@bike4mind/cli 4.10.0 → 5.0.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 (33) hide show
  1. package/dist/{AgentHistoryStore-CjGVgxLR.mjs → AgentHistoryStore-C3hJOgpM.mjs} +188 -90
  2. package/dist/{ApiClient-SVXSI3HI.mjs → ApiClient-CeuIcSY8.mjs} +3 -3
  3. package/dist/{BubblewrapRuntime-CTc_KPnd.mjs → BubblewrapRuntime-BF5wXaNS.mjs} +2 -2
  4. package/dist/ConfigStore--dPqdX3O.mjs +2 -0
  5. package/dist/{ConfigStore-B2Dy-PT9.mjs → ConfigStore-nr0ebq4v.mjs} +1 -1
  6. package/dist/{Logger-7MmrU5w6.mjs → Logger-CovZt7LL.mjs} +509 -103
  7. package/dist/{RemoteSkillSource-D_F99yBR.mjs → RemoteSkillSource-HqoLRV56.mjs} +2 -6
  8. package/dist/{SandboxOrchestrator-CeDwd6Fj.mjs → SandboxOrchestrator-DTz_5Zub.mjs} +1 -1
  9. package/dist/{SandboxRuntimeAdapter-CjNDzYSf.mjs → SandboxRuntimeAdapter-CC5KlbZ8.mjs} +2 -2
  10. package/dist/{SandboxRuntimeAdapter-CFEIywKt.mjs → SandboxRuntimeAdapter-X0HAkbpW.mjs} +1 -1
  11. package/dist/{SeatbeltRuntime-CQItj-F1.mjs → SeatbeltRuntime-zdxVqGZ3.mjs} +2 -2
  12. package/dist/{WorkItemsClient-C9_pjHCo.mjs → WorkItemsClient-lKJCPP0j.mjs} +1 -1
  13. package/dist/{buildToolSearch-8xyBwXRx.mjs → buildToolSearch-BlOSK4m3.mjs} +2 -2
  14. package/dist/commands/acpCommand.mjs +6 -6
  15. package/dist/commands/apiCommand.mjs +1 -1
  16. package/dist/commands/doctorCommand.mjs +2 -2
  17. package/dist/commands/envCommand.mjs +1 -1
  18. package/dist/commands/headlessCommand.mjs +7 -7
  19. package/dist/commands/mcpCommand.mjs +3 -3
  20. package/dist/commands/mirrorCommand.mjs +2 -2
  21. package/dist/commands/modelsCommand.mjs +4 -4
  22. package/dist/commands/pluginCommand.mjs +1 -1
  23. package/dist/commands/skillsCommand.mjs +4 -4
  24. package/dist/commands/updateCommand.mjs +2 -2
  25. package/dist/{dist-DHgMhdzV.mjs → dist-BrBjZ6Cv.mjs} +33 -3
  26. package/dist/{fit-D8Quui6j.mjs → fit-vnmP4Dfc.mjs} +3 -3
  27. package/dist/index.mjs +12 -417
  28. package/dist/{modelServers-JsKBm7Wn.mjs → modelServers-CjSlPFsg.mjs} +1 -1
  29. package/dist/{package-r_xumsGY.mjs → package-BTvxFRbB.mjs} +1 -1
  30. package/dist/{serve-BM9PKMLH.mjs → serve-BLBhPkyw.mjs} +6 -6
  31. package/dist/{updateChecker-BOqaLeZU.mjs → updateChecker-uDIZuEZg.mjs} +1 -1
  32. package/package.json +10 -11
  33. package/dist/ConfigStore-zlY0PikB.mjs +0 -2
@@ -29,7 +29,7 @@ const SIGNUP_RISK_REVIEW_STATES = [
29
29
  "banned"
30
30
  ];
31
31
  //#endregion
32
- //#region ../../b4m-core/common/dist/skillMdSource-CNWRf6Lw.mjs
32
+ //#region ../../b4m-core/common/dist/skillMdSource-Bt2JzY-l.mjs
33
33
  /**
34
34
  * The marker an exported SKILL.md carries so Bike4Mind can recognize its own exports. The B4M
35
35
  * CLI/desktop loader (packages/cli CustomCommandStore) skips stamped files, and a future CLI sync
@@ -65,7 +65,7 @@ function readSkillMdSourceUrl(frontmatter) {
65
65
  }
66
66
  /**
67
67
  * True when the file's frontmatter carries the source stamp. Reads the raw fence text because the
68
- * stamp is a YAML comment, which every YAML parser (gray-matter included) discards.
68
+ * stamp is a YAML comment, which every YAML parser discards.
69
69
  */
70
70
  function frontmatterHasSourceStamp(text) {
71
71
  const split = splitSkillMdFrontmatter(text);
@@ -246,7 +246,6 @@ const delegationPayloadSchema = z$1.looseObject({
246
246
  const INSTRUCTION_LIMIT_REACHED_ERROR_CODE = "instruction_limit_reached";
247
247
  const UNKNOWN_MODEL_ERROR_CODE = "unknown_model";
248
248
  const MODEL_REQUIRES_SUBSCRIPTION_ERROR_CODE = "model_requires_subscription";
249
- const FREE_QUEST_LIMIT_REACHED_ERROR_CODE = "free_quest_limit_reached";
250
249
  const BILLING_ORGANIZATION_MISMATCH_ERROR_CODE = "billing_organization_mismatch";
251
250
  const REQUEST_TIMEOUT_ERROR_CODE = "request_timeout";
252
251
  const OUTPUT_BUDGET_EXHAUSTED_ERROR_CODE = "output_budget_exhausted";
@@ -5107,9 +5106,9 @@ z$1.enum([
5107
5106
  "UseFormatPrompt",
5108
5107
  "EnableDeferredToolLoading",
5109
5108
  "DeferredToolStartSetMaxTokens",
5110
- "EnableQuestMaster",
5109
+ "evaluationUserIds",
5110
+ "evaluationModelIds",
5111
5111
  "QuestMasterLegacyShutdownDate",
5112
- "EnableQuestMasterDefault",
5113
5112
  "EnableHearth",
5114
5113
  "EnableHearthDefault",
5115
5114
  "EnableMementos",
@@ -7207,14 +7206,6 @@ const API_SERVICE_GROUPS = {
7207
7206
  key: "SimulatorComputeCreditsPerRound",
7208
7207
  order: 91.5
7209
7208
  },
7210
- {
7211
- key: "EnableQuestMaster",
7212
- order: 92
7213
- },
7214
- {
7215
- key: "EnableQuestMasterDefault",
7216
- order: 93
7217
- },
7218
7209
  {
7219
7210
  key: "QuestMasterLegacyShutdownDate",
7220
7211
  order: 93.5
@@ -8602,25 +8593,6 @@ const settingsMap = {
8602
8593
  group: API_SERVICE_GROUPS.EXPERIMENTAL.id,
8603
8594
  order: 89
8604
8595
  }),
8605
- EnableQuestMaster: makeBooleanSetting({
8606
- key: "EnableQuestMaster",
8607
- name: "Enable Quest Master",
8608
- defaultValue: true,
8609
- description: "Whether to enable the Quest Master feature.",
8610
- category: "Experimental",
8611
- group: API_SERVICE_GROUPS.EXPERIMENTAL.id,
8612
- order: 90
8613
- }),
8614
- EnableQuestMasterDefault: makeBooleanSetting({
8615
- key: "EnableQuestMasterDefault",
8616
- name: "Quest Master: On by default for users",
8617
- defaultValue: false,
8618
- description: "When enabled, Quest Master is active for users who have never explicitly toggled it.",
8619
- category: "Experimental",
8620
- group: API_SERVICE_GROUPS.EXPERIMENTAL.id,
8621
- order: 91,
8622
- dependsOn: "EnableQuestMaster"
8623
- }),
8624
8596
  QuestMasterLegacyShutdownDate: {
8625
8597
  ...makeStringSetting({
8626
8598
  key: "QuestMasterLegacyShutdownDate",
@@ -9105,6 +9077,22 @@ const settingsMap = {
9105
9077
  dependsOn: "EnableDeferredToolLoading",
9106
9078
  userReadable: true
9107
9079
  }),
9080
+ evaluationUserIds: makeStringSetting({
9081
+ key: "evaluationUserIds",
9082
+ name: "Controlled Evaluation: Allowed User IDs",
9083
+ defaultValue: "",
9084
+ description: "Comma-separated user IDs allowed to create evaluation completion runs and send evaluation requests (the Desktop controlled cost evaluation). Evaluation mode disables provider retries and fallback, bounds output and returns per-request provider usage receipts. Empty (default) refuses every evaluation request. Changes apply to the next request.",
9085
+ category: "AI",
9086
+ order: 16
9087
+ }),
9088
+ evaluationModelIds: makeStringSetting({
9089
+ key: "evaluationModelIds",
9090
+ name: "Controlled Evaluation: Allowed Model IDs",
9091
+ defaultValue: "",
9092
+ description: "Comma-separated exact catalog model IDs an evaluation request may dispatch to. Aliases are not matched, so confirm each ID resolves to the intended provider model before adding it. Empty (default) refuses every evaluation dispatch. Changes apply to the next request.",
9093
+ category: "AI",
9094
+ order: 17
9095
+ }),
9108
9096
  UseFormatPrompt: makeBooleanSetting({
9109
9097
  key: "UseFormatPrompt",
9110
9098
  name: "Use Format Prompt",
@@ -14280,14 +14268,6 @@ const SUBQUEST_STATUS_VALUES = [
14280
14268
  "deleted"
14281
14269
  ];
14282
14270
  /**
14283
- * Status of a review gate on a sub-quest
14284
- */
14285
- const REVIEW_GATE_STATUS_VALUES = [
14286
- "pending",
14287
- "approved",
14288
- "rejected"
14289
- ];
14290
- /**
14291
14271
  * Valid complexity ratings for quests.
14292
14272
  * Canonical vocabulary - matches what the planner generates and validates
14293
14273
  * (Easy < 1 hour, Medium 1-4 hours, Hard > 4 hours).
@@ -14631,6 +14611,26 @@ const CREDIT_DEDUCT_TRANSACTION_TYPES = [
14631
14611
  const NON_AI_DEDUCT_TRANSACTION_TYPES = ["transfer_credit", "generic_deduct"];
14632
14612
  CREDIT_DEDUCT_TRANSACTION_TYPES.filter((t) => !NON_AI_DEDUCT_TRANSACTION_TYPES.includes(t));
14633
14613
  CREDIT_DEDUCT_TRANSACTION_TYPES.filter((t) => t !== "transfer_credit");
14614
+ const identity = z$1.string().min(1).max(128);
14615
+ const PlatformAttribution = z$1.object({
14616
+ kind: z$1.literal("platform_operation"),
14617
+ operation: z$1.literal("sre_diagnosis"),
14618
+ environment: z$1.enum([
14619
+ "production",
14620
+ "staging",
14621
+ "development",
14622
+ "test"
14623
+ ]),
14624
+ logicalJobId: identity,
14625
+ executionId: identity
14626
+ }).strict();
14627
+ z$1.object({
14628
+ providerCallId: identity,
14629
+ attribution: PlatformAttribution,
14630
+ provider: z$1.string().min(1).max(128),
14631
+ model: z$1.string().min(1).max(256),
14632
+ leaseExpiresAt: z$1.date()
14633
+ }).strict();
14634
14634
  /** Who made a run-attributed request: the session that started the run, or a worker it spawned. */
14635
14635
  const COMPLETION_RUN_ROLES = ["root", "worker"];
14636
14636
  /**
@@ -14730,6 +14730,7 @@ const USAGE_EVENT_OPERATIONS = [
14730
14730
  "memento",
14731
14731
  "assistant_brief",
14732
14732
  "delegated_item",
14733
+ "document_obligation",
14733
14734
  "org_feedback_summary"
14734
14735
  ];
14735
14736
  /**
@@ -14772,7 +14773,17 @@ const UsageEventRun = z$1.object({
14772
14773
  parentSessionId: z$1.string().optional(),
14773
14774
  sessionId: z$1.string().max(128).optional()
14774
14775
  });
14775
- z$1.object({
14776
+ /**
14777
+ * One row per provider API call. Ties true COGS (costUsd, frozen
14778
+ * at write time) to what the user was debited (creditsCharged) so margin per
14779
+ * model/user is queryable. Dual-written at settlement time; never part of the
14780
+ * billing path itself.
14781
+ */
14782
+ const AttributedUsageEvent = z$1.object({
14783
+ attribution: z$1.undefined().optional(),
14784
+ providerCallId: z$1.undefined().optional(),
14785
+ usageOccurredAt: z$1.undefined().optional(),
14786
+ recordedAt: z$1.undefined().optional(),
14776
14787
  id: z$1.string().optional(),
14777
14788
  /** App-level correlation id: questId for chat/image/video, session/run id otherwise. */
14778
14789
  requestId: z$1.string(),
@@ -14874,6 +14885,79 @@ z$1.object({
14874
14885
  createdAt: z$1.date(),
14875
14886
  updatedAt: z$1.date()
14876
14887
  });
14888
+ const PlatformUsageEvent = AttributedUsageEvent.omit({
14889
+ attribution: true,
14890
+ providerCallId: true,
14891
+ usageOccurredAt: true,
14892
+ recordedAt: true
14893
+ }).extend({
14894
+ attribution: PlatformAttribution,
14895
+ providerCallId: z$1.string().min(1).max(128),
14896
+ usageOccurredAt: z$1.date(),
14897
+ recordedAt: z$1.date(),
14898
+ timestampSource: z$1.enum(["provider", "dispatch"]),
14899
+ dispatchedAt: z$1.date(),
14900
+ completedAt: z$1.date(),
14901
+ providerRequestId: z$1.string().max(256).optional(),
14902
+ userId: z$1.never().optional(),
14903
+ ownerId: z$1.never().optional(),
14904
+ ownerType: z$1.never().optional(),
14905
+ sessionId: z$1.never().optional(),
14906
+ projectId: z$1.never().optional(),
14907
+ dataLakeId: z$1.never().optional(),
14908
+ apiKeyId: z$1.never().optional(),
14909
+ fundingBreakdown: z$1.never().optional(),
14910
+ writtenOffCredits: z$1.never().optional(),
14911
+ reservedCredits: z$1.never().optional(),
14912
+ units: z$1.never().optional(),
14913
+ turnUsage: z$1.never().optional(),
14914
+ turnUsageTruncated: z$1.never().optional(),
14915
+ requestMeta: z$1.never().optional(),
14916
+ run: z$1.never().optional(),
14917
+ latencyMs: z$1.number().finite().nonnegative().optional(),
14918
+ feature: z$1.literal("operations"),
14919
+ source: z$1.literal("system"),
14920
+ keySource: z$1.literal("platform"),
14921
+ creditsCharged: z$1.literal(0),
14922
+ costUsd: z$1.number().finite().nonnegative(),
14923
+ provider: z$1.string().min(1).max(128),
14924
+ model: z$1.string().min(1).max(256),
14925
+ providerInputTokens: z$1.number().int().nonnegative(),
14926
+ providerOutputTokens: z$1.number().int().nonnegative(),
14927
+ inputTokens: z$1.literal(0).default(0),
14928
+ outputTokens: z$1.literal(0).default(0),
14929
+ cachedInputTokens: z$1.number().int().nonnegative(),
14930
+ cacheWriteTokens: z$1.number().int().nonnegative(),
14931
+ cacheWrite1hTokens: z$1.number().int().nonnegative().optional(),
14932
+ settledBasis: z$1.literal("provider"),
14933
+ priceSource: z$1.enum(USAGE_PRICE_SOURCES),
14934
+ executedProvider: z$1.never().optional(),
14935
+ executedModel: z$1.never().optional(),
14936
+ rates: UsageEventRates.extend({
14937
+ tierKey: z$1.number().finite().nonnegative(),
14938
+ input: z$1.number().finite().nonnegative(),
14939
+ output: z$1.number().finite().nonnegative(),
14940
+ cacheRead: z$1.number().finite().nonnegative().optional(),
14941
+ cacheWrite: z$1.number().finite().nonnegative().optional(),
14942
+ cacheWrite1h: z$1.number().finite().nonnegative().optional()
14943
+ })
14944
+ }).strict().superRefine((event, ctx) => {
14945
+ const oneHour = event.cacheWrite1hTokens ?? 0;
14946
+ if (oneHour > event.cacheWriteTokens || event.cachedInputTokens > 0 && event.rates.cacheRead === void 0 || event.cacheWriteTokens > oneHour && event.rates.cacheWrite === void 0 || oneHour > 0 && event.rates.cacheWrite1h === void 0 || event.priceSource === "catalog" && !event.priceRowId) ctx.addIssue({
14947
+ code: "custom",
14948
+ message: "Incomplete platform pricing provenance"
14949
+ });
14950
+ const expected = event.providerInputTokens * event.rates.input + event.providerOutputTokens * event.rates.output + event.cachedInputTokens * (event.rates.cacheRead ?? 0) + (event.cacheWriteTokens - oneHour) * (event.rates.cacheWrite ?? 0) + oneHour * (event.rates.cacheWrite1h ?? 0);
14951
+ if (Math.abs(expected - event.costUsd) > Math.max(1e-12, Math.abs(expected) * 1e-9)) ctx.addIssue({
14952
+ code: "custom",
14953
+ message: "Platform cost does not match measured usage and rates"
14954
+ });
14955
+ if (event.requestId !== event.attribution.executionId || event.usageOccurredAt > event.completedAt || event.timestampSource === "dispatch" && event.usageOccurredAt.getTime() !== event.dispatchedAt.getTime() || event.completedAt < event.dispatchedAt || event.recordedAt < event.completedAt) ctx.addIssue({
14956
+ code: "custom",
14957
+ message: "Invalid platform accounting timestamps"
14958
+ });
14959
+ });
14960
+ z$1.union([PlatformUsageEvent, AttributedUsageEvent]);
14877
14961
  z$1.object({
14878
14962
  version: z$1.literal(1),
14879
14963
  generatedAt: z$1.string().datetime(),
@@ -18696,7 +18780,7 @@ const SimplifiedChatRequestSchema = z$1.object({
18696
18780
  enableTools: z$1.boolean().prefault(false),
18697
18781
  toolMode: ChatToolModeSchema.optional(),
18698
18782
  tools: z$1.array(z$1.string()).optional().describe("Explicit tool ids to offer the model. A non-empty array enables tools on its own; no companion `toolMode` or `enableTools` is required. Merged with the auto-selected set under `toolMode: \"smart\"`, and ignored under `toolMode: \"fast\"`. This list ADDS to what is offered rather than restricting it - the server still offers tools of its own (for example knowledge retrieval when the session has reachable documents). Unrecognized ids are dropped rather than rejecting the request; the response reports the surviving set as `tools.effectiveTools` and the ids that are not tools in this deployment as `tools.unrecognizedTools`, since no endpoint enumerates the valid ids. `unrecognizedTools` is reported under every `toolMode` - it describes the ids, not what the mode did with them - so under `toolMode: \"fast\"` an id can be absent from `effectiveTools` (the mode discarded it) without being unrecognized. Both reported lists are deduplicated, and `unrecognizedTools` names at most the first 10 distinct ids."),
18699
- enableQuestMaster: z$1.boolean().optional(),
18783
+ enableQuestMaster: z$1.boolean().optional().describe("Deprecated and ignored. The in-chat QuestMaster plan this used to start has been retired."),
18700
18784
  enableMementos: z$1.boolean().optional(),
18701
18785
  enableAgents: z$1.boolean().optional(),
18702
18786
  promptMode: z$1.enum([
@@ -18981,7 +19065,6 @@ const ModelPolicyForbiddenErrorSchema = MeteredForbiddenErrorSchema.extend({ err
18981
19065
  const ChatForbiddenErrorSchema = MeteredForbiddenErrorSchema.extend({ errorCode: z$1.enum([
18982
19066
  ACCOUNT_SUSPENDED_ERROR_CODE,
18983
19067
  MODEL_REQUIRES_SUBSCRIPTION_ERROR_CODE,
18984
- FREE_QUEST_LIMIT_REACHED_ERROR_CODE,
18985
19068
  ORG_MODEL_NOT_ALLOWED_ERROR_CODE,
18986
19069
  ORG_TOOL_NOT_ALLOWED_ERROR_CODE,
18987
19070
  SPEND_FROZEN_ERROR_CODE
@@ -19549,11 +19632,6 @@ const DashboardParamsSchema = z$1.object({
19549
19632
  })),
19550
19633
  promptName: z$1.string().optional()
19551
19634
  });
19552
- const QuestMasterParamsSchema = z$1.object({
19553
- questMasterPlanId: z$1.string(),
19554
- questId: z$1.string(),
19555
- subQuestId: z$1.string()
19556
- });
19557
19635
  const ResearchModeConfigurationSchema = z$1.object({
19558
19636
  id: z$1.string(),
19559
19637
  enabled: z$1.boolean(),
@@ -19787,8 +19865,6 @@ z$1.object({
19787
19865
  dashboardParams: DashboardParamsSchema.optional(),
19788
19866
  /** LLM params */
19789
19867
  params: ChatCompletionCreateInputSchema,
19790
- /** Whether Quest Master is enabled */
19791
- enableQuestMaster: z$1.boolean().optional(),
19792
19868
  /**
19793
19869
  * How much of the system stack to put in front of the model, for callers that need a completion
19794
19870
  * they can compare against the bare provider model. Unset keeps the full stack - what every
@@ -19883,8 +19959,6 @@ z$1.object({
19883
19959
  organizationId: z$1.string().nullable().optional(),
19884
19960
  /** Tool prompt ID to use for the LLM */
19885
19961
  toolPromptId: z$1.string().optional(),
19886
- /** Quest Master related params */
19887
- questMaster: QuestMasterParamsSchema.optional(),
19888
19962
  /** Research Mode related params */
19889
19963
  researchMode: ResearchModeParamsSchema.optional(),
19890
19964
  /** Fallback model ID to try if primary model fails */
@@ -20793,6 +20867,10 @@ const SELF_VIEW_PASSTHROUGH_FIELDS = {
20793
20867
  deletion: true,
20794
20868
  nextBriefAt: true,
20795
20869
  lastBriefStartedAt: true,
20870
+ busyBlocks: true,
20871
+ busyBlocksSyncedAt: true,
20872
+ nextBlockBriefAt: true,
20873
+ lastBlockBriefEnd: true,
20796
20874
  suspensionReasonCategory: true
20797
20875
  };
20798
20876
  /** A redacted integration object: only the named non-secret subfields survive. */
@@ -25694,32 +25772,6 @@ z$2.object({
25694
25772
  totalCount: z$2.number()
25695
25773
  })
25696
25774
  });
25697
- const questMasterPlanResponseSchema = z$2.object(passthroughShape({
25698
- id: true,
25699
- createdAt: true,
25700
- updatedAt: true,
25701
- notebookId: true,
25702
- goal: true,
25703
- quests: true,
25704
- userId: true,
25705
- visibility: true,
25706
- state: true,
25707
- lastAccessedAt: true,
25708
- sessionHistory: true,
25709
- metrics: true,
25710
- tags: true,
25711
- priority: true,
25712
- parentPlanId: true,
25713
- sharedWith: true,
25714
- handoff: true,
25715
- blockers: true,
25716
- decisions: true
25717
- }));
25718
- z$2.array(questMasterPlanResponseSchema);
25719
- z$2.object({
25720
- success: z$2.literal(true),
25721
- plan: questMasterPlanResponseSchema
25722
- }).extend({ metrics: passthroughField });
25723
25775
  const userShareResponseSchema = z$2.object(passthroughShape({
25724
25776
  userId: true,
25725
25777
  permissions: true,
@@ -26452,7 +26504,7 @@ const ClientConfigFeaturesSchema = z$1.object({
26452
26504
  mcp_server: z$1.boolean(),
26453
26505
  custom_mcp_connectors: z$1.boolean(),
26454
26506
  mementos: z$1.boolean(),
26455
- quest_master: z$1.boolean(),
26507
+ quest_master: z$1.boolean().describe("Deprecated: the in-chat QuestMaster plan feature was removed. Always false."),
26456
26508
  rapid_reply: z$1.boolean(),
26457
26509
  research_engine: z$1.boolean(),
26458
26510
  team_plan: z$1.boolean(),
@@ -26629,13 +26681,20 @@ const BRIEF_LIMITS = {
26629
26681
  draftSubject: 200,
26630
26682
  draftBody: 4e3
26631
26683
  };
26632
- const BriefSourceRefSchema = z$1.discriminatedUnion("kind", [z$1.object({
26633
- kind: z$1.literal("email"),
26634
- emailId: z$1.string().min(1).describe("The ingested email the item was triaged from.")
26635
- }), z$1.object({
26636
- kind: z$1.literal("delegation"),
26637
- delegationId: z$1.string().min(1).describe("The item you delegated; read it with `GET /api/v1/delegations/{id}`.")
26638
- })]);
26684
+ const BriefSourceRefSchema = z$1.discriminatedUnion("kind", [
26685
+ z$1.object({
26686
+ kind: z$1.literal("email"),
26687
+ emailId: z$1.string().min(1).describe("The ingested email the item was triaged from.")
26688
+ }),
26689
+ z$1.object({
26690
+ kind: z$1.literal("delegation"),
26691
+ delegationId: z$1.string().min(1).describe("The item you delegated; read it with `GET /api/v1/delegations/{id}`.")
26692
+ }),
26693
+ z$1.object({
26694
+ kind: z$1.literal("obligation"),
26695
+ obligationId: z$1.string().min(1).describe("A confirmed obligation; read it with `GET /api/v1/obligations/{id}`.")
26696
+ })
26697
+ ]);
26639
26698
  const BriefItemSchema = z$1.object({
26640
26699
  id: z$1.string().min(1).describe("Stable within the brief."),
26641
26700
  text: z$1.string().min(1).max(BRIEF_LIMITS.itemText),
@@ -26715,12 +26774,92 @@ const BriefScheduleResponseSchema = z$1.object({
26715
26774
  schedule: BriefScheduleSchema.nullable().describe("Null until a schedule has been saved."),
26716
26775
  nextBriefAt: z$1.string().nullable().describe("ISO 8601 instant of the next scheduled brief; null when the schedule is off or unset.")
26717
26776
  });
26777
+ /** Bounds on a synced busy-block list. `retryWindowMs` is also the reconciler's retry window (apps/workers/src/cron/briefScheduleReconcile.ts). */
26778
+ const BUSY_BLOCK_LIMITS = {
26779
+ maxBlocks: 48,
26780
+ maxDurationMs: 432e5,
26781
+ horizonMs: 2592e5,
26782
+ retryWindowMs: 36e5,
26783
+ /** Pushes are held only while the last sync is at most this old, so a client that stopped syncing cannot mute them. */
26784
+ syncFreshMs: 864e5
26785
+ };
26786
+ const BusyBlockSchema = z$1.object({
26787
+ start: z$1.iso.datetime({ offset: true }).describe("ISO 8601 instant the busy interval starts."),
26788
+ end: z$1.iso.datetime({ offset: true }).describe("ISO 8601 instant the busy interval ends; after `start`.")
26789
+ }).refine((block) => Date.parse(block.end) > Date.parse(block.start), "end must be after start").refine((block) => Date.parse(block.end) - Date.parse(block.start) <= BUSY_BLOCK_LIMITS.maxDurationMs, "A busy block can be at most 12 hours");
26790
+ const PutBusyBlocksSchema = z$1.object({
26791
+ enabled: z$1.boolean().describe("Whether a brief is composed when a busy block ends. Disabling clears the stored blocks."),
26792
+ blocks: z$1.array(BusyBlockSchema).max(BUSY_BLOCK_LIMITS.maxBlocks).describe("Busy intervals from the device calendar, times only; replaces the stored list. Empty is valid.")
26793
+ });
26794
+ const BusyBlocksResponseSchema = z$1.object({
26795
+ enabled: z$1.boolean(),
26796
+ blocks: z$1.array(BusyBlockSchema).describe("Stored blocks after merging overlaps and dropping ones already briefed."),
26797
+ nextBlockBriefAt: z$1.string().nullable().describe("ISO 8601 instant the next block ends and its brief is due; null when off or none is pending.")
26798
+ });
26718
26799
  const PendingDecisionCountSchema = z$1.object({
26719
26800
  count: z$1.number().int().nonnegative().describe("Decisions waiting on you: `approvals` plus `briefDecisions`. Nothing is counted twice."),
26720
26801
  approvals: z$1.number().int().nonnegative().describe("Agent approvals still open in your notebooks: raised within the last 15 minutes and not yet answered."),
26721
- briefDecisions: z$1.number().int().nonnegative().describe("Decisions in your latest ready brief that are not agent approvals. An approval decision in the brief is counted under `approvals` while it is open, and not at all once it was answered or lapsed."),
26722
- briefId: z$1.string().nullable().describe("The latest ready brief `briefDecisions` comes from; null when there is none.")
26802
+ briefDecisions: z$1.number().int().nonnegative().describe("Unanswered decisions that are not agent approvals, in your latest regular ready brief and the busy-block briefs readied since it. An approval decision in a brief is counted under `approvals` while it is open, and not at all once it was answered or lapsed."),
26803
+ briefId: z$1.string().nullable().describe("The latest ready brief, the one a client shows by default; null when there is none.")
26804
+ });
26805
+ const ObligationStatusSchema = z$1.enum([
26806
+ "pending",
26807
+ "confirmed",
26808
+ "dismissed"
26809
+ ]);
26810
+ const ObligationDocumentKindSchema = z$1.enum([
26811
+ "invoice",
26812
+ "receipt",
26813
+ "letter",
26814
+ "other"
26815
+ ]);
26816
+ /** Bounds shared by the route, the stored record and the extractor. */
26817
+ const OBLIGATION_LIMITS = {
26818
+ payee: 200,
26819
+ summary: 400,
26820
+ text: 2e4
26821
+ };
26822
+ const ObligationDueDateSchema = z$1.string().refine(isCalendarDate, "due_date must be a real calendar date as YYYY-MM-DD").describe("Calendar date the payment is due, `YYYY-MM-DD`, with no time zone.");
26823
+ const ObligationAmountSchema = z$1.object({
26824
+ value: z$1.number().finite().nonnegative().describe("Amount in major units, e.g. 120.5 for $120.50."),
26825
+ currency: z$1.string().regex(/^[A-Z]{3}$/, "currency must be an ISO 4217 code such as USD").describe("ISO 4217 currency code.")
26723
26826
  });
26827
+ const ObligationDestinationSchema = z$1.object({
26828
+ lake_id: z$1.string().min(1),
26829
+ name: z$1.string()
26830
+ });
26831
+ const ObligationSchema = z$1.object({
26832
+ id: z$1.string().min(1),
26833
+ status: ObligationStatusSchema.describe("`pending` until you confirm or dismiss it; `confirmed` once you accepted the fields; `dismissed` if you discarded it."),
26834
+ document_kind: ObligationDocumentKindSchema,
26835
+ file_id: z$1.string().min(1).describe("The uploaded scan."),
26836
+ amount: ObligationAmountSchema.nullable(),
26837
+ payee: z$1.string().max(OBLIGATION_LIMITS.payee).nullable(),
26838
+ due_date: ObligationDueDateSchema.nullable(),
26839
+ destination: ObligationDestinationSchema.nullable().describe("The data lake the document is filed in on confirm. Suggested by the assistant from your own lakes."),
26840
+ summary: z$1.string().max(OBLIGATION_LIMITS.summary).describe("Model-written from the document, so treat it as untrusted text."),
26841
+ created_at: z$1.string(),
26842
+ confirmed_at: z$1.string().nullable()
26843
+ });
26844
+ const ObligationHandoffRequestSchema = z$1.object({
26845
+ file_id: z$1.string().min(1).describe("A file you uploaded with `POST /api/v1/files`. It must be yours."),
26846
+ text: z$1.string().max(OBLIGATION_LIMITS.text).optional().describe("Text recognized on the device. When absent or blank, the file's indexed text is read instead.")
26847
+ });
26848
+ /** Every field is optional; the route rejects a body that sets none of them. */
26849
+ const ObligationUpdateRequestSchema = z$1.object({
26850
+ amount: ObligationAmountSchema.nullable().optional(),
26851
+ payee: z$1.string().min(1).max(OBLIGATION_LIMITS.payee).nullable().optional(),
26852
+ due_date: ObligationDueDateSchema.nullable().optional(),
26853
+ destination_lake_id: z$1.string().min(1).nullable().optional().describe("A data lake you can manage, or null to file nowhere."),
26854
+ status: z$1.enum(["confirmed", "dismissed"]).optional()
26855
+ });
26856
+ const ObligationIdParamSchema = z$1.object({ id: z$1.string().min(1).describe("The obligation id returned by `POST /api/v1/obligations`.") });
26857
+ const ListObligationsQuerySchema = z$1.object({
26858
+ status: ObligationStatusSchema.optional().describe("Only obligations in this status."),
26859
+ limit: z$1.coerce.number().int().min(1).max(50).default(25),
26860
+ cursor: z$1.string().min(1).optional()
26861
+ });
26862
+ const ListObligationsResponseSchema = paginatedResponseSchema(ObligationSchema);
26724
26863
  /**
26725
26864
  * Wire schemas for standing assistant instructions (`/api/v1/assistant/instructions`): short notes a
26726
26865
  * user keeps about what their briefs should highlight and how to word them. The brief composer
@@ -26816,7 +26955,12 @@ z$1.object({
26816
26955
  * `brief_ready` only, set when the brief holds exactly one decision: its kind, so the push selects a
26817
26956
  * notification category with approve/deny or reply actions. The client re-fetches the brief before acting.
26818
26957
  */
26819
- briefAction: z$1.enum(["approval", "question"]).optional()
26958
+ briefAction: z$1.enum(["approval", "question"]).optional(),
26959
+ /**
26960
+ * `agent_completed` only: the one summary sent for runs finished during a busy block whose block brief did
26961
+ * not land (notifyHeldBlockRuns in packages/server-utils/src/briefs). Never held itself.
26962
+ */
26963
+ busyBlockDigest: z$1.literal(true).optional()
26820
26964
  });
26821
26965
  z$1.object({
26822
26966
  agent_completed: z$1.boolean().optional(),
@@ -29909,7 +30053,7 @@ defineEndpoint({
29909
30053
  path: "/api/chat",
29910
30054
  operationId: "sendChatMessage",
29911
30055
  summary: "Send a chat message",
29912
- description: "Sends a message to the AI and creates a quest to process it. By default (async) the call returns immediately with a quest id; poll `GET /api/v1/quests/{id}` for the reply. Send `wait: true` to block until the reply is ready and receive it inline. A `wait: true` turn is bounded at about 45 seconds: one that runs longer is ended (unused credits refunded) and answered with a 504 naming the quest in `quest_id`; one whose reasoning model spends its whole output budget thinking is answered with a 422 or 502 (see those responses). Send long or tool-heavy turns (large attachments, tool calls) in the default async mode and poll instead. A tool that produced machine-readable state reports it under `toolPayloads` - an array of `{ type, payload }` entries in emission order, alongside (never instead of) the prose reply - on the `wait: true` body and on the polled quest. A turn can FAIL after the ACK - reported on the polled quest as `type: \"error\"`, since the ACK was already sent. A terminal `status: \"stopped\"` (a missing session, a user-cancelled turn) is ALSO a failure even without `type: \"error\"` - it carries an explanatory string in `reply`/`replies` rather than an answer. `type` is the failure signal for the classified failure classes (an abort, a provider timeout, credit exhaustion); `errorCode` is an optional refinement present only when the failure has a classified reason. A recovered stuck quest is NOT in that list: one that still has renderable content resolves as a success by design. `QUEST_ERROR_CODES` has five members: `insufficient_credits`, `spend_cap_exceeded`, `spend_frozen`, `free_quest_limit_reached`, and `run_budget_exhausted`. `insufficient_credits` and `spend_frozen` are raised as quest errorCodes on this endpoint: a spending pause in force when the request arrives is refused synchronously with a 403, and one that lands after the ACK reaches the quest. A new exhausted QuestMaster start is refused synchronously with 403 before a quest exists; an older queued start can instead settle as an error quest with `free_quest_limit_reached`. `spend_cap_exceeded` is thrown only by the embed chat route's pre-flight, which fires outside the process try/catch that would classify it onto a quest, and `run_budget_exhausted` only by image generation. A turn that prompt moderation refuses settles as `type: \"error\"` with `errorCode: \"content_blocked\"` and the refusal text in `reply`, on the 200 `wait: true` body and on the polled quest alike; do not resend it unchanged. A caller must treat `type: \"error\"` OR a terminal `status: \"stopped\"` as failure even when `errorCode` is absent, and must not read `reply` as an answer without checking those first. Organization-policy preflight refusals use 403 with `errorCode: \"org_model_not_allowed\"` or `\"org_tool_not_allowed\"`. An explicit-model JWT request can instead be accepted and refused during quest execution: that refusal appears on the 200 `wait: true` body or polled quest as `type: \"error\"`, without a policy `errorCode`. Check the quest outcome as described above. Authenticate with an API key (`b4m_live_`) or a JWT. Session resolution: pass `sessionId` to continue an existing notebook. An API-key caller that omits it gets a BRAND-NEW notebook rather than the notebook the human last had open, and `newConversation: true` forces a new notebook for any auth mode; both return the new id as `sessionId`, so the caller can continue the conversation by passing it back. A first-party JWT caller that omits `sessionId` keeps the last-opened-notebook fallback. Sending `sessionId` and `newConversation` together is a 422.",
30056
+ description: "Sends a message to the AI and creates a quest to process it. By default (async) the call returns immediately with a quest id; poll `GET /api/v1/quests/{id}` for the reply. Send `wait: true` to block until the reply is ready and receive it inline. A `wait: true` turn is bounded at about 45 seconds: one that runs longer is ended (unused credits refunded) and answered with a 504 naming the quest in `quest_id`; one whose reasoning model spends its whole output budget thinking is answered with a 422 or 502 (see those responses). Send long or tool-heavy turns (large attachments, tool calls) in the default async mode and poll instead. A tool that produced machine-readable state reports it under `toolPayloads` - an array of `{ type, payload }` entries in emission order, alongside (never instead of) the prose reply - on the `wait: true` body and on the polled quest. A turn can FAIL after the ACK - reported on the polled quest as `type: \"error\"`, since the ACK was already sent. A terminal `status: \"stopped\"` (a missing session, a user-cancelled turn) is ALSO a failure even without `type: \"error\"` - it carries an explanatory string in `reply`/`replies` rather than an answer. `type` is the failure signal for the classified failure classes (an abort, a provider timeout, credit exhaustion); `errorCode` is an optional refinement present only when the failure has a classified reason. A recovered stuck quest is NOT in that list: one that still has renderable content resolves as a success by design. `QUEST_ERROR_CODES` has five members: `insufficient_credits`, `spend_cap_exceeded`, `spend_frozen`, `free_quest_limit_reached`, and `run_budget_exhausted`. `insufficient_credits` and `spend_frozen` are raised as quest errorCodes on this endpoint: a spending pause in force when the request arrives is refused synchronously with a 403, and one that lands after the ACK reaches the quest. `free_quest_limit_reached` is no longer raised: it survives only on quests that settled with it before the in-chat QuestMaster plan was retired. `spend_cap_exceeded` is thrown only by the embed chat route's pre-flight, which fires outside the process try/catch that would classify it onto a quest, and `run_budget_exhausted` only by image generation. A turn that prompt moderation refuses settles as `type: \"error\"` with `errorCode: \"content_blocked\"` and the refusal text in `reply`, on the 200 `wait: true` body and on the polled quest alike; do not resend it unchanged. A caller must treat `type: \"error\"` OR a terminal `status: \"stopped\"` as failure even when `errorCode` is absent, and must not read `reply` as an answer without checking those first. Organization-policy preflight refusals use 403 with `errorCode: \"org_model_not_allowed\"` or `\"org_tool_not_allowed\"`. An explicit-model JWT request can instead be accepted and refused during quest execution: that refusal appears on the 200 `wait: true` body or polled quest as `type: \"error\"`, without a policy `errorCode`. Check the quest outcome as described above. Authenticate with an API key (`b4m_live_`) or a JWT. Session resolution: pass `sessionId` to continue an existing notebook. An API-key caller that omits it gets a BRAND-NEW notebook rather than the notebook the human last had open, and `newConversation: true` forces a new notebook for any auth mode; both return the new id as `sessionId`, so the caller can continue the conversation by passing it back. A first-party JWT caller that omits `sessionId` keeps the last-opened-notebook fallback. Sending `sessionId` and `newConversation` together is a 422.",
29913
30057
  tags: ["AI"],
29914
30058
  auth: "apiKeyOrJwt",
29915
30059
  scopes: ["ai:chat", "ai:generate"],
@@ -29921,11 +30065,11 @@ defineEndpoint({
29921
30065
  emitsRateLimitHeaders: true,
29922
30066
  responses: {
29923
30067
  200: {
29924
- description: "Message accepted - NOT a completed turn. The default (async) path returns this queued ACK; the outcome arrives on `GET /api/v1/quests/{id}` (see the `sendChatMessage200PollResult` schema). With `wait: true` the body is instead the completed turn: the ACK fields plus the reply (`response`/`responses`), `toolPayloads`, `createdAt`, `performance` timings and, when requested, `promptDetails`/`promptText`. A turn that FAILS still resolves with `200`, never a 4xx, on both that `wait: true` body and the polled quest (`GET /api/v1/quests/{id}`) - the prose explaining why lands in `reply`/`response` like any other answer, so the reply text alone cannot tell a failure from an answer. `type` is the field that can: both surfaces carry it unconditionally, so match on `type: \"error\"` first - it covers credit exhaustion, a provider timeout or overload, and an in-process aborted turn; a real answer carries the turn's actual completion type instead (`\"message\"` for an ordinary reply). Two related states do NOT set `type: \"error\"`: a user-cancelled turn resolves as `status: \"stopped\"` with `type` left at `\"message\"`, and a recovered stuck quest that still has renderable content resolves as a success (`status: \"done\"`, no error) by design, to avoid destroying content to report a failure. The one exception is output-budget exhaustion: a `wait: true` request answers it with the 422 or 502 error envelope (plus `quest_id`) instead of this body. `errorCode` names a classified failure: `insufficient_credits`, `spend_frozen` (a spending pause that landed after the ACK), or `free_quest_limit_reached` when an older queued QuestMaster start is refused during processing. A new exhausted start is refused synchronously with 403 before a quest exists. Other `type: \"error\"` turns may have no classifier, so never use its absence to infer success. On a real answer `errorCode` is absent from the `wait: true` body. The body also carries `sessionId`, the notebook the turn was recorded in - for an API-key caller that sent none (or any caller sending `newConversation: true`), that is the freshly created notebook's id; pass it back as the request's `sessionId` to continue. Contrast the tts/music/soundEffects contracts, which reject synchronously with a 422 carrying the same `errorCode` vocabulary.",
30068
+ description: "Message accepted - NOT a completed turn. The default (async) path returns this queued ACK; the outcome arrives on `GET /api/v1/quests/{id}` (see the `sendChatMessage200PollResult` schema). With `wait: true` the body is instead the completed turn: the ACK fields plus the reply (`response`/`responses`), `toolPayloads`, `createdAt`, `performance` timings and, when requested, `promptDetails`/`promptText`. A turn that FAILS still resolves with `200`, never a 4xx, on both that `wait: true` body and the polled quest (`GET /api/v1/quests/{id}`) - the prose explaining why lands in `reply`/`response` like any other answer, so the reply text alone cannot tell a failure from an answer. `type` is the field that can: both surfaces carry it unconditionally, so match on `type: \"error\"` first - it covers credit exhaustion, a provider timeout or overload, and an in-process aborted turn; a real answer carries the turn's actual completion type instead (`\"message\"` for an ordinary reply). Two related states do NOT set `type: \"error\"`: a user-cancelled turn resolves as `status: \"stopped\"` with `type` left at `\"message\"`, and a recovered stuck quest that still has renderable content resolves as a success (`status: \"done\"`, no error) by design, to avoid destroying content to report a failure. The one exception is output-budget exhaustion: a `wait: true` request answers it with the 422 or 502 error envelope (plus `quest_id`) instead of this body. `errorCode` names a classified failure: `insufficient_credits` or `spend_frozen` (a spending pause that landed after the ACK). Other `type: \"error\"` turns may have no classifier, so never use its absence to infer success. On a real answer `errorCode` is absent from the `wait: true` body. The body also carries `sessionId`, the notebook the turn was recorded in - for an API-key caller that sent none (or any caller sending `newConversation: true`), that is the freshly created notebook's id; pass it back as the request's `sessionId` to continue. Contrast the tts/music/soundEffects contracts, which reject synchronously with a 422 carrying the same `errorCode` vocabulary.",
29925
30069
  schema: z$1.union([ChatWaitResponseSchema, ChatAckSchema]),
29926
30070
  pollResult: {
29927
30071
  schema: ChatQuestPollResultSchema,
29928
- description: "Outcome fields of the quest polled at `GET /api/v1/quests/{id}` after this ACK. A finished turn that failed is `status: \"done\"` with `type: \"error\"` and the failure text in `reply`, so a caller reading `reply` alone cannot tell a failure from an answer - check `type` first, and also treat a terminal `status: \"stopped\"` (a missing session, a user-cancelled turn) as failure even though it never sets `type`. `errorCode` is an optional refinement of `type: \"error\"`, present only for a classified failure; credit exhaustion arrives here as `insufficient_credits`, the same vocabulary the synchronous 422s on `/api/ai/music`, `/api/ai/sound-effects` and `/api/ai/tts` use, and a spending pause that lands after the ACK arrives as `spend_frozen`. An older queued QuestMaster start can instead settle with `free_quest_limit_reached`; new exhausted starts are refused synchronously with 403 before a quest exists. `QUEST_ERROR_CODES` also publishes `spend_cap_exceeded`, but no current throw site on this endpoint raises it as a quest errorCode: its only one, the embed chat route's pre-flight 422, fires outside the process try/catch that would classify it onto the quest; `run_budget_exhausted` is raised only by image generation. A turn that prompt moderation refuses arrives as `content_blocked`; do not resend it unchanged. Most `type: \"error\"` turns - an abort, a provider timeout or overload - have NO `errorCode`; its absence does not mean success, only that the failure is unclassified. A recovered stuck quest that still has renderable content is not a failure at all: it keeps `type: \"message\"` even though it did not finish, so a caller gets the content rather than an error. `fallbackInfo` is present only when the requested model failed and another model produced the reply: `fallbackModel` answered, `primaryModel` is what was asked for, and `reason` is the error from the first failed attempt on the requested model. The poll body carries further fields not modelled here, including `images`, `files`, `toolPayloads`, `promptMeta`, and the attachment report (`attachmentNotices`/`attachmentDelivery`) - only the outcome subset is modelled here.",
30072
+ description: "Outcome fields of the quest polled at `GET /api/v1/quests/{id}` after this ACK. A finished turn that failed is `status: \"done\"` with `type: \"error\"` and the failure text in `reply`, so a caller reading `reply` alone cannot tell a failure from an answer - check `type` first, and also treat a terminal `status: \"stopped\"` (a missing session, a user-cancelled turn) as failure even though it never sets `type`. `errorCode` is an optional refinement of `type: \"error\"`, present only for a classified failure; credit exhaustion arrives here as `insufficient_credits`, the same vocabulary the synchronous 422s on `/api/ai/music`, `/api/ai/sound-effects` and `/api/ai/tts` use, and a spending pause that lands after the ACK arrives as `spend_frozen`. A quest that settled before the in-chat QuestMaster plan was retired can still carry `free_quest_limit_reached`; no current turn raises it. `QUEST_ERROR_CODES` also publishes `spend_cap_exceeded`, but no current throw site on this endpoint raises it as a quest errorCode: its only one, the embed chat route's pre-flight 422, fires outside the process try/catch that would classify it onto the quest; `run_budget_exhausted` is raised only by image generation. A turn that prompt moderation refuses arrives as `content_blocked`; do not resend it unchanged. Most `type: \"error\"` turns - an abort, a provider timeout or overload - have NO `errorCode`; its absence does not mean success, only that the failure is unclassified. A recovered stuck quest that still has renderable content is not a failure at all: it keeps `type: \"message\"` even though it did not finish, so a caller gets the content rather than an error. `fallbackInfo` is present only when the requested model failed and another model produced the reply: `fallbackModel` answered, `primaryModel` is what was asked for, and `reason` is the error from the first failed attempt on the requested model. The poll body carries further fields not modelled here, including `images`, `files`, `toolPayloads`, `promptMeta`, and the attachment report (`attachmentNotices`/`attachmentDelivery`) - only the outcome subset is modelled here.",
29929
30073
  example: {
29930
30074
  id: EXAMPLE_RESOURCE_ID,
29931
30075
  status: "done",
@@ -29940,7 +30084,7 @@ defineEndpoint({
29940
30084
  schema: ApiErrorSchema
29941
30085
  },
29942
30086
  403: {
29943
- description: `The API key does not hold any of the required scopes, the account is suspended (\`errorCode: "account_suspended"\`), a free-tier account named a model outside the free-tier allowlist (\`errorCode: "model_requires_subscription"\`), a free account already started its QuestMaster quest (\`errorCode: "free_quest_limit_reached"\`), organization-policy preflight refuses the model (\`errorCode: "org_model_not_allowed"\`), or an API-key caller named a built-in tool the organization does not allow (\`errorCode: "org_tool_not_allowed"\`). ${SPEND_FROZEN_FORBIDDEN_NOTE}`,
30087
+ description: `The API key does not hold any of the required scopes, the account is suspended (\`errorCode: "account_suspended"\`), a free-tier account named a model outside the free-tier allowlist (\`errorCode: "model_requires_subscription"\`), organization-policy preflight refuses the model (\`errorCode: "org_model_not_allowed"\`), or an API-key caller named a built-in tool the organization does not allow (\`errorCode: "org_tool_not_allowed"\`). ${SPEND_FROZEN_FORBIDDEN_NOTE}`,
29944
30088
  schema: ChatForbiddenErrorSchema
29945
30089
  },
29946
30090
  404: {
@@ -30280,7 +30424,7 @@ defineEndpoint({
30280
30424
  * gate and one hourly budget (toolRoutesRateLimit), so they cannot drift apart. The JWT-only
30281
30425
  * POST /api/ai/v1/tools (tools.contract.ts) is a separate surface serving the CLI.
30282
30426
  */
30283
- const SCOPES$2 = ["ai:chat", "ai:generate"];
30427
+ const SCOPES$3 = ["ai:chat", "ai:generate"];
30284
30428
  const AUTH = "Authenticate with an API key (`b4m_live_`) carrying `ai:chat` or `ai:generate`, or a JWT. Every call counts against one hourly budget of 600 calls per user, shared by the three `/api/v1/tools/*` endpoints and the three `/api/tools/*` routes.";
30285
30429
  const BILLED = "Billed per call from the caller's credits (or their organization's) when the deployment's provider charges for it, and refused with a 422 `insufficient_credits` before the provider is called when the payer cannot cover it.";
30286
30430
  const FORBIDDEN$3 = {
@@ -30292,7 +30436,7 @@ const BILLED_FORBIDDEN = {
30292
30436
  description: `${FORBIDDEN$3.description} ${SPEND_FROZEN_FORBIDDEN_NOTE}`,
30293
30437
  schema: MeteredForbiddenErrorSchema
30294
30438
  };
30295
- const RATE_LIMITED$5 = {
30439
+ const RATE_LIMITED$6 = {
30296
30440
  description: "Rate limit exceeded: the per-key limit, or the hourly budget shared by the tool endpoints.",
30297
30441
  schema: ApiErrorSchema
30298
30442
  };
@@ -30316,7 +30460,7 @@ defineEndpoint({
30316
30460
  description: "Runs one web search on the provider this deployment is configured with and returns the hits as one formatted text block (title, link and snippet per result), ready to hand to a model. When no search provider is configured, `result` says so instead of listing hits. " + BILLED + " " + AUTH,
30317
30461
  tags: ["Tools"],
30318
30462
  auth: "apiKeyOrJwt",
30319
- scopes: SCOPES$2,
30463
+ scopes: SCOPES$3,
30320
30464
  request: WebSearchToolRequestSchema,
30321
30465
  requestExample: SEARCH_EXAMPLE,
30322
30466
  responses: {
@@ -30332,7 +30476,7 @@ defineEndpoint({
30332
30476
  },
30333
30477
  403: BILLED_FORBIDDEN,
30334
30478
  422: INSUFFICIENT_CREDITS,
30335
- 429: RATE_LIMITED$5,
30479
+ 429: RATE_LIMITED$6,
30336
30480
  500: {
30337
30481
  description: "The search provider failed, or an unexpected server error.",
30338
30482
  schema: ApiErrorSchema
@@ -30354,7 +30498,7 @@ defineEndpoint({
30354
30498
  description: "Fetches one public http or https page and returns its readable content as Markdown, headed by the page title when it has one. A long page is truncated, and the end of `result` says which `offset` to pass to read the next part. Private, loopback and cloud-metadata addresses are refused. " + BILLED + " " + AUTH,
30355
30499
  tags: ["Tools"],
30356
30500
  auth: "apiKeyOrJwt",
30357
- scopes: SCOPES$2,
30501
+ scopes: SCOPES$3,
30358
30502
  request: WebFetchToolRequestSchema,
30359
30503
  requestExample: FETCH_EXAMPLE,
30360
30504
  responses: {
@@ -30376,7 +30520,7 @@ defineEndpoint({
30376
30520
  description: "Request body failed validation, the page cannot be read (unreachable, or a content type that is not a readable page), or the caller cannot afford the call (`errorCode: \"insufficient_credits\"`).",
30377
30521
  schema: InsufficientCreditsErrorSchema
30378
30522
  },
30379
- 429: RATE_LIMITED$5,
30523
+ 429: RATE_LIMITED$6,
30380
30524
  500: {
30381
30525
  description: "The fetch failed, or an unexpected server error.",
30382
30526
  schema: ApiErrorSchema
@@ -30402,7 +30546,7 @@ defineEndpoint({
30402
30546
  description: "Returns the current temperature and conditions at a coordinate as one sentence. Not billed. " + AUTH,
30403
30547
  tags: ["Tools"],
30404
30548
  auth: "apiKeyOrJwt",
30405
- scopes: SCOPES$2,
30549
+ scopes: SCOPES$3,
30406
30550
  request: WeatherToolRequestSchema,
30407
30551
  requestExample: WEATHER_EXAMPLE,
30408
30552
  responses: {
@@ -30416,7 +30560,7 @@ defineEndpoint({
30416
30560
  schema: ApiErrorSchema
30417
30561
  },
30418
30562
  403: FORBIDDEN$3,
30419
- 429: RATE_LIMITED$5,
30563
+ 429: RATE_LIMITED$6,
30420
30564
  500: {
30421
30565
  description: "The weather provider is not configured or failed, or an unexpected server error.",
30422
30566
  schema: ApiErrorSchema
@@ -31173,7 +31317,7 @@ defineEndpoint({
31173
31317
  mcp_server: false,
31174
31318
  custom_mcp_connectors: false,
31175
31319
  mementos: false,
31176
- quest_master: true,
31320
+ quest_master: false,
31177
31321
  rapid_reply: true,
31178
31322
  research_engine: true,
31179
31323
  team_plan: false,
@@ -31522,6 +31666,75 @@ defineEndpoint({
31522
31666
  streaming: false
31523
31667
  }
31524
31668
  });
31669
+ const BUSY_BLOCKS_NOTE = "Authenticate with a JWT access token of the signed-in user. The busy blocks are the caller's own; only start and end times are accepted, never event titles or attendees. A brief is composed after a block ends only when something arrived during it.";
31670
+ const BUSY_BLOCKS_EXAMPLE = {
31671
+ enabled: true,
31672
+ blocks: [{
31673
+ start: "2026-11-20T15:00:00.000Z",
31674
+ end: "2026-11-20T16:00:00.000Z"
31675
+ }]
31676
+ };
31677
+ defineEndpoint({
31678
+ method: "get",
31679
+ path: "/api/v1/briefs/busy-blocks",
31680
+ operationId: "getBusyBlocks",
31681
+ summary: "Get your busy blocks",
31682
+ description: "Reads the synced busy blocks and when the next block brief is due. " + BUSY_BLOCKS_NOTE,
31683
+ tags: ["AI"],
31684
+ auth: "jwtOnly",
31685
+ responses: {
31686
+ 200: {
31687
+ description: "Your busy blocks.",
31688
+ schema: BusyBlocksResponseSchema
31689
+ },
31690
+ 401: {
31691
+ description: "Missing or invalid JWT.",
31692
+ schema: ApiErrorSchema
31693
+ },
31694
+ 429: {
31695
+ description: "Per-user rate limit exceeded.",
31696
+ schema: ApiErrorSchema
31697
+ }
31698
+ },
31699
+ codeSample: {
31700
+ authToken: "<access_token>",
31701
+ streaming: false
31702
+ }
31703
+ });
31704
+ defineEndpoint({
31705
+ method: "put",
31706
+ path: "/api/v1/briefs/busy-blocks",
31707
+ operationId: "putBusyBlocks",
31708
+ summary: "Sync your busy blocks",
31709
+ description: "Replaces the stored busy blocks with the device calendar's next busy intervals and returns them merged, with the next due time. Blocks more than 72 hours out and blocks already briefed are dropped. " + BUSY_BLOCKS_NOTE,
31710
+ tags: ["AI"],
31711
+ auth: "jwtOnly",
31712
+ request: PutBusyBlocksSchema,
31713
+ requestExample: BUSY_BLOCKS_EXAMPLE,
31714
+ responses: {
31715
+ 200: {
31716
+ description: "The stored busy blocks.",
31717
+ schema: BusyBlocksResponseSchema
31718
+ },
31719
+ 400: {
31720
+ description: "Malformed JSON request body.",
31721
+ schema: ApiErrorSchema
31722
+ },
31723
+ 401: {
31724
+ description: "Missing or invalid JWT.",
31725
+ schema: ApiErrorSchema
31726
+ },
31727
+ 429: {
31728
+ description: "Per-user rate limit exceeded.",
31729
+ schema: ApiErrorSchema
31730
+ }
31731
+ },
31732
+ codeSample: {
31733
+ authToken: "<access_token>",
31734
+ body: BUSY_BLOCKS_EXAMPLE,
31735
+ streaming: false
31736
+ }
31737
+ });
31525
31738
  defineEndpoint({
31526
31739
  method: "post",
31527
31740
  path: "/api/v1/briefs/{id}/decisions/{decisionId}/reply",
@@ -31673,6 +31886,199 @@ defineEndpoint({
31673
31886
  body: {}
31674
31887
  }
31675
31888
  });
31889
+ /**
31890
+ * Obligations: a scanned bill, receipt or letter handed to the assistant. Served by
31891
+ * apps/client/pages/api/v1/obligations/index.ts (hand-off, list) and [id].ts (read, correct + confirm);
31892
+ * the extraction lives in apps/client/server/obligations/handOffDocument.ts and confirmed ones reach
31893
+ * the brief through apps/workers/src/events/briefCompose.ts.
31894
+ */
31895
+ const SCOPES$2 = ["ai:chat", "ai:generate"];
31896
+ const RATE_LIMITED$5 = {
31897
+ description: "Per-user rate limit exceeded.",
31898
+ schema: ApiErrorSchema
31899
+ };
31900
+ const CONNECTED_APP = {
31901
+ description: "The key was minted for a connected app, which cannot use obligations.",
31902
+ schema: ApiErrorSchema
31903
+ };
31904
+ const NOT_FOUND$1 = {
31905
+ description: "No such obligation, or it is not yours.",
31906
+ schema: ApiErrorSchema
31907
+ };
31908
+ defineEndpoint({
31909
+ method: "post",
31910
+ path: "/api/v1/obligations",
31911
+ operationId: "handOffObligation",
31912
+ summary: "Hand a scanned document to the assistant",
31913
+ description: "Reads a document you uploaded (a bill, receipt or letter) and extracts the amount, payee and due date, suggesting one of your data lakes to file it in. The result is `pending`: nothing is filed or briefed until you confirm it with `PATCH /api/v1/obligations/{id}`. Pass `text` when the device already recognized the page; otherwise the file's indexed text is read. Handing off the same file again returns the existing obligation with `200` and is not charged again. An API key without `datalake:write` gets no destination suggestion, and one without a data-lake read scope reads `destination` as `null` on every obligation route.",
31914
+ tags: ["AI"],
31915
+ auth: "apiKeyOrJwt",
31916
+ emitsRateLimitHeaders: true,
31917
+ scopes: SCOPES$2,
31918
+ request: ObligationHandoffRequestSchema,
31919
+ requestExample: { file_id: "file_example" },
31920
+ responses: {
31921
+ 201: {
31922
+ description: "The extracted obligation, `pending`.",
31923
+ schema: ObligationSchema,
31924
+ example: {
31925
+ id: "obligation_example",
31926
+ status: "pending",
31927
+ document_kind: "invoice",
31928
+ file_id: "file_example",
31929
+ amount: {
31930
+ value: 120.5,
31931
+ currency: "USD"
31932
+ },
31933
+ payee: "Example Utilities",
31934
+ due_date: "2026-12-15",
31935
+ destination: {
31936
+ lake_id: "lake_example",
31937
+ name: "Household bills"
31938
+ },
31939
+ summary: "Electricity bill for November.",
31940
+ created_at: "2026-11-25T10:00:00.000Z",
31941
+ confirmed_at: null
31942
+ }
31943
+ },
31944
+ 200: {
31945
+ description: "This file was already handed off; the existing obligation.",
31946
+ schema: ObligationSchema
31947
+ },
31948
+ 403: {
31949
+ description: `${CONNECTED_APP.description} Also returned (\`spend_frozen\`) when your account or organization spend is frozen.`,
31950
+ schema: ApiErrorSchema
31951
+ },
31952
+ 404: {
31953
+ description: "`file_id` names no file of yours. Another user's file reads the same.",
31954
+ schema: ApiErrorSchema
31955
+ },
31956
+ 409: {
31957
+ description: "The file is still being checked after upload; retry shortly.",
31958
+ schema: ApiErrorSchema
31959
+ },
31960
+ 422: {
31961
+ description: "The file cannot be processed, has no readable text, or (`insufficient_credits`) you are out of credits.",
31962
+ schema: ApiErrorSchema
31963
+ },
31964
+ 429: {
31965
+ description: `${RATE_LIMITED$5.description} Also returned when the free tier's daily usage cap is reached.`,
31966
+ schema: ApiErrorSchema
31967
+ },
31968
+ 502: {
31969
+ description: "The assistant could not read the document. Nothing was saved, but the reading is charged.",
31970
+ schema: ApiErrorSchema
31971
+ }
31972
+ },
31973
+ codeSample: {
31974
+ authToken: "b4m_live_<key>",
31975
+ streaming: false,
31976
+ body: { file_id: "file_example" }
31977
+ }
31978
+ });
31979
+ defineEndpoint({
31980
+ method: "get",
31981
+ path: "/api/v1/obligations",
31982
+ operationId: "listObligations",
31983
+ summary: "List obligations",
31984
+ description: "Lists your obligations, newest first, optionally only those in one `status`. Cursor-paginated: pass `next_cursor` back as `cursor` until it is `null`.",
31985
+ tags: ["AI"],
31986
+ auth: "apiKeyOrJwt",
31987
+ emitsRateLimitHeaders: true,
31988
+ scopes: SCOPES$2,
31989
+ queryParams: ListObligationsQuerySchema,
31990
+ responses: {
31991
+ 200: {
31992
+ description: "One page of obligations.",
31993
+ schema: ListObligationsResponseSchema
31994
+ },
31995
+ 403: CONNECTED_APP,
31996
+ 422: {
31997
+ description: "Invalid query parameter or cursor.",
31998
+ schema: ApiErrorSchema
31999
+ },
32000
+ 429: RATE_LIMITED$5
32001
+ },
32002
+ codeSample: {
32003
+ authToken: "b4m_live_<key>",
32004
+ streaming: false,
32005
+ body: {}
32006
+ }
32007
+ });
32008
+ defineEndpoint({
32009
+ method: "get",
32010
+ path: "/api/v1/obligations/{id}",
32011
+ operationId: "getObligation",
32012
+ summary: "Get an obligation",
32013
+ description: "Reads one obligation. Only its owner can read it; anyone else gets `404`, exactly like a missing one.",
32014
+ tags: ["AI"],
32015
+ auth: "apiKeyOrJwt",
32016
+ emitsRateLimitHeaders: true,
32017
+ scopes: SCOPES$2,
32018
+ pathParams: ObligationIdParamSchema,
32019
+ responses: {
32020
+ 200: {
32021
+ description: "The obligation.",
32022
+ schema: ObligationSchema
32023
+ },
32024
+ 403: CONNECTED_APP,
32025
+ 404: NOT_FOUND$1,
32026
+ 429: RATE_LIMITED$5
32027
+ },
32028
+ codeSample: {
32029
+ authToken: "b4m_live_<key>",
32030
+ streaming: false,
32031
+ body: {}
32032
+ }
32033
+ });
32034
+ defineEndpoint({
32035
+ method: "patch",
32036
+ path: "/api/v1/obligations/{id}",
32037
+ operationId: "updateObligation",
32038
+ summary: "Correct or confirm an obligation",
32039
+ description: "Corrects the extracted fields and, with `status: \"confirmed\"`, accepts them: the document is filed into the destination data lake and, when it has a due date, the obligation appears in your briefs ahead of it. A confirmed obligation stays editable; changing its destination files the document into the new lake and leaves it in the old one. `status: \"dismissed\"` discards it, after which it cannot be changed. Send at least one field.",
32040
+ tags: ["AI"],
32041
+ auth: "apiKeyOrJwt",
32042
+ emitsRateLimitHeaders: true,
32043
+ scopes: SCOPES$2,
32044
+ pathParams: ObligationIdParamSchema,
32045
+ request: ObligationUpdateRequestSchema,
32046
+ requestExample: {
32047
+ amount: {
32048
+ value: 120.5,
32049
+ currency: "USD"
32050
+ },
32051
+ status: "confirmed"
32052
+ },
32053
+ responses: {
32054
+ 200: {
32055
+ description: "The updated obligation.",
32056
+ schema: ObligationSchema
32057
+ },
32058
+ 403: {
32059
+ description: "The destination is a data lake you can read but not manage or a built-in one, the request sets or files into a destination with an API key lacking `datalake:write`, or the key was minted for a connected app.",
32060
+ schema: ApiErrorSchema
32061
+ },
32062
+ 404: {
32063
+ description: "No such obligation or destination data lake, or it is not yours.",
32064
+ schema: ApiErrorSchema
32065
+ },
32066
+ 409: {
32067
+ description: "The obligation was dismissed and can no longer change.",
32068
+ schema: ApiErrorSchema
32069
+ },
32070
+ 422: {
32071
+ description: "The body is invalid or sets no field.",
32072
+ schema: ApiErrorSchema
32073
+ },
32074
+ 429: RATE_LIMITED$5
32075
+ },
32076
+ codeSample: {
32077
+ authToken: "b4m_live_<key>",
32078
+ streaming: false,
32079
+ body: { status: "confirmed" }
32080
+ }
32081
+ });
31676
32082
  const JWT_ONLY_NOTE$1 = "Authenticate with a JWT access token only: the token is bound to the signed-in session that registers it, and API keys have no session. ";
31677
32083
  defineEndpoint({
31678
32084
  method: "post",
@@ -43437,4 +43843,4 @@ const logger = class Logger {
43437
43843
  }.getInstance();
43438
43844
  logger.setVerbose(process.env.B4M_VERBOSE === "1");
43439
43845
  //#endregion
43440
- export { RESEARCH_ITEM_RULE_ACTIONS as $, tokenEstimateMultiplier as $t, DEFAULT_TTS_PROVIDER as A, isExpectedToolError as At, LOW_CONFIDENCE_COMPLETION_MODES as B, planLeaves as Bt, CREDIT_DEDUCT_TRANSACTION_TYPES as C, getEmbeddingModelCapabilities as Ct, CreateArtifactRequestSchema as D, hasDeliverablePinnedArtifact as Dt, CompletionReasoningEffortSchema as E, googleMapsSearchUrl as Et, EMBEDDING_MODEL_IDS as F, isSupportedFabFileMimeType as Ft, NotFoundError as G, resolveSettingDefinition as Gt, MODEL_INFO_FIELD_GROUP_OF as H, questReplyText as Ht, ExpectedToolError as I, isUserInitiatedAbort as It, PROMPT_TEXT_MAX as J, signImageUrl as Jt, OllamaEmbeddingModel as K, secureParameters as Kt, ImageJobSchema as L, joinReplySlots as Lt, DecisionTextPartSchema as M, isProviderRefusalStopReason as Mt, DecisionsRequestSchema as N, isRetryableError as Nt, CreateImageJobResponseSchema as O, isEarlyStop as Ot, EMBEDDING_MODEL_CATALOG as P, isSupportedEmbeddingModel as Pt, RESEARCH_FEED_URL_MAX_CHARS as Q, supportedVoiceGenerationVendor as Qt, ImageModels as R, normalizeDomainEntry as Rt, CONTEXT_WINDOW_SAFETY_BUFFER_TOKENS as S, generatedAudioResponseSchema as St, ChatModels as T, getQuestErrorCode as Tt, McpServerName as U, reasoningChannelOf as Ut, MODEL_DECLINED_MESSAGE as V, planProgress as Vt, ModelBackend as W, replacePromptVariables as Wt, RESEARCH_COST_CEILING_MICRO_USD_LIMIT as X, stripDeliveredArtifactBlocks as Xt, PermissionDeniedError as Y, splitEquals as Yt, RESEARCH_DROP_REASONS as Z, stripToolArtifactMarkup as Zt, AudioMimeType as _, WEBSITE_URL as _n, createReasoningWithholder as _t, htmlFirstH1 as a, withholdsReasoning as an, SEARCH_RESULT_CARDS_LANGUAGE as at, BriefcasePromptIdSchema as b, filterToolArtifactMarkup as bt, AGENT_QUEST_MANIFEST as c, actorColorIndex as cn, SupportedFabFileMimeTypes as ct, ARTIFACT_REMOVED_PLACEHOLDER as d, delegationPayloadSchema as dn, VoyageAIEmbeddingModel as dt, ttsBase64ResponseSchema as en, RESEARCH_MIN_RELEVANCE_DEFAULT as et, AdminAiStoredConfigSchema as f, selfClaimedActorKindSchema as fn, WORK_ITEM_STATUSES as ft, ArtifactTypeSchema as g, APP_NAME as gn, createMutex as gt, ApiKeyType as h, splitSkillMdFrontmatter as hn, completionsSupportsToolSearch as ht, htmlErrorTitle as i, withRetry as in, REVIEW_GATE_STATUS_VALUES as it, DEGENERATE_FINISH_REASON as j, isPlaceholderImageSigningSecret as jt, DATA_LAKE_PROPOSAL_STATUSES as k, isEnforceCreditsLocked as kt, AGENT_QUEST_MCP_URI as l, actorKindMarker as ln, UnprocessableEntityError as lt, ApiKeyScope as m, readSkillMdSourceUrl as mn, buildPromptContext as mt, SESSION_ID_PATTERN as n, ttsResponseTooLargeSchema as nn, RESEARCH_SOURCES as nt, escapeArtifactBodyJson as o, ACTOR_COLOR_SLOTS as on, SLUG_OWNED_BY_OTHER as ot, AiAccessRefusedError as p, frontmatterHasSourceStamp as pn, assertAuthOriginMatchesApiKey as pt, OpenAIEmbeddingModel as q, servableEmbeddingDimensions as qt, isValidSessionId as r, visibleReplyText as rn, RESEARCH_UNLISTED_SOURCES as rt, AGENT_QUEST_ID as s, DELEGATION_PAYLOAD_SCHEMA_NAME as sn, SUBQUEST_STATUS_VALUES as st, logger as t, ttsRequestSchema as tn, RESEARCH_SCHEDULE_CADENCES as tt, ARTIFACT_DELIVERED_PLACEHOLDER as u, actorKindSchema as un, VisibilitySchema as ut, BRIEFCASE_CATALOG_QUERIES as v, createThinkMarkerEscaper as vt, CUSTOM_MCP_DATA_NOTICE as w, getMcpProviderMetadata as wt, CONFIDENCE_GATE_MODES as x, fromCliTodos as xt, BedrockEmbeddingModel as y, escapeThinkMarkers as yt, LOCATION_MAP_LANGUAGE as z, obfuscateApiKey as zt };
43846
+ export { RESEARCH_ITEM_RULE_ACTIONS as $, ttsRequestSchema as $t, DEFAULT_TTS_PROVIDER as A, isProviderRefusalStopReason as At, LOW_CONFIDENCE_COMPLETION_MODES as B, questReplyText as Bt, CREDIT_DEDUCT_TRANSACTION_TYPES as C, getQuestErrorCode as Ct, CreateArtifactRequestSchema as D, isEnforceCreditsLocked as Dt, CompletionReasoningEffortSchema as E, isEarlyStop as Et, EMBEDDING_MODEL_IDS as F, joinReplySlots as Ft, NotFoundError as G, servableEmbeddingDimensions as Gt, MODEL_INFO_FIELD_GROUP_OF as H, replacePromptVariables as Ht, ExpectedToolError as I, normalizeDomainEntry as It, PROMPT_TEXT_MAX as J, stripDeliveredArtifactBlocks as Jt, OllamaEmbeddingModel as K, signImageUrl as Kt, ImageJobSchema as L, obfuscateApiKey as Lt, DecisionTextPartSchema as M, isSupportedEmbeddingModel as Mt, DecisionsRequestSchema as N, isSupportedFabFileMimeType as Nt, CreateImageJobResponseSchema as O, isExpectedToolError as Ot, EMBEDDING_MODEL_CATALOG as P, isUserInitiatedAbort as Pt, RESEARCH_FEED_URL_MAX_CHARS as Q, ttsBase64ResponseSchema as Qt, ImageModels as R, planLeaves as Rt, CONTEXT_WINDOW_SAFETY_BUFFER_TOKENS as S, getMcpProviderMetadata as St, ChatModels as T, hasDeliverablePinnedArtifact as Tt, McpServerName as U, resolveSettingDefinition as Ut, MODEL_DECLINED_MESSAGE as V, reasoningChannelOf as Vt, ModelBackend as W, secureParameters as Wt, RESEARCH_COST_CEILING_MICRO_USD_LIMIT as X, supportedVoiceGenerationVendor as Xt, PermissionDeniedError as Y, stripToolArtifactMarkup as Yt, RESEARCH_DROP_REASONS as Z, tokenEstimateMultiplier as Zt, AudioMimeType as _, escapeThinkMarkers as _t, htmlFirstH1 as a, DELEGATION_PAYLOAD_SCHEMA_NAME as an, SLUG_OWNED_BY_OTHER as at, BriefcasePromptIdSchema as b, generatedAudioResponseSchema as bt, AGENT_QUEST_MANIFEST as c, actorKindSchema as cn, VisibilitySchema as ct, ARTIFACT_REMOVED_PLACEHOLDER as d, frontmatterHasSourceStamp as dn, assertAuthOriginMatchesApiKey as dt, ttsResponseTooLargeSchema as en, RESEARCH_MIN_RELEVANCE_DEFAULT as et, AdminAiStoredConfigSchema as f, readSkillMdSourceUrl as fn, buildPromptContext as ft, ArtifactTypeSchema as g, createThinkMarkerEscaper as gt, ApiKeyType as h, WEBSITE_URL as hn, createReasoningWithholder as ht, htmlErrorTitle as i, ACTOR_COLOR_SLOTS as in, SEARCH_RESULT_CARDS_LANGUAGE as it, DEGENERATE_FINISH_REASON as j, isRetryableError as jt, DATA_LAKE_PROPOSAL_STATUSES as k, isPlaceholderImageSigningSecret as kt, AGENT_QUEST_MCP_URI as l, delegationPayloadSchema as ln, VoyageAIEmbeddingModel as lt, ApiKeyScope as m, APP_NAME as mn, createMutex as mt, SESSION_ID_PATTERN as n, withRetry as nn, RESEARCH_SOURCES as nt, escapeArtifactBodyJson as o, actorColorIndex as on, SupportedFabFileMimeTypes as ot, AiAccessRefusedError as p, splitSkillMdFrontmatter as pn, completionsSupportsToolSearch as pt, OpenAIEmbeddingModel as q, splitEquals as qt, isValidSessionId as r, withholdsReasoning as rn, RESEARCH_UNLISTED_SOURCES as rt, AGENT_QUEST_ID as s, actorKindMarker as sn, UnprocessableEntityError as st, logger as t, visibleReplyText as tn, RESEARCH_SCHEDULE_CADENCES as tt, ARTIFACT_DELIVERED_PLACEHOLDER as u, selfClaimedActorKindSchema as un, WORK_ITEM_STATUSES as ut, BRIEFCASE_CATALOG_QUERIES as v, filterToolArtifactMarkup as vt, CUSTOM_MCP_DATA_NOTICE as w, googleMapsSearchUrl as wt, CONFIDENCE_GATE_MODES as x, getEmbeddingModelCapabilities as xt, BedrockEmbeddingModel as y, fromCliTodos as yt, LOCATION_MAP_LANGUAGE as z, planProgress as zt };