@adecore/agent-contracts 0.23.1 → 0.24.1

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/chat.d.ts CHANGED
@@ -132,6 +132,32 @@ export declare const ChatTurnLimitSchema: z.ZodObject<{
132
132
  resetsAt: z.ZodOptional<z.ZodNumber>;
133
133
  }, z.core.$strip>;
134
134
  export type ChatTurnLimit = z.infer<typeof ChatTurnLimitSchema>;
135
+ export declare const ChatGoalStatusSchema: z.ZodEnum<{
136
+ active: "active";
137
+ blocked: "blocked";
138
+ "budget-limited": "budget-limited";
139
+ complete: "complete";
140
+ paused: "paused";
141
+ "usage-limited": "usage-limited";
142
+ }>;
143
+ export type ChatGoalStatus = z.infer<typeof ChatGoalStatusSchema>;
144
+ export declare const ChatGoalSchema: z.ZodObject<{
145
+ objective: z.ZodString;
146
+ status: z.ZodEnum<{
147
+ active: "active";
148
+ blocked: "blocked";
149
+ "budget-limited": "budget-limited";
150
+ complete: "complete";
151
+ paused: "paused";
152
+ "usage-limited": "usage-limited";
153
+ }>;
154
+ checks: z.ZodOptional<z.ZodNumber>;
155
+ lastCheck: z.ZodOptional<z.ZodString>;
156
+ tokensUsed: z.ZodOptional<z.ZodNumber>;
157
+ tokenBudget: z.ZodOptional<z.ZodNumber>;
158
+ secondsUsed: z.ZodOptional<z.ZodNumber>;
159
+ }, z.core.$strip>;
160
+ export type ChatGoal = z.infer<typeof ChatGoalSchema>;
135
161
  export declare const ChatQuestionSchema: z.ZodObject<{
136
162
  id: z.ZodString;
137
163
  header: z.ZodString;
@@ -364,6 +390,22 @@ export declare const ChatInfoSchema: z.ZodObject<{
364
390
  async: z.ZodOptional<z.ZodBoolean>;
365
391
  }, z.core.$strip>>;
366
392
  }, z.core.$strip>>>;
393
+ goal: z.ZodOptional<z.ZodObject<{
394
+ objective: z.ZodString;
395
+ status: z.ZodEnum<{
396
+ active: "active";
397
+ blocked: "blocked";
398
+ "budget-limited": "budget-limited";
399
+ complete: "complete";
400
+ paused: "paused";
401
+ "usage-limited": "usage-limited";
402
+ }>;
403
+ checks: z.ZodOptional<z.ZodNumber>;
404
+ lastCheck: z.ZodOptional<z.ZodString>;
405
+ tokensUsed: z.ZodOptional<z.ZodNumber>;
406
+ tokenBudget: z.ZodOptional<z.ZodNumber>;
407
+ secondsUsed: z.ZodOptional<z.ZodNumber>;
408
+ }, z.core.$strip>>;
367
409
  createdAt: z.ZodNumber;
368
410
  }, z.core.$strip>;
369
411
  export type ChatInfo = z.infer<typeof ChatInfoSchema>;
@@ -740,6 +782,7 @@ export declare const ChatSubagentUsageSchema: z.ZodObject<{
740
782
  durationMs: z.ZodNumber;
741
783
  }, z.core.$strip>;
742
784
  export type ChatSubagentUsage = z.infer<typeof ChatSubagentUsageSchema>;
785
+ export declare const HOST_TASK_ORIGIN = "ruimte";
743
786
  export declare const ChatSubagentItemSchema: z.ZodObject<{
744
787
  id: z.ZodString;
745
788
  createdAt: z.ZodNumber;
@@ -1830,6 +1873,22 @@ export declare const ChatEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1830
1873
  async: z.ZodOptional<z.ZodBoolean>;
1831
1874
  }, z.core.$strip>>;
1832
1875
  }, z.core.$strip>>>;
1876
+ goal: z.ZodOptional<z.ZodObject<{
1877
+ objective: z.ZodString;
1878
+ status: z.ZodEnum<{
1879
+ active: "active";
1880
+ blocked: "blocked";
1881
+ "budget-limited": "budget-limited";
1882
+ complete: "complete";
1883
+ paused: "paused";
1884
+ "usage-limited": "usage-limited";
1885
+ }>;
1886
+ checks: z.ZodOptional<z.ZodNumber>;
1887
+ lastCheck: z.ZodOptional<z.ZodString>;
1888
+ tokensUsed: z.ZodOptional<z.ZodNumber>;
1889
+ tokenBudget: z.ZodOptional<z.ZodNumber>;
1890
+ secondsUsed: z.ZodOptional<z.ZodNumber>;
1891
+ }, z.core.$strip>>;
1833
1892
  createdAt: z.ZodNumber;
1834
1893
  }, z.core.$strip>;
1835
1894
  }, z.core.$strip>, z.ZodObject<{
@@ -1984,6 +2043,22 @@ export declare const ChatEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1984
2043
  async: z.ZodOptional<z.ZodBoolean>;
1985
2044
  }, z.core.$strip>>;
1986
2045
  }, z.core.$strip>>>;
2046
+ goal: z.ZodOptional<z.ZodObject<{
2047
+ objective: z.ZodString;
2048
+ status: z.ZodEnum<{
2049
+ active: "active";
2050
+ blocked: "blocked";
2051
+ "budget-limited": "budget-limited";
2052
+ complete: "complete";
2053
+ paused: "paused";
2054
+ "usage-limited": "usage-limited";
2055
+ }>;
2056
+ checks: z.ZodOptional<z.ZodNumber>;
2057
+ lastCheck: z.ZodOptional<z.ZodString>;
2058
+ tokensUsed: z.ZodOptional<z.ZodNumber>;
2059
+ tokenBudget: z.ZodOptional<z.ZodNumber>;
2060
+ secondsUsed: z.ZodOptional<z.ZodNumber>;
2061
+ }, z.core.$strip>>;
1987
2062
  createdAt: z.ZodNumber;
1988
2063
  }, z.core.$strip>;
1989
2064
  items: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -2849,6 +2924,22 @@ export declare const ChatEventEnvelopeSchema: z.ZodObject<{
2849
2924
  async: z.ZodOptional<z.ZodBoolean>;
2850
2925
  }, z.core.$strip>>;
2851
2926
  }, z.core.$strip>>>;
2927
+ goal: z.ZodOptional<z.ZodObject<{
2928
+ objective: z.ZodString;
2929
+ status: z.ZodEnum<{
2930
+ active: "active";
2931
+ blocked: "blocked";
2932
+ "budget-limited": "budget-limited";
2933
+ complete: "complete";
2934
+ paused: "paused";
2935
+ "usage-limited": "usage-limited";
2936
+ }>;
2937
+ checks: z.ZodOptional<z.ZodNumber>;
2938
+ lastCheck: z.ZodOptional<z.ZodString>;
2939
+ tokensUsed: z.ZodOptional<z.ZodNumber>;
2940
+ tokenBudget: z.ZodOptional<z.ZodNumber>;
2941
+ secondsUsed: z.ZodOptional<z.ZodNumber>;
2942
+ }, z.core.$strip>>;
2852
2943
  createdAt: z.ZodNumber;
2853
2944
  }, z.core.$strip>;
2854
2945
  }, z.core.$strip>, z.ZodObject<{
@@ -3003,6 +3094,22 @@ export declare const ChatEventEnvelopeSchema: z.ZodObject<{
3003
3094
  async: z.ZodOptional<z.ZodBoolean>;
3004
3095
  }, z.core.$strip>>;
3005
3096
  }, z.core.$strip>>>;
3097
+ goal: z.ZodOptional<z.ZodObject<{
3098
+ objective: z.ZodString;
3099
+ status: z.ZodEnum<{
3100
+ active: "active";
3101
+ blocked: "blocked";
3102
+ "budget-limited": "budget-limited";
3103
+ complete: "complete";
3104
+ paused: "paused";
3105
+ "usage-limited": "usage-limited";
3106
+ }>;
3107
+ checks: z.ZodOptional<z.ZodNumber>;
3108
+ lastCheck: z.ZodOptional<z.ZodString>;
3109
+ tokensUsed: z.ZodOptional<z.ZodNumber>;
3110
+ tokenBudget: z.ZodOptional<z.ZodNumber>;
3111
+ secondsUsed: z.ZodOptional<z.ZodNumber>;
3112
+ }, z.core.$strip>>;
3006
3113
  createdAt: z.ZodNumber;
3007
3114
  }, z.core.$strip>;
3008
3115
  items: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -3780,6 +3887,21 @@ export declare const ChatStopSubagentPayloadSchema: z.ZodObject<{
3780
3887
  toolUseId: z.ZodString;
3781
3888
  }, z.core.$strip>;
3782
3889
  export type ChatStopSubagentPayload = z.infer<typeof ChatStopSubagentPayloadSchema>;
3890
+ export declare const ChatGoalActionSchema: z.ZodEnum<{
3891
+ clear: "clear";
3892
+ pause: "pause";
3893
+ resume: "resume";
3894
+ }>;
3895
+ export type ChatGoalAction = z.infer<typeof ChatGoalActionSchema>;
3896
+ export declare const ChatGoalPayloadSchema: z.ZodObject<{
3897
+ chatId: z.ZodString;
3898
+ action: z.ZodEnum<{
3899
+ clear: "clear";
3900
+ pause: "pause";
3901
+ resume: "resume";
3902
+ }>;
3903
+ }, z.core.$strip>;
3904
+ export type ChatGoalPayload = z.infer<typeof ChatGoalPayloadSchema>;
3783
3905
  export declare const ChatStopTaskPayloadSchema: z.ZodObject<{
3784
3906
  chatId: z.ZodString;
3785
3907
  taskId: z.ZodString;
@@ -4341,6 +4463,22 @@ export declare const ChatStatusEventSchema: z.ZodObject<{
4341
4463
  async: z.ZodOptional<z.ZodBoolean>;
4342
4464
  }, z.core.$strip>>;
4343
4465
  }, z.core.$strip>>>;
4466
+ goal: z.ZodOptional<z.ZodObject<{
4467
+ objective: z.ZodString;
4468
+ status: z.ZodEnum<{
4469
+ active: "active";
4470
+ blocked: "blocked";
4471
+ "budget-limited": "budget-limited";
4472
+ complete: "complete";
4473
+ paused: "paused";
4474
+ "usage-limited": "usage-limited";
4475
+ }>;
4476
+ checks: z.ZodOptional<z.ZodNumber>;
4477
+ lastCheck: z.ZodOptional<z.ZodString>;
4478
+ tokensUsed: z.ZodOptional<z.ZodNumber>;
4479
+ tokenBudget: z.ZodOptional<z.ZodNumber>;
4480
+ secondsUsed: z.ZodOptional<z.ZodNumber>;
4481
+ }, z.core.$strip>>;
4344
4482
  createdAt: z.ZodNumber;
4345
4483
  }, z.core.$strip>;
4346
4484
  }, z.core.$strip>;
@@ -4593,6 +4731,22 @@ export declare const ChatAttachResultSchema: z.ZodObject<{
4593
4731
  async: z.ZodOptional<z.ZodBoolean>;
4594
4732
  }, z.core.$strip>>;
4595
4733
  }, z.core.$strip>>>;
4734
+ goal: z.ZodOptional<z.ZodObject<{
4735
+ objective: z.ZodString;
4736
+ status: z.ZodEnum<{
4737
+ active: "active";
4738
+ blocked: "blocked";
4739
+ "budget-limited": "budget-limited";
4740
+ complete: "complete";
4741
+ paused: "paused";
4742
+ "usage-limited": "usage-limited";
4743
+ }>;
4744
+ checks: z.ZodOptional<z.ZodNumber>;
4745
+ lastCheck: z.ZodOptional<z.ZodString>;
4746
+ tokensUsed: z.ZodOptional<z.ZodNumber>;
4747
+ tokenBudget: z.ZodOptional<z.ZodNumber>;
4748
+ secondsUsed: z.ZodOptional<z.ZodNumber>;
4749
+ }, z.core.$strip>>;
4596
4750
  createdAt: z.ZodNumber;
4597
4751
  }, z.core.$strip>;
4598
4752
  items: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -5784,6 +5938,22 @@ export declare const ChatAttachResultSchema: z.ZodObject<{
5784
5938
  async: z.ZodOptional<z.ZodBoolean>;
5785
5939
  }, z.core.$strip>>;
5786
5940
  }, z.core.$strip>>>;
5941
+ goal: z.ZodOptional<z.ZodObject<{
5942
+ objective: z.ZodString;
5943
+ status: z.ZodEnum<{
5944
+ active: "active";
5945
+ blocked: "blocked";
5946
+ "budget-limited": "budget-limited";
5947
+ complete: "complete";
5948
+ paused: "paused";
5949
+ "usage-limited": "usage-limited";
5950
+ }>;
5951
+ checks: z.ZodOptional<z.ZodNumber>;
5952
+ lastCheck: z.ZodOptional<z.ZodString>;
5953
+ tokensUsed: z.ZodOptional<z.ZodNumber>;
5954
+ tokenBudget: z.ZodOptional<z.ZodNumber>;
5955
+ secondsUsed: z.ZodOptional<z.ZodNumber>;
5956
+ }, z.core.$strip>>;
5787
5957
  createdAt: z.ZodNumber;
5788
5958
  }, z.core.$strip>;
5789
5959
  }, z.core.$strip>, z.ZodObject<{
@@ -5938,6 +6108,22 @@ export declare const ChatAttachResultSchema: z.ZodObject<{
5938
6108
  async: z.ZodOptional<z.ZodBoolean>;
5939
6109
  }, z.core.$strip>>;
5940
6110
  }, z.core.$strip>>>;
6111
+ goal: z.ZodOptional<z.ZodObject<{
6112
+ objective: z.ZodString;
6113
+ status: z.ZodEnum<{
6114
+ active: "active";
6115
+ blocked: "blocked";
6116
+ "budget-limited": "budget-limited";
6117
+ complete: "complete";
6118
+ paused: "paused";
6119
+ "usage-limited": "usage-limited";
6120
+ }>;
6121
+ checks: z.ZodOptional<z.ZodNumber>;
6122
+ lastCheck: z.ZodOptional<z.ZodString>;
6123
+ tokensUsed: z.ZodOptional<z.ZodNumber>;
6124
+ tokenBudget: z.ZodOptional<z.ZodNumber>;
6125
+ secondsUsed: z.ZodOptional<z.ZodNumber>;
6126
+ }, z.core.$strip>>;
5941
6127
  createdAt: z.ZodNumber;
5942
6128
  }, z.core.$strip>;
5943
6129
  items: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -6610,6 +6796,22 @@ export declare const ChatForkResultSchema: z.ZodObject<{
6610
6796
  async: z.ZodOptional<z.ZodBoolean>;
6611
6797
  }, z.core.$strip>>;
6612
6798
  }, z.core.$strip>>>;
6799
+ goal: z.ZodOptional<z.ZodObject<{
6800
+ objective: z.ZodString;
6801
+ status: z.ZodEnum<{
6802
+ active: "active";
6803
+ blocked: "blocked";
6804
+ "budget-limited": "budget-limited";
6805
+ complete: "complete";
6806
+ paused: "paused";
6807
+ "usage-limited": "usage-limited";
6808
+ }>;
6809
+ checks: z.ZodOptional<z.ZodNumber>;
6810
+ lastCheck: z.ZodOptional<z.ZodString>;
6811
+ tokensUsed: z.ZodOptional<z.ZodNumber>;
6812
+ tokenBudget: z.ZodOptional<z.ZodNumber>;
6813
+ secondsUsed: z.ZodOptional<z.ZodNumber>;
6814
+ }, z.core.$strip>>;
6613
6815
  createdAt: z.ZodNumber;
6614
6816
  }, z.core.$strip>;
6615
6817
  nodeId: z.ZodString;
@@ -6795,6 +6997,22 @@ export declare const ChatContinueOnResultSchema: z.ZodObject<{
6795
6997
  async: z.ZodOptional<z.ZodBoolean>;
6796
6998
  }, z.core.$strip>>;
6797
6999
  }, z.core.$strip>>>;
7000
+ goal: z.ZodOptional<z.ZodObject<{
7001
+ objective: z.ZodString;
7002
+ status: z.ZodEnum<{
7003
+ active: "active";
7004
+ blocked: "blocked";
7005
+ "budget-limited": "budget-limited";
7006
+ complete: "complete";
7007
+ paused: "paused";
7008
+ "usage-limited": "usage-limited";
7009
+ }>;
7010
+ checks: z.ZodOptional<z.ZodNumber>;
7011
+ lastCheck: z.ZodOptional<z.ZodString>;
7012
+ tokensUsed: z.ZodOptional<z.ZodNumber>;
7013
+ tokenBudget: z.ZodOptional<z.ZodNumber>;
7014
+ secondsUsed: z.ZodOptional<z.ZodNumber>;
7015
+ }, z.core.$strip>>;
6798
7016
  createdAt: z.ZodNumber;
6799
7017
  }, z.core.$strip>;
6800
7018
  nodeId: z.ZodString;
@@ -6994,6 +7212,22 @@ export declare const ChatListResultSchema: z.ZodObject<{
6994
7212
  async: z.ZodOptional<z.ZodBoolean>;
6995
7213
  }, z.core.$strip>>;
6996
7214
  }, z.core.$strip>>>;
7215
+ goal: z.ZodOptional<z.ZodObject<{
7216
+ objective: z.ZodString;
7217
+ status: z.ZodEnum<{
7218
+ active: "active";
7219
+ blocked: "blocked";
7220
+ "budget-limited": "budget-limited";
7221
+ complete: "complete";
7222
+ paused: "paused";
7223
+ "usage-limited": "usage-limited";
7224
+ }>;
7225
+ checks: z.ZodOptional<z.ZodNumber>;
7226
+ lastCheck: z.ZodOptional<z.ZodString>;
7227
+ tokensUsed: z.ZodOptional<z.ZodNumber>;
7228
+ tokenBudget: z.ZodOptional<z.ZodNumber>;
7229
+ secondsUsed: z.ZodOptional<z.ZodNumber>;
7230
+ }, z.core.$strip>>;
6997
7231
  createdAt: z.ZodNumber;
6998
7232
  }, z.core.$strip>>;
6999
7233
  }, z.core.$strip>;
package/dist/chat.js CHANGED
@@ -137,6 +137,24 @@ export const ChatTurnLimitSchema = z.object({
137
137
  // When the limit lifts, in milliseconds since the epoch; absent when the CLI named no time.
138
138
  resetsAt: z.number().optional()
139
139
  });
140
+ /*
141
+ * A goal the chat's CLI works toward on its own, turn after turn, until it is met: Claude Code's and Codex's
142
+ * `/goal`. The statuses are this schema's own, so a client that validates a chat payload whole never meets
143
+ * a new value inside one it already knew. `usage-limited` and `budget-limited` are Codex's: the plan's limit,
144
+ * or the token budget the goal was given.
145
+ */
146
+ export const ChatGoalStatusSchema = z.enum(['active', 'paused', 'blocked', 'usage-limited', 'budget-limited', 'complete']);
147
+ export const ChatGoalSchema = z.object({
148
+ objective: z.string(),
149
+ status: ChatGoalStatusSchema,
150
+ // How often the CLI's own check found the goal not met yet and sent the agent on; absent from a CLI that counts tokens instead.
151
+ checks: z.number().int().nonnegative().optional(),
152
+ // What that check last said was still missing.
153
+ lastCheck: z.string().optional(),
154
+ tokensUsed: z.number().int().nonnegative().optional(),
155
+ tokenBudget: z.number().int().positive().optional(),
156
+ secondsUsed: z.number().int().nonnegative().optional()
157
+ });
140
158
  export const ChatQuestionSchema = z.object({
141
159
  id: z.string(),
142
160
  header: z.string(),
@@ -235,6 +253,8 @@ export const ChatInfoSchema = z.object({
235
253
  resumeAt: z.number().optional(),
236
254
  // What the chat waits on a person for, oldest first and at most `CHAT_REQUEST_LIMITS.perChat`; absent while nothing waits.
237
255
  requests: z.array(ChatRequestSummarySchema).optional(),
256
+ // The goal the CLI works toward, from the moment one is set until it is cleared; absent while there is none.
257
+ goal: ChatGoalSchema.optional(),
238
258
  createdAt: z.number()
239
259
  });
240
260
  // Where a skill was found: the person's own folder, the chat's folder, or a plugin.
@@ -387,6 +407,8 @@ export const ChatSubagentUsageSchema = z.object({
387
407
  * ordinary items that carry `parentToolUseId`, so streaming keeps working; the timeline gathers
388
408
  * them under this row. `result` is the report it ended with, as markdown.
389
409
  */
410
+ // The `origin` of a subagent row a host opened with a task of its own rather than the CLI with its tool; a legacy spelling that stored threads carry.
411
+ export const HOST_TASK_ORIGIN = 'ruimte';
390
412
  export const ChatSubagentItemSchema = z.object({
391
413
  ...base,
392
414
  kind: z.literal('subagent'),
@@ -415,8 +437,7 @@ export const ChatSubagentItemSchema = z.object({
415
437
  // Where the CLI keeps this subagent's own conversation; set once the daemon found it.
416
438
  native: z.object({ agentId: z.string().optional(), threadId: z.string().optional() }).optional(),
417
439
  // Who opened it: the CLI with its own tool, or a verb with `--task` that made a node; absent is `native`.
418
- // The second value keeps its legacy spelling, since stored threads carry it.
419
- origin: z.enum(['native', 'ruimte']).optional(),
440
+ origin: z.enum(['native', HOST_TASK_ORIGIN]).optional(),
420
441
  // The node a `--task` opened, whose own conversation this row stands for.
421
442
  childId: z.string().optional(),
422
443
  // Set for an agent a subagent opened, with the id of that subagent's own Agent call; its row hangs under that one.
@@ -628,6 +649,9 @@ export const ChatStopSubagentPayloadSchema = ChatTargetPayloadSchema.extend({
628
649
  // A running row of the chat's own thread: a task's node is stopped, a subagent of the CLI's own only marked.
629
650
  toolUseId: z.string().min(1).max(256)
630
651
  });
652
+ // What a person does to a chat's goal without a turn of its own; `pause` and `resume` only where the CLI's protocol has them.
653
+ export const ChatGoalActionSchema = z.enum(['pause', 'resume', 'clear']);
654
+ export const ChatGoalPayloadSchema = ChatTargetPayloadSchema.extend({ action: ChatGoalActionSchema });
631
655
  export const ChatStopTaskPayloadSchema = ChatTargetPayloadSchema.extend({ taskId: z.string().min(1).max(256) });
632
656
  // `start` is the place in the conversation for a source that numbers it; a Codex thread pages by its own cursor only.
633
657
  export const ChatSubagentPageSchema = z.object({
package/dist/index.d.ts CHANGED
@@ -1,13 +1,14 @@
1
- export * from './agent.ts';
2
- export * from './chat.ts';
3
- export * from './envelope.ts';
4
- export * from './ids.ts';
5
- export * from './model.ts';
6
- export * from './protocol.ts';
7
- export * from './provider-accounts.ts';
8
- export * from './task.ts';
9
- export * from './text.ts';
10
- export * from './usage.ts';
11
- export * from './visual.ts';
12
- export * from './worktree.ts';
13
- export type * from './port.ts';
1
+ export { AgentKindSchema, type AgentKind, AgentStatusSchema, type AgentStatus, SUGGESTED_TITLE_LIMIT, SuggestedTitleSchema, AgentRequestSchema, type AgentRequest, AgentInfoSchema, type AgentInfo, SessionStatusEventSchema, type SessionStatusEvent, AgentResumePayloadSchema, type AgentResumePayload, ApprovalChoiceSchema, type ApprovalChoice, ApprovalRequestSchema, type ApprovalRequest, SessionApprovalsEventSchema, type SessionApprovalsEvent, ApprovalAnswerPayloadSchema, type ApprovalAnswerPayload, ApprovalAnswerResultSchema, type ApprovalAnswerResult, ApprovalPreferencePayloadSchema, type ApprovalPreferencePayload } from './agent.ts';
2
+ export { ChatIdSchema, type ChatId, ChatContextBreakdownSchema, type ChatContextBreakdown, ChatUsageSchema, type ChatUsage, CHAT_ATTACHMENTS_MAX_BYTES, CHAT_ATTACHMENT_MAX_BYTES, CHAT_ATTACHMENTS_MAX_COUNT, attachmentBytes, attachmentImageMime, ChatAttachmentUploadSchema, type ChatAttachmentUpload, ChatAttachmentUploadsSchema, ChatAttachmentSchema, type ChatAttachment, ChatUiChoiceOriginSchema, type ChatUiChoiceOrigin, ChatUiAnswerSchema, type ChatUiAnswer, ChatQuoteSourceSchema, type ChatQuoteSource, ChatQueuedMessageSchema, type ChatQueuedMessage, ChatBackgroundTaskSchema, type ChatBackgroundTask, ChatTurnLimitSchema, type ChatTurnLimit, ChatGoalStatusSchema, type ChatGoalStatus, ChatGoalSchema, type ChatGoal, ChatQuestionSchema, type ChatQuestion, ChatRequestKindSchema, type ChatRequestKind, CHAT_REQUEST_LIMITS, ChatRequestApprovalSchema, type ChatRequestApproval, ChatRequestSummarySchema, type ChatRequestSummary, ChatInfoSchema, type ChatInfo, ChatSkillSourceSchema, type ChatSkillSource, ChatSkillSchema, type ChatSkill, SkillsListPayloadSchema, type SkillsListPayload, SkillsListResultSchema, type SkillsListResult, ChatUserItemSchema, ChatUiQueryReadingSchema, type ChatUiQueryReading, ChatUiLinkReadingSchema, type ChatUiLinkReading, ChatUiQueryStateSchema, type ChatUiQueryState, ChatAssistantItemSchema, ChatThinkingItemSchema, ChatToolStateSchema, type ChatToolState, ChatToolProgressSchema, type ChatToolProgress, ChatFileChangeSchema, type ChatFileChange, ChatSubagentStatusSchema, type ChatSubagentStatus, ChatWorkflowPhaseSchema, type ChatWorkflowPhase, ChatWorkflowAgentSchema, type ChatWorkflowAgent, ChatWorkflowSchema, type ChatWorkflow, workflowAgentRef, workflowAgentIdOf, ChatToolItemSchema, ChatSubagentUsageSchema, type ChatSubagentUsage, HOST_TASK_ORIGIN, ChatSubagentItemSchema, ChatApprovalDecisionSchema, type ChatApprovalDecision, ChatApprovalItemSchema, ChatQuestionItemSchema, ChatCheckpointFileSchema, type ChatCheckpointFile, ChatCheckpointDiffSchema, type ChatCheckpointDiff, ChatTurnItemSchema, notResumedNote, abortedByMachine, WAITING_NOTE_PREFIX, ChatNoteItemSchema, ChatCompactionItemSchema, ChatItemSchema, type ChatItem, type ChatUserItem, type ChatAssistantItem, type ChatThinkingItem, type ChatToolItem, type ChatSubagentItem, type ChatApprovalItem, type ChatQuestionItem, type ChatTurnItem, type ChatNoteItem, type ChatCompactionItem, ChatEventSchema, type ChatEvent, ChatEventEnvelopeSchema, type ChatEventEnvelope, ChatCreatePayloadSchema, type ChatCreatePayload, ChatConfigurePayloadSchema, type ChatConfigurePayload, ChatPreferencesPayloadSchema, type ChatPreferencesPayload, ChatTargetPayloadSchema, type ChatTargetPayload, ChatClearPayloadSchema, type ChatClearPayload, ChatCancelPayloadSchema, type ChatCancelPayload, ChatAttachPayloadSchema, ChatHistoryPayloadSchema, ChatHistoryPageSchema, ChatHistoryResultSchema, type ChatHistoryResult, ChatSubagentPayloadSchema, type ChatSubagentPayload, ChatStopSubagentPayloadSchema, type ChatStopSubagentPayload, ChatGoalActionSchema, type ChatGoalAction, ChatGoalPayloadSchema, type ChatGoalPayload, ChatStopTaskPayloadSchema, type ChatStopTaskPayload, ChatSubagentPageSchema, ChatSubagentSourceSchema, type ChatSubagentSource, ChatSubagentResultSchema, type ChatSubagentResult, ChatStatusEventSchema, type ChatStatusEvent, ChatSubagentChangedEventSchema, type ChatSubagentChangedEvent, CHAT_BOOKMARK_LIMITS, ChatBookmarkSchema, type ChatBookmark, ChatBookmarksSchema, ChatAddBookmarkPayloadSchema, type ChatAddBookmarkPayload, ChatRenameBookmarkPayloadSchema, type ChatRenameBookmarkPayload, ChatRemoveBookmarkPayloadSchema, type ChatRemoveBookmarkPayload, ChatBookmarksResultSchema, type ChatBookmarksResult, ChatBookmarksEventSchema, type ChatBookmarksEvent, ChatRemoveVisualPayloadSchema, type ChatRemoveVisualPayload, ChatVisualsResultSchema, type ChatVisualsResult, ChatVisualsEventSchema, type ChatVisualsEvent, ChatAttachResultSchema, type ChatAttachResult, ChatDeliverySchema, type ChatDelivery, ChatSendPayloadSchema, type ChatSendPayload, ChatSendResultSchema, type ChatSendResult, ChatUiChoicePayloadSchema, type ChatUiChoicePayload, ChatUiQueryPayloadSchema, type ChatUiQueryPayload, ChatUiLinkPayloadSchema, type ChatUiLinkPayload, ChatQueuePayloadSchema, type ChatQueuePayload, ChatUnqueueResultSchema, type ChatUnqueueResult, ChatApprovePayloadSchema, type ChatApprovePayload, ChatDismissPayloadSchema, type ChatDismissPayload, ChatAnswerPayloadSchema, type ChatAnswerPayload, ChatTurnDiffPayloadSchema, type ChatTurnDiffPayload, ChatTurnDiffResultSchema, type ChatTurnDiffResult, CHAT_FORK_TITLE_MAX, ChatForkPayloadSchema, type ChatForkPayload, ChatForkResultSchema, type ChatForkResult, ChatContinueOnPayloadSchema, type ChatContinueOnPayload, ChatContinueOnResultSchema, type ChatContinueOnResult, ChatSummarizePayloadSchema, type ChatSummarizePayload, ChatSummarizeResultSchema, type ChatSummarizeResult, ChatForkInfoPayloadSchema, type ChatForkInfoPayload, ChatForkInfoResultSchema, type ChatForkInfoResult, ChatListResultSchema, type ChatListResult, GeneratedImageInputSchema, type GeneratedImageInput, generatedImageAttachment } from './chat.ts';
3
+ export { ErrorSchema, type WireError, RequestSchema, type Request, ReplyOkSchema, type ReplyOk, ReplyErrorSchema, type ReplyError, ReplySchema, type Reply, EventSchema, type Event, ServerFrameSchema, type ServerFrame, type ParseResult, parseRequest, parseServerFrame } from './envelope.ts';
4
+ export { SessionIdSchema, type SessionId } from './ids.ts';
5
+ export { ModelOptionChoiceSchema, type ModelOptionChoice, ModelOptionDescriptorSchema, type ModelOptionDescriptor, ModelInfoSchema, type ModelInfo, ModelSelectionSchema, type ModelSelection, ModelCatalogProfileSchema, type ModelCatalogProfile, ModelCatalogEntrySchema, type ModelCatalogEntry, ModelCatalogDataSchema, type ModelCatalogData, RuntimeModeSchema, type RuntimeMode, ProviderCapabilitiesSchema, type ProviderCapabilities, ProviderInfoSchema, type ProviderInfo, ProviderListResultSchema, type ProviderListResult, resumeCommandFor } from './model.ts';
6
+ export type { FramePort } from './port.ts';
7
+ export { EmptySchema, AGENT_REQUEST_SCHEMAS, AGENT_EVENT_SCHEMAS, type AgentRequestType, type AgentEventType } from './protocol.ts';
8
+ export { ProviderAccountIdSchema, type ProviderAccountId, ProviderAccountVariableSchema, type ProviderAccountVariable, ProviderAccountSchema, type ProviderAccount, ProviderAccountStateSchema, type ProviderAccountState, ProviderAccountStatusSchema, type ProviderAccountStatus, ProviderAccountMapSchema, type ProviderAccountMap, ProviderAccountsSchema, type ProviderAccounts, ProviderAccountsSavePayloadSchema, type ProviderAccountsSavePayload, ProviderAccountCreatePayloadSchema, type ProviderAccountCreatePayload, ProviderAccountCreateResultSchema, type ProviderAccountCreateResult, ProviderAccountWatchLoginPayloadSchema, type ProviderAccountWatchLoginPayload } from './provider-accounts.ts';
9
+ export { isRecord } from './record.ts';
10
+ export { TaskStatusSchema, type TaskStatus, TaskResultSchema, type TaskResult, TaskSchema, type Task, TaskChangedEventSchema, type TaskChangedEvent } from './task.ts';
11
+ export { clipText, TOOL_OUTPUT_TAIL, appendToolOutput } from './text.ts';
12
+ export { UsageProviderSchema, type UsageProvider, USAGE_PROVIDERS, UsageResolutionSchema, type UsageResolution, UsageTotalsSchema, type UsageTotals, EMPTY_TOTALS, totalTokensOf, addTotals, UsageAccountSchema, type UsageAccount, UsageBucketSchema, type UsageBucket, UsagePriceBasisSchema, type UsagePriceBasis, UsageModelSchema, type UsageModel, UsageProjectSchema, type UsageProject, UsageSummaryPayloadSchema, type UsageSummaryPayload, UsageScanSchema, type UsageScan, UsagePricingSchema, type UsagePricing, UsageRootSchema, type UsageRoot, UsageRateSchema, type UsageRate, UsageSummaryResultSchema, type UsageSummaryResult, UsageChangedEventSchema, type UsageChangedEvent, UsageWindowSchema, type UsageWindow, UsageLimitsProviderSchema, type UsageLimitsProvider, UsageLimitsSnapshotSchema, type UsageLimitsSnapshot } from './usage.ts';
13
+ export { VISUAL_LIMITS, VISUAL_MEASURE_WIDTHS, VisualHeightSchema, type VisualHeight, VisualLayoutSchema, type VisualLayout, ChatVisualSchema, type ChatVisual, ChatVisualsSchema, visualFrameHeight, VISUAL_BRIDGE_METHODS, type VisualAppearance, type VisualTheme, type VisualRequestId, type VisualViewport, type VisualScrollRequest, visualViewportMessage, visualScrollMessage, type VisualMessage, visualProxyReadyMessage, visualResourceReadyMessage, visualHostContextMessage, visualSizeChangedMessage, visualOpenLinkRequest, visualOpenLinkResult, parseVisualMessage, VISUAL_THEME_VARIABLES, type VisualThemeVariable, VISUAL_LIGHT_THEME, VISUAL_DARK_THEME, cleanVisualVariables, visualThemeFragment, VISUAL_PAGE_RULES, VISUAL_LAYOUT_GUIDE, VISUAL_THEME_GUIDE, injectVisualBootstrap, VISUAL_HOST_PAGE } from './visual.ts';
14
+ export { WorktreeWorkSchema, type WorktreeWork, WorktreeSchema, type Worktree } from './worktree.ts';
package/dist/index.js CHANGED
@@ -1,12 +1,14 @@
1
- export * from './agent.js';
2
- export * from './chat.js';
3
- export * from './envelope.js';
4
- export * from './ids.js';
5
- export * from './model.js';
6
- export * from './protocol.js';
7
- export * from './provider-accounts.js';
8
- export * from './task.js';
9
- export * from './text.js';
10
- export * from './usage.js';
11
- export * from './visual.js';
12
- export * from './worktree.js';
1
+ // Public API: exports.test.ts snapshots this list, so a name added or dropped here is an API change.
2
+ export { AgentKindSchema, AgentStatusSchema, SUGGESTED_TITLE_LIMIT, SuggestedTitleSchema, AgentRequestSchema, AgentInfoSchema, SessionStatusEventSchema, AgentResumePayloadSchema, ApprovalChoiceSchema, ApprovalRequestSchema, SessionApprovalsEventSchema, ApprovalAnswerPayloadSchema, ApprovalAnswerResultSchema, ApprovalPreferencePayloadSchema } from './agent.js';
3
+ export { ChatIdSchema, ChatContextBreakdownSchema, ChatUsageSchema, CHAT_ATTACHMENTS_MAX_BYTES, CHAT_ATTACHMENT_MAX_BYTES, CHAT_ATTACHMENTS_MAX_COUNT, attachmentBytes, attachmentImageMime, ChatAttachmentUploadSchema, ChatAttachmentUploadsSchema, ChatAttachmentSchema, ChatUiChoiceOriginSchema, ChatUiAnswerSchema, ChatQuoteSourceSchema, ChatQueuedMessageSchema, ChatBackgroundTaskSchema, ChatTurnLimitSchema, ChatGoalStatusSchema, ChatGoalSchema, ChatQuestionSchema, ChatRequestKindSchema, CHAT_REQUEST_LIMITS, ChatRequestApprovalSchema, ChatRequestSummarySchema, ChatInfoSchema, ChatSkillSourceSchema, ChatSkillSchema, SkillsListPayloadSchema, SkillsListResultSchema, ChatUserItemSchema, ChatUiQueryReadingSchema, ChatUiLinkReadingSchema, ChatUiQueryStateSchema, ChatAssistantItemSchema, ChatThinkingItemSchema, ChatToolStateSchema, ChatToolProgressSchema, ChatFileChangeSchema, ChatSubagentStatusSchema, ChatWorkflowPhaseSchema, ChatWorkflowAgentSchema, ChatWorkflowSchema, workflowAgentRef, workflowAgentIdOf, ChatToolItemSchema, ChatSubagentUsageSchema, HOST_TASK_ORIGIN, ChatSubagentItemSchema, ChatApprovalDecisionSchema, ChatApprovalItemSchema, ChatQuestionItemSchema, ChatCheckpointFileSchema, ChatCheckpointDiffSchema, ChatTurnItemSchema, notResumedNote, abortedByMachine, WAITING_NOTE_PREFIX, ChatNoteItemSchema, ChatCompactionItemSchema, ChatItemSchema, ChatEventSchema, ChatEventEnvelopeSchema, ChatCreatePayloadSchema, ChatConfigurePayloadSchema, ChatPreferencesPayloadSchema, ChatTargetPayloadSchema, ChatClearPayloadSchema, ChatCancelPayloadSchema, ChatAttachPayloadSchema, ChatHistoryPayloadSchema, ChatHistoryPageSchema, ChatHistoryResultSchema, ChatSubagentPayloadSchema, ChatStopSubagentPayloadSchema, ChatGoalActionSchema, ChatGoalPayloadSchema, ChatStopTaskPayloadSchema, ChatSubagentPageSchema, ChatSubagentSourceSchema, ChatSubagentResultSchema, ChatStatusEventSchema, ChatSubagentChangedEventSchema, CHAT_BOOKMARK_LIMITS, ChatBookmarkSchema, ChatBookmarksSchema, ChatAddBookmarkPayloadSchema, ChatRenameBookmarkPayloadSchema, ChatRemoveBookmarkPayloadSchema, ChatBookmarksResultSchema, ChatBookmarksEventSchema, ChatRemoveVisualPayloadSchema, ChatVisualsResultSchema, ChatVisualsEventSchema, ChatAttachResultSchema, ChatDeliverySchema, ChatSendPayloadSchema, ChatSendResultSchema, ChatUiChoicePayloadSchema, ChatUiQueryPayloadSchema, ChatUiLinkPayloadSchema, ChatQueuePayloadSchema, ChatUnqueueResultSchema, ChatApprovePayloadSchema, ChatDismissPayloadSchema, ChatAnswerPayloadSchema, ChatTurnDiffPayloadSchema, ChatTurnDiffResultSchema, CHAT_FORK_TITLE_MAX, ChatForkPayloadSchema, ChatForkResultSchema, ChatContinueOnPayloadSchema, ChatContinueOnResultSchema, ChatSummarizePayloadSchema, ChatSummarizeResultSchema, ChatForkInfoPayloadSchema, ChatForkInfoResultSchema, ChatListResultSchema, GeneratedImageInputSchema, generatedImageAttachment } from './chat.js';
4
+ export { ErrorSchema, RequestSchema, ReplyOkSchema, ReplyErrorSchema, ReplySchema, EventSchema, ServerFrameSchema, parseRequest, parseServerFrame } from './envelope.js';
5
+ export { SessionIdSchema } from './ids.js';
6
+ export { ModelOptionChoiceSchema, ModelOptionDescriptorSchema, ModelInfoSchema, ModelSelectionSchema, ModelCatalogProfileSchema, ModelCatalogEntrySchema, ModelCatalogDataSchema, RuntimeModeSchema, ProviderCapabilitiesSchema, ProviderInfoSchema, ProviderListResultSchema, resumeCommandFor } from './model.js';
7
+ export { EmptySchema, AGENT_REQUEST_SCHEMAS, AGENT_EVENT_SCHEMAS } from './protocol.js';
8
+ export { ProviderAccountIdSchema, ProviderAccountVariableSchema, ProviderAccountSchema, ProviderAccountStateSchema, ProviderAccountStatusSchema, ProviderAccountMapSchema, ProviderAccountsSchema, ProviderAccountsSavePayloadSchema, ProviderAccountCreatePayloadSchema, ProviderAccountCreateResultSchema, ProviderAccountWatchLoginPayloadSchema } from './provider-accounts.js';
9
+ export { isRecord } from './record.js';
10
+ export { TaskStatusSchema, TaskResultSchema, TaskSchema, TaskChangedEventSchema } from './task.js';
11
+ export { clipText, TOOL_OUTPUT_TAIL, appendToolOutput } from './text.js';
12
+ export { UsageProviderSchema, USAGE_PROVIDERS, UsageResolutionSchema, UsageTotalsSchema, EMPTY_TOTALS, totalTokensOf, addTotals, UsageAccountSchema, UsageBucketSchema, UsagePriceBasisSchema, UsageModelSchema, UsageProjectSchema, UsageSummaryPayloadSchema, UsageScanSchema, UsagePricingSchema, UsageRootSchema, UsageRateSchema, UsageSummaryResultSchema, UsageChangedEventSchema, UsageWindowSchema, UsageLimitsProviderSchema, UsageLimitsSnapshotSchema } from './usage.js';
13
+ export { VISUAL_LIMITS, VISUAL_MEASURE_WIDTHS, VisualHeightSchema, VisualLayoutSchema, ChatVisualSchema, ChatVisualsSchema, visualFrameHeight, VISUAL_BRIDGE_METHODS, visualViewportMessage, visualScrollMessage, visualProxyReadyMessage, visualResourceReadyMessage, visualHostContextMessage, visualSizeChangedMessage, visualOpenLinkRequest, visualOpenLinkResult, parseVisualMessage, VISUAL_THEME_VARIABLES, VISUAL_LIGHT_THEME, VISUAL_DARK_THEME, cleanVisualVariables, visualThemeFragment, VISUAL_PAGE_RULES, VISUAL_LAYOUT_GUIDE, VISUAL_THEME_GUIDE, injectVisualBootstrap, VISUAL_HOST_PAGE } from './visual.js';
14
+ export { WorktreeWorkSchema, WorktreeSchema } from './worktree.js';
package/dist/model.d.ts CHANGED
@@ -141,6 +141,7 @@ export declare const ProviderCapabilitiesSchema: z.ZodObject<{
141
141
  denyReason: z.ZodBoolean;
142
142
  allowAlways: z.ZodBoolean;
143
143
  asyncQuestions: z.ZodBoolean;
144
+ steer: z.ZodOptional<z.ZodBoolean>;
144
145
  compaction: z.ZodEnum<{
145
146
  native: "native";
146
147
  none: "none";
@@ -150,6 +151,10 @@ export declare const ProviderCapabilitiesSchema: z.ZodObject<{
150
151
  reportsContextWindow: z.ZodBoolean;
151
152
  reportsThinking: z.ZodBoolean;
152
153
  slashCommands: z.ZodBoolean;
154
+ goals: z.ZodOptional<z.ZodEnum<{
155
+ command: "command";
156
+ native: "native";
157
+ }>>;
153
158
  }, z.core.$strip>;
154
159
  export type ProviderCapabilities = z.infer<typeof ProviderCapabilitiesSchema>;
155
160
  export declare const ProviderInfoSchema: z.ZodObject<{
@@ -204,6 +209,7 @@ export declare const ProviderInfoSchema: z.ZodObject<{
204
209
  denyReason: z.ZodBoolean;
205
210
  allowAlways: z.ZodBoolean;
206
211
  asyncQuestions: z.ZodBoolean;
212
+ steer: z.ZodOptional<z.ZodBoolean>;
207
213
  compaction: z.ZodEnum<{
208
214
  native: "native";
209
215
  none: "none";
@@ -213,6 +219,10 @@ export declare const ProviderInfoSchema: z.ZodObject<{
213
219
  reportsContextWindow: z.ZodBoolean;
214
220
  reportsThinking: z.ZodBoolean;
215
221
  slashCommands: z.ZodBoolean;
222
+ goals: z.ZodOptional<z.ZodEnum<{
223
+ command: "command";
224
+ native: "native";
225
+ }>>;
216
226
  }, z.core.$strip>;
217
227
  resumeCommand: z.ZodString;
218
228
  }, z.core.$strip>;
@@ -270,6 +280,7 @@ export declare const ProviderListResultSchema: z.ZodObject<{
270
280
  denyReason: z.ZodBoolean;
271
281
  allowAlways: z.ZodBoolean;
272
282
  asyncQuestions: z.ZodBoolean;
283
+ steer: z.ZodOptional<z.ZodBoolean>;
273
284
  compaction: z.ZodEnum<{
274
285
  native: "native";
275
286
  none: "none";
@@ -279,6 +290,10 @@ export declare const ProviderListResultSchema: z.ZodObject<{
279
290
  reportsContextWindow: z.ZodBoolean;
280
291
  reportsThinking: z.ZodBoolean;
281
292
  slashCommands: z.ZodBoolean;
293
+ goals: z.ZodOptional<z.ZodEnum<{
294
+ command: "command";
295
+ native: "native";
296
+ }>>;
282
297
  }, z.core.$strip>;
283
298
  resumeCommand: z.ZodString;
284
299
  }, z.core.$strip>>;
package/dist/model.js CHANGED
@@ -91,13 +91,19 @@ export const ProviderCapabilitiesSchema = z.object({
91
91
  allowAlways: z.boolean(),
92
92
  // A question the person may leave alone while the turn goes on.
93
93
  asyncQuestions: z.boolean(),
94
+ // Whether a message sent while a turn runs can join that turn rather than wait for the next;
95
+ // absent where it cannot, which is also what a host from before this field reports.
96
+ steer: z.boolean().optional(),
94
97
  // Folding the context: a call of its own, a slash command sent as a turn, or nothing.
95
98
  compaction: z.enum(['native', 'prompt', 'none']),
96
99
  reportsCost: z.boolean(),
97
100
  reportsContextWindow: z.boolean(),
98
101
  // Whether the CLI hands over what the model thought before it answered.
99
102
  reportsThinking: z.boolean(),
100
- slashCommands: z.boolean()
103
+ slashCommands: z.boolean(),
104
+ // How `/goal` reaches the CLI: through a protocol of its own that pauses, resumes and clears (`native`),
105
+ // or as the slash command alone (`command`); absent where the CLI has no goals.
106
+ goals: z.enum(['native', 'command']).optional()
101
107
  });
102
108
  export const ProviderInfoSchema = z.object({
103
109
  kind: AgentKindSchema,