@bike4mind/cli 5.1.0 → 5.3.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-DrZ47hqO.mjs → AgentHistoryStore-DmjsjprP.mjs} +9246 -186
  2. package/dist/{ApiClient-B8VxyNEM.mjs → ApiClient-z1v3ZiyX.mjs} +3 -3
  3. package/dist/{BubblewrapRuntime-DotKnqtu.mjs → BubblewrapRuntime-tQxRxWDx.mjs} +2 -2
  4. package/dist/{ConfigStore-DfuE49PH.mjs → ConfigStore-DV3DLYe7.mjs} +2 -2
  5. package/dist/ConfigStore-DuoHZ-FU.mjs +2 -0
  6. package/dist/{Logger-D6QD3c7G.mjs → Logger-BL2tt7VU.mjs} +1496 -191
  7. package/dist/{SandboxOrchestrator-Cm9L1TRR.mjs → SandboxOrchestrator-CvgTBr8Y.mjs} +1 -1
  8. package/dist/{SandboxRuntimeAdapter-HEkl0-qG.mjs → SandboxRuntimeAdapter-C2SCtV5L.mjs} +2 -2
  9. package/dist/{SandboxRuntimeAdapter-DF9hg5Xl.mjs → SandboxRuntimeAdapter-Z53LMuMM.mjs} +1 -1
  10. package/dist/{SeatbeltRuntime-CYsIp616.mjs → SeatbeltRuntime-B3mQajp2.mjs} +2 -2
  11. package/dist/{WorkItemsClient-sUftLgOz.mjs → WorkItemsClient-D9AzCyZL.mjs} +1 -1
  12. package/dist/{buildToolSearch-Bb-DPCb0.mjs → buildToolSearch-CiGysMAm.mjs} +2 -2
  13. package/dist/commands/acpCommand.mjs +5 -5
  14. package/dist/commands/apiCommand.mjs +1 -1
  15. package/dist/commands/doctorCommand.mjs +2 -2
  16. package/dist/commands/envCommand.mjs +1 -1
  17. package/dist/commands/headlessCommand.mjs +5 -6
  18. package/dist/commands/mcpCommand.mjs +3 -3
  19. package/dist/commands/mirrorCommand.mjs +2 -2
  20. package/dist/commands/modelsCommand.mjs +4 -4
  21. package/dist/commands/pluginCommand.mjs +1 -1
  22. package/dist/commands/skillsCommand.mjs +3 -3
  23. package/dist/commands/updateCommand.mjs +2 -2
  24. package/dist/dist-gMa7bapu.mjs +1209 -0
  25. package/dist/{fit-BsHUrxwe.mjs → fit-Cks7OTh3.mjs} +3 -3
  26. package/dist/index.mjs +12 -15
  27. package/dist/{modelServers-Ca1l2hMC.mjs → modelServers-DlyDu08E.mjs} +1 -1
  28. package/dist/{package-hEkaJgsy.mjs → package-CB8wzf84.mjs} +1 -1
  29. package/dist/{serve-CiSddein.mjs → serve-bulD3gJ-.mjs} +445 -29
  30. package/dist/{updateChecker-dZqiMftm.mjs → updateChecker-a6OuWq18.mjs} +1 -1
  31. package/package.json +11 -11
  32. package/dist/ConfigStore-1lUx9qD8.mjs +0 -2
  33. package/dist/dist-De8Q0ivE.mjs +0 -10291
@@ -12,7 +12,6 @@ import timezone from "dayjs/plugin/timezone.js";
12
12
  import utc from "dayjs/plugin/utc.js";
13
13
  import relativeTime from "dayjs/plugin/relativeTime.js";
14
14
  import localizedFormat from "dayjs/plugin/localizedFormat.js";
15
- import { isAxiosError } from "axios";
16
15
  //#region ../../b4m-core/common/dist/api-BWq4M1mv.mjs
17
16
  const APP_NAME = process.env.APP_NAME || "";
18
17
  const WEBSITE_URL = process.env.WEBSITE_URL || "";
@@ -355,6 +354,15 @@ var ForbiddenError = class extends HTTPError {
355
354
  * (`isTerminalToolError`, `@bike4mind/llm-adapters`): it ends the turn instead of going back to the model.
356
355
  */
357
356
  var AiAccessRefusedError = class extends ForbiddenError {};
357
+ /** 502: an upstream we depend on failed. The caller's request was well-formed. */
358
+ var BadGatewayError = class extends HTTPError {
359
+ additionalInfo;
360
+ constructor(message, additionalInfo) {
361
+ super(502, message, additionalInfo);
362
+ this.additionalInfo = additionalInfo;
363
+ this.name = "BadGatewayError";
364
+ }
365
+ };
358
366
  function isZodError(err) {
359
367
  return Boolean(err && (err instanceof ZodError || err.name === "ZodError"));
360
368
  }
@@ -2859,6 +2867,11 @@ const ADMIN_AUDIT_CATALOGUE = {
2859
2867
  severity: "notice",
2860
2868
  write: "strict"
2861
2869
  },
2870
+ "org.slack_channel_app_read.updated": {
2871
+ category: "org",
2872
+ severity: "notice",
2873
+ write: "strict"
2874
+ },
2862
2875
  "org.member.added": {
2863
2876
  category: "org",
2864
2877
  severity: "notice",
@@ -3602,6 +3615,11 @@ const ADMIN_AUDIT_CATALOGUE = {
3602
3615
  severity: "notice",
3603
3616
  write: "strict"
3604
3617
  },
3618
+ "ops.dlq.fix.attached": {
3619
+ category: "support",
3620
+ severity: "notice",
3621
+ write: "strict"
3622
+ },
3605
3623
  "ops.agent_executions.cleaned_up": {
3606
3624
  category: "support",
3607
3625
  severity: "notice",
@@ -3752,6 +3770,16 @@ const ADMIN_AUDIT_CATALOGUE = {
3752
3770
  severity: "notice",
3753
3771
  write: "bestEffort"
3754
3772
  },
3773
+ "settings.feature_release.created": {
3774
+ category: "settings",
3775
+ severity: "info",
3776
+ write: "bestEffort"
3777
+ },
3778
+ "settings.feature_release.deleted": {
3779
+ category: "settings",
3780
+ severity: "notice",
3781
+ write: "bestEffort"
3782
+ },
3755
3783
  "settings.business_link.created": {
3756
3784
  category: "settings",
3757
3785
  severity: "info",
@@ -4201,6 +4229,96 @@ const ADMIN_AUDIT_CATALOGUE = {
4201
4229
  category: "access",
4202
4230
  severity: "notice",
4203
4231
  write: "strict"
4232
+ },
4233
+ "status.incident.created": {
4234
+ category: "status",
4235
+ severity: "info",
4236
+ write: "strict"
4237
+ },
4238
+ "status.incident.published": {
4239
+ category: "status",
4240
+ severity: "notice",
4241
+ write: "strict"
4242
+ },
4243
+ "status.incident.updated": {
4244
+ category: "status",
4245
+ severity: "notice",
4246
+ write: "strict"
4247
+ },
4248
+ "status.incident.corrected": {
4249
+ category: "status",
4250
+ severity: "notice",
4251
+ write: "strict"
4252
+ },
4253
+ "status.incident.resolved": {
4254
+ category: "status",
4255
+ severity: "notice",
4256
+ write: "strict"
4257
+ },
4258
+ "status.incident.reopened": {
4259
+ category: "status",
4260
+ severity: "notice",
4261
+ write: "strict"
4262
+ },
4263
+ "status.incident.retracted": {
4264
+ category: "status",
4265
+ severity: "critical",
4266
+ write: "strict"
4267
+ },
4268
+ "status.incident.classification_raised": {
4269
+ category: "status",
4270
+ severity: "notice",
4271
+ write: "strict"
4272
+ },
4273
+ "status.incident.classification_lowered": {
4274
+ category: "status",
4275
+ severity: "critical",
4276
+ write: "strict"
4277
+ },
4278
+ "status.incident.note_added": {
4279
+ category: "status",
4280
+ severity: "info",
4281
+ write: "bestEffort"
4282
+ },
4283
+ "status.incident.postmortem_attached": {
4284
+ category: "status",
4285
+ severity: "notice",
4286
+ write: "strict"
4287
+ },
4288
+ "status.component.pinned": {
4289
+ category: "status",
4290
+ severity: "notice",
4291
+ write: "strict"
4292
+ },
4293
+ "status.component.unpinned": {
4294
+ category: "status",
4295
+ severity: "notice",
4296
+ write: "strict"
4297
+ },
4298
+ "status.component.suppressed": {
4299
+ category: "status",
4300
+ severity: "notice",
4301
+ write: "strict"
4302
+ },
4303
+ "status.component.edited": {
4304
+ category: "status",
4305
+ severity: "notice",
4306
+ write: "strict"
4307
+ },
4308
+ "status.component.published": {
4309
+ category: "status",
4310
+ severity: "notice",
4311
+ write: "strict"
4312
+ },
4313
+ "status.component.history_corrected": {
4314
+ category: "status",
4315
+ severity: "critical",
4316
+ write: "strict"
4317
+ },
4318
+ "status.snapshot.force_published": {
4319
+ category: "status",
4320
+ severity: "notice",
4321
+ write: "strict"
4204
4322
  }
4205
4323
  };
4206
4324
  Object.keys(ADMIN_AUDIT_CATALOGUE).filter((action) => "escalatesAboveGrantThreshold" in ADMIN_AUDIT_CATALOGUE[action]);
@@ -4376,13 +4494,16 @@ const SreRepoConfigSchema = z$1.object({
4376
4494
  }).default({
4377
4495
  required: ["bug"],
4378
4496
  anyOf: []
4379
- })
4497
+ }),
4498
+ /** GitHub logins whose `labeled` and `reopened` issue events are not dispatched. */
4499
+ ignoredSenderLogins: z$1.array(z$1.string()).default([])
4380
4500
  }).default({
4381
4501
  enabled: false,
4382
4502
  labelFilter: {
4383
4503
  required: ["bug"],
4384
4504
  anyOf: []
4385
- }
4505
+ },
4506
+ ignoredSenderLogins: []
4386
4507
  })
4387
4508
  }).default({
4388
4509
  cloudwatch: { enabled: false },
@@ -4391,7 +4512,8 @@ const SreRepoConfigSchema = z$1.object({
4391
4512
  labelFilter: {
4392
4513
  required: ["bug"],
4393
4514
  anyOf: []
4394
- }
4515
+ },
4516
+ ignoredSenderLogins: []
4395
4517
  }
4396
4518
  }),
4397
4519
  /** Recurrence guard */
@@ -5101,51 +5223,6 @@ const CALLABLE_FUNCTION_DATA_LIMITS = {
5101
5223
  /** The runtime's data cache, and so the most `CallableFunctionDataTotalMaxMb` can allow. */
5102
5224
  cacheMb: 9216
5103
5225
  };
5104
- /** An `owner/name` GitHub repository; also used by the worker's repository check. */
5105
- const SECOPS_TRIAGE_REPO_PATTERN = /^[\w.-]+\/[\w.-]+$/;
5106
- const MAX_ISSUES_MESSAGE = "Max issues per scan must be between 1 and 100";
5107
- /**
5108
- * Configuration schema for the SecOps Triage feature.
5109
- *
5110
- * Controls automatic GitHub issue creation for critical/high ZAP scan findings.
5111
- * Triggered via SQS fan-out from the web-owasp-ingest endpoint after each scan.
5112
- *
5113
- * Setting name: 'secopsTriageConfig'
5114
- */
5115
- const SecopsTriageConfigSchema = z$1.object({
5116
- /** Master kill switch */
5117
- enabled: z$1.boolean().default(false),
5118
- /** GitHub repository to create issues in (e.g. 'owner/repo') */
5119
- githubRepo: z$1.string().default(""),
5120
- /** Minimum ZAP severity level that triggers issue creation */
5121
- severityThreshold: z$1.enum(["critical", "high"]).default("high"),
5122
- /** Map ZAP severity levels to GitHub issue priority labels */
5123
- severityToPriority: z$1.object({
5124
- critical: z$1.enum(["P0", "P1"]).default("P0"),
5125
- high: z$1.enum(["P0", "P1"]).default("P1")
5126
- }).default({
5127
- critical: "P0",
5128
- high: "P1"
5129
- }),
5130
- /** Maximum number of issues to create per scan (sorted by severity, highest first) */
5131
- maxIssuesPerScan: z$1.number({ error: MAX_ISSUES_MESSAGE }).min(1, MAX_ISSUES_MESSAGE).max(100, MAX_ISSUES_MESSAGE).default(20),
5132
- /** Slack workspace ID to use for posting (must match an active workspace in Admin -> Slack Workspaces). Falls back to first active workspace if not set. */
5133
- slackWorkspaceId: z$1.string().optional(),
5134
- /** Slack channel ID to post triage summary to (optional) */
5135
- slackChannelId: z$1.string().optional(),
5136
- /** Enable LLM enrichment: per-finding remediation guidance + overall health assessment */
5137
- llmEnrichment: z$1.boolean().default(false),
5138
- /** LLM model ID to use for enrichment (e.g. 'claude-3-5-haiku-20241022') */
5139
- modelId: z$1.string().optional(),
5140
- /** Log actions without creating real GitHub issues or posting to Slack */
5141
- dryRun: z$1.boolean().default(false)
5142
- }).refine((data) => !data.llmEnrichment || !!data.modelId, {
5143
- message: "A model must be selected when LLM enrichment is enabled",
5144
- path: ["modelId"]
5145
- }).refine((data) => !data.enabled || SECOPS_TRIAGE_REPO_PATTERN.test(data.githubRepo), {
5146
- message: "A repository in owner/name form is required when SecOps triage is enabled",
5147
- path: ["githubRepo"]
5148
- });
5149
5226
  const MODAL_MEDIA_HOST_SUFFIXES = [".amazonaws.com", ".cloudfront.net"];
5150
5227
  const MODAL_MEDIA_URL_MAX_LENGTH = 2048;
5151
5228
  const MODAL_MEDIA_URL_HINT = "Upload the file, or paste an https URL on amazonaws.com or cloudfront.net";
@@ -5533,7 +5610,10 @@ z$1.object({
5533
5610
  groupId: z$1.string(),
5534
5611
  jobs: z$1.array(StudioRenderJobSchema)
5535
5612
  });
5536
- z$1.strictObject({ outputIds: z$1.array(z$1.string().min(1).max(64)).min(1).max(8) });
5613
+ z$1.strictObject({
5614
+ outputIds: z$1.array(z$1.string().min(1).max(64)).min(1).max(8),
5615
+ organization_id: z$1.string().trim().min(1).nullable().optional()
5616
+ });
5537
5617
  const FILE_EMBEDDING_USER_BUDGET_PER_WINDOW_USD_MAX = 1e3;
5538
5618
  /**
5539
5619
  * Embedded tokens a single user may send per window. Metered beside the USD budget because the
@@ -5802,6 +5882,7 @@ z$1.enum([
5802
5882
  "EnableDataLakeDrivePoll",
5803
5883
  "EnableDataLakeGitHub",
5804
5884
  "EnableDataLakeGitHubReconcile",
5885
+ "EnableLakeFollow",
5805
5886
  "EnforceLakeAdmission",
5806
5887
  "EnforceLakeOriginOnIngest",
5807
5888
  "EnableBriefcase",
@@ -6181,7 +6262,6 @@ z$1.enum([
6181
6262
  "ContextVerbatimWindowFraction",
6182
6263
  "CorpusRetrievalMinInlineTokensPerDoc",
6183
6264
  "sreAgentConfig",
6184
- "secopsTriageConfig",
6185
6265
  "apiRateLimitFreePerMin",
6186
6266
  "apiRateLimitBasicPerMin",
6187
6267
  "apiRateLimitProPerMin",
@@ -9251,6 +9331,16 @@ const settingsMap = {
9251
9331
  order: 96,
9252
9332
  dependsOn: "EnableDataLakeGitHub"
9253
9333
  }),
9334
+ EnableLakeFollow: makeBooleanSetting({
9335
+ key: "EnableLakeFollow",
9336
+ name: "Data Lakes: Follow public lakes",
9337
+ defaultValue: false,
9338
+ description: "When on, a public lake appears in a user's lake list and ambient chat retrieval only if they own it, were given access, hold its tag, or follow it. Off by default: every public lake is listed and searched for everyone.",
9339
+ category: "Experimental",
9340
+ group: API_SERVICE_GROUPS.EXPERIMENTAL.id,
9341
+ order: 96,
9342
+ dependsOn: "EnableDataLakes"
9343
+ }),
9254
9344
  EnforceLakeAdmission: makeBooleanSetting({
9255
9345
  key: "EnforceLakeAdmission",
9256
9346
  name: "Data Lakes: Enforce the admission contract",
@@ -9904,6 +9994,7 @@ const settingsMap = {
9904
9994
  }),
9905
9995
  apiRateLimitFreePerMin: makeNumberSetting({
9906
9996
  key: "apiRateLimitFreePerMin",
9997
+ abuseControl: "traffic",
9907
9998
  name: "API Rate Limit — Free (requests/min)",
9908
9999
  defaultValue: 10,
9909
10000
  min: 0,
@@ -9916,6 +10007,7 @@ const settingsMap = {
9916
10007
  }),
9917
10008
  apiRateLimitBasicPerMin: makeNumberSetting({
9918
10009
  key: "apiRateLimitBasicPerMin",
10010
+ abuseControl: "traffic",
9919
10011
  name: "API Rate Limit — Basic (requests/min)",
9920
10012
  defaultValue: 30,
9921
10013
  min: 1,
@@ -9928,6 +10020,7 @@ const settingsMap = {
9928
10020
  }),
9929
10021
  apiRateLimitProPerMin: makeNumberSetting({
9930
10022
  key: "apiRateLimitProPerMin",
10023
+ abuseControl: "traffic",
9931
10024
  name: "API Rate Limit — Pro (requests/min)",
9932
10025
  defaultValue: 60,
9933
10026
  min: 1,
@@ -9940,6 +10033,7 @@ const settingsMap = {
9940
10033
  }),
9941
10034
  apiRateLimitCreditsPerMin: makeNumberSetting({
9942
10035
  key: "apiRateLimitCreditsPerMin",
10036
+ abuseControl: "traffic",
9943
10037
  name: "API Rate Limit - Credit Balance Reads (requests/min per key)",
9944
10038
  defaultValue: 0,
9945
10039
  min: 0,
@@ -9952,6 +10046,7 @@ const settingsMap = {
9952
10046
  }),
9953
10047
  apiRateLimitDefaultWritePerMin: makeNumberSetting({
9954
10048
  key: "apiRateLimitDefaultWritePerMin",
10049
+ abuseControl: "traffic",
9955
10050
  name: "Default Write Rate Limit (writes/min per user)",
9956
10051
  defaultValue: 120,
9957
10052
  min: 1,
@@ -9964,6 +10059,7 @@ const settingsMap = {
9964
10059
  }),
9965
10060
  apiRateLimitDefaultWriteMode: makeStringSetting({
9966
10061
  key: "apiRateLimitDefaultWriteMode",
10062
+ abuseControl: "traffic",
9967
10063
  name: "Default Write Rate Limit Mode",
9968
10064
  defaultValue: "log",
9969
10065
  description: "\"log\": writes over the cap are allowed and logged, to measure real usage before enforcing. \"enforce\": writes over the cap get 429 Too Many Requests. \"off\": not counted at all. Changes apply within 15 seconds.",
@@ -10080,6 +10176,7 @@ const settingsMap = {
10080
10176
  }),
10081
10177
  oauthAbuseAutoBlockEnabled: makeBooleanSetting({
10082
10178
  key: "oauthAbuseAutoBlockEnabled",
10179
+ abuseControl: "traffic",
10083
10180
  name: "OAuth Abuse Auto-Block",
10084
10181
  defaultValue: true,
10085
10182
  description: "Automatically block IPs whose failed OAuth sign-ins reach the threshold within the window.",
@@ -10089,6 +10186,7 @@ const settingsMap = {
10089
10186
  }),
10090
10187
  oauthAbuseAttemptThreshold: makeNumberSetting({
10091
10188
  key: "oauthAbuseAttemptThreshold",
10189
+ abuseControl: "traffic",
10092
10190
  name: "OAuth Abuse Attempt Threshold",
10093
10191
  defaultValue: 20,
10094
10192
  min: 1,
@@ -10100,6 +10198,7 @@ const settingsMap = {
10100
10198
  }),
10101
10199
  oauthAbuseWindowMinutes: makeNumberSetting({
10102
10200
  key: "oauthAbuseWindowMinutes",
10201
+ abuseControl: "traffic",
10103
10202
  name: "OAuth Abuse Window (minutes)",
10104
10203
  defaultValue: 10,
10105
10204
  min: 1,
@@ -10112,6 +10211,7 @@ const settingsMap = {
10112
10211
  }),
10113
10212
  oauthAbuseBlockEscalationMinutes: withSchema(makeStringSetting({
10114
10213
  key: "oauthAbuseBlockEscalationMinutes",
10214
+ abuseControl: "traffic",
10115
10215
  name: "OAuth Abuse Block Escalation (minutes)",
10116
10216
  defaultValue: "10,60,1440",
10117
10217
  description: "Comma-separated block durations in minutes. Each repeat block of the same IP within the lookback moves one step up; the last step repeats.",
@@ -10121,6 +10221,7 @@ const settingsMap = {
10121
10221
  }), z$1.string().refine(isEscalationScheduleOrBlank, { message: "Use comma-separated positive whole minutes with valid expiry dates, e.g. 10,60,1440" })),
10122
10222
  oauthAbuseLookbackHours: makeNumberSetting({
10123
10223
  key: "oauthAbuseLookbackHours",
10224
+ abuseControl: "traffic",
10124
10225
  name: "OAuth Abuse Escalation Lookback (hours)",
10125
10226
  defaultValue: 24,
10126
10227
  min: 1,
@@ -10133,6 +10234,7 @@ const settingsMap = {
10133
10234
  }),
10134
10235
  oauthRateLimitPerIp: makeNumberSetting({
10135
10236
  key: "oauthRateLimitPerIp",
10237
+ abuseControl: "traffic",
10136
10238
  name: "OAuth Rate Limit (requests per IP)",
10137
10239
  defaultValue: 40,
10138
10240
  min: 1,
@@ -10144,6 +10246,7 @@ const settingsMap = {
10144
10246
  }),
10145
10247
  oauthRateLimitWindowMinutes: makeNumberSetting({
10146
10248
  key: "oauthRateLimitWindowMinutes",
10249
+ abuseControl: "traffic",
10147
10250
  name: "OAuth Rate Limit Window (minutes)",
10148
10251
  defaultValue: 10,
10149
10252
  min: 1,
@@ -10874,6 +10977,7 @@ const settingsMap = {
10874
10977
  }),
10875
10978
  allowOpenRegistration: makeBooleanSetting({
10876
10979
  key: "allowOpenRegistration",
10980
+ abuseControl: "signup",
10877
10981
  name: "Allow Open Registration",
10878
10982
  defaultValue: false,
10879
10983
  description: "Master switch for self-serve signup. When OFF (default), a valid invite code is required to register. When ON, users may register without an invite code; the signup grant (Signup Grant Initial Credits) is then released after they verify their email (anti-spam). Safe to enable: the pre-request credit reservation caps every free user at the credits they are granted.",
@@ -10881,6 +10985,7 @@ const settingsMap = {
10881
10985
  }),
10882
10986
  apiKeyTrustGateEnabled: makeBooleanSetting({
10883
10987
  key: "apiKeyTrustGateEnabled",
10988
+ abuseControl: "traffic",
10884
10989
  name: "API Key Trust Gate",
10885
10990
  defaultValue: true,
10886
10991
  description: "Restricts personal API key creation for untrusted accounts: an unverified email cannot mint keys, and a verified account that has not purchased, is younger than the minimum age and is not admin-approved is limited to the untrusted key cap. The same trust check blocks untrusted accounts from outbound actions (email send, invites, tools, agent helpers, publishing). Off restores unrestricted minting and lifts the untrusted rate limit and outbound block (moderated accounts stay blocked). Changes reach running servers within about 5 minutes (settings cache).",
@@ -10890,6 +10995,7 @@ const settingsMap = {
10890
10995
  }),
10891
10996
  apiKeyMinAccountAgeDays: makeNumberSetting({
10892
10997
  key: "apiKeyMinAccountAgeDays",
10998
+ abuseControl: "traffic",
10893
10999
  name: "API Key Trust: Minimum Account Age (days)",
10894
11000
  defaultValue: 7,
10895
11001
  min: 0,
@@ -10903,6 +11009,7 @@ const settingsMap = {
10903
11009
  }),
10904
11010
  apiKeyAccountAgeTrustsKeys: makeBooleanSetting({
10905
11011
  key: "apiKeyAccountAgeTrustsKeys",
11012
+ abuseControl: "traffic",
10906
11013
  name: "API Key Trust: Account Age Lifts Key Limits",
10907
11014
  defaultValue: true,
10908
11015
  description: "On (default): an account older than the minimum age is trusted for API keys, so the untrusted key cap, rate limits and quotas stop applying to it. Off: only a purchase, an active plan or admin approval lifts them, at any account age. Account age still unlocks outbound actions either way.",
@@ -10913,6 +11020,7 @@ const settingsMap = {
10913
11020
  }),
10914
11021
  maxActiveKeysUntrusted: makeNumberSetting({
10915
11022
  key: "maxActiveKeysUntrusted",
11023
+ abuseControl: "traffic",
10916
11024
  name: "API Key Trust: Max Active Keys (untrusted)",
10917
11025
  defaultValue: 1,
10918
11026
  min: 0,
@@ -10926,6 +11034,7 @@ const settingsMap = {
10926
11034
  }),
10927
11035
  apiKeyUntrustedRateLimitPerMin: makeNumberSetting({
10928
11036
  key: "apiKeyUntrustedRateLimitPerMin",
11037
+ abuseControl: "traffic",
10929
11038
  name: "API Key Trust: Untrusted Rate Limit (requests/min)",
10930
11039
  defaultValue: 20,
10931
11040
  min: 1,
@@ -10939,6 +11048,7 @@ const settingsMap = {
10939
11048
  }),
10940
11049
  apiKeyUntrustedRequestsPerDay: makeNumberSetting({
10941
11050
  key: "apiKeyUntrustedRequestsPerDay",
11051
+ abuseControl: "traffic",
10942
11052
  name: "API Key Trust: Untrusted Daily Limit (requests/day)",
10943
11053
  defaultValue: 0,
10944
11054
  min: 0,
@@ -10952,6 +11062,7 @@ const settingsMap = {
10952
11062
  }),
10953
11063
  apiKeyUntrustedTokensPerMin: makeNumberSetting({
10954
11064
  key: "apiKeyUntrustedTokensPerMin",
11065
+ abuseControl: "traffic",
10955
11066
  name: "API Key Trust: Untrusted Token Rate (tokens/min)",
10956
11067
  defaultValue: 0,
10957
11068
  min: 0,
@@ -10965,6 +11076,7 @@ const settingsMap = {
10965
11076
  }),
10966
11077
  apiKeyUntrustedMaxConcurrent: makeNumberSetting({
10967
11078
  key: "apiKeyUntrustedMaxConcurrent",
11079
+ abuseControl: "traffic",
10968
11080
  name: "API Key Trust: Untrusted Concurrent Completions",
10969
11081
  defaultValue: 0,
10970
11082
  min: 0,
@@ -11007,6 +11119,7 @@ const settingsMap = {
11007
11119
  }),
11008
11120
  abuseAssessmentEnabled: makeBooleanSetting({
11009
11121
  key: "abuseAssessmentEnabled",
11122
+ abuseControl: "traffic",
11010
11123
  name: "Advisory Abuse Assessment",
11011
11124
  defaultValue: false,
11012
11125
  description: "Lets a Decisions model add an advisory judgment (abuse, legitimate automation or insufficient evidence) to shadow detections, from a pseudonymous summary of counts and flags. Paid from the platform key and budget, never from the assessed account. Advisory only: it never changes an account, its access, its credits or its review state. Off means no provider calls.",
@@ -11027,6 +11140,7 @@ const settingsMap = {
11027
11140
  }),
11028
11141
  autoContainmentConfig: makeObjectSetting({
11029
11142
  key: "autoContainmentConfig",
11143
+ abuseControl: "traffic",
11030
11144
  name: "Automated Containment from Abuse Assessments",
11031
11145
  defaultValue: AutoContainmentConfigSchema.parse({}),
11032
11146
  description: "What happens when an abuse assessment judges a detection as abuse at or above minConfidence (0.5-1). mode: off (nothing), shadow (records the decision for grading against the detection's admin verdict and changes no account; the default) or enforce (contains the accounts through the bulk Contain path: suspended, Stripe subscriptions canceled, positive balance removed, API keys revoked, sessions ended, attributed to the system with the evidence as the reason). Unsuspend on the user profile reverses the suspension; revoked keys stay revoked and a removed balance is not restored. maxPerHour caps decisions per hour, counted per mode (over it, the decision is recorded as capped and re-evaluated after the hour); maxAccountsPerDetection sends larger detections to an admin; blockEmailDomains also blocks the accounts' owned email domains, which refuses every new signup on that domain, so one false positive on a shared corporate or campus network blocks the whole domain (leave it off until shadow precision is known); strongLinkWindowHours assesses a new account at once when it signed up from the same IP as a blocked account within that many hours (0 turns the rule off); deviceLinkWindowHours does the same for a new account used from the same device (screen size, pixel ratio and browser) as a banned account, when the device is uncommon (seen on fewer than deviceLinkCommonNetworks networks in 30 days) and one more signal agrees: the same residential signup network, the same uncommon TLS fingerprint, or signups within that many hours (0 turns the rule off; abuse assessments still show device-link evidence, at the default window). Needs the advisory assessment on.",
@@ -11108,6 +11222,7 @@ const settingsMap = {
11108
11222
  }),
11109
11223
  otcLimitSendPerEmailPerIp: makeNumberSetting({
11110
11224
  key: "otcLimitSendPerEmailPerIp",
11225
+ abuseControl: "traffic",
11111
11226
  name: "Sign-in Codes: Send: Per Inbox per IP (per 15 min)",
11112
11227
  defaultValue: 0,
11113
11228
  min: 0,
@@ -11120,6 +11235,7 @@ const settingsMap = {
11120
11235
  }),
11121
11236
  otcLimitSendPerEmailPerIpDaily: makeNumberSetting({
11122
11237
  key: "otcLimitSendPerEmailPerIpDaily",
11238
+ abuseControl: "traffic",
11123
11239
  name: "Sign-in Codes: Send: Per Inbox per IP (per day)",
11124
11240
  defaultValue: 0,
11125
11241
  min: 0,
@@ -11132,6 +11248,7 @@ const settingsMap = {
11132
11248
  }),
11133
11249
  otcLimitSendPerEmail: makeNumberSetting({
11134
11250
  key: "otcLimitSendPerEmail",
11251
+ abuseControl: "traffic",
11135
11252
  name: "Sign-in Codes: Send: Per Inbox (per 15 min)",
11136
11253
  defaultValue: 0,
11137
11254
  min: 0,
@@ -11144,6 +11261,7 @@ const settingsMap = {
11144
11261
  }),
11145
11262
  otcLimitSendPerEmailDaily: makeNumberSetting({
11146
11263
  key: "otcLimitSendPerEmailDaily",
11264
+ abuseControl: "traffic",
11147
11265
  name: "Sign-in Codes: Send: Per Inbox Before Challenge (per day)",
11148
11266
  defaultValue: 0,
11149
11267
  min: 0,
@@ -11156,6 +11274,7 @@ const settingsMap = {
11156
11274
  }),
11157
11275
  otcLimitSendGlobalHourly: makeNumberSetting({
11158
11276
  key: "otcLimitSendGlobalHourly",
11277
+ abuseControl: "traffic",
11159
11278
  name: "Sign-in Codes: Send: All Inboxes Before Challenge (per hour)",
11160
11279
  defaultValue: 0,
11161
11280
  min: 0,
@@ -11168,6 +11287,7 @@ const settingsMap = {
11168
11287
  }),
11169
11288
  otcLimitRegisterPerDomainHourly: makeNumberSetting({
11170
11289
  key: "otcLimitRegisterPerDomainHourly",
11290
+ abuseControl: "traffic",
11171
11291
  name: "Sign-in Codes: New Accounts per Domain (per hour)",
11172
11292
  defaultValue: 0,
11173
11293
  min: 0,
@@ -11180,6 +11300,7 @@ const settingsMap = {
11180
11300
  }),
11181
11301
  otcLimitRegisterPerDomainDaily: makeNumberSetting({
11182
11302
  key: "otcLimitRegisterPerDomainDaily",
11303
+ abuseControl: "traffic",
11183
11304
  name: "Sign-in Codes: New Accounts per Domain (per day)",
11184
11305
  defaultValue: 0,
11185
11306
  min: 0,
@@ -11192,6 +11313,7 @@ const settingsMap = {
11192
11313
  }),
11193
11314
  otcLimitSendPerIpDistinctEmails: makeNumberSetting({
11194
11315
  key: "otcLimitSendPerIpDistinctEmails",
11316
+ abuseControl: "traffic",
11195
11317
  name: "Sign-in Codes: Send: Distinct Inboxes per IP (per 15 min)",
11196
11318
  defaultValue: 0,
11197
11319
  min: 0,
@@ -11204,6 +11326,7 @@ const settingsMap = {
11204
11326
  }),
11205
11327
  otcLimitSendPerIpTotal: makeNumberSetting({
11206
11328
  key: "otcLimitSendPerIpTotal",
11329
+ abuseControl: "traffic",
11207
11330
  name: "Sign-in Codes: Send: Per IP (per 15 min)",
11208
11331
  defaultValue: 0,
11209
11332
  min: 0,
@@ -11216,6 +11339,7 @@ const settingsMap = {
11216
11339
  }),
11217
11340
  otcLimitSendPerIpDaily: makeNumberSetting({
11218
11341
  key: "otcLimitSendPerIpDaily",
11342
+ abuseControl: "traffic",
11219
11343
  name: "Sign-in Codes: Send: Per IP (per day)",
11220
11344
  defaultValue: 0,
11221
11345
  min: 0,
@@ -11228,6 +11352,7 @@ const settingsMap = {
11228
11352
  }),
11229
11353
  otcLimitVerifyPerEmailPerIp: makeNumberSetting({
11230
11354
  key: "otcLimitVerifyPerEmailPerIp",
11355
+ abuseControl: "traffic",
11231
11356
  name: "Sign-in Codes: Verify: Wrong Guesses per Address per IP (per 15 min)",
11232
11357
  defaultValue: 0,
11233
11358
  min: 0,
@@ -11240,6 +11365,7 @@ const settingsMap = {
11240
11365
  }),
11241
11366
  otcLimitVerifyPerIp: makeNumberSetting({
11242
11367
  key: "otcLimitVerifyPerIp",
11368
+ abuseControl: "traffic",
11243
11369
  name: "Sign-in Codes: Verify: Per IP (per 15 min)",
11244
11370
  defaultValue: 0,
11245
11371
  min: 0,
@@ -11252,6 +11378,7 @@ const settingsMap = {
11252
11378
  }),
11253
11379
  otcLimitFormTokenPerIp: makeNumberSetting({
11254
11380
  key: "otcLimitFormTokenPerIp",
11381
+ abuseControl: "traffic",
11255
11382
  name: "Sign-in Codes: Form Token: Per IP (per hour)",
11256
11383
  defaultValue: 0,
11257
11384
  min: 0,
@@ -11264,6 +11391,7 @@ const settingsMap = {
11264
11391
  }),
11265
11392
  subscriberLimitPerIp: makeNumberSetting({
11266
11393
  key: "subscriberLimitPerIp",
11394
+ abuseControl: "traffic",
11267
11395
  name: "Subscribers: Per IP (per 15 min)",
11268
11396
  defaultValue: 0,
11269
11397
  min: 0,
@@ -11276,6 +11404,7 @@ const settingsMap = {
11276
11404
  }),
11277
11405
  subscriberLimitPerIpDaily: makeNumberSetting({
11278
11406
  key: "subscriberLimitPerIpDaily",
11407
+ abuseControl: "traffic",
11279
11408
  name: "Subscribers: Per IP (per day)",
11280
11409
  defaultValue: 0,
11281
11410
  min: 0,
@@ -11288,6 +11417,7 @@ const settingsMap = {
11288
11417
  }),
11289
11418
  subscriberLimitSlackAlertsPerHour: makeNumberSetting({
11290
11419
  key: "subscriberLimitSlackAlertsPerHour",
11420
+ abuseControl: "traffic",
11291
11421
  name: "Subscribers: Slack alerts per hour",
11292
11422
  defaultValue: 0,
11293
11423
  min: 0,
@@ -11300,6 +11430,7 @@ const settingsMap = {
11300
11430
  }),
11301
11431
  blockDisposableEmails: makeBooleanSetting({
11302
11432
  key: "blockDisposableEmails",
11433
+ abuseControl: "signup",
11303
11434
  name: "Block Disposable Emails",
11304
11435
  defaultValue: true,
11305
11436
  description: "Rejects new registrations whose email domain (or any parent domain) is a known disposable/burner provider — free credits cannot be farmed with throwaway inboxes (#9779). Applies at registration only; existing accounts on such domains can still sign in. Turn OFF only to work around a false positive.",
@@ -11308,6 +11439,7 @@ const settingsMap = {
11308
11439
  }),
11309
11440
  blockedEmailDomains: makeObjectSetting({
11310
11441
  key: "blockedEmailDomains",
11442
+ abuseControl: "signup",
11311
11443
  name: "Blocked Email Domains",
11312
11444
  defaultValue: [],
11313
11445
  description: "Email domains blocked from signup credits, one per line, on top of the built-in disposable list. A domain also blocks every subdomain (kashre.com blocks x@np.kashre.com). Applies even when Block Disposable Emails is OFF. Registration is refused; OAuth signup and email change still create the account but withhold the free-credit grant, and the OAuth starting-grant backfill skips these users. Existing accounts can still sign in. Bare public suffixes (co.uk, github.io) are refused. Enter internationalized domains in punycode (xn--...); a Unicode-domain email is not matched against them.",
@@ -11317,6 +11449,7 @@ const settingsMap = {
11317
11449
  }),
11318
11450
  signupGrantSignupPoolDaily: makeNumberSetting({
11319
11451
  key: "signupGrantSignupPoolDaily",
11452
+ abuseControl: "signup",
11320
11453
  name: "Signup Pool (credits per day)",
11321
11454
  defaultValue: 0,
11322
11455
  min: 0,
@@ -11326,6 +11459,7 @@ const settingsMap = {
11326
11459
  }),
11327
11460
  signupGrantTricklePoolDaily: makeNumberSetting({
11328
11461
  key: "signupGrantTricklePoolDaily",
11462
+ abuseControl: "signup",
11329
11463
  name: "Trickle Pool (credits per day)",
11330
11464
  defaultValue: 0,
11331
11465
  min: 0,
@@ -11335,6 +11469,7 @@ const settingsMap = {
11335
11469
  }),
11336
11470
  signupGrantRiskPolicy: makeObjectSetting({
11337
11471
  key: "signupGrantRiskPolicy",
11472
+ abuseControl: "signup",
11338
11473
  name: "Signup Grant Assessment Policy",
11339
11474
  defaultValue: { enabled: false },
11340
11475
  schema: z$1.record(z$1.string(), z$1.unknown()),
@@ -11344,6 +11479,7 @@ const settingsMap = {
11344
11479
  }),
11345
11480
  signupGrantUnprotectedMaxCredits: makeNumberSetting({
11346
11481
  key: "signupGrantUnprotectedMaxCredits",
11482
+ abuseControl: "signup",
11347
11483
  name: "Unprotected Signup Grant Limit (credits)",
11348
11484
  defaultValue: 1e3,
11349
11485
  min: 0,
@@ -11424,6 +11560,7 @@ const settingsMap = {
11424
11560
  }),
11425
11561
  maxSignupsPerIpPerDay: makeNumberSetting({
11426
11562
  key: "maxSignupsPerIpPerDay",
11563
+ abuseControl: "signup",
11427
11564
  name: "Max Signups per IP per Day",
11428
11565
  defaultValue: 0,
11429
11566
  min: 0,
@@ -11435,6 +11572,7 @@ const settingsMap = {
11435
11572
  }),
11436
11573
  maxSignupsPerAsnPerHour: makeNumberSetting({
11437
11574
  key: "maxSignupsPerAsnPerHour",
11575
+ abuseControl: "signup",
11438
11576
  name: "Max Signups per Network (ASN) per Hour",
11439
11577
  defaultValue: 0,
11440
11578
  min: 0,
@@ -11519,6 +11657,7 @@ const settingsMap = {
11519
11657
  }),
11520
11658
  freeTierDailySpendCapCredits: makeNumberSetting({
11521
11659
  key: "freeTierDailySpendCapCredits",
11660
+ abuseControl: "spend",
11522
11661
  name: "Free Tier Daily Spend Cap",
11523
11662
  defaultValue: 200,
11524
11663
  int: true,
@@ -11528,6 +11667,7 @@ const settingsMap = {
11528
11667
  }),
11529
11668
  freeTierDay1SpendCapCredits: makeNumberSetting({
11530
11669
  key: "freeTierDay1SpendCapCredits",
11670
+ abuseControl: "spend",
11531
11671
  name: "Free Tier Day-1 Spend Cap",
11532
11672
  defaultValue: 500,
11533
11673
  int: true,
@@ -11537,6 +11677,7 @@ const settingsMap = {
11537
11677
  }),
11538
11678
  freeTierDays2To7SpendCapCredits: makeNumberSetting({
11539
11679
  key: "freeTierDays2To7SpendCapCredits",
11680
+ abuseControl: "spend",
11540
11681
  name: "Free Tier Days 2-7 Spend Cap",
11541
11682
  defaultValue: 300,
11542
11683
  int: true,
@@ -11546,6 +11687,7 @@ const settingsMap = {
11546
11687
  }),
11547
11688
  newAccountSpendCapDays: makeNumberSetting({
11548
11689
  key: "newAccountSpendCapDays",
11690
+ abuseControl: "spend",
11549
11691
  name: "New Account Spend Cap - Account Age (days)",
11550
11692
  defaultValue: 7,
11551
11693
  int: true,
@@ -11557,6 +11699,7 @@ const settingsMap = {
11557
11699
  }),
11558
11700
  newAccountHourlySpendCapCredits: makeNumberSetting({
11559
11701
  key: "newAccountHourlySpendCapCredits",
11702
+ abuseControl: "spend",
11560
11703
  name: "New Account Spend Cap - Credits per Hour",
11561
11704
  defaultValue: 1e4,
11562
11705
  int: true,
@@ -11567,6 +11710,7 @@ const settingsMap = {
11567
11710
  }),
11568
11711
  newAccountDailySpendCapCredits: makeNumberSetting({
11569
11712
  key: "newAccountDailySpendCapCredits",
11713
+ abuseControl: "spend",
11570
11714
  name: "New Account Spend Cap - Credits per Day",
11571
11715
  defaultValue: 25e3,
11572
11716
  int: true,
@@ -11577,6 +11721,7 @@ const settingsMap = {
11577
11721
  }),
11578
11722
  paidCompletionOverdraftCredits: makeNumberSetting({
11579
11723
  key: "paidCompletionOverdraftCredits",
11724
+ abuseControl: "spend",
11580
11725
  name: "Paid Completion Overdraft Allowance (credits)",
11581
11726
  defaultValue: 500,
11582
11727
  int: true,
@@ -11587,6 +11732,7 @@ const settingsMap = {
11587
11732
  }),
11588
11733
  spendMonitorEnabled: makeBooleanSetting({
11589
11734
  key: "spendMonitorEnabled",
11735
+ abuseControl: "spend",
11590
11736
  name: "Spend Monitor: Enabled",
11591
11737
  defaultValue: true,
11592
11738
  description: "Run the 5-minute credit spend detector. OFF stops detection and alerting; rollups are no longer written either.",
@@ -11595,6 +11741,7 @@ const settingsMap = {
11595
11741
  }),
11596
11742
  spendMonitorSlackEnabled: makeBooleanSetting({
11597
11743
  key: "spendMonitorSlackEnabled",
11744
+ abuseControl: "spend",
11598
11745
  name: "Spend Monitor: Post Alerts to Slack",
11599
11746
  defaultValue: false,
11600
11747
  description: "Post spend alerts to the alarms channel. OFF (default) records alerts silently so a new deployment can be watched before anyone is paged.",
@@ -11603,6 +11750,7 @@ const settingsMap = {
11603
11750
  }),
11604
11751
  spendMonitorPlatformSpikeRatio: makeNumberSetting({
11605
11752
  key: "spendMonitorPlatformSpikeRatio",
11753
+ abuseControl: "spend",
11606
11754
  name: "Spend Monitor: Platform Spike Ratio",
11607
11755
  defaultValue: 3,
11608
11756
  int: false,
@@ -11613,6 +11761,7 @@ const settingsMap = {
11613
11761
  }),
11614
11762
  spendMonitorPlatformCriticalRatio: makeNumberSetting({
11615
11763
  key: "spendMonitorPlatformCriticalRatio",
11764
+ abuseControl: "spend",
11616
11765
  name: "Spend Monitor: Platform Critical Ratio",
11617
11766
  defaultValue: 6,
11618
11767
  int: false,
@@ -11633,6 +11782,7 @@ const settingsMap = {
11633
11782
  }),
11634
11783
  spendMonitorPlatformSpikeFloorCredits: makeNumberSetting({
11635
11784
  key: "spendMonitorPlatformSpikeFloorCredits",
11785
+ abuseControl: "spend",
11636
11786
  name: "Spend Monitor: Platform Spike Floor",
11637
11787
  defaultValue: 5e3,
11638
11788
  int: true,
@@ -11643,6 +11793,7 @@ const settingsMap = {
11643
11793
  }),
11644
11794
  spendMonitorPlatformCostFloorUsd: makeNumberSetting({
11645
11795
  key: "spendMonitorPlatformCostFloorUsd",
11796
+ abuseControl: "spend",
11646
11797
  name: "Spend Monitor: Platform Cost Floor",
11647
11798
  defaultValue: 20,
11648
11799
  int: true,
@@ -11653,6 +11804,7 @@ const settingsMap = {
11653
11804
  }),
11654
11805
  spendMonitorAccountSpikeRatio: makeNumberSetting({
11655
11806
  key: "spendMonitorAccountSpikeRatio",
11807
+ abuseControl: "spend",
11656
11808
  name: "Spend Monitor: Account Spike Ratio",
11657
11809
  defaultValue: 10,
11658
11810
  int: false,
@@ -11663,6 +11815,7 @@ const settingsMap = {
11663
11815
  }),
11664
11816
  spendMonitorAccountSpikeFloorCredits: makeNumberSetting({
11665
11817
  key: "spendMonitorAccountSpikeFloorCredits",
11818
+ abuseControl: "spend",
11666
11819
  name: "Spend Monitor: Account Spike Floor",
11667
11820
  defaultValue: 1e3,
11668
11821
  int: true,
@@ -11673,6 +11826,7 @@ const settingsMap = {
11673
11826
  }),
11674
11827
  spendMonitorAccountCeilingCredits: makeNumberSetting({
11675
11828
  key: "spendMonitorAccountCeilingCredits",
11829
+ abuseControl: "spend",
11676
11830
  name: "Spend Monitor: Account Ceiling",
11677
11831
  defaultValue: 5e3,
11678
11832
  int: true,
@@ -11683,6 +11837,7 @@ const settingsMap = {
11683
11837
  }),
11684
11838
  spendMonitorPaidAccountSpikeFloorCredits: makeNumberSetting({
11685
11839
  key: "spendMonitorPaidAccountSpikeFloorCredits",
11840
+ abuseControl: "spend",
11686
11841
  name: "Spend Monitor: Paid Account Spike Floor",
11687
11842
  defaultValue: 2e4,
11688
11843
  int: true,
@@ -11693,6 +11848,7 @@ const settingsMap = {
11693
11848
  }),
11694
11849
  spendMonitorPaidAccountCeilingCredits: makeNumberSetting({
11695
11850
  key: "spendMonitorPaidAccountCeilingCredits",
11851
+ abuseControl: "spend",
11696
11852
  name: "Spend Monitor: Paid Account Ceiling",
11697
11853
  defaultValue: 4e4,
11698
11854
  int: true,
@@ -11703,6 +11859,7 @@ const settingsMap = {
11703
11859
  }),
11704
11860
  spendMonitorPaidAccountMinAgeDays: makeNumberSetting({
11705
11861
  key: "spendMonitorPaidAccountMinAgeDays",
11862
+ abuseControl: "spend",
11706
11863
  name: "Spend Monitor: Paid Account Minimum Age",
11707
11864
  defaultValue: 7,
11708
11865
  int: true,
@@ -11713,6 +11870,7 @@ const settingsMap = {
11713
11870
  }),
11714
11871
  spendMonitorTrustedEmailDomains: makeStringSetting({
11715
11872
  key: "spendMonitorTrustedEmailDomains",
11873
+ abuseControl: "spend",
11716
11874
  name: "Spend Monitor: Trusted Email Domains",
11717
11875
  defaultValue: "",
11718
11876
  description: "Comma-separated email domains. A user whose email is verified and whose domain (the part after the last @) exactly equals one of these is held to the trusted-account thresholds below instead of the standard ones. Subdomains are not covered: list each one. Organizations are never trusted by their members' domains; list them under Trusted Account IDs. Empty (default) trusts no domain.",
@@ -11721,6 +11879,7 @@ const settingsMap = {
11721
11879
  }),
11722
11880
  spendMonitorTrustedAccountIds: makeStringSetting({
11723
11881
  key: "spendMonitorTrustedAccountIds",
11882
+ abuseControl: "spend",
11724
11883
  name: "Spend Monitor: Trusted Account IDs",
11725
11884
  defaultValue: "",
11726
11885
  description: "Comma-separated user or organization IDs held to the trusted-account thresholds below, for partner and client accounts with known heavy usage. API keys and agents follow the account that pays for them. Empty (default) trusts no account by ID.",
@@ -11729,6 +11888,7 @@ const settingsMap = {
11729
11888
  }),
11730
11889
  spendMonitorTrustedAccountSpikeFloorCredits: makeNumberSetting({
11731
11890
  key: "spendMonitorTrustedAccountSpikeFloorCredits",
11891
+ abuseControl: "spend",
11732
11892
  name: "Spend Monitor: Trusted Account Spike Floor",
11733
11893
  defaultValue: 2e4,
11734
11894
  int: true,
@@ -11739,6 +11899,7 @@ const settingsMap = {
11739
11899
  }),
11740
11900
  spendMonitorTrustedAccountCeilingCredits: makeNumberSetting({
11741
11901
  key: "spendMonitorTrustedAccountCeilingCredits",
11902
+ abuseControl: "spend",
11742
11903
  name: "Spend Monitor: Trusted Account Ceiling",
11743
11904
  defaultValue: 4e4,
11744
11905
  int: true,
@@ -11749,6 +11910,7 @@ const settingsMap = {
11749
11910
  }),
11750
11911
  spendMonitorMarginEnabled: makeBooleanSetting({
11751
11912
  key: "spendMonitorMarginEnabled",
11913
+ abuseControl: "spend",
11752
11914
  name: "Spend Monitor: Model Margin Check",
11753
11915
  defaultValue: true,
11754
11916
  description: "Once a day, shortly after 00:00 UTC and only while Spend Monitor is enabled, flag any model whose credits charged, converted to USD at the lowest per-credit price, fall below its provider cost over the margin window. Posts follow \"Post Alerts to Slack\".",
@@ -11757,6 +11919,7 @@ const settingsMap = {
11757
11919
  }),
11758
11920
  spendMonitorMarginMinRatio: makeNumberSetting({
11759
11921
  key: "spendMonitorMarginMinRatio",
11922
+ abuseControl: "spend",
11760
11923
  name: "Spend Monitor: Model Margin Min Ratio",
11761
11924
  defaultValue: 1,
11762
11925
  int: false,
@@ -11768,6 +11931,7 @@ const settingsMap = {
11768
11931
  }),
11769
11932
  spendMonitorMarginWindowHours: makeNumberSetting({
11770
11933
  key: "spendMonitorMarginWindowHours",
11934
+ abuseControl: "spend",
11771
11935
  name: "Spend Monitor: Model Margin Window",
11772
11936
  defaultValue: 24,
11773
11937
  int: true,
@@ -11779,6 +11943,7 @@ const settingsMap = {
11779
11943
  }),
11780
11944
  spendMonitorMarginCostFloorUsd: makeNumberSetting({
11781
11945
  key: "spendMonitorMarginCostFloorUsd",
11946
+ abuseControl: "spend",
11782
11947
  name: "Spend Monitor: Model Margin Cost Floor",
11783
11948
  defaultValue: 5,
11784
11949
  int: true,
@@ -11789,6 +11954,7 @@ const settingsMap = {
11789
11954
  }),
11790
11955
  spendMonitorAutoPauseMode: makeStringSetting({
11791
11956
  key: "spendMonitorAutoPauseMode",
11957
+ abuseControl: "spend",
11792
11958
  name: "Spend Monitor: Automatic Pause Mode",
11793
11959
  defaultValue: "shadow",
11794
11960
  options: [...SPEND_AUTO_PAUSE_MODES],
@@ -11798,6 +11964,7 @@ const settingsMap = {
11798
11964
  }),
11799
11965
  spendMonitorAutoPauseStandardMinCredits: makeNumberSetting({
11800
11966
  key: "spendMonitorAutoPauseStandardMinCredits",
11967
+ abuseControl: "spend",
11801
11968
  name: "Spend Monitor: Automatic Pause Threshold (Standard)",
11802
11969
  defaultValue: 1e4,
11803
11970
  int: true,
@@ -11808,6 +11975,7 @@ const settingsMap = {
11808
11975
  }),
11809
11976
  spendMonitorAutoPausePaidMinCredits: makeNumberSetting({
11810
11977
  key: "spendMonitorAutoPausePaidMinCredits",
11978
+ abuseControl: "spend",
11811
11979
  name: "Spend Monitor: Automatic Pause Threshold (Paid)",
11812
11980
  defaultValue: 0,
11813
11981
  int: true,
@@ -11818,6 +11986,7 @@ const settingsMap = {
11818
11986
  }),
11819
11987
  spendMonitorAutoPauseTrustedMinCredits: makeNumberSetting({
11820
11988
  key: "spendMonitorAutoPauseTrustedMinCredits",
11989
+ abuseControl: "spend",
11821
11990
  name: "Spend Monitor: Automatic Pause Threshold (Trusted)",
11822
11991
  defaultValue: 0,
11823
11992
  int: true,
@@ -11828,6 +11997,7 @@ const settingsMap = {
11828
11997
  }),
11829
11998
  youngAccountSpendPageUsdPerHour: makeNumberSetting({
11830
11999
  key: "youngAccountSpendPageUsdPerHour",
12000
+ abuseControl: "spend",
11831
12001
  name: "Young-Account Spend Alarm: Page Ceiling (USD)",
11832
12002
  defaultValue: 0,
11833
12003
  min: 0,
@@ -11837,6 +12007,7 @@ const settingsMap = {
11837
12007
  }),
11838
12008
  youngAccountSpendWarnUsdPerHour: makeNumberSetting({
11839
12009
  key: "youngAccountSpendWarnUsdPerHour",
12010
+ abuseControl: "spend",
11840
12011
  name: "Young-Account Spend Alarm: Warn Ceiling (USD)",
11841
12012
  defaultValue: 0,
11842
12013
  min: 0,
@@ -11846,6 +12017,7 @@ const settingsMap = {
11846
12017
  }),
11847
12018
  providerSpendOpenaiUsdPerHour: makeNumberSetting({
11848
12019
  key: "providerSpendOpenaiUsdPerHour",
12020
+ abuseControl: "spend",
11849
12021
  name: "Provider Spend Alarm: OpenAI Hourly Ceiling (USD)",
11850
12022
  defaultValue: 0,
11851
12023
  min: 0,
@@ -11855,6 +12027,7 @@ const settingsMap = {
11855
12027
  }),
11856
12028
  providerSpendAnthropicUsdPerHour: makeNumberSetting({
11857
12029
  key: "providerSpendAnthropicUsdPerHour",
12030
+ abuseControl: "spend",
11858
12031
  name: "Provider Spend Alarm: Anthropic Hourly Ceiling (USD)",
11859
12032
  defaultValue: 0,
11860
12033
  min: 0,
@@ -11864,6 +12037,7 @@ const settingsMap = {
11864
12037
  }),
11865
12038
  freeTierDailySystemCostCapUsd: makeNumberSetting({
11866
12039
  key: "freeTierDailySystemCostCapUsd",
12040
+ abuseControl: "spend",
11867
12041
  name: "Free Tier Daily System Cost Cap (USD)",
11868
12042
  defaultValue: .1,
11869
12043
  min: 0,
@@ -11927,6 +12101,7 @@ const settingsMap = {
11927
12101
  }),
11928
12102
  turnstileEnabled: makeBooleanSetting({
11929
12103
  key: "turnstileEnabled",
12104
+ abuseControl: "signup",
11930
12105
  name: "Require Turnstile on Email Sign-in",
11931
12106
  defaultValue: false,
11932
12107
  description: "Require a Cloudflare Turnstile challenge before a sign-in code is emailed. Takes effect only when the Turnstile secret is provisioned on this stage and a site key is set below; otherwise the check is skipped.",
@@ -11935,6 +12110,7 @@ const settingsMap = {
11935
12110
  }),
11936
12111
  turnstileFailClosed: makeBooleanSetting({
11937
12112
  key: "turnstileFailClosed",
12113
+ abuseControl: "signup",
11938
12114
  name: "Turnstile Fail Closed",
11939
12115
  defaultValue: false,
11940
12116
  description: "When Cloudflare verification cannot be reached, refuse the request instead of letting it through. Off keeps sign-in available during a Cloudflare outage.",
@@ -11943,6 +12119,7 @@ const settingsMap = {
11943
12119
  }),
11944
12120
  turnstileSiteKey: makeStringSetting({
11945
12121
  key: "turnstileSiteKey",
12122
+ abuseControl: "signup",
11946
12123
  name: "Turnstile Site Key",
11947
12124
  defaultValue: "",
11948
12125
  description: "The public Cloudflare Turnstile site key shown to the sign-in form. With the toggle above off, a set key still challenges sign-in code requests past the send budgets (see Sign-in Code Limits). The secret key is never stored here.",
@@ -11951,6 +12128,7 @@ const settingsMap = {
11951
12128
  }),
11952
12129
  signupBurstThreshold: makeNumberSetting({
11953
12130
  key: "signupBurstThreshold",
12131
+ abuseControl: "signup",
11954
12132
  name: "Signup Burst Threshold",
11955
12133
  defaultValue: 5,
11956
12134
  int: true,
@@ -11962,6 +12140,7 @@ const settingsMap = {
11962
12140
  }),
11963
12141
  signupBurstWindowHours: makeNumberSetting({
11964
12142
  key: "signupBurstWindowHours",
12143
+ abuseControl: "signup",
11965
12144
  name: "Signup Burst Window (hours)",
11966
12145
  defaultValue: 6,
11967
12146
  int: true,
@@ -11973,6 +12152,7 @@ const settingsMap = {
11973
12152
  }),
11974
12153
  signupBurstAutoHold: makeBooleanSetting({
11975
12154
  key: "signupBurstAutoHold",
12155
+ abuseControl: "signup",
11976
12156
  name: "Auto-hold Signup Bursts",
11977
12157
  defaultValue: false,
11978
12158
  category: "Users",
@@ -11981,6 +12161,7 @@ const settingsMap = {
11981
12161
  }),
11982
12162
  signupRiskScoring: makeObjectSetting({
11983
12163
  key: "signupRiskScoring",
12164
+ abuseControl: "signup",
11984
12165
  name: "Signup Risk Scoring",
11985
12166
  defaultValue: SignupRiskScoringSchema.parse({}),
11986
12167
  description: "Weights (0-100 each) for the signals that make up a new account's 0-100 risk score, the minutes and credits that set off the quick-API-key and fast-spend signals, and the score at which an account needs review. The score is capped at 100.",
@@ -11990,6 +12171,7 @@ const settingsMap = {
11990
12171
  }),
11991
12172
  signupRiskAutoApproval: makeObjectSetting({
11992
12173
  key: "signupRiskAutoApproval",
12174
+ abuseControl: "signup",
11993
12175
  name: "Signup Risk Auto-Approval",
11994
12176
  defaultValue: SignupRiskAutoApprovalSchema.parse({}),
11995
12177
  description: "Approves a pending signup risk review without an admin. settledPayment: a successful card payment (credit pack or subscription) that Stripe Radar rated normal, on a card no other account paid with in the payment-attempt retention window, at least minPaymentAgeHours old. quietAccount (off by default): an account at least minAccountAgeDays old, scoring at most maxScore, not rescored for minQuietDays and named in no open shadow detection. Neither applies to a banned, suspended or disputed account, one whose payment unlock was forfeited, one with a signup tranche held for review, or one an admin reopened. Each approval is audited and listed in Risk review, where it can be reopened; a refund, dispute or early fraud warning reopens a settledPayment approval automatically. A stored value that fails to parse turns both rules off.",
@@ -11999,6 +12181,7 @@ const settingsMap = {
11999
12181
  }),
12000
12182
  signupAnomaly: makeObjectSetting({
12001
12183
  key: "signupAnomaly",
12184
+ abuseControl: "signup",
12002
12185
  name: "Signup anomaly detection",
12003
12186
  defaultValue: {
12004
12187
  signupBaseline: 0,
@@ -12018,6 +12201,7 @@ const settingsMap = {
12018
12201
  }),
12019
12202
  enableDomainIntelligence: makeBooleanSetting({
12020
12203
  key: "enableDomainIntelligence",
12204
+ abuseControl: "signup",
12021
12205
  name: "Hold Risky Signup Domains",
12022
12206
  defaultValue: true,
12023
12207
  category: "Users",
@@ -12026,6 +12210,7 @@ const settingsMap = {
12026
12210
  }),
12027
12211
  holdSignupsFromDomainsYoungerThanDays: makeNumberSetting({
12028
12212
  key: "holdSignupsFromDomainsYoungerThanDays",
12213
+ abuseControl: "signup",
12029
12214
  name: "Hold Signups From Domains Younger Than (days)",
12030
12215
  defaultValue: 30,
12031
12216
  int: true,
@@ -12037,6 +12222,7 @@ const settingsMap = {
12037
12222
  }),
12038
12223
  autoConfirmDisposableAggregateHolds: makeBooleanSetting({
12039
12224
  key: "autoConfirmDisposableAggregateHolds",
12225
+ abuseControl: "signup",
12040
12226
  name: "Auto-Confirm Disposable-List Domain Holds",
12041
12227
  defaultValue: true,
12042
12228
  category: "Users",
@@ -12045,6 +12231,7 @@ const settingsMap = {
12045
12231
  }),
12046
12232
  signupDomainHoldsSettledVisibleDays: makeNumberSetting({
12047
12233
  key: "signupDomainHoldsSettledVisibleDays",
12234
+ abuseControl: "signup",
12048
12235
  name: "Signup Domain Holds: Show Settled Holds For (days)",
12049
12236
  defaultValue: 90,
12050
12237
  int: true,
@@ -12056,6 +12243,7 @@ const settingsMap = {
12056
12243
  }),
12057
12244
  signupDomainHoldAssessmentEnabled: makeBooleanSetting({
12058
12245
  key: "signupDomainHoldAssessmentEnabled",
12246
+ abuseControl: "signup",
12059
12247
  name: "Advisory Assessment of Young-Domain Holds",
12060
12248
  defaultValue: false,
12061
12249
  category: "Users",
@@ -12064,6 +12252,7 @@ const settingsMap = {
12064
12252
  }),
12065
12253
  signupDomainHoldAssessmentConfig: makeObjectSetting({
12066
12254
  key: "signupDomainHoldAssessmentConfig",
12255
+ abuseControl: "signup",
12067
12256
  name: "Advisory Assessment of Young-Domain Holds: Model and Limits",
12068
12257
  defaultValue: SignupDomainHoldAssessmentConfigSchema.parse({}),
12069
12258
  description: "The Decisions model to ask (it must have a platform key), the daily USD budget and call cap, concurrent calls, holds per 10-minute run, the least confidence in an abuse verdict that confirms a hold, and the auto-release switch, confidence and caps. The defaults make no calls and never release.",
@@ -12085,6 +12274,7 @@ const settingsMap = {
12085
12274
  }),
12086
12275
  paymentRiskAlertsEnabled: makeBooleanSetting({
12087
12276
  key: "paymentRiskAlertsEnabled",
12277
+ abuseControl: "payments",
12088
12278
  name: "Payment Risk Alerts",
12089
12279
  defaultValue: true,
12090
12280
  category: "Users",
@@ -12093,6 +12283,7 @@ const settingsMap = {
12093
12283
  }),
12094
12284
  paymentRiskYoungAccountMinutes: makeNumberSetting({
12095
12285
  key: "paymentRiskYoungAccountMinutes",
12286
+ abuseControl: "payments",
12096
12287
  name: "Payment Risk: Young Account (minutes)",
12097
12288
  defaultValue: 60,
12098
12289
  int: true,
@@ -12104,6 +12295,7 @@ const settingsMap = {
12104
12295
  }),
12105
12296
  paymentRiskMaxAccountsPerCard: makeNumberSetting({
12106
12297
  key: "paymentRiskMaxAccountsPerCard",
12298
+ abuseControl: "payments",
12107
12299
  name: "Payment Risk: Max Accounts Per Card",
12108
12300
  defaultValue: 1,
12109
12301
  int: true,
@@ -12115,6 +12307,7 @@ const settingsMap = {
12115
12307
  }),
12116
12308
  paymentRiskMaxCardsPerWindow: makeNumberSetting({
12117
12309
  key: "paymentRiskMaxCardsPerWindow",
12310
+ abuseControl: "payments",
12118
12311
  name: "Payment Risk: Max Cards Per Window",
12119
12312
  defaultValue: 1,
12120
12313
  int: true,
@@ -12126,6 +12319,7 @@ const settingsMap = {
12126
12319
  }),
12127
12320
  paymentRiskCardWindowMinutes: makeNumberSetting({
12128
12321
  key: "paymentRiskCardWindowMinutes",
12322
+ abuseControl: "payments",
12129
12323
  name: "Payment Risk: Card Window (minutes)",
12130
12324
  defaultValue: 60,
12131
12325
  int: true,
@@ -12137,6 +12331,7 @@ const settingsMap = {
12137
12331
  }),
12138
12332
  paymentRiskFlagHostingNetwork: makeBooleanSetting({
12139
12333
  key: "paymentRiskFlagHostingNetwork",
12334
+ abuseControl: "payments",
12140
12335
  name: "Payment Risk: Flag Hosting/VPN Networks",
12141
12336
  defaultValue: true,
12142
12337
  category: "Users",
@@ -12145,6 +12340,7 @@ const settingsMap = {
12145
12340
  }),
12146
12341
  requireThreeDSecureOnFirstPurchase: makeBooleanSetting({
12147
12342
  key: "requireThreeDSecureOnFirstPurchase",
12343
+ abuseControl: "payments",
12148
12344
  name: "Require 3-D Secure on First Purchase",
12149
12345
  defaultValue: true,
12150
12346
  description: "Asks the card issuer for a 3-D Secure challenge when an account buys a subscription or credits for the first time: the paying Stripe customer has no prior successful charge, or the account is younger than the new-account window. A passed challenge usually shifts fraud-chargeback liability to the issuer. Turn off if checkout conversion suffers.",
@@ -12154,6 +12350,7 @@ const settingsMap = {
12154
12350
  }),
12155
12351
  threeDSecureNewAccountDays: makeNumberSetting({
12156
12352
  key: "threeDSecureNewAccountDays",
12353
+ abuseControl: "payments",
12157
12354
  name: "3-D Secure: New-Account Window (days)",
12158
12355
  defaultValue: 7,
12159
12356
  min: 0,
@@ -12177,6 +12374,7 @@ const settingsMap = {
12177
12374
  }),
12178
12375
  signupNetworkAlertsEnabled: makeBooleanSetting({
12179
12376
  key: "signupNetworkAlertsEnabled",
12377
+ abuseControl: "signup",
12180
12378
  name: "Signup Network Burst Alerts",
12181
12379
  defaultValue: true,
12182
12380
  category: "Users",
@@ -12185,6 +12383,7 @@ const settingsMap = {
12185
12383
  }),
12186
12384
  signupNetworkAlertWindowMinutes: makeNumberSetting({
12187
12385
  key: "signupNetworkAlertWindowMinutes",
12386
+ abuseControl: "signup",
12188
12387
  name: "Signup Network Alert: Window (minutes)",
12189
12388
  defaultValue: 180,
12190
12389
  int: true,
@@ -12196,6 +12395,7 @@ const settingsMap = {
12196
12395
  }),
12197
12396
  signupNetworkAlertMaxPerIp: makeNumberSetting({
12198
12397
  key: "signupNetworkAlertMaxPerIp",
12398
+ abuseControl: "signup",
12199
12399
  name: "Signup Network Alert: Max Signups per IP",
12200
12400
  defaultValue: 1,
12201
12401
  int: true,
@@ -12207,6 +12407,7 @@ const settingsMap = {
12207
12407
  }),
12208
12408
  signupNetworkAlertMinUncorroboratedPerIp: makeNumberSetting({
12209
12409
  key: "signupNetworkAlertMinUncorroboratedPerIp",
12410
+ abuseControl: "signup",
12210
12411
  name: "Signup Network Alert: Min Signups per IP Without Corroboration",
12211
12412
  defaultValue: 3,
12212
12413
  int: true,
@@ -12218,6 +12419,7 @@ const settingsMap = {
12218
12419
  }),
12219
12420
  signupNetworkAlertMaxPerHostingAsn: makeNumberSetting({
12220
12421
  key: "signupNetworkAlertMaxPerHostingAsn",
12422
+ abuseControl: "signup",
12221
12423
  name: "Signup Network Alert: Max Signups per Hosting/VPN Network",
12222
12424
  defaultValue: 2,
12223
12425
  int: true,
@@ -12229,6 +12431,7 @@ const settingsMap = {
12229
12431
  }),
12230
12432
  signupNetworkAlertMaxPerAsn: makeNumberSetting({
12231
12433
  key: "signupNetworkAlertMaxPerAsn",
12434
+ abuseControl: "signup",
12232
12435
  name: "Signup Network Alert: Max Signups per Network (any ASN)",
12233
12436
  defaultValue: 0,
12234
12437
  int: true,
@@ -12259,6 +12462,7 @@ const settingsMap = {
12259
12462
  }),
12260
12463
  paymentRiskAutoRefundEnabled: makeBooleanSetting({
12261
12464
  key: "paymentRiskAutoRefundEnabled",
12465
+ abuseControl: "payments",
12262
12466
  name: "Payment Risk: Act on Early Fraud Warnings",
12263
12467
  defaultValue: true,
12264
12468
  category: "Users",
@@ -12267,6 +12471,7 @@ const settingsMap = {
12267
12471
  }),
12268
12472
  paymentRiskAutoRefundMinUnspentPercent: makeNumberSetting({
12269
12473
  key: "paymentRiskAutoRefundMinUnspentPercent",
12474
+ abuseControl: "payments",
12270
12475
  name: "Payment Risk: Refund Only Above Unspent %",
12271
12476
  defaultValue: 0,
12272
12477
  int: true,
@@ -12278,6 +12483,7 @@ const settingsMap = {
12278
12483
  }),
12279
12484
  paymentRiskCheckoutMaxBlockedAttempts: makeNumberSetting({
12280
12485
  key: "paymentRiskCheckoutMaxBlockedAttempts",
12486
+ abuseControl: "payments",
12281
12487
  name: "Payment Risk: Refuse Checkout After Radar Blocks",
12282
12488
  defaultValue: 3,
12283
12489
  int: true,
@@ -12289,6 +12495,7 @@ const settingsMap = {
12289
12495
  }),
12290
12496
  paymentRiskCheckoutBlockedWindowMinutes: makeNumberSetting({
12291
12497
  key: "paymentRiskCheckoutBlockedWindowMinutes",
12498
+ abuseControl: "payments",
12292
12499
  name: "Payment Risk: Radar Block Window (minutes)",
12293
12500
  defaultValue: 1440,
12294
12501
  int: true,
@@ -12300,6 +12507,7 @@ const settingsMap = {
12300
12507
  }),
12301
12508
  paymentRiskLinkedAccountActions: makeBooleanSetting({
12302
12509
  key: "paymentRiskLinkedAccountActions",
12510
+ abuseControl: "payments",
12303
12511
  name: "Payment Risk: Act on Linked Accounts",
12304
12512
  defaultValue: true,
12305
12513
  category: "Users",
@@ -12308,6 +12516,7 @@ const settingsMap = {
12308
12516
  }),
12309
12517
  signupMinSubmitMs: makeNumberSetting({
12310
12518
  key: "signupMinSubmitMs",
12519
+ abuseControl: "signup",
12311
12520
  name: "Signup Minimum Submit Time (ms)",
12312
12521
  defaultValue: 1500,
12313
12522
  min: 0,
@@ -12318,6 +12527,7 @@ const settingsMap = {
12318
12527
  }),
12319
12528
  signupBotChecksEnabled: makeBooleanSetting({
12320
12529
  key: "signupBotChecksEnabled",
12530
+ abuseControl: "signup",
12321
12531
  name: "Signup Bot Checks",
12322
12532
  defaultValue: true,
12323
12533
  description: "Records risk signals (hidden field filled, missing or invalid form token, too-fast submit) at signup and places flagged new accounts in the restricted tier. Turn OFF to stop recording signals.",
@@ -13892,16 +14102,6 @@ const settingsMap = {
13892
14102
  order: 121,
13893
14103
  schema: ContextTelemetryAlertsSchema
13894
14104
  }),
13895
- secopsTriageConfig: makeObjectSetting({
13896
- key: "secopsTriageConfig",
13897
- name: "SecOps Triage Config",
13898
- hideFromSettingsList: true,
13899
- defaultValue: SecopsTriageConfigSchema.parse({}),
13900
- description: "Configuration for SecOps triage: files a GitHub issue for each critical or high finding reported by a security scan through the system GitHub connection, and closes it when the finding is gone. Disabled by default.",
13901
- category: "SecOps",
13902
- order: 131,
13903
- schema: SecopsTriageConfigSchema
13904
- }),
13905
14105
  overwatchRollupSync: makeObjectSetting({
13906
14106
  key: "overwatchRollupSync",
13907
14107
  name: "Overwatch Rollup Sync Lock",
@@ -14884,7 +15084,8 @@ const GenericDeductReasons = [
14884
15084
  "optihashi_cost_chargeup",
14885
15085
  "credit_expiry",
14886
15086
  "abuse_clawback",
14887
- "referral_reward_takeback"
15087
+ "referral_reward_takeback",
15088
+ "balance_cap_cleanup"
14888
15089
  ];
14889
15090
  const GENERIC_DEDUCT_REASON_PATTERN = /^[a-z][a-z0-9_]*$/;
14890
15091
  const GENERIC_DEDUCT_REASON_REGISTRY_KEY = Symbol.for("b4m.credit.genericDeductReasons");
@@ -15096,21 +15297,176 @@ const CREDIT_DEDUCT_TRANSACTION_TYPES = [
15096
15297
  const NON_AI_DEDUCT_TRANSACTION_TYPES = ["transfer_credit", "generic_deduct"];
15097
15298
  CREDIT_DEDUCT_TRANSACTION_TYPES.filter((t) => !NON_AI_DEDUCT_TRANSACTION_TYPES.includes(t));
15098
15299
  CREDIT_DEDUCT_TRANSACTION_TYPES.filter((t) => t !== "transfer_credit");
15099
- const identity$1 = z$1.string().min(1).max(128);
15300
+ const ImageUsageCounter = z$1.discriminatedUnion("status", [
15301
+ z$1.object({
15302
+ status: z$1.literal("reported"),
15303
+ value: z$1.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER)
15304
+ }).strict(),
15305
+ z$1.object({ status: z$1.literal("not_reported") }).strict(),
15306
+ z$1.object({ status: z$1.literal("invalid") }).strict()
15307
+ ]);
15308
+ const issues = [
15309
+ "usage_missing",
15310
+ "usage_invalid",
15311
+ "counter_invalid",
15312
+ "input_partition_mismatch",
15313
+ "output_partition_mismatch",
15314
+ "total_mismatch",
15315
+ "capture_invalid"
15316
+ ];
15317
+ const ImageProviderUsage = z$1.object({
15318
+ version: z$1.literal(1),
15319
+ provider: z$1.literal("openai"),
15320
+ providerSource: z$1.literal("adapter"),
15321
+ endpointProvenance: z$1.enum(["native_openai", "unverified"]),
15322
+ api: z$1.literal("images"),
15323
+ method: z$1.enum([
15324
+ "generate",
15325
+ "edit",
15326
+ "variation",
15327
+ "unknown"
15328
+ ]),
15329
+ attemptId: z$1.string().regex(/^[A-Za-z0-9._:-]{1,128}$/),
15330
+ requestedModel: z$1.string().regex(/^[A-Za-z0-9._:-]{1,128}$/).optional(),
15331
+ modelSource: z$1.literal("request"),
15332
+ input: ImageUsageCounter,
15333
+ output: ImageUsageCounter,
15334
+ total: ImageUsageCounter,
15335
+ inputText: ImageUsageCounter,
15336
+ inputImage: ImageUsageCounter,
15337
+ outputText: ImageUsageCounter,
15338
+ outputImage: ImageUsageCounter,
15339
+ issues: z$1.array(z$1.enum(issues)).max(issues.length)
15340
+ }).strict();
15341
+ const identity$1 = z$1.string().min(1).max(256);
15342
+ const tokenCount = z$1.number().int().min(0).max(Number.MAX_SAFE_INTEGER);
15343
+ const rate = z$1.number().finite().nonnegative();
15344
+ const capabilitySchema = z$1.object({
15345
+ version: z$1.literal(1),
15346
+ provider: z$1.literal("openai"),
15347
+ endpoint: z$1.literal("https://api.openai.com/v1"),
15348
+ api: z$1.enum(["chat", "responses"]),
15349
+ policy: z$1.literal("explicit-cache-write-v1"),
15350
+ contractId: identity$1,
15351
+ chatWriteDefault: z$1.enum(["unknown", "documented_zero"])
15352
+ }).strict().refine((value) => value.api === "chat" || value.chatWriteDefault === "unknown", { message: "Only native Chat permits the documented default" });
15353
+ const nativeCounterSchema = z$1.object({
15354
+ provenance: z$1.enum([
15355
+ "reported",
15356
+ "not_reported",
15357
+ "invalid"
15358
+ ]),
15359
+ value: tokenCount.optional()
15360
+ }).strict().refine((counter) => counter.provenance === "reported" === (counter.value !== void 0));
15361
+ const nativeRatesSchema = z$1.object({
15362
+ input: rate,
15363
+ output: rate,
15364
+ cachedRead: rate,
15365
+ write30m: rate,
15366
+ write12h: rate
15367
+ }).strict();
15368
+ const OpenAiNativeUsageAttempt = z$1.object({
15369
+ attemptId: identity$1,
15370
+ api: z$1.literal("responses"),
15371
+ endpoint: z$1.enum(["native_openai", "unsupported"]),
15372
+ capturedAt: z$1.iso.datetime(),
15373
+ terminalStatus: z$1.enum([
15374
+ "pending",
15375
+ "completed",
15376
+ "incomplete",
15377
+ "failed",
15378
+ "error"
15379
+ ]),
15380
+ contractStatus: z$1.enum([
15381
+ "unsupported",
15382
+ "admitted",
15383
+ "invalid_context"
15384
+ ]),
15385
+ contractId: identity$1.optional(),
15386
+ requestedModel: identity$1.optional(),
15387
+ returnedModel: identity$1.optional(),
15388
+ actualServiceTier: identity$1.optional(),
15389
+ inclusiveInput: nativeCounterSchema,
15390
+ output: nativeCounterSchema,
15391
+ cachedReads: nativeCounterSchema,
15392
+ cacheWrites: nativeCounterSchema,
15393
+ writes30m: nativeCounterSchema,
15394
+ writes12h: nativeCounterSchema,
15395
+ partitionStatus: z$1.enum([
15396
+ "unknown",
15397
+ "complete",
15398
+ "aggregate_writes_only"
15399
+ ]),
15400
+ issues: z$1.array(identity$1).max(16),
15401
+ rateBinding: z$1.discriminatedUnion("status", [z$1.object({
15402
+ status: z$1.literal("unresolved"),
15403
+ reason: identity$1
15404
+ }).strict(), z$1.object({
15405
+ status: z$1.literal("resolved"),
15406
+ units: z$1.literal("usd_per_token"),
15407
+ returnedModel: identity$1,
15408
+ actualServiceTier: identity$1,
15409
+ maxInputTokens: tokenCount,
15410
+ rates: nativeRatesSchema,
15411
+ priceSourceId: identity$1,
15412
+ identityContractId: identity$1,
15413
+ capturedAt: z$1.iso.datetime(),
15414
+ effectiveAt: z$1.iso.datetime()
15415
+ }).strict()])
15416
+ }).strict();
15417
+ const OpenAiNativeUsageObservations = z$1.object({
15418
+ version: z$1.literal(1),
15419
+ coverage: z$1.literal("app_visible_attempts"),
15420
+ truncated: z$1.boolean(),
15421
+ invalidCapture: z$1.boolean(),
15422
+ attempts: z$1.array(OpenAiNativeUsageAttempt).max(32)
15423
+ }).strict();
15424
+ const ratesSchema = z$1.object({
15425
+ input: rate,
15426
+ output: rate,
15427
+ cachedRead: rate,
15428
+ write30m: rate.optional(),
15429
+ write12h: rate.optional()
15430
+ }).strict();
15431
+ const contextTierSchema = z$1.object({
15432
+ maxInputTokens: tokenCount.positive(),
15433
+ rates: ratesSchema
15434
+ }).strict();
15435
+ const serviceTierSchema = z$1.object({
15436
+ serviceTier: identity$1,
15437
+ contextTiers: z$1.array(contextTierSchema).min(1).max(32)
15438
+ }).strict().refine((value) => value.contextTiers.every((tier, index, tiers) => index === 0 || tiers[index - 1].maxInputTokens < tier.maxInputTokens), { message: "Context thresholds must be strictly increasing" });
15439
+ z$1.object({
15440
+ version: z$1.literal(1),
15441
+ units: z$1.literal("usd_per_token"),
15442
+ capability: capabilitySchema,
15443
+ wireModel: identity$1,
15444
+ allowedReturnedModels: z$1.array(identity$1).min(1).max(32),
15445
+ identityContractId: identity$1,
15446
+ priceSourceId: identity$1,
15447
+ capturedAt: z$1.iso.datetime(),
15448
+ effectiveAt: z$1.iso.datetime(),
15449
+ serviceTiers: z$1.array(serviceTierSchema).min(1).max(16)
15450
+ }).strict().refine((value) => new Set(value.allowedReturnedModels).size === value.allowedReturnedModels.length, { message: "Returned model identities must be unique" }).refine((value) => new Set(value.serviceTiers.map((tier) => tier.serviceTier)).size === value.serviceTiers.length, { message: "Service tiers must be unique" }).refine((value) => Date.parse(value.effectiveAt) <= Date.parse(value.capturedAt), { message: "Rates must be effective when captured" });
15451
+ const identity = z$1.string().min(1).max(128);
15100
15452
  const PlatformAttribution = z$1.object({
15101
15453
  kind: z$1.literal("platform_operation"),
15102
- operation: z$1.literal("sre_diagnosis"),
15454
+ operation: z$1.enum([
15455
+ "sre_diagnosis",
15456
+ "image_prompt_resolution",
15457
+ "release_highlights"
15458
+ ]),
15103
15459
  environment: z$1.enum([
15104
15460
  "production",
15105
15461
  "staging",
15106
15462
  "development",
15107
15463
  "test"
15108
15464
  ]),
15109
- logicalJobId: identity$1,
15110
- executionId: identity$1
15465
+ logicalJobId: identity,
15466
+ executionId: identity
15111
15467
  }).strict();
15112
15468
  z$1.object({
15113
- providerCallId: identity$1,
15469
+ providerCallId: identity,
15114
15470
  attribution: PlatformAttribution,
15115
15471
  provider: z$1.string().min(1).max(128),
15116
15472
  model: z$1.string().min(1).max(256),
@@ -15120,7 +15476,8 @@ z$1.object({
15120
15476
  const COMPLETION_RUN_ROLES = ["root", "worker"];
15121
15477
  /**
15122
15478
  * What a run-attributed request was for, so spend can be split by category. `tool` is a paid tool call
15123
- * (image, video, music, speech, sound) a run's session made, charged by its own route.
15479
+ * (image, video, music, speech, sound) a run's session made, charged by its own route. `approval` is
15480
+ * Desktop's approval judge, a side call that rates one tool call (apps/desktop permissions/approvalJudge.ts).
15124
15481
  */
15125
15482
  const COMPLETION_RUN_PURPOSES = [
15126
15483
  "turn",
@@ -15129,7 +15486,8 @@ const COMPLETION_RUN_PURPOSES = [
15129
15486
  "suggestion",
15130
15487
  "explore",
15131
15488
  "review",
15132
- "tool"
15489
+ "tool",
15490
+ "approval"
15133
15491
  ];
15134
15492
  /**
15135
15493
  * Which product surface generated the provider call.
@@ -15174,7 +15532,9 @@ const UsageEventRates = z$1.object({
15174
15532
  cacheRead: z$1.number().optional(),
15175
15533
  cacheWrite: z$1.number().optional(),
15176
15534
  /** Stamped only on a row that wrote with the 1-hour TTL. */
15177
- cacheWrite1h: z$1.number().optional()
15535
+ cacheWrite1h: z$1.number().optional(),
15536
+ /** The off-peak factor (ModelInfo.offPeak) already applied to every rate above; absent for an unscheduled model. */
15537
+ offPeakMultiplier: z$1.number().optional()
15178
15538
  });
15179
15539
  /** One provider request of a multi-turn completion, with the tier it was priced on. */
15180
15540
  const UsageEventTurn = z$1.object({
@@ -15183,7 +15543,10 @@ const UsageEventTurn = z$1.object({
15183
15543
  cacheReadTokens: z$1.number().optional(),
15184
15544
  cacheWriteTokens: z$1.number().optional(),
15185
15545
  cacheWrite1hTokens: z$1.number().optional(),
15186
- tierKey: z$1.number()
15546
+ tierKey: z$1.number(),
15547
+ /** Epoch ms the request was sent and its usage arrived (TurnUsage), which decide its off-peak multiplier. */
15548
+ startedAt: z$1.number().optional(),
15549
+ finishedAt: z$1.number().optional()
15187
15550
  });
15188
15551
  /**
15189
15552
  * What funded the credits a usage event spent. `unknown` covers legacy-backfill lots and
@@ -15216,7 +15579,9 @@ const USAGE_EVENT_OPERATIONS = [
15216
15579
  "assistant_brief",
15217
15580
  "delegated_item",
15218
15581
  "document_obligation",
15219
- "org_feedback_summary"
15582
+ "org_feedback_summary",
15583
+ "quest_export_summary",
15584
+ "lake_inconsistency_detection"
15220
15585
  ];
15221
15586
  /**
15222
15587
  * How a request was run, for the admin usage receipt. Metadata only by contract: never prompt or
@@ -15342,9 +15707,10 @@ const AttributedUsageEvent = z$1.object({
15342
15707
  /** The ModelPrice row in force; set only when priceSource is 'catalog'. */
15343
15708
  priceRowId: z$1.string().optional(),
15344
15709
  /**
15345
- * Rates of the tier applied. A multi-turn row whose turns hit different tiers carries the
15346
- * tier of its largest turn; turnUsage has each turn's own tierKey, but not that tier's rates,
15347
- * so only a single-tier text charge is recomputable from its own fields. Provider-basis chat
15710
+ * Rates of the tier applied, after any off-peak discount (rates.offPeakMultiplier). A multi-turn
15711
+ * row whose turns hit different tiers or sides of an off-peak boundary carries the rates of its
15712
+ * largest turn; turnUsage has each turn's own tierKey and timestamps, but not that turn's rates,
15713
+ * so only a single-tier, single-period text charge is recomputable from its own fields. Provider-basis chat
15348
15714
  * rows use providerInputTokens/providerOutputTokens plus the cache buckets. Local-estimate chat
15349
15715
  * rows use input * (inputTokens - cachedInputTokens) + cacheRead * cachedInputTokens
15350
15716
  * + output * outputTokens. Operational and CLI rows use disjoint input/cache buckets instead:
@@ -15363,6 +15729,8 @@ const AttributedUsageEvent = z$1.object({
15363
15729
  turnUsageTruncated: z$1.boolean().optional(),
15364
15730
  /** The part of cacheWriteTokens written with the 1-hour TTL, priced at rates.cacheWrite1h. Absent when none. */
15365
15731
  cacheWrite1hTokens: z$1.number().optional(),
15732
+ openAiUsageObservations: OpenAiNativeUsageObservations.optional(),
15733
+ imageProviderUsage: ImageProviderUsage.optional(),
15366
15734
  /** How the request ran, for the admin usage receipt (see UsageEventRequestMeta). */
15367
15735
  requestMeta: UsageEventRequestMeta.optional(),
15368
15736
  /** The completion run this call's spend belongs to (see UsageEventRun). */
@@ -15809,7 +16177,13 @@ z$1.object({
15809
16177
  * Only meaningful for a principal INSIDE the lake's organization: membership never crosses
15810
16178
  * organizations (epic decision 12), so this is not a cross-org mechanism.
15811
16179
  */
15812
- expiresAt: z$1.date().nullish()
16180
+ expiresAt: z$1.date().nullish(),
16181
+ /**
16182
+ * When the recipient agreed to hold this grant: set when they accept a grant offer, or choose to
16183
+ * keep a grant from before offers existed. Absent on a cross-org grant means it was never agreed
16184
+ * to, which is what the recipient's one-time notice lists.
16185
+ */
16186
+ recipientAcknowledgedAt: z$1.date().nullish()
15813
16187
  });
15814
16188
  /** One prefix-arm content tag a lake held on a file, as captured at removal for later restore. */
15815
16189
  const LakeMembershipRemovalContentTag = z$1.object({
@@ -15940,6 +16314,9 @@ const LAKE_CONFIG_FIELD_AUDIT = {
15940
16314
  purgeClaimId: "excluded",
15941
16315
  purgeStartedAt: "excluded",
15942
16316
  lakeMemoryExtractionAt: "excluded",
16317
+ lakeMemoryCoverageGeneration: "excluded",
16318
+ lakeMemoryCoverageScopeKey: "excluded",
16319
+ lakeMemoryPassStartedAt: "excluded",
15943
16320
  lakeMemoryCursor: "excluded",
15944
16321
  lakeMemoryPurgedAt: "excluded",
15945
16322
  inconsistencyReport: "excluded",
@@ -15995,6 +16372,32 @@ z$1.object({
15995
16372
  onBehalfOfUserId: z$1.string().optional()
15996
16373
  }).optional()
15997
16374
  });
16375
+ z$1.object({
16376
+ dataLakeId: z$1.string(),
16377
+ /** The lake's org at offer time; accept refuses if the lake has moved since. */
16378
+ organizationId: z$1.string().nullish(),
16379
+ offeredByUserId: z$1.string(),
16380
+ recipientUserId: z$1.string(),
16381
+ role: z$1.enum(["curator", "reader"]),
16382
+ /** The expiry the GRANT will carry once accepted; null = never expires. Not the offer's expiry. */
16383
+ grantExpiresAt: z$1.date().nullish(),
16384
+ status: z$1.enum([
16385
+ "pending",
16386
+ "accepted",
16387
+ "declined",
16388
+ "cancelled",
16389
+ "expired"
16390
+ ]),
16391
+ /** When the offer itself lapses if unanswered. */
16392
+ expiresAt: z$1.date(),
16393
+ resolvedAt: z$1.date().nullish(),
16394
+ /** Resolved by the route at offer time, so the eventual audit row names the offering principal. */
16395
+ auditPrincipal: z$1.object({
16396
+ principalKind: z$1.enum(LAKE_CONFIG_CHANGE_PRINCIPAL_KINDS),
16397
+ principalId: z$1.string(),
16398
+ onBehalfOfUserId: z$1.string().optional()
16399
+ }).optional()
16400
+ });
15998
16401
  /**
15999
16402
  * Who INITIATED the write: an automated ingestion pipeline (today, a Google Drive connector
16000
16403
  * sync) or a person acting through an interactive door (a session, or an API key acting on a
@@ -16214,7 +16617,9 @@ const AuditTargetSchema = z$1.object({
16214
16617
  "system",
16215
16618
  "curatedCatalog",
16216
16619
  "adminRole",
16217
- "space"
16620
+ "space",
16621
+ "statusIncident",
16622
+ "statusComponent"
16218
16623
  ]),
16219
16624
  id: z$1.string(),
16220
16625
  displayName: z$1.string()
@@ -16246,7 +16651,8 @@ const AdminAuditCategorySchema = z$1.enum([
16246
16651
  "account",
16247
16652
  "org",
16248
16653
  "settings",
16249
- "support"
16654
+ "support",
16655
+ "status"
16250
16656
  ]);
16251
16657
  const AdminAuditSeveritySchema = z$1.enum([
16252
16658
  "info",
@@ -16951,45 +17357,6 @@ function completionsSupportsToolSearch(model) {
16951
17357
  return servedByClaudeAdapter(model) && supportsToolSearch(model);
16952
17358
  }
16953
17359
  const PROMPT_CACHE_TTLS = ["5m", "1h"];
16954
- const identity = z$1.string().min(1).max(256);
16955
- const tokenCount = z$1.number().int().min(0).max(Number.MAX_SAFE_INTEGER);
16956
- const rate = z$1.number().finite().nonnegative();
16957
- const capabilitySchema = z$1.object({
16958
- version: z$1.literal(1),
16959
- provider: z$1.literal("openai"),
16960
- endpoint: z$1.literal("https://api.openai.com/v1"),
16961
- api: z$1.enum(["chat", "responses"]),
16962
- policy: z$1.literal("explicit-cache-write-v1"),
16963
- contractId: identity,
16964
- chatWriteDefault: z$1.enum(["unknown", "documented_zero"])
16965
- }).strict().refine((value) => value.api === "chat" || value.chatWriteDefault === "unknown", { message: "Only native Chat permits the documented default" });
16966
- const ratesSchema = z$1.object({
16967
- input: rate,
16968
- output: rate,
16969
- cachedRead: rate,
16970
- write30m: rate.optional(),
16971
- write12h: rate.optional()
16972
- }).strict();
16973
- const contextTierSchema = z$1.object({
16974
- maxInputTokens: tokenCount.positive(),
16975
- rates: ratesSchema
16976
- }).strict();
16977
- const serviceTierSchema = z$1.object({
16978
- serviceTier: identity,
16979
- contextTiers: z$1.array(contextTierSchema).min(1).max(32)
16980
- }).strict().refine((value) => value.contextTiers.every((tier, index, tiers) => index === 0 || tiers[index - 1].maxInputTokens < tier.maxInputTokens), { message: "Context thresholds must be strictly increasing" });
16981
- z$1.object({
16982
- version: z$1.literal(1),
16983
- units: z$1.literal("usd_per_token"),
16984
- capability: capabilitySchema,
16985
- wireModel: identity,
16986
- allowedReturnedModels: z$1.array(identity).min(1).max(32),
16987
- identityContractId: identity,
16988
- priceSourceId: identity,
16989
- capturedAt: z$1.iso.datetime(),
16990
- effectiveAt: z$1.iso.datetime(),
16991
- serviceTiers: z$1.array(serviceTierSchema).min(1).max(16)
16992
- }).strict().refine((value) => new Set(value.allowedReturnedModels).size === value.allowedReturnedModels.length, { message: "Returned model identities must be unique" }).refine((value) => new Set(value.serviceTiers.map((tier) => tier.serviceTier)).size === value.serviceTiers.length, { message: "Service tiers must be unique" }).refine((value) => Date.parse(value.effectiveAt) <= Date.parse(value.capturedAt), { message: "Rates must be effective when captured" });
16993
17360
  z.enum([
16994
17361
  "openai",
16995
17362
  "test",
@@ -17119,7 +17486,7 @@ const generatedAudioResponseSchema = extendGeneratedAudioResponseSchema({});
17119
17486
  /**
17120
17487
  * 413 body: the audio was generated and billed, exceeds the response ceiling, and
17121
17488
  * offloading it to storage failed too. Written, never thrown, so it carries no
17122
- * `name`/`request_id`.
17489
+ * `request_id`.
17123
17490
  */
17124
17491
  const generatedAudioTooLargeSchema = z.object({ error: z.string() });
17125
17492
  /**
@@ -19178,6 +19545,12 @@ z$1.object({
19178
19545
  citables: z$1.array(CitableSourceSchema).optional(),
19179
19546
  contextTelemetry: ContextTelemetrySchema.optional()
19180
19547
  });
19548
+ const PublicLakeScopeSchema = z$1.enum(["all", "followed"]);
19549
+ const FOLLOW_OFF_NOTE = "While lake following is switched off on the deployment there is no follow set, so `followed` behaves as `all`.";
19550
+ /** Description of `public_lakes` on a request that retrieves from lakes. */
19551
+ const PUBLIC_LAKES_RETRIEVAL_DESCRIPTION = `Which public lakes unscoped lake retrieval may read for an API-key caller. \`all\` (the default) keeps every public lake; \`followed\` keeps only public lakes you follow (\`POST /api/v1/data-lakes/{id}/follow\`). Lakes you own or reach through an organization, share or plan are never dropped. Ignored for a signed-in browser session. ${FOLLOW_OFF_NOTE}`;
19552
+ /** Description of `public_lakes` on `GET /api/v1/data-lakes`. */
19553
+ const PUBLIC_LAKES_LIST_DESCRIPTION = "`all` (the default) lists every public lake. `followed` drops public lakes you reach only because they are public and that you do not follow (`access_reason: 'public'`); every other row stays. " + FOLLOW_OFF_NOTE;
19181
19554
  /**
19182
19555
  * Request schema for POST /api/chat - the simplified external chat surface.
19183
19556
  *
@@ -19221,7 +19594,8 @@ const SimplifiedChatRequestSchema = z$1.object({
19221
19594
  skip_auto_offers: z$1.boolean().optional().describe("Suppress tools the server would otherwise attach on its own for this session (the knowledge-base search offer, in-app view navigation, blog drafting/editing/publishing, skill invocation, and every tool from a connected MCP server). Native tools you request explicitly in `tools` are unaffected, but an MCP server tool cannot be named through this field, so with this flag set a caller with an MCP server connected sees none of its tools regardless of `tools`. One system-prompt block goes with them: withholding in-app view navigation also drops the view-registry block that exists only to describe it. No other prompt content changes. This does not switch off retrieval: a session with forced knowledge retrieval still retrieves, and documents already attached to the session are still placed in the prompt directly. Any promptMode suppresses these too, so false has no effect alongside one."),
19222
19595
  includePromptDetails: z$1.boolean().optional(),
19223
19596
  includeSystemPrompt: z$1.boolean().optional(),
19224
- systemPrompt: z$1.string().max(PROMPT_TEXT_MAX).optional().describe("System-prompt text for this request only, never persisted. Rendered as a defended block appended after every other system-prompt source, with prose instructing the model to defer to organization, session and data-lake guidance. Over the cap is a 422, never truncated.")
19597
+ systemPrompt: z$1.string().max(PROMPT_TEXT_MAX).optional().describe("System-prompt text for this request only, never persisted. Rendered as a defended block appended after every other system-prompt source, with prose instructing the model to defer to organization, session and data-lake guidance. Over the cap is a 422, never truncated."),
19598
+ public_lakes: PublicLakeScopeSchema.optional().describe(PUBLIC_LAKES_RETRIEVAL_DESCRIPTION)
19225
19599
  });
19226
19600
  /**
19227
19601
  * Async ACK returned on the default (wait:false) path of POST /api/chat. The
@@ -19339,14 +19713,7 @@ const ChatQuestPollResultSchema = z$1.object({
19339
19713
  */
19340
19714
  const ApiErrorSchema = z$1.object({
19341
19715
  error: z$1.string(),
19342
- request_id: z$1.string().optional(),
19343
- /**
19344
- * Deprecated, sunset 2026-12-01. The `name` of whatever was thrown - our own error
19345
- * classes usually, a library/driver class name on an unhandled 500 - added to every
19346
- * body by apps/client's errorHandler. Documented here so the runtime and the spec
19347
- * agree while it is still served; do not build on it. See CONVENTIONS.md section 1.
19348
- */
19349
- name: z$1.string().optional()
19716
+ request_id: z$1.string().optional()
19350
19717
  });
19351
19718
  /**
19352
19719
  * Error envelope for the 422 a credit-metered endpoint returns for two unrelated
@@ -19356,8 +19723,8 @@ const ApiErrorSchema = z$1.object({
19356
19723
  *
19357
19724
  * Derived from `ApiErrorSchema` rather than re-declaring `error`/`request_id`:
19358
19725
  * both of those 422s are *thrown*, so errorHandler serves the body and adds
19359
- * `name`. Extending is what keeps that documented here (and what drops it again
19360
- * on the sunset date) instead of leaving a bespoke copy behind to drift.
19726
+ * `request_id`. Extending is what keeps that documented here instead of leaving a
19727
+ * bespoke copy behind to drift.
19361
19728
  *
19362
19729
  * Also covers `spend_cap_exceeded`; the name is a published OpenAPI component, so it stays.
19363
19730
  */
@@ -19593,8 +19960,7 @@ const TTS_ERROR_CODES = [
19593
19960
  * on the conditions that carry a classifier; an ordinary validation 422 has none.
19594
19961
  *
19595
19962
  * Extends `ApiErrorSchema` because what decides whether a body carries the fields
19596
- * errorHandler adds - `request_id`, and `name` until its 2026-12-01 sunset - is
19597
- * whether the body was THROWN, not which status it wears, and three of these four
19963
+ * errorHandler adds - `request_id` - is whether the body was THROWN, not which status it wears, and three of these four
19598
19964
  * statuses are reachable both ways:
19599
19965
  *
19600
19966
  * - 401: thrown by apiKeyAuth on a rejected key; written by `auth` when no
@@ -19607,8 +19973,8 @@ const TTS_ERROR_CODES = [
19607
19973
  * - 429: thrown by apiKeyRateLimit; written by the handler on an upstream 429.
19608
19974
  * - 502: only ever written.
19609
19975
  *
19610
- * So those two are genuinely optional here, and splitting this per status would be
19611
- * wrong for the first three. The 502 does advertise both without ever sending them;
19976
+ * So it is genuinely optional here, and splitting this per status would be
19977
+ * wrong for the first three. The 502 does advertise it without ever sending it;
19612
19978
  * that is not worth a fourth error schema on one route, and `request_id` missing from
19613
19979
  * this handler's written bodies is a gap in the handler rather than something to
19614
19980
  * enshrine in a schema.
@@ -19629,7 +19995,7 @@ const ttsErrorResponseSchema = ApiErrorSchema.extend({
19629
19995
  * that predates the offload.
19630
19996
  *
19631
19997
  * Not derived from `ApiErrorSchema`: every 413 on this route is written, never
19632
- * thrown, so `name` is genuinely absent rather than optional - a stronger claim than
19998
+ * thrown, so `request_id` is genuinely absent rather than optional - a stronger claim than
19633
19999
  * `ttsErrorResponseSchema` can make for its own statuses, see the note there (a
19634
20000
  * provider 413 is folded onto a 422 by documentedStatusForUpstream4xx). An oversized
19635
20001
  * *request* body is another 413 that never reaches this schema at all - Next's own
@@ -19969,6 +20335,27 @@ const hasBlankTagPrefixSegment = (prefix) => {
19969
20335
  return (prefix.endsWith(":") ? prefix.slice(0, -1) : prefix).split(":").some((part) => !/[\p{L}\p{N}\p{P}\p{S}\p{M}]/u.test(part.replace(INVISIBLE_INK, "")));
19970
20336
  };
19971
20337
  const DATA_LAKE_SLUG_REGEX = /^[a-z0-9][a-z0-9-]*[a-z0-9]$/;
20338
+ /**
20339
+ * DataLakeConfig plus the fields only a lake's EDITORS may read. Returned exclusively by the
20340
+ * actor-aware list projections (listDataLakes / listAllDataLakes), which populate the extra
20341
+ * fields per lake and only when `canManage` holds for the requesting caller.
20342
+ *
20343
+ * This is a separate type on purpose: DataLakeConfig is the shared shape the access filters and
20344
+ * the tag/registry projections all operate on, and several of those have no actor to gate on.
20345
+ * `toDataLakeConfig` is therefore structurally unable to carry an editor-only field - the
20346
+ * invariant that keeps the prompt text out of every actor-less projection (see
20347
+ * getAccessibleDataLakePrompts, which reads it off the raw documents for the same reason).
20348
+ */
20349
+ /** Why a lake is on the caller's list (GET /api/data-lakes), in precedence order. */
20350
+ const LAKE_ACCESS_REASONS = [
20351
+ "owner",
20352
+ "manager",
20353
+ "organization",
20354
+ "shared",
20355
+ "tag",
20356
+ "followed",
20357
+ "public"
20358
+ ];
19972
20359
  const DATA_LAKES = [{
19973
20360
  id: "opti-knowledge",
19974
20361
  slug: "opti-knowledge",
@@ -22911,6 +23298,7 @@ const StreamedChatCompletionAction = z$1.object({
22911
23298
  })),
22912
23299
  sources: z$1.array(z$1.object({
22913
23300
  url: z$1.string(),
23301
+ type: z$1.string(),
22914
23302
  title: z$1.string(),
22915
23303
  description: z$1.string(),
22916
23304
  status: z$1.enum([
@@ -23942,7 +24330,19 @@ const OptiHashiRunUpdatedAction = z$1.object({
23942
24330
  runId: z$1.string(),
23943
24331
  status: z$1.string()
23944
24332
  });
24333
+ /**
24334
+ * Server -> Client: a short-lived message from another person in a shared session, such as where
24335
+ * they are pointing. Relayed, never stored; `payload` is the sending feature's own shape.
24336
+ */
24337
+ const SessionSignalAction = z$1.object({
24338
+ action: z$1.literal("session_signal"),
24339
+ sessionId: z$1.string(),
24340
+ /** The user id of the person it came from. */
24341
+ from: z$1.string(),
24342
+ payload: z$1.record(z$1.string(), z$1.unknown())
24343
+ });
23945
24344
  z$1.discriminatedUnion("action", [
24345
+ SessionSignalAction,
23946
24346
  SessionHandoffAction,
23947
24347
  GenerationJobUpdatedAction,
23948
24348
  StudioJobCompletedAction,
@@ -24161,7 +24561,8 @@ const AgentExecutionStartRequestSchema = z$1.object({
24161
24561
  * iteration, and nothing on this transport renders an artifact back to a human.
24162
24562
  */
24163
24563
  enable_artifacts: z$1.boolean().optional(),
24164
- confidence_overrides: z$1.array(z$1.number().min(0).max(1)).min(1).max(100).optional().describe("Admin only. Scripted per-iteration confidence scores (0 to 1) that replace the real score at the confidence gate: entry i scores iteration i + 1, and iterations past the end use the real score. The gate pauses the run for review on a streak of consecutive evaluated iterations below its threshold (currently 2), so script one low entry per iteration you want in the streak. Only iterations that ran tools are evaluated, scripted or not, and a finished run never pauses. A non-admin caller gets 403.")
24564
+ confidence_overrides: z$1.array(z$1.number().min(0).max(1)).min(1).max(100).optional().describe("Admin only. Scripted per-iteration confidence scores (0 to 1) that replace the real score at the confidence gate: entry i scores iteration i + 1, and iterations past the end use the real score. The gate pauses the run for review on a streak of consecutive evaluated iterations below its threshold (currently 2), so script one low entry per iteration you want in the streak. Only iterations that ran tools are evaluated, scripted or not, and a finished run never pauses. A non-admin caller gets 403."),
24565
+ public_lakes: PublicLakeScopeSchema.optional().describe(`${PUBLIC_LAKES_RETRIEVAL_DESCRIPTION} Inherited by any subagent this run dispatches.`)
24165
24566
  });
24166
24567
  /**
24167
24568
  * 202 ACK for `POST /api/v1/agent-executions`. The run is fire-and-forget: nothing is
@@ -24290,7 +24691,8 @@ const SessionTurnRequestSchema = z$1.object({
24290
24691
  "surface"
24291
24692
  ]).optional().describe("How much of the system stack to place in front of the model. Unset keeps the full stack the web app uses."),
24292
24693
  organization_id: z$1.string().nullable().optional().describe("Organization to bill. `null` bills personal credits; omitted uses the caller default."),
24293
- client_submitted_at: z$1.number().optional().describe("Epoch ms when the client submitted the message, for the turn timing log.")
24694
+ client_submitted_at: z$1.number().optional().describe("Epoch ms when the client submitted the message, for the turn timing log."),
24695
+ public_lakes: PublicLakeScopeSchema.optional().describe(PUBLIC_LAKES_RETRIEVAL_DESCRIPTION)
24294
24696
  });
24295
24697
  /**
24296
24698
  * Event fields are snake_case (CONVENTIONS.md section 2), except in `meta` and `error`: those are the
@@ -25597,8 +25999,8 @@ const CreateSessionRequestSchema = z$1.object({
25597
25999
  tags: z$1.array(SessionTagSchema).optional(),
25598
26000
  lastUsedModel: z$1.string().nullish()
25599
26001
  });
25600
- /** Query for GET /api/v1/sessions/{id}/quests: the pagination convention, nothing more. */
25601
- const ListSessionQuestsQuerySchema = PaginationQuerySchema;
26002
+ /** Query for GET /api/v1/sessions/{id}/quests: the pagination convention plus the listing order. */
26003
+ const ListSessionQuestsQuerySchema = PaginationQuerySchema.extend({ order: z$1.enum(["asc", "desc"]).default("asc").describe("Listing order: `asc` is oldest first (the default), `desc` is newest first. A cursor only continues the order it was issued for.") });
25602
26004
  /** An approval a tool is waiting on before it runs (confirm or cancel in the product UI). */
25603
26005
  const SessionQuestPendingActionSchema = z$1.object({
25604
26006
  tool: z$1.string().describe("The tool awaiting approval."),
@@ -26557,12 +26959,24 @@ const dataLakeResponseSchema = z$2.object(passthroughShape({
26557
26959
  purgeStartedAt: true,
26558
26960
  lakeMemoryEnabled: true,
26559
26961
  lakeMemoryExtractionAt: true,
26962
+ lakeMemoryCoverageGeneration: true,
26963
+ lakeMemoryCoverageScopeKey: true,
26964
+ lakeMemoryPassStartedAt: true,
26560
26965
  lakeMemoryCursor: true,
26561
26966
  lakeMemoryPurgedAt: true,
26562
26967
  origin: true,
26563
26968
  pendingConnector: true,
26564
26969
  modelInconsistencyRunAt: true
26565
26970
  }));
26971
+ dataLakeResponseSchema.extend({ viewer: z$2.object(passthroughShape({
26972
+ canManage: true,
26973
+ canManageSettings: true,
26974
+ canRebuild: true,
26975
+ isOwn: true,
26976
+ pendingProposalCount: true,
26977
+ accessReason: true,
26978
+ isFollowed: true
26979
+ })) });
26566
26980
  z$2.object({ data: z$2.array(dataLakeResponseSchema) });
26567
26981
  z$2.object({ data: z$2.array(z$2.object(passthroughShape({
26568
26982
  id: true,
@@ -26597,7 +27011,8 @@ z$2.object({ data: z$2.array(z$2.object(passthroughShape({
26597
27011
  canRebuild: true,
26598
27012
  canManageSettings: true,
26599
27013
  canManageMemory: true,
26600
- retrievable: true
27014
+ retrievable: true,
27015
+ accessReason: true
26601
27016
  }))) });
26602
27017
  /** One detected corpus problem as the findings routes return it. */
26603
27018
  const lakeFindingResponseSchema = z$2.object(passthroughShape({
@@ -27133,7 +27548,7 @@ const PublicModelSchema = z$1.object({
27133
27548
  deprecation_date: z$1.string().nullable().describe("`YYYY-MM-DD`; null when no retirement is scheduled."),
27134
27549
  replaced_by: z$1.string().nullable().describe("The id of the recommended successor, when there is one."),
27135
27550
  image: PublicImageCapabilitiesSchema.nullable().describe("Size rules and supported parameters. Present on image models only; null for every other type."),
27136
- credits_per_1m_tokens: PublicModelCreditsPer1MTokensSchema.nullable().describe("What a call is billed, in credits per 1M tokens, at the base context tier. Use it to compare models by cost. Null on non-text models and on any model with no published price; never 0 for an unpriced model.")
27551
+ credits_per_1m_tokens: PublicModelCreditsPer1MTokensSchema.nullable().describe("What a call is billed, in credits per 1M tokens, at the base context tier and the list rate. Use it to compare models by cost. A model with off-peak pricing lists its peak rate here and bills less outside its peak hours. Null on non-text models and on any model with no published price; never 0 for an unpriced model.")
27137
27552
  });
27138
27553
  const ListModelsResponseSchema = paginatedResponseSchema(PublicModelSchema);
27139
27554
  const ClientConfigServerSchema = z$1.object({
@@ -27931,6 +28346,8 @@ const ArtifactResourceSchema = z$1.object({
27931
28346
  "organization",
27932
28347
  "public"
27933
28348
  ]),
28349
+ published: z$1.boolean().describe("Whether you have a published page for this artifact. Only your own pages count, never another owner's."),
28350
+ published_url: z$1.string().nullable().describe("The absolute URL of your published page for this artifact, or `null` when `published` is false."),
27934
28351
  created_at: z$1.string().describe("ISO 8601 timestamp."),
27935
28352
  updated_at: z$1.string().describe("ISO 8601 timestamp."),
27936
28353
  content: z$1.string().nullable().describe("The current version's content. `null` in a list (fetch the artifact by id for it), and in an update response to a caller who may edit the artifact but not read it, unless that update sent content.")
@@ -29048,9 +29465,42 @@ const DataLakeResourceSchema = z$1.object({
29048
29465
  total_size_bytes: z$1.number().nonnegative(),
29049
29466
  last_sync_at: z$1.string().nullable(),
29050
29467
  created_at: z$1.string().nullable(),
29051
- updated_at: z$1.string().nullable()
29468
+ updated_at: z$1.string().nullable(),
29469
+ access_reason: z$1.enum(LAKE_ACCESS_REASONS).describe("Why the caller can reach this lake, the first that applies in this order: `owner`, `manager`, `organization` (through their organization), `shared` (an access grant), `tag` (they hold its access tag or entitlement), `followed` (a public lake they follow), `public` (a public lake they do not follow). `followed` appears only on deployments where following is enabled."),
29470
+ is_followed: z$1.boolean().optional().describe("Whether the caller follows this lake. Present only on deployments where following is enabled.")
29052
29471
  });
29472
+ const ListDataLakesQuerySchema = PaginationQuerySchema.extend({ public_lakes: PublicLakeScopeSchema.default("all").describe(PUBLIC_LAKES_LIST_DESCRIPTION) });
29053
29473
  const ListDataLakesResponseSchema = paginatedResponseSchema(DataLakeResourceSchema);
29474
+ /** The caller's follow state for one lake after a follow or unfollow. */
29475
+ const DataLakeFollowResponseSchema = z$1.object({
29476
+ lake_id: z$1.string(),
29477
+ followed: z$1.boolean()
29478
+ });
29479
+ /**
29480
+ * One public lake in the discovery catalog. The owner is a display name only, never an email: the
29481
+ * catalog is readable across organizations.
29482
+ */
29483
+ const PublicDataLakeCardSchema = z$1.object({
29484
+ id: z$1.string(),
29485
+ name: z$1.string(),
29486
+ slug: z$1.string(),
29487
+ description: z$1.string().nullable(),
29488
+ owner_display_name: z$1.string().nullable(),
29489
+ file_count: z$1.number().int().nonnegative(),
29490
+ total_size_bytes: z$1.number().nonnegative(),
29491
+ is_own: z$1.boolean(),
29492
+ can_manage: z$1.boolean(),
29493
+ last_updated_at: z$1.string().nullable(),
29494
+ trusted_sites: z$1.array(z$1.string()).optional().describe("Up to 3 Always use sites from the lake's research configs. Present only on deployments where following is enabled."),
29495
+ follower_count: z$1.number().int().nonnegative().optional().describe("How many users follow the lake. Present only on deployments where following is enabled."),
29496
+ is_followed: z$1.boolean().optional().describe("Whether the caller follows the lake. Present only on deployments where following is enabled.")
29497
+ });
29498
+ /** The catalog pages at most 50 lakes at a time, below the shared 100 cap. */
29499
+ const ListPublicDataLakesQuerySchema = PaginationQuerySchema.extend({
29500
+ limit: z$1.coerce.number().int().min(1).max(50).default(25),
29501
+ search: z$1.string().min(1).max(200).optional().describe("Matches lake names and descriptions, ignoring case.")
29502
+ });
29503
+ const ListPublicDataLakesResponseSchema = paginatedResponseSchema(PublicDataLakeCardSchema);
29054
29504
  /** `id` is a lake id or its slug; an unknown value of either shape is a 404, never a 422. */
29055
29505
  const DataLakeIdParamSchema = z$1.object({ id: z$1.string().min(1) });
29056
29506
  /**
@@ -29385,6 +29835,15 @@ const ResearchConfigParamSchema = z$1.object({
29385
29835
  id: z$1.string().min(1),
29386
29836
  config_id: z$1.string().min(1)
29387
29837
  });
29838
+ const MoveResearchSiteRequestSchema = z$1.object({
29839
+ domain: z$1.string().min(1).max(2048).describe("A site host or address, such as `example.com`."),
29840
+ list: z$1.enum([
29841
+ "trusted",
29842
+ "review",
29843
+ "blocked",
29844
+ "none"
29845
+ ]).describe("`trusted` (Always use), `review` (Ask me first), `blocked` (Never use), or `none` to take it off all three.")
29846
+ }).strict();
29388
29847
  const ResearchRunParamSchema = z$1.object({
29389
29848
  id: z$1.string().min(1),
29390
29849
  run_id: z$1.string().min(1)
@@ -29791,12 +30250,21 @@ const ListProjectsResponseSchema = paginatedResponseSchema(ProjectResourceSchema
29791
30250
  * and a path-param schema failure would answer 422.
29792
30251
  */
29793
30252
  const ProjectIdParamSchema = z$1.object({ id: z$1.string().min(1) });
30253
+ const PROJECT_NAME_REQUIRED_MESSAGE = "Project name is required.";
30254
+ /**
30255
+ * Rejects empty names and names with no visible character. Does not trim, so a padded name passes
30256
+ * through unchanged. `abort` keeps an empty name to a single issue.
30257
+ */
30258
+ const ProjectNameSchema = z$1.string().min(1, {
30259
+ message: PROJECT_NAME_REQUIRED_MESSAGE,
30260
+ abort: true
30261
+ }).regex(/[^\s\u0000-\u001F\u007F-\u009F\u00AD\u034F\u061C\u115F\u1160\u17B4\u17B5\u180B-\u180F\u200B-\u200F\u202A-\u202E\u2060-\u206F\u2800\u3164\uFE00-\uFE0F\uFEFF\uFFA0\uFFF0-\uFFFB\uDC00-\uDFFF\uDB40]/, PROJECT_NAME_REQUIRED_MESSAGE);
29794
30262
  /**
29795
30263
  * Strict, so a camelCase `sessionIds`/`fileIds` (the SPA route's spelling) is a 422 rather than
29796
30264
  * silently dropped, which would create a project without the content the caller meant to attach.
29797
30265
  */
29798
30266
  const CreateProjectRequestSchema = z$1.object({
29799
- name: z$1.string().min(1).describe("Unique among your live projects."),
30267
+ name: ProjectNameSchema.describe("Unique among your live projects."),
29800
30268
  description: z$1.string().min(1),
29801
30269
  organization_id: z$1.string().min(1).optional().describe("Organization context for new content. Requires membership; immutable after creation."),
29802
30270
  session_ids: z$1.array(z$1.string().min(1)).max(500).optional().describe("Sessions to group in the project. Each must be readable by the caller."),
@@ -29804,7 +30272,7 @@ const CreateProjectRequestSchema = z$1.object({
29804
30272
  }).strict();
29805
30273
  /** Strict for the same reason as the create body. Omitted fields are left unchanged. */
29806
30274
  const UpdateProjectRequestSchema = z$1.object({
29807
- name: z$1.string().min(1).optional().describe("Unique among your live projects."),
30275
+ name: ProjectNameSchema.optional().describe("Unique among your live projects."),
29808
30276
  description: z$1.string().min(1).optional()
29809
30277
  }).strict();
29810
30278
  /**
@@ -31393,6 +31861,10 @@ defineEndpoint({
31393
31861
  500: {
31394
31862
  description: "The fetch failed, or an unexpected server error.",
31395
31863
  schema: ApiErrorSchema
31864
+ },
31865
+ 502: {
31866
+ description: "The page-reading service could not be reached. Nothing is charged; retry later.",
31867
+ schema: ApiErrorSchema
31396
31868
  }
31397
31869
  },
31398
31870
  emitsRateLimitHeaders: true,
@@ -32352,7 +32824,7 @@ defineEndpoint({
32352
32824
  }
32353
32825
  } }
32354
32826
  });
32355
- const JWT_ONLY_NOTE$3 = "Authenticate with a JWT access token of the signed-in user: an API key cannot answer an approval. The caller must own the session the action belongs to; anyone else gets `404`, exactly like a missing action. Nothing in a push notification authorizes this call. ";
32827
+ const JWT_ONLY_NOTE$4 = "Authenticate with a JWT access token of the signed-in user: an API key cannot answer an approval. The caller must own the session the action belongs to; anyone else gets `404`, exactly like a missing action. Nothing in a push notification authorizes this call. ";
32356
32828
  const LIFECYCLE = "An approval is answered once and only while it is current: it lapses 15 minutes after it was raised, and a newer approval on the same quest replaces it.";
32357
32829
  const CONFLICT = "The action was replaced by a newer one (`errorCode: action_replaced`), lapsed (`action_expired`, and it is cleared), or was already answered (`action_already_resolved`). Also a custom connector tool that is no longer offered. Do not retry; review the quest for a newer approval.";
32358
32830
  const REQUEST_EXAMPLE = { pendingActionTs: 17672256e5 };
@@ -32361,7 +32833,7 @@ defineEndpoint({
32361
32833
  path: "/api/v1/pending-actions/{questId}/approve",
32362
32834
  operationId: "approvePendingAction",
32363
32835
  summary: "Approve an agent action",
32364
- description: "Approves the tool call an agent is waiting on and runs it. " + LIFECYCLE + " " + JWT_ONLY_NOTE$3,
32836
+ description: "Approves the tool call an agent is waiting on and runs it. " + LIFECYCLE + " " + JWT_ONLY_NOTE$4,
32365
32837
  tags: ["AI"],
32366
32838
  auth: "jwtOnly",
32367
32839
  pathParams: PendingActionParamSchema,
@@ -32416,7 +32888,7 @@ defineEndpoint({
32416
32888
  path: "/api/v1/pending-actions/{questId}/deny",
32417
32889
  operationId: "denyPendingAction",
32418
32890
  summary: "Deny an agent action",
32419
- description: "Declines the tool call an agent is waiting on; nothing runs. " + LIFECYCLE + " " + JWT_ONLY_NOTE$3,
32891
+ description: "Declines the tool call an agent is waiting on; nothing runs. " + LIFECYCLE + " " + JWT_ONLY_NOTE$4,
32420
32892
  tags: ["AI"],
32421
32893
  auth: "jwtOnly",
32422
32894
  pathParams: PendingActionParamSchema,
@@ -32454,13 +32926,13 @@ defineEndpoint({
32454
32926
  body: REQUEST_EXAMPLE
32455
32927
  }
32456
32928
  });
32457
- const JWT_ONLY_NOTE$2 = "Authenticate with a JWT access token of the signed-in user. A brief is readable only by the user it was composed for; anyone else gets `404`, exactly like a missing brief. Nothing in a push notification authorizes this call. ";
32929
+ const JWT_ONLY_NOTE$3 = "Authenticate with a JWT access token of the signed-in user. A brief is readable only by the user it was composed for; anyone else gets `404`, exactly like a missing brief. Nothing in a push notification authorizes this call. ";
32458
32930
  defineEndpoint({
32459
32931
  method: "post",
32460
32932
  path: "/api/v1/briefs",
32461
32933
  operationId: "composeBrief",
32462
32934
  summary: "Compose a brief",
32463
- description: "Asks the assistant to compose a brief of what happened since the last one, what it handled and what needs a decision. Composition is asynchronous: the response is the brief in `composing` status, and a `brief_ready` push (or polling `GET /api/v1/briefs/{id}`) signals `ready` or `failed`. Idempotent while a brief is composing: the same brief is returned instead of starting another. " + JWT_ONLY_NOTE$2,
32935
+ description: "Asks the assistant to compose a brief of what happened since the last one, what it handled and what needs a decision. Composition is asynchronous: the response is the brief in `composing` status, and a `brief_ready` push (or polling `GET /api/v1/briefs/{id}`) signals `ready` or `failed`. Idempotent while a brief is composing: the same brief is returned instead of starting another. " + JWT_ONLY_NOTE$3,
32464
32936
  tags: ["AI"],
32465
32937
  auth: "jwtOnly",
32466
32938
  responses: {
@@ -32487,7 +32959,7 @@ defineEndpoint({
32487
32959
  path: "/api/v1/briefs/follow-ups",
32488
32960
  operationId: "composeFollowUpBrief",
32489
32961
  summary: "Compose follow-ups from a dictated memo",
32490
- description: "Turns a dictated memo (the transcript of a voice note after a meeting or call) into a brief whose decisions propose follow-ups: action items, a follow-up email draft and reminders, each carrying `followUp` in `pending` state. Nothing is sent or scheduled until you approve a decision. Composition is asynchronous like `POST /api/v1/briefs`: the response is the brief in `composing` status, then a `brief_ready` push (or polling `GET /api/v1/briefs/{id}`) signals `ready` or `failed`. Every call starts a new brief, and a follow-up brief does not change the window the next activity brief covers. " + JWT_ONLY_NOTE$2,
32962
+ description: "Turns a dictated memo (the transcript of a voice note after a meeting or call) into a brief whose decisions propose follow-ups: action items, a follow-up email draft and reminders, each carrying `followUp` in `pending` state. Nothing is sent or scheduled until you approve a decision. Composition is asynchronous like `POST /api/v1/briefs`: the response is the brief in `composing` status, then a `brief_ready` push (or polling `GET /api/v1/briefs/{id}`) signals `ready` or `failed`. Every call starts a new brief, and a follow-up brief does not change the window the next activity brief covers. " + JWT_ONLY_NOTE$3,
32491
32963
  tags: ["AI"],
32492
32964
  auth: "jwtOnly",
32493
32965
  request: BriefFollowUpRequestSchema,
@@ -32523,7 +32995,7 @@ defineEndpoint({
32523
32995
  path: "/api/v1/briefs",
32524
32996
  operationId: "listBriefs",
32525
32997
  summary: "List briefs",
32526
- description: "Lists your most recent briefs (up to 20), newest first. A brief composed from a dictated memo is not listed; read it by id. " + JWT_ONLY_NOTE$2,
32998
+ description: "Lists your most recent briefs (up to 20), newest first. A brief composed from a dictated memo is not listed; read it by id. " + JWT_ONLY_NOTE$3,
32527
32999
  tags: ["AI"],
32528
33000
  auth: "jwtOnly",
32529
33001
  responses: {
@@ -32550,7 +33022,7 @@ defineEndpoint({
32550
33022
  path: "/api/v1/briefs/{id}",
32551
33023
  operationId: "getBrief",
32552
33024
  summary: "Get a brief",
32553
- description: "Reads one brief. Decision items that reference an agent approval carry its `questId` and `pendingActionTs`; answer it through the pending-actions endpoints. Items triaged from an ingested email carry a `source`, and an email decision may carry a `draftReply` for you to review; nothing sends it. " + JWT_ONLY_NOTE$2,
33025
+ description: "Reads one brief. Decision items that reference an agent approval carry its `questId` and `pendingActionTs`; answer it through the pending-actions endpoints. Items triaged from an ingested email carry a `source`, and an email decision may carry a `draftReply` for you to review; nothing sends it. " + JWT_ONLY_NOTE$3,
32554
33026
  tags: ["AI"],
32555
33027
  auth: "jwtOnly",
32556
33028
  pathParams: BriefIdParamSchema,
@@ -32725,7 +33197,7 @@ defineEndpoint({
32725
33197
  path: "/api/v1/briefs/{id}/decisions/{decisionId}/reply",
32726
33198
  operationId: "replyToBriefDecision",
32727
33199
  summary: "Reply to a brief question",
32728
- description: "Answers a decision item that carries a `question`: the reply is sent to the agent as your next message in that notebook, starting an agent run. A question can be answered from the brief once; a second reply, or one after the conversation moved on (`state` other than `open`), is `409` with `errorCode: \"question_closed\"`. A decision that is an approval is `404` here; answer it through the pending-actions endpoints. " + JWT_ONLY_NOTE$2,
33200
+ description: "Answers a decision item that carries a `question`: the reply is sent to the agent as your next message in that notebook, starting an agent run. A question can be answered from the brief once; a second reply, or one after the conversation moved on (`state` other than `open`), is `409` with `errorCode: \"question_closed\"`. A decision that is an approval is `404` here; answer it through the pending-actions endpoints. " + JWT_ONLY_NOTE$3,
32729
33201
  tags: ["AI"],
32730
33202
  auth: "jwtOnly",
32731
33203
  pathParams: BriefDecisionParamsSchema,
@@ -32796,7 +33268,7 @@ defineEndpoint({
32796
33268
  path: "/api/v1/briefs/{id}/decisions/{decisionId}",
32797
33269
  operationId: "editBriefDecision",
32798
33270
  summary: "Edit a proposed follow-up",
32799
- description: "Changes a follow-up decision (one carrying `followUp`) while it is still `pending`: `text` on any kind, `draftReply` fields only on a `followUpEmail`, `remindAt` only on a `reminder`. The response is the updated decision. Once the follow-up is approved or dismissed it cannot change; that is `409` with `errorCode: \"decision_closed\"`. " + JWT_ONLY_NOTE$2,
33271
+ description: "Changes a follow-up decision (one carrying `followUp`) while it is still `pending`: `text` on any kind, `draftReply` fields only on a `followUpEmail`, `remindAt` only on a `reminder`. The response is the updated decision. Once the follow-up is approved or dismissed it cannot change; that is `409` with `errorCode: \"decision_closed\"`. " + JWT_ONLY_NOTE$3,
32800
33272
  tags: ["AI"],
32801
33273
  auth: "jwtOnly",
32802
33274
  pathParams: BriefDecisionParamsSchema,
@@ -32823,7 +33295,7 @@ defineEndpoint({
32823
33295
  path: "/api/v1/briefs/{id}/decisions/{decisionId}/resolve",
32824
33296
  operationId: "resolveBriefDecision",
32825
33297
  summary: "Approve or dismiss a proposed follow-up",
32826
- description: "Approves or dismisses a `pending` follow-up decision, once; the response is the updated decision. Approving records your approval and nothing more: the server never sends a `followUpEmail` (hand the approved `draftReply` to the device mail app) and needs `draftReply.to` to be an email address first. An approved `reminder` needs a `remindAt` and is listed in the first brief composed at or after it; with a brief schedule on, the next scheduled brief is moved earlier to that time. A second approve or dismiss is `409` with `errorCode: \"decision_closed\"`. " + JWT_ONLY_NOTE$2,
33298
+ description: "Approves or dismisses a `pending` follow-up decision, once; the response is the updated decision. Approving records your approval and nothing more: the server never sends a `followUpEmail` (hand the approved `draftReply` to the device mail app) and needs `draftReply.to` to be an email address first. An approved `reminder` needs a `remindAt` and is listed in the first brief composed at or after it; with a brief schedule on, the next scheduled brief is moved earlier to that time. A second approve or dismiss is `409` with `errorCode: \"decision_closed\"`. " + JWT_ONLY_NOTE$3,
32827
33299
  tags: ["AI"],
32828
33300
  auth: "jwtOnly",
32829
33301
  pathParams: BriefDecisionParamsSchema,
@@ -33136,13 +33608,13 @@ defineEndpoint({
33136
33608
  body: { status: "confirmed" }
33137
33609
  }
33138
33610
  });
33139
- 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. ";
33611
+ const JWT_ONLY_NOTE$2 = "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. ";
33140
33612
  defineEndpoint({
33141
33613
  method: "post",
33142
33614
  path: "/api/v1/push-tokens",
33143
33615
  operationId: "registerPushToken",
33144
33616
  summary: "Register a device push token",
33145
- description: "Registers a push token for the signed-in device so the server can notify it. Idempotent: re-registering the same token refreshes it and rebinds it to the calling user and session, which is how a token moves when a different account signs in on the same device. The token is removed automatically when the registering session ends. `platform` selects the delivery service: `ios` (APNs) or `android` (FCM; send `production` as the environment). " + JWT_ONLY_NOTE$1 + "A token with no session claim (legacy access token) is refused with `401`; sign in again.",
33617
+ description: "Registers a push token for the signed-in device so the server can notify it. Idempotent: re-registering the same token refreshes it and rebinds it to the calling user and session, which is how a token moves when a different account signs in on the same device. The token is removed automatically when the registering session ends. `platform` selects the delivery service: `ios` (APNs) or `android` (FCM; send `production` as the environment). " + JWT_ONLY_NOTE$2 + "A token with no session claim (legacy access token) is refused with `401`; sign in again.",
33146
33618
  tags: ["Account"],
33147
33619
  auth: "jwtOnly",
33148
33620
  request: PushTokenRegisterRequestSchema,
@@ -33183,7 +33655,7 @@ defineEndpoint({
33183
33655
  path: "/api/v1/push-tokens",
33184
33656
  operationId: "unregisterPushToken",
33185
33657
  summary: "Unregister a device push token",
33186
- description: "Removes a push token so the server stops notifying it. Succeeds whether or not the token was registered, so a client can call it unconditionally on sign-out. Only the token owner can remove it: a token registered by another user is left in place and the call still succeeds. " + JWT_ONLY_NOTE$1,
33658
+ description: "Removes a push token so the server stops notifying it. Succeeds whether or not the token was registered, so a client can call it unconditionally on sign-out. Only the token owner can remove it: a token registered by another user is left in place and the call still succeeds. " + JWT_ONLY_NOTE$2,
33187
33659
  tags: ["Account"],
33188
33660
  auth: "jwtOnly",
33189
33661
  request: PushTokenUnregisterRequestSchema,
@@ -33394,7 +33866,7 @@ defineEndpoint({
33394
33866
  tags: ["Models"],
33395
33867
  auth: "apiKeyOrJwt",
33396
33868
  scopes: ["ai:chat", "ai:generate"],
33397
- queryParams: PaginationQuerySchema,
33869
+ queryParams: PaginationQuerySchema.extend({ organization_id: z$1.string().regex(/^[0-9a-f]{24}$/, "organization_id must be an organization id").optional().describe("List the models a call billed to this organization can use (its model policy applies). Omitted: the organization a call with no `organization_id` bills. You must be a member.") }),
33398
33870
  emitsRateLimitHeaders: true,
33399
33871
  responses: {
33400
33872
  200: {
@@ -33486,6 +33958,14 @@ defineEndpoint({
33486
33958
  next_cursor: null
33487
33959
  }
33488
33960
  },
33961
+ 400: {
33962
+ description: "The organization-billed API key's organization no longer exists, or its holder left it.",
33963
+ schema: ApiErrorSchema
33964
+ },
33965
+ 403: {
33966
+ description: "The caller cannot bill the named `organization_id`, or an organization-billed API key named another one (`errorCode: \"billing_organization_mismatch\"`).",
33967
+ schema: ApiErrorSchema
33968
+ },
33489
33969
  422: {
33490
33970
  description: "`limit` is out of range, or `cursor` is malformed or was issued by a different endpoint. A cursor is opaque: pass back exactly the `next_cursor` you were given.",
33491
33971
  schema: ApiErrorSchema
@@ -34808,6 +35288,8 @@ const ARTIFACT_EXAMPLE = {
34808
35288
  session_id: "<sessionId>",
34809
35289
  project_id: null,
34810
35290
  visibility: "private",
35291
+ published: false,
35292
+ published_url: null,
34811
35293
  created_at: "2026-10-01T12:00:00.000Z",
34812
35294
  updated_at: "2026-10-02T09:30:00.000Z",
34813
35295
  content: "graph TD; A[Sign up] --> B[Verify email]"
@@ -35547,7 +36029,7 @@ defineEndpoint({
35547
36029
  path: "/api/v1/sessions/{id}/quests",
35548
36030
  operationId: "listSessionQuests",
35549
36031
  summary: "List a session's quests",
35550
- description: "Lists the turns (quests) of a session's conversation, oldest first: what was sent, the visible reply, its status and the credits it cost. Works for a session you own or one shared with you. Cursor-paginated (see the pagination convention): pass `next_cursor` back as `cursor` until it is `null`. Re-read a non-terminal turn with `GET /api/v1/quests/{id}`. While a tool awaits approval the turn carries `pendingAction` (owner only). Deleted turns are not listed. A session that does not exist, was deleted, or is not visible to you is `404`. An API key needs `notebooks:read` or `notebooks:write`.",
36032
+ description: "Lists the turns (quests) of a session's conversation, oldest first by default (`order=desc` for newest first): what was sent, the visible reply, its status and the credits it cost. Works for a session you own or one shared with you. Cursor-paginated (see the pagination convention): pass `next_cursor` back as `cursor` until it is `null`. Re-read a non-terminal turn with `GET /api/v1/quests/{id}`. While a tool awaits approval the turn carries `pendingAction` (owner only). Deleted turns are not listed. A session that does not exist, was deleted, or is not visible to you is `404`. An API key needs `notebooks:read` or `notebooks:write`.",
35551
36033
  tags: ["Sessions"],
35552
36034
  auth: "apiKeyOrJwt",
35553
36035
  scopes: ["notebooks:read", "notebooks:write"],
@@ -35556,7 +36038,7 @@ defineEndpoint({
35556
36038
  emitsRateLimitHeaders: true,
35557
36039
  responses: {
35558
36040
  200: {
35559
- description: "One page of quests, oldest first.",
36041
+ description: "One page of quests, in the requested `order` (oldest first by default).",
35560
36042
  schema: ListSessionQuestsResponseSchema
35561
36043
  },
35562
36044
  403: {
@@ -35568,7 +36050,7 @@ defineEndpoint({
35568
36050
  schema: ApiErrorSchema
35569
36051
  },
35570
36052
  422: {
35571
- description: "`limit` is out of range, or `cursor` is malformed or was issued by a different endpoint. A cursor is opaque: pass back exactly the `next_cursor` you were given.",
36053
+ description: "`limit` or `order` is out of range, or `cursor` is malformed, was issued by a different endpoint, or was issued for the other `order`. A cursor is opaque: pass back exactly the `next_cursor` you were given, with the same `order`.",
35572
36054
  schema: ApiErrorSchema
35573
36055
  },
35574
36056
  429: {
@@ -35900,11 +36382,11 @@ defineEndpoint({
35900
36382
  path: "/api/v1/data-lakes",
35901
36383
  operationId: "listDataLakes",
35902
36384
  summary: "List data lakes",
35903
- description: "Lists the data lakes the caller can reach as a member: lakes they own, lakes shared with them through an organization or an access grant, public lakes, and the built-in lakes their plan entitles them to. Platform-administrator reach is deliberately NOT applied here, so an admin key lists its owner's own lakes rather than every lake on the platform. Only `draft` and `active` lakes are listed. Cursor-paginated (see the pagination convention): pass `next_cursor` back as `cursor` until it is `null`.",
36385
+ description: "Lists the data lakes the caller can reach as a member: lakes they own, lakes shared with them through an organization or an access grant, public lakes, and the built-in lakes their plan entitles them to. Each lake carries `access_reason`, which says why it is listed. By default every public lake is listed, followed or not; pass `public_lakes=followed` to drop public lakes you do not follow. Platform-administrator reach is deliberately NOT applied here, so an admin key lists its owner's own lakes rather than every lake on the platform. Only `draft` and `active` lakes are listed. Cursor-paginated (see the pagination convention): pass `next_cursor` back as `cursor` until it is `null`.",
35904
36386
  tags: ["Data Lakes"],
35905
36387
  auth: "apiKeyOrJwt",
35906
36388
  scopes: DATA_LAKE_READ_API_KEY_SCOPES,
35907
- queryParams: PaginationQuerySchema,
36389
+ queryParams: ListDataLakesQuerySchema,
35908
36390
  emitsRateLimitHeaders: true,
35909
36391
  responses: {
35910
36392
  200: {
@@ -35916,7 +36398,7 @@ defineEndpoint({
35916
36398
  schema: ScopeForbiddenErrorSchema
35917
36399
  },
35918
36400
  422: {
35919
- description: "`limit` is out of range, or `cursor` is malformed or was issued by a different endpoint. A cursor is opaque: pass back exactly the `next_cursor` you were given.",
36401
+ description: "`limit` is out of range, `public_lakes` is not `all` or `followed`, or `cursor` is malformed or was issued by a different endpoint. A cursor is opaque: pass back exactly the `next_cursor` you were given.",
35920
36402
  schema: ApiErrorSchema
35921
36403
  },
35922
36404
  429: {
@@ -36129,6 +36611,111 @@ defineEndpoint({
36129
36611
  }
36130
36612
  }
36131
36613
  });
36614
+ defineEndpoint({
36615
+ method: "post",
36616
+ path: "/api/v1/data-lakes/{id}/follow",
36617
+ operationId: "followDataLake",
36618
+ summary: "Follow a public data lake",
36619
+ description: `Follows a public, active lake the caller can read, so the assistant can use it without being pointed at it where following is enabled. Takes no body. Idempotent: following a lake already followed succeeds and changes nothing. Takes the lake id, not its slug. Following is the caller's own choice and is not recorded in the lake's History. Following is recorded whether or not this deployment has following enabled; where it is not, a follow changes nothing a caller can observe until it is.`,
36620
+ tags: ["Data Lakes"],
36621
+ auth: "apiKeyOrJwt",
36622
+ scopes: DATA_LAKE_WRITE_API_KEY_SCOPES,
36623
+ pathParams: DataLakeIdParamSchema,
36624
+ emitsRateLimitHeaders: true,
36625
+ responses: {
36626
+ 200: {
36627
+ description: "The caller follows the lake.",
36628
+ schema: DataLakeFollowResponseSchema
36629
+ },
36630
+ 403: {
36631
+ description: `The API key lacks \`datalake:write\`, ${FEATURE_DISABLED_NOTE$1}.`,
36632
+ schema: ScopeForbiddenErrorSchema
36633
+ },
36634
+ 404: {
36635
+ description: "No public, active lake with that id is visible to the caller. A private lake, a draft or archived lake, a lake the caller cannot read, an unknown id and a malformed id all get this same 404.",
36636
+ schema: ApiErrorSchema
36637
+ },
36638
+ 429: {
36639
+ description: "Per-user rate limit exceeded.",
36640
+ schema: ApiErrorSchema
36641
+ }
36642
+ },
36643
+ codeSample: {
36644
+ authToken: "b4m_live_<key>",
36645
+ streaming: false,
36646
+ body: {}
36647
+ }
36648
+ });
36649
+ defineEndpoint({
36650
+ method: "delete",
36651
+ path: "/api/v1/data-lakes/{id}/follow",
36652
+ operationId: "unfollowDataLake",
36653
+ summary: "Unfollow a data lake",
36654
+ description: "Stops following a lake. Succeeds for any well-formed lake id, including a lake the caller does not follow or cannot see, and checks no lake access, so it reveals nothing about the id. Takes the lake id, not its slug: a slug or malformed id gets the same not-found error as follow. Unfollowing never removes a lake the caller reaches some other way, such as their own lake or one shared with them.",
36655
+ tags: ["Data Lakes"],
36656
+ auth: "apiKeyOrJwt",
36657
+ scopes: DATA_LAKE_WRITE_API_KEY_SCOPES,
36658
+ pathParams: DataLakeIdParamSchema,
36659
+ emitsRateLimitHeaders: true,
36660
+ responses: {
36661
+ 200: {
36662
+ description: "The caller does not follow the lake.",
36663
+ schema: DataLakeFollowResponseSchema
36664
+ },
36665
+ 403: {
36666
+ description: `The API key lacks \`datalake:write\`, ${FEATURE_DISABLED_NOTE$1}.`,
36667
+ schema: ScopeForbiddenErrorSchema
36668
+ },
36669
+ 404: {
36670
+ description: "The id is not a well-formed lake id, such as a slug. A well-formed id never gets this 404.",
36671
+ schema: ApiErrorSchema
36672
+ },
36673
+ 429: {
36674
+ description: "Per-user rate limit exceeded.",
36675
+ schema: ApiErrorSchema
36676
+ }
36677
+ },
36678
+ codeSample: {
36679
+ authToken: "b4m_live_<key>",
36680
+ streaming: false,
36681
+ body: {}
36682
+ }
36683
+ });
36684
+ defineEndpoint({
36685
+ method: "get",
36686
+ path: "/api/v1/public-data-lakes",
36687
+ operationId: "listPublicDataLakes",
36688
+ summary: "Discover public data lakes",
36689
+ description: "Lists the public, active lakes the caller can find, ordered by name, to choose one to follow. A public lake restricted to an access tag or entitlement is listed only to callers who hold it. The owner is shown by display name, never by email. `search` narrows to lakes whose name or description contains it. Cursor-paginated (see the pagination convention): pass `next_cursor` back as `cursor` with the same `search` until it is `null`. `follower_count`, `is_followed` and `trusted_sites` are present only on deployments where following is enabled.",
36690
+ tags: ["Data Lakes"],
36691
+ auth: "apiKeyOrJwt",
36692
+ scopes: DATA_LAKE_READ_API_KEY_SCOPES,
36693
+ queryParams: ListPublicDataLakesQuerySchema,
36694
+ emitsRateLimitHeaders: true,
36695
+ responses: {
36696
+ 200: {
36697
+ description: "One page of public lakes, ordered by name.",
36698
+ schema: ListPublicDataLakesResponseSchema
36699
+ },
36700
+ 403: {
36701
+ description: `The API key holds none of \`datalake:read\`, \`datalake:write\` or \`datalake:query\`, ${FEATURE_DISABLED_NOTE$1}.`,
36702
+ schema: ScopeForbiddenErrorSchema
36703
+ },
36704
+ 422: {
36705
+ description: "`limit` is out of range, `search` is empty or too long, or `cursor` is malformed or was issued by a different endpoint. A cursor is opaque: pass back exactly the `next_cursor` you were given.",
36706
+ schema: ApiErrorSchema
36707
+ },
36708
+ 429: {
36709
+ description: "Per-user rate limit exceeded.",
36710
+ schema: ApiErrorSchema
36711
+ }
36712
+ },
36713
+ codeSample: {
36714
+ authToken: "b4m_live_<key>",
36715
+ streaming: false,
36716
+ body: {}
36717
+ }
36718
+ });
36132
36719
  /**
36133
36720
  * Lake research over the public API: saved research configs, runs, the proposal review queue and
36134
36721
  * the config-change history. Each route is the `/api/v1` twin of an SPA route under
@@ -36324,6 +36911,54 @@ defineEndpoint({
36324
36911
  body: UPDATE_CONFIG_EXAMPLE
36325
36912
  }
36326
36913
  });
36914
+ const MOVE_SITE_EXAMPLE = {
36915
+ domain: "example.com",
36916
+ list: "blocked"
36917
+ };
36918
+ defineEndpoint({
36919
+ method: "post",
36920
+ path: "/api/v1/data-lakes/{id}/research/configs/{config_id}/sites",
36921
+ operationId: "moveDataLakeResearchSite",
36922
+ summary: "Move a site between research lists",
36923
+ description: "Puts one site on a config's Always use (`trusted`), Ask me first (`review`) or Never use (`blocked`) list, taking it off the other two, or takes it off all three (`none`). Only the three lists change, so one site can be moved without resending the rest of the config. A move that changes nothing succeeds and records nothing. Each move appears in the lake's History and can usually be undone there.",
36924
+ tags: ["Data Lake Research"],
36925
+ auth: "apiKeyOrJwt",
36926
+ scopes: DATA_LAKE_WRITE_API_KEY_SCOPES,
36927
+ pathParams: ResearchConfigParamSchema,
36928
+ request: MoveResearchSiteRequestSchema,
36929
+ requestExample: MOVE_SITE_EXAMPLE,
36930
+ emitsRateLimitHeaders: true,
36931
+ responses: {
36932
+ 200: {
36933
+ description: "The config with its updated lists.",
36934
+ schema: ResearchConfigResponseSchema
36935
+ },
36936
+ 400: {
36937
+ description: "The move is refused and nothing changed. The message says why: `domain` is not a site address, the target list already holds its maximum, a parent domain is on Never use and already covers the site, the move would leave the config with no site it may search, or it would let unreviewed results in from a site that is not safe to admit automatically.",
36938
+ schema: ApiErrorSchema
36939
+ },
36940
+ 403: {
36941
+ description: WRITE_FORBIDDEN$5,
36942
+ schema: ScopeForbiddenErrorSchema
36943
+ },
36944
+ 404: {
36945
+ description: `${NOT_VISIBLE_LAKE} The same 404 answers a config that does not exist in this lake.`,
36946
+ schema: ApiErrorSchema
36947
+ },
36948
+ 422: {
36949
+ description: BODY_422$2,
36950
+ schema: ApiErrorSchema
36951
+ },
36952
+ 429: {
36953
+ description: RATE_LIMITED$3,
36954
+ schema: ApiErrorSchema
36955
+ }
36956
+ },
36957
+ codeSample: {
36958
+ ...codeSample$2,
36959
+ body: MOVE_SITE_EXAMPLE
36960
+ }
36961
+ });
36327
36962
  defineEndpoint({
36328
36963
  method: "delete",
36329
36964
  path: "/api/v1/data-lakes/{id}/research/configs/{config_id}",
@@ -40070,6 +40705,522 @@ defineEndpoint({
40070
40705
  body: {}
40071
40706
  }
40072
40707
  });
40708
+ const DNS_LABEL_PATTERN = /^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/;
40709
+ const RESERVED_IDNA_PATTERN = /^..--/;
40710
+ const IPV4_LOOKING_PATTERN = /^(?:[0-9]+|0x[0-9a-f]*)$/;
40711
+ /**
40712
+ * An installed app's id, which is also the host of its origin. It must survive a URL host parse
40713
+ * unchanged, so it is a lowercase DNS label that no parser would rewrite as IDNA or IPv4.
40714
+ * Minted by the server; a raw ObjectId is valid unless it happens to be all digits.
40715
+ */
40716
+ const AppIdSchema = z$1.string().regex(DNS_LABEL_PATTERN, "App id must be a lowercase hostname label (a-z, 0-9, inner hyphens, 1-63 chars)").refine((value) => !RESERVED_IDNA_PATTERN.test(value), "App id must not use a reserved IDNA prefix").refine((value) => !IPV4_LOOKING_PATTERN.test(value), "App id must not parse as an IPv4 number").brand();
40717
+ const ObjectIdStringSchema$5 = z$1.string().regex(/^[a-f0-9]{24}$/, "Not a valid id");
40718
+ /** Artifact versions are positive integers (see ArtifactTypes `version`). */
40719
+ const ArtifactVersionNumberSchema = z$1.int().positive();
40720
+ /** Wire timestamps are ISO 8601 strings with an offset. */
40721
+ const IsoTimestampSchema = z$1.iso.datetime({ offset: true });
40722
+ /** True when no two items share a key; linear in the list length. */
40723
+ function hasUniqueKeys(items, key) {
40724
+ return new Set(items.map(key)).size === items.length;
40725
+ }
40726
+ z$1.enum([
40727
+ "browser",
40728
+ "abilities",
40729
+ "machine"
40730
+ ]);
40731
+ const AppFileAccessSchema = z$1.enum(["read", "read_write"]);
40732
+ /**
40733
+ * A capability as an app's manifest REQUESTS it: the kind, plus the mode the app needs. It names
40734
+ * no user resources; those are chosen at consent time and live on the grant.
40735
+ *
40736
+ * Adding a capability: a variant here and in AppGrantedCapabilitySchema, its tier in
40737
+ * APP_CAPABILITY_TIER and its case in appGrantCovers (the compiler flags the last two).
40738
+ */
40739
+ const AppCapabilityRequestSchema = z$1.discriminatedUnion("kind", [
40740
+ z$1.object({ kind: z$1.literal("notifications") }),
40741
+ z$1.object({ kind: z$1.literal("tray") }),
40742
+ z$1.object({ kind: z$1.literal("global_shortcuts") }),
40743
+ z$1.object({ kind: z$1.literal("always_on_top") }),
40744
+ z$1.object({ kind: z$1.literal("llm") }),
40745
+ z$1.object({ kind: z$1.literal("connectors") }),
40746
+ z$1.object({ kind: z$1.literal("run_programs") }),
40747
+ z$1.object({
40748
+ kind: z$1.literal("file_system"),
40749
+ access: AppFileAccessSchema
40750
+ })
40751
+ ]);
40752
+ AppCapabilityRequestSchema.options.map((option) => option.shape.kind.value);
40753
+ /**
40754
+ * A folder the user picked for file access. `root_id` is an opaque handle; the absolute path
40755
+ * behind it stays on the device that picked it and is never sent to the server, so another
40756
+ * device asks the user to pick again.
40757
+ */
40758
+ const AppFileRootSchema = z$1.object({
40759
+ root_id: z$1.string().min(1).max(128),
40760
+ label: z$1.string().min(1).max(200)
40761
+ });
40762
+ /** How far `run_programs` reaches. Only `unrestricted` exists today; narrower scopes are additive. */
40763
+ const AppProgramScopeSchema = z$1.discriminatedUnion("type", [z$1.object({ type: z$1.literal("unrestricted") })]);
40764
+ /**
40765
+ * A capability as the user GRANTED it: the request's kind and mode plus the scope the user chose.
40766
+ * Kinds without a scope are identical to their request.
40767
+ */
40768
+ const AppGrantedCapabilitySchema = z$1.discriminatedUnion("kind", [
40769
+ z$1.object({ kind: z$1.literal("notifications") }),
40770
+ z$1.object({ kind: z$1.literal("tray") }),
40771
+ z$1.object({ kind: z$1.literal("global_shortcuts") }),
40772
+ z$1.object({ kind: z$1.literal("always_on_top") }),
40773
+ z$1.object({ kind: z$1.literal("llm") }),
40774
+ z$1.object({
40775
+ kind: z$1.literal("connectors"),
40776
+ connector_ids: z$1.array(z$1.string().min(1).max(128)).min(1).max(100).refine((ids) => hasUniqueKeys(ids, (id) => id), "Each connector may be granted once")
40777
+ }),
40778
+ z$1.object({
40779
+ kind: z$1.literal("run_programs"),
40780
+ scope: AppProgramScopeSchema
40781
+ }),
40782
+ z$1.object({
40783
+ kind: z$1.literal("file_system"),
40784
+ access: AppFileAccessSchema,
40785
+ roots: z$1.array(AppFileRootSchema).min(1).max(20).refine((roots) => hasUniqueKeys(roots, (root) => root.root_id), "Each root may be granted once")
40786
+ })
40787
+ ]);
40788
+ const ONE_PER_KIND$1 = "Each capability kind may appear at most once";
40789
+ /** A manifest's requested capabilities: at most one per kind. */
40790
+ const AppCapabilityRequestSetSchema = z$1.array(AppCapabilityRequestSchema).refine((requests) => hasUniqueKeys(requests, (request) => request.kind), ONE_PER_KIND$1);
40791
+ /** A set of granted capabilities: at most one per kind. */
40792
+ const AppGrantedCapabilitySetSchema = z$1.array(AppGrantedCapabilitySchema).refine((grants) => hasUniqueKeys(grants, (grant) => grant.kind), ONE_PER_KIND$1);
40793
+ const AppBridgeApiVersionSchema = z$1.int().min(1);
40794
+ /**
40795
+ * A file path inside an app bundle, relative to the app origin root: forward slashes, no leading
40796
+ * slash, no empty, `.` or `..` segments. Served as `b4m-app://<appId>/<path>`.
40797
+ */
40798
+ const AppBundlePathSchema = z$1.string().min(1).max(512).regex(/^[\x20-\x22\x24\x26-\x3e\x40-\x5b\x5d-\x7e]+$/, "Bundle path must be printable ASCII without \\, ?, # or %").refine((path) => path.split("/").every((segment) => segment !== "" && segment !== "." && segment !== ".."), "Bundle path must be relative, with no empty, \".\" or \"..\" segments");
40799
+ const NonBlankStringSchema = (max) => z$1.string().max(max).regex(/\S/, "Must not be blank");
40800
+ /** An app's manifest, built into its bundle from a pinned artifact version. */
40801
+ const AppManifestSchema = z$1.object({
40802
+ manifest_version: z$1.literal(1),
40803
+ api_version: AppBridgeApiVersionSchema,
40804
+ name: NonBlankStringSchema(80),
40805
+ description: NonBlankStringSchema(500).optional(),
40806
+ /** Bundle-relative path to the app icon (SVG or PNG); absent means the host draws a default. */
40807
+ icon: AppBundlePathSchema.optional(),
40808
+ /** Bundle-relative path of the HTML document the app window opens. */
40809
+ entry: AppBundlePathSchema,
40810
+ capabilities: AppCapabilityRequestSetSchema
40811
+ });
40812
+ /**
40813
+ * A content hash as `<algorithm>:<lowercase hex digest>`. Only sha256 today; the prefix lets a
40814
+ * later algorithm be added without ambiguity.
40815
+ */
40816
+ const AppContentHashSchema = z$1.string().regex(/^sha256:[0-9a-f]{64}$/, "Content hash must be sha256:<64 hex chars>");
40817
+ const APP_BUNDLE_MAX_FILES = 1e3;
40818
+ const AppBundleFileSchema = z$1.object({
40819
+ path: AppBundlePathSchema,
40820
+ size: z$1.int().nonnegative(),
40821
+ hash: AppContentHashSchema,
40822
+ content_type: z$1.string().min(1).max(255)
40823
+ });
40824
+ /**
40825
+ * An immutable app bundle built from one pinned artifact version. `hash` identifies the bundle
40826
+ * by content (computeAppBundleHash over manifest and files; artifact id and version are not part
40827
+ * of it), and is how installs and grants reference it.
40828
+ */
40829
+ const AppBundleDescriptorSchema = z$1.object({
40830
+ format_version: z$1.literal(1),
40831
+ hash: AppContentHashSchema,
40832
+ artifact_id: ObjectIdStringSchema$5,
40833
+ artifact_version: ArtifactVersionNumberSchema,
40834
+ manifest: AppManifestSchema,
40835
+ files: z$1.array(AppBundleFileSchema).min(1).max(APP_BUNDLE_MAX_FILES)
40836
+ }).superRefine((bundle, ctx) => {
40837
+ const paths = /* @__PURE__ */ new Set();
40838
+ bundle.files.forEach((file, index) => {
40839
+ if (paths.has(file.path)) ctx.addIssue({
40840
+ code: "custom",
40841
+ message: `Duplicate bundle path: ${file.path}`,
40842
+ path: [
40843
+ "files",
40844
+ index,
40845
+ "path"
40846
+ ]
40847
+ });
40848
+ paths.add(file.path);
40849
+ });
40850
+ const { entry, icon } = bundle.manifest;
40851
+ if (!paths.has(entry)) ctx.addIssue({
40852
+ code: "custom",
40853
+ message: "Manifest entry is not in the bundle",
40854
+ path: ["manifest", "entry"]
40855
+ });
40856
+ if (icon !== void 0 && !paths.has(icon)) ctx.addIssue({
40857
+ code: "custom",
40858
+ message: "Manifest icon is not in the bundle",
40859
+ path: ["manifest", "icon"]
40860
+ });
40861
+ });
40862
+ /** Who made a change to an install. */
40863
+ const AppActorSchema = z$1.discriminatedUnion("kind", [
40864
+ z$1.object({
40865
+ kind: z$1.literal("user"),
40866
+ user_id: ObjectIdStringSchema$5
40867
+ }),
40868
+ z$1.object({
40869
+ kind: z$1.literal("org_admin"),
40870
+ user_id: ObjectIdStringSchema$5
40871
+ }),
40872
+ z$1.object({ kind: z$1.literal("system") })
40873
+ ]);
40874
+ /** One capability the user approved, who approved it, and the bundle they reviewed. */
40875
+ const AppCapabilityGrantSchema = z$1.object({
40876
+ capability: AppGrantedCapabilitySchema,
40877
+ granted_at: IsoTimestampSchema,
40878
+ granted_by: AppActorSchema,
40879
+ bundle_hash: AppContentHashSchema
40880
+ });
40881
+ /** A request the user turned down, kept so the same request is not asked again on every update. */
40882
+ const AppCapabilityDeclineSchema = z$1.object({
40883
+ capability: AppCapabilityRequestSchema,
40884
+ declined_at: IsoTimestampSchema,
40885
+ bundle_hash: AppContentHashSchema
40886
+ });
40887
+ /**
40888
+ * `active` launches. `disabled` is reversible: the install comes back when the condition ends.
40889
+ * `revoked` is terminal; the record stays so every device can see it and remove the app.
40890
+ */
40891
+ const InstalledAppStatusSchema = z$1.discriminatedUnion("state", [
40892
+ z$1.object({ state: z$1.literal("active") }),
40893
+ z$1.object({
40894
+ state: z$1.literal("disabled"),
40895
+ reason: z$1.enum([
40896
+ "organization_setting",
40897
+ "access_lost",
40898
+ "org_admin_request"
40899
+ ]),
40900
+ disabled_at: IsoTimestampSchema,
40901
+ disabled_by: AppActorSchema
40902
+ }),
40903
+ z$1.object({
40904
+ state: z$1.literal("revoked"),
40905
+ reason: z$1.enum([
40906
+ "user_request",
40907
+ "org_admin_request",
40908
+ "artifact_deleted",
40909
+ "policy"
40910
+ ]),
40911
+ revoked_at: IsoTimestampSchema,
40912
+ revoked_by: AppActorSchema
40913
+ })
40914
+ ]);
40915
+ const ONE_PER_KIND = "Each capability kind may appear at most once";
40916
+ /**
40917
+ * The server's record of one installed app; desktop only caches it. Personal and organization
40918
+ * installs share this shape: `organization_id` is null for a personal install. The record pins an
40919
+ * artifact version and the bundle built from it; an update moves both together.
40920
+ */
40921
+ const InstalledAppSchema = z$1.object({
40922
+ app_id: AppIdSchema,
40923
+ owner_id: ObjectIdStringSchema$5,
40924
+ organization_id: ObjectIdStringSchema$5.nullable(),
40925
+ artifact_id: ObjectIdStringSchema$5,
40926
+ artifact_version: ArtifactVersionNumberSchema,
40927
+ bundle_hash: AppContentHashSchema,
40928
+ /** The pinned manifest's name, so a list renders without fetching bundles. */
40929
+ name: AppManifestSchema.shape.name,
40930
+ grants: z$1.array(AppCapabilityGrantSchema).refine((grants) => hasUniqueKeys(grants, (grant) => grant.capability.kind), ONE_PER_KIND),
40931
+ declined: z$1.array(AppCapabilityDeclineSchema).refine((declines) => hasUniqueKeys(declines, (decline) => decline.capability.kind), ONE_PER_KIND),
40932
+ status: InstalledAppStatusSchema,
40933
+ created_at: IsoTimestampSchema,
40934
+ updated_at: IsoTimestampSchema
40935
+ }).refine((record) => {
40936
+ const grantedKinds = new Set(record.grants.map((grant) => grant.capability.kind));
40937
+ return record.declined.every((decline) => !grantedKinds.has(decline.capability.kind));
40938
+ }, {
40939
+ message: "A capability kind cannot be both granted and declined",
40940
+ path: ["declined"]
40941
+ });
40942
+ const InstallAppRequestSchema = z$1.object({
40943
+ artifact_id: ObjectIdStringSchema$5,
40944
+ /** The version the user reviewed; the install pins it and never silently moves to a later one. */
40945
+ artifact_version: ArtifactVersionNumberSchema,
40946
+ /**
40947
+ * The capabilities the user approved, with the scopes they chose. Each must cover a request in
40948
+ * the pinned bundle's manifest; the server records every other request as declined.
40949
+ */
40950
+ grants: AppGrantedCapabilitySetSchema
40951
+ });
40952
+ const InstalledAppIdParamSchema = z$1.object({ appId: z$1.string().min(1).max(63) });
40953
+ const InstalledAppListResponseSchema = paginatedResponseSchema(InstalledAppSchema);
40954
+ /**
40955
+ * Where to download each bundle file. URLs are short-lived; a client verifies every download
40956
+ * against the file's hash in `bundle.files` before serving it.
40957
+ */
40958
+ const AppBundleFetchResponseSchema = z$1.object({
40959
+ bundle: AppBundleDescriptorSchema,
40960
+ downloads: z$1.array(z$1.object({
40961
+ path: AppBundlePathSchema,
40962
+ url: z$1.url({ protocol: /^https$/ })
40963
+ })).max(APP_BUNDLE_MAX_FILES),
40964
+ expires_at: IsoTimestampSchema
40965
+ }).refine(({ bundle, downloads }) => {
40966
+ const downloadPaths = new Set(downloads.map((download) => download.path));
40967
+ return downloadPaths.size === downloads.length && downloads.length === bundle.files.length && bundle.files.every((file) => downloadPaths.has(file.path));
40968
+ }, {
40969
+ message: "Downloads must list each bundle file exactly once",
40970
+ path: ["downloads"]
40971
+ });
40972
+ /**
40973
+ * Installed apps: an HTML or React artifact installed from the desktop app as a standalone app.
40974
+ * These contracts are not in CONTRACTS yet; they are registered (and so published in the spec)
40975
+ * together with their handlers.
40976
+ */
40977
+ const JWT_ONLY_NOTE = "Authenticate with a JWT access token only: installing and running apps is a signed-in desktop feature, and API keys cannot call it. ";
40978
+ const INSTALL_EXAMPLE = {
40979
+ artifact_id: EXAMPLE_RESOURCE_ID,
40980
+ artifact_version: 3,
40981
+ grants: [{ kind: "notifications" }]
40982
+ };
40983
+ defineEndpoint({
40984
+ method: "post",
40985
+ path: "/api/v1/installed-apps",
40986
+ operationId: "installApp",
40987
+ summary: "Install an artifact as an app",
40988
+ description: "Installs one version of an HTML or React artifact as an app for the caller and builds its bundle. The install pins `artifact_version`; later versions never replace it without a new consent. `grants` lists the capabilities the user approved, and each must be one the bundle's manifest requests, and every request left out is recorded as declined. An install belongs to the caller's organization when the artifact does, and is personal otherwise. Building the bundle happens inside this call: a version that cannot be built is a `422`, and a build that fails for a server-side reason is a `500`. " + JWT_ONLY_NOTE,
40989
+ tags: ["Artifacts"],
40990
+ auth: "jwtOnly",
40991
+ request: InstallAppRequestSchema,
40992
+ requestExample: INSTALL_EXAMPLE,
40993
+ responses: {
40994
+ 201: {
40995
+ description: "The new install.",
40996
+ schema: InstalledAppSchema
40997
+ },
40998
+ 400: {
40999
+ description: "`grants` includes a capability the bundle's manifest does not request.",
41000
+ schema: ApiErrorSchema
41001
+ },
41002
+ 401: {
41003
+ description: "Missing or invalid JWT.",
41004
+ schema: ApiErrorSchema
41005
+ },
41006
+ 403: {
41007
+ description: "Installed apps are turned off for the organization, or a requested capability needs an artifact the caller owns or that belongs to the caller's organization.",
41008
+ schema: ApiErrorSchema
41009
+ },
41010
+ 404: {
41011
+ description: "No artifact with that id and version is visible to the caller.",
41012
+ schema: ApiErrorSchema
41013
+ },
41014
+ 409: {
41015
+ description: "The caller already has an install of this artifact that is not revoked. A disabled install counts: it comes back when its condition ends, so a second one would split the app's data.",
41016
+ schema: ApiErrorSchema
41017
+ },
41018
+ 422: {
41019
+ description: "The body is invalid, or the artifact version cannot be built into an app bundle (for example, its code does not compile).",
41020
+ schema: ApiErrorSchema
41021
+ },
41022
+ 429: {
41023
+ description: "Per-user rate limit exceeded.",
41024
+ schema: ApiErrorSchema
41025
+ }
41026
+ },
41027
+ codeSample: {
41028
+ authToken: "<access_token>",
41029
+ streaming: false,
41030
+ body: INSTALL_EXAMPLE
41031
+ }
41032
+ });
41033
+ defineEndpoint({
41034
+ method: "get",
41035
+ path: "/api/v1/installed-apps",
41036
+ operationId: "listInstalledApps",
41037
+ summary: "List installed apps",
41038
+ description: "Lists the caller's installs in every state (active, disabled and revoked), newest first, so a desktop client can reconcile its local cache. " + JWT_ONLY_NOTE,
41039
+ tags: ["Artifacts"],
41040
+ auth: "jwtOnly",
41041
+ queryParams: PaginationQuerySchema,
41042
+ responses: {
41043
+ 200: {
41044
+ description: "One page of installs.",
41045
+ schema: InstalledAppListResponseSchema
41046
+ },
41047
+ 401: {
41048
+ description: "Missing or invalid JWT.",
41049
+ schema: ApiErrorSchema
41050
+ },
41051
+ 429: {
41052
+ description: "Per-user rate limit exceeded.",
41053
+ schema: ApiErrorSchema
41054
+ }
41055
+ },
41056
+ codeSample: {
41057
+ authToken: "<access_token>",
41058
+ streaming: false
41059
+ }
41060
+ });
41061
+ defineEndpoint({
41062
+ method: "delete",
41063
+ path: "/api/v1/installed-apps/{appId}",
41064
+ operationId: "revokeInstalledApp",
41065
+ summary: "Revoke an installed app",
41066
+ description: "Revokes an install. Revoking is terminal and idempotent: the record stays, in the `revoked` state, so every device can see it and remove the app. The owner can revoke their own install; an organization admin can revoke any install in the organization. " + JWT_ONLY_NOTE,
41067
+ tags: ["Artifacts"],
41068
+ auth: "jwtOnly",
41069
+ pathParams: InstalledAppIdParamSchema,
41070
+ responses: {
41071
+ 200: {
41072
+ description: "The install, now revoked.",
41073
+ schema: InstalledAppSchema
41074
+ },
41075
+ 401: {
41076
+ description: "Missing or invalid JWT.",
41077
+ schema: ApiErrorSchema
41078
+ },
41079
+ 404: {
41080
+ description: "No install with that id is visible to the caller.",
41081
+ schema: ApiErrorSchema
41082
+ },
41083
+ 429: {
41084
+ description: "Per-user rate limit exceeded.",
41085
+ schema: ApiErrorSchema
41086
+ }
41087
+ },
41088
+ codeSample: {
41089
+ authToken: "<access_token>",
41090
+ streaming: false
41091
+ }
41092
+ });
41093
+ defineEndpoint({
41094
+ method: "get",
41095
+ path: "/api/v1/installed-apps/{appId}/bundle",
41096
+ operationId: "getInstalledAppBundle",
41097
+ summary: "Get an installed app's bundle",
41098
+ description: "Returns the immutable bundle the install pins: its descriptor (manifest, per-file hashes) and short-lived download URLs for its files. Verify each file against its hash before serving it. " + JWT_ONLY_NOTE,
41099
+ tags: ["Artifacts"],
41100
+ auth: "jwtOnly",
41101
+ pathParams: InstalledAppIdParamSchema,
41102
+ responses: {
41103
+ 200: {
41104
+ description: "The bundle and where to download its files.",
41105
+ schema: AppBundleFetchResponseSchema
41106
+ },
41107
+ 401: {
41108
+ description: "Missing or invalid JWT.",
41109
+ schema: ApiErrorSchema
41110
+ },
41111
+ 403: {
41112
+ description: "The install is revoked or disabled.",
41113
+ schema: ApiErrorSchema
41114
+ },
41115
+ 404: {
41116
+ description: "No install with that id is visible to the caller.",
41117
+ schema: ApiErrorSchema
41118
+ },
41119
+ 429: {
41120
+ description: "Per-user rate limit exceeded.",
41121
+ schema: ApiErrorSchema
41122
+ }
41123
+ },
41124
+ codeSample: {
41125
+ authToken: "<access_token>",
41126
+ streaming: false
41127
+ }
41128
+ });
41129
+ z$1.object({
41130
+ manifest: z$1.looseObject({ capabilities: z$1.array(z$1.looseObject({ kind: z$1.string() })) }),
41131
+ files: z$1.array(z$1.looseObject({ path: z$1.string() }))
41132
+ }).extend({ hash: z$1.string() });
41133
+ z$1.object({ state: z$1.enum([
41134
+ "active",
41135
+ "disabled",
41136
+ "revoked"
41137
+ ]) });
41138
+ z$1.object({
41139
+ app_id: z$1.unknown(),
41140
+ name: z$1.unknown(),
41141
+ status: z$1.unknown()
41142
+ });
41143
+ z$1.object({
41144
+ data: z$1.array(z$1.unknown()),
41145
+ next_cursor: z$1.string().nullable()
41146
+ });
41147
+ const envelopeBase = {
41148
+ apiVersion: AppBridgeApiVersionSchema,
41149
+ id: z$1.string().min(1).max(64)
41150
+ };
41151
+ const NoParamsSchema = z$1.object({}).strict();
41152
+ const AppBridgeHandshakeParamsSchema = z$1.object({
41153
+ /** Every bridge API version the page can speak. */
41154
+ apiVersions: z$1.array(AppBridgeApiVersionSchema).min(1).max(16) });
41155
+ const AppBridgeHandshakeResultSchema = z$1.object({
41156
+ /** The version both sides use from here on. */
41157
+ apiVersion: AppBridgeApiVersionSchema,
41158
+ /** The methods this app may call, given its grants. */
41159
+ methods: z$1.array(z$1.string().min(1))
41160
+ });
41161
+ const AppBridgeAppInfoResultSchema = z$1.object({
41162
+ appId: AppIdSchema,
41163
+ name: AppManifestSchema.shape.name,
41164
+ artifactId: ObjectIdStringSchema$5,
41165
+ artifactVersion: ArtifactVersionNumberSchema,
41166
+ /**
41167
+ * What the user GRANTED this install, with scopes; not what the manifest requested. Folder
41168
+ * labels and connector ids are visible to the page on purpose: an app shows which it can use.
41169
+ */
41170
+ grantedCapabilities: AppGrantedCapabilitySetSchema
41171
+ });
41172
+ z$1.discriminatedUnion("method", [z$1.object({
41173
+ ...envelopeBase,
41174
+ method: z$1.literal("bridge.handshake"),
41175
+ params: AppBridgeHandshakeParamsSchema
41176
+ }), z$1.object({
41177
+ ...envelopeBase,
41178
+ method: z$1.literal("app.info"),
41179
+ params: NoParamsSchema
41180
+ })]);
41181
+ const successBase = {
41182
+ ...envelopeBase,
41183
+ ok: z$1.literal(true)
41184
+ };
41185
+ const AppBridgeSuccessResponseSchema = z$1.discriminatedUnion("method", [z$1.object({
41186
+ ...successBase,
41187
+ method: z$1.literal("bridge.handshake"),
41188
+ result: AppBridgeHandshakeResultSchema
41189
+ }), z$1.object({
41190
+ ...successBase,
41191
+ method: z$1.literal("app.info"),
41192
+ result: AppBridgeAppInfoResultSchema
41193
+ })]);
41194
+ const AppBridgeErrorSchema = z$1.object({
41195
+ code: z$1.enum([
41196
+ "invalid_request",
41197
+ "unknown_method",
41198
+ "unsupported_api_version",
41199
+ "capability_not_granted",
41200
+ "user_declined",
41201
+ "internal"
41202
+ ]),
41203
+ message: z$1.string().max(1e3)
41204
+ });
41205
+ /** A failed call. It carries no `method`, since an unknown or malformed method cannot be echoed. */
41206
+ const AppBridgeErrorResponseSchema = z$1.object({
41207
+ ...envelopeBase,
41208
+ ok: z$1.literal(false),
41209
+ error: AppBridgeErrorSchema
41210
+ });
41211
+ z$1.union([AppBridgeSuccessResponseSchema, AppBridgeErrorResponseSchema]);
41212
+ z$1.object({
41213
+ ...envelopeBase,
41214
+ progress: z$1.object({
41215
+ seq: z$1.int().nonnegative(),
41216
+ data: z$1.unknown()
41217
+ })
41218
+ });
41219
+ z$1.discriminatedUnion("event", [z$1.object({
41220
+ apiVersion: AppBridgeApiVersionSchema,
41221
+ event: z$1.literal("app.grantsChanged"),
41222
+ data: z$1.object({ grantedCapabilities: AppGrantedCapabilitySetSchema })
41223
+ })]);
40073
41224
  /**
40074
41225
  * The fence language the model writes to place an inline map of search-result places in a reply.
40075
41226
  *
@@ -41288,7 +42439,23 @@ z$1.object({
41288
42439
  sentTimestamp: z$1.string().nullable().optional(),
41289
42440
  retentionSeconds: z$1.number().nullable().optional(),
41290
42441
  consumerVersion: z$1.string(),
41291
- fixVerification: z$1.literal("unavailable"),
42442
+ failedCommit: z$1.string().optional(),
42443
+ runningCommit: z$1.string().optional(),
42444
+ commitRelation: z$1.enum([
42445
+ "same-commit",
42446
+ "different-commit",
42447
+ "unknown"
42448
+ ]).optional(),
42449
+ failureSignature: z$1.string().optional(),
42450
+ fixPr: z$1.object({
42451
+ repository: z$1.string(),
42452
+ pullNumber: z$1.number().int().positive()
42453
+ }).nullable().optional(),
42454
+ fixVerification: z$1.enum([
42455
+ "unavailable",
42456
+ "unverified",
42457
+ "verified"
42458
+ ]),
41292
42459
  entityContext: z$1.enum(["present-id-withheld", "unavailable"]),
41293
42460
  owner: z$1.string().nullable(),
41294
42461
  expiry: z$1.object({
@@ -41329,6 +42496,125 @@ z$1.object({
41329
42496
  assessmentId: z$1.string().regex(/^[a-f0-9]{24}$/i, "Not a valid assessment id")
41330
42497
  });
41331
42498
  /**
42499
+ * The deterministic case brief the admin Detections page shows beside a shadow detection (see
42500
+ * ./shadowDetection.ts): a conclusion, the plain-English reasons behind it, and what to do. Built
42501
+ * server-side by packages/server-utils/src/security/detectionCaseBrief/caseBrief.ts from the facts
42502
+ * below; nothing here acts on an account.
42503
+ */
42504
+ const DETECTION_CASE_ACCOUNT_STATUSES = [
42505
+ "active",
42506
+ "suspended",
42507
+ "deleted",
42508
+ "missing"
42509
+ ];
42510
+ /** Shape flags read from an account's address and username; each is a farming marker on its own. */
42511
+ const detectionCaseShapeSchema = z$1.object({
42512
+ /** A plus tag that looks random (canonicalEmail isRandomLookingTag). */
42513
+ randomPlusTag: z$1.boolean(),
42514
+ /** A Gmail local part dotted so heavily that it reads as a variant of another mailbox. */
42515
+ dottedGmail: z$1.boolean(),
42516
+ disposableDomain: z$1.boolean(),
42517
+ /** A per-user subdomain of a privacy relay (x@me.alias.example), which mints addresses at will. */
42518
+ aliasDomain: z$1.boolean(),
42519
+ /** A name followed by a hex counter (signupRiskScore looksGeneratedLocalPart). */
42520
+ generatedLocalPart: z$1.boolean(),
42521
+ /** A username holding a run of 5+ neighbouring keys on one keyboard row (asdfg, lkjhg). */
42522
+ keyboardMashUsername: z$1.boolean()
42523
+ });
42524
+ /** One account a listed detection (or its burst peers) names, with the facts its brief reads. */
42525
+ const detectionCaseAccountSchema = z$1.object({
42526
+ userId: z$1.string(),
42527
+ status: z$1.enum(DETECTION_CASE_ACCOUNT_STATUSES),
42528
+ /** Local part masked (`ab***@example.test`); null with no address. The user page shows the full one. */
42529
+ maskedEmail: z$1.string().nullable(),
42530
+ username: z$1.string().nullable(),
42531
+ signedUpAt: z$1.date().nullable(),
42532
+ /** Credits spent in the last 30 days, from usage events. Never derived from the balance. */
42533
+ spent30d: z$1.number(),
42534
+ /** The signup grant (signup plus unlock credits); null when the account has no grant record. */
42535
+ grantCredits: z$1.number().nullable(),
42536
+ /** Current balance; context only, since a held grant leaves it at 0 without any spend. */
42537
+ balance: z$1.number().nullable(),
42538
+ activeApiKeys: z$1.number().int(),
42539
+ shape: detectionCaseShapeSchema
42540
+ });
42541
+ const detectionCaseReasonSchema = z$1.object({
42542
+ key: z$1.enum([
42543
+ "single_account",
42544
+ "shared_device",
42545
+ "common_device",
42546
+ "no_shared_device",
42547
+ "ip_only_match",
42548
+ "shared_carrier_network",
42549
+ "disposable_domain",
42550
+ "alias_domain",
42551
+ "random_plus_tags",
42552
+ "dotted_gmail",
42553
+ "keyboard_mash_username",
42554
+ "generated_local_part",
42555
+ "sibling_drained_grant",
42556
+ "same_name",
42557
+ "same_first_name",
42558
+ "distinct_names",
42559
+ "no_farming_markers",
42560
+ "little_spend",
42561
+ "significant_spend",
42562
+ "close_signups"
42563
+ ]),
42564
+ text: z$1.string()
42565
+ });
42566
+ const detectionCaseActionSchema = z$1.discriminatedUnion("kind", [
42567
+ z$1.object({
42568
+ kind: z$1.literal("suspend"),
42569
+ userIds: z$1.array(z$1.string()).min(1)
42570
+ }),
42571
+ z$1.object({
42572
+ kind: z$1.literal("block_domain"),
42573
+ domain: z$1.string(),
42574
+ userIds: z$1.array(z$1.string()).min(1)
42575
+ }),
42576
+ z$1.object({ kind: z$1.literal("none") })
42577
+ ]);
42578
+ /** An account's place in one case: whether the detection names it or it is a burst peer. */
42579
+ const detectionCaseMemberSchema = z$1.object({
42580
+ userId: z$1.string(),
42581
+ role: z$1.enum(["named", "peer"]),
42582
+ /** Minutes to the nearest other account's signup in this case; null when either time is unknown. */
42583
+ gapMinutes: z$1.number().nullable(),
42584
+ sharesDevice: z$1.boolean()
42585
+ });
42586
+ const briefBase = {
42587
+ /** One line for the table row. */
42588
+ headline: z$1.string(),
42589
+ reasons: z$1.array(detectionCaseReasonSchema),
42590
+ members: z$1.array(detectionCaseMemberSchema)
42591
+ };
42592
+ const detectionCaseBriefSchema = z$1.discriminatedUnion("conclusion", [
42593
+ z$1.object({
42594
+ ...briefBase,
42595
+ conclusion: z$1.literal("likely_abuse"),
42596
+ recommendedVerdict: z$1.literal("confirmed_abuse"),
42597
+ recommendedAction: detectionCaseActionSchema
42598
+ }),
42599
+ z$1.object({
42600
+ ...briefBase,
42601
+ conclusion: z$1.literal("likely_legitimate"),
42602
+ recommendedVerdict: z$1.literal("legitimate_human"),
42603
+ recommendedAction: z$1.object({ kind: z$1.literal("none") })
42604
+ }),
42605
+ z$1.object({
42606
+ ...briefBase,
42607
+ conclusion: z$1.literal("needs_review"),
42608
+ /** No verdict is suggested: the evidence does not point either way. */
42609
+ recommendedVerdict: z$1.null(),
42610
+ recommendedAction: z$1.object({ kind: z$1.literal("none") })
42611
+ })
42612
+ ]);
42613
+ const detectionCaseBriefEntrySchema = z$1.object({
42614
+ detectionId: z$1.string(),
42615
+ brief: detectionCaseBriefSchema
42616
+ });
42617
+ /**
41332
42618
  * Shadow detections: what an abuse detector WOULD have done to an actor, recorded next to its alert
41333
42619
  * without acting, so admins can grade each one and measure detection errors before any automated
41334
42620
  * containment is switched on. Recording never changes access, credits, API keys or
@@ -41414,7 +42700,9 @@ const shadowDetectionVerdictEntrySchema = z$1.object({
41414
42700
  "automation"
41415
42701
  ]).optional(),
41416
42702
  /** The account whose suspension or reinstatement recorded this entry; absent on reviews and older entries. */
41417
- accountId: z$1.string().optional()
42703
+ accountId: z$1.string().optional(),
42704
+ /** The users bulk batch that recorded this entry; its undo removes the entry while it is still the latest. */
42705
+ batchId: z$1.string().optional()
41418
42706
  });
41419
42707
  const shadowDetectionItemSchema = z$1.object({
41420
42708
  id: z$1.string(),
@@ -41498,7 +42786,11 @@ z$1.object({
41498
42786
  accounts: z$1.array(shadowDetectionAccountSchema),
41499
42787
  burstPeers: z$1.array(shadowDetectionBurstPeersSchema),
41500
42788
  /** Everyone who recorded a verdict on the listed detections, so the page can name them. */
41501
- reviewers: z$1.array(shadowDetectionReviewerSchema)
42789
+ reviewers: z$1.array(shadowDetectionReviewerSchema),
42790
+ /** The facts each case brief reads, one entry per account in `accounts`. */
42791
+ caseAccounts: z$1.array(detectionCaseAccountSchema),
42792
+ /** One deterministic case brief per listed detection (./detectionCaseBrief.ts). */
42793
+ briefs: z$1.array(detectionCaseBriefEntrySchema)
41502
42794
  });
41503
42795
  z$1.object({
41504
42796
  detector: z$1.enum(SHADOW_DETECTORS).optional(),
@@ -42215,6 +43507,11 @@ const stripWww = (hostname) => {
42215
43507
  return rest.includes(".") ? rest : hostname;
42216
43508
  };
42217
43509
  /**
43510
+ * Dot-separated LDH labels; an IDN has already been punycoded to `xn--` by the URL parser. An inner
43511
+ * underscore is allowed because real source hosts use it and the URL parser accepts it.
43512
+ */
43513
+ const HOSTNAME_PATTERN = /^[a-z0-9]([a-z0-9_-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9_-]*[a-z0-9])?)*$/;
43514
+ /**
42218
43515
  * Reduce one free-text list entry to the hostname the source filter compares against, or '' when it
42219
43516
  * cannot be one. The field arrives as a mix of `example.net`, `*.example.net`, `https://example.net/blog`
42220
43517
  * and pasted URLs with a port or trailing dot. One `new URL` drops scheme, credentials, port, path and
@@ -42225,7 +43522,8 @@ const normalizeDomainEntry = (value) => {
42225
43522
  const bare = value.trim().replace(/^[a-z][a-z0-9+.-]*:\/\//i, "").replace(/^[*.]+/, "");
42226
43523
  if (!bare) return "";
42227
43524
  try {
42228
- return stripWww(new URL(`https://${bare}`).hostname.replace(/\.$/, ""));
43525
+ const hostname = new URL(`https://${bare}`).hostname.replace(/\.$/, "");
43526
+ return HOSTNAME_PATTERN.test(hostname) ? stripWww(hostname) : "";
42229
43527
  } catch {
42230
43528
  return "";
42231
43529
  }
@@ -43466,7 +44764,7 @@ const VIEW_REGISTRY = [
43466
44764
  id: "admin.security_dashboard",
43467
44765
  section: "admin",
43468
44766
  label: "Security Dashboard",
43469
- description: "Security views: Incident (queues, alarms, payments), Firewall (traffic and blocked requests) and Scans (scheduled security scan results)",
44767
+ description: "Security views: Incident (queues, alarms, payments), Firewall (traffic and blocked requests), Scans (scheduled security scan results) and Abuse controls (every abuse-limiting setting by group)",
43470
44768
  navigationType: "tab",
43471
44769
  target: "26",
43472
44770
  keywords: [
@@ -43996,22 +45294,6 @@ const VIEW_REGISTRY = [
43996
45294
  ],
43997
45295
  requiresAdmin: true
43998
45296
  },
43999
- {
44000
- id: "admin.secops_triage",
44001
- section: "admin",
44002
- label: "Security scan issue filing",
44003
- description: "Security page, Scans view: GitHub issue filing status, recent filing runs and its settings (dry run, repository, Slack)",
44004
- navigationType: "tab",
44005
- target: "51",
44006
- keywords: [
44007
- "secops",
44008
- "security triage",
44009
- "security alerts",
44010
- "vulnerabilities",
44011
- "security issues"
44012
- ],
44013
- requiresAdmin: true
44014
- },
44015
45297
  {
44016
45298
  id: "admin.audit_log",
44017
45299
  section: "admin",
@@ -44332,6 +45614,24 @@ const VIEW_REGISTRY = [
44332
45614
  ],
44333
45615
  requiresAdmin: true
44334
45616
  },
45617
+ {
45618
+ id: "admin.status_page",
45619
+ section: "admin",
45620
+ label: "Status page",
45621
+ description: "Run incidents on the public status page from draft to resolution, and pin or suppress a component state",
45622
+ navigationType: "tab",
45623
+ target: "86",
45624
+ keywords: [
45625
+ "status page",
45626
+ "incident",
45627
+ "outage",
45628
+ "maintenance",
45629
+ "publish",
45630
+ "pin",
45631
+ "component status"
45632
+ ],
45633
+ requiresAdmin: true
45634
+ },
44335
45635
  {
44336
45636
  id: "admin.ai_operations",
44337
45637
  section: "admin",
@@ -44701,6 +46001,9 @@ dayjs.extend(utc);
44701
46001
  dayjs.extend(timezone);
44702
46002
  dayjs.extend(relativeTime);
44703
46003
  dayjs.extend(localizedFormat);
46004
+ function isAxiosError(error) {
46005
+ return typeof error === "object" && error !== null && error.isAxiosError === true;
46006
+ }
44704
46007
  /**
44705
46008
  * Default retryable errors for LLM API calls
44706
46009
  */
@@ -44888,18 +46191,20 @@ const ADMIN_PERMISSIONS = [
44888
46191
  "users:export",
44889
46192
  "settings:manage",
44890
46193
  "models:curate",
46194
+ "analytics:read",
46195
+ "status:manage",
44891
46196
  "credits:self_grant",
44892
46197
  "credits:approve_self_grant"
44893
46198
  ];
44894
46199
  const AdminPermissionSchema = z$1.enum(ADMIN_PERMISSIONS);
44895
46200
  const AdminPermissionsSchema = z$1.array(AdminPermissionSchema).max(ADMIN_PERMISSIONS.length).refine((ids) => new Set(ids).size === ids.length, "Admin permissions must not repeat");
44896
46201
  /**
44897
- * Permissions the full-admin flag does not imply; only a holder can grant or revoke one
44898
- * (assertCanChangeExplicitOnlyPermissions), and holding one alone grants no admin access.
46202
+ * Permissions only a holder can grant or revoke (assertCanChangeHolderGrantedPermissions), so a delegated admin
46203
+ * without one cannot hand it out. Holding one alone grants no admin access. Full admins hold them like any other.
44899
46204
  */
44900
- const EXPLICIT_ONLY_ADMIN_PERMISSIONS = ["credits:self_grant", "credits:approve_self_grant"];
44901
- const isExplicitOnlyAdminPermission = (permission) => EXPLICIT_ONLY_ADMIN_PERMISSIONS.includes(permission);
44902
- ADMIN_PERMISSIONS.filter((permission) => !isExplicitOnlyAdminPermission(permission));
46205
+ const HOLDER_GRANTED_ADMIN_PERMISSIONS = ["credits:self_grant", "credits:approve_self_grant"];
46206
+ const isHolderGrantedAdminPermission = (permission) => HOLDER_GRANTED_ADMIN_PERMISSIONS.includes(permission);
46207
+ ADMIN_PERMISSIONS.filter((permission) => !isHolderGrantedAdminPermission(permission));
44903
46208
  const AdminRoleIdSchema = z$1.string().regex(/^[0-9a-f]{24}$/i, "Expected an id");
44904
46209
  const AdminRoleIdsSchema = z$1.array(AdminRoleIdSchema).max(20).refine((ids) => new Set(ids.map((id) => id.toLowerCase())).size === ids.length, "Admin roles must not repeat");
44905
46210
  z$1.object({
@@ -45521,4 +46826,4 @@ const logger = class Logger {
45521
46826
  }.getInstance();
45522
46827
  logger.setVerbose(process.env.B4M_VERBOSE === "1");
45523
46828
  //#endregion
45524
- export { RESEARCH_ITEM_RULE_ACTIONS as $, ttsBase64ResponseSchema as $t, DEFAULT_TTS_PROVIDER as A, isPlaceholderImageSigningSecret as At, LOW_CONFIDENCE_COMPLETION_MODES as B, planProgress 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, isUserInitiatedAbort as Ft, NotFoundError as G, secureParameters as Gt, MODEL_INFO_FIELD_GROUP_OF as H, reasoningChannelOf as Ht, ExpectedToolError as I, joinReplySlots as It, PROMPT_TEXT_MAX as J, splitEquals as Jt, OllamaEmbeddingModel as K, servableEmbeddingDimensions as Kt, ImageJobSchema as L, normalizeDomainEntry as Lt, DecisionTextPartSchema as M, isRetryableError as Mt, DecisionsRequestSchema as N, isSupportedEmbeddingModel as Nt, CreateImageJobResponseSchema as O, isExpectedToolError as Ot, EMBEDDING_MODEL_CATALOG as P, isSupportedFabFileMimeType as Pt, RESEARCH_FEED_URL_MAX_CHARS as Q, tokenEstimateMultiplier as Qt, ImageModels as R, obfuscateApiKey as Rt, CONTEXT_WINDOW_SAFETY_BUFFER_TOKENS as S, getMcpProviderMetadata as St, ChatModels as T, hasDeliverablePinnedArtifact as Tt, McpServerName as U, replacePromptVariables as Ut, MODEL_DECLINED_MESSAGE as V, questReplyText as Vt, ModelBackend as W, resolveSettingDefinition as Wt, RESEARCH_COST_CEILING_MICRO_USD_LIMIT as X, stripToolArtifactMarkup as Xt, PermissionDeniedError as Y, stripDeliveredArtifactBlocks as Yt, RESEARCH_DROP_REASONS as Z, supportedVoiceGenerationVendor as Zt, AudioMimeType as _, escapeThinkMarkers as _t, htmlFirstH1 as a, ACTOR_COLOR_SLOTS as an, SLUG_OWNED_BY_OTHER as at, BriefcasePromptIdSchema as b, generatedAudioResponseSchema as bt, AGENT_QUEST_MANIFEST as c, actorKindMarker as cn, VisibilitySchema as ct, ARTIFACT_REMOVED_PLACEHOLDER as d, selfClaimedActorKindSchema as dn, assertAuthOriginMatchesApiKey as dt, ttsRequestSchema as en, RESEARCH_MIN_RELEVANCE_DEFAULT as et, AdminAiStoredConfigSchema as f, frontmatterHasSourceStamp as fn, buildPromptContext as ft, ArtifactTypeSchema as g, WEBSITE_URL as gn, createThinkMarkerEscaper as gt, ApiKeyType as h, APP_NAME as hn, createReasoningWithholder as ht, htmlErrorTitle as i, withholdsReasoning as in, SEARCH_RESULT_CARDS_LANGUAGE as it, DEGENERATE_FINISH_REASON as j, isProviderRefusalStopReason as jt, DATA_LAKE_PROPOSAL_STATUSES as k, isPlaceholderApiKey as kt, AGENT_QUEST_MCP_URI as l, actorKindSchema as ln, VoyageAIEmbeddingModel as lt, ApiKeyScope as m, splitSkillMdFrontmatter as mn, createMutex as mt, SESSION_ID_PATTERN as n, visibleReplyText as nn, RESEARCH_SOURCES as nt, escapeArtifactBodyJson as o, DELEGATION_PAYLOAD_SCHEMA_NAME as on, SupportedFabFileMimeTypes as ot, AiAccessRefusedError as p, readSkillMdSourceUrl as pn, completionsSupportsToolSearch as pt, OpenAIEmbeddingModel as q, signImageUrl as qt, isValidSessionId as r, withRetry as rn, RESEARCH_UNLISTED_SOURCES as rt, AGENT_QUEST_ID as s, actorColorIndex as sn, UnprocessableEntityError as st, logger as t, ttsResponseTooLargeSchema as tn, RESEARCH_SCHEDULE_CADENCES as tt, ARTIFACT_DELIVERED_PLACEHOLDER as u, delegationPayloadSchema 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, planLeaves as zt };
46829
+ export { RESEARCH_DROP_REASONS as $, supportedVoiceGenerationVendor as $t, DATA_LAKE_PROPOSAL_STATUSES as A, isExpectedToolError as At, LOCATION_MAP_LANGUAGE as B, obfuscateApiKey as Bt, CONTEXT_WINDOW_SAFETY_BUFFER_TOKENS as C, getEmbeddingModelCapabilities as Ct, CompletionReasoningEffortSchema as D, hasDeliverablePinnedArtifact as Dt, ChatModels as E, googleMapsSearchUrl as Et, EMBEDDING_MODEL_CATALOG as F, isSupportedEmbeddingModel as Ft, ModelBackend as G, replacePromptVariables as Gt, MODEL_DECLINED_MESSAGE as H, planProgress as Ht, EMBEDDING_MODEL_IDS as I, isSupportedFabFileMimeType as It, OpenAIEmbeddingModel as J, servableEmbeddingDimensions as Jt, NotFoundError as K, resolveSettingDefinition as Kt, ExpectedToolError as L, isUserInitiatedAbort as Lt, DEGENERATE_FINISH_REASON as M, isPlaceholderImageSigningSecret as Mt, DecisionTextPartSchema as N, isProviderRefusalStopReason as Nt, CreateArtifactRequestSchema as O, isEarlyStop as Ot, DecisionsRequestSchema as P, isRetryableError as Pt, RESEARCH_COST_CEILING_MICRO_USD_LIMIT as Q, stripToolArtifactMarkup as Qt, ImageJobSchema as R, joinReplySlots as Rt, CONFIDENCE_GATE_MODES as S, generatedAudioResponseSchema as St, CUSTOM_MCP_DATA_NOTICE as T, getQuestErrorCode as Tt, MODEL_INFO_FIELD_GROUP_OF as U, questReplyText as Ut, LOW_CONFIDENCE_COMPLETION_MODES as V, planLeaves as Vt, McpServerName as W, reasoningChannelOf as Wt, PermissionDeniedError as X, splitEquals as Xt, PROMPT_TEXT_MAX as Y, signImageUrl as Yt, ProjectNameSchema as Z, stripDeliveredArtifactBlocks as Zt, AudioMimeType as _, APP_NAME as _n, createReasoningWithholder as _t, htmlFirstH1 as a, withRetry as an, RESEARCH_UNLISTED_SOURCES as at, BedrockEmbeddingModel as b, filterToolArtifactMarkup as bt, AGENT_QUEST_MANIFEST as c, DELEGATION_PAYLOAD_SCHEMA_NAME as cn, SupportedFabFileMimeTypes as ct, ARTIFACT_REMOVED_PLACEHOLDER as d, actorKindSchema as dn, VoyageAIEmbeddingModel as dt, tokenEstimateMultiplier as en, RESEARCH_FEED_URL_MAX_CHARS as et, AdminAiStoredConfigSchema as f, delegationPayloadSchema as fn, WORK_ITEM_STATUSES as ft, ArtifactTypeSchema as g, splitSkillMdFrontmatter as gn, createMutex as gt, ApiKeyType as h, readSkillMdSourceUrl as hn, completionsSupportsToolSearch as ht, htmlErrorTitle as i, visibleReplyText as in, RESEARCH_SOURCES as it, DEFAULT_TTS_PROVIDER as j, isPlaceholderApiKey as jt, CreateImageJobResponseSchema as k, isEnforceCreditsLocked as kt, AGENT_QUEST_MCP_URI as l, actorColorIndex as ln, UnprocessableEntityError as lt, ApiKeyScope as m, frontmatterHasSourceStamp as mn, buildPromptContext as mt, SESSION_ID_PATTERN as n, ttsRequestSchema as nn, RESEARCH_MIN_RELEVANCE_DEFAULT as nt, escapeArtifactBodyJson as o, withholdsReasoning as on, SEARCH_RESULT_CARDS_LANGUAGE as ot, AiAccessRefusedError as p, selfClaimedActorKindSchema as pn, assertAuthOriginMatchesApiKey as pt, OllamaEmbeddingModel as q, secureParameters as qt, isValidSessionId as r, ttsResponseTooLargeSchema as rn, RESEARCH_SCHEDULE_CADENCES as rt, AGENT_QUEST_ID as s, ACTOR_COLOR_SLOTS as sn, SLUG_OWNED_BY_OTHER as st, logger as t, ttsBase64ResponseSchema as tn, RESEARCH_ITEM_RULE_ACTIONS as tt, ARTIFACT_DELIVERED_PLACEHOLDER as u, actorKindMarker as un, VisibilitySchema as ut, BRIEFCASE_CATALOG_QUERIES as v, WEBSITE_URL as vn, createThinkMarkerEscaper as vt, CREDIT_DEDUCT_TRANSACTION_TYPES as w, getMcpProviderMetadata as wt, BriefcasePromptIdSchema as x, fromCliTodos as xt, BadGatewayError as y, escapeThinkMarkers as yt, ImageModels as z, normalizeDomainEntry as zt };