@maudecode/talaria-web-contracts 1.20.0 → 1.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/dist/agent-imports.d.ts +42 -0
  2. package/dist/agent-imports.js +11 -0
  3. package/dist/agent-imports.js.map +1 -0
  4. package/dist/checkpoint.d.ts +78 -0
  5. package/dist/checkpoint.js +16 -0
  6. package/dist/checkpoint.js.map +1 -0
  7. package/dist/context-detail.d.ts +3 -3
  8. package/dist/delegation.d.ts +206 -0
  9. package/dist/delegation.js +32 -0
  10. package/dist/delegation.js.map +1 -0
  11. package/dist/gateway-session.d.ts +183 -6
  12. package/dist/gateway-session.js +28 -2
  13. package/dist/gateway-session.js.map +1 -1
  14. package/dist/groups-native.d.ts +427 -0
  15. package/dist/groups-native.js +40 -0
  16. package/dist/groups-native.js.map +1 -0
  17. package/dist/groups.d.ts +1545 -0
  18. package/dist/groups.js +12 -0
  19. package/dist/groups.js.map +1 -0
  20. package/dist/index.d.ts +9 -0
  21. package/dist/index.js +9 -0
  22. package/dist/index.js.map +1 -1
  23. package/dist/mcp-cost-policy.d.ts +110 -0
  24. package/dist/mcp-cost-policy.js +24 -0
  25. package/dist/mcp-cost-policy.js.map +1 -0
  26. package/dist/openapi.js +4 -0
  27. package/dist/openapi.js.map +1 -1
  28. package/dist/outbound-drafts.d.ts +114 -0
  29. package/dist/outbound-drafts.js +20 -0
  30. package/dist/outbound-drafts.js.map +1 -0
  31. package/dist/plan-usage.d.ts +92 -0
  32. package/dist/plan-usage.js +20 -0
  33. package/dist/plan-usage.js.map +1 -0
  34. package/dist/prompt-queue.d.ts +96 -0
  35. package/dist/prompt-queue.js +19 -0
  36. package/dist/prompt-queue.js.map +1 -0
  37. package/dist/router.d.ts +13 -17691
  38. package/dist/router.js +4 -1
  39. package/dist/router.js.map +1 -1
  40. package/dist/routes/automation.d.ts +335 -16
  41. package/dist/routes/automation.js +16 -2
  42. package/dist/routes/automation.js.map +1 -1
  43. package/dist/routes/chat.d.ts +756 -83
  44. package/dist/routes/core.d.ts +2 -2
  45. package/dist/routes/git.d.ts +50 -0
  46. package/dist/routes/git.js +3 -2
  47. package/dist/routes/git.js.map +1 -1
  48. package/dist/routes/groups.d.ts +860 -0
  49. package/dist/routes/groups.js +13 -0
  50. package/dist/routes/groups.js.map +1 -0
  51. package/dist/routes/raw.js +13 -3
  52. package/dist/routes/raw.js.map +1 -1
  53. package/dist/routes/sessions.d.ts +2055 -214
  54. package/dist/routes/sessions.js +5 -0
  55. package/dist/routes/sessions.js.map +1 -1
  56. package/dist/routes/settings.d.ts +949 -1
  57. package/dist/routes/settings.js +26 -0
  58. package/dist/routes/settings.js.map +1 -1
  59. package/dist/routes/tools.d.ts +640 -51
  60. package/dist/routes/tools.js +24 -3
  61. package/dist/routes/tools.js.map +1 -1
  62. package/dist/routes/workspaces.d.ts +47 -2
  63. package/dist/routes/workspaces.js +5 -4
  64. package/dist/routes/workspaces.js.map +1 -1
  65. package/dist/sidecar/methods.d.ts +827 -29
  66. package/dist/sidecar/methods.js +3 -1
  67. package/dist/sidecar/methods.js.map +1 -1
  68. package/dist/sidecar/namespaces.d.ts +941 -42
  69. package/dist/sidecar/namespaces.js +66 -6
  70. package/dist/sidecar/namespaces.js.map +1 -1
  71. package/dist/sidecar/rpc.d.ts +3 -3
  72. package/dist/sidecar/runtime.d.ts +43 -0
  73. package/dist/sidecar/runtime.js +12 -2
  74. package/dist/sidecar/runtime.js.map +1 -1
  75. package/dist/sidecar/version.d.ts +1 -1
  76. package/dist/sidecar/version.js +1 -1
  77. package/dist/sse.d.ts +219 -26
  78. package/dist/sse.js +11 -5
  79. package/dist/sse.js.map +1 -1
  80. package/dist/views.d.ts +1916 -175
  81. package/dist/views.js +100 -35
  82. package/dist/views.js.map +1 -1
  83. package/fixtures/sidecar/agent-imports.json +6 -0
  84. package/fixtures/sidecar/aux.json +58 -0
  85. package/fixtures/sidecar/connectors.json +29 -0
  86. package/fixtures/sidecar/gateway.json +45 -0
  87. package/fixtures/sidecar/groups.json +18 -0
  88. package/fixtures/sidecar/kanban.json +197 -0
  89. package/fixtures/sidecar/managed-buffers.json +16 -0
  90. package/fixtures/sidecar/mcp.json +12 -0
  91. package/fixtures/sidecar/outbound-drafts.json +1 -0
  92. package/fixtures/sidecar/providers.json +37 -1
  93. package/fixtures/sidecar/runtime.json +3 -3
  94. package/fixtures/sidecar/skills.json +19 -2
  95. package/fixtures/sidecar/tts.json +6 -0
  96. package/package.json +1 -1
package/dist/views.js CHANGED
@@ -1,3 +1,6 @@
1
+ import { DelegationSettingsSchema } from './delegation.js';
2
+ import { PlanGaugeSchema, PlanUsageSchema, ModelAllowanceSchema, ModelSectionsSchema } from './plan-usage.js';
3
+ import { McpCostPolicySchema } from './mcp-cost-policy.js';
1
4
  /**
2
5
  * Pinned response shapes shared by every consumer (formerly the frontend's
3
6
  * hand-written `src/contracts/*` schemas). Known fields are typed; every
@@ -5,11 +8,12 @@
5
8
  * that must survive a round trip (documented passthrough).
6
9
  */
7
10
  import { z } from 'zod';
11
+ import { OutboundDraftRefSchema } from './outbound-drafts.js';
8
12
  import { RunStatusSchema } from './run-status.js';
9
- import { AgentRefreshConfirmationSchema } from './sidecar/runtime.js';
13
+ import { AgentRefreshConfirmationSchema, AgentUpdateOperationSchema } from './sidecar/runtime.js';
10
14
  import { SpeedTierSchema } from './speed.js';
11
- import { ExecutionModeSchema, OwnerAttachmentSchema } from './gateway-session.js';
12
- import { CanonicalBotChatSchema, GatewayModeSchema, PluginOAuthClientSchema, PluginSettingFieldSchema, SkillCatalogIdentitySchema } from './sidecar/namespaces.js';
15
+ import { ExecutionModeSchema, OwnerAttachmentSchema, MessageReactionViewSchema } from './gateway-session.js';
16
+ import { NousAccountSchema, KanbanInspectionNodeSchema, KanbanInspectionSnapshotSchema, CanonicalBotChatSchema, GatewayModeSchema, PluginOAuthClientSchema, PluginSettingFieldSchema, SkillCatalogIdentitySchema } from './sidecar/namespaces.js';
13
17
  export { SpeedTierSchema } from './speed.js';
14
18
  const Json = z.unknown();
15
19
  export const NullableString = z.string().nullable();
@@ -19,6 +23,7 @@ export const UnixSeconds = z.number();
19
23
  // ── sessions ─────────────────────────────────────────────────────────────
20
24
  export const SessionIdSchema = z.string().regex(/^[A-Za-z0-9_.:-]{1,128}$/, 'invalid session id');
21
25
  export const AttachmentSchema = z.looseObject({
26
+ download_url: z.string().startsWith('/api/groups/file?').optional(),
22
27
  filename: z.string().optional(), name: z.string().optional(), path: z.string().optional(), size: z.number().optional(), mime: z.string().optional(), is_image: z.boolean().optional(), rollback_token: z.string().optional(),
23
28
  });
24
29
  /** The server's display class for a tool call: clients map it to an icon and localized verb, and never classify names themselves. */
@@ -46,14 +51,17 @@ export const ToolEditDiffSchema = z.object({ added: z.number().int(), removed: z
46
51
  /** The latest server-normalized MCP update; never stored with the transcript. */
47
52
  export const ToolProgressSchema = z.object({ percent: z.number().min(0).max(100).nullable(), message: z.string().nullable() });
48
53
  /** Shared tool display fields. Progress is ephemeral, absent on older servers and null after completion. */
49
- export const ToolDisplayFields = { progress: ToolProgressSchema.nullable().optional(), kind: ToolKindSchema.optional(), target: z.string().optional(), edit_diff: ToolEditDiffSchema.optional() };
54
+ export const ToolDisplayFields = {
55
+ progress: ToolProgressSchema.nullable().optional(), kind: ToolKindSchema.optional(), target: z.string().optional(), edit_diff: ToolEditDiffSchema.optional(),
56
+ focus_path: NullableString.optional().describe('TAL-1458: a read or write call\'s file as a workspace-relative path, the file a companion page shows; absent for any other call or an absolute, home or out-of-workspace path.'),
57
+ };
50
58
  /**
51
59
  * TAL-315: a tool result's display sections, decided by the server's one rule for live, replayed and persisted results
52
60
  * alike. Clients show `stdout`, `stderr`, a labelled `error` and a labelled `exit_code` (sent only when worth showing), or
53
61
  * `text`, in that order, and never parse result text. Each string is capped server-side; a client without the field
54
62
  * shows `preview`.
55
63
  */
56
- export const ToolResultViewSchema = z.object({ text: z.string().optional(), stdout: z.string().optional(), stderr: z.string().optional(), error: z.string().optional(), exit_code: z.number().int().optional() });
64
+ export const ToolResultViewSchema = z.object({ outbound_draft: OutboundDraftRefSchema.optional(), text: z.string().optional(), stdout: z.string().optional(), stderr: z.string().optional(), error: z.string().optional(), exit_code: z.number().int().optional() });
57
65
  /**
58
66
  * Stored transcripts carry the OpenAI shape (`function.name` / `function.arguments` JSON string); live events carry `name` / `args`.
59
67
  * On an assistant row the server resolves every call (TAL-313, `session-sse-contract-v1.md`): Anthropic `tool_use` parts and
@@ -131,6 +139,7 @@ export const BackgroundLineSchema = z.object({ kind: z.enum(['agent', 'command',
131
139
  });
132
140
  export const MessageSchema = z.looseObject({
133
141
  role: z.string(), content: MessageContentSchema.optional(), id: MessageIdSchema.optional(), message_id: MessageIdSchema.optional(), timestamp: z.number().nullable().optional(),
142
+ reaction_view: MessageReactionViewSchema.optional(),
134
143
  attachments: z.array(AttachmentSchema).optional(), tool_calls: z.array(ToolCallSchema).optional(),
135
144
  /**
136
145
  * TAL-302: an assistant row's whole reasoning as one string (its reasoning fields, typed thinking parts and inline
@@ -189,8 +198,10 @@ export const MessageSchema = z.looseObject({
189
198
  review_state: BackgroundReviewStateSchema.optional(),
190
199
  }).optional(),
191
200
  /**
192
- * TAL-305: a marker the Agent wrote around context compaction, not a message anyone typed. Clients render a collapsed
193
- * card with a localized title per kind and the body on expansion: `_marker_body` when sent, else `content`.
201
+ * TAL-305: a marker around context compaction, not a message anyone typed. Clients render a collapsed line with a
202
+ * localized title per kind and the body on expansion: `_marker_body` when sent, else `content`. TAL-1566: each compaction
203
+ * Web runs is one row in its place, with role `marker` and a stable `message_id`, display-only and excluded from model
204
+ * history; it is never a turn's prompt or reply.
194
205
  */
195
206
  _marker_kind: z.enum(['context_compaction', 'preserved_task_list']).optional(),
196
207
  /** TAL-305: a preserved task list's card body, without its marker line. */
@@ -277,19 +288,32 @@ const IsMessagingSessionSchema = z.boolean().describe('`source_kind` is `messagi
277
288
  * the folder name (TAL-303). Null without a workspace; absent from an older server, where clients show no label.
278
289
  */
279
290
  const WorkspaceNameSchema = NullableString.optional();
280
- /**
281
- * TAL-560: the "Context compaction · Reference only" card, on payloads that carry `messages`. Clients render `text` after
282
- * the row at full-transcript index `after_message_index` (row `after_message_index - _messages_offset` of `messages`), or
283
- * above the loaded rows when it is null or before them. Null: no card.
284
- */
285
- export const CompressionReferenceSchema = z.object({
286
- text: z.string(),
287
- after_message_index: z.number().int().nonnegative().nullable().describe('The full-transcript index of the row the card follows; null puts it above the transcript.'),
288
- });
289
291
  /** TAL-454: the chat a `/branch` copied, with its redacted title. */
290
292
  export const BranchedFromSchema = z.object({ session_id: SessionIdSchema, title: z.string() });
293
+ export const MAX_SOURCE_REFERENCES = 5;
294
+ export const SourceReferenceSchema = z.object({
295
+ session_id: z.string().regex(/^[A-Za-z0-9_-]{1,128}$/).describe('Retained logical conversation identity.'),
296
+ tip_session_id: z.string().regex(/^[A-Za-z0-9_-]{1,128}$/),
297
+ profile: z.string().min(1).max(128),
298
+ });
299
+ export const AcceptedSourceReferenceSchema = SourceReferenceSchema.extend({ title: z.string() });
291
300
  /** Full session record from `GET /api/session` and mutations returning `session`. */
301
+ export const SessionActivityPhaseSchema = z.enum(['starting', 'running', 'waiting_for_approval', 'waiting_for_input', 'completed', 'failed', 'cancelled', 'stale']);
302
+ /** Raw rows remain for older clients; current clients render only the server-normalized display items. */
303
+ export const TodoItemSchema = z.looseObject({ id: z.union([z.string(), z.number()]).optional(), text: z.string().optional(), content: z.string().optional(), title: z.string().optional(), status: z.string().optional(), done: z.boolean().optional(), completed: z.boolean().optional() });
304
+ export const TodoStateSchema = z.looseObject({
305
+ display_items: z.array(z.object({ id: z.union([z.string(), z.number()]).optional(), text: z.string(), state: z.enum(['pending', 'in_progress', 'completed', 'cancelled']) })).optional(),
306
+ total_count: z.number().int().nonnegative().optional(), completed_count: z.number().int().nonnegative().optional(),
307
+ pending_count: z.number().int().nonnegative().optional(), in_progress_count: z.number().int().nonnegative().optional(), cancelled_count: z.number().int().nonnegative().optional(),
308
+ session_id: z.string().optional(), todos: z.array(TodoItemSchema).optional(), summary: z.record(z.string(), z.unknown()).optional(),
309
+ version: z.number().optional(), ts: z.number().optional(), source: z.string().optional(), description: z.string().optional(),
310
+ });
292
311
  export const SessionSchema = z.looseObject({
312
+ plan_gauge: PlanGaugeSchema.nullable().optional(),
313
+ show_reasoning: z.boolean().optional().describe('Server-resolved display preference. Hidden reasoning is omitted from live events, history and activity scenes; older servers omit this field.'),
314
+ activity_phase: SessionActivityPhaseSchema.optional(),
315
+ todo_state: TodoStateSchema.optional(),
316
+ source_references: z.array(AcceptedSourceReferenceSchema).optional(),
293
317
  context_detail_key: z.string().nullable().optional().describe('Opaque identity for open-only context details; changes with owner epoch, model and context.'),
294
318
  composer_state_key: z.string().optional().describe('Opaque profile-home and owner identity for device-local composer state; never an API session id.'),
295
319
  session_id: SessionIdSchema, title: z.string(), workspace: z.string().optional(), created_workspace: z.string().nullable().optional(), model: NullableString.optional(), model_provider: NullableString.optional(),
@@ -324,10 +348,14 @@ export const SessionSchema = z.looseObject({
324
348
  /** The agent's display name: a named profile's own name, else the `bot_name` setting (TAL-458). */
325
349
  assistant_name: z.string().optional(),
326
350
  workspace_name: WorkspaceNameSchema,
327
- compression_reference: CompressionReferenceSchema.nullable().optional(),
351
+ focus_path: NullableString.optional().describe('TAL-1458: the last non-null `focus_path` of the session\'s persisted tool calls, so a reopened chat shows its file before any stream event; null when none.'),
328
352
  branched_from: BranchedFromSchema.nullable().optional().describe('TAL-454: the chat this one was branched from while it still loads (archived included); null for a compression continuation, a deleted or missing parent, and every other chat.'),
329
353
  });
330
354
  export const SessionEnvelopeSchema = z.looseObject({ session: SessionSchema });
355
+ /** TAL-1534: the sidebar group a listed row belongs to; `pinned` rows come first in the canonical order. */
356
+ export const SidebarGroupKindSchema = z.enum(['pinned', 'recent']);
357
+ /** One group present in a session list, with its English caption; clients localize the known kinds. */
358
+ export const SidebarGroupSchema = z.object({ kind: SidebarGroupKindSchema, title: z.string() });
331
359
  /** Sidebar row from `GET /api/sessions`. */
332
360
  export const SessionRowSchema = z.looseObject({
333
361
  session_id: SessionIdSchema, title: z.string(), workspace: z.string().optional(), model: NullableString.optional(), created_at: UnixSeconds.optional(), updated_at: UnixSeconds.optional(), last_message_at: NullableNumber.optional(),
@@ -336,6 +364,7 @@ export const SessionRowSchema = z.looseObject({
336
364
  source_tag: NullableString.optional(), source_label: NullableString.optional(), session_source: NullableString.optional(), raw_source: NullableString.optional(), parent_session_id: NullableString.optional(),
337
365
  active_stream_id: ActiveStreamIdSchema, share_token: NullableString.optional(), share_url: NullableString.optional(), worktree_branch: NullableString.optional(), match_type: z.enum(['title', 'metadata', 'content']).optional(), match_preview: NullableString.optional(),
338
366
  workspace_name: WorkspaceNameSchema,
367
+ sidebar_group: SidebarGroupKindSchema.nullable().optional().describe('TAL-1534: the sidebar group `GET /api/sessions` files the row under; null for an archived row. Other routes omit it.'),
339
368
  ...ContextUsageFields,
340
369
  });
341
370
  /**
@@ -351,14 +380,16 @@ export const SessionsListSchema = z.looseObject({
351
380
  // TAL-482: sidebar counts for the "Scheduled sessions" / "Webhook sessions" groups; `_truncated` means more exist than are listed.
352
381
  scheduled_session_count: z.number().int().nonnegative(), scheduled_sessions_truncated: z.boolean(),
353
382
  webhook_session_count: z.number().int().nonnegative(), webhook_sessions_truncated: z.boolean(),
383
+ sidebar_groups: z.array(SidebarGroupSchema).describe('TAL-1534: the groups the unarchived `sessions` rows fill, in display order; a client captions only these.'),
354
384
  agent_storage: AgentStorageSchema.describe('Agent session storage health; a degraded state explains an empty or missing Agent session list.'),
355
385
  archived_limit: z.number().int().nullable().optional(), archived_offset: z.number().int().optional(),
356
386
  });
357
387
  export const SessionStatusSchema = z.looseObject({
388
+ activity_phase: SessionActivityPhaseSchema.optional(),
358
389
  session_id: SessionIdSchema, title: z.string().optional(), active_stream_id: ActiveStreamIdSchema, active_turn_origin: ActiveTurnOriginSchema, agent_running: IsStreamingSchema, is_streaming: IsStreamingSchema, read_only: ReadOnlySchema, read_only_reason: ReadOnlyReasonSchema, owner_attachment: OwnerAttachmentSchema.optional(), message_count: z.number().optional(), model: NullableString.optional(),
359
390
  profile: NullableString.optional(), workspace: z.string().optional(), input_tokens: z.number().optional(), output_tokens: z.number().optional(), total_tokens: z.number().optional(), estimated_cost: NullableNumber.optional(), updated_at: UnixSeconds.optional(),
360
391
  });
361
- export const SessionUsageSchema = z.looseObject({ input_tokens: z.number().optional(), output_tokens: z.number().optional(), total_tokens: z.number().optional(), estimated_cost: NullableNumber.optional(), model: NullableString.optional() });
392
+ export const SessionUsageSchema = z.looseObject({ plan_gauge: PlanGaugeSchema.nullable().optional(), input_tokens: z.number().optional(), output_tokens: z.number().optional(), total_tokens: z.number().optional(), estimated_cost: NullableNumber.optional(), model: NullableString.optional() });
362
393
  export const ProjectSchema = z.looseObject({ project_id: z.string(), name: z.string(), color: z.string().nullable().optional(), profile: NullableString.optional(), created_at: z.number().optional() });
363
394
  export const ProjectsSchema = z.looseObject({ projects: z.array(ProjectSchema), active_profile: z.string(), all_profiles: z.boolean(), other_profile_count: z.number().int() });
364
395
  export const SessionDeleteResultSchema = z.looseObject({ ok: z.literal(true), state_db_cleanup_failed: z.boolean().optional() });
@@ -385,7 +416,7 @@ export const ChatStartResponseSchema = z.looseObject({
385
416
  * stream's session: this run while it unwinds after a Stop, or a successor such as a goal continuation. A session delete
386
417
  * answers 409 while it is set, so a client draining a session before deleting it waits until it is null.
387
418
  */
388
- export const StreamStatusSchema = z.looseObject({ active: z.boolean(), stream_id: z.string(), replay_available: z.boolean().optional(), journal: Json.optional(), blocking_stream_id: z.string().nullable() });
419
+ export const StreamStatusSchema = z.looseObject({ activity_phase: SessionActivityPhaseSchema.optional(), active: z.boolean(), stream_id: z.string(), replay_available: z.boolean().optional(), journal: Json.optional(), blocking_stream_id: z.string().nullable() });
389
420
  /**
390
421
  * TAL-424: a pending steer is no longer pending without the Agent taking it: Edit and Cancel by the user, `stopped` by a
391
422
  * Stop (`text` goes back to the composer), or `followup` when the server sends it as the next turn. `steer_id` is null
@@ -396,7 +427,7 @@ export const SteerWithdrawnSchema = z.object({ steer_id: z.string().nullable(),
396
427
  * `withdrawn_steers` (TAL-426): the steers this Stop withdrew, the same `steer_withdrawn` (stopped) the stream carries, so
397
428
  * a client that stops reading the stream once the Stop answers still gives its own text back.
398
429
  */
399
- export const CancelResponseSchema = z.looseObject({ ok: z.boolean(), cancelled: z.boolean(), stream_id: z.string().optional(), withdrawn_steers: z.array(SteerWithdrawnSchema).optional(), error: z.string().optional() });
430
+ export const CancelResponseSchema = z.looseObject({ activity_phase: SessionActivityPhaseSchema.optional(), ok: z.boolean(), cancelled: z.boolean(), stream_id: z.string().optional(), withdrawn_steers: z.array(SteerWithdrawnSchema).optional(), error: z.string().optional() });
400
431
  export const SteerWithdrawRequestSchema = z.object({ session_id: SessionIdSchema, steer_id: z.string().min(1), reason: z.enum(['edit', 'cancel']) });
401
432
  /** `withdrawn: false` when the steer is unknown, already taken by the Agent (it then settles as consumed), or being sent. */
402
433
  export const SteerWithdrawResponseSchema = z.object({ withdrawn: z.boolean(), text: z.string().optional() });
@@ -493,7 +524,7 @@ export const BackgroundTaskSchema = z.object({
493
524
  * result. `agents_working` (TAL-373): a delegation is running or needs attention, whatever `kind` the list is narrowed to;
494
525
  * the chat's side panel opens on Agents for it. Absent from servers before TAL-373.
495
526
  */
496
- export const BackgroundTasksResponseSchema = z.object({ session_id: z.string(), tasks: z.array(BackgroundTaskSchema), agent_available: z.boolean(), agents_working: z.boolean().optional() });
527
+ export const BackgroundTasksResponseSchema = z.object({ activity_phase: SessionActivityPhaseSchema.optional(), session_id: z.string(), tasks: z.array(BackgroundTaskSchema), agent_available: z.boolean(), agents_working: z.boolean().optional() });
497
528
  export const BackgroundTaskResultSchema = z.object({ task_id: z.string(), text: z.string() });
498
529
  export const BackgroundDismissRequestSchema = z.object({ session_id: SessionIdSchema, task_id: z.string().min(1) });
499
530
  export const BackgroundStopResponseSchema = z.object({ outcome: z.enum(['stopped', 'not_running', 'not_found']) });
@@ -502,11 +533,16 @@ export const ShareCreateResponseSchema = z.looseObject({ ok: z.literal(true), sh
502
533
  export const ShareMessageSchema = z.looseObject({ role: z.string(), content: z.union([z.string(), z.null(), z.array(Json)]).optional() });
503
534
  export const ShareSchema = z.looseObject({ title: z.string(), messages: z.array(ShareMessageSchema), message_count: z.number().int(), created_at: z.number().optional(), updated_at: z.number().optional(), model: NullableString.optional() });
504
535
  export const ShareReadSchema = z.looseObject({ share: ShareSchema });
536
+ export const SourceReferenceSearchSchema = z.object({
537
+ sessions: z.array(SessionRowSchema.extend({ source_reference: SourceReferenceSchema })),
538
+ active_profile: z.string(), max_sources: z.number().int(),
539
+ });
505
540
  export const SessionNewRequestSchema = z.looseObject({
506
541
  title: z.string().optional(), workspace: z.string().optional(), workspace_inherited_from_prev_session: z.boolean().optional(), model: z.string().nullable().optional(), model_provider: z.string().nullable().optional(),
507
542
  profile: z.string().nullable().optional(), prev_session_id: z.string().optional(), project_id: z.string().nullable().optional(), worktree: Json.optional(), enabled_toolsets: z.array(z.string()).nullable().optional(), parent_session_id: z.string().optional(),
508
543
  execution_mode: ExecutionModeSchema.optional().describe('TAL-1040: `ignore_config` and `safe` start the session through the Agent owner; omitted means normal.'),
509
- request_id: z.string().regex(/^[A-Za-z0-9_-]{1,64}$/).optional().describe('TAL-1040: stable creation identity for a diagnostic chat. Reuse it only to retry the same creation.'),
544
+ request_id: z.string().regex(/^[A-Za-z0-9_-]{1,64}$/).optional().describe('TAL-1040: stable creation identity for a diagnostic or referenced chat. Reuse it only to retry the same creation.'),
545
+ source_references: z.array(SourceReferenceSchema).max(MAX_SOURCE_REFERENCES).optional().describe('Same-profile search pointers. Nonempty selections require request_id; unavailable or changed identities refuse creation.'),
510
546
  });
511
547
  /**
512
548
  * `streaming` (TAL-802): live dictation over `TRANSCRIBE_STREAM_PATH` would open for this profile (`stt.streaming` on, a live provider wire).
@@ -524,13 +560,15 @@ export const QuotaThresholdsSchema = z.object({
524
560
  pace_warning_burn_rate_percent: z.number().int().min(100).max(300), pace_critical_burn_rate_percent: z.number().int().min(100).max(400), pace_minimum_elapsed_hours: z.number().int().min(0).max(72),
525
561
  });
526
562
  export const LoginResponseSchema = z.looseObject({ ok: z.literal(true), message: z.string().optional() });
563
+ /** TAL-1569: Talaria Web update channels, in display order. Nightly is a daily snapshot of the Experimental artifact. */
564
+ export const WebUpdateChannelSchema = z.enum(['stable', 'nightly', 'experimental']);
527
565
  export const SettingsSchema = z.looseObject({
528
566
  bot_name: z.string().optional(), default_model: z.string().optional(), default_workspace: z.string().optional(), language: z.string().optional(), send_key: z.string().optional(), font_size: z.string().optional(),
529
567
  full_width_chat: z.boolean().optional(), chat_width: z.enum(['comfortable', 'wide', 'full']).optional(), auto_scroll_follow: z.boolean().optional(), render_user_markdown: z.boolean().optional(), chat_activity_display_mode: z.string().optional(), default_message_mode: z.string().optional(),
530
568
  fade_text_effect: z.boolean().optional(), hidden_tabs: z.array(z.string()).optional(), composer_control_order: z.array(z.string()).optional(), show_cli_sessions: z.boolean().optional(), show_claude_code_sessions: z.boolean().optional(),
531
569
  show_cron_sessions: z.boolean().optional(), show_webhook_sessions: z.boolean().optional(), show_kanban_sessions: z.boolean().optional(), check_for_updates: z.boolean().optional(), summarize_updates_automatically: z.boolean().optional(), ignore_agent_updates: z.boolean().optional(),
532
570
  auth_enabled: z.boolean().optional(), password_auth_enabled: z.boolean().optional(), password_env_var: z.boolean().optional(), passkeys_enabled: z.boolean().optional(), passwordless_enabled: z.boolean().optional(),
533
- auth_disabled_acknowledged: z.boolean().optional(), webui_version: z.string().optional(), agent_version: z.string().optional(), update_channel: z.string().optional(), agent_update_channel: z.enum(['stable', 'experimental']).optional(), update_channel_version: NullableString.optional(),
571
+ auth_disabled_acknowledged: z.boolean().optional(), webui_version: z.string().optional(), agent_version: z.string().optional(), update_channel: z.string().optional(), update_channels: z.array(WebUpdateChannelSchema).optional().describe('TAL-1569: the Web update channels this server offers, in display order.'), agent_update_channel: z.enum(['stable', 'experimental']).optional(), update_channel_version: NullableString.optional(),
534
572
  max_tokens: NullableNumber.optional(), max_tokens_effective: NullableNumber.optional(), max_tokens_fallback: NullableNumber.optional(), tts_engine: z.string().optional(), tts_voice: z.string().optional(),
535
573
  dictation_append: z.boolean().optional(), persisted_speech_keys: z.array(z.string()).optional(),
536
574
  /** TAL-279: ask before opening external chat links; `trusted_link_hosts` are exact, server-normalized hostnames that skip the ask. */
@@ -560,6 +598,7 @@ export const QuotaLevelSchema = z.enum(['healthy', 'warning', 'critical', 'stale
560
598
  * TAL-807: `limit` is present while the provider's credential pool cannot serve this model until `resets_at` (ISO-8601 UTC).
561
599
  */
562
600
  export const ModelEntrySchema = z.looseObject({
601
+ allowance: ModelAllowanceSchema.optional(),
563
602
  id: z.string(), label: z.string().optional(), provider: z.string().optional(), provider_id: z.string().optional(), bare_id: z.string().optional(), supports_fast_tier: z.boolean().optional(), supported_speed_tiers: z.array(SpeedTierSchema).optional(),
564
603
  limit: z.object({ scope: z.literal('model'), resets_at: z.string() }).optional(),
565
604
  });
@@ -575,6 +614,7 @@ export const ModelGroupLimitSchema = z.discriminatedUnion('scope', [
575
614
  */
576
615
  export const CatalogAvailabilitySchema = z.object({ status: z.enum(['available', 'stale', 'unavailable']), authoritative: z.boolean(), unavailable_reason: NullableString, generation: z.string().min(1).describe('Opaque source generation; cached data from another generation must never be merged.') });
577
616
  export const ModelGroupSchema = z.looseObject({
617
+ plan_usage: PlanUsageSchema.nullable().optional(), plan_stale: z.boolean().optional(), sections: ModelSectionsSchema.optional(),
578
618
  availability: CatalogAvailabilitySchema.optional(),
579
619
  provider: z.string(), provider_id: z.string().optional(), models: z.array(ModelEntrySchema), extra_models: z.array(ModelEntrySchema).optional(),
580
620
  limit: ModelGroupLimitSchema.optional(), quota_level: QuotaLevelSchema.optional(),
@@ -592,6 +632,7 @@ export const KeySourceKindSchema = z.enum(['env', 'oauth', 'config', 'pool', 'pl
592
632
  export const ProviderSchema = z.looseObject({
593
633
  id: z.string(), display_name: z.string().optional(), has_key: z.boolean().optional(), configured: z.boolean().optional(), configurable: z.boolean().optional(), is_oauth: z.boolean().optional(), is_plugin_provider: z.boolean().optional(), is_self_hosted: z.boolean().optional(),
594
634
  is_custom: z.boolean().optional(), key_source: z.string().optional(), base_url: NullableString.optional(), auth_error: NullableString.optional(), env_var: NullableString.optional(), models: z.array(ModelEntrySchema).optional(), models_total: z.number().optional(),
635
+ nous_account: NousAccountSchema.nullable().optional(), nous_account_error: NullableString.optional(),
595
636
  is_active: z.boolean().optional(), key_source_kind: KeySourceKindSchema.nullable().optional(), removable: z.boolean().optional(),
596
637
  });
597
638
  export const ProvidersSchema = z.looseObject({ availability: CatalogAvailabilitySchema.optional(), providers: z.array(ProviderSchema), active_provider: NullableString.optional() });
@@ -619,6 +660,7 @@ export const QuotaWindowSchema = z.looseObject({
619
660
  });
620
661
  const QuotaWindowIndex = z.number().int().nullable().optional();
621
662
  export const QuotaSourceSchema = z.looseObject({
663
+ plan_usage: PlanUsageSchema.nullable().optional(), plan_stale: z.boolean().optional(),
622
664
  computed_at: z.string().optional().describe('Original reference time of this source, retained with stale windows.'),
623
665
  source_id: z.string(), provider_id: z.string().optional(), provider_label: z.string().optional(), account_label: z.string().optional(), status: z.string().optional(), supported: z.boolean().optional(), message: z.string().nullable().optional(),
624
666
  is_active_provider: z.boolean().optional(), quota: Json.optional(), windows: z.array(QuotaWindowSchema).optional(), balances: Json.optional(), plan: Json.optional(), details: Json.optional(), unavailable_reason: Json.optional(), retry_after: Json.optional(), fetched_at: Json.optional(),
@@ -628,6 +670,7 @@ export const QuotaSourceSchema = z.looseObject({
628
670
  });
629
671
  /** An account-usage provider's normalised snapshot on `/api/provider/quota` (the same windows and indexes as a quotas source). */
630
672
  export const QuotaAccountLimitsSchema = z.looseObject({
673
+ plan_usage: PlanUsageSchema.nullable().optional(), plan_stale: z.boolean().optional(),
631
674
  available: z.boolean().optional(), stale: z.boolean().optional(), title: z.string().optional(), plan: Json.optional(), unavailable_reason: NullableString.optional(),
632
675
  windows: z.array(QuotaWindowSchema), details: Json.optional(), fetched_at: NullableString.describe('ISO-8601 UTC.'),
633
676
  pace_window_index: QuotaWindowIndex, session_window_index: QuotaWindowIndex, weekly_window_index: QuotaWindowIndex,
@@ -681,22 +724,24 @@ export const AuxiliaryTaskSchema = z.looseObject({
681
724
  /** TAL-800: the reasoning effort the slot runs with (the Agent's default until one is saved; `''` = provider default); null when the Agent does not report its slots. */
682
725
  reasoning_effort: z.string().nullable(),
683
726
  });
684
- export const AuxiliaryModelsSchema = z.looseObject({ main: z.looseObject({ model: z.string().optional(), provider: z.string().optional(), base_url: z.string().optional(), api_key_set: z.boolean().optional(), service_tier: z.enum(['', 'default', 'priority', 'ultrafast']).optional().describe('Empty string is the Standard value returned by older servers.'), supported_speed_tiers: z.array(SpeedTierSchema).optional() }), tasks: z.array(AuxiliaryTaskSchema) });
727
+ export const AuxiliaryModelsSchema = z.looseObject({ delegation: DelegationSettingsSchema.optional(), main: z.looseObject({ model: z.string().optional(), provider: z.string().optional(), base_url: z.string().optional(), api_key_set: z.boolean().optional(), service_tier: z.enum(['', 'default', 'priority', 'ultrafast']).optional().describe('Empty string is the Standard value returned by older servers.'), supported_speed_tiers: z.array(SpeedTierSchema).optional() }), tasks: z.array(AuxiliaryTaskSchema) });
685
728
  export const MaxTokensSchema = z.looseObject({ max_tokens: NullableNumber, max_tokens_effective: NullableNumber, max_tokens_fallback: NullableNumber });
686
729
  // ── workspaces, files, git ───────────────────────────────────────────────
687
730
  /** A registry entry; `name` is never empty (the folder name when none is registered, `Home` for `default`), so pickers show it as-is (TAL-303). */
688
731
  export const WorkspaceEntrySchema = z.looseObject({ name: z.string().min(1), path: z.string() });
689
732
  export const WorkspacesSchema = z.looseObject({ workspaces: z.array(WorkspaceEntrySchema), last: NullableString.optional(), terminal_remote_backend: z.boolean().optional() });
690
733
  export const FileEntrySchema = z.looseObject({
691
- name: z.string(), path: z.string().optional(), is_dir: z.boolean().optional(), type: z.string().optional(), size: z.number().nullable().optional(), mtime: z.number().nullable().optional(), mtime_ns: z.union([z.number(), z.string()]).nullable().optional(),
734
+ read_only: z.boolean().optional(), name: z.string(), path: z.string().optional(), is_dir: z.boolean().optional(), type: z.string().optional(), size: z.number().nullable().optional(), mtime: z.number().nullable().optional(), mtime_ns: z.union([z.number(), z.string()]).nullable().optional(),
692
735
  birthtime_ns: z.union([z.number(), z.string()]).nullable().optional(), hidden: z.boolean().optional(), workspace_sort_rank: z.number().int().optional(), target: z.string().optional(), target_outside_workspace: z.boolean().optional(),
693
736
  });
694
- export const DirListingSchema = z.looseObject({ path: z.string().optional(), entries: z.array(FileEntrySchema), signature: z.string().optional(), workspace: z.string().optional(), workspace_recovered: z.boolean().optional(), is_git: z.boolean().optional() });
737
+ export const FileSourceSchema = z.enum(['workspace', 'managed']);
738
+ const ManagedFileFields = { source: FileSourceSchema.optional(), read_only: z.boolean().optional(), write_semantics: z.literal('unconditional').optional() };
739
+ export const DirListingSchema = z.looseObject({ ...ManagedFileFields, unavailable: z.boolean().optional(), path: z.string().optional(), entries: z.array(FileEntrySchema), signature: z.string().optional(), workspace: z.string().optional(), workspace_recovered: z.boolean().optional(), is_git: z.boolean().optional() });
695
740
  /** How a workspace file renders (TAL-566): media streams from `/api/file/raw`; text kinds carry `content`. */
696
741
  export const FilePreviewKindSchema = z.enum(['text', 'markdown', 'csv', 'html', 'image', 'pdf', 'audio', 'video', 'binary']);
697
742
  /** `table` is a `csv` preview's leading rows (header first); `table_truncated` says the file has more. `preview_url` is an
698
743
  * `html` preview's app-relative frame URL, under which the page's relative assets also resolve. */
699
- export const FileContentSchema = z.looseObject({
744
+ export const FileContentSchema = z.looseObject({ ...ManagedFileFields, name: z.string().optional(),
700
745
  path: z.string().optional(), content: z.string().optional(), lines: z.number().optional(), size: z.number().optional(), truncated: z.boolean().optional(), binary: z.boolean().optional(), mime: z.string().optional(),
701
746
  preview: FilePreviewKindSchema.optional(), table: z.array(z.array(z.string())).optional(), table_truncated: z.boolean().optional(),
702
747
  preview_url: z.string().optional(),
@@ -803,7 +848,7 @@ export const UpdateVersionSchema = z.object({
803
848
  }).describe('TAL-946: one installable Stable release newer than the installed one.');
804
849
  export const UpdateTargetSchema = z.looseObject({
805
850
  failed_update: z.object({ version: z.string(), restored_version: z.string() }).optional().describe('Web only: the update that failed before HTTP readiness and the restored package version. Manual retry remains available.'),
806
- name: z.string().optional(), channel: z.enum(['stable', 'experimental']).optional(),
851
+ name: z.string().optional(), channel: WebUpdateChannelSchema.optional(),
807
852
  unsupported: z.boolean().optional().describe('Deprecated (TAL-350): `support === \'unchecked\'`, kept for older clients.'),
808
853
  support: AgentSupportSchema.optional().describe('Agent target only (TAL-350): `supported` when the target revision is exactly a release in the verified Agent window, else `unchecked`; an `unchecked` apply requires `confirmed_agent_revision`.'),
809
854
  support_label: z.string().optional().describe('Agent target only (TAL-946): `support` worded to fit one phone line.'),
@@ -818,7 +863,7 @@ export const UpdateTargetSchema = z.looseObject({
818
863
  versions: z.array(UpdateVersionSchema).describe('TAL-946: every installable Stable release newer than the installed one, newest first; empty unless `release_ready` can apply.'),
819
864
  folded_count: z.number().int().nonnegative().describe('How many `versions` are `folded`.'),
820
865
  });
821
- export const AgentRecoveryStateSchema = z.object({ phase: z.enum(['idle', 'running', 'waiting', 'complete', 'blocked']), attempt: z.number().int().nonnegative(), detail: z.string(), retry_at: z.string().nullable() });
866
+ export const AgentRecoveryStateSchema = z.object({ phase: z.enum(['idle', 'running', 'waiting', 'complete', 'blocked']), attempt: z.number().int().nonnegative(), detail: z.string(), retry_at: z.string().nullable(), operation_id: z.uuid().optional(), operation: AgentUpdateOperationSchema.optional(), verified_revision: z.string().regex(/^[a-f0-9]{40}$/).optional(), runtime_revision: z.string().regex(/^[a-f0-9]{40}$/).optional(), verified_version: z.string().nullable().optional() });
822
867
  export const UpdatesCheckSchema = z.looseObject({ agent_recovery: AgentRecoveryStateSchema.optional(), disabled: z.boolean().optional(), cached: z.boolean().optional(), channel: z.string().optional(), agent_channel: z.enum(['stable', 'experimental']).optional(), checked_at: z.number().optional(), include_agent: z.boolean().optional(), webui: UpdateTargetSchema.nullable().optional(), agent: UpdateTargetSchema.nullable().optional() });
823
868
  export const UpdatesSummarySchema = z.object({
824
869
  ok: z.boolean(), target: z.enum(['webui', 'agent']), summary: z.string(),
@@ -830,12 +875,15 @@ export const UpdatesSummarySchema = z.object({
830
875
  cached: z.boolean(),
831
876
  });
832
877
  export const UpdateApplySchema = z.looseObject({
878
+ recovery_only: z.boolean().optional().describe('Only a retained transaction was repaired; the selected update outcome remains unverified.'),
879
+ recovery_pending: z.boolean().optional().describe('The initiating operation remains active through automatic recovery; follow its notification_id without replaying the update.'),
880
+ verified_revision: z.string().regex(/^[a-f0-9]{40}$/).optional(), verified_version: z.string().nullable().optional(),
833
881
  recovery_compatibility: z.object({ manual_execution: z.boolean(), bot_chat_delivery: z.boolean() }).optional()
834
882
  .describe('Whether the target Agent can reconcile retained manual execution and pending Bot Chat records. A false value blocks the update before any source or repair-intent change.'),
835
883
  ok: z.boolean().optional(), status: z.string().optional(), error: z.string().optional(), message: z.string().optional(), lock: Json.optional(), confirmation_required: z.boolean().optional(), refresh_confirmation: AgentRefreshConfirmationSchema.optional(), candidate_revision: z.string().optional(), supported_revision: z.string().optional(), supported_version: z.string().optional(), agent_channel: z.enum(['stable', 'experimental']).optional(), notification_id: z.uuid().optional(), channel_switch: z.boolean().optional(), backup_dir: z.string().nullable().optional(), backup_failed: z.boolean().optional(), stash_conflict: z.boolean().optional(), gateway_restart: z.string().optional().describe('TAL-953: `waiting_for_idle` when an Agent update left the gateway restart to wait for the gateway\'s running work; the update notification reports its outcome.')
836
884
  });
837
885
  /** `verifying` (TAL-1138): the gateway restarted, and the server is checking that the new gateway process and the Agent runtime answer. */
838
- export const UpdateNotificationPhaseSchema = z.enum(['applying', 'awaiting_confirmation', 'waiting_for_idle', 'restarting', 'verifying', 'succeeded', 'blocked', 'failed', 'unknown']);
886
+ export const UpdateNotificationPhaseSchema = z.enum(['applying', 'awaiting_confirmation', 'waiting_for_idle', 'restarting', 'verifying', 'recovering', 'succeeded', 'blocked', 'failed', 'unknown']);
839
887
  export const UpdateNotificationActionSchema = z.object({
840
888
  id: z.string().min(1).max(64).regex(/^[a-z0-9][a-z0-9_-]*$/),
841
889
  label: z.string().min(1).max(80),
@@ -848,10 +896,15 @@ export const UpdateNotificationDestinationSchema = z.object({
848
896
  });
849
897
  /** TAL-1138: one step of an update as its Updating dialog lists it; the server derives every label and state. */
850
898
  export const UpdateStepSchema = z.object({
851
- id: z.enum(['install', 'web_restart', 'ready', 'gateway_wait', 'gateway_restart', 'agent_ready']),
899
+ id: z.enum(['install', 'web_restart', 'ready', 'gateway_wait', 'gateway_restart', 'agent_ready', 'recovery']),
852
900
  label: z.string().min(1).max(80),
853
901
  state: z.enum(['done', 'active', 'pending', 'failed']),
854
902
  });
903
+ export const AgentUpdateRecoverySchema = z.object({
904
+ operation: AgentUpdateOperationSchema, attempt_error: z.string().max(2000).nullable(), runtime_revision: z.string().regex(/^[a-f0-9]{40}$/).nullable(),
905
+ rollback: z.boolean().nullable().optional(),
906
+ outcome: z.enum(['recovering', 'target_installed', 'baseline_restored', 'other_revision', 'blocked', 'unknown']),
907
+ });
855
908
  export const UpdateNotificationSchema = z.object({
856
909
  id: z.uuid(),
857
910
  kind: z.string().min(1).max(64).regex(/^[a-z0-9][a-z0-9_-]*$/),
@@ -873,6 +926,7 @@ export const UpdateNotificationSchema = z.object({
873
926
  verified_version: z.string().min(1).max(80).nullable(),
874
927
  /** The apply's own explanation of a failed or blocked attempt, or of a success that needs attention (an Agent update that kept local edits in the git stash), line breaks kept; null otherwise. */
875
928
  detail: z.string().max(2000).nullable(),
929
+ recovery: AgentUpdateRecoverySchema.optional(),
876
930
  unread: z.boolean(),
877
931
  active: z.boolean(),
878
932
  requires_interaction: z.boolean(),
@@ -926,7 +980,7 @@ export const PluginSchema = z.looseObject({ key: z.string(), name: z.string().op
926
980
  * `in_process`, so Settings recommends `plugins.isolation: host`; Talaria never sets the mode.
927
981
  */
928
982
  export const PluginsSchema = z.looseObject({ plugins: z.array(PluginSchema), empty: z.boolean().optional(), read_only: z.boolean().optional(), supported_hooks: z.array(z.string()).optional(), unavailable: z.boolean().optional(), plugin_isolation_advisory: z.boolean().optional() });
929
- export const McpServerSchema = z.looseObject({ name: z.string(), id: z.string().optional(), transport: z.string().optional(), enabled: z.boolean().optional(), can_toggle: z.boolean().optional().describe('Whether PATCH can enable or disable this server; false for invalid config.'), active: z.boolean().optional(), status: z.string().optional(), tools: z.number().optional(), tool_count: z.number().int().nullable().optional(), health: z.string().optional(), health_detail: z.string().optional(), health_checked_at: Json.optional(), health_pending: z.boolean().optional() });
983
+ export const McpServerSchema = z.looseObject({ cost_policy: McpCostPolicySchema.nullable().optional(), name: z.string(), id: z.string().optional(), transport: z.string().optional(), enabled: z.boolean().optional(), can_toggle: z.boolean().optional().describe('Whether PATCH can enable or disable this server; false for invalid config.'), active: z.boolean().optional(), status: z.string().optional(), tools: z.number().optional(), tool_count: z.number().int().nullable().optional(), health: z.string().optional(), health_detail: z.string().optional(), health_checked_at: Json.optional(), health_pending: z.boolean().optional() });
930
984
  export const McpServersSchema = z.looseObject({ servers: z.array(McpServerSchema), health_pending: z.boolean().optional(), reload_required: z.boolean().optional(), toggle_supported: z.boolean().optional() });
931
985
  /** TAL-818: one connected account of a Nous tool-gateway app; `name` is its alias, else the vendor label. `problem` is its gateway status while it is not active, else null. */
932
986
  export const ConnectorAccountViewSchema = z.object({ connection_id: z.string(), name: z.string(), problem: z.enum(['pending', 'failed', 'expired', 'revoked', 'inactive']).nullable(), status_reason: z.string().nullable(), active: z.boolean(), created_at: z.string() });
@@ -945,7 +999,11 @@ export const ConnectorViewSchema = z.object({
945
999
  * so no switch changes them. `sign_in_required` offers Nous sign-in without creating a guest on reads.
946
1000
  * `rules_error`: why the rules could not be read; every app then reads off (fails closed).
947
1001
  */
948
- export const ConnectorsPageSchema = z.object({ available: z.boolean(), sign_in_required: z.boolean().default(false), connectors: z.array(ConnectorViewSchema), policy_revision: z.string().nullable(), rules_error: z.string().nullable() });
1002
+ export const ConnectorSignInOfferSchema = z.object({
1003
+ available: z.boolean(), due: z.boolean().describe('The native eligible due check at this read; an already delivered offer remains visible independently.'), visible: z.boolean(), offer_id: z.string().nullable(),
1004
+ actions: z.array(z.enum(['sign_in', 'dismiss'])), refresh_after: z.number().int().positive().nullable(),
1005
+ });
1006
+ export const ConnectorsPageSchema = z.object({ available: z.boolean(), sign_in_required: z.boolean().default(false), sign_in_offer: ConnectorSignInOfferSchema.optional(), connectors: z.array(ConnectorViewSchema), policy_revision: z.string().nullable(), rules_error: z.string().nullable() });
949
1007
  /**
950
1008
  * TAL-818: one app's tools: `enabled`: Hermes may use it (the member rules leave it on and nothing locks it); `locked`: an
951
1009
  * organization or role rule (by name or tag) keeps it off. `editable`: its switch may change the member rule (readable rules, the app on in them, and no lock).
@@ -982,8 +1040,6 @@ export const WikiStatusSchema = z.object({
982
1040
  });
983
1041
  export const WikiBrowseSchema = z.object({ pages: z.array(z.object({ name: z.string(), path: z.string(), size: z.number().int(), mtime: z.number().int() })) });
984
1042
  export const WikiPageSchema = z.object({ content: z.string(), path: z.string() });
985
- export const TodoItemSchema = z.looseObject({ id: z.union([z.string(), z.number()]).optional(), text: z.string().optional(), content: z.string().optional(), title: z.string().optional(), status: z.string().optional(), done: z.boolean().optional(), completed: z.boolean().optional() });
986
- export const TodoStateSchema = z.looseObject({ session_id: z.string().optional(), todos: z.array(TodoItemSchema).optional(), summary: z.record(z.string(), z.unknown()).optional(), version: z.number().optional(), ts: z.number().optional(), source: z.string().optional(), description: z.string().optional(), pending_count: z.number().optional() });
987
1043
  // ── onboarding ───────────────────────────────────────────────────────────
988
1044
  /** `oauth_flow` (TAL-398): `device_code` when the provider signs in through `/api/onboarding/oauth/*` instead of taking an API key; `oauth_label` then names the account to sign in with, and `signed_in` says whether the profile already holds its credential. */
989
1045
  export const OnboardingProviderSchema = z.looseObject({ id: z.string(), name: z.string().optional(), label: z.string().optional(), kind: z.string().optional(), oauth: z.boolean().optional(), needs_key: z.boolean().optional(), base_url: NullableString.optional(), models: z.array(Json).optional(), category: z.string().optional(), default_model: z.string().optional(), oauth_flow: z.literal('device_code').nullable().optional(), oauth_label: z.string().optional(), signed_in: z.boolean().optional() });
@@ -1002,6 +1058,7 @@ export const OnboardingProbeSchema = z.looseObject({ ok: z.boolean().optional(),
1002
1058
  * `user_code`, `verification_url`, `expires_in` and `interval` (seconds between polls) come with the start.
1003
1059
  */
1004
1060
  export const OnboardingOAuthSchema = z.looseObject({
1061
+ nous_account: NousAccountSchema.nullable().optional(),
1005
1062
  ok: z.boolean().optional(), status: z.string().optional(), url: z.string().optional(), verification_url: z.string().optional(), user_code: z.string().optional(), message: z.string().optional(),
1006
1063
  error: z.string().nullable().optional(), flow_id: z.string().optional(), provider: z.string().optional(), expires_in: z.number().int().optional(), interval: z.number().int().optional(),
1007
1064
  /**
@@ -1061,6 +1118,14 @@ export const KanbanTaskPolicyShape = { available_actions: KanbanTaskActionsSchem
1061
1118
  export const KanbanTaskViewSchema = z.looseObject({ id: z.union([z.string(), z.number()]), title: z.string().optional(), status: z.string().optional(), assignee: NullableString.optional(), priority: z.union([z.string(), z.number()]).nullable().optional(), description: z.string().optional(), tags: z.array(z.string()).optional(), session_id: NullableString.optional(), archived: z.boolean().optional(), created_at: Json.optional(), updated_at: Json.optional(), ...KanbanTaskPolicyShape });
1062
1119
  /** A board column in the Agent workflow's order (TAL-796): `name` is the status key, `label` the Agent's English label. */
1063
1120
  export const KanbanColumnSchema = z.looseObject({ name: z.string(), label: z.string(), tasks: z.array(KanbanTaskViewSchema) });
1121
+ /** One bounded profile-scoped read shared by timeline and relationship layouts. Null timing means unknown, never planned effort. */
1122
+ export const KanbanInspectionSchema = KanbanInspectionSnapshotSchema.extend({
1123
+ nodes: z.array(KanbanInspectionNodeSchema.extend({ task: KanbanTaskViewSchema,
1124
+ ancestors: z.array(z.string()), descendants: z.array(z.string()), cycle: z.boolean(), running_lineage: z.boolean(),
1125
+ timing: z.object({ start: z.number().nullable(), end: z.number().nullable(), duration_seconds: z.number().nullable(), offset: z.number().nullable(), width: z.number().nullable() }),
1126
+ })).max(500),
1127
+ window: z.object({ start: z.number().nullable(), end: z.number().nullable() }),
1128
+ });
1064
1129
  /** One profile lane (TAL-567): an assignee's tasks (`null` = unassigned) across every board column, with its task count. */
1065
1130
  export const KanbanLaneSchema = z.object({ assignee: z.string().nullable(), count: z.number().int(), columns: z.array(KanbanColumnSchema) });
1066
1131
  export const KanbanBoardViewSchema = z.looseObject({ columns: z.array(KanbanColumnSchema).optional(), assignees: z.array(Json).optional(), filters: Json.optional(), latest_event_id: z.number().optional(), read_only: z.boolean().optional(), tenants: z.array(Json).optional(), changed: z.boolean().optional(),