@intentic/sandbox-contract 1.226.0 → 1.227.0
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/contracts/activity.contract.d.ts.map +1 -1
- package/dist/contracts/activity.contract.js +17 -2
- package/dist/contracts/activity.contract.js.map +1 -1
- package/dist/contracts/agent.contract.d.ts +19 -2
- package/dist/contracts/agent.contract.d.ts.map +1 -1
- package/dist/contracts/agent.contract.js +71 -8
- package/dist/contracts/agent.contract.js.map +1 -1
- package/dist/contracts/agents.contract.d.ts +59 -0
- package/dist/contracts/agents.contract.d.ts.map +1 -1
- package/dist/contracts/agents.contract.js +164 -19
- package/dist/contracts/agents.contract.js.map +1 -1
- package/dist/contracts/automations.contract.d.ts.map +1 -1
- package/dist/contracts/automations.contract.js +78 -9
- package/dist/contracts/automations.contract.js.map +1 -1
- package/dist/contracts/capabilities.contract.d.ts.map +1 -1
- package/dist/contracts/capabilities.contract.js +98 -11
- package/dist/contracts/capabilities.contract.js.map +1 -1
- package/dist/contracts/chores.contract.d.ts.map +1 -1
- package/dist/contracts/chores.contract.js +26 -3
- package/dist/contracts/chores.contract.js.map +1 -1
- package/dist/contracts/ci.contract.d.ts.map +1 -1
- package/dist/contracts/ci.contract.js +52 -6
- package/dist/contracts/ci.contract.js.map +1 -1
- package/dist/contracts/claude.contract.d.ts.map +1 -1
- package/dist/contracts/claude.contract.js +44 -5
- package/dist/contracts/claude.contract.js.map +1 -1
- package/dist/contracts/drafts.contract.d.ts.map +1 -1
- package/dist/contracts/drafts.contract.js +26 -3
- package/dist/contracts/drafts.contract.js.map +1 -1
- package/dist/contracts/endpoints.contract.d.ts +1 -0
- package/dist/contracts/endpoints.contract.d.ts.map +1 -1
- package/dist/contracts/endpoints.contract.js +17 -2
- package/dist/contracts/endpoints.contract.js.map +1 -1
- package/dist/contracts/exit.contract.d.ts.map +1 -1
- package/dist/contracts/exit.contract.js +62 -7
- package/dist/contracts/exit.contract.js.map +1 -1
- package/dist/contracts/extensions.contract.d.ts +1 -0
- package/dist/contracts/extensions.contract.d.ts.map +1 -1
- package/dist/contracts/extensions.contract.js +124 -15
- package/dist/contracts/extensions.contract.js.map +1 -1
- package/dist/contracts/git.contract.d.ts.map +1 -1
- package/dist/contracts/git.contract.js +384 -43
- package/dist/contracts/git.contract.js.map +1 -1
- package/dist/contracts/grok.contract.d.ts.map +1 -1
- package/dist/contracts/grok.contract.js +25 -3
- package/dist/contracts/grok.contract.js.map +1 -1
- package/dist/contracts/history.contract.d.ts.map +1 -1
- package/dist/contracts/history.contract.js +35 -4
- package/dist/contracts/history.contract.js.map +1 -1
- package/dist/contracts/intentic.contract.d.ts.map +1 -1
- package/dist/contracts/intentic.contract.js +25 -3
- package/dist/contracts/intentic.contract.js.map +1 -1
- package/dist/contracts/inventory.contract.d.ts.map +1 -1
- package/dist/contracts/inventory.contract.js +26 -3
- package/dist/contracts/inventory.contract.js.map +1 -1
- package/dist/contracts/logs.contract.d.ts +17 -0
- package/dist/contracts/logs.contract.d.ts.map +1 -1
- package/dist/contracts/logs.contract.js +27 -3
- package/dist/contracts/logs.contract.js.map +1 -1
- package/dist/contracts/loops.contract.d.ts.map +1 -1
- package/dist/contracts/loops.contract.js +52 -6
- package/dist/contracts/loops.contract.js.map +1 -1
- package/dist/contracts/panels.contract.d.ts.map +1 -1
- package/dist/contracts/panels.contract.js +26 -3
- package/dist/contracts/panels.contract.js.map +1 -1
- package/dist/contracts/personas.contract.d.ts.map +1 -1
- package/dist/contracts/personas.contract.js +71 -8
- package/dist/contracts/personas.contract.js.map +1 -1
- package/dist/contracts/ports.contract.d.ts.map +1 -1
- package/dist/contracts/ports.contract.js +26 -3
- package/dist/contracts/ports.contract.js.map +1 -1
- package/dist/contracts/prepush.contract.d.ts.map +1 -1
- package/dist/contracts/prepush.contract.js +24 -3
- package/dist/contracts/prepush.contract.js.map +1 -1
- package/dist/contracts/providers.contract.d.ts +1 -0
- package/dist/contracts/providers.contract.d.ts.map +1 -1
- package/dist/contracts/providers.contract.js +9 -1
- package/dist/contracts/providers.contract.js.map +1 -1
- package/dist/contracts/public.contract.d.ts.map +1 -1
- package/dist/contracts/public.contract.js +26 -3
- package/dist/contracts/public.contract.js.map +1 -1
- package/dist/contracts/push.contract.d.ts.map +1 -1
- package/dist/contracts/push.contract.js +35 -4
- package/dist/contracts/push.contract.js.map +1 -1
- package/dist/contracts/secrets.contract.d.ts.map +1 -1
- package/dist/contracts/secrets.contract.js +43 -5
- package/dist/contracts/secrets.contract.js.map +1 -1
- package/dist/contracts/sessions.contract.d.ts +3 -0
- package/dist/contracts/sessions.contract.d.ts.map +1 -1
- package/dist/contracts/sessions.contract.js +15 -2
- package/dist/contracts/sessions.contract.js.map +1 -1
- package/dist/contracts/settings.contract.d.ts +19 -0
- package/dist/contracts/settings.contract.d.ts.map +1 -1
- package/dist/contracts/settings.contract.js +43 -5
- package/dist/contracts/settings.contract.js.map +1 -1
- package/dist/contracts/share.contract.d.ts.map +1 -1
- package/dist/contracts/share.contract.js +35 -4
- package/dist/contracts/share.contract.js.map +1 -1
- package/dist/contracts/skills.contract.d.ts.map +1 -1
- package/dist/contracts/skills.contract.js +35 -4
- package/dist/contracts/skills.contract.js.map +1 -1
- package/dist/contracts/system.contract.d.ts +7 -0
- package/dist/contracts/system.contract.d.ts.map +1 -1
- package/dist/contracts/system.contract.js +107 -14
- package/dist/contracts/system.contract.js.map +1 -1
- package/dist/contracts/translator.contract.d.ts.map +1 -1
- package/dist/contracts/translator.contract.js +29 -4
- package/dist/contracts/translator.contract.js.map +1 -1
- package/dist/contracts/usage.contract.d.ts.map +1 -1
- package/dist/contracts/usage.contract.js +9 -1
- package/dist/contracts/usage.contract.js.map +1 -1
- package/dist/contracts/vpn.contract.d.ts.map +1 -1
- package/dist/contracts/vpn.contract.js +32 -4
- package/dist/contracts/vpn.contract.js.map +1 -1
- package/dist/contracts/workflows.contract.d.ts.map +1 -1
- package/dist/contracts/workflows.contract.js +70 -8
- package/dist/contracts/workflows.contract.js.map +1 -1
- package/dist/contracts/workspace.contract.d.ts.map +1 -1
- package/dist/contracts/workspace.contract.js +216 -25
- package/dist/contracts/workspace.contract.js.map +1 -1
- package/dist/events.d.ts +46 -0
- package/dist/events.d.ts.map +1 -1
- package/dist/events.js +193 -88
- package/dist/events.js.map +1 -1
- package/dist/history-state.d.ts.map +1 -1
- package/dist/history-state.js +1 -0
- package/dist/history-state.js.map +1 -1
- package/dist/index.d.ts +197 -70
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/prompt-complexity.d.ts +9 -1
- package/dist/prompt-complexity.d.ts.map +1 -1
- package/dist/prompt-complexity.js +13 -5
- package/dist/prompt-complexity.js.map +1 -1
- package/dist/request-id.d.ts +3 -0
- package/dist/request-id.d.ts.map +1 -0
- package/dist/request-id.js +3 -0
- package/dist/request-id.js.map +1 -0
- package/dist/schemas.d.ts +89 -0
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +2912 -1276
- package/dist/schemas.js.map +1 -1
- package/dist/starter.d.ts +3 -0
- package/dist/starter.d.ts.map +1 -0
- package/dist/starter.js +3 -0
- package/dist/starter.js.map +1 -0
- package/package.json +5 -4
- package/src/contract-lock.test.ts +8 -2
- package/src/contracts/activity.contract.ts +18 -2
- package/src/contracts/agent.contract.ts +78 -8
- package/src/contracts/agents.contract.ts +180 -19
- package/src/contracts/automations.contract.ts +80 -9
- package/src/contracts/capabilities.contract.ts +106 -11
- package/src/contracts/chores.contract.ts +29 -3
- package/src/contracts/ci.contract.ts +55 -6
- package/src/contracts/claude.contract.ts +47 -5
- package/src/contracts/drafts.contract.ts +26 -3
- package/src/contracts/endpoints.contract.ts +19 -2
- package/src/contracts/exit.contract.ts +69 -7
- package/src/contracts/extensions.contract.ts +134 -15
- package/src/contracts/git.contract.ts +421 -43
- package/src/contracts/grok.contract.ts +26 -3
- package/src/contracts/history.contract.ts +37 -4
- package/src/contracts/intentic.contract.ts +28 -3
- package/src/contracts/inventory.contract.ts +27 -3
- package/src/contracts/logs.contract.ts +41 -4
- package/src/contracts/loops.contract.ts +58 -6
- package/src/contracts/panels.contract.ts +26 -3
- package/src/contracts/personas.contract.ts +77 -8
- package/src/contracts/ports.contract.ts +27 -3
- package/src/contracts/prepush.contract.ts +26 -3
- package/src/contracts/providers.contract.ts +10 -1
- package/src/contracts/public.contract.ts +29 -3
- package/src/contracts/push.contract.ts +37 -4
- package/src/contracts/secrets.contract.ts +46 -5
- package/src/contracts/sessions.contract.ts +16 -2
- package/src/contracts/settings.contract.ts +46 -5
- package/src/contracts/share.contract.ts +37 -4
- package/src/contracts/skills.contract.ts +39 -4
- package/src/contracts/system.contract.ts +119 -14
- package/src/contracts/translator.contract.ts +32 -4
- package/src/contracts/usage.contract.ts +10 -1
- package/src/contracts/vpn.contract.ts +35 -4
- package/src/contracts/workflows.contract.ts +77 -8
- package/src/contracts/workspace.contract.ts +231 -25
- package/src/events.ts +259 -89
- package/src/history-state.ts +6 -0
- package/src/index.ts +2 -0
- package/src/prompt-complexity.test.ts +69 -0
- package/src/prompt-complexity.ts +102 -39
- package/src/request-id.ts +41 -0
- package/src/schemas.ts +3700 -1260
- package/src/starter.ts +13 -0
package/src/events.ts
CHANGED
|
@@ -21,17 +21,17 @@ import {
|
|
|
21
21
|
|
|
22
22
|
// One interactive question the agent asks via the `ask` tool (mirrors AskUserQuestion's input shape).
|
|
23
23
|
export const AskOptionSchema = z.object({
|
|
24
|
-
label: z.string(),
|
|
25
|
-
description: z.string(),
|
|
26
|
-
preview: z.string().optional(),
|
|
24
|
+
label: z.string().describe("The choice, in a few words."),
|
|
25
|
+
description: z.string().describe("What picking it means."),
|
|
26
|
+
preview: z.string().optional().describe("Something to look at while deciding: a mock-up, a snippet, a layout."),
|
|
27
27
|
});
|
|
28
28
|
export type AskOption = z.infer<typeof AskOptionSchema>;
|
|
29
29
|
|
|
30
30
|
export const AskQuestionSchema = z.object({
|
|
31
|
-
question: z.string(),
|
|
32
|
-
header: z.string(),
|
|
33
|
-
multiSelect: z.boolean(),
|
|
34
|
-
options: z.array(AskOptionSchema),
|
|
31
|
+
question: z.string().describe("What the agent is asking."),
|
|
32
|
+
header: z.string().describe("A short label for the question."),
|
|
33
|
+
multiSelect: z.boolean().describe("Whether more than one answer can be picked."),
|
|
34
|
+
options: z.array(AskOptionSchema).describe("The choices offered. A free-text answer is always possible as well."),
|
|
35
35
|
});
|
|
36
36
|
export type AskQuestion = z.infer<typeof AskQuestionSchema>;
|
|
37
37
|
|
|
@@ -40,17 +40,22 @@ export type AskQuestion = z.infer<typeof AskQuestionSchema>;
|
|
|
40
40
|
// Code words it. `alwaysLabel` is present only when the SDK offered rules to persist, without it the card
|
|
41
41
|
// shows allow-once / deny alone, because there is nothing an "always" answer could remember.
|
|
42
42
|
export const PermissionAskSchema = z.object({
|
|
43
|
-
toolName: z.string(),
|
|
43
|
+
toolName: z.string().describe("Which tool it wants to use."),
|
|
44
44
|
// "Claude wants to read foo.txt", the full prompt sentence, when the bridge rendered one.
|
|
45
|
-
title: z.string().optional(),
|
|
45
|
+
title: z.string().optional().describe("The whole question, as a sentence, exactly as the runtime words it."),
|
|
46
46
|
// Short noun phrase for the allow button ("Read file").
|
|
47
|
-
displayName: z.string().optional(),
|
|
48
|
-
description: z.string().optional(),
|
|
47
|
+
displayName: z.string().optional().describe("A short phrase for the button, such as read file."),
|
|
48
|
+
description: z.string().optional().describe("More about what it is asking for."),
|
|
49
49
|
// Why the prompt fired ('rule' | 'mode' | 'classifier' | …), shown as the card's muted subline.
|
|
50
|
-
reason: z.string().optional(),
|
|
50
|
+
reason: z.string().optional().describe("Why it is asking at all: a rule, the current mode, something that looked risky."),
|
|
51
51
|
// The file the request is about, when it is about one (workspace-root-relative).
|
|
52
|
-
path: z.string().optional(),
|
|
53
|
-
alwaysLabel: z
|
|
52
|
+
path: z.string().optional().describe("Which file it concerns, when it concerns one."),
|
|
53
|
+
alwaysLabel: z
|
|
54
|
+
.string()
|
|
55
|
+
.optional()
|
|
56
|
+
.describe(
|
|
57
|
+
"The wording for an always-allow answer. Present only when there is something an always could actually remember; without it the only answers are once and no.",
|
|
58
|
+
),
|
|
54
59
|
});
|
|
55
60
|
export type PermissionAsk = z.infer<typeof PermissionAskSchema>;
|
|
56
61
|
|
|
@@ -61,24 +66,40 @@ export type PermissionAsk = z.infer<typeof PermissionAskSchema>;
|
|
|
61
66
|
* to misquote, and the click on it the only way the run can happen. */
|
|
62
67
|
export const ServiceOfferSchema = z.object({
|
|
63
68
|
// The service, as the platform lists it: `<slug>` is what the run names, the rest is the catalog row.
|
|
64
|
-
slug: z.string(),
|
|
65
|
-
name: z.string(),
|
|
66
|
-
publisher: z.string(),
|
|
67
|
-
description: z.string(),
|
|
68
|
-
creditsPerRun: z
|
|
69
|
+
slug: z.string().describe("Which service."),
|
|
70
|
+
name: z.string().describe("What it is called."),
|
|
71
|
+
publisher: z.string().describe("Who runs it."),
|
|
72
|
+
description: z.string().describe("What it does."),
|
|
73
|
+
creditsPerRun: z
|
|
74
|
+
.number()
|
|
75
|
+
.describe(
|
|
76
|
+
"What one run costs. Stated by the platform rather than by the agent asking, which is what makes the price impossible to misquote.",
|
|
77
|
+
),
|
|
69
78
|
/* Whether the platform still has this listing on probation, a new provider that passed admission's
|
|
70
79
|
* mechanical gates but has not yet served enough runs cleanly to graduate. It rides the card because
|
|
71
80
|
* probation is the honest form of "listed automatically, not vouched for": the member approving the
|
|
72
81
|
* spend is the person who should know that, and the platform is the only party that can say it. */
|
|
73
|
-
probation: z
|
|
82
|
+
probation: z
|
|
83
|
+
.boolean()
|
|
84
|
+
.optional()
|
|
85
|
+
.describe(
|
|
86
|
+
"The listing is new and has not yet served enough runs cleanly to be trusted. The honest form of listed automatically but not vouched for, and the person approving the spend is who should know it.",
|
|
87
|
+
),
|
|
74
88
|
// The owner's meter as the platform stated it with the catalog, what "N left today" renders from. Absent
|
|
75
89
|
// when the platform sent none (it answers a meter only to a member, and membership was already checked
|
|
76
90
|
// before this card went up, so in practice it is present; the field stays honest about the wire).
|
|
77
|
-
credits: z
|
|
91
|
+
credits: z
|
|
92
|
+
.object({
|
|
93
|
+
allowance: z.number().describe("How many credits the period gives."),
|
|
94
|
+
remaining: z.number().describe("How many are left."),
|
|
95
|
+
resetsAt: z.string().describe("When they refill."),
|
|
96
|
+
})
|
|
97
|
+
.optional()
|
|
98
|
+
.describe("Your own meter, as the platform stated it."),
|
|
78
99
|
// The request body the agent wants forwarded, verbatim, shown so the owner can see what leaves.
|
|
79
|
-
request: z.string(),
|
|
100
|
+
request: z.string().describe("Exactly what would be sent, so you can see what leaves before agreeing to it."),
|
|
80
101
|
// The agent's one-line case for spending, the only prose on the card that is the model's.
|
|
81
|
-
why: z.string().optional(),
|
|
102
|
+
why: z.string().optional().describe("The agent's case for spending, and the only words on this card that are the agent's."),
|
|
82
103
|
});
|
|
83
104
|
export type ServiceOffer = z.infer<typeof ServiceOfferSchema>;
|
|
84
105
|
|
|
@@ -89,8 +110,14 @@ export type ServiceOffer = z.infer<typeof ServiceOfferSchema>;
|
|
|
89
110
|
* `result`, whose `data` is the answer the agent acts on. The union is where future event kinds land when
|
|
90
111
|
* services start streaming richer transcript elements; today's two are the smallest honest set. */
|
|
91
112
|
export const ServiceStreamEventSchema = z.discriminatedUnion(`event`, [
|
|
92
|
-
z.object({
|
|
93
|
-
|
|
113
|
+
z.object({
|
|
114
|
+
event: z.literal(`status`).describe("Progress. Each one replaces the last: a label, not a log."),
|
|
115
|
+
text: z.string().describe("What it is doing."),
|
|
116
|
+
}),
|
|
117
|
+
z.object({
|
|
118
|
+
event: z.literal(`result`).describe("The answer. Exactly one of these ends a run."),
|
|
119
|
+
data: z.unknown().describe("The answer itself, in whatever shape that service returns."),
|
|
120
|
+
}),
|
|
94
121
|
]);
|
|
95
122
|
export type ServiceStreamEvent = z.infer<typeof ServiceStreamEventSchema>;
|
|
96
123
|
|
|
@@ -101,10 +128,10 @@ export type ServiceStreamEvent = z.infer<typeof ServiceStreamEventSchema>;
|
|
|
101
128
|
* impossible to misrepresent, and the click on it the only way anything gets connected. */
|
|
102
129
|
export const CapabilityOfferSchema = z.object({
|
|
103
130
|
// The catalog card being asked for, and how the catalog itself titles it ("Notion", "GitHub", "Docker").
|
|
104
|
-
card: z.string(),
|
|
105
|
-
name: z.string(),
|
|
131
|
+
card: z.string().describe("Which connection is being asked for."),
|
|
132
|
+
name: z.string().describe("What it is called, as the catalogue titles it rather than as the agent named it."),
|
|
106
133
|
// The agent's one-line case for connecting it, the only prose on the card that is the model's.
|
|
107
|
-
why: z.string().optional(),
|
|
134
|
+
why: z.string().optional().describe("The agent's case for connecting it, and the only words on this card that are the agent's."),
|
|
108
135
|
});
|
|
109
136
|
export type CapabilityOffer = z.infer<typeof CapabilityOfferSchema>;
|
|
110
137
|
|
|
@@ -112,10 +139,12 @@ export type CapabilityOffer = z.infer<typeof CapabilityOfferSchema>;
|
|
|
112
139
|
* speaking after the stream settled. `ok` means the run served and was charged (`remaining` is the meter
|
|
113
140
|
* after); `refunded` means the provider's stream died before its `result` and the charge was reversed. */
|
|
114
141
|
export const ServiceRunReceiptSchema = z.object({
|
|
115
|
-
event: z
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
142
|
+
event: z
|
|
143
|
+
.literal(`receipt`)
|
|
144
|
+
.describe("The last line of a run, added by the platform rather than by the service. The ledger speaking after the fact."),
|
|
145
|
+
outcome: z.enum([`ok`, `refunded`]).describe("Whether it served and was charged, or died before answering and the charge was reversed."),
|
|
146
|
+
credits: z.number().describe("What it cost."),
|
|
147
|
+
remaining: z.number().optional().describe("What is left afterwards."),
|
|
119
148
|
});
|
|
120
149
|
export type ServiceRunReceipt = z.infer<typeof ServiceRunReceiptSchema>;
|
|
121
150
|
|
|
@@ -126,22 +155,22 @@ export type ServiceRunReceipt = z.infer<typeof ServiceRunReceiptSchema>;
|
|
|
126
155
|
* impossible to misquote, and the click on it the only way the money can move. */
|
|
127
156
|
export const PaymentOfferSchema = z.object({
|
|
128
157
|
// The paid resource, as the endpoint's challenge stated it.
|
|
129
|
-
url: z.string(),
|
|
130
|
-
description: z.string().optional(),
|
|
158
|
+
url: z.string().describe("What is being paid for."),
|
|
159
|
+
description: z.string().optional().describe("What the endpoint says it is."),
|
|
131
160
|
// Where the money goes, verbatim off the challenge: recipient address, CAIP-2 network, token contract.
|
|
132
|
-
payTo: z.string(),
|
|
133
|
-
network: z.string(),
|
|
134
|
-
asset: z.string(),
|
|
161
|
+
payTo: z.string().describe("Where the money goes, taken verbatim from the endpoint's own demand."),
|
|
162
|
+
network: z.string().describe("On which network."),
|
|
163
|
+
asset: z.string().describe("In which token."),
|
|
135
164
|
// The token's display name ("USDC"), dollar-pegged, which is what lets every amount below read as USD.
|
|
136
|
-
assetName: z.string(),
|
|
165
|
+
assetName: z.string().describe("That token's name. It is pegged to the dollar, which is what lets every amount here read as dollars."),
|
|
137
166
|
// The exact price in display units ("0.10"), the x402 exact scheme has no ranges, so this is the whole
|
|
138
167
|
// spend, not a ceiling.
|
|
139
|
-
amountUsd: z.string(),
|
|
168
|
+
amountUsd: z.string().describe("The exact price. Not a ceiling: this scheme has no ranges, so this is the whole spend."),
|
|
140
169
|
// The wallet's meter as the daemon's ledger states it, what "spent today / cap" renders from.
|
|
141
|
-
spentTodayUsd: z.string(),
|
|
142
|
-
dailyCapUsd: z.string(),
|
|
170
|
+
spentTodayUsd: z.string().describe("What has already gone out today."),
|
|
171
|
+
dailyCapUsd: z.string().describe("What may go out in a day."),
|
|
143
172
|
// The agent's one-line case for paying, the only prose on the card that is the model's.
|
|
144
|
-
why: z.string().optional(),
|
|
173
|
+
why: z.string().optional().describe("The agent's case for paying, and the only words on this card that are the agent's."),
|
|
145
174
|
});
|
|
146
175
|
export type PaymentOffer = z.infer<typeof PaymentOfferSchema>;
|
|
147
176
|
|
|
@@ -149,29 +178,36 @@ export type PaymentOffer = z.infer<typeof PaymentOfferSchema>;
|
|
|
149
178
|
// supportedCommands() (its built-ins plus the workspace's own .claude/commands and any plugin/skill commands).
|
|
150
179
|
// `hint` is the argument placeholder the popover shows after the name.
|
|
151
180
|
export const AgentCommandSchema = z.object({
|
|
152
|
-
name: z.string(),
|
|
153
|
-
description: z.string(),
|
|
154
|
-
hint: z.string().optional(),
|
|
181
|
+
name: z.string().describe("What to type, without the leading slash."),
|
|
182
|
+
description: z.string().describe("What it does."),
|
|
183
|
+
hint: z.string().optional().describe("What its argument should look like, shown after the name."),
|
|
155
184
|
});
|
|
156
185
|
export type AgentCommand = z.infer<typeof AgentCommandSchema>;
|
|
157
186
|
|
|
158
187
|
// GET /agent/commands, which provider's last-published list to read; absent = claude, matching AgentTurn.
|
|
159
|
-
export const AgentCommandsQuerySchema = z.object({
|
|
160
|
-
|
|
188
|
+
export const AgentCommandsQuerySchema = z.object({
|
|
189
|
+
agent: AgentProviderSchema.optional().describe("Whose commands to read. Leave it out for Claude."),
|
|
190
|
+
});
|
|
191
|
+
export const AgentCommandsSchema = z.object({
|
|
192
|
+
commands: z.array(AgentCommandSchema).describe("The shortcut commands, as the provider last published them."),
|
|
193
|
+
});
|
|
161
194
|
|
|
162
195
|
// One TodoWrite/Task checklist item, surfaced live so the UI shows the agent's plan-of-work (Claude Code style).
|
|
163
196
|
export const TodoItemSchema = z.object({
|
|
164
|
-
content: z.string(),
|
|
165
|
-
status: z.enum(["pending", "in_progress", "completed"]),
|
|
166
|
-
activeForm: z
|
|
197
|
+
content: z.string().describe("The item, as the agent wrote it."),
|
|
198
|
+
status: z.enum(["pending", "in_progress", "completed"]).describe("Where it is."),
|
|
199
|
+
activeForm: z
|
|
200
|
+
.string()
|
|
201
|
+
.optional()
|
|
202
|
+
.describe("How to phrase it while it is happening, so a screen can say what the agent is doing rather than what it plans to do."),
|
|
167
203
|
});
|
|
168
204
|
export type TodoItem = z.infer<typeof TodoItemSchema>;
|
|
169
205
|
|
|
170
206
|
// Context-window fill for a conversation: how many tokens the latest request sent vs the model's window, so
|
|
171
207
|
// the UI can warn as the chat nears auto-compaction. Per-conversation, unlike the account-wide usage above.
|
|
172
208
|
export const ContextUsageSchema = z.object({
|
|
173
|
-
tokens: z.number()
|
|
174
|
-
contextWindow: z.number()
|
|
209
|
+
tokens: z.number().describe("How much the latest request sent, all told."),
|
|
210
|
+
contextWindow: z.number().describe("How much the model can hold. The gap between these two is how close the conversation is to being compacted."),
|
|
175
211
|
});
|
|
176
212
|
export type ContextUsage = z.infer<typeof ContextUsageSchema>;
|
|
177
213
|
|
|
@@ -186,8 +222,8 @@ export type ToolCallStatus = z.infer<typeof ToolCallStatusSchema>;
|
|
|
186
222
|
// A file a tool call touches. Workspace-root-relative, forward-slash (the tree/file route space), adapters
|
|
187
223
|
// normalize from the turn's cwd. `line` is 1-based.
|
|
188
224
|
export const ToolCallLocationSchema = z.object({
|
|
189
|
-
path: z.string(),
|
|
190
|
-
line: z.number().optional(),
|
|
225
|
+
path: z.string().describe("The file, as a workspace path, whatever directory the tool was run from."),
|
|
226
|
+
line: z.number().optional().describe("Which line, counting from one."),
|
|
191
227
|
});
|
|
192
228
|
export type ToolCallLocation = z.infer<typeof ToolCallLocationSchema>;
|
|
193
229
|
|
|
@@ -202,15 +238,25 @@ export type ToolCallLocation = z.infer<typeof ToolCallLocationSchema>;
|
|
|
202
238
|
// the path also keeps the picture openable afterwards. Root-relative, forward-slash: the same route space as
|
|
203
239
|
// ToolCallLocation.
|
|
204
240
|
export const ToolCallContentSchema = z.discriminatedUnion("type", [
|
|
205
|
-
z.object({ type: z.literal("text"), text: z.string() }),
|
|
206
241
|
z.object({
|
|
207
|
-
type: z.literal("
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
242
|
+
type: z.literal("text").describe("Plain output."),
|
|
243
|
+
text: z.string().describe("What the tool said."),
|
|
244
|
+
}),
|
|
245
|
+
z.object({
|
|
246
|
+
type: z.literal("diff").describe("A change to a file."),
|
|
247
|
+
path: z.string().describe("Which file, as a workspace path."),
|
|
248
|
+
oldText: z.string().optional().describe("What was there. Absent for a new file, or where the previous contents are not known."),
|
|
249
|
+
newText: z.string().describe("What is there now."),
|
|
250
|
+
truncated: z.boolean().optional().describe("One of the two sides was too large to send whole."),
|
|
251
|
+
}),
|
|
252
|
+
z.object({
|
|
253
|
+
type: z.literal("image").describe("A picture the tool produced."),
|
|
254
|
+
path: z
|
|
255
|
+
.string()
|
|
256
|
+
.describe(
|
|
257
|
+
"Where it is, as a workspace path. A path rather than the bytes, because the workspace already serves it, sending it inline would bloat every stored record, and this way the picture stays openable afterwards.",
|
|
258
|
+
),
|
|
212
259
|
}),
|
|
213
|
-
z.object({ type: z.literal("image"), path: z.string() }),
|
|
214
260
|
]);
|
|
215
261
|
export type ToolCallContent = z.infer<typeof ToolCallContentSchema>;
|
|
216
262
|
|
|
@@ -228,15 +274,22 @@ export type ToolCallContent = z.infer<typeof ToolCallContentSchema>;
|
|
|
228
274
|
// z.lazy because the shape refers to itself: a subagent that delegates nests one level deeper.
|
|
229
275
|
export const RestoredToolCallSchema: z.ZodType<RestoredToolCall> = z.lazy(() =>
|
|
230
276
|
z.object({
|
|
231
|
-
id: z.string(),
|
|
232
|
-
name: z.string(),
|
|
233
|
-
category: ToolKindSchema
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
277
|
+
id: z.string().describe("The call's id."),
|
|
278
|
+
name: z.string().describe("Which tool."),
|
|
279
|
+
category: ToolKindSchema.describe(
|
|
280
|
+
"What kind of thing it does: read, edit, delete, move, search, run, think, fetch. Named the same way whatever the backend called the tool.",
|
|
281
|
+
),
|
|
282
|
+
status: ToolCallStatusSchema.describe("How it went."),
|
|
283
|
+
target: z.string().optional().describe("What it acted on, in one line: a file, a command, an address."),
|
|
284
|
+
locations: z.array(ToolCallLocationSchema).optional().describe("The files it touched."),
|
|
285
|
+
content: z.array(ToolCallContentSchema).optional().describe("What it produced: text, a change to a file, or a picture."),
|
|
286
|
+
children: z
|
|
287
|
+
.array(RestoredToolCallSchema)
|
|
288
|
+
.optional()
|
|
289
|
+
.describe(
|
|
290
|
+
"Calls a delegated helper made, nested under the call that started it, so a reopened conversation redraws the delegation rather than collapsing it into one result.",
|
|
291
|
+
),
|
|
292
|
+
thinking: z.string().optional().describe("What the agent was reasoning about around this call."),
|
|
240
293
|
}),
|
|
241
294
|
);
|
|
242
295
|
// Mutable, unlike most of this file: both builders settle a card IN PLACE when its result arrives turns later
|
|
@@ -256,7 +309,10 @@ export interface RestoredToolCall {
|
|
|
256
309
|
/* ONE NOTE THE DAEMON PUT IN FRONT OF A USER'S MESSAGE, as both audiences see it: the model reads `text`, and
|
|
257
310
|
* the chat draws `title` on a collapsed row that opens to that same `text`. Shared by the live frame and the
|
|
258
311
|
* restored transcript so a note reads identically whether the tab watched it arrive or reopened an hour later. */
|
|
259
|
-
export const TurnNoteSchema = z.object({
|
|
312
|
+
export const TurnNoteSchema = z.object({
|
|
313
|
+
title: z.string().describe("The one line a reader sees, on a row that opens to the text below."),
|
|
314
|
+
text: z.string().describe("The note itself, which is also exactly what the model was told."),
|
|
315
|
+
});
|
|
260
316
|
export type TurnNote = z.infer<typeof TurnNoteSchema>;
|
|
261
317
|
|
|
262
318
|
// One restored bubble. Each stored assistant message becomes its own, which is what reproduces the live
|
|
@@ -268,8 +324,12 @@ export const RestoredMessageSchema = z.object({
|
|
|
268
324
|
* organization has disabled Claude subscription access" produced no assistant text, so a transcript of the
|
|
269
325
|
* two speakers alone ends on the user's message and the session reads as broken. It is the same muted line
|
|
270
326
|
* the live client draws for the codes it does not turn red (ChatRole's `notice`). */
|
|
271
|
-
role: z
|
|
272
|
-
|
|
327
|
+
role: z
|
|
328
|
+
.enum(["user", "assistant", "notice"])
|
|
329
|
+
.describe(
|
|
330
|
+
"Who said it. A notice is neither side: it is something that happened to the turn, recorded so a reopened conversation can say it. Without those, a turn a provider refused ends on the user's message and reads as broken.",
|
|
331
|
+
),
|
|
332
|
+
text: z.string().describe("The words."),
|
|
273
333
|
/* WHEN THIS TURN WAS SENT, in epoch milliseconds (user rows only), what the chat shows on the bubble it
|
|
274
334
|
* belongs to. The turn's START, not the moment the record was written: a turn that ran for twenty minutes
|
|
275
335
|
* was still sent when the user pressed send, and a stamp taken at settlement would say the conversation
|
|
@@ -279,16 +339,26 @@ export const RestoredMessageSchema = z.object({
|
|
|
279
339
|
* turn's frames arrive with no clock of their own, so an assistant bubble could only ever be stamped with
|
|
280
340
|
* the whole turn's start or end, a number that says nothing about when that particular block was written.
|
|
281
341
|
* Rows recorded before this existed simply have none, and the chat draws nothing for them. */
|
|
282
|
-
sentAt: z
|
|
342
|
+
sentAt: z
|
|
343
|
+
.number()
|
|
344
|
+
.optional()
|
|
345
|
+
.describe(
|
|
346
|
+
"When it was sent, in milliseconds. On the user's rows only, because that is the only moment actually known: a turn's own frames arrive with no clock, so stamping the agent's rows could only ever mean the whole turn's start or end.",
|
|
347
|
+
),
|
|
283
348
|
// Files the user attached to this turn (user bubbles only) as workspace-relative paths, recovered from
|
|
284
349
|
// the stored prompt's attachment note, so a reopened tab redraws chips, not the injected protocol text.
|
|
285
|
-
attachments: z.array(z.string()).optional(),
|
|
350
|
+
attachments: z.array(z.string()).optional().describe("Files attached to this message, as workspace paths."),
|
|
286
351
|
/* The checkpoint this message can be rewound to (user bubbles only), filled in when the transcript is read
|
|
287
352
|
* back. Not stored in the record itself, it is looked up per read from the daemon's rewind points, which
|
|
288
353
|
* a rewind rewrites, so a reopened tab offers exactly the turns that are still there to go back to. */
|
|
289
|
-
checkpointId: z
|
|
290
|
-
|
|
291
|
-
|
|
354
|
+
checkpointId: z
|
|
355
|
+
.string()
|
|
356
|
+
.optional()
|
|
357
|
+
.describe(
|
|
358
|
+
"The saved point this message can be rewound to. Looked up on each read rather than stored, so what is offered is exactly what is still there to go back to.",
|
|
359
|
+
),
|
|
360
|
+
thinking: z.string().optional().describe("What the agent was reasoning about."),
|
|
361
|
+
tools: z.array(RestoredToolCallSchema).optional().describe("The tool calls this part of the turn made."),
|
|
292
362
|
/* What the daemon added to this turn's message (user rows only), the same notes the live `preamble` frame
|
|
293
363
|
* carries, recovered from the stored prompt when the transcript is read back. The reader that strips them out
|
|
294
364
|
* of the user's words is the one that hands them over here instead of dropping them on the floor.
|
|
@@ -296,7 +366,12 @@ export const RestoredMessageSchema = z.object({
|
|
|
296
366
|
* On the message rather than as a row of its own, and that matters twice: they ARE part of what was
|
|
297
367
|
* sent, and a record row per turn preamble would break the one-row-per-bubble correspondence a branch counts
|
|
298
368
|
* with (see the client's recordedRows, notices are drawn locally and never recorded). */
|
|
299
|
-
notes: z
|
|
369
|
+
notes: z
|
|
370
|
+
.array(TurnNoteSchema)
|
|
371
|
+
.optional()
|
|
372
|
+
.describe(
|
|
373
|
+
"What the sandbox added to this message before the model saw it. Carried on the message rather than as rows of their own, because they genuinely were part of what was sent.",
|
|
374
|
+
),
|
|
300
375
|
/* THE USER WROTE THIS ROW WEARING THE AGENT'S VOICE (assistant rows only), the composer's "as agent" mode
|
|
301
376
|
* appending straight into the record, with no turn behind it (agents.place).
|
|
302
377
|
*
|
|
@@ -306,12 +381,38 @@ export const RestoredMessageSchema = z.object({
|
|
|
306
381
|
* fresh runtime session (agent/runtime-history.ts), which renders role and text alone, so there the line is
|
|
307
382
|
* indistinguishable from anything the agent genuinely said. Keep it that way: rendering this flag into any
|
|
308
383
|
* agent-facing text would break the feature's whole contract. */
|
|
309
|
-
placed: z
|
|
384
|
+
placed: z
|
|
385
|
+
.boolean()
|
|
386
|
+
.optional()
|
|
387
|
+
.describe(
|
|
388
|
+
"A person wrote this in the agent's voice, with no turn behind it. Marked for the human re-reading the conversation months later, so their own words do not pass as the agent's. The agent itself never sees the mark.",
|
|
389
|
+
),
|
|
390
|
+
/* THE ONE-PRESS OFFER A RECORDED NOTICE CARRIES (notice rows only), named rather than inferred from its
|
|
391
|
+
* words. Only `tierHold` today: the line saying this turn ran on a cheaper model, whose offer is "keep this
|
|
392
|
+
* chat on my pick".
|
|
393
|
+
*
|
|
394
|
+
* It is on the wire because the offer has to survive a reopen, and a reopened tab has only the record. The
|
|
395
|
+
* chat's other one-press notices are drawn live and never recorded, so they never needed this; a routed turn
|
|
396
|
+
* is different precisely because the whole point of recording it is that somebody reads it LATER. A KIND, not
|
|
397
|
+
* a callback, exactly as the live ones are: the reader decides what the press does and whether the offer
|
|
398
|
+
* still stands (a chat already holding its pick shows a settled sentence, not a stale button). */
|
|
399
|
+
noticeAction: z
|
|
400
|
+
.enum(["tierHold"])
|
|
401
|
+
.optional()
|
|
402
|
+
.describe("A one-press follow-up this recorded notice offers, by name. The chat decides what it does and whether it still applies."),
|
|
310
403
|
});
|
|
311
404
|
export type RestoredMessage = z.infer<typeof RestoredMessageSchema>;
|
|
312
405
|
|
|
313
|
-
export const SessionTranscriptSchema = z.object({
|
|
314
|
-
|
|
406
|
+
export const SessionTranscriptSchema = z.object({
|
|
407
|
+
messages: z
|
|
408
|
+
.array(RestoredMessageSchema)
|
|
409
|
+
.describe(
|
|
410
|
+
"The conversation, in order. Each block of the agent's prose is its own message with the tools that block introduced, which is what reproduces the way it actually unfolded.",
|
|
411
|
+
),
|
|
412
|
+
});
|
|
413
|
+
export const AgentTranscriptSchema = SessionTranscriptSchema.extend({
|
|
414
|
+
sessionId: z.string().optional().describe("The provider session behind the last turn, when there is one."),
|
|
415
|
+
});
|
|
315
416
|
|
|
316
417
|
/* WHAT A PUBLISHED CONVERSATION'S PAGE IS HANDED, the whole of it, baked into the page as one JSON block.
|
|
317
418
|
*
|
|
@@ -339,9 +440,20 @@ export type SharePayload = z.infer<typeof SharePayloadSchema>;
|
|
|
339
440
|
* the restart that killed the process holding it. The two handover cards are deliberately not among them:
|
|
340
441
|
* `browser_help`'s Chromium and `terminal_help`'s waiting command both die with the container, so those parks
|
|
341
442
|
* cannot be restored, only reported. */
|
|
342
|
-
const PlanCardSchema = z.object({
|
|
343
|
-
|
|
344
|
-
|
|
443
|
+
const PlanCardSchema = z.object({
|
|
444
|
+
kind: z.literal("plan").describe("The agent has written a plan and is waiting for a yes."),
|
|
445
|
+
requestId: z.string().describe("What to send back when you answer."),
|
|
446
|
+
text: z.string().describe("The plan itself."),
|
|
447
|
+
});
|
|
448
|
+
const QuestionCardSchema = z.object({
|
|
449
|
+
kind: z.literal("question").describe("The agent has asked you something and is waiting."),
|
|
450
|
+
requestId: z.string().describe("What to send back when you answer."),
|
|
451
|
+
questions: z.array(AskQuestionSchema).describe("What it wants to know."),
|
|
452
|
+
});
|
|
453
|
+
const PermissionCardSchema = PermissionAskSchema.extend({
|
|
454
|
+
kind: z.literal("permission").describe("The agent wants to use a tool it needs permission for."),
|
|
455
|
+
requestId: z.string().describe("What to send back when you answer."),
|
|
456
|
+
});
|
|
345
457
|
export const ParkedCardSchema = z.discriminatedUnion("kind", [PlanCardSchema, QuestionCardSchema, PermissionCardSchema]);
|
|
346
458
|
export type ParkedCard = z.infer<typeof ParkedCardSchema>;
|
|
347
459
|
|
|
@@ -568,6 +680,33 @@ export const AgentEventSchema = z.discriminatedUnion("kind", [
|
|
|
568
680
|
// wasn't asked for.
|
|
569
681
|
reason: z.string().optional(),
|
|
570
682
|
}),
|
|
683
|
+
/* WHAT THE COMPLEXITY JUDGE MADE OF THIS TURN, emitted once at turn start on every judged turn (that is,
|
|
684
|
+
* whenever settings.autoTier is not "off"), for the same reason fast_mode exists: a mechanism that can
|
|
685
|
+
* change what a turn runs on fails silently unless the daemon says what it decided. One tiny frame per
|
|
686
|
+
* turn, deliberately on the standard verdicts too, because the client's composer preview needs the
|
|
687
|
+
* conversation's LAST verdict (prompt-complexity.ts `afterHardTurn`) and a frame only on the interesting
|
|
688
|
+
* turns would leave it guessing on the common ones.
|
|
689
|
+
*
|
|
690
|
+
* `tier`/`score`/`rules` are the verdict verbatim (judgeComplexity): the rules are the named-feature
|
|
691
|
+
* vocabulary of ComplexityRule, carried as strings so a frame from a build with a rule this client hasn't
|
|
692
|
+
* heard of still parses. `model` is present only when a substitution actually applies to THIS turn, which
|
|
693
|
+
* is `routed` (mode on, verdict fast, something cheaper published) or `held` (the same turn the user pinned
|
|
694
|
+
* to their pick, see AgentTurn.tierHold): measure mode never names one because naming it would cost the
|
|
695
|
+
* catalog read shadow mode exists to avoid.
|
|
696
|
+
*
|
|
697
|
+
* `routed` is what HAPPENED, never implied by the verdict: a fast verdict in measure mode, under a hold, or
|
|
698
|
+
* with nothing cheaper published all run the user's own pick and say `routed: false`. */
|
|
699
|
+
z.object({
|
|
700
|
+
kind: z.literal("tier"),
|
|
701
|
+
tier: z.enum(["fast", "standard"]),
|
|
702
|
+
score: z.number(),
|
|
703
|
+
rules: z.array(z.string()),
|
|
704
|
+
// The cheaper model this turn ran on (routed) or would have run on (held). Absent otherwise.
|
|
705
|
+
model: z.string().optional(),
|
|
706
|
+
routed: z.boolean(),
|
|
707
|
+
// The user pinned this turn to their pick (AgentTurn.tierHold), so a fast verdict moved nothing.
|
|
708
|
+
held: z.boolean().optional(),
|
|
709
|
+
}),
|
|
571
710
|
/* The turn is alive but WAITING on the provider: a request failed transiently (5xx, 529, a dropped socket)
|
|
572
711
|
* and the harness is retrying it inside this same turn. A status, not a failure, nothing has been lost and
|
|
573
712
|
* the turn may still finish normally, so the client renders it where "thinking" goes rather than in the
|
|
@@ -578,7 +717,10 @@ export const AgentEventSchema = z.discriminatedUnion("kind", [
|
|
|
578
717
|
* a hang. The one action a user takes against an apparent hang is Stop, which is the only action that
|
|
579
718
|
* actually loses the work, so the wait has to be visible, with its own next-attempt clock.
|
|
580
719
|
*
|
|
581
|
-
* `attempt
|
|
720
|
+
* `attempt` is the harness's own counter and `maxAttempts` is the bound that will actually be honoured,
|
|
721
|
+
* which on the Claude path is the daemon's own cap on how deep a storm may get rather than the harness's
|
|
722
|
+
* far longer budget (MAX_IN_TURN_RETRIES in sdk-stream.ts, which ends the turn at the cap and hands the
|
|
723
|
+
* waiting to the outage breaker). `nextAttemptAt` (epoch ms) is when it will try
|
|
582
724
|
* again, so the readout counts down instead of freezing on a number nobody can interpret. BOTH are optional
|
|
583
725
|
* for the same reason, which is that each runtime publishes a different half of the wait and none of them
|
|
584
726
|
* publishes all of it: Claude's harness reports the delay and the bound, Codex says which attempt it is on
|
|
@@ -756,6 +898,14 @@ export const AgentEventSchema = z.discriminatedUnion("kind", [
|
|
|
756
898
|
"unknown-command",
|
|
757
899
|
"grok-model-invalid",
|
|
758
900
|
"codex-model-invalid",
|
|
901
|
+
/* THE MODEL CANNOT HOLD A TURN OF THIS AGENT LOOP, so the daemon refused before sending
|
|
902
|
+
* (agent/context-budget.ts). Its own code because none of the neighbours describes it: nothing is
|
|
903
|
+
* disconnected, nothing is spent, nothing comes back on a clock, and re-sending the same request
|
|
904
|
+
* at the same model fails identically forever. What changes the outcome is the model or the
|
|
905
|
+
* server's context flag, so the message names both and the client HOLDS the words: they never
|
|
906
|
+
* reached anything, and losing them to a configuration fact would be the one part of this that
|
|
907
|
+
* was our fault. */
|
|
908
|
+
"context-window-too-small",
|
|
759
909
|
"subscription-required",
|
|
760
910
|
"agent-busy",
|
|
761
911
|
])
|
|
@@ -795,9 +945,29 @@ export type AgentEvent = z.infer<typeof AgentEventSchema>;
|
|
|
795
945
|
// second window, another device) synthesize the user bubble and the elapsed readout; its `seq` is the log
|
|
796
946
|
// length at attach time, the replay/live boundary.
|
|
797
947
|
export const AttachFrameSchema = z.discriminatedUnion("kind", [
|
|
798
|
-
z.object({
|
|
799
|
-
|
|
800
|
-
|
|
948
|
+
z.object({
|
|
949
|
+
kind: z.literal("attached").describe("The first frame, identifying the run you have joined."),
|
|
950
|
+
run: z.string().describe("The run's id."),
|
|
951
|
+
prompt: z.string().describe("What was said to start it, so a window that did not start the turn can still draw the message."),
|
|
952
|
+
startedAt: z.number().describe("When it started, in milliseconds, so a window joining late can show how long it has been going."),
|
|
953
|
+
seq: z.number().describe("How many frames already exist. Everything at or below this number is replay; everything above it is live."),
|
|
954
|
+
}),
|
|
955
|
+
z.object({
|
|
956
|
+
kind: z.literal("frame").describe("One thing that happened."),
|
|
957
|
+
seq: z
|
|
958
|
+
.number()
|
|
959
|
+
.describe("Its position in the run, counting from one. Keep the last one you saw and hand it back to resume rather than replay."),
|
|
960
|
+
event: AgentEventSchema.describe(
|
|
961
|
+
"What happened, as one of about forty shapes: the agent's words arriving piece by piece, a tool being called and answering, a plan or a question it is waiting on, a mode change, the turn's cost. Each carries its own `kind`.",
|
|
962
|
+
),
|
|
963
|
+
}),
|
|
964
|
+
z.object({
|
|
965
|
+
kind: z
|
|
966
|
+
.literal("end")
|
|
967
|
+
.describe(
|
|
968
|
+
"The run is over and every frame has been delivered. A stream that closes without this was dropped mid-run, so re-attach with the last position you hold rather than assuming the turn finished.",
|
|
969
|
+
),
|
|
970
|
+
}),
|
|
801
971
|
]);
|
|
802
972
|
export type AttachFrame = z.infer<typeof AttachFrameSchema>;
|
|
803
973
|
|
package/src/history-state.ts
CHANGED
|
@@ -78,6 +78,12 @@ export const HISTORY_STATE_FILES: readonly StateFile[] = [
|
|
|
78
78
|
portability: "derived",
|
|
79
79
|
note: "Each conversation re-attaches its checkout from its branch on its next turn.",
|
|
80
80
|
},
|
|
81
|
+
/* The phrase index over what every conversation said, which both search boxes read (sessions/search-index.ts).
|
|
82
|
+
* Derived in the strict sense: every row in it was extracted from `transcripts/`, which travels, so a
|
|
83
|
+
* restored sandbox rebuilds it on its first boot rather than carrying tens of megabytes of index that its
|
|
84
|
+
* own backfill would produce anyway. Until that pass finishes the searches answer from what is indexed so
|
|
85
|
+
* far and say so, which is the behaviour they already have on any first run. */
|
|
86
|
+
{ path: "said-index/", portability: "derived", note: "Rebuilt from the carried transcripts by the first boot's backfill." },
|
|
81
87
|
{ path: "overlays/", portability: "derived" },
|
|
82
88
|
{ path: "logs/", portability: "derived" },
|
|
83
89
|
{ path: "trash/", portability: "derived" },
|
package/src/index.ts
CHANGED
|
@@ -60,6 +60,7 @@ export { hostContract } from "./contracts/host.contract.js";
|
|
|
60
60
|
export { intenticContract } from "./contracts/intentic.contract.js";
|
|
61
61
|
export { inventoryContract } from "./contracts/inventory.contract.js";
|
|
62
62
|
export { logsContract } from "./contracts/logs.contract.js";
|
|
63
|
+
export { REQUEST_ID_EVIDENCE_ROUTE, REQUEST_ID_HEADER } from "./request-id.js";
|
|
63
64
|
export { loopsContract } from "./contracts/loops.contract.js";
|
|
64
65
|
export { panelsContract } from "./contracts/panels.contract.js";
|
|
65
66
|
export { portsContract } from "./contracts/ports.contract.js";
|
|
@@ -113,6 +114,7 @@ export * from "./output-fields.js";
|
|
|
113
114
|
export * from "./publish-drafts.js";
|
|
114
115
|
export * from "./schemas.js";
|
|
115
116
|
export * from "./search-globs.js";
|
|
117
|
+
export * from "./starter.js";
|
|
116
118
|
export * from "./terminal-protocol.js";
|
|
117
119
|
export * from "./title.js";
|
|
118
120
|
export * from "./versions.js";
|