@adecore/agent-contracts 0.30.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
  };
@@ -3989,6 +4007,7 @@ export declare const AGENT_REQUEST_SCHEMAS: {
3989
4007
  }, z.core.$strip>>;
3990
4008
  secretsAvailable: z.ZodOptional<z.ZodBoolean>;
3991
4009
  loginCommands: z.ZodOptional<z.ZodRecord<z.ZodString & z.core.$partial, z.ZodString>>;
4010
+ chatLogins: z.ZodOptional<z.ZodArray<z.ZodString>>;
3992
4011
  }, z.core.$strip>;
3993
4012
  };
3994
4013
  readonly 'accounts.save': {
@@ -4046,6 +4065,7 @@ export declare const AGENT_REQUEST_SCHEMAS: {
4046
4065
  }, z.core.$strip>>;
4047
4066
  secretsAvailable: z.ZodOptional<z.ZodBoolean>;
4048
4067
  loginCommands: z.ZodOptional<z.ZodRecord<z.ZodString & z.core.$partial, z.ZodString>>;
4068
+ chatLogins: z.ZodOptional<z.ZodArray<z.ZodString>>;
4049
4069
  }, z.core.$strip>;
4050
4070
  };
4051
4071
  readonly 'accounts.refresh': {
@@ -4088,6 +4108,7 @@ export declare const AGENT_REQUEST_SCHEMAS: {
4088
4108
  }, z.core.$strip>>;
4089
4109
  secretsAvailable: z.ZodOptional<z.ZodBoolean>;
4090
4110
  loginCommands: z.ZodOptional<z.ZodRecord<z.ZodString & z.core.$partial, z.ZodString>>;
4111
+ chatLogins: z.ZodOptional<z.ZodArray<z.ZodString>>;
4091
4112
  }, z.core.$strip>;
4092
4113
  };
4093
4114
  readonly 'accounts.create': {
@@ -4134,6 +4155,7 @@ export declare const AGENT_REQUEST_SCHEMAS: {
4134
4155
  }, z.core.$strip>>;
4135
4156
  secretsAvailable: z.ZodOptional<z.ZodBoolean>;
4136
4157
  loginCommands: z.ZodOptional<z.ZodRecord<z.ZodString & z.core.$partial, z.ZodString>>;
4158
+ chatLogins: z.ZodOptional<z.ZodArray<z.ZodString>>;
4137
4159
  id: z.ZodString;
4138
4160
  }, z.core.$strip>;
4139
4161
  };
@@ -4167,6 +4189,7 @@ export declare const AGENT_REQUEST_SCHEMAS: {
4167
4189
  provider: z.ZodEnum<{
4168
4190
  claude: "claude";
4169
4191
  codex: "codex";
4192
+ nanogpt: "nanogpt";
4170
4193
  }>;
4171
4194
  model: z.ZodString;
4172
4195
  account: z.ZodOptional<z.ZodString>;
@@ -4187,6 +4210,7 @@ export declare const AGENT_REQUEST_SCHEMAS: {
4187
4210
  provider: z.ZodEnum<{
4188
4211
  claude: "claude";
4189
4212
  codex: "codex";
4213
+ nanogpt: "nanogpt";
4190
4214
  }>;
4191
4215
  model: z.ZodString;
4192
4216
  account: z.ZodOptional<z.ZodString>;
@@ -4215,6 +4239,7 @@ export declare const AGENT_REQUEST_SCHEMAS: {
4215
4239
  byProvider: z.ZodRecord<z.ZodEnum<{
4216
4240
  claude: "claude";
4217
4241
  codex: "codex";
4242
+ nanogpt: "nanogpt";
4218
4243
  }> & z.core.$partial, z.ZodObject<{
4219
4244
  costUsd: z.ZodNumber;
4220
4245
  tokens: z.ZodNumber;
@@ -4258,6 +4283,7 @@ export declare const AGENT_REQUEST_SCHEMAS: {
4258
4283
  provider: z.ZodEnum<{
4259
4284
  claude: "claude";
4260
4285
  codex: "codex";
4286
+ nanogpt: "nanogpt";
4261
4287
  }>;
4262
4288
  path: z.ZodString;
4263
4289
  status: z.ZodEnum<{
@@ -4272,6 +4298,7 @@ export declare const AGENT_REQUEST_SCHEMAS: {
4272
4298
  kind: z.ZodEnum<{
4273
4299
  claude: "claude";
4274
4300
  codex: "codex";
4301
+ nanogpt: "nanogpt";
4275
4302
  }>;
4276
4303
  label: z.ZodString;
4277
4304
  color: z.ZodOptional<z.ZodString>;
@@ -4293,6 +4320,7 @@ export declare const AGENT_REQUEST_SCHEMAS: {
4293
4320
  kind: z.ZodEnum<{
4294
4321
  claude: "claude";
4295
4322
  codex: "codex";
4323
+ nanogpt: "nanogpt";
4296
4324
  }>;
4297
4325
  account: z.ZodOptional<z.ZodObject<{
4298
4326
  id: z.ZodString;
@@ -4339,6 +4367,7 @@ export declare const AGENT_REQUEST_SCHEMAS: {
4339
4367
  kind: z.ZodEnum<{
4340
4368
  claude: "claude";
4341
4369
  codex: "codex";
4370
+ nanogpt: "nanogpt";
4342
4371
  }>;
4343
4372
  account: z.ZodOptional<z.ZodObject<{
4344
4373
  id: z.ZodString;
@@ -5837,6 +5866,7 @@ export declare const AGENT_EVENT_SCHEMAS: {
5837
5866
  kind: z.ZodEnum<{
5838
5867
  claude: "claude";
5839
5868
  codex: "codex";
5869
+ nanogpt: "nanogpt";
5840
5870
  }>;
5841
5871
  account: z.ZodOptional<z.ZodObject<{
5842
5872
  id: z.ZodString;
@@ -5913,6 +5943,7 @@ export declare const AGENT_EVENT_SCHEMAS: {
5913
5943
  }, z.core.$strip>>;
5914
5944
  secretsAvailable: z.ZodOptional<z.ZodBoolean>;
5915
5945
  loginCommands: z.ZodOptional<z.ZodRecord<z.ZodString & z.core.$partial, z.ZodString>>;
5946
+ chatLogins: z.ZodOptional<z.ZodArray<z.ZodString>>;
5916
5947
  }, z.core.$strip>;
5917
5948
  };
5918
5949
  export type AgentRequestType = keyof typeof AGENT_REQUEST_SCHEMAS;
@@ -109,6 +109,7 @@ export declare const ProviderAccountsSchema: z.ZodObject<{
109
109
  }, z.core.$strip>>;
110
110
  secretsAvailable: z.ZodOptional<z.ZodBoolean>;
111
111
  loginCommands: z.ZodOptional<z.ZodRecord<z.ZodString & z.core.$partial, z.ZodString>>;
112
+ chatLogins: z.ZodOptional<z.ZodArray<z.ZodString>>;
112
113
  }, z.core.$strip>;
113
114
  export type ProviderAccounts = z.infer<typeof ProviderAccountsSchema>;
114
115
  export declare const ProviderAccountsSavePayloadSchema: z.ZodObject<{
@@ -172,6 +173,7 @@ export declare const ProviderAccountCreateResultSchema: z.ZodObject<{
172
173
  }, z.core.$strip>>;
173
174
  secretsAvailable: z.ZodOptional<z.ZodBoolean>;
174
175
  loginCommands: z.ZodOptional<z.ZodRecord<z.ZodString & z.core.$partial, z.ZodString>>;
176
+ chatLogins: z.ZodOptional<z.ZodArray<z.ZodString>>;
175
177
  id: z.ZodString;
176
178
  }, z.core.$strip>;
177
179
  export type ProviderAccountCreateResult = z.infer<typeof ProviderAccountCreateResultSchema>;
@@ -69,7 +69,9 @@ export const ProviderAccountsSchema = z.object({
69
69
  // Whether this machine can keep a sensitive variable; false off macOS, where no keychain is used.
70
70
  secretsAvailable: z.boolean().optional(),
71
71
  // Per agent kind, what a terminal types to sign that CLI in under an account, which the account's environment points at.
72
- loginCommands: z.partialRecord(AgentKindSchema, z.string()).optional()
72
+ loginCommands: z.partialRecord(AgentKindSchema, z.string()).optional(),
73
+ // The agent kinds that keep accounts in folders of their own but sign in from a chat, with no command to type.
74
+ chatLogins: z.array(AgentKindSchema).optional()
73
75
  });
74
76
  /* The whole map: an id left out is removed, and its folder stays where it is. */
75
77
  export const ProviderAccountsSavePayloadSchema = z.object({
package/dist/usage.d.ts CHANGED
@@ -2,9 +2,10 @@ import { z } from 'zod';
2
2
  export declare const UsageProviderSchema: z.ZodEnum<{
3
3
  claude: "claude";
4
4
  codex: "codex";
5
+ nanogpt: "nanogpt";
5
6
  }>;
6
7
  export type UsageProvider = z.infer<typeof UsageProviderSchema>;
7
- export declare const USAGE_PROVIDERS: ("claude" | "codex")[];
8
+ export declare const USAGE_PROVIDERS: ("claude" | "codex" | "nanogpt")[];
8
9
  export declare const UsageResolutionSchema: z.ZodEnum<{
9
10
  day: "day";
10
11
  hour: "hour";
@@ -28,6 +29,7 @@ export declare const UsageAccountSchema: z.ZodObject<{
28
29
  kind: z.ZodEnum<{
29
30
  claude: "claude";
30
31
  codex: "codex";
32
+ nanogpt: "nanogpt";
31
33
  }>;
32
34
  label: z.ZodString;
33
35
  color: z.ZodOptional<z.ZodString>;
@@ -38,6 +40,7 @@ export declare const UsageBucketSchema: z.ZodObject<{
38
40
  provider: z.ZodEnum<{
39
41
  claude: "claude";
40
42
  codex: "codex";
43
+ nanogpt: "nanogpt";
41
44
  }>;
42
45
  model: z.ZodString;
43
46
  account: z.ZodOptional<z.ZodString>;
@@ -66,6 +69,7 @@ export declare const UsageModelSchema: z.ZodObject<{
66
69
  provider: z.ZodEnum<{
67
70
  claude: "claude";
68
71
  codex: "codex";
72
+ nanogpt: "nanogpt";
69
73
  }>;
70
74
  model: z.ZodString;
71
75
  account: z.ZodOptional<z.ZodString>;
@@ -95,6 +99,7 @@ export declare const UsageProjectSchema: z.ZodObject<{
95
99
  byProvider: z.ZodRecord<z.ZodEnum<{
96
100
  claude: "claude";
97
101
  codex: "codex";
102
+ nanogpt: "nanogpt";
98
103
  }> & z.core.$partial, z.ZodObject<{
99
104
  costUsd: z.ZodNumber;
100
105
  tokens: z.ZodNumber;
@@ -145,6 +150,7 @@ export declare const UsageRootSchema: z.ZodObject<{
145
150
  provider: z.ZodEnum<{
146
151
  claude: "claude";
147
152
  codex: "codex";
153
+ nanogpt: "nanogpt";
148
154
  }>;
149
155
  path: z.ZodString;
150
156
  status: z.ZodEnum<{
@@ -175,6 +181,7 @@ export declare const UsageSummaryResultSchema: z.ZodObject<{
175
181
  provider: z.ZodEnum<{
176
182
  claude: "claude";
177
183
  codex: "codex";
184
+ nanogpt: "nanogpt";
178
185
  }>;
179
186
  model: z.ZodString;
180
187
  account: z.ZodOptional<z.ZodString>;
@@ -195,6 +202,7 @@ export declare const UsageSummaryResultSchema: z.ZodObject<{
195
202
  provider: z.ZodEnum<{
196
203
  claude: "claude";
197
204
  codex: "codex";
205
+ nanogpt: "nanogpt";
198
206
  }>;
199
207
  model: z.ZodString;
200
208
  account: z.ZodOptional<z.ZodString>;
@@ -223,6 +231,7 @@ export declare const UsageSummaryResultSchema: z.ZodObject<{
223
231
  byProvider: z.ZodRecord<z.ZodEnum<{
224
232
  claude: "claude";
225
233
  codex: "codex";
234
+ nanogpt: "nanogpt";
226
235
  }> & z.core.$partial, z.ZodObject<{
227
236
  costUsd: z.ZodNumber;
228
237
  tokens: z.ZodNumber;
@@ -266,6 +275,7 @@ export declare const UsageSummaryResultSchema: z.ZodObject<{
266
275
  provider: z.ZodEnum<{
267
276
  claude: "claude";
268
277
  codex: "codex";
278
+ nanogpt: "nanogpt";
269
279
  }>;
270
280
  path: z.ZodString;
271
281
  status: z.ZodEnum<{
@@ -280,6 +290,7 @@ export declare const UsageSummaryResultSchema: z.ZodObject<{
280
290
  kind: z.ZodEnum<{
281
291
  claude: "claude";
282
292
  codex: "codex";
293
+ nanogpt: "nanogpt";
283
294
  }>;
284
295
  label: z.ZodString;
285
296
  color: z.ZodOptional<z.ZodString>;
@@ -308,6 +319,7 @@ export declare const UsageLimitsProviderSchema: z.ZodObject<{
308
319
  kind: z.ZodEnum<{
309
320
  claude: "claude";
310
321
  codex: "codex";
322
+ nanogpt: "nanogpt";
311
323
  }>;
312
324
  account: z.ZodOptional<z.ZodObject<{
313
325
  id: z.ZodString;
@@ -351,6 +363,7 @@ export declare const UsageLimitsSnapshotSchema: z.ZodObject<{
351
363
  kind: z.ZodEnum<{
352
364
  claude: "claude";
353
365
  codex: "codex";
366
+ nanogpt: "nanogpt";
354
367
  }>;
355
368
  account: z.ZodOptional<z.ZodObject<{
356
369
  id: z.ZodString;
package/dist/usage.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  import { ProviderAccountIdSchema } from './provider-accounts.js';
3
- /* The CLIs whose transcripts the daemon reads. A subset of `AgentKindSchema`: it grows with the readers. */
4
- export const UsageProviderSchema = z.enum(['claude', 'codex']);
3
+ /* The providers whose usage the daemon reads: the CLIs' transcripts, and the log of a subscription API it calls itself. A subset of `AgentKindSchema`: it grows with the readers. */
4
+ export const UsageProviderSchema = z.enum(['claude', 'codex', 'nanogpt']);
5
5
  export const USAGE_PROVIDERS = UsageProviderSchema.options;
6
6
  export const UsageResolutionSchema = z.enum(['hour', 'day']);
7
7
  /* Token kinds are disjoint, so a total is their sum. Reasoning is a part of output and never counted twice. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adecore/agent-contracts",
3
- "version": "0.30.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.30.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
 
@@ -83,7 +83,9 @@ export const ProviderAccountsSchema = z.object({
83
83
  // Whether this machine can keep a sensitive variable; false off macOS, where no keychain is used.
84
84
  secretsAvailable: z.boolean().optional(),
85
85
  // Per agent kind, what a terminal types to sign that CLI in under an account, which the account's environment points at.
86
- loginCommands: z.partialRecord(AgentKindSchema, z.string()).optional()
86
+ loginCommands: z.partialRecord(AgentKindSchema, z.string()).optional(),
87
+ // The agent kinds that keep accounts in folders of their own but sign in from a chat, with no command to type.
88
+ chatLogins: z.array(AgentKindSchema).optional()
87
89
  });
88
90
  export type ProviderAccounts = z.infer<typeof ProviderAccountsSchema>;
89
91
 
package/src/usage.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { z } from 'zod';
2
2
  import { ProviderAccountIdSchema } from './provider-accounts.ts';
3
3
 
4
- /* The CLIs whose transcripts the daemon reads. A subset of `AgentKindSchema`: it grows with the readers. */
5
- export const UsageProviderSchema = z.enum(['claude', 'codex']);
4
+ /* The providers whose usage the daemon reads: the CLIs' transcripts, and the log of a subscription API it calls itself. A subset of `AgentKindSchema`: it grows with the readers. */
5
+ export const UsageProviderSchema = z.enum(['claude', 'codex', 'nanogpt']);
6
6
  export type UsageProvider = z.infer<typeof UsageProviderSchema>;
7
7
  export const USAGE_PROVIDERS = UsageProviderSchema.options;
8
8