@adecore/agent-contracts 0.31.0 → 0.31.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/index.d.ts CHANGED
@@ -2,7 +2,7 @@ export { KNOWN_AGENT_KINDS, type KnownAgentKind, AGENT_KIND_MAX_LENGTH, AgentKin
2
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, ChatUiPlaceReadingSchema, type ChatUiPlaceReading, 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, ENDED_NOTE_PREFIX, abortedByEnd, activeSubagents, 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
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
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';
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, ProviderPlatformSchema, type ProviderPlatform, ProviderSignInSchema, type ProviderSignIn, ProviderInstallSchema, type ProviderInstall, ProviderInfoSchema, type ProviderInfo, ProviderListResultSchema, type ProviderListResult, resumeCommandFor } from './model.ts';
6
6
  export type { FramePort } from './port.ts';
7
7
  export { EmptySchema, AGENT_REQUEST_SCHEMAS, AGENT_EVENT_SCHEMAS, type AgentRequestType, type AgentEventType } from './protocol.ts';
8
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';
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ export { KNOWN_AGENT_KINDS, AGENT_KIND_MAX_LENGTH, AgentKindSchema, isKnownAgent
3
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, ChatUiPlaceReadingSchema, 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, ENDED_NOTE_PREFIX, abortedByEnd, activeSubagents, 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
4
  export { ErrorSchema, RequestSchema, ReplyOkSchema, ReplyErrorSchema, ReplySchema, EventSchema, ServerFrameSchema, parseRequest, parseServerFrame } from './envelope.js';
5
5
  export { SessionIdSchema } from './ids.js';
6
- export { ModelOptionChoiceSchema, ModelOptionDescriptorSchema, ModelInfoSchema, ModelSelectionSchema, ModelCatalogProfileSchema, ModelCatalogEntrySchema, ModelCatalogDataSchema, RuntimeModeSchema, ProviderCapabilitiesSchema, ProviderInfoSchema, ProviderListResultSchema, resumeCommandFor } from './model.js';
6
+ export { ModelOptionChoiceSchema, ModelOptionDescriptorSchema, ModelInfoSchema, ModelSelectionSchema, ModelCatalogProfileSchema, ModelCatalogEntrySchema, ModelCatalogDataSchema, RuntimeModeSchema, ProviderCapabilitiesSchema, ProviderPlatformSchema, ProviderSignInSchema, ProviderInstallSchema, ProviderInfoSchema, ProviderListResultSchema, resumeCommandFor } from './model.js';
7
7
  export { EmptySchema, AGENT_REQUEST_SCHEMAS, AGENT_EVENT_SCHEMAS } from './protocol.js';
8
8
  export { ProviderAccountIdSchema, ProviderAccountVariableSchema, ProviderAccountSchema, ProviderAccountStateSchema, ProviderAccountStatusSchema, ProviderAccountMapSchema, ProviderAccountsSchema, ProviderAccountsSavePayloadSchema, ProviderAccountCreatePayloadSchema, ProviderAccountCreateResultSchema, ProviderAccountWatchLoginPayloadSchema } from './provider-accounts.js';
9
9
  export { isRecord } from './record.js';
package/dist/model.d.ts CHANGED
@@ -160,6 +160,41 @@ export declare const ProviderCapabilitiesSchema: z.ZodObject<{
160
160
  }>>;
161
161
  }, z.core.$strip>;
162
162
  export type ProviderCapabilities = z.infer<typeof ProviderCapabilitiesSchema>;
163
+ export declare const ProviderPlatformSchema: z.ZodEnum<{
164
+ darwin: "darwin";
165
+ linux: "linux";
166
+ win32: "win32";
167
+ }>;
168
+ export type ProviderPlatform = z.infer<typeof ProviderPlatformSchema>;
169
+ export declare const ProviderSignInSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
170
+ kind: z.ZodLiteral<"command">;
171
+ command: z.ZodString;
172
+ }, z.core.$strip>, z.ZodObject<{
173
+ kind: z.ZodLiteral<"env">;
174
+ variable: z.ZodString;
175
+ }, z.core.$strip>, z.ZodObject<{
176
+ kind: z.ZodLiteral<"chat">;
177
+ }, z.core.$strip>], "kind">;
178
+ export type ProviderSignIn = z.infer<typeof ProviderSignInSchema>;
179
+ export declare const ProviderInstallSchema: z.ZodObject<{
180
+ description: z.ZodString;
181
+ commands: z.ZodObject<{
182
+ darwin: z.ZodOptional<z.ZodString>;
183
+ linux: z.ZodOptional<z.ZodString>;
184
+ win32: z.ZodOptional<z.ZodString>;
185
+ }, z.core.$strip>;
186
+ guideUrl: z.ZodOptional<z.ZodString>;
187
+ signIn: z.ZodPipe<z.ZodArray<z.ZodUnknown>, z.ZodTransform<({
188
+ kind: "command";
189
+ command: string;
190
+ } | {
191
+ kind: "env";
192
+ variable: string;
193
+ } | {
194
+ kind: "chat";
195
+ })[], unknown[]>>;
196
+ }, z.core.$strip>;
197
+ export type ProviderInstall = z.infer<typeof ProviderInstallSchema>;
163
198
  export declare const ProviderInfoSchema: z.ZodObject<{
164
199
  kind: z.ZodString;
165
200
  name: z.ZodString;
@@ -223,6 +258,24 @@ export declare const ProviderInfoSchema: z.ZodObject<{
223
258
  }>>;
224
259
  }, z.core.$strip>;
225
260
  resumeCommand: z.ZodString;
261
+ install: z.ZodOptional<z.ZodObject<{
262
+ description: z.ZodString;
263
+ commands: z.ZodObject<{
264
+ darwin: z.ZodOptional<z.ZodString>;
265
+ linux: z.ZodOptional<z.ZodString>;
266
+ win32: z.ZodOptional<z.ZodString>;
267
+ }, z.core.$strip>;
268
+ guideUrl: z.ZodOptional<z.ZodString>;
269
+ signIn: z.ZodPipe<z.ZodArray<z.ZodUnknown>, z.ZodTransform<({
270
+ kind: "command";
271
+ command: string;
272
+ } | {
273
+ kind: "env";
274
+ variable: string;
275
+ } | {
276
+ kind: "chat";
277
+ })[], unknown[]>>;
278
+ }, z.core.$strip>>;
226
279
  }, z.core.$strip>;
227
280
  export type ProviderInfo = z.infer<typeof ProviderInfoSchema>;
228
281
  export declare const ProviderListResultSchema: z.ZodObject<{
@@ -289,6 +342,24 @@ export declare const ProviderListResultSchema: z.ZodObject<{
289
342
  }>>;
290
343
  }, z.core.$strip>;
291
344
  resumeCommand: z.ZodString;
345
+ install: z.ZodOptional<z.ZodObject<{
346
+ description: z.ZodString;
347
+ commands: z.ZodObject<{
348
+ darwin: z.ZodOptional<z.ZodString>;
349
+ linux: z.ZodOptional<z.ZodString>;
350
+ win32: z.ZodOptional<z.ZodString>;
351
+ }, z.core.$strip>;
352
+ guideUrl: z.ZodOptional<z.ZodString>;
353
+ signIn: z.ZodPipe<z.ZodArray<z.ZodUnknown>, z.ZodTransform<({
354
+ kind: "command";
355
+ command: string;
356
+ } | {
357
+ kind: "env";
358
+ variable: string;
359
+ } | {
360
+ kind: "chat";
361
+ })[], unknown[]>>;
362
+ }, z.core.$strip>>;
292
363
  }, z.core.$strip>>;
293
364
  }, z.core.$strip>;
294
365
  export type ProviderListResult = z.infer<typeof ProviderListResultSchema>;
package/dist/model.js CHANGED
@@ -108,6 +108,28 @@ export const ProviderCapabilitiesSchema = z.object({
108
108
  // or as the slash command alone (`command`); absent where the CLI has no goals.
109
109
  goals: z.enum(['native', 'command']).optional()
110
110
  });
111
+ // The systems an install command is written for, by Node's names for them.
112
+ export const ProviderPlatformSchema = z.enum(['darwin', 'linux', 'win32']);
113
+ // One way a CLI signs in once it is installed.
114
+ export const ProviderSignInSchema = z.discriminatedUnion('kind', [
115
+ z.object({ kind: z.literal('command'), command: z.string() }),
116
+ z.object({ kind: z.literal('env'), variable: z.string() }),
117
+ z.object({ kind: z.literal('chat') })
118
+ ]);
119
+ // How a person gets a CLI that is not on the machine yet.
120
+ export const ProviderInstallSchema = z.object({
121
+ // One line on what the CLI is.
122
+ description: z.string(),
123
+ // A system without a command is one the CLI does not install on in one line.
124
+ commands: z.object({ darwin: z.string().optional(), linux: z.string().optional(), win32: z.string().optional() }),
125
+ guideUrl: z.string().optional(),
126
+ // In the order the CLI prefers them. A way a newer host names that this version does not know is left out,
127
+ // so it never fails the whole provider.
128
+ signIn: z.array(z.unknown()).transform((ways) => ways.flatMap((way) => {
129
+ const parsed = ProviderSignInSchema.safeParse(way);
130
+ return parsed.success ? [parsed.data] : [];
131
+ }))
132
+ });
111
133
  export const ProviderInfoSchema = z.object({
112
134
  kind: AgentKindSchema,
113
135
  name: z.string(),
@@ -119,7 +141,9 @@ export const ProviderInfoSchema = z.object({
119
141
  capabilities: ProviderCapabilitiesSchema,
120
142
  // What a terminal runs to continue one of this CLI's sessions. `{id}` stands for the session id
121
143
  // and `{flags}` for the flags the launch carries, which is where in the line each CLI takes them.
122
- resumeCommand: z.string()
144
+ resumeCommand: z.string(),
145
+ // Absent from a host that knows no way to install this CLI, and from one older than this field.
146
+ install: ProviderInstallSchema.optional()
123
147
  });
124
148
  export const ProviderListResultSchema = z.object({
125
149
  providers: z.array(ProviderInfoSchema)
@@ -3946,6 +3946,24 @@ export declare const AGENT_REQUEST_SCHEMAS: {
3946
3946
  }>>;
3947
3947
  }, z.core.$strip>;
3948
3948
  resumeCommand: z.ZodString;
3949
+ install: z.ZodOptional<z.ZodObject<{
3950
+ description: z.ZodString;
3951
+ commands: z.ZodObject<{
3952
+ darwin: z.ZodOptional<z.ZodString>;
3953
+ linux: z.ZodOptional<z.ZodString>;
3954
+ win32: z.ZodOptional<z.ZodString>;
3955
+ }, z.core.$strip>;
3956
+ guideUrl: z.ZodOptional<z.ZodString>;
3957
+ signIn: z.ZodPipe<z.ZodArray<z.ZodUnknown>, z.ZodTransform<({
3958
+ kind: "command";
3959
+ command: string;
3960
+ } | {
3961
+ kind: "env";
3962
+ variable: string;
3963
+ } | {
3964
+ kind: "chat";
3965
+ })[], unknown[]>>;
3966
+ }, z.core.$strip>>;
3949
3967
  }, z.core.$strip>>;
3950
3968
  }, z.core.$strip>;
3951
3969
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adecore/agent-contracts",
3
- "version": "0.31.0",
3
+ "version": "0.31.1",
4
4
  "description": "Schemas and port contracts for agent chats, provider accounts, models and usage.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -86,7 +86,7 @@
86
86
  "test": "bun --conditions=source test"
87
87
  },
88
88
  "dependencies": {
89
- "@adecore/intelligent-ui": "0.31.0",
89
+ "@adecore/intelligent-ui": "0.31.1",
90
90
  "zod": "^4.6.5"
91
91
  },
92
92
  "devDependencies": {
package/src/index.ts CHANGED
@@ -294,6 +294,12 @@ export {
294
294
  type RuntimeMode,
295
295
  ProviderCapabilitiesSchema,
296
296
  type ProviderCapabilities,
297
+ ProviderPlatformSchema,
298
+ type ProviderPlatform,
299
+ ProviderSignInSchema,
300
+ type ProviderSignIn,
301
+ ProviderInstallSchema,
302
+ type ProviderInstall,
297
303
  ProviderInfoSchema,
298
304
  type ProviderInfo,
299
305
  ProviderListResultSchema,
package/src/model.ts CHANGED
@@ -128,6 +128,36 @@ export const ProviderCapabilitiesSchema = z.object({
128
128
  });
129
129
  export type ProviderCapabilities = z.infer<typeof ProviderCapabilitiesSchema>;
130
130
 
131
+ // The systems an install command is written for, by Node's names for them.
132
+ export const ProviderPlatformSchema = z.enum(['darwin', 'linux', 'win32']);
133
+ export type ProviderPlatform = z.infer<typeof ProviderPlatformSchema>;
134
+
135
+ // One way a CLI signs in once it is installed.
136
+ export const ProviderSignInSchema = z.discriminatedUnion('kind', [
137
+ z.object({ kind: z.literal('command'), command: z.string() }),
138
+ z.object({ kind: z.literal('env'), variable: z.string() }),
139
+ z.object({ kind: z.literal('chat') })
140
+ ]);
141
+ export type ProviderSignIn = z.infer<typeof ProviderSignInSchema>;
142
+
143
+ // How a person gets a CLI that is not on the machine yet.
144
+ export const ProviderInstallSchema = z.object({
145
+ // One line on what the CLI is.
146
+ description: z.string(),
147
+ // A system without a command is one the CLI does not install on in one line.
148
+ commands: z.object({ darwin: z.string().optional(), linux: z.string().optional(), win32: z.string().optional() }),
149
+ guideUrl: z.string().optional(),
150
+ // In the order the CLI prefers them. A way a newer host names that this version does not know is left out,
151
+ // so it never fails the whole provider.
152
+ signIn: z.array(z.unknown()).transform((ways) =>
153
+ ways.flatMap((way) => {
154
+ const parsed = ProviderSignInSchema.safeParse(way);
155
+ return parsed.success ? [parsed.data] : [];
156
+ })
157
+ )
158
+ });
159
+ export type ProviderInstall = z.infer<typeof ProviderInstallSchema>;
160
+
131
161
  export const ProviderInfoSchema = z.object({
132
162
  kind: AgentKindSchema,
133
163
  name: z.string(),
@@ -139,7 +169,9 @@ export const ProviderInfoSchema = z.object({
139
169
  capabilities: ProviderCapabilitiesSchema,
140
170
  // What a terminal runs to continue one of this CLI's sessions. `{id}` stands for the session id
141
171
  // and `{flags}` for the flags the launch carries, which is where in the line each CLI takes them.
142
- resumeCommand: z.string()
172
+ resumeCommand: z.string(),
173
+ // Absent from a host that knows no way to install this CLI, and from one older than this field.
174
+ install: ProviderInstallSchema.optional()
143
175
  });
144
176
  export type ProviderInfo = z.infer<typeof ProviderInfoSchema>;
145
177