refactor: apply stashed bridge + CLI changes

This commit is contained in:
Peter Steinberger
2025-12-13 19:30:46 +00:00
parent 0b990443de
commit e2a93e17f9
23 changed files with 1337 additions and 1097 deletions

View File

@@ -69,11 +69,13 @@ struct CronSettings: View {
.font(.headline)
Spacer()
}
Text(
"Jobs are saved, but they will not run automatically until `cron.enabled` is set to `true` and the Gateway restarts.")
.font(.footnote)
.foregroundStyle(.secondary)
.fixedSize(horizontal: false, vertical: true)
Text(
"Jobs are saved, but they will not run automatically until `cron.enabled` is set to `true` " +
"and the Gateway restarts."
)
.font(.footnote)
.foregroundStyle(.secondary)
.fixedSize(horizontal: false, vertical: true)
if let storePath = self.store.schedulerStorePath, !storePath.isEmpty {
Text(storePath)
.font(.caption.monospaced())
@@ -526,7 +528,8 @@ private struct CronJobEditor: View {
Text(self.job == nil ? "New cron job" : "Edit cron job")
.font(.title3.weight(.semibold))
Text(
"Create a schedule that wakes clawd via the Gateway. Use an isolated session for agent turns so your main chat stays clean.")
"Create a schedule that wakes clawd via the Gateway. Use an isolated session for agent turns so your main chat stays clean."
)
.font(.callout)
.foregroundStyle(.secondary)
.fixedSize(horizontal: false, vertical: true)
@@ -572,7 +575,8 @@ private struct CronJobEditor: View {
Color.clear
.frame(width: self.labelColumnWidth, height: 1)
Text(
"Main jobs post a system event into the current main session. Isolated jobs run clawd in a dedicated session and can deliver results (WhatsApp/Telegram/etc).")
"Main jobs post a system event into the current main session. Isolated jobs run clawd in a dedicated session and can deliver results (WhatsApp/Telegram/etc)."
)
.font(.footnote)
.foregroundStyle(.secondary)
.frame(maxWidth: .infinity, alignment: .leading)
@@ -597,7 +601,8 @@ private struct CronJobEditor: View {
Color.clear
.frame(width: self.labelColumnWidth, height: 1)
Text(
"“At” runs once, “Every” repeats with a duration, “Cron” uses a 5-field Unix expression.")
"“At” runs once, “Every” repeats with a duration, “Cron” uses a 5-field Unix expression."
)
.font(.footnote)
.foregroundStyle(.secondary)
.frame(maxWidth: .infinity, alignment: .leading)
@@ -642,7 +647,8 @@ private struct CronJobEditor: View {
VStack(alignment: .leading, spacing: 10) {
if self.sessionTarget == .isolated {
Text(
"Isolated jobs always run an agent turn. The result can be delivered to a surface, and a short summary is posted back to your main chat.")
"Isolated jobs always run an agent turn. The result can be delivered to a surface, and a short summary is posted back to your main chat."
)
.font(.footnote)
.foregroundStyle(.secondary)
.fixedSize(horizontal: false, vertical: true)
@@ -663,7 +669,8 @@ private struct CronJobEditor: View {
Color.clear
.frame(width: self.labelColumnWidth, height: 1)
Text(
"System events are injected into the current main session. Agent turns require an isolated session target.")
"System events are injected into the current main session. Agent turns require an isolated session target."
)
.font(.footnote)
.foregroundStyle(.secondary)
.frame(maxWidth: .infinity, alignment: .leading)
@@ -696,7 +703,8 @@ private struct CronJobEditor: View {
Color.clear
.frame(width: self.labelColumnWidth, height: 1)
Text(
"Controls the label used when posting the completion summary back to the main session.")
"Controls the label used when posting the completion summary back to the main session."
)
.font(.footnote)
.foregroundStyle(.secondary)
.frame(maxWidth: .infinity, alignment: .leading)
@@ -906,13 +914,14 @@ private struct CronJobEditor: View {
}()
if self.sessionTarget == .main, payload["kind"] as? String == "agentTurn" {
throw NSError(
domain: "Cron",
code: 0,
userInfo: [
NSLocalizedDescriptionKey: "Main session jobs require systemEvent payloads (switch Session target to isolated).",
])
}
throw NSError(
domain: "Cron",
code: 0,
userInfo: [
NSLocalizedDescriptionKey:
"Main session jobs require systemEvent payloads (switch Session target to isolated).",
])
}
if self.sessionTarget == .isolated, payload["kind"] as? String == "systemEvent" {
throw NSError(