@maudecode/talaria-web-contracts 1.21.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 (68) 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/context-detail.d.ts +3 -3
  5. package/dist/delegation.d.ts +206 -0
  6. package/dist/delegation.js +32 -0
  7. package/dist/delegation.js.map +1 -0
  8. package/dist/gateway-session.d.ts +24 -4
  9. package/dist/gateway-session.js +5 -1
  10. package/dist/gateway-session.js.map +1 -1
  11. package/dist/groups-native.d.ts +427 -0
  12. package/dist/groups-native.js +40 -0
  13. package/dist/groups-native.js.map +1 -0
  14. package/dist/groups.d.ts +1545 -0
  15. package/dist/groups.js +12 -0
  16. package/dist/groups.js.map +1 -0
  17. package/dist/index.d.ts +5 -0
  18. package/dist/index.js +5 -0
  19. package/dist/index.js.map +1 -1
  20. package/dist/mcp-cost-policy.d.ts +1 -1
  21. package/dist/openapi.js +4 -0
  22. package/dist/openapi.js.map +1 -1
  23. package/dist/plan-usage.d.ts +92 -0
  24. package/dist/plan-usage.js +20 -0
  25. package/dist/plan-usage.js.map +1 -0
  26. package/dist/prompt-queue.d.ts +2 -2
  27. package/dist/router.d.ts +13 -20005
  28. package/dist/router.js +4 -1
  29. package/dist/router.js.map +1 -1
  30. package/dist/routes/automation.d.ts +15 -15
  31. package/dist/routes/chat.d.ts +269 -83
  32. package/dist/routes/groups.d.ts +860 -0
  33. package/dist/routes/groups.js +13 -0
  34. package/dist/routes/groups.js.map +1 -0
  35. package/dist/routes/raw.js +13 -3
  36. package/dist/routes/raw.js.map +1 -1
  37. package/dist/routes/sessions.d.ts +714 -204
  38. package/dist/routes/settings.d.ts +949 -1
  39. package/dist/routes/settings.js +26 -0
  40. package/dist/routes/settings.js.map +1 -1
  41. package/dist/routes/tools.d.ts +109 -24
  42. package/dist/routes/tools.js +5 -2
  43. package/dist/routes/tools.js.map +1 -1
  44. package/dist/routes/workspaces.d.ts +2 -2
  45. package/dist/sidecar/methods.d.ts +522 -24
  46. package/dist/sidecar/methods.js +3 -1
  47. package/dist/sidecar/methods.js.map +1 -1
  48. package/dist/sidecar/namespaces.d.ts +611 -34
  49. package/dist/sidecar/namespaces.js +46 -5
  50. package/dist/sidecar/namespaces.js.map +1 -1
  51. package/dist/sidecar/rpc.d.ts +3 -3
  52. package/dist/sidecar/version.d.ts +1 -1
  53. package/dist/sidecar/version.js +1 -1
  54. package/dist/sse.d.ts +95 -20
  55. package/dist/sse.js +4 -3
  56. package/dist/sse.js.map +1 -1
  57. package/dist/views.d.ts +872 -161
  58. package/dist/views.js +43 -20
  59. package/dist/views.js.map +1 -1
  60. package/fixtures/sidecar/agent-imports.json +6 -0
  61. package/fixtures/sidecar/aux.json +58 -0
  62. package/fixtures/sidecar/connectors.json +29 -0
  63. package/fixtures/sidecar/groups.json +18 -0
  64. package/fixtures/sidecar/providers.json +37 -1
  65. package/fixtures/sidecar/runtime.json +3 -3
  66. package/fixtures/sidecar/skills.json +19 -2
  67. package/fixtures/sidecar/tts.json +6 -0
  68. package/package.json +1 -1
package/dist/views.js CHANGED
@@ -1,3 +1,5 @@
1
+ import { DelegationSettingsSchema } from './delegation.js';
2
+ import { PlanGaugeSchema, PlanUsageSchema, ModelAllowanceSchema, ModelSectionsSchema } from './plan-usage.js';
1
3
  import { McpCostPolicySchema } from './mcp-cost-policy.js';
2
4
  /**
3
5
  * Pinned response shapes shared by every consumer (formerly the frontend's
@@ -11,7 +13,7 @@ import { RunStatusSchema } from './run-status.js';
11
13
  import { AgentRefreshConfirmationSchema, AgentUpdateOperationSchema } from './sidecar/runtime.js';
12
14
  import { SpeedTierSchema } from './speed.js';
13
15
  import { ExecutionModeSchema, OwnerAttachmentSchema, MessageReactionViewSchema } from './gateway-session.js';
14
- import { KanbanInspectionNodeSchema, KanbanInspectionSnapshotSchema, CanonicalBotChatSchema, GatewayModeSchema, PluginOAuthClientSchema, PluginSettingFieldSchema, SkillCatalogIdentitySchema } from './sidecar/namespaces.js';
16
+ import { NousAccountSchema, KanbanInspectionNodeSchema, KanbanInspectionSnapshotSchema, CanonicalBotChatSchema, GatewayModeSchema, PluginOAuthClientSchema, PluginSettingFieldSchema, SkillCatalogIdentitySchema } from './sidecar/namespaces.js';
15
17
  export { SpeedTierSchema } from './speed.js';
16
18
  const Json = z.unknown();
17
19
  export const NullableString = z.string().nullable();
@@ -21,6 +23,7 @@ export const UnixSeconds = z.number();
21
23
  // ── sessions ─────────────────────────────────────────────────────────────
22
24
  export const SessionIdSchema = z.string().regex(/^[A-Za-z0-9_.:-]{1,128}$/, 'invalid session id');
23
25
  export const AttachmentSchema = z.looseObject({
26
+ download_url: z.string().startsWith('/api/groups/file?').optional(),
24
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(),
25
28
  });
26
29
  /** The server's display class for a tool call: clients map it to an icon and localized verb, and never classify names themselves. */
@@ -195,8 +198,10 @@ export const MessageSchema = z.looseObject({
195
198
  review_state: BackgroundReviewStateSchema.optional(),
196
199
  }).optional(),
197
200
  /**
198
- * TAL-305: a marker the Agent wrote around context compaction, not a message anyone typed. Clients render a collapsed
199
- * 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.
200
205
  */
201
206
  _marker_kind: z.enum(['context_compaction', 'preserved_task_list']).optional(),
202
207
  /** TAL-305: a preserved task list's card body, without its marker line. */
@@ -283,15 +288,6 @@ const IsMessagingSessionSchema = z.boolean().describe('`source_kind` is `messagi
283
288
  * the folder name (TAL-303). Null without a workspace; absent from an older server, where clients show no label.
284
289
  */
285
290
  const WorkspaceNameSchema = NullableString.optional();
286
- /**
287
- * TAL-560: the "Context compaction · Reference only" card, on payloads that carry `messages`. Clients render `text` after
288
- * the row at full-transcript index `after_message_index` (row `after_message_index - _messages_offset` of `messages`), or
289
- * above the loaded rows when it is null or before them. Null: no card.
290
- */
291
- export const CompressionReferenceSchema = z.object({
292
- text: z.string(),
293
- 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.'),
294
- });
295
291
  /** TAL-454: the chat a `/branch` copied, with its redacted title. */
296
292
  export const BranchedFromSchema = z.object({ session_id: SessionIdSchema, title: z.string() });
297
293
  export const MAX_SOURCE_REFERENCES = 5;
@@ -303,8 +299,20 @@ export const SourceReferenceSchema = z.object({
303
299
  export const AcceptedSourceReferenceSchema = SourceReferenceSchema.extend({ title: z.string() });
304
300
  /** Full session record from `GET /api/session` and mutations returning `session`. */
305
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
+ });
306
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.'),
307
314
  activity_phase: SessionActivityPhaseSchema.optional(),
315
+ todo_state: TodoStateSchema.optional(),
308
316
  source_references: z.array(AcceptedSourceReferenceSchema).optional(),
309
317
  context_detail_key: z.string().nullable().optional().describe('Opaque identity for open-only context details; changes with owner epoch, model and context.'),
310
318
  composer_state_key: z.string().optional().describe('Opaque profile-home and owner identity for device-local composer state; never an API session id.'),
@@ -340,11 +348,14 @@ export const SessionSchema = z.looseObject({
340
348
  /** The agent's display name: a named profile's own name, else the `bot_name` setting (TAL-458). */
341
349
  assistant_name: z.string().optional(),
342
350
  workspace_name: WorkspaceNameSchema,
343
- compression_reference: CompressionReferenceSchema.nullable().optional(),
344
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.'),
345
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.'),
346
353
  });
347
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() });
348
359
  /** Sidebar row from `GET /api/sessions`. */
349
360
  export const SessionRowSchema = z.looseObject({
350
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(),
@@ -353,6 +364,7 @@ export const SessionRowSchema = z.looseObject({
353
364
  source_tag: NullableString.optional(), source_label: NullableString.optional(), session_source: NullableString.optional(), raw_source: NullableString.optional(), parent_session_id: NullableString.optional(),
354
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(),
355
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.'),
356
368
  ...ContextUsageFields,
357
369
  });
358
370
  /**
@@ -368,6 +380,7 @@ export const SessionsListSchema = z.looseObject({
368
380
  // TAL-482: sidebar counts for the "Scheduled sessions" / "Webhook sessions" groups; `_truncated` means more exist than are listed.
369
381
  scheduled_session_count: z.number().int().nonnegative(), scheduled_sessions_truncated: z.boolean(),
370
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.'),
371
384
  agent_storage: AgentStorageSchema.describe('Agent session storage health; a degraded state explains an empty or missing Agent session list.'),
372
385
  archived_limit: z.number().int().nullable().optional(), archived_offset: z.number().int().optional(),
373
386
  });
@@ -376,7 +389,7 @@ export const SessionStatusSchema = z.looseObject({
376
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(),
377
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(),
378
391
  });
379
- 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() });
380
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() });
381
394
  export const ProjectsSchema = z.looseObject({ projects: z.array(ProjectSchema), active_profile: z.string(), all_profiles: z.boolean(), other_profile_count: z.number().int() });
382
395
  export const SessionDeleteResultSchema = z.looseObject({ ok: z.literal(true), state_db_cleanup_failed: z.boolean().optional() });
@@ -547,13 +560,15 @@ export const QuotaThresholdsSchema = z.object({
547
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),
548
561
  });
549
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']);
550
565
  export const SettingsSchema = z.looseObject({
551
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(),
552
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(),
553
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(),
554
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(),
555
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(),
556
- 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(),
557
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(),
558
573
  dictation_append: z.boolean().optional(), persisted_speech_keys: z.array(z.string()).optional(),
559
574
  /** TAL-279: ask before opening external chat links; `trusted_link_hosts` are exact, server-normalized hostnames that skip the ask. */
@@ -583,6 +598,7 @@ export const QuotaLevelSchema = z.enum(['healthy', 'warning', 'critical', 'stale
583
598
  * TAL-807: `limit` is present while the provider's credential pool cannot serve this model until `resets_at` (ISO-8601 UTC).
584
599
  */
585
600
  export const ModelEntrySchema = z.looseObject({
601
+ allowance: ModelAllowanceSchema.optional(),
586
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(),
587
603
  limit: z.object({ scope: z.literal('model'), resets_at: z.string() }).optional(),
588
604
  });
@@ -598,6 +614,7 @@ export const ModelGroupLimitSchema = z.discriminatedUnion('scope', [
598
614
  */
599
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.') });
600
616
  export const ModelGroupSchema = z.looseObject({
617
+ plan_usage: PlanUsageSchema.nullable().optional(), plan_stale: z.boolean().optional(), sections: ModelSectionsSchema.optional(),
601
618
  availability: CatalogAvailabilitySchema.optional(),
602
619
  provider: z.string(), provider_id: z.string().optional(), models: z.array(ModelEntrySchema), extra_models: z.array(ModelEntrySchema).optional(),
603
620
  limit: ModelGroupLimitSchema.optional(), quota_level: QuotaLevelSchema.optional(),
@@ -615,6 +632,7 @@ export const KeySourceKindSchema = z.enum(['env', 'oauth', 'config', 'pool', 'pl
615
632
  export const ProviderSchema = z.looseObject({
616
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(),
617
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(),
618
636
  is_active: z.boolean().optional(), key_source_kind: KeySourceKindSchema.nullable().optional(), removable: z.boolean().optional(),
619
637
  });
620
638
  export const ProvidersSchema = z.looseObject({ availability: CatalogAvailabilitySchema.optional(), providers: z.array(ProviderSchema), active_provider: NullableString.optional() });
@@ -642,6 +660,7 @@ export const QuotaWindowSchema = z.looseObject({
642
660
  });
643
661
  const QuotaWindowIndex = z.number().int().nullable().optional();
644
662
  export const QuotaSourceSchema = z.looseObject({
663
+ plan_usage: PlanUsageSchema.nullable().optional(), plan_stale: z.boolean().optional(),
645
664
  computed_at: z.string().optional().describe('Original reference time of this source, retained with stale windows.'),
646
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(),
647
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(),
@@ -651,6 +670,7 @@ export const QuotaSourceSchema = z.looseObject({
651
670
  });
652
671
  /** An account-usage provider's normalised snapshot on `/api/provider/quota` (the same windows and indexes as a quotas source). */
653
672
  export const QuotaAccountLimitsSchema = z.looseObject({
673
+ plan_usage: PlanUsageSchema.nullable().optional(), plan_stale: z.boolean().optional(),
654
674
  available: z.boolean().optional(), stale: z.boolean().optional(), title: z.string().optional(), plan: Json.optional(), unavailable_reason: NullableString.optional(),
655
675
  windows: z.array(QuotaWindowSchema), details: Json.optional(), fetched_at: NullableString.describe('ISO-8601 UTC.'),
656
676
  pace_window_index: QuotaWindowIndex, session_window_index: QuotaWindowIndex, weekly_window_index: QuotaWindowIndex,
@@ -704,7 +724,7 @@ export const AuxiliaryTaskSchema = z.looseObject({
704
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. */
705
725
  reasoning_effort: z.string().nullable(),
706
726
  });
707
- 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) });
708
728
  export const MaxTokensSchema = z.looseObject({ max_tokens: NullableNumber, max_tokens_effective: NullableNumber, max_tokens_fallback: NullableNumber });
709
729
  // ── workspaces, files, git ───────────────────────────────────────────────
710
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). */
@@ -828,7 +848,7 @@ export const UpdateVersionSchema = z.object({
828
848
  }).describe('TAL-946: one installable Stable release newer than the installed one.');
829
849
  export const UpdateTargetSchema = z.looseObject({
830
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.'),
831
- name: z.string().optional(), channel: z.enum(['stable', 'experimental']).optional(),
851
+ name: z.string().optional(), channel: WebUpdateChannelSchema.optional(),
832
852
  unsupported: z.boolean().optional().describe('Deprecated (TAL-350): `support === \'unchecked\'`, kept for older clients.'),
833
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`.'),
834
854
  support_label: z.string().optional().describe('Agent target only (TAL-946): `support` worded to fit one phone line.'),
@@ -979,7 +999,11 @@ export const ConnectorViewSchema = z.object({
979
999
  * so no switch changes them. `sign_in_required` offers Nous sign-in without creating a guest on reads.
980
1000
  * `rules_error`: why the rules could not be read; every app then reads off (fails closed).
981
1001
  */
982
- 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() });
983
1007
  /**
984
1008
  * TAL-818: one app's tools: `enabled`: Hermes may use it (the member rules leave it on and nothing locks it); `locked`: an
985
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).
@@ -1016,8 +1040,6 @@ export const WikiStatusSchema = z.object({
1016
1040
  });
1017
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() })) });
1018
1042
  export const WikiPageSchema = z.object({ content: z.string(), path: z.string() });
1019
- 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() });
1020
- 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() });
1021
1043
  // ── onboarding ───────────────────────────────────────────────────────────
1022
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. */
1023
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() });
@@ -1036,6 +1058,7 @@ export const OnboardingProbeSchema = z.looseObject({ ok: z.boolean().optional(),
1036
1058
  * `user_code`, `verification_url`, `expires_in` and `interval` (seconds between polls) come with the start.
1037
1059
  */
1038
1060
  export const OnboardingOAuthSchema = z.looseObject({
1061
+ nous_account: NousAccountSchema.nullable().optional(),
1039
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(),
1040
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(),
1041
1064
  /**