@otto-code/protocol 0.5.0 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-attention-notification.js +60 -12
- package/dist/agent-personalities.d.ts +2 -1
- package/dist/agent-personalities.js +17 -2
- package/dist/agent-teams.d.ts +49 -0
- package/dist/agent-teams.js +99 -0
- package/dist/agent-types.d.ts +20 -0
- package/dist/browser-automation/rpc-schemas.d.ts +3 -3
- package/dist/default-personalities.d.ts +2 -1
- package/dist/default-personalities.js +31 -8
- package/dist/generated/validation/ws-outbound.aot.js +11574 -10714
- package/dist/messages.d.ts +971 -27
- package/dist/messages.js +298 -4
- package/dist/model-tiers.d.ts +34 -0
- package/dist/model-tiers.js +92 -0
- package/dist/provider-manifest.js +11 -0
- package/dist/schedule/rpc-schemas.d.ts +5 -4
- package/dist/schedule/rpc-schemas.js +3 -0
- package/dist/schedule/types.d.ts +1 -1
- package/dist/validation/ws-outbound-schema-metadata.d.ts +151 -4
- package/package.json +1 -1
package/dist/messages.js
CHANGED
|
@@ -133,13 +133,17 @@ export const MutableGitHostingConfigSchema = z
|
|
|
133
133
|
.passthrough();
|
|
134
134
|
// Canonical personality roles, in display order. Kept as an exported const so
|
|
135
135
|
// the daemon and app share one vocabulary, but the wire schema stores roles as
|
|
136
|
-
// plain strings (below) — adding
|
|
137
|
-
//
|
|
136
|
+
// plain strings (below) — adding a role later must never break an older peer's
|
|
137
|
+
// parsing. Consumers filter incoming role arrays to this known set. The retired
|
|
138
|
+
// "worker" role is mapped to "coder" on the way in (see LEGACY_ROLE_ALIASES in
|
|
139
|
+
// agent-personalities.ts) so personalities persisted before the split keep their
|
|
140
|
+
// role rather than silently losing it.
|
|
138
141
|
export const PERSONALITY_ROLES = [
|
|
139
142
|
"chatter",
|
|
140
143
|
"artificer",
|
|
141
144
|
"scheduler",
|
|
142
|
-
"
|
|
145
|
+
"writer",
|
|
146
|
+
"coder",
|
|
143
147
|
"judger",
|
|
144
148
|
"advisor",
|
|
145
149
|
"orchestrator",
|
|
@@ -194,6 +198,75 @@ const MutableAgentPersonalitiesConfigSchema = z
|
|
|
194
198
|
personalities: z.array(AgentPersonalitySchema).default([]),
|
|
195
199
|
})
|
|
196
200
|
.passthrough();
|
|
201
|
+
// Patch shape declared explicitly rather than via .partial(): partial() keeps
|
|
202
|
+
// the personalities .default([]), so a patch touching the section without an
|
|
203
|
+
// explicit personalities array would have an empty array injected and
|
|
204
|
+
// deep-merge would wipe the stored roster.
|
|
205
|
+
const MutableAgentPersonalitiesConfigPatchSchema = z
|
|
206
|
+
.object({
|
|
207
|
+
personalities: z.array(AgentPersonalitySchema).optional(),
|
|
208
|
+
})
|
|
209
|
+
.passthrough();
|
|
210
|
+
// A team's avatar. v1 ships only `color` (hex, validated at the editor like
|
|
211
|
+
// spinner colors); `imageId` is reserved for the future themed avatar set —
|
|
212
|
+
// when present it wins over color, and color stays the fallback so an old
|
|
213
|
+
// client that doesn't know `imageId` keeps rendering the swatch. Plain
|
|
214
|
+
// strings for forward compat.
|
|
215
|
+
const AgentTeamAvatarSchema = z
|
|
216
|
+
.object({
|
|
217
|
+
color: z.string().min(1).optional(),
|
|
218
|
+
imageId: z.string().min(1).optional(),
|
|
219
|
+
})
|
|
220
|
+
.passthrough();
|
|
221
|
+
// A named, per-host grouping of agent personalities that acts as an operating
|
|
222
|
+
// template: which personalities are on deck, plus a shared team prompt stacked
|
|
223
|
+
// directly ahead of the member's personality prompt at spawn. `id` is the
|
|
224
|
+
// stable identity everything binds to; `name` is a freely-renamable label.
|
|
225
|
+
// `memberIds` bind personality ids (order = display order) — an entry pointing
|
|
226
|
+
// at a deleted personality is tolerated and ignored everywhere, then pruned on
|
|
227
|
+
// the next save of that team. Membership is many-to-many.
|
|
228
|
+
export const AgentTeamSchema = z
|
|
229
|
+
.object({
|
|
230
|
+
id: z.string().min(1),
|
|
231
|
+
name: z.string().min(1),
|
|
232
|
+
avatar: AgentTeamAvatarSchema.optional(),
|
|
233
|
+
teamPrompt: z.string().optional(),
|
|
234
|
+
memberIds: z.array(z.string().min(1)).optional(),
|
|
235
|
+
})
|
|
236
|
+
.passthrough();
|
|
237
|
+
const MutableAgentTeamsConfigSchema = z
|
|
238
|
+
.object({
|
|
239
|
+
teams: z.array(AgentTeamSchema).default([]),
|
|
240
|
+
// The host's active team id; null/absent = no team active (exactly legacy
|
|
241
|
+
// behavior). Host-scoped daemon config rather than device-local: the team
|
|
242
|
+
// prompt is applied daemon-side at spawn, so headless spawns (MCP
|
|
243
|
+
// create_agent, schedule runs) must see it, and a patch from any client
|
|
244
|
+
// hot-reloads the switch to every connected client.
|
|
245
|
+
activeTeamId: z.string().nullable().optional(),
|
|
246
|
+
})
|
|
247
|
+
.passthrough();
|
|
248
|
+
// Patch shape declared explicitly rather than via .partial(): partial() keeps
|
|
249
|
+
// the teams .default([]), so a patch that only touches activeTeamId would have
|
|
250
|
+
// an empty array injected and deep-merge would wipe the stored teams.
|
|
251
|
+
const MutableAgentTeamsConfigPatchSchema = z
|
|
252
|
+
.object({
|
|
253
|
+
teams: z.array(AgentTeamSchema).optional(),
|
|
254
|
+
activeTeamId: z.string().nullable().optional(),
|
|
255
|
+
})
|
|
256
|
+
.passthrough();
|
|
257
|
+
export const ModelTierSchema = z.enum(["deep", "standard", "fast"]);
|
|
258
|
+
// A user's explicit tier tag for one model of one provider. The daemon stamps
|
|
259
|
+
// `model.tier` at ingest, preferring a matching override here over inference
|
|
260
|
+
// (see model-tiers.ts). Stored as an array (not a nested record) so a patch
|
|
261
|
+
// replaces it wholesale — that's how a tag gets cleared, since deep-merge can't
|
|
262
|
+
// delete a record key.
|
|
263
|
+
export const ModelTierOverrideSchema = z
|
|
264
|
+
.object({
|
|
265
|
+
provider: z.string().min(1),
|
|
266
|
+
modelId: z.string().min(1),
|
|
267
|
+
tier: ModelTierSchema,
|
|
268
|
+
})
|
|
269
|
+
.passthrough();
|
|
197
270
|
export const MutableDaemonConfigSchema = z
|
|
198
271
|
.object({
|
|
199
272
|
mcp: z
|
|
@@ -216,6 +289,14 @@ export const MutableDaemonConfigSchema = z
|
|
|
216
289
|
// feature; defaults to an empty roster so a new client parsing an old
|
|
217
290
|
// daemon's config still sees a well-formed section.
|
|
218
291
|
agentPersonalities: MutableAgentPersonalitiesConfigSchema.default({ personalities: [] }),
|
|
292
|
+
// Per-host agent teams + the active team id. Gated by the agentTeams
|
|
293
|
+
// feature; defaults to an empty section so a new client parsing an old
|
|
294
|
+
// daemon's config still sees a well-formed shape.
|
|
295
|
+
agentTeams: MutableAgentTeamsConfigSchema.default({ teams: [] }),
|
|
296
|
+
// Per-host user overrides of model tiers, keyed by provider + model id.
|
|
297
|
+
// Gated by the modelTierOverrides feature; defaults empty so a new client
|
|
298
|
+
// parsing an old daemon's config still sees a well-formed array.
|
|
299
|
+
modelTierOverrides: z.array(ModelTierOverrideSchema).default([]),
|
|
219
300
|
})
|
|
220
301
|
.passthrough();
|
|
221
302
|
export const MutableDaemonConfigPatchSchema = z
|
|
@@ -241,7 +322,14 @@ export const MutableDaemonConfigPatchSchema = z
|
|
|
241
322
|
// Gated by server_info features.agentPersonalities. A patch replaces the
|
|
242
323
|
// full roster (read-modify-write the array), matching how terminalProfiles
|
|
243
324
|
// and metadataGeneration.providers patch.
|
|
244
|
-
agentPersonalities:
|
|
325
|
+
agentPersonalities: MutableAgentPersonalitiesConfigPatchSchema.optional(),
|
|
326
|
+
// Gated by server_info features.agentTeams. A `teams` patch replaces the
|
|
327
|
+
// full array (read-modify-write), matching agentPersonalities;
|
|
328
|
+
// `activeTeamId: null` deactivates the team without touching the array.
|
|
329
|
+
agentTeams: MutableAgentTeamsConfigPatchSchema.optional(),
|
|
330
|
+
// Gated by server_info features.modelTierOverrides. Replaces the full array
|
|
331
|
+
// (read-modify-write), so removing an entry clears that model's tag.
|
|
332
|
+
modelTierOverrides: z.array(ModelTierOverrideSchema).optional(),
|
|
245
333
|
})
|
|
246
334
|
.partial()
|
|
247
335
|
.passthrough();
|
|
@@ -304,6 +392,12 @@ const AgentModelDefinitionSchema = z.object({
|
|
|
304
392
|
contextWindowMaxTokens: z.number().optional(),
|
|
305
393
|
thinkingOptions: z.array(AgentSelectOptionSchema).optional(),
|
|
306
394
|
defaultThinkingOptionId: z.string().optional(),
|
|
395
|
+
// Daemon-stamped capability tier (deep/standard/fast). Optional: absent on old
|
|
396
|
+
// daemons and on models neither classified nor user-tagged.
|
|
397
|
+
tier: ModelTierSchema.optional(),
|
|
398
|
+
// False when the model can't run the provider's "auto" permission mode.
|
|
399
|
+
// Optional: absent on old daemons and when supported/unknown.
|
|
400
|
+
supportsAutoMode: z.boolean().optional(),
|
|
307
401
|
});
|
|
308
402
|
export const ProviderSnapshotEntrySchema = z.object({
|
|
309
403
|
provider: AgentProviderSchema,
|
|
@@ -689,6 +783,13 @@ export const AgentSnapshotPayloadSchema = z.object({
|
|
|
689
783
|
persistence: AgentPersistenceHandleSchema.nullable(),
|
|
690
784
|
runtimeInfo: AgentRuntimeInfoSchema.optional(),
|
|
691
785
|
lastUsage: AgentUsageSchema.optional(),
|
|
786
|
+
// Honest cumulative token total (Σ across the whole run) from the provider,
|
|
787
|
+
// for the subagents-track cost readout — the only currency that works for
|
|
788
|
+
// cost-less local models. Observed subagents source it from the provider's
|
|
789
|
+
// per-task usage.total_tokens (already cumulative-per-subagent). Purely
|
|
790
|
+
// additive; absent ⇒ no readout. Old clients ignore it.
|
|
791
|
+
// See projects/subagents-cleanup/subagents-cleanup.md (Item 3).
|
|
792
|
+
cumulativeTokens: z.number().optional(),
|
|
692
793
|
lastError: z.string().optional(),
|
|
693
794
|
title: z.string().nullable(),
|
|
694
795
|
labels: z.record(z.string(), z.string()).default({}),
|
|
@@ -1483,6 +1584,78 @@ export const CheckoutCommitRequestSchema = z.object({
|
|
|
1483
1584
|
addAll: z.boolean().optional(),
|
|
1484
1585
|
requestId: z.string(),
|
|
1485
1586
|
});
|
|
1587
|
+
// One entry in a git operation log (the "Git Commit"/"Git Push" log panes).
|
|
1588
|
+
// `seq` is a per-(cwd, operation) monotonic counter used for client-side
|
|
1589
|
+
// dedup between backfill and live pushes.
|
|
1590
|
+
export const GitOperationLogEntrySchema = z.object({
|
|
1591
|
+
seq: z.number(),
|
|
1592
|
+
timestamp: z.string(),
|
|
1593
|
+
level: z.enum(["info", "output", "error"]),
|
|
1594
|
+
text: z.string(),
|
|
1595
|
+
});
|
|
1596
|
+
// Backfill for a git operation log pane. `operation` is an open string on the
|
|
1597
|
+
// wire ("commit" | "pull" | "push" today) so newly watchable operations don't
|
|
1598
|
+
// break old peers. Gated by server_info.features.checkoutGitLog.
|
|
1599
|
+
export const CheckoutGitGetOperationLogRequestSchema = z.object({
|
|
1600
|
+
type: z.literal("checkout.git.get_operation_log.request"),
|
|
1601
|
+
cwd: z.string(),
|
|
1602
|
+
operation: z.string(),
|
|
1603
|
+
requestId: z.string(),
|
|
1604
|
+
});
|
|
1605
|
+
export const CheckoutGitGetOperationLogResponseSchema = z.object({
|
|
1606
|
+
type: z.literal("checkout.git.get_operation_log.response"),
|
|
1607
|
+
payload: z.object({
|
|
1608
|
+
cwd: z.string(),
|
|
1609
|
+
operation: z.string(),
|
|
1610
|
+
entries: z.array(GitOperationLogEntrySchema),
|
|
1611
|
+
requestId: z.string(),
|
|
1612
|
+
}),
|
|
1613
|
+
});
|
|
1614
|
+
// Live append notification, broadcast to connected clients while a watched git
|
|
1615
|
+
// operation runs. Carries only the appended entries; `seq` orders them against
|
|
1616
|
+
// the backfill.
|
|
1617
|
+
export const CheckoutGitLogAppendedNotificationSchema = z.object({
|
|
1618
|
+
type: z.literal("checkout.git.log_appended.notification"),
|
|
1619
|
+
payload: z.object({
|
|
1620
|
+
cwd: z.string(),
|
|
1621
|
+
operation: z.string(),
|
|
1622
|
+
entries: z.array(GitOperationLogEntrySchema),
|
|
1623
|
+
}),
|
|
1624
|
+
});
|
|
1625
|
+
// Namespaced successor to checkout_commit_request: per-file selection and
|
|
1626
|
+
// structured errors. Gated by server_info.features.checkoutGitCommit; the flat
|
|
1627
|
+
// RPC stays accepted for old clients.
|
|
1628
|
+
export const CheckoutGitCommitRequestSchema = z.object({
|
|
1629
|
+
type: z.literal("checkout.git.commit.request"),
|
|
1630
|
+
cwd: z.string(),
|
|
1631
|
+
message: z.string(),
|
|
1632
|
+
// Repo-relative paths to stage and commit. Only these paths land in the
|
|
1633
|
+
// commit, even if other changes are already staged.
|
|
1634
|
+
paths: z.array(z.string()),
|
|
1635
|
+
// Set after the user confirms committing while agents are running in this
|
|
1636
|
+
// workspace; without it the daemon refuses with kind "agents_running".
|
|
1637
|
+
allowWithRunningAgents: z.boolean().optional(),
|
|
1638
|
+
requestId: z.string(),
|
|
1639
|
+
});
|
|
1640
|
+
// Resolve which agent the daemon would use to author a commit message for this
|
|
1641
|
+
// checkout (the "writer" role) so the client can name it in a confirmation
|
|
1642
|
+
// before running the AI-authored commit. A pure query — it never commits. Gated
|
|
1643
|
+
// by server_info.features.checkoutGitCommitAgent.
|
|
1644
|
+
export const CheckoutGitCommitAgentRequestSchema = z.object({
|
|
1645
|
+
type: z.literal("checkout.git.commit_agent.request"),
|
|
1646
|
+
cwd: z.string(),
|
|
1647
|
+
requestId: z.string(),
|
|
1648
|
+
});
|
|
1649
|
+
// Discard uncommitted working-tree changes for specific repo-relative paths
|
|
1650
|
+
// (restore tracked files from HEAD, delete newly-added files). Gated by
|
|
1651
|
+
// server_info.features.checkoutGitRollback.
|
|
1652
|
+
export const CheckoutGitRollbackRequestSchema = z.object({
|
|
1653
|
+
type: z.literal("checkout.git.rollback.request"),
|
|
1654
|
+
cwd: z.string(),
|
|
1655
|
+
// Repo-relative paths whose uncommitted changes should be discarded.
|
|
1656
|
+
paths: z.array(z.string()),
|
|
1657
|
+
requestId: z.string(),
|
|
1658
|
+
});
|
|
1486
1659
|
export const CheckoutMergeRequestSchema = z.object({
|
|
1487
1660
|
type: z.literal("checkout_merge_request"),
|
|
1488
1661
|
cwd: z.string(),
|
|
@@ -2170,6 +2343,10 @@ export const SessionInboundMessageSchema = z.discriminatedUnion("type", [
|
|
|
2170
2343
|
SubscribeCheckoutDiffRequestSchema,
|
|
2171
2344
|
UnsubscribeCheckoutDiffRequestSchema,
|
|
2172
2345
|
CheckoutCommitRequestSchema,
|
|
2346
|
+
CheckoutGitCommitRequestSchema,
|
|
2347
|
+
CheckoutGitCommitAgentRequestSchema,
|
|
2348
|
+
CheckoutGitRollbackRequestSchema,
|
|
2349
|
+
CheckoutGitGetOperationLogRequestSchema,
|
|
2173
2350
|
CheckoutMergeRequestSchema,
|
|
2174
2351
|
CheckoutMergeFromBaseRequestSchema,
|
|
2175
2352
|
CheckoutPullRequestSchema,
|
|
@@ -2464,6 +2641,18 @@ export const ServerInfoStatusPayloadSchema = z
|
|
|
2464
2641
|
ttsPreview: z.boolean().optional(),
|
|
2465
2642
|
// COMPAT(setAgentPersonality): added in v0.5.0, drop the gate when daemon floor >= v0.5.0.
|
|
2466
2643
|
setAgentPersonality: z.boolean().optional(),
|
|
2644
|
+
// COMPAT(checkoutGitCommit): added in v0.5.1, drop the gate when daemon floor >= v0.5.1.
|
|
2645
|
+
checkoutGitCommit: z.boolean().optional(),
|
|
2646
|
+
// COMPAT(checkoutGitCommitAgent): added in v0.5.1, drop the gate when daemon floor >= v0.5.1.
|
|
2647
|
+
checkoutGitCommitAgent: z.boolean().optional(),
|
|
2648
|
+
// COMPAT(checkoutGitRollback): added in v0.5.1, drop the gate when daemon floor >= v0.5.1.
|
|
2649
|
+
checkoutGitRollback: z.boolean().optional(),
|
|
2650
|
+
// COMPAT(checkoutGitLog): added in v0.5.1, drop the gate when daemon floor >= v0.5.1.
|
|
2651
|
+
checkoutGitLog: z.boolean().optional(),
|
|
2652
|
+
// COMPAT(agentTeams): added in v0.5.2, drop the gate when daemon floor >= v0.5.2.
|
|
2653
|
+
agentTeams: z.boolean().optional(),
|
|
2654
|
+
// COMPAT(modelTierOverrides): added in v0.5.2, drop the gate when daemon floor >= v0.5.2.
|
|
2655
|
+
modelTierOverrides: z.boolean().optional(),
|
|
2467
2656
|
})
|
|
2468
2657
|
.optional(),
|
|
2469
2658
|
})
|
|
@@ -3021,6 +3210,11 @@ export const CancelAgentResponseMessageSchema = z.object({
|
|
|
3021
3210
|
requestId: z.string(),
|
|
3022
3211
|
agentId: z.string(),
|
|
3023
3212
|
agent: AgentSnapshotPayloadSchema.nullable(),
|
|
3213
|
+
// Whether an in-flight run was actually interrupted. False when the agent
|
|
3214
|
+
// had nothing running (already finished, still initializing), so clients
|
|
3215
|
+
// can say "nothing to stop" instead of silently no-oping. Purely additive;
|
|
3216
|
+
// absent ⇒ unknown (old daemon). See projects/subagents-cleanup/subagents-cleanup.md (Item 2).
|
|
3217
|
+
cancelled: z.boolean().optional(),
|
|
3024
3218
|
}),
|
|
3025
3219
|
});
|
|
3026
3220
|
export const ClearAgentAttentionResponseMessageSchema = z.object({
|
|
@@ -3495,6 +3689,101 @@ export const CheckoutCommitResponseSchema = z.object({
|
|
|
3495
3689
|
requestId: z.string(),
|
|
3496
3690
|
}),
|
|
3497
3691
|
});
|
|
3692
|
+
const CheckoutGitCommitRunningAgentSchema = z.object({
|
|
3693
|
+
id: z.string(),
|
|
3694
|
+
title: z.string().nullable(),
|
|
3695
|
+
});
|
|
3696
|
+
export const CheckoutGitCommitErrorSchema = z.discriminatedUnion("kind", [
|
|
3697
|
+
z.object({
|
|
3698
|
+
kind: z.literal("agents_running"),
|
|
3699
|
+
agents: z.array(CheckoutGitCommitRunningAgentSchema),
|
|
3700
|
+
}),
|
|
3701
|
+
z.object({
|
|
3702
|
+
kind: z.literal("identity_missing"),
|
|
3703
|
+
missingName: z.boolean(),
|
|
3704
|
+
missingEmail: z.boolean(),
|
|
3705
|
+
}),
|
|
3706
|
+
z.object({
|
|
3707
|
+
kind: z.literal("hook_failed"),
|
|
3708
|
+
output: z.string(),
|
|
3709
|
+
exitCode: z.number().nullable(),
|
|
3710
|
+
}),
|
|
3711
|
+
z.object({
|
|
3712
|
+
kind: z.literal("signing_failed"),
|
|
3713
|
+
detail: z.string(),
|
|
3714
|
+
}),
|
|
3715
|
+
z.object({
|
|
3716
|
+
kind: z.literal("nothing_to_commit"),
|
|
3717
|
+
}),
|
|
3718
|
+
z.object({
|
|
3719
|
+
kind: z.literal("git_failed"),
|
|
3720
|
+
detail: z.string(),
|
|
3721
|
+
}),
|
|
3722
|
+
]);
|
|
3723
|
+
export const CheckoutGitCommitResponseSchema = z.object({
|
|
3724
|
+
type: z.literal("checkout.git.commit.response"),
|
|
3725
|
+
payload: z.object({
|
|
3726
|
+
cwd: z.string(),
|
|
3727
|
+
success: z.boolean(),
|
|
3728
|
+
commitSha: z.string().nullable(),
|
|
3729
|
+
error: CheckoutGitCommitErrorSchema.nullable(),
|
|
3730
|
+
requestId: z.string(),
|
|
3731
|
+
}),
|
|
3732
|
+
});
|
|
3733
|
+
// The agent the daemon resolved to author a commit message. "personality" when
|
|
3734
|
+
// an available role-matched Agent Personality wins the mini-task routing (its
|
|
3735
|
+
// name plus the bound provider/model); "provider" when a bare provider/model is
|
|
3736
|
+
// used instead; "none" when nothing is configured to run the task, in which case
|
|
3737
|
+
// the client refuses the AI commit rather than falling back to placeholder text.
|
|
3738
|
+
export const CommitMessageAgentSchema = z.discriminatedUnion("kind", [
|
|
3739
|
+
z.object({
|
|
3740
|
+
kind: z.literal("personality"),
|
|
3741
|
+
personalityId: z.string(),
|
|
3742
|
+
personalityName: z.string(),
|
|
3743
|
+
provider: z.string(),
|
|
3744
|
+
providerLabel: z.string(),
|
|
3745
|
+
model: z.string().nullable(),
|
|
3746
|
+
modelLabel: z.string().nullable(),
|
|
3747
|
+
}),
|
|
3748
|
+
z.object({
|
|
3749
|
+
kind: z.literal("provider"),
|
|
3750
|
+
provider: z.string(),
|
|
3751
|
+
providerLabel: z.string(),
|
|
3752
|
+
model: z.string().nullable(),
|
|
3753
|
+
modelLabel: z.string().nullable(),
|
|
3754
|
+
}),
|
|
3755
|
+
z.object({
|
|
3756
|
+
kind: z.literal("none"),
|
|
3757
|
+
}),
|
|
3758
|
+
]);
|
|
3759
|
+
export const CheckoutGitCommitAgentResponseSchema = z.object({
|
|
3760
|
+
type: z.literal("checkout.git.commit_agent.response"),
|
|
3761
|
+
payload: z.object({
|
|
3762
|
+
cwd: z.string(),
|
|
3763
|
+
agent: CommitMessageAgentSchema,
|
|
3764
|
+
requestId: z.string(),
|
|
3765
|
+
}),
|
|
3766
|
+
});
|
|
3767
|
+
export const CheckoutGitRollbackErrorSchema = z.discriminatedUnion("kind", [
|
|
3768
|
+
z.object({
|
|
3769
|
+
kind: z.literal("nothing_to_rollback"),
|
|
3770
|
+
}),
|
|
3771
|
+
z.object({
|
|
3772
|
+
kind: z.literal("git_failed"),
|
|
3773
|
+
detail: z.string(),
|
|
3774
|
+
}),
|
|
3775
|
+
]);
|
|
3776
|
+
export const CheckoutGitRollbackResponseSchema = z.object({
|
|
3777
|
+
type: z.literal("checkout.git.rollback.response"),
|
|
3778
|
+
payload: z.object({
|
|
3779
|
+
cwd: z.string(),
|
|
3780
|
+
success: z.boolean(),
|
|
3781
|
+
// Repo-relative paths whose changes were discarded.
|
|
3782
|
+
rolledBackPaths: z.array(z.string()),
|
|
3783
|
+
error: CheckoutGitRollbackErrorSchema.nullable(),
|
|
3784
|
+
requestId: z.string(),
|
|
3785
|
+
}),
|
|
3786
|
+
});
|
|
3498
3787
|
export const CheckoutMergeResponseSchema = z.object({
|
|
3499
3788
|
type: z.literal("checkout_merge_response"),
|
|
3500
3789
|
payload: z.object({
|
|
@@ -4535,6 +4824,11 @@ export const SessionOutboundMessageSchema = z.discriminatedUnion("type", [
|
|
|
4535
4824
|
SubscribeCheckoutDiffResponseSchema,
|
|
4536
4825
|
CheckoutDiffUpdateSchema,
|
|
4537
4826
|
CheckoutCommitResponseSchema,
|
|
4827
|
+
CheckoutGitCommitResponseSchema,
|
|
4828
|
+
CheckoutGitCommitAgentResponseSchema,
|
|
4829
|
+
CheckoutGitRollbackResponseSchema,
|
|
4830
|
+
CheckoutGitGetOperationLogResponseSchema,
|
|
4831
|
+
CheckoutGitLogAppendedNotificationSchema,
|
|
4538
4832
|
CheckoutMergeResponseSchema,
|
|
4539
4833
|
CheckoutMergeFromBaseResponseSchema,
|
|
4540
4834
|
CheckoutPullResponseSchema,
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Model → tier classification, shared by the daemon (stamps `model.tier` at
|
|
3
|
+
* ingest) and the app (reads `model.tier`). Pure and dependency-free — no zod,
|
|
4
|
+
* no I/O.
|
|
5
|
+
*
|
|
6
|
+
* Deliberately NO name-pattern guessing: the official model ids are public
|
|
7
|
+
* record, so we classify what we KNOW (the shipped catalog) and leave everything
|
|
8
|
+
* else `undefined` = "Unknown". Size-in-the-name heuristics are unreliable
|
|
9
|
+
* (a Qwen-32B coder ≠ a Qwen-32B instruct), so we don't pretend — the user tags
|
|
10
|
+
* an Unknown model with an override and that's it.
|
|
11
|
+
*
|
|
12
|
+
* Resolution order for a single model:
|
|
13
|
+
* 1. user override (a per-model tag persisted in host config),
|
|
14
|
+
* 2. the shipped catalog of known models,
|
|
15
|
+
* else undefined ("Unknown"). At generation the consumer's context-window
|
|
16
|
+
* heuristic still fills a slot so a team can bind, but that's a last resort, not
|
|
17
|
+
* a claim about the model's tier.
|
|
18
|
+
*/
|
|
19
|
+
import type { AgentModelDefinition, ModelTier } from "./agent-types.js";
|
|
20
|
+
export declare const KNOWN_MODEL_TIERS: Readonly<Record<string, ModelTier>>;
|
|
21
|
+
export declare function catalogTier(modelId: string): ModelTier | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Infer a model's tier from the shipped catalog alone (no guessing). Undefined
|
|
24
|
+
* for models we don't ship an id for — those read as "Unknown" until the user
|
|
25
|
+
* tags one.
|
|
26
|
+
*/
|
|
27
|
+
export declare function inferModelTier(model: Pick<AgentModelDefinition, "id">): ModelTier | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* The tier to stamp on a model at ingest: an explicit user override wins,
|
|
30
|
+
* otherwise the catalog. Undefined ("Unknown") leaves the model tier-less until
|
|
31
|
+
* the user tags it; the consumer's generation heuristic still binds a slot.
|
|
32
|
+
*/
|
|
33
|
+
export declare function resolveModelTier(model: Pick<AgentModelDefinition, "id">, override: ModelTier | undefined): ModelTier | undefined;
|
|
34
|
+
//# sourceMappingURL=model-tiers.d.ts.map
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Model → tier classification, shared by the daemon (stamps `model.tier` at
|
|
3
|
+
* ingest) and the app (reads `model.tier`). Pure and dependency-free — no zod,
|
|
4
|
+
* no I/O.
|
|
5
|
+
*
|
|
6
|
+
* Deliberately NO name-pattern guessing: the official model ids are public
|
|
7
|
+
* record, so we classify what we KNOW (the shipped catalog) and leave everything
|
|
8
|
+
* else `undefined` = "Unknown". Size-in-the-name heuristics are unreliable
|
|
9
|
+
* (a Qwen-32B coder ≠ a Qwen-32B instruct), so we don't pretend — the user tags
|
|
10
|
+
* an Unknown model with an override and that's it.
|
|
11
|
+
*
|
|
12
|
+
* Resolution order for a single model:
|
|
13
|
+
* 1. user override (a per-model tag persisted in host config),
|
|
14
|
+
* 2. the shipped catalog of known models,
|
|
15
|
+
* else undefined ("Unknown"). At generation the consumer's context-window
|
|
16
|
+
* heuristic still fills a slot so a team can bind, but that's a last resort, not
|
|
17
|
+
* a claim about the model's tier.
|
|
18
|
+
*/
|
|
19
|
+
// Shipped catalog of known, official model ids (public record). Matched
|
|
20
|
+
// case-insensitively against the exact model id; decorated ids that miss here
|
|
21
|
+
// fall through to patterns.
|
|
22
|
+
export const KNOWN_MODEL_TIERS = {
|
|
23
|
+
// Anthropic (Claude) — the full Claude Code manifest. Tiering rule: 1M-context
|
|
24
|
+
// Opus variants are "deep", non-1M Opus and Sonnet are "standard", Haiku is
|
|
25
|
+
// "fast". Fable (1M, most powerful) is "deep".
|
|
26
|
+
"claude-fable-5": "deep",
|
|
27
|
+
"claude-opus-4-8[1m]": "deep",
|
|
28
|
+
"claude-opus-4-8": "standard",
|
|
29
|
+
"claude-opus-4-7[1m]": "deep",
|
|
30
|
+
"claude-opus-4-7": "standard",
|
|
31
|
+
"claude-opus-4-6[1m]": "deep",
|
|
32
|
+
"claude-opus-4-6": "standard",
|
|
33
|
+
"claude-sonnet-5": "standard",
|
|
34
|
+
"claude-sonnet-4-6[1m]": "standard",
|
|
35
|
+
"claude-sonnet-4-6": "standard",
|
|
36
|
+
"claude-haiku-4-5": "fast",
|
|
37
|
+
"claude-haiku-4-5-20251001": "fast",
|
|
38
|
+
// OpenAI (GPT / o-series)
|
|
39
|
+
"gpt-5": "deep",
|
|
40
|
+
"gpt-5-mini": "fast",
|
|
41
|
+
"gpt-5-nano": "fast",
|
|
42
|
+
o3: "deep",
|
|
43
|
+
"o3-mini": "fast",
|
|
44
|
+
"o4-mini": "fast",
|
|
45
|
+
"gpt-4.1": "standard",
|
|
46
|
+
"gpt-4.1-mini": "fast",
|
|
47
|
+
"gpt-4o": "standard",
|
|
48
|
+
"gpt-4o-mini": "fast",
|
|
49
|
+
// Google (Gemini)
|
|
50
|
+
"gemini-2.5-pro": "deep",
|
|
51
|
+
"gemini-2.5-flash": "fast",
|
|
52
|
+
"gemini-2.5-flash-lite": "fast",
|
|
53
|
+
"gemini-2.0-flash": "fast",
|
|
54
|
+
// DeepSeek
|
|
55
|
+
"deepseek-r1": "deep",
|
|
56
|
+
"deepseek-v3": "deep",
|
|
57
|
+
"deepseek-chat": "standard",
|
|
58
|
+
"deepseek-reasoner": "deep",
|
|
59
|
+
// Alibaba (Qwen) hosted tiers
|
|
60
|
+
"qwen-max": "deep",
|
|
61
|
+
"qwen-plus": "standard",
|
|
62
|
+
"qwen-turbo": "fast",
|
|
63
|
+
// xAI (Grok)
|
|
64
|
+
"grok-4": "deep",
|
|
65
|
+
"grok-3": "deep",
|
|
66
|
+
"grok-3-mini": "fast",
|
|
67
|
+
// Mistral
|
|
68
|
+
"mistral-large-latest": "deep",
|
|
69
|
+
"mistral-large": "deep",
|
|
70
|
+
"mistral-medium": "standard",
|
|
71
|
+
"mistral-small": "fast",
|
|
72
|
+
};
|
|
73
|
+
export function catalogTier(modelId) {
|
|
74
|
+
return KNOWN_MODEL_TIERS[modelId.toLowerCase()];
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Infer a model's tier from the shipped catalog alone (no guessing). Undefined
|
|
78
|
+
* for models we don't ship an id for — those read as "Unknown" until the user
|
|
79
|
+
* tags one.
|
|
80
|
+
*/
|
|
81
|
+
export function inferModelTier(model) {
|
|
82
|
+
return catalogTier(model.id);
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* The tier to stamp on a model at ingest: an explicit user override wins,
|
|
86
|
+
* otherwise the catalog. Undefined ("Unknown") leaves the model tier-less until
|
|
87
|
+
* the user tags it; the consumer's generation heuristic still binds a slot.
|
|
88
|
+
*/
|
|
89
|
+
export function resolveModelTier(model, override) {
|
|
90
|
+
return override ?? inferModelTier(model);
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=model-tiers.js.map
|
|
@@ -28,6 +28,17 @@ const CLAUDE_MODES = [
|
|
|
28
28
|
icon: "LocalPolice",
|
|
29
29
|
colorTier: "moderate",
|
|
30
30
|
},
|
|
31
|
+
{
|
|
32
|
+
id: "dontAsk",
|
|
33
|
+
label: "Don't Ask",
|
|
34
|
+
description: "Runs without prompting — actions not pre-approved are denied",
|
|
35
|
+
// Guarded unattended mode: more dangerous than acceptEdits (edits only) but
|
|
36
|
+
// safer than bypass (deny-by-default vs. run-everything), so it sits at the
|
|
37
|
+
// "moderate" tier alongside Auto.
|
|
38
|
+
icon: "ShieldCheck",
|
|
39
|
+
colorTier: "moderate",
|
|
40
|
+
isUnattended: true,
|
|
41
|
+
},
|
|
31
42
|
{
|
|
32
43
|
id: "bypassPermissions",
|
|
33
44
|
label: "Bypass",
|
|
@@ -100,6 +100,7 @@ export declare const ScheduleUpdateRequestSchema: z.ZodObject<{
|
|
|
100
100
|
}, z.core.$strip>], "type">>;
|
|
101
101
|
newAgentConfig: z.ZodOptional<z.ZodObject<{
|
|
102
102
|
provider: z.ZodOptional<z.ZodString>;
|
|
103
|
+
personality: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
103
104
|
model: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
104
105
|
modeId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
105
106
|
thinkingOptionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -118,6 +119,7 @@ export declare const ScheduleCreateResponseSchema: z.ZodObject<{
|
|
|
118
119
|
payload: z.ZodObject<{
|
|
119
120
|
requestId: z.ZodString;
|
|
120
121
|
schedule: z.ZodNullable<z.ZodObject<{
|
|
122
|
+
prompt: z.ZodString;
|
|
121
123
|
name: z.ZodNullable<z.ZodString>;
|
|
122
124
|
status: z.ZodEnum<{
|
|
123
125
|
completed: "completed";
|
|
@@ -166,7 +168,6 @@ export declare const ScheduleCreateResponseSchema: z.ZodObject<{
|
|
|
166
168
|
mcpServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
167
169
|
}, z.core.$strip>;
|
|
168
170
|
}, z.core.$strip>], "type">;
|
|
169
|
-
prompt: z.ZodString;
|
|
170
171
|
nextRunAt: z.ZodNullable<z.ZodString>;
|
|
171
172
|
lastRunAt: z.ZodNullable<z.ZodString>;
|
|
172
173
|
lastRunStatus: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
@@ -186,6 +187,7 @@ export declare const ScheduleListResponseSchema: z.ZodObject<{
|
|
|
186
187
|
payload: z.ZodObject<{
|
|
187
188
|
requestId: z.ZodString;
|
|
188
189
|
schedules: z.ZodArray<z.ZodObject<{
|
|
190
|
+
prompt: z.ZodString;
|
|
189
191
|
name: z.ZodNullable<z.ZodString>;
|
|
190
192
|
status: z.ZodEnum<{
|
|
191
193
|
completed: "completed";
|
|
@@ -234,7 +236,6 @@ export declare const ScheduleListResponseSchema: z.ZodObject<{
|
|
|
234
236
|
mcpServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
235
237
|
}, z.core.$strip>;
|
|
236
238
|
}, z.core.$strip>], "type">;
|
|
237
|
-
prompt: z.ZodString;
|
|
238
239
|
nextRunAt: z.ZodNullable<z.ZodString>;
|
|
239
240
|
lastRunAt: z.ZodNullable<z.ZodString>;
|
|
240
241
|
lastRunStatus: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
@@ -359,6 +360,7 @@ export declare const SchedulePauseResponseSchema: z.ZodObject<{
|
|
|
359
360
|
payload: z.ZodObject<{
|
|
360
361
|
requestId: z.ZodString;
|
|
361
362
|
schedule: z.ZodNullable<z.ZodObject<{
|
|
363
|
+
prompt: z.ZodString;
|
|
362
364
|
name: z.ZodNullable<z.ZodString>;
|
|
363
365
|
status: z.ZodEnum<{
|
|
364
366
|
completed: "completed";
|
|
@@ -407,7 +409,6 @@ export declare const SchedulePauseResponseSchema: z.ZodObject<{
|
|
|
407
409
|
mcpServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
408
410
|
}, z.core.$strip>;
|
|
409
411
|
}, z.core.$strip>], "type">;
|
|
410
|
-
prompt: z.ZodString;
|
|
411
412
|
nextRunAt: z.ZodNullable<z.ZodString>;
|
|
412
413
|
lastRunAt: z.ZodNullable<z.ZodString>;
|
|
413
414
|
lastRunStatus: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
@@ -427,6 +428,7 @@ export declare const ScheduleResumeResponseSchema: z.ZodObject<{
|
|
|
427
428
|
payload: z.ZodObject<{
|
|
428
429
|
requestId: z.ZodString;
|
|
429
430
|
schedule: z.ZodNullable<z.ZodObject<{
|
|
431
|
+
prompt: z.ZodString;
|
|
430
432
|
name: z.ZodNullable<z.ZodString>;
|
|
431
433
|
status: z.ZodEnum<{
|
|
432
434
|
completed: "completed";
|
|
@@ -475,7 +477,6 @@ export declare const ScheduleResumeResponseSchema: z.ZodObject<{
|
|
|
475
477
|
mcpServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
476
478
|
}, z.core.$strip>;
|
|
477
479
|
}, z.core.$strip>], "type">;
|
|
478
|
-
prompt: z.ZodString;
|
|
479
480
|
nextRunAt: z.ZodNullable<z.ZodString>;
|
|
480
481
|
lastRunAt: z.ZodNullable<z.ZodString>;
|
|
481
482
|
lastRunStatus: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
@@ -62,6 +62,9 @@ export const ScheduleRunOnceRequestSchema = z.object({
|
|
|
62
62
|
});
|
|
63
63
|
const ScheduleUpdateNewAgentConfigSchema = z.object({
|
|
64
64
|
provider: z.string().trim().min(1).optional(),
|
|
65
|
+
// Personality binding by name — or the "@team-scheduler" sentinel. Explicit
|
|
66
|
+
// null clears a stored binding; omission leaves it untouched.
|
|
67
|
+
personality: z.string().trim().min(1).nullable().optional(),
|
|
65
68
|
model: z.string().trim().min(1).nullable().optional(),
|
|
66
69
|
modeId: z.string().trim().min(1).nullable().optional(),
|
|
67
70
|
thinkingOptionId: z.string().trim().min(1).nullable().optional(),
|
package/dist/schedule/types.d.ts
CHANGED
|
@@ -140,6 +140,7 @@ export declare const StoredScheduleSchema: z.ZodObject<{
|
|
|
140
140
|
}, z.core.$strip>;
|
|
141
141
|
export type StoredSchedule = z.infer<typeof StoredScheduleSchema>;
|
|
142
142
|
export declare const ScheduleSummarySchema: z.ZodObject<{
|
|
143
|
+
prompt: z.ZodString;
|
|
143
144
|
name: z.ZodNullable<z.ZodString>;
|
|
144
145
|
status: z.ZodEnum<{
|
|
145
146
|
completed: "completed";
|
|
@@ -188,7 +189,6 @@ export declare const ScheduleSummarySchema: z.ZodObject<{
|
|
|
188
189
|
mcpServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
189
190
|
}, z.core.$strip>;
|
|
190
191
|
}, z.core.$strip>], "type">;
|
|
191
|
-
prompt: z.ZodString;
|
|
192
192
|
nextRunAt: z.ZodNullable<z.ZodString>;
|
|
193
193
|
lastRunAt: z.ZodNullable<z.ZodString>;
|
|
194
194
|
lastRunStatus: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|