@work-shape/catalyst-asset-schemas 0.8.0-rc.4 → 0.8.0-rc.41

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 (3) hide show
  1. package/dist/index.d.ts +2466 -44
  2. package/dist/index.js +2016 -185
  3. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  // src/asset-types.ts
2
+ var ASSET_ACCESS_VERBS = ["read", "write", "delete", "publish"];
2
3
  var localeCodes = ["en", "de"];
3
4
  var REASONING_EFFORTS = ["none", "low", "medium", "high", "xhigh", "max"];
4
5
  var SKILL_STARTERS_MAX = 2;
@@ -12,100 +13,305 @@ var SKILL_RESOURCE_MEDIA_TYPES = [
12
13
  "application/json",
13
14
  "application/yaml"
14
15
  ];
16
+ var APP_AUDIENCES = ["self", "workspace", "instance"];
15
17
 
16
- // src/contract-values.ts
17
- var AUTH_SCOPE_WILDCARD = "*";
18
- var CHAT_SESSION_AUTH_SCOPES = [
19
- "me:read",
20
- "me:delete",
21
- "config:read",
22
- "conversation:read",
23
- "conversation:write",
24
- "run:start",
25
- "run:observe",
26
- "run:cancel",
27
- "run:command"
28
- ];
29
- var FIRST_PARTY_AUTH_SCOPES = [
30
- AUTH_SCOPE_WILDCARD,
31
- ...CHAT_SESSION_AUTH_SCOPES,
32
- "collaboration_workspace:read",
33
- "collaboration_workspace:manage",
34
- "me:write",
35
- "governance:read",
36
- "governance:write",
37
- "user_admin:read",
38
- "user_admin:write",
39
- "api_access:read",
40
- "api_access:write",
41
- "config_assets:read",
42
- "config_assets:write",
43
- // Moving the published pointer of an asset. A credential that writes drafts with
44
- // `config_assets:write` publishes none of them without this one.
45
- "config_assets:publish",
46
- "config_assets:release",
47
- // The rows of a Data Store: reading them, and adding or loading them. The definition of a
48
- // store and its migrations stay under `config_assets:*`. A scope caps what a key may be
49
- // used for; whether its holder may do it is decided by the grants.
50
- "data_store_rows:read",
51
- "data_store_rows:write"
52
- ];
53
- var ACTIONS = [
18
+ // src/bedrock-profiles.ts
19
+ var BEDROCK_REGION = "eu-central-1";
20
+ var BEDROCK_ARN = /^arn:aws:bedrock:([a-z0-9-]*):(\d{12}):([a-z-]+)\/([a-zA-Z0-9.:_-]+)$/u;
21
+ var APPLICATION_INFERENCE_PROFILE = "application-inference-profile";
22
+ var AWS_ACCOUNT_ID = /^\d{12}$/u;
23
+ function bedrockProfileRefusal(model, accountId) {
24
+ const arn = BEDROCK_ARN.exec(model);
25
+ if (!arn) {
26
+ return "a model id or a shared inference profile such as 'eu.anthropic.\u2026' is not attributed to this consumer";
27
+ }
28
+ if (arn[3] !== APPLICATION_INFERENCE_PROFILE) {
29
+ return "the ARN names a foundation model or a shared inference profile, which is not attributed to this consumer";
30
+ }
31
+ if (arn[1] !== BEDROCK_REGION) {
32
+ return `the profile is in another region, and calls go to ${BEDROCK_REGION} only`;
33
+ }
34
+ if (arn[2] !== accountId) {
35
+ return "the profile belongs to another AWS account than the provider's 'accountId'";
36
+ }
37
+ return void 0;
38
+ }
39
+
40
+ // src/config-merge.ts
41
+ function mergeConfigObjects(base, overrides) {
42
+ const result = { ...base };
43
+ for (const [key2, override] of Object.entries(overrides)) {
44
+ if (key2 === "__proto__") {
45
+ continue;
46
+ }
47
+ const baseValue = result[key2];
48
+ result[key2] = isPlainConfigObject(baseValue) && isPlainConfigObject(override) ? mergeConfigObjects(baseValue, override) : override;
49
+ }
50
+ return result;
51
+ }
52
+ function isPlainConfigObject(value) {
53
+ if (typeof value !== "object" || value === null) {
54
+ return false;
55
+ }
56
+ const prototype = Object.getPrototypeOf(value);
57
+ return prototype === Object.prototype || prototype === null;
58
+ }
59
+
60
+ // src/contract-values/agent.ts
61
+ var AGENT_ACTIONS = [
54
62
  "agent.read",
55
63
  "agent.write",
56
64
  "agent.publish",
65
+ // Decides a held publish of an agent a workspace owns (WS-PUB-1b).
66
+ "agent.approve",
57
67
  "agent.delete",
68
+ // Converse with the agent where it is available (AGENT-USE-1).
69
+ "agent.use"
70
+ ];
71
+
72
+ // src/contract-values/skill.ts
73
+ var SKILL_ACTIONS = [
58
74
  "skill.read",
59
75
  "skill.write",
76
+ // A save of a team's or the instance's skill is live with it; without it, a request (SKILL-LIVE-1).
77
+ "skill.publish",
60
78
  "skill.delete",
61
- "skill.approve",
79
+ "skill.approve"
80
+ ];
81
+
82
+ // src/contract-values/connection.ts
83
+ var CONNECTION_ACTIONS = [
62
84
  "connection.read",
63
85
  "connection.use",
64
86
  "connection.write",
65
87
  "connection.delete",
66
88
  "connection.approve",
89
+ // Adding one's own MCP server, a Connection only its owner uses (PMCP). The role `user`
90
+ // holds it by default; it names no Connection.
91
+ "connection.add_own"
92
+ ];
93
+
94
+ // src/contract-values/app.ts
95
+ var APP_ACTIONS = [
67
96
  "app.read",
68
97
  "app.write",
69
98
  "app.publish",
70
99
  "app.approve",
71
100
  "app.delete",
72
- "app.use",
101
+ "app.use"
102
+ ];
103
+
104
+ // src/contract-values/workflow.ts
105
+ var WORKFLOW_ACTIONS = [
73
106
  "workflow.read",
74
107
  "workflow.write",
75
108
  "workflow.publish",
76
109
  "workflow.approve",
77
110
  "workflow.delete",
78
111
  "workflow.use",
79
- "workflow.read_run_data",
112
+ "workflow.read_run_data"
113
+ ];
114
+
115
+ // src/contract-values/data-store.ts
116
+ var DATA_STORE_ACTIONS = [
80
117
  "data_store.read",
81
118
  "data_store.write",
82
119
  "data_store.publish",
83
120
  "data_store.delete",
84
121
  "data_store.insert",
85
122
  "data_store.execute",
123
+ "data_store.records"
124
+ ];
125
+
126
+ // src/contract-values/knowledge-base.ts
127
+ var KNOWLEDGE_BASE_ACTIONS = [
86
128
  "knowledge_base.read",
87
129
  "knowledge_base.write",
130
+ "knowledge_base.ingest",
88
131
  "knowledge_base.publish",
89
132
  "knowledge_base.delete",
90
- "knowledge_base.use",
133
+ "knowledge_base.use"
134
+ ];
135
+
136
+ // src/contract-values/mail-sender.ts
137
+ var MAIL_SENDER_ACTIONS = [
138
+ // Sending e-mail as one sender of the instance (`mail.send`). The `admin` role holds it on
139
+ // the sender `system`; a member only by a grant.
140
+ "mail_sender.use"
141
+ ];
142
+
143
+ // src/contract-values/guardrail.ts
144
+ var GUARDRAIL_ACTIONS = [
91
145
  "guardrail.read",
92
146
  "guardrail.write",
93
147
  "guardrail.publish",
94
- "guardrail.delete",
95
- "operations.approve",
148
+ "guardrail.delete"
149
+ ];
150
+
151
+ // src/contract-values/operations.ts
152
+ var OPERATIONS_ACTIONS = ["operations.approve"];
153
+
154
+ // src/contract-values/feedback.ts
155
+ var FEEDBACK_ACTIONS = [
156
+ // Reading the written feedback on agent messages and marking it handled (LU-4): on the
157
+ // instance, or on one workspace for the agents it owns. No bundle carries it.
158
+ "feedback.review"
159
+ ];
160
+
161
+ // src/contract-values/administration.ts
162
+ var ADMINISTRATION_ACTIONS = [
96
163
  "users.manage",
164
+ // Deleting a person's account and their data, beside `users.manage` (RIGHTS-1e, D5). Its
165
+ // default sits with `superadmin` alone.
166
+ "users.delete",
97
167
  "usage.view",
168
+ // Setting the spend limits of the instance, of shared workspaces and of users (LU-2).
169
+ // Instance admins hold it; workspace owners do not.
170
+ "limits.manage",
171
+ // Setting the central policy of operations on Instance > Policies and locking "Always allow"
172
+ // (OP-2). Instance admins hold it.
173
+ "policy.manage",
174
+ // Usage by named person beyond one's own (LU-3, limits spec 3.4): the Users view of the
175
+ // instance, and an owner's figures per member of a workspace. A separate right because the
176
+ // works council has a say on it (BetrVG section 87(1) no. 6).
177
+ "usage.view_users",
98
178
  "audit.view",
179
+ // Seeing how the instance runs: its background jobs, its Operation Runs, its modules and what
180
+ // it runs on, the Settings group "System" (RIGHTS-1e; UX audit ruling 2). Its default sits
181
+ // with `superadmin` alone, so a customer's admin keeps the audit log and not these pages.
182
+ "system.view",
183
+ // Running a background job again that failed or died (RIGHTS-1e; UX audit ruling 2). Its
184
+ // default sits with `superadmin` alone.
185
+ "jobs.retry",
99
186
  "api_access.manage",
100
187
  // Creating service principals, giving and taking their rights, enabling and disabling them.
101
188
  // Their keys stay with `api_access.manage`.
102
189
  "service_principals.manage",
103
190
  "agent_models.manage",
191
+ // Editing and resetting the built-in roles `user` and `admin`, and deciding their pending
192
+ // actions (Felix, 2026-10-21). Its default sits with `superadmin` alone.
193
+ "roles.edit_built_in",
104
194
  "assets.release"
105
195
  ];
106
- var NAMESPACE_PREFIX_PATTERN = /^[a-z][a-z0-9]*(-[a-z0-9]+)*-$/u;
107
- var NAMESPACE_PREFIX_MIN_LENGTH = 2;
108
- var NAMESPACE_PREFIX_MAX_LENGTH = 32;
196
+
197
+ // src/contract-values/workspace.ts
198
+ var WORKSPACE_ACTIONS = [
199
+ // The two bundles of a workspace: one row each, expanded by the evaluator (`bundleCarries`).
200
+ "builder",
201
+ "publisher"
202
+ ];
203
+
204
+ // src/contract-values/project.ts
205
+ var PROJECT_ACTIONS = [
206
+ // A project's rights come from membership of its workspace alone (PRJ-1): no grant row, no
207
+ // role default and no bundle carries them, and its audience narrows them further.
208
+ "project.read",
209
+ "project.write",
210
+ "project.delete"
211
+ ];
212
+ var PROJECT_ASSET_KIND = "project";
213
+ var PROJECT_AUDIENCES = ["workspace", "private"];
214
+ var PROJECT_DELETION_CONVERSATIONS = ["keep", "delete"];
215
+ var PROJECT_FILE_ORIGINS = ["person", "agent", "upload"];
216
+ var PROJECT_FILE_CHANGES = [
217
+ "created",
218
+ "updated",
219
+ "deleted",
220
+ "restored",
221
+ "unchanged",
222
+ "conflict_copy"
223
+ ];
224
+ var PROJECT_FOLDER_WRITE_CHANGES = [
225
+ "created",
226
+ "updated",
227
+ "unchanged",
228
+ "conflict_copy"
229
+ ];
230
+ var PROJECT_TITLE_MAX_LENGTH = 120;
231
+ var PROJECT_DESCRIPTION_MAX_LENGTH = 500;
232
+ var PROJECT_SKILLS_MAX = 20;
233
+ var PROJECT_KNOWLEDGE_BASES_MAX = 20;
234
+ var PROJECT_CHOICE_REFUSALS = ["own_in_shared_project", "not_everyone_may_use"];
235
+ var PROJECT_NAME_PATTERN = /^[a-z0-9]+(?:-[a-z0-9]+)*$/u;
236
+ var PROJECT_NAME_MAX_LENGTH = 64;
237
+
238
+ // src/contract-values.ts
239
+ var AUTH_SCOPE_WILDCARD = "*";
240
+ var CHAT_SESSION_AUTH_SCOPES = [
241
+ "me:read",
242
+ "me:delete",
243
+ "config:read",
244
+ "conversation:read",
245
+ "conversation:write",
246
+ "run:start",
247
+ "run:observe",
248
+ "run:cancel",
249
+ "run:command"
250
+ ];
251
+ var FIRST_PARTY_AUTH_SCOPES = [
252
+ AUTH_SCOPE_WILDCARD,
253
+ ...CHAT_SESSION_AUTH_SCOPES,
254
+ "collaboration_workspace:read",
255
+ "collaboration_workspace:manage",
256
+ "me:write",
257
+ "governance:read",
258
+ "governance:write",
259
+ "user_admin:read",
260
+ "user_admin:write",
261
+ // A personal key can check providers without reaching other user administration routes.
262
+ "infrastructure:check",
263
+ "api_access:read",
264
+ "api_access:write",
265
+ "config_assets:read",
266
+ "config_assets:write",
267
+ // Moving the published pointer of an asset. A credential that writes drafts with
268
+ // `config_assets:write` publishes none of them without this one.
269
+ "config_assets:publish",
270
+ "config_assets:release",
271
+ // The rows of a Data Store: reading them, and adding or loading them. The definition of a
272
+ // store and its migrations stay under `config_assets:*`. A scope caps what a key may be
273
+ // used for; whether its holder may do it is decided by the grants.
274
+ "data_store_rows:read",
275
+ "data_store_rows:write",
276
+ // What the use level of a personal key reaches of those rows (CLI-PARITY-4): a read of a
277
+ // store's rows, an insert and a query of a Knowledge Base, and nothing else under
278
+ // `data_store_rows:*`. Only a personal key's call is asked for it, through the operation's
279
+ // `personalKeyScope`; every other credential keeps the scopes above.
280
+ "data_store_rows:use",
281
+ // What the use level of a personal key reaches of Workflows: starting a run by hand, with
282
+ // `workflow.use` alone (CLI-PARITY-4 review). Only a personal key's call is asked for it, through
283
+ // the operation's `personalKeyScope`.
284
+ "workflow_runs:use",
285
+ // What the instance level of a personal key reads of the instance (CLI-PARITY-6a): usage,
286
+ // audit events, background jobs, Operation Runs, Modules and the last infrastructure check,
287
+ // each still asking the right of its own (`usage.view`, `audit.view`, `system.view`). Only
288
+ // a personal key's call is asked for it, through the operation's `personalKeyScope`.
289
+ "instance:inspect",
290
+ // What the account and workspaces level of a personal key reaches (CLI-PARITY-5): the
291
+ // person's name and model preference and the revocation of their own keys, never a new key,
292
+ // a confirmed connect code, the password or the account's deletion; and the Shared
293
+ // Workspaces as the person's role in each allows, never a workspace's usage. Only a personal
294
+ // key's call is asked for them, through the operation's `personalKeyScope`; `me:write` and
295
+ // `collaboration_workspace:*` stay off every key.
296
+ "account:manage",
297
+ "workspaces:manage"
298
+ ];
299
+ var ACTIONS = [
300
+ ...AGENT_ACTIONS,
301
+ ...SKILL_ACTIONS,
302
+ ...CONNECTION_ACTIONS,
303
+ ...APP_ACTIONS,
304
+ ...WORKFLOW_ACTIONS,
305
+ ...DATA_STORE_ACTIONS,
306
+ ...KNOWLEDGE_BASE_ACTIONS,
307
+ ...MAIL_SENDER_ACTIONS,
308
+ ...GUARDRAIL_ACTIONS,
309
+ ...OPERATIONS_ACTIONS,
310
+ ...FEEDBACK_ACTIONS,
311
+ ...ADMINISTRATION_ACTIONS,
312
+ ...WORKSPACE_ACTIONS,
313
+ ...PROJECT_ACTIONS
314
+ ];
109
315
  var APP_ERROR_STATUS_CODES = {
110
316
  BAD_REQUEST: 400,
111
317
  UNAUTHENTICATED: 401,
@@ -144,6 +350,7 @@ var CONNECTION_NAME_MAX_LENGTH = 64;
144
350
  var GUARDRAIL_NAME_PATTERN = /^[a-z][a-z0-9]*([_-][a-z0-9]+)*$/u;
145
351
  var GUARDRAIL_NAME_MAX_LENGTH = 64;
146
352
  var CONNECTION_EXPOSURES = ["agent", "bridge", "workflow", "outside"];
353
+ var CONNECTOR_FORM_FIELD_VALUES = ["text", "number", "list"];
147
354
  var CONNECTION_HEALTH_STATES = [
148
355
  "unknown",
149
356
  "ok",
@@ -151,14 +358,38 @@ var CONNECTION_HEALTH_STATES = [
151
358
  "needs_configuration",
152
359
  "secret_unreadable"
153
360
  ];
361
+ var ASSET_OWNER_RUNGS = ["personal", "team", "everyone"];
362
+ var ASSET_MOVE_PATHS = ["direct", "request"];
363
+ var ASSET_MOVE_STATUSES = ["moved", "requested"];
364
+ var ASSET_MOVE_EDITORS = ["workspace_builders", "instance_builders"];
365
+ var ASSET_MOVE_USERS = ["workspace_members", "everyone_where_offered"];
154
366
  var GRANT_HOLDER_KINDS = ["user", "service_principal", "role", "group"];
155
- var GRANT_SCOPE_KINDS = ["instance", "workspace", "namespace", "asset"];
367
+ var GRANT_SCOPE_KINDS = ["instance", "workspace", "asset"];
368
+ var ASSET_RIGHT_VERBS = ["read", "use", "write", "delete"];
369
+ var ROLE_GRANT_SCOPE_KINDS = [
370
+ "instance",
371
+ "workspace",
372
+ "asset"
373
+ ];
374
+ var ROLE_PENDING_CHANGES = ["added", "removed"];
375
+ var ROLE_PENDING_DECISIONS = ["apply", "dismiss"];
156
376
  var GRANT_EFFECTS = ["allow", "deny"];
157
377
  var ACCESS_SOURCES = ["role", "legacy_ref", "grant", "membership"];
158
378
  var POLICY_VALUES = ["allow", "confirm", "approval", "deny"];
159
379
  var AUTH_PRINCIPAL_KINDS = ["user", "service"];
160
380
  var ADMINISTERED_USER_STATUSES = ["active", "disabled", "deleting"];
161
381
  var SERVICE_PRINCIPAL_STATUSES = ["active", "disabled"];
382
+ var WORKFLOW_RIGHT_NEEDED_FOR = ["publish", "run"];
383
+ var WORKFLOW_RIGHTS_REVISIONS = ["draft", "published"];
384
+ var WORKFLOW_RUN_ACCOUNT_STATUSES = [...SERVICE_PRINCIPAL_STATUSES, "unknown"];
385
+ var WORKFLOW_RIGHT_REFUSALS = [
386
+ "not_grantable",
387
+ "not_administrator",
388
+ "not_held",
389
+ "account_unavailable",
390
+ "asset_unavailable",
391
+ "not_visible"
392
+ ];
162
393
  var SERVICE_PRINCIPAL_PERMISSIONS = [
163
394
  "config_assets.read",
164
395
  "config_assets.release"
@@ -188,7 +419,11 @@ var APP_ERROR_CODES = [
188
419
  "INTERNAL"
189
420
  ];
190
421
  var OPERATION_EFFECTS = ["reading", "changing"];
422
+ var CATALOGUE_PARTS = ["tools", "source"];
423
+ var CATALOGUE_CATEGORIES = ["mail", "files", "accounting", "databases", "other"];
191
424
  var OPERATION_TARGETS = ["live", "test", "dry_run"];
425
+ var DRAFT_TEST_TARGETS = ["present", "made_on_change"];
426
+ var PUBLISH_CHANGE_KINDS = ["new", "changed"];
192
427
  var OPERATION_RUN_STATUSES = [
193
428
  "running",
194
429
  "pending_confirmation",
@@ -225,7 +460,9 @@ var OPERATION_DENIAL_REASONS = [
225
460
  "holder_inactive",
226
461
  "holder_not_administrable",
227
462
  "user_only",
228
- "outside_key_scope"
463
+ "outside_key_scope",
464
+ // An owner-bound right of a person's own MCP server, and the caller is not its owner (PMCP).
465
+ "not_owner"
229
466
  ];
230
467
  var APPROVAL_REQUEST_STATUSES = [
231
468
  "pending",
@@ -250,6 +487,7 @@ var APPROVAL_EXECUTIONS = [
250
487
  ];
251
488
  var SKILL_CHANGE_TYPES = ["replace", "add", "new_resource"];
252
489
  var GUARDRAIL_OUTCOMES = ["allow", "warn", "require_approval", "block"];
490
+ var GUARDRAIL_CHECK_KINDS = ["pattern", "model_judge"];
253
491
  var APP_MODES = ["published", "draft"];
254
492
  var ASSET_NAME_REFUSAL_REASONS = ["name_invalid", "name_taken"];
255
493
  var ASSET_SYNC_CHANGE_TYPES = ["put", "delete"];
@@ -257,7 +495,8 @@ var ASSET_LIFECYCLES = ["active", "draft_published"];
257
495
  var ASSET_REPRESENTATIONS = ["config", "files"];
258
496
  var CONFIG_ASSET_KINDS = ["agent", "skill"];
259
497
  var CONFIG_ASSET_CHANGE_OPERATIONS = ["create", "update", "delete", "revert"];
260
- var AGENT_AVAILABILITY_MODES = ["all", "selected"];
498
+ var AGENT_AVAILABILITY_MODES = ["all", "selected", "all_except"];
499
+ var AGENT_USE_SETTINGS = ["everyone", "granted"];
261
500
  var AGENT_EDITABLE_FIELDS = [
262
501
  "displayName",
263
502
  "description",
@@ -298,6 +537,14 @@ var WORKSPACE_ACCENT_COLORS = [
298
537
  ];
299
538
  var COLLABORATION_WORKSPACE_KINDS = ["personal", "shared"];
300
539
  var WORKSPACE_ACCESS_STATES = ["member", "request_pending", "can_request"];
540
+ var WORKSPACE_BUNDLES = ["builder", "publisher"];
541
+ var MEMBER_BUNDLE_STATES = ["none", "requested", "held", "inherited"];
542
+ var MEMBER_BUNDLE_CHANGES = ["grant", "request", "revoke", "withdraw"];
543
+ var GRANT_REQUEST_STALE_REASONS = [
544
+ "member_left",
545
+ "member_inactive",
546
+ "already_held"
547
+ ];
301
548
  var DELETION_STATES = ["deleting", "deleted"];
302
549
  var WORKSPACE_SECTIONS = ["agents", "apps"];
303
550
  var MODEL_USAGE_TIERS = [
@@ -324,6 +571,7 @@ var OPENAI_COMPATIBLE_APIS = ["chat_completions", "responses"];
324
571
  var MODEL_PROVIDER_AUTH_MODES = ["bearer", "api-key"];
325
572
  var CONVERSATION_VISIBILITIES = ["workspace", "private"];
326
573
  var CONVERSATION_KINDS = ["chat", "run_thread"];
574
+ var CONVERSATION_TITLE_MAX_CHARS = 120;
327
575
  var WEB_SOURCE_PROVIDERS = [
328
576
  "openai-native",
329
577
  "serper",
@@ -343,8 +591,8 @@ var CONVERSATION_ATTACHMENT_STATUSES = [
343
591
  ];
344
592
  var ATTACHMENT_CREATE_OUTCOMES = ["created", "already_available"];
345
593
  var STRUCTURED_DATA_REVIEW_REASONS = ["uncertain", "conflicting"];
346
- var FOLLOW_UP_MODES = ["queue"];
347
- var FOLLOW_UP_STATUSES = ["pending", "dispatched", "cancelled"];
594
+ var FOLLOW_UP_MODES = ["queue", "steer"];
595
+ var FOLLOW_UP_STATUSES = ["pending", "dispatched", "consumed", "cancelled"];
348
596
  var AGENT_RUN_STATUSES = [
349
597
  "queued",
350
598
  "running",
@@ -368,6 +616,8 @@ var WAITING_OPERATION_RUN_STATUSES = [
368
616
  "pending_approval"
369
617
  ];
370
618
  var OPERATION_CONFIRMATION_DECISIONS = ["confirm", "decline"];
619
+ var PERSON_POLICY_SETTINGS = ["always_allow", "ask", "never"];
620
+ var OPERATION_CHANGE_CLASSES = ["reversible", "irreversible", "outward"];
371
621
  var TOOL_DECISION_MODES = ["confirm", "approval"];
372
622
  var TOOL_DECISION_OUTCOMES = ["confirmed", "declined", "expired", "cancelled"];
373
623
  var TOOL_CALL_STATES = [
@@ -418,16 +668,33 @@ var CONNECTION_OPERATION_STATUSES = [
418
668
  "disabled"
419
669
  ];
420
670
  var CONNECTION_SECRET_STATES = ["set", "not_set", "unreadable"];
671
+ var CONNECTION_TEST_CREDENTIAL_STATES = ["not_set", "set", "stale"];
672
+ var CONNECTION_OWN_TOKEN_STATES = ["set", "not_set", "needs_reconnect"];
673
+ var CONNECTION_OWN_TOKEN_SCHEMES = ["bearer", "header"];
674
+ var OWN_SERVER_SIGN_INS = ["oauth", "token"];
421
675
  var CONNECTOR_TEST_STATUSES = [
422
676
  "ready",
423
677
  "unauthorized",
424
678
  "network_denied",
425
679
  "unavailable",
426
680
  /** The server asks for an OAuth sign-in, or the Connection signs in and nobody has. */
427
- "oauth_required"
681
+ "oauth_required",
682
+ /**
683
+ * A person's own server refuses a request without a credential and describes no sign-in:
684
+ * it takes a token (PMCP).
685
+ */
686
+ "token_required"
428
687
  ];
688
+ var CONNECTION_CREDENTIAL_MODES = ["shared", "user"];
429
689
  var CONNECTION_BINDING_STATES = ["connected", "needs_reconnect", "revoked"];
430
- var CONNECTION_OAUTH_REGISTRATIONS = ["dcr", "preregistered"];
690
+ var CONNECTION_PROPOSAL_STATES = ["ready", "needs_setup"];
691
+ var CONNECTION_PROPOSAL_BINDING_STATES = [
692
+ "connected",
693
+ "needs_reconnect",
694
+ "not_connected"
695
+ ];
696
+ var CONNECTION_SIGN_IN_NEEDS = ["not_connected", "needs_reconnect"];
697
+ var CONNECTION_OAUTH_REGISTRATIONS = ["dcr", "preregistered", "managed"];
431
698
  var CONNECTION_PROVIDER_REVOCATIONS = ["confirmed", "failed", "not_offered"];
432
699
  var CONNECTION_ORIGINS = ["release", "runtime"];
433
700
  var CONNECTION_NETWORKS = ["public", "private"];
@@ -452,11 +719,21 @@ var DATA_STORE_CONDITIONS = [
452
719
  var DATA_STORE_STATUSES = ["provisioning", "ready", "retired"];
453
720
  var DATA_STORE_MIGRATION_OUTCOMES = ["none", "pending", "applied", "failed"];
454
721
  var KNOWLEDGE_BASE_STATUSES = ["unchecked", "preparing", "ok", "needs_attention"];
722
+ var KNOWLEDGE_EMBEDDING_STATES = [
723
+ "current",
724
+ "reindex_needed",
725
+ "reindex_available",
726
+ "reindexing",
727
+ "none"
728
+ ];
455
729
  var KNOWLEDGE_DOCUMENT_STATES = ["pending", "indexed", "failed"];
730
+ var KNOWLEDGE_FILE_MAX_BYTES = 100 * 1024 * 1024;
731
+ var KNOWLEDGE_DOCUMENT_TEXT_MAX_BYTES = 25 * 1024 * 1024;
732
+ var KNOWLEDGE_FILE_MAX_BYTES_CEILING = 256 * 1024 * 1024;
456
733
  var KNOWLEDGE_DOCUMENT_FAILURE_CODES = [
457
734
  // The extractor does not read the file's format.
458
735
  "knowledge_file_format_unsupported",
459
- // The file is over a limit of the extraction: size, pages or time.
736
+ // The file is over a limit of the extraction: its size or the size of its text.
460
737
  "knowledge_file_over_limit",
461
738
  // The file is corrupt, encrypted, or not the format it claims.
462
739
  "knowledge_file_unreadable",
@@ -471,7 +748,14 @@ var KNOWLEDGE_DOCUMENT_FAILURE_CODES = [
471
748
  // No text to search, such as a scanned PDF without a text layer.
472
749
  "knowledge_text_empty",
473
750
  // Indexing failed on every attempt.
474
- "knowledge_index_failed"
751
+ "knowledge_index_failed",
752
+ // A PDF or DOCX with more pages than `knowledge.maxPagesPerDocument`, counted before its text
753
+ // is read.
754
+ "knowledge_file_too_many_pages",
755
+ // A built-in or Workflow processor returned output outside its contract.
756
+ "knowledge_processor_output_invalid",
757
+ // Conversion exceeded its page-aware deadline.
758
+ "knowledge_conversion_timeout"
475
759
  ];
476
760
  var KNOWLEDGE_DOCUMENT_WAIT_CODES = [
477
761
  // A usage limit of the instance or the workspace refuses the embedding calls. Indexing goes
@@ -486,7 +770,13 @@ var KNOWLEDGE_SOURCE_FAILURE_CODES = [
486
770
  // A fetch failed on every attempt.
487
771
  "knowledge_fetch_failed",
488
772
  // The Knowledge Base holds its document limit; the listing stopped discovering there.
489
- "knowledge_source_limit_reached"
773
+ "knowledge_source_limit_reached",
774
+ "knowledge_item_invalid",
775
+ "knowledge_fetch_not_allowed",
776
+ // The Workflow run that called `ingest` ended before the pass did; what it wrote stays.
777
+ "knowledge_ingest_cancelled",
778
+ // A person removed the item by hand: no pass puts it back until a publisher lifts the hold.
779
+ "knowledge_item_removed"
490
780
  ];
491
781
  var KNOWLEDGE_SOURCE_ITEM_FAILURE_CODES = [
492
782
  ...KNOWLEDGE_SOURCE_FAILURE_CODES,
@@ -499,8 +789,8 @@ var KNOWLEDGE_SOURCE_ITEM_STATES = [
499
789
  "failed",
500
790
  "withdrawn"
501
791
  ];
502
- var KNOWLEDGE_SYNC_MODES = ["initial", "changes", "full"];
503
- var KNOWLEDGE_SYNC_RUN_STATES = ["running", "done", "failed"];
792
+ var KNOWLEDGE_SYNC_MODES = ["initial", "changes", "full", "ingest"];
793
+ var KNOWLEDGE_SYNC_RUN_STATES = ["running", "done", "failed", "superseded"];
504
794
  var KNOWLEDGE_SYNC_COUNTS = [
505
795
  "discovered",
506
796
  "added",
@@ -518,6 +808,7 @@ var DATABASE_RELATION_TYPES = [
518
808
  "foreign_table"
519
809
  ];
520
810
  var WORKFLOW_RUN_STATUSES = [
811
+ "continued",
521
812
  "queued",
522
813
  "running",
523
814
  "waiting",
@@ -535,15 +826,48 @@ var WORKFLOW_STEP_TYPES = [
535
826
  "agent",
536
827
  "notify",
537
828
  /** Starts another Workflow as a child run and waits for it. */
538
- "workflow"
539
- ];
540
- var WORKFLOW_RESERVED_STEP_TYPES = [
541
- /** Reserved in the contract: drawn, and run by no engine yet. */
829
+ "workflow",
542
830
  "condition",
543
831
  "parallel"
544
832
  ];
545
- var WORKFLOW_TRIGGER_KINDS = ["manual", "schedule", "parent"];
833
+ var WORKFLOW_EXECUTED_STEP_TYPES = [...WORKFLOW_STEP_TYPES];
834
+ var WORKFLOW_RESERVED_STEP_TYPES = [];
835
+ var WORKFLOW_WEBHOOK_LIMITS = {
836
+ maxBodyBytes: 256 * 1024,
837
+ toleranceMs: 5 * 6e4,
838
+ perMinute: 60,
839
+ perMinuteMax: 600,
840
+ nonceMaxLength: 200
841
+ };
842
+ var WORKFLOW_WEBHOOK_HEADERS = {
843
+ timestamp: "catalyst-webhook-timestamp",
844
+ nonce: "catalyst-webhook-nonce",
845
+ signature: "catalyst-webhook-signature"
846
+ };
847
+ var WORKFLOW_TRIGGER_KINDS = [
848
+ "manual",
849
+ "schedule",
850
+ "parent",
851
+ "outside",
852
+ "webhook",
853
+ "platform_event"
854
+ ];
546
855
  var NOTIFY_CHANNELS = ["inbox", "mail"];
856
+ var WORKFLOW_STEP_SOURCE_KINDS = [
857
+ "connection",
858
+ "data_store",
859
+ "knowledge_base",
860
+ "workflow",
861
+ "mail_sender",
862
+ "other"
863
+ ];
864
+ var OPERATION_SOURCE_KINDS = [
865
+ "connection",
866
+ "data_store",
867
+ "knowledge_base",
868
+ "workflow",
869
+ "other"
870
+ ];
547
871
  var PRINCIPAL_HOLDER_KINDS = [
548
872
  "user",
549
873
  "service_principal"
@@ -553,11 +877,13 @@ var ASSET_OWNER_KINDS = [
553
877
  "workspace"
554
878
  ];
555
879
  var READING_POLICY_VALUES = ["allow", "deny"];
880
+ var ALWAYS_ALLOW_LOCK_SOURCES = ["release", "instance"];
556
881
  var CONNECTION_OPERATION_POLICIES = [
557
882
  "deny",
558
883
  "approval"
559
884
  ];
560
885
  var WORKFLOW_RUN_MODES = ["live", "test"];
886
+ var WORKFLOW_TEST_REVISIONS = ["draft", "published"];
561
887
  var APP_ACTION_CALL_STATUSES = [
562
888
  "done",
563
889
  "pending_approval"
@@ -600,6 +926,7 @@ var MESSAGE_FINISH_STATUSES = [
600
926
  "completed",
601
927
  "cancelled"
602
928
  ];
929
+ var MODEL_FALLBACK_REASONS = ["rate_limit", "unavailable"];
603
930
  var ENDED_AGENT_RUN_STATUSES = [
604
931
  "completed",
605
932
  "cancelled",
@@ -642,12 +969,77 @@ var WORKFLOW_STEP_RUN_STATUSES = [
642
969
  "cancelled"
643
970
  ];
644
971
  var WORKFLOW_ENDED_STATUSES = [
972
+ "continued",
645
973
  "done",
646
974
  "failed",
647
975
  "cancelled",
648
976
  "limit_reached"
649
977
  ];
650
978
  var MANAGED_FILE_STATUSES = ["available", "released", "deleted"];
979
+ var WORKFLOW_KINDS = ["process", "data"];
980
+ var WORKFLOW_DATASET_DOWNLOAD_FORMATS = ["jsonl", "csv"];
981
+ var WORKSPACE_USE_ASSET_KINDS = ["knowledge_base", "connection"];
982
+ var WORKSPACE_OWNED_RIGHT_KINDS = [
983
+ "agent",
984
+ "skill",
985
+ "app",
986
+ "workflow",
987
+ "data_store",
988
+ "knowledge_base",
989
+ "guardrail"
990
+ ];
991
+ var PUBLISHED_DATA_CONSUMER_KINDS = ["app", "workflow", "knowledge_base"];
992
+ var SCHEDULED_START_STATES = ["active", "paused"];
993
+ var AGENT_PREVIEW_SOURCES = ["draft", "live"];
994
+ var PREVIEW_CAPTURE_SIZES = ["phone", "tablet", "desktop"];
995
+ var PREVIEW_CAPTURE_STATUSES = ["pending", "answering", "captured", "refused"];
996
+ var SERVER_PREVIEW_CAPTURE_REFUSALS = ["capture_busy", "capture_failed"];
997
+ var WORKFLOW_CAPABILITY_UNITS = [
998
+ "bytes",
999
+ "count",
1000
+ "seconds",
1001
+ "minutes",
1002
+ "cpus",
1003
+ "duration"
1004
+ ];
1005
+ var WORKFLOW_CODE_STEP_AVAILABILITY = ["available", "no_sandbox"];
1006
+ var WORKFLOW_PACKAGE_MANIFEST_STATES = ["available", "missing", "invalid"];
1007
+
1008
+ // src/interface-paths.ts
1009
+ function appInterfacePath(input) {
1010
+ const area = input.mode === "draft" ? "app-drafts" : "apps";
1011
+ return `/w/${encodeURIComponent(input.workspaceId)}/${area}/${encodeURIComponent(input.app)}`;
1012
+ }
1013
+ var STUDIO_KIND_PATHS = {
1014
+ agent: "agents",
1015
+ skill: "skills",
1016
+ connection: "connections",
1017
+ data_store: "data-stores",
1018
+ knowledge_base: "knowledge-bases",
1019
+ guardrail: "guardrails"
1020
+ };
1021
+ function assetPagePath(asset) {
1022
+ const name2 = encodeURIComponent(asset.name);
1023
+ if (Object.hasOwn(STUDIO_KIND_PATHS, asset.kind)) {
1024
+ return `/build/${STUDIO_KIND_PATHS[asset.kind]}/${name2}`;
1025
+ }
1026
+ if (asset.workspaceId === void 0) return void 0;
1027
+ if (asset.kind === "workflow") {
1028
+ return `/w/${encodeURIComponent(asset.workspaceId)}/workflows/${name2}`;
1029
+ }
1030
+ return asset.kind === "app" ? appInterfacePath({ workspaceId: asset.workspaceId, app: asset.name, mode: "draft" }) : void 0;
1031
+ }
1032
+ function conversationInterfacePath(input) {
1033
+ return `/w/${encodeURIComponent(input.workspaceId)}/c/${encodeURIComponent(input.conversationId)}`;
1034
+ }
1035
+ function inboxItemPath(itemId) {
1036
+ return `/inbox/${encodeURIComponent(itemId)}`;
1037
+ }
1038
+
1039
+ // src/is-record.ts
1040
+ function isRecord(value) {
1041
+ return typeof value === "object" && value !== null && !Array.isArray(value);
1042
+ }
651
1043
 
652
1044
  // src/schemas.ts
653
1045
  import { z } from "zod";
@@ -673,6 +1065,7 @@ function yamlValueIssueSentence(issue, maxDepth) {
673
1065
  }
674
1066
 
675
1067
  // src/schemas.ts
1068
+ var providerRegionSchema = z.string().trim().min(1).max(32);
676
1069
  var localizedStringMapSchema = z.object({
677
1070
  en: z.string().min(1).optional(),
678
1071
  de: z.string().min(1).optional()
@@ -807,12 +1200,12 @@ var skillConfigObjectSchema = z.object({
807
1200
  icon: z.string().min(1).optional()
808
1201
  });
809
1202
  var skillConfigSchema = skillConfigObjectSchema.superRefine((skill, context) => {
810
- for (const key of SKILL_FRONTMATTER_FIELDS) {
811
- if (skill.frontmatter && Object.hasOwn(skill.frontmatter, key)) {
1203
+ for (const key2 of SKILL_FRONTMATTER_FIELDS) {
1204
+ if (skill.frontmatter && Object.hasOwn(skill.frontmatter, key2)) {
812
1205
  context.addIssue({
813
1206
  code: "custom",
814
- path: ["frontmatter", key],
815
- message: `Skill frontmatter cannot hold '${key}': it is a field of the skill itself`
1207
+ path: ["frontmatter", key2],
1208
+ message: `Skill frontmatter cannot hold '${key2}': it is a field of the skill itself`
816
1209
  });
817
1210
  }
818
1211
  }
@@ -845,7 +1238,7 @@ var welcomeSubtitleSchema = z.union([
845
1238
  message: "At least one localized value is required"
846
1239
  })
847
1240
  ]);
848
- var agentNameSchema = z.string().min(1).refine((name) => name !== "." && name !== "..", {
1241
+ var agentNameSchema = z.string().min(1).refine((name2) => name2 !== "." && name2 !== "..", {
849
1242
  message: "Agent name must not be '.' or '..'"
850
1243
  });
851
1244
  var agentConfigSchema = z.object({
@@ -855,21 +1248,36 @@ var agentConfigSchema = z.object({
855
1248
  welcomeMessage: localizedStringSchema.optional(),
856
1249
  welcomeSubtitle: welcomeSubtitleSchema.optional(),
857
1250
  instructions: z.string().min(1),
1251
+ /**
1252
+ * What the instance adds after the instructions of an agent that ships with the platform. A
1253
+ * release never ships or changes it, so the instructions keep taking each release's text.
1254
+ */
1255
+ additionalInstructions: z.string().optional(),
858
1256
  modelProviderId: z.string().min(1).optional(),
859
1257
  modelBindingId: z.string().min(1).optional(),
860
1258
  reasoningEffort: z.enum(REASONING_EFFORTS).optional(),
861
1259
  fastMode: z.boolean().optional(),
1260
+ useModelFallback: z.boolean().optional(),
862
1261
  userSelectableModelBindingIds: z.array(z.string().min(1)).optional(),
863
1262
  modelReasoningEfforts: z.record(z.string().min(1), z.enum(REASONING_EFFORTS)).optional(),
864
1263
  maxSteps: z.number().int().positive().optional(),
865
1264
  toolNames: z.array(z.string().min(1)).default([]),
866
1265
  /**
867
- * The agents this agent may start as subagents through `run_agent`, beside itself. Only an
868
- * agent whose `toolNames` lists `run_agent` starts any.
1266
+ * Whether a run its person starts in their own private chat is offered the tools of the MCP
1267
+ * servers that person added for themselves (PMCP-4). Unset is on.
869
1268
  */
870
- subagentNames: z.array(agentNameSchema).refine((names) => new Set(names).size === names.length, {
871
- message: "A subagent is listed once"
872
- }).optional(),
1269
+ ownServers: z.boolean().optional(),
1270
+ /**
1271
+ * The agents this agent may start as subagents through `run_agent`, beside itself, or `"*"`
1272
+ * for every agent the person may use (CR-3m). Only an agent whose `toolNames` lists
1273
+ * `run_agent` starts any.
1274
+ */
1275
+ subagentNames: z.union([
1276
+ z.literal("*"),
1277
+ z.array(agentNameSchema).refine((names) => new Set(names).size === names.length, {
1278
+ message: "A subagent is listed once"
1279
+ })
1280
+ ]).optional(),
873
1281
  skillNames: z.array(skillNameSchema).default([]),
874
1282
  knowledgeBases: z.array(z.string().min(1)).refine((names) => new Set(names).size === names.length, {
875
1283
  message: "A Knowledge Base is listed once"
@@ -879,7 +1287,19 @@ var agentConfigSchema = z.object({
879
1287
  title: localizedStringSchema,
880
1288
  prompt: localizedStringSchema
881
1289
  })
882
- ).default([])
1290
+ ).default([]),
1291
+ /**
1292
+ * An agent that ships with the platform, such as Workshaper: the fields as the release
1293
+ * shipped them last. Only the release seed writes it, and every other write keeps it as
1294
+ * stored. A field the instance left as shipped takes what the next release ships; one it
1295
+ * changed stays the instance's.
1296
+ */
1297
+ shipped: z.record(z.string(), z.unknown()).optional(),
1298
+ /**
1299
+ * The fields of `shipped` the instance changed and a release then shipped anew. The release
1300
+ * seed adds a field; a save may only take one out.
1301
+ */
1302
+ shippedNewer: z.array(z.string()).optional()
883
1303
  });
884
1304
  var WORKFLOW_NAME_PATTERN = /^[a-z][a-z0-9_-]{0,62}$/u;
885
1305
  var WORKFLOW_NAME_RULE = "A Workflow id starts with a lowercase letter and holds lowercase letters, digits, '_' and '-', at most 63 characters";
@@ -893,14 +1313,39 @@ var workflowConfigSchema = z.strictObject({
893
1313
  files: z.array(z.strictObject({ path: z.string(), content: z.string() })).optional()
894
1314
  });
895
1315
 
1316
+ // src/secret-names.ts
1317
+ var SECRET_NAME_MAX_LENGTH = 64;
1318
+ var SECRET_NAME_SINGLE_WORD_MAX_LENGTH = 12;
1319
+ var SECRET_NAME_WORD = /^[A-Z0-9]{1,16}$/u;
1320
+ var SECRET_NAME_WORD_MAX_DIGITS = 2;
1321
+ var CREDENTIAL_SHAPE = /^(?:(?:AKIA|ASIA)[A-Z0-9]{16}$|GH[OPRSU]_[A-Z0-9]{20,}|AIZA[A-Z0-9_-]{30,}|XOX[A-Z]-|EYJ[A-Z0-9_-]{16,})/iu;
1322
+ var SECRET_NAME_EXPECTATION = "expected the name of an environment variable such as MODEL_API_KEY (upper-case words joined by underscores, at most 64 characters); the value given does not read as one and looks like a credential value";
1323
+ function isSecretName(value) {
1324
+ if (value.length > SECRET_NAME_MAX_LENGTH || CREDENTIAL_SHAPE.test(value)) {
1325
+ return false;
1326
+ }
1327
+ const words = value.split("_");
1328
+ if (words.length === 1 && value.length > SECRET_NAME_SINGLE_WORD_MAX_LENGTH) {
1329
+ return false;
1330
+ }
1331
+ return /^[A-Z]/u.test(value) && words.every(isSecretNameWord);
1332
+ }
1333
+ function isSecretNameWord(word) {
1334
+ if (!SECRET_NAME_WORD.test(word)) {
1335
+ return false;
1336
+ }
1337
+ const digits = word.replace(/[A-Z]/gu, "").length;
1338
+ return digits === word.length ? word.length <= 4 : digits <= SECRET_NAME_WORD_MAX_DIGITS;
1339
+ }
1340
+
896
1341
  // src/skill-markdown.ts
897
1342
  import yaml from "js-yaml";
898
1343
 
899
1344
  // src/yaml-data.ts
900
- import { JSON_SCHEMA, YAMLException, load } from "js-yaml";
1345
+ import { JSON_SCHEMA, YAMLException, dump, load } from "js-yaml";
901
1346
  var YAML_DATA_MAX_VALUES = 1e5;
902
- function isStorableText(text) {
903
- return !text.includes("\0") && !/\p{Surrogate}/u.test(text);
1347
+ function isStorableText(text2) {
1348
+ return !text2.includes("\0") && !/\p{Surrogate}/u.test(text2);
904
1349
  }
905
1350
  function checkStorableTexts(value, maxValues) {
906
1351
  const pending = [value];
@@ -912,15 +1357,15 @@ function checkStorableTexts(value, maxValues) {
912
1357
  } else if (Array.isArray(next)) {
913
1358
  for (const entry of next) pending.push(entry);
914
1359
  } else if (typeof next === "object" && next !== null) {
915
- for (const [key, entry] of Object.entries(next)) {
916
- if (!isStorableText(key)) return "unstorable";
1360
+ for (const [key2, entry] of Object.entries(next)) {
1361
+ if (!isStorableText(key2)) return "unstorable";
917
1362
  pending.push(entry);
918
1363
  }
919
1364
  }
920
1365
  }
921
1366
  return "storable";
922
1367
  }
923
- function readYamlData(text, file, options = {}) {
1368
+ function readYamlData(text2, file, options = {}) {
924
1369
  const fail = (code, message, line, column) => ({
925
1370
  ok: false,
926
1371
  issue: {
@@ -932,7 +1377,7 @@ function readYamlData(text, file, options = {}) {
932
1377
  });
933
1378
  let value;
934
1379
  try {
935
- value = load(text, { schema: JSON_SCHEMA, filename: file });
1380
+ value = load(text2, { schema: JSON_SCHEMA, filename: file });
936
1381
  } catch (error) {
937
1382
  if (error instanceof YAMLException) {
938
1383
  const markLine = error.mark?.line;
@@ -961,6 +1406,15 @@ function readYamlData(text, file, options = {}) {
961
1406
  }
962
1407
  return { ok: true, value };
963
1408
  }
1409
+ function writeYamlData(value) {
1410
+ return dump(value, {
1411
+ schema: JSON_SCHEMA,
1412
+ lineWidth: -1,
1413
+ noCompatMode: true,
1414
+ noRefs: true,
1415
+ sortKeys: false
1416
+ });
1417
+ }
964
1418
  var YamlDataError = class extends Error {
965
1419
  issue;
966
1420
  constructor(issue) {
@@ -969,8 +1423,8 @@ var YamlDataError = class extends Error {
969
1423
  this.issue = issue;
970
1424
  }
971
1425
  };
972
- function loadYamlData(text, file) {
973
- const read = readYamlData(text, file);
1426
+ function loadYamlData(text2, file) {
1427
+ const read = readYamlData(text2, file);
974
1428
  if (!read.ok) throw new YamlDataError(read.issue);
975
1429
  return read.value;
976
1430
  }
@@ -1007,7 +1461,7 @@ function parseSkillMarkdown(contents, skillFile, skillPath) {
1007
1461
  }
1008
1462
  const content = (match[2] ?? "").trim();
1009
1463
  const { name: named, title, description, summary, starters, ...others } = frontmatter.data;
1010
- const name = named ?? deriveSkillName(skillPath);
1464
+ const name2 = named ?? deriveSkillName(skillPath);
1011
1465
  const json = JSON.stringify(others);
1012
1466
  if (json.length > SKILL_FRONTMATTER_MAX_BYTES) {
1013
1467
  throw new SkillMarkdownError(
@@ -1018,8 +1472,8 @@ function parseSkillMarkdown(contents, skillFile, skillPath) {
1018
1472
  }
1019
1473
  const kept = JSON.parse(json);
1020
1474
  return {
1021
- name,
1022
- title: title ?? deriveSkillTitle(name, content),
1475
+ name: name2,
1476
+ title: title ?? deriveSkillTitle(name2, content),
1023
1477
  description,
1024
1478
  ...summary === void 0 ? {} : { summary },
1025
1479
  ...starters === void 0 ? {} : { starters },
@@ -1027,8 +1481,8 @@ function parseSkillMarkdown(contents, skillFile, skillPath) {
1027
1481
  ...Object.keys(others).length > 0 ? { frontmatter: kept } : {}
1028
1482
  };
1029
1483
  }
1030
- function loadFrontmatter(text, skillFile) {
1031
- const read = readYamlData(text, skillFile, { refuseAliases: true });
1484
+ function loadFrontmatter(text2, skillFile) {
1485
+ const read = readYamlData(text2, skillFile, { refuseAliases: true });
1032
1486
  if (read.ok) return read.value;
1033
1487
  const { issue } = read;
1034
1488
  if (issue.code === "yaml_alias") {
@@ -1055,7 +1509,7 @@ function loadFrontmatter(text, skillFile) {
1055
1509
  { issues: [{ message: issue.message, path: [], line, column }] }
1056
1510
  );
1057
1511
  }
1058
- function deriveSkillTitle(name, content) {
1512
+ function deriveSkillTitle(name2, content) {
1059
1513
  let fence;
1060
1514
  for (const line of content.split(/\r?\n/u)) {
1061
1515
  const marker = /^\s{0,3}(`{3,}|~{3,})/u.exec(line)?.[1];
@@ -1066,8 +1520,8 @@ function deriveSkillTitle(name, content) {
1066
1520
  const heading = fence === void 0 ? /^ {0,3}#{1,6}\s+(.+?)(?:\s+#+)?\s*$/u.exec(line) : null;
1067
1521
  if (heading?.[1]) return heading[1];
1068
1522
  }
1069
- const words = name.replace(/[-_]+/gu, " ").trim();
1070
- return words === "" ? name : words.charAt(0).toUpperCase() + words.slice(1);
1523
+ const words = name2.replace(/[-_]+/gu, " ").trim();
1524
+ return words === "" ? name2 : words.charAt(0).toUpperCase() + words.slice(1);
1071
1525
  }
1072
1526
  function formatSkillMarkdown(skill) {
1073
1527
  const content = skill.content.trim();
@@ -1113,11 +1567,298 @@ function withoutExtension(filename) {
1113
1567
  return dot > 0 ? filename.slice(0, dot) : filename;
1114
1568
  }
1115
1569
 
1116
- // src/knowledge-sources.ts
1570
+ // src/knowledge-write.ts
1571
+ import { z as z3 } from "zod";
1572
+
1573
+ // src/operation-batch.ts
1117
1574
  import { z as z2 } from "zod";
1118
- var sourceIdSchema = z2.string().min(1).max(63);
1119
- var countSchema = z2.number().int().min(0);
1120
- var countsSchema = z2.strictObject({
1575
+ var workflowDatasetReferenceSchema = z2.strictObject({
1576
+ $dataset: z2.string().min(1),
1577
+ rowCount: z2.number().int().min(0),
1578
+ // A view keeps the parent byte count as an upper bound.
1579
+ bytes: z2.number().int().min(0),
1580
+ /** Absolute offset in the parent; rowCount bounds the view. No rows are copied. */
1581
+ offset: z2.number().int().nonnegative().optional()
1582
+ });
1583
+ var workflowFileReferenceSchema = z2.strictObject({
1584
+ $file: z2.string().min(1),
1585
+ name: z2.string().min(1).max(200),
1586
+ mimeType: z2.string().min(1).max(200),
1587
+ bytes: z2.number().int().positive()
1588
+ });
1589
+ var operationBatchFailureSchema = z2.strictObject({
1590
+ item: z2.json(),
1591
+ code: z2.string().min(1),
1592
+ message: z2.string().min(1)
1593
+ });
1594
+ var operationBatchResultSchema = z2.strictObject({
1595
+ done: z2.number().int().min(0),
1596
+ failed: z2.number().int().min(0),
1597
+ failures: workflowDatasetReferenceSchema
1598
+ });
1599
+
1600
+ // src/knowledge-write.ts
1601
+ var id = z3.string().min(1).max(200);
1602
+ var count = z3.number().int().min(0);
1603
+ var hash = z3.string().regex(/^[a-f0-9]{64}$/u);
1604
+ var text = z3.string().max(KNOWLEDGE_DOCUMENT_TEXT_MAX_BYTES).refine(
1605
+ (value) => new TextEncoder().encode(value).byteLength <= KNOWLEDGE_DOCUMENT_TEXT_MAX_BYTES,
1606
+ {
1607
+ message: `Document text exceeds ${KNOWLEDGE_DOCUMENT_TEXT_MAX_BYTES} bytes`
1608
+ }
1609
+ );
1610
+ var KNOWLEDGE_ORIGIN_LINK_MAX_CHARS = 4e3;
1611
+ var KNOWLEDGE_ORIGIN_LINK_CHANGES = ["set", "cleared"];
1612
+ var CREDENTIAL_PARAMETERS = /* @__PURE__ */ new Set([
1613
+ "access_token",
1614
+ "id_token",
1615
+ "refresh_token",
1616
+ "token",
1617
+ "auth",
1618
+ "authorization",
1619
+ "apikey",
1620
+ "api_key",
1621
+ "password",
1622
+ "secret",
1623
+ "client_secret",
1624
+ "sig",
1625
+ "signature",
1626
+ "x-amz-signature",
1627
+ "x-amz-credential",
1628
+ "x-amz-security-token",
1629
+ "x-goog-signature",
1630
+ "x-goog-credential"
1631
+ ]);
1632
+ function carriesCredential(link) {
1633
+ let url;
1634
+ try {
1635
+ url = new URL(link);
1636
+ } catch {
1637
+ return false;
1638
+ }
1639
+ if (url.username !== "" || url.password !== "") return true;
1640
+ const fragment = url.hash.startsWith("#") ? url.hash.slice(1) : url.hash;
1641
+ return [url.searchParams, new URLSearchParams(fragment)].some(
1642
+ (parameters) => [...parameters.keys()].some((key2) => CREDENTIAL_PARAMETERS.has(key2.toLowerCase()))
1643
+ );
1644
+ }
1645
+ var knowledgeOriginLinkSchema = z3.url({ protocol: /^https?$/u, error: "An origin link is an http or https address" }).max(KNOWLEDGE_ORIGIN_LINK_MAX_CHARS).refine((link) => !carriesCredential(link), {
1646
+ error: "An origin link names where the original is and carries no sign-in: leave out a user, a password and any token or signature parameter"
1647
+ });
1648
+ var knowledgeIngestFetchSchema = z3.strictObject({
1649
+ connection: id,
1650
+ operation: id,
1651
+ input: z3.record(z3.string(), z3.json())
1652
+ });
1653
+ var ingestItemIdentity = z3.strictObject({
1654
+ itemId: id,
1655
+ version: id,
1656
+ name: z3.string().min(1).max(1e3),
1657
+ path: z3.string().startsWith("/").max(4e3).optional(),
1658
+ originLink: knowledgeOriginLinkSchema.optional(),
1659
+ metadata: z3.record(z3.string(), z3.json()).optional(),
1660
+ text: z3.never().optional(),
1661
+ fileId: z3.never().optional(),
1662
+ fetch: z3.never().optional()
1663
+ });
1664
+ var knowledgeIngestItemSchema = z3.union(
1665
+ [
1666
+ ingestItemIdentity.extend({ text }),
1667
+ ingestItemIdentity.extend({ fileId: id }),
1668
+ ingestItemIdentity.extend({ fetch: knowledgeIngestFetchSchema })
1669
+ ],
1670
+ { error: "knowledge_item_invalid: Supply exactly one of text, fileId or fetch" }
1671
+ ).superRefine((item, context) => {
1672
+ if (item.fetch !== void 0)
1673
+ context.addIssue({
1674
+ code: "custom",
1675
+ path: ["fetch"],
1676
+ message: "not_supported_yet: fetch arrives with CONN-DL; supply text or fileId"
1677
+ });
1678
+ });
1679
+ var knowledgeIngestInputSchema = z3.union([
1680
+ z3.strictObject({ items: z3.array(knowledgeIngestItemSchema), complete: z3.boolean().optional() }),
1681
+ z3.strictObject({ dataset: workflowDatasetReferenceSchema, complete: z3.boolean().optional() })
1682
+ ]);
1683
+ var knowledgeIngestOutputSchema = operationBatchResultSchema.extend({
1684
+ accepted: count,
1685
+ withdrawn: count
1686
+ });
1687
+ var knowledgeWithdrawInputSchema = z3.strictObject({ itemIds: z3.array(id).min(1) });
1688
+ var knowledgeWithdrawOutputSchema = z3.strictObject({ withdrawn: count });
1689
+ var KNOWLEDGE_PENDING_MAX_LIMIT = 1e3;
1690
+ var knowledgePendingInputSchema = z3.strictObject({
1691
+ type: id.optional(),
1692
+ /** Only documents whose `changedAt` is after this time. */
1693
+ since: z3.iso.datetime({ offset: true }).optional(),
1694
+ limit: z3.number().int().positive().max(KNOWLEDGE_PENDING_MAX_LIMIT)
1695
+ });
1696
+ var knowledgePendingRowSchema = z3.strictObject({
1697
+ id,
1698
+ type: id,
1699
+ contentHash: hash,
1700
+ source: z3.string().min(1).nullable(),
1701
+ path: z3.string().startsWith("/"),
1702
+ name: z3.string().min(1),
1703
+ changedAt: z3.iso.datetime({ offset: true }),
1704
+ pages: workflowDatasetReferenceSchema
1705
+ });
1706
+ var knowledgePendingPageRowSchema = z3.strictObject({
1707
+ page: z3.number().int().positive(),
1708
+ text: z3.string()
1709
+ });
1710
+ var knowledgePendingOutputSchema = z3.strictObject({
1711
+ documents: workflowDatasetReferenceSchema
1712
+ });
1713
+ var pageNumber = z3.number().int().positive();
1714
+ var range = z3.strictObject({ pageFrom: pageNumber, pageTo: pageNumber });
1715
+ var processorMetadataSchema = z3.strictObject({
1716
+ documents: z3.array(range).min(1),
1717
+ sections: z3.array(range.extend({ title: z3.string().min(1) })).optional(),
1718
+ fields: z3.record(z3.string(), z3.json())
1719
+ });
1720
+ var knowledgeProcessorOutputSchema = processorMetadataSchema.extend({
1721
+ // Count stays unbounded here: PROC-1/PROC-W must enforce the instance's
1722
+ // knowledge.maxPagesPerDocument at runtime (KB-ISO-3a), not a new contract cap.
1723
+ pages: z3.array(z3.strictObject({ page: pageNumber, text })).min(1)
1724
+ }).superRefine((output, context) => {
1725
+ const pages = new Set(output.pages.map((page) => page.page));
1726
+ if (output.pages.some(
1727
+ (page, index) => index > 0 && page.page <= (output.pages[index - 1]?.page ?? 0)
1728
+ )) {
1729
+ context.addIssue({
1730
+ code: "custom",
1731
+ path: ["pages"],
1732
+ message: "knowledge_processor_output_invalid: Pages must be ascending and unique"
1733
+ });
1734
+ }
1735
+ const bytes = output.pages.reduce(
1736
+ (size, page) => size + new TextEncoder().encode(page.text).byteLength,
1737
+ 0
1738
+ );
1739
+ if (bytes > KNOWLEDGE_DOCUMENT_TEXT_MAX_BYTES)
1740
+ context.addIssue({
1741
+ code: "custom",
1742
+ path: ["pages"],
1743
+ message: "knowledge_processor_output_invalid: Document text exceeds the per-document limit"
1744
+ });
1745
+ for (const field of ["documents", "sections"]) {
1746
+ output[field]?.forEach((entry, index) => {
1747
+ if (entry.pageFrom > entry.pageTo || !pages.has(entry.pageFrom) || !pages.has(entry.pageTo)) {
1748
+ context.addIssue({
1749
+ code: "custom",
1750
+ path: [field, index],
1751
+ message: "knowledge_processor_output_invalid: Page range must be ordered and inside the document"
1752
+ });
1753
+ }
1754
+ });
1755
+ }
1756
+ });
1757
+ var knowledgePutProcessedInputSchema = z3.strictObject({
1758
+ items: z3.union([
1759
+ z3.array(
1760
+ z3.strictObject({
1761
+ documentId: id,
1762
+ contentHash: hash,
1763
+ workflowRevision: id,
1764
+ // Mirror pending: page text lives outside step values and item dataset rows.
1765
+ // PROC-W resolves the pages and validates the full processor output above.
1766
+ output: processorMetadataSchema.extend({ pages: workflowDatasetReferenceSchema })
1767
+ })
1768
+ ),
1769
+ workflowDatasetReferenceSchema
1770
+ ])
1771
+ });
1772
+ var knowledgeFieldValueSchema = z3.json();
1773
+ var knowledgeExtractFieldsInputSchema = z3.strictObject({
1774
+ documentId: id,
1775
+ schema: z3.record(z3.string(), knowledgeFieldValueSchema)
1776
+ });
1777
+ var knowledgeExtractFieldsOutputSchema = z3.strictObject({
1778
+ droppedFields: z3.number().int().nonnegative().optional(),
1779
+ failedFields: z3.number().int().nonnegative().optional(),
1780
+ path: z3.string(),
1781
+ date: z3.iso.date().nullable(),
1782
+ type: id,
1783
+ fields: z3.record(
1784
+ z3.string(),
1785
+ z3.strictObject({ value: knowledgeFieldValueSchema, page: pageNumber, quote: z3.string().min(1) })
1786
+ )
1787
+ });
1788
+ var knowledgeWorkflowSourceSchema = z3.strictObject({
1789
+ id: z3.string().startsWith("workflow:"),
1790
+ kind: z3.literal("workflow"),
1791
+ workflowId: z3.string().regex(/^[a-z][a-z0-9_-]{0,62}$/u)
1792
+ }).refine(
1793
+ (source) => source.id === `workflow:${source.workflowId}` || source.id.startsWith(`workflow:${source.workflowId}@`) && /^[1-9][0-9]{0,9}$/u.test(source.id.slice(`workflow:${source.workflowId}@`.length)),
1794
+ {
1795
+ path: ["id"],
1796
+ message: "A Workflow source id is workflow:<workflowId>@<the revision that created the Workflow>"
1797
+ }
1798
+ );
1799
+ var knowledgeWriteContracts = {
1800
+ ingest: {
1801
+ description: "Ingest items or a dataset into the calling data Workflow's source; complete promises a full pass, withdrawn only after the run succeeds.",
1802
+ inputSchema: knowledgeIngestInputSchema,
1803
+ outputSchema: knowledgeIngestOutputSchema,
1804
+ effect: "changing",
1805
+ right: "knowledge_base.ingest",
1806
+ keyLevel: "write",
1807
+ completion: "async",
1808
+ batch: true
1809
+ },
1810
+ withdraw: {
1811
+ description: "Withdraw item ids from the calling Workflow's source; removed from search immediately.",
1812
+ inputSchema: knowledgeWithdrawInputSchema,
1813
+ outputSchema: knowledgeWithdrawOutputSchema,
1814
+ effect: "changing",
1815
+ right: "knowledge_base.ingest",
1816
+ keyLevel: "write"
1817
+ },
1818
+ pending: {
1819
+ description: "Pull indexed documents of a type whose pages changed after a time, oldest change first, as a dataset; each row's page text is another dataset reference.",
1820
+ inputSchema: knowledgePendingInputSchema,
1821
+ outputSchema: knowledgePendingOutputSchema,
1822
+ rowSchema: knowledgePendingRowSchema,
1823
+ effect: "reading",
1824
+ right: "knowledge_base.read",
1825
+ keyLevel: "read",
1826
+ dataset: true
1827
+ },
1828
+ put_processed: {
1829
+ description: "Write processor output by document, content hash and Workflow revision, with pages as a dataset reference like pending; the platform validates, chunks and indexes it, with per-item outcomes.",
1830
+ inputSchema: knowledgePutProcessedInputSchema,
1831
+ outputSchema: operationBatchResultSchema,
1832
+ effect: "changing",
1833
+ right: "knowledge_base.ingest",
1834
+ keyLevel: "write",
1835
+ batch: true
1836
+ },
1837
+ extract_fields: {
1838
+ description: "Extract fields by schema through the approved model binding within the Knowledge Base budget; each value carries page and quote evidence.",
1839
+ inputSchema: knowledgeExtractFieldsInputSchema,
1840
+ outputSchema: knowledgeExtractFieldsOutputSchema,
1841
+ effect: "reading",
1842
+ right: "knowledge_base.read",
1843
+ keyLevel: "read"
1844
+ }
1845
+ };
1846
+ var knowledgeRecordsRefusalSchema = z3.never({
1847
+ error: "'records' belongs in store.yaml. A data Workflow proposes fields into the Data Store's records mechanism."
1848
+ }).optional();
1849
+
1850
+ // src/knowledge-sources.ts
1851
+ import { z as z4 } from "zod";
1852
+ var sourceIdSchema = z4.union([
1853
+ z4.string().regex(/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/u).max(63),
1854
+ // KBW-2c: a Workflow's source carries the revision that created the Workflow; one made
1855
+ // before that release carries none.
1856
+ knowledgeWorkflowSourceSchema.shape.id.regex(
1857
+ /^workflow:[a-z][a-z0-9_-]{0,62}(?:@[1-9][0-9]{0,9})?$/u
1858
+ )
1859
+ ]);
1860
+ var countSchema = z4.number().int().min(0);
1861
+ var countsSchema = z4.strictObject({
1121
1862
  discovered: countSchema,
1122
1863
  added: countSchema,
1123
1864
  changed: countSchema,
@@ -1126,28 +1867,31 @@ var countsSchema = z2.strictObject({
1126
1867
  failed: countSchema,
1127
1868
  skipped: countSchema
1128
1869
  });
1129
- var knowledgeSyncInputSchema = z2.strictObject({
1870
+ var knowledgeSyncInputSchema = z4.strictObject({
1130
1871
  /** The `id` of the source in the definition. */
1131
1872
  source: sourceIdSchema,
1132
1873
  /** `changes` unless `full`. The initial import is started by publish, not by this call. */
1133
- mode: z2.literal("full", {
1134
- // Keep SRC-0's accepted values frozen while explaining the deferred mode.
1135
- error: (issue) => issue.input === "changes" ? "not_supported_yet: Change-feed sync is not supported yet; request mode full." : void 0
1136
- }).optional()
1874
+ mode: z4.enum(["changes", "full"]).optional(),
1875
+ /**
1876
+ * Lets a first pass that waits for confirmation go on (KB-ISO-1b): a connector's first sync or
1877
+ * a Workflow's first `ingest` above 10,000 items. Needs `knowledge_base.publish`; audited with
1878
+ * the counts and the estimate.
1879
+ */
1880
+ confirm: z4.boolean().optional()
1137
1881
  });
1138
- var knowledgeSyncResultSchema = z2.strictObject({
1139
- syncRunId: z2.string(),
1140
- source: z2.string(),
1141
- mode: z2.enum(KNOWLEDGE_SYNC_MODES),
1882
+ var knowledgeSyncResultSchema = z4.strictObject({
1883
+ syncRunId: z4.string(),
1884
+ source: z4.string(),
1885
+ mode: z4.enum(KNOWLEDGE_SYNC_MODES),
1142
1886
  /** Why a run is of another mode than asked, such as a cursor the source refused. */
1143
- reason: z2.enum(["cursor_expired"]).optional(),
1144
- state: z2.enum(KNOWLEDGE_SYNC_RUN_STATES),
1887
+ reason: z4.enum(["cursor_expired"]).optional(),
1888
+ state: z4.enum(KNOWLEDGE_SYNC_RUN_STATES),
1145
1889
  counts: countsSchema,
1146
- bytesFetched: z2.number().int().min(0),
1890
+ bytesFetched: z4.number().int().min(0),
1147
1891
  /** Why the whole sync failed, for a run in state `failed`. */
1148
- failureCode: z2.enum(KNOWLEDGE_SOURCE_FAILURE_CODES).optional(),
1149
- startedAt: z2.string(),
1150
- endedAt: z2.string().optional()
1892
+ failureCode: z4.enum(KNOWLEDGE_SOURCE_FAILURE_CODES).optional(),
1893
+ startedAt: z4.string(),
1894
+ endedAt: z4.string().optional()
1151
1895
  });
1152
1896
  var KNOWLEDGE_SOURCE_ITEM_SHOWN_STATES = [
1153
1897
  "discovered",
@@ -1156,99 +1900,946 @@ var KNOWLEDGE_SOURCE_ITEM_SHOWN_STATES = [
1156
1900
  "failed",
1157
1901
  "withdrawn"
1158
1902
  ];
1159
- var itemFailureCodeSchema = z2.union([
1160
- z2.enum(KNOWLEDGE_SOURCE_ITEM_FAILURE_CODES),
1161
- z2.enum(KNOWLEDGE_DOCUMENT_FAILURE_CODES)
1903
+ var itemFailureCodeSchema = z4.union([
1904
+ z4.enum(KNOWLEDGE_SOURCE_ITEM_FAILURE_CODES),
1905
+ z4.enum(KNOWLEDGE_DOCUMENT_FAILURE_CODES)
1162
1906
  ]);
1163
- var knowledgeSourcesOutputSchema = z2.strictObject({
1164
- sources: z2.array(
1165
- z2.strictObject({
1166
- id: z2.string(),
1167
- /** The name of the Connection it reads through. */
1168
- connection: z2.string(),
1169
- /** Items by the state the page shows. */
1170
- items: z2.strictObject({
1171
- discovered: countSchema,
1172
- fetched: countSchema,
1173
- indexed: countSchema,
1174
- failed: countSchema,
1175
- withdrawn: countSchema
1176
- }),
1177
- /** Failed items per code. */
1178
- failures: z2.array(z2.strictObject({ code: itemFailureCodeSchema, count: countSchema })),
1179
- /** The sync that runs now, with its rate in items per minute and its estimated end. */
1180
- running: z2.strictObject({
1181
- syncRunId: z2.string(),
1182
- mode: z2.enum(KNOWLEDGE_SYNC_MODES),
1183
- startedAt: z2.string(),
1184
- itemsPerMinute: z2.number().min(0).optional(),
1185
- estimatedEndAt: z2.string().optional()
1186
- }).optional(),
1187
- /** The last sync that ended. */
1188
- last: knowledgeSyncResultSchema.optional(),
1189
- /** "Letzte Änderung verarbeitet". */
1190
- lastChangeAt: z2.string().optional(),
1191
- /** "Älteste offene Änderung". */
1192
- oldestOpenChangeAt: z2.string().optional()
1193
- })
1907
+ var rangeSchema = z4.strictObject({ min: z4.number().min(0), max: z4.number().min(0) });
1908
+ var knowledgeFirstPassConfirmationSchema = z4.strictObject({
1909
+ syncRunId: z4.string(),
1910
+ /** The items of the pass, listed or named, and their size in bytes. */
1911
+ items: countSchema,
1912
+ bytes: countSchema,
1913
+ /** How many it fetches and indexes before it waits. */
1914
+ stop: countSchema,
1915
+ /** Estimated from the listed sizes; absent where the Knowledge Base does not search by meaning. */
1916
+ tokens: rangeSchema.optional(),
1917
+ passages: rangeSchema.optional(),
1918
+ /** The embedding model it embeds with; absent where the Knowledge Base does not search by meaning. */
1919
+ model: z4.string().optional(),
1920
+ /** From the rate card; absent where nothing is embedded or the model has no price. */
1921
+ cost: rangeSchema.extend({ currency: z4.string() }).optional(),
1922
+ /**
1923
+ * Whether the store's size limit holds the high estimate of passages and vectors, and that
1924
+ * estimate; absent where nothing is embedded.
1925
+ */
1926
+ room: z4.boolean().optional(),
1927
+ storeBytes: countSchema,
1928
+ addedBytes: countSchema.optional(),
1929
+ limitBytes: countSchema.optional()
1930
+ });
1931
+ var sourceStatusSchema = z4.strictObject({
1932
+ id: z4.string(),
1933
+ /** The name of the Connection it reads through. */
1934
+ connection: z4.string(),
1935
+ kind: z4.literal("connector").optional(),
1936
+ /** Items by the state the page shows. */
1937
+ items: z4.strictObject({
1938
+ discovered: countSchema,
1939
+ fetched: countSchema,
1940
+ indexed: countSchema,
1941
+ failed: countSchema,
1942
+ withdrawn: countSchema
1943
+ }),
1944
+ /** Failed items per code. */
1945
+ failures: z4.array(z4.strictObject({ code: itemFailureCodeSchema, count: countSchema })),
1946
+ /** The sync that runs now, with its rate in items per minute and its estimated end. */
1947
+ running: z4.strictObject({
1948
+ syncRunId: z4.string(),
1949
+ mode: z4.enum(KNOWLEDGE_SYNC_MODES),
1950
+ startedAt: z4.string(),
1951
+ itemsPerMinute: z4.number().min(0).optional(),
1952
+ estimatedEndAt: z4.string().optional()
1953
+ }).optional(),
1954
+ /** The last sync that ended. */
1955
+ last: knowledgeSyncResultSchema.optional(),
1956
+ /** "Wartet auf Bestätigung": the running first pass stopped at 10,000 items. */
1957
+ confirmation: knowledgeFirstPassConfirmationSchema.optional(),
1958
+ /**
1959
+ * When a connector source syncs by itself (SRC-SYNC), as it applies: its `changes` poll in
1960
+ * minutes or `off`, its full pass as a cron expression in the instance's time zone or `off`,
1961
+ * and what its connector type gives a source that sets none: the poll, the full pass, and the
1962
+ * shortest poll the type allows, where it has one.
1963
+ */
1964
+ schedule: z4.strictObject({
1965
+ changes: z4.union([z4.literal("off"), z4.number().int().min(1)]),
1966
+ full: z4.string(),
1967
+ defaultChanges: z4.number().int().min(1),
1968
+ defaultFull: z4.string(),
1969
+ minChanges: z4.number().int().min(1).optional()
1970
+ }).optional(),
1971
+ /** "Letzte Änderung verarbeitet". */
1972
+ lastChangeAt: z4.string().optional(),
1973
+ /** "Älteste offene Änderung". */
1974
+ oldestOpenChangeAt: z4.string().optional()
1975
+ });
1976
+ var knowledgeSourcesOutputSchema = z4.strictObject({
1977
+ sources: z4.array(
1978
+ z4.union([
1979
+ sourceStatusSchema,
1980
+ knowledgeWorkflowSourceSchema.safeExtend(
1981
+ sourceStatusSchema.omit({ id: true, connection: true, kind: true }).shape
1982
+ )
1983
+ ])
1194
1984
  )
1195
1985
  });
1196
- var knowledgeSourceItemsInputSchema = z2.strictObject({
1986
+ var knowledgeSourceItemsInputSchema = z4.strictObject({
1197
1987
  source: sourceIdSchema,
1198
- state: z2.enum(KNOWLEDGE_SOURCE_ITEM_SHOWN_STATES).optional(),
1988
+ state: z4.enum(KNOWLEDGE_SOURCE_ITEM_SHOWN_STATES).optional(),
1199
1989
  failureCode: itemFailureCodeSchema.optional(),
1200
1990
  /** Items per page: 50 by default, at most 200. */
1201
- limit: z2.coerce.number().int().min(1).max(200).optional(),
1202
- cursor: z2.string().min(1).max(1e3).optional()
1991
+ limit: z4.coerce.number().int().min(1).max(200).optional(),
1992
+ cursor: z4.string().min(1).max(1e3).optional()
1203
1993
  });
1204
- var knowledgeSourceItemsOutputSchema = z2.strictObject({
1994
+ var knowledgeSourceItemsOutputSchema = z4.strictObject({
1205
1995
  /** Newest change first. */
1206
- items: z2.array(
1207
- z2.strictObject({
1996
+ items: z4.array(
1997
+ z4.strictObject({
1208
1998
  /** The row in `source_items`: what `retry` and `locate` name. */
1209
- id: z2.string(),
1999
+ id: z4.string(),
1210
2000
  /** The id of the item at the source. */
1211
- itemId: z2.string(),
1212
- name: z2.string(),
1213
- path: z2.string(),
1214
- state: z2.enum(KNOWLEDGE_SOURCE_ITEM_SHOWN_STATES),
2001
+ itemId: z4.string(),
2002
+ name: z4.string(),
2003
+ path: z4.string(),
2004
+ state: z4.enum(KNOWLEDGE_SOURCE_ITEM_SHOWN_STATES),
1215
2005
  failureCode: itemFailureCodeSchema.optional(),
1216
- documentId: z2.string().optional(),
1217
- originLink: z2.string().optional(),
1218
- changedAt: z2.string()
2006
+ documentId: z4.string().optional(),
2007
+ originLink: z4.string().optional(),
2008
+ changedAt: z4.string()
1219
2009
  })
1220
2010
  ),
1221
- nextCursor: z2.string().optional()
2011
+ nextCursor: z4.string().optional()
1222
2012
  });
1223
2013
  var RETRY_MAX = 100;
1224
- var knowledgeRetryInputSchema = z2.union([
1225
- z2.strictObject({ documentIds: z2.array(z2.string().min(1).max(200)).min(1).max(RETRY_MAX) }),
1226
- z2.strictObject({
2014
+ var knowledgeRetryInputSchema = z4.union([
2015
+ z4.strictObject({ documentIds: z4.array(z4.string().min(1).max(200)).min(1).max(RETRY_MAX) }),
2016
+ z4.strictObject({
1227
2017
  source: sourceIdSchema,
1228
- sourceItemIds: z2.array(z2.string().min(1).max(200)).min(1).max(RETRY_MAX)
2018
+ sourceItemIds: z4.array(z4.string().min(1).max(200)).min(1).max(RETRY_MAX)
1229
2019
  }),
1230
- z2.strictObject({ source: sourceIdSchema, failureCode: itemFailureCodeSchema }),
1231
- z2.strictObject({ source: sourceIdSchema, all: z2.literal(true) })
2020
+ z4.strictObject({ source: sourceIdSchema, failureCode: itemFailureCodeSchema }),
2021
+ z4.strictObject({ source: sourceIdSchema, all: z4.literal(true) })
1232
2022
  ]);
1233
- var knowledgeRetryOutputSchema = z2.strictObject({
2023
+ var knowledgeRetryOutputSchema = z4.strictObject({
1234
2024
  /** For a retry by document ids: each named document, with its state after the retry. */
1235
- documents: z2.array(z2.strictObject({ id: z2.string(), state: z2.enum(KNOWLEDGE_DOCUMENT_STATES) })).optional(),
2025
+ documents: z4.array(z4.strictObject({ id: z4.string(), state: z4.enum(KNOWLEDGE_DOCUMENT_STATES) })).optional(),
1236
2026
  /** How many contents or items were queued again. */
1237
- queued: z2.number().int()
2027
+ queued: z4.number().int(),
2028
+ /**
2029
+ * For a Workflow-fed source: how many items removed by hand were allowed back. Its next pass
2030
+ * that names one takes it again (KBW-2b).
2031
+ */
2032
+ released: z4.number().int().optional()
1238
2033
  });
1239
- var knowledgeLocateInputSchema = z2.strictObject({
2034
+ var knowledgeLocateInputSchema = z4.strictObject({
1240
2035
  /** The row in `source_items`. */
1241
- sourceItemId: z2.string().min(1).max(200)
1242
- });
1243
- var knowledgeLocateOutputSchema = z2.strictObject({
1244
- sourceItemId: z2.string(),
1245
- source: z2.string(),
1246
- itemId: z2.string(),
1247
- state: z2.enum(KNOWLEDGE_SOURCE_ITEM_SHOWN_STATES),
1248
- discoveredAt: z2.string(),
1249
- fetchedAt: z2.string().optional(),
1250
- withdrawnAt: z2.string().optional(),
1251
- purgedAt: z2.string().optional()
2036
+ sourceItemId: z4.string().min(1).max(200)
2037
+ });
2038
+ var knowledgeLocateOutputSchema = z4.strictObject({
2039
+ sourceItemId: z4.string(),
2040
+ source: z4.string(),
2041
+ itemId: z4.string(),
2042
+ state: z4.enum(KNOWLEDGE_SOURCE_ITEM_SHOWN_STATES),
2043
+ discoveredAt: z4.string(),
2044
+ fetchedAt: z4.string().optional(),
2045
+ withdrawnAt: z4.string().optional(),
2046
+ purgedAt: z4.string().optional(),
2047
+ /** A person removed it by hand; a pass leaves it out until a publisher lifts the hold. */
2048
+ removedAt: z4.string().optional()
2049
+ });
2050
+ var knowledgeWorkflowSourcesOutputSchema = z4.strictObject({
2051
+ knowledgeBases: z4.array(
2052
+ z4.strictObject({ name: z4.string(), title: z4.string(), documents: countSchema })
2053
+ ),
2054
+ hidden: z4.strictObject({ knowledgeBases: countSchema, documents: countSchema })
2055
+ });
2056
+
2057
+ // src/workflow-datasets.ts
2058
+ var WORKFLOW_DATASET_STATES = ["writing", "complete", "deleted"];
2059
+
2060
+ // src/operation-paging.ts
2061
+ import { z as z5 } from "zod";
2062
+ var operationPagingSchema = z5.discriminatedUnion("by", [
2063
+ z5.strictObject({
2064
+ by: z5.enum(["page", "offset"]),
2065
+ param: z5.string().min(1),
2066
+ sizeParam: z5.string().min(1),
2067
+ size: z5.number().int().min(1),
2068
+ start: z5.number().int().min(0).optional()
2069
+ }),
2070
+ z5.strictObject({
2071
+ by: z5.enum(["cursor", "next_link"]),
2072
+ param: z5.string().min(1),
2073
+ cursor: z5.string().min(1)
2074
+ })
2075
+ ]);
2076
+
2077
+ // src/workflow-data-flows.ts
2078
+ import { z as z6 } from "zod";
2079
+ var workflowDataFlowsSchema = z6.object({
2080
+ fills: z6.array(z6.object({ id: z6.string(), name: z6.string(), title: z6.string() })),
2081
+ processes: z6.array(z6.object({ id: z6.string(), name: z6.string(), title: z6.string() })),
2082
+ hidden: z6.object({ fills: z6.number().int().min(0), processes: z6.number().int().min(0) }),
2083
+ truncated: z6.boolean()
2084
+ });
2085
+
2086
+ // src/data-store-records.ts
2087
+ import { z as z7 } from "zod";
2088
+ var RECORDS_PROPOSE_MAX_ITEMS_PER_CALL = 1e3;
2089
+ var RECORDS_PROPOSE_MAX_FIELDS_PER_ITEM = 1e3;
2090
+ var RECORDS_FLAGGED_MAX_ITEMS_PER_PAGE = 1e4;
2091
+ var name = z7.string().min(1);
2092
+ var id2 = z7.string().min(1).max(200);
2093
+ var key = z7.union([z7.string().min(1), z7.number(), z7.boolean()]);
2094
+ var dataStoreRecordsRuleSchema = z7.strictObject({
2095
+ table: name,
2096
+ key: z7.union([
2097
+ z7.strictObject({ column: name, fromPath: z7.string().startsWith("/").min(1) }),
2098
+ z7.strictObject({ column: name, fromField: name })
2099
+ ]),
2100
+ precedence: z7.array(name).default([]),
2101
+ review: z7.strictObject({ always: z7.array(name).default([]) }).prefault({}),
2102
+ retainWithoutSource: z7.boolean().default(false)
2103
+ }).superRefine((rule, context) => {
2104
+ if ("fromPath" in rule.key) {
2105
+ const placeholders = rule.key.fromPath.match(/\{[^{}]*\}/gu);
2106
+ if (placeholders?.length !== 1 || placeholders[0] !== `{${rule.key.column}}`) {
2107
+ context.addIssue({
2108
+ code: "custom",
2109
+ path: ["key", "fromPath"],
2110
+ message: "fromPath must contain exactly one placeholder naming the key column"
2111
+ });
2112
+ }
2113
+ }
2114
+ });
2115
+ var recordEvidenceResultSchema = z7.discriminatedUnion("status", [
2116
+ z7.strictObject({ status: z7.literal("passed") }),
2117
+ z7.strictObject({
2118
+ status: z7.literal("failed"),
2119
+ reason: z7.enum(["page_not_found", "quote_not_found", "value_not_parsed"])
2120
+ })
2121
+ ]);
2122
+ var RECORD_FIELD_STATES = ["extracted", "confirmed", "corrected", "conflict"];
2123
+ var RECORD_FLAG_REASONS = [
2124
+ "conflict",
2125
+ "not_evidenced",
2126
+ "confirmation_required",
2127
+ "key_unresolved"
2128
+ ];
2129
+ var RECORD_FIELD_FAILURE_CODES = ["record_field_unknown"];
2130
+ var fieldSchema = knowledgeExtractFieldsOutputSchema.shape.fields.valueType.extend({ name });
2131
+ var dataStoreRecordProposalItemSchema = z7.strictObject({
2132
+ // Document ids are scoped by their Knowledge Base. Both ids travel with every citation.
2133
+ knowledgeBaseId: id2,
2134
+ documentId: id2,
2135
+ kind: name,
2136
+ documentDate: z7.iso.date().nullable(),
2137
+ path: z7.string().startsWith("/").optional(),
2138
+ fields: z7.array(fieldSchema).min(1).max(
2139
+ RECORDS_PROPOSE_MAX_FIELDS_PER_ITEM,
2140
+ "At most 1000 fields per item (RECORDS_PROPOSE_MAX_FIELDS_PER_ITEM); split larger proposals into batches"
2141
+ )
2142
+ });
2143
+ var dataStoreRecordsProposeInputSchema = z7.strictObject({
2144
+ table: name,
2145
+ items: z7.array(dataStoreRecordProposalItemSchema).max(
2146
+ RECORDS_PROPOSE_MAX_ITEMS_PER_CALL,
2147
+ "At most 1000 items per call (RECORDS_PROPOSE_MAX_ITEMS_PER_CALL); send another batch"
2148
+ )
2149
+ });
2150
+ var decisionSchema = z7.strictObject({
2151
+ table: name,
2152
+ key,
2153
+ field: name,
2154
+ documentId: id2.optional(),
2155
+ knowledgeBaseId: id2.optional()
2156
+ });
2157
+ var dataStoreRecordsDecideInputSchema = z7.discriminatedUnion("action", [
2158
+ decisionSchema.extend({ action: z7.literal("confirm") }),
2159
+ decisionSchema.extend({ action: z7.literal("correct"), value: knowledgeFieldValueSchema }),
2160
+ decisionSchema.extend({ action: z7.literal("assign"), documentId: id2, knowledgeBaseId: id2 })
2161
+ ]).refine(
2162
+ (decision) => decision.documentId === void 0 === (decision.knowledgeBaseId === void 0),
2163
+ {
2164
+ path: ["documentId"],
2165
+ message: "A citation needs both knowledgeBaseId and documentId"
2166
+ }
2167
+ );
2168
+ var dataStoreRecordsDecideOutputSchema = z7.strictObject({ decided: z7.literal(true) });
2169
+ var dataStoreRecordsFlaggedInputSchema = z7.strictObject({
2170
+ table: name.optional(),
2171
+ cursor: z7.string().min(1).optional(),
2172
+ limit: z7.number().int().positive().max(
2173
+ RECORDS_FLAGGED_MAX_ITEMS_PER_PAGE,
2174
+ "At most 10000 items per page (RECORDS_FLAGGED_MAX_ITEMS_PER_PAGE); follow nextCursor"
2175
+ )
2176
+ });
2177
+ var dataStoreRecordFieldSchema = fieldSchema.extend({
2178
+ // `value` is what the document reads; a person's correction stands beside it, held exactly
2179
+ // while the state is `corrected` (REC-KEEP).
2180
+ correctedValue: knowledgeFieldValueSchema.nullable(),
2181
+ table: name,
2182
+ // Unresolved keys go to review, without writing a customer row.
2183
+ key: key.nullable(),
2184
+ knowledgeBaseId: id2,
2185
+ documentId: id2,
2186
+ kind: name,
2187
+ documentDate: z7.iso.date().nullable(),
2188
+ extractedAt: z7.iso.datetime({ offset: true }),
2189
+ evidence: recordEvidenceResultSchema,
2190
+ state: z7.enum(RECORD_FIELD_STATES),
2191
+ decidedBy: id2.nullable(),
2192
+ decidedAt: z7.iso.datetime({ offset: true }).nullable()
2193
+ });
2194
+ var dataStoreRecordsFlaggedOutputSchema = z7.strictObject({
2195
+ // A citation is shown only after checking access to its Knowledge Base, even for a
2196
+ // holder of data_store.records. Values/quotes never enter jobs, runs or audit metadata.
2197
+ items: z7.array(
2198
+ dataStoreRecordFieldSchema.extend({
2199
+ reason: z7.enum(RECORD_FLAG_REASONS),
2200
+ // REC-2: the cited document as its chip opens it, by the Knowledge Base's name. Absent
2201
+ // where the document is no longer there to open.
2202
+ document: z7.strictObject({ knowledgeBase: name, fileName: name }).optional(),
2203
+ // REC-KEEP: the person who decided, by the name the instance shows for them, read when
2204
+ // the list is. Absent where the account is gone or its deletion was requested.
2205
+ decidedByName: z7.string().min(1).optional()
2206
+ })
2207
+ ).max(RECORDS_FLAGGED_MAX_ITEMS_PER_PAGE),
2208
+ nextCursor: z7.string().optional()
2209
+ });
2210
+ var scalarSchemas = {
2211
+ text: z7.string(),
2212
+ integer: z7.number().int(),
2213
+ number: z7.number(),
2214
+ boolean: z7.boolean(),
2215
+ date: z7.iso.date(),
2216
+ timestamp: z7.iso.datetime({ offset: true })
2217
+ };
2218
+ function recordColumnTakes(column, value) {
2219
+ return compatible(column, value);
2220
+ }
2221
+ function compatible(column, value) {
2222
+ if (column.generated || column.type === "other") return false;
2223
+ if (value === null) return column.nullable;
2224
+ for (const [type, schema] of Object.entries(scalarSchemas)) {
2225
+ if (column.type === type) return schema.safeParse(value).success;
2226
+ if (column.type === `${type}[]`) return z7.array(schema.nullable()).safeParse(value).success;
2227
+ }
2228
+ return false;
2229
+ }
2230
+ function proposalItemSchemaFor(columns) {
2231
+ const byName = new Map(columns.map((column) => [column.name, column]));
2232
+ return dataStoreRecordProposalItemSchema.superRefine((item, context) => {
2233
+ const seen = /* @__PURE__ */ new Set();
2234
+ item.fields.forEach((field, index) => {
2235
+ const column = byName.get(field.name);
2236
+ if (!column || !compatible(column, field.value) || seen.has(field.name)) {
2237
+ context.addIssue({
2238
+ code: "custom",
2239
+ path: ["fields", index],
2240
+ message: `record_field_unknown: Field '${field.name}' has no writable column of a compatible type, or occurs twice`
2241
+ });
2242
+ }
2243
+ seen.add(field.name);
2244
+ });
2245
+ });
2246
+ }
2247
+ var dataStoreRecordsContracts = {
2248
+ propose: {
2249
+ description: "Propose extracted fields with Knowledge Base/document/page/quote evidence. Validate each whole item against the published table before writing; failures are per item. Send at most 1000 items per call and 1000 fields per item; split larger work into batches. Merge by evidence precedence, then document date; unresolved keys and evidence go to review.",
2250
+ inputSchema: dataStoreRecordsProposeInputSchema,
2251
+ outputSchema: operationBatchResultSchema,
2252
+ itemSchemaFor: proposalItemSchemaFor,
2253
+ effect: "changing",
2254
+ right: "data_store.records",
2255
+ keyLevel: "write",
2256
+ batch: true
2257
+ },
2258
+ decide: {
2259
+ description: "Confirm or correct a field against its evidence, or assign a document to an object key. Decisions are pinned; audit table/field/action/actor only, never the value.",
2260
+ inputSchema: dataStoreRecordsDecideInputSchema,
2261
+ outputSchema: dataStoreRecordsDecideOutputSchema,
2262
+ effect: "changing",
2263
+ right: "data_store.records",
2264
+ keyLevel: "write"
2265
+ },
2266
+ flagged: {
2267
+ description: "Page through fields needing review, up to 10000 per call; pass nextCursor as cursor for the next page. Check Knowledge Base access before showing any document citation; the store right alone does not grant access to source documents.",
2268
+ inputSchema: dataStoreRecordsFlaggedInputSchema,
2269
+ outputSchema: dataStoreRecordsFlaggedOutputSchema,
2270
+ effect: "reading",
2271
+ right: "data_store.records",
2272
+ keyLevel: "read"
2273
+ }
2274
+ };
2275
+
2276
+ // src/usage-limits.ts
2277
+ var MODEL_USAGE_LIMIT_PERIODS = ["day", "month"];
2278
+ var MODEL_USAGE_LIMIT_METRICS = ["modelCallCount", "tokens", "costMicros"];
2279
+ var MODEL_USAGE_LIMIT_SCOPES = ["instance", "user", "system", "workspace"];
2280
+ var USAGE_SPEND_LIMIT_LEVELS = [
2281
+ "instance",
2282
+ "workspace_default",
2283
+ "workspace",
2284
+ "user_default",
2285
+ "user"
2286
+ ];
2287
+ var PERSONAL_WORKSPACES_KEY = "personal";
2288
+ var PERSONAL_AGENTS_KEY = ":personal";
2289
+ var USAGE_BREAKDOWN_DIMENSIONS = [
2290
+ "workspace",
2291
+ "agent",
2292
+ "app",
2293
+ "workflow",
2294
+ "model",
2295
+ "origin"
2296
+ ];
2297
+ var USAGE_ORIGINS = [
2298
+ "conversation",
2299
+ "app",
2300
+ "workflow",
2301
+ "knowledge_base",
2302
+ "system"
2303
+ ];
2304
+
2305
+ // src/workflow-text.ts
2306
+ var WORKFLOW_TEXT_FORMAT_MARKDOWN = "markdown";
2307
+ var WORKFLOW_TEXT_MAX_PARTS = 100;
2308
+ var WORKFLOW_MARKDOWN_MAX_ROWS = 100;
2309
+ var WORKFLOW_MARKDOWN_MAX_COLUMNS = 8;
2310
+
2311
+ // src/mail-send.ts
2312
+ import { z as z8 } from "zod";
2313
+ var MAIL_SEND_OPERATION = "mail.send";
2314
+ var MAIL_SENDER_RESOURCE_KIND = "mail_sender";
2315
+ var MAIL_SENDER_USE_ACTION = "mail_sender.use";
2316
+ var MAIL_SENDER_SYSTEM = "system";
2317
+ var MAIL_SENDER_CONNECTION_PREFIX = "connection.";
2318
+ var MAIL_SENDER_SYSTEM_ICON = "system-mail";
2319
+ var MAIL_WORKFLOW_MESSAGE_TEMPLATE = "workflow-message";
2320
+ var MAIL_SEND_MAX_ADDRESSES = 50;
2321
+ var MAIL_SUBJECT_MAX_LENGTH = 200;
2322
+ var MAIL_BODY_MAX_BYTES = 64 * 1024;
2323
+ var MAIL_SENDER_NAME_MAX_LENGTH = 80;
2324
+ var MAIL_ADDRESS_MAX_LENGTH = 254;
2325
+ var MAIL_OUTBOUND_DEFAULT_LIMITS = {
2326
+ perWorkflowPerHour: 200,
2327
+ perInstancePerDay: 1e3
2328
+ };
2329
+ var MAIL_OUTBOUND_FOOTER_MAX_LENGTH = 2e3;
2330
+ var MAIL_AUDIT_MAX_DOMAINS = 10;
2331
+ var MAIL_ATTACHMENTS_MAX_FILES = 10;
2332
+ var MAIL_ATTACHMENTS_MAX_BYTES = 10 * 1024 * 1024;
2333
+ var MAIL_SEND_ERROR_CODES = {
2334
+ recipientNotAllowed: "recipient_not_allowed",
2335
+ noRecipient: "no_recipient",
2336
+ mailRejected: "mail_rejected",
2337
+ workspaceNotAllowed: "workspace_not_allowed"
2338
+ };
2339
+ var MAIL_SEND_REFUSAL_REASONS = [
2340
+ MAIL_SEND_ERROR_CODES.recipientNotAllowed,
2341
+ MAIL_SEND_ERROR_CODES.noRecipient,
2342
+ MAIL_SEND_ERROR_CODES.mailRejected,
2343
+ MAIL_SEND_ERROR_CODES.workspaceNotAllowed
2344
+ ];
2345
+ var mailSendRefusalDetailsSchema = z8.discriminatedUnion("reason", [
2346
+ z8.strictObject({
2347
+ reason: z8.literal(MAIL_SEND_ERROR_CODES.recipientNotAllowed),
2348
+ domain: z8.string().min(1).max(MAIL_ADDRESS_MAX_LENGTH)
2349
+ }),
2350
+ z8.strictObject({ reason: z8.literal(MAIL_SEND_ERROR_CODES.noRecipient) }),
2351
+ z8.strictObject({ reason: z8.literal(MAIL_SEND_ERROR_CODES.workspaceNotAllowed) }),
2352
+ z8.strictObject({
2353
+ reason: z8.literal(MAIL_SEND_ERROR_CODES.mailRejected),
2354
+ providerCode: z8.string().min(1).max(100).optional()
2355
+ })
2356
+ ]);
2357
+ var MAIL_RECIPIENT_ID_PATTERN = /^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$/u;
2358
+ var principalId = z8.string().regex(MAIL_RECIPIENT_ID_PATTERN);
2359
+ var ONE_LINE_PATTERN = /^[^\u0000-\u001f\u007f\u2028\u2029]*$/u;
2360
+ var mailAddressSchema = z8.email().max(MAIL_ADDRESS_MAX_LENGTH);
2361
+ var MAIL_RECIPIENT_DOMAIN_PATTERN = /^(\*\.)?(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+(?:[a-z]{2,63}|xn--[a-z0-9-]{1,59})$/u;
2362
+ var MAIL_RECIPIENT_DOMAINS_ANY = "*";
2363
+ var mailRecipientDomainSchema = z8.string().max(MAIL_ADDRESS_MAX_LENGTH).refine(
2364
+ (domain) => domain === MAIL_RECIPIENT_DOMAINS_ANY || MAIL_RECIPIENT_DOMAIN_PATTERN.test(domain),
2365
+ { message: "A recipient domain is lowercase, such as kanzlei.de or *.kanzlei.de, or * alone" }
2366
+ );
2367
+ var mailSenderIdSchema = z8.union([
2368
+ z8.literal(MAIL_SENDER_SYSTEM),
2369
+ z8.templateLiteral([MAIL_SENDER_CONNECTION_PREFIX, z8.string().regex(CONNECTION_NAME_PATTERN)])
2370
+ ]).superRefine((sender, context) => {
2371
+ if (sender !== MAIL_SENDER_SYSTEM)
2372
+ context.addIssue({
2373
+ code: "custom",
2374
+ message: "not_supported_yet: a Connection sender arrives with MAIL-M365S; send as system"
2375
+ });
2376
+ });
2377
+ var mailRecipientSchema = z8.union([
2378
+ z8.strictObject({ address: mailAddressSchema }),
2379
+ z8.strictObject({ user: principalId }),
2380
+ z8.strictObject({ workspace: principalId })
2381
+ ]);
2382
+ var recipientEntries = z8.array(
2383
+ z8.union([mailAddressSchema, mailRecipientSchema, z8.looseObject({ email: mailAddressSchema })])
2384
+ ).max(MAIL_SEND_MAX_ADDRESSES);
2385
+ var mailRecipientListSchema = z8.union([mailAddressSchema, recipientEntries.min(1)]);
2386
+ var mailCopyRecipientListSchema = z8.union([mailAddressSchema, recipientEntries]);
2387
+ var mailReplyToSchema = z8.union([
2388
+ mailAddressSchema,
2389
+ z8.strictObject({ address: mailAddressSchema }),
2390
+ z8.strictObject({ user: principalId })
2391
+ ]);
2392
+ var mailSubjectSchema = z8.string().min(1).max(MAIL_SUBJECT_MAX_LENGTH).regex(ONE_LINE_PATTERN, { message: "input_invalid: a subject is one line" }).refine((subject) => subject.trim().length > 0, { message: "input_invalid: a subject has text" });
2393
+ var mailBodySchema = z8.string().max(MAIL_BODY_MAX_BYTES).refine((body) => new TextEncoder().encode(body).byteLength <= MAIL_BODY_MAX_BYTES, {
2394
+ message: `input_invalid: the body exceeds ${MAIL_BODY_MAX_BYTES} bytes`
2395
+ }).meta({ format: WORKFLOW_TEXT_FORMAT_MARKDOWN });
2396
+ var mailSenderNameSchema = z8.string().min(1).max(MAIL_SENDER_NAME_MAX_LENGTH).regex(ONE_LINE_PATTERN, { message: "input_invalid: a sender name is one line" }).refine((name2) => !name2.includes("@"), {
2397
+ message: "input_invalid: a sender name holds no @"
2398
+ });
2399
+ var mailSendInputSchema = z8.strictObject({
2400
+ sender: mailSenderIdSchema.default(MAIL_SENDER_SYSTEM),
2401
+ to: mailRecipientListSchema,
2402
+ cc: mailCopyRecipientListSchema.optional(),
2403
+ bcc: mailCopyRecipientListSchema.optional(),
2404
+ subject: mailSubjectSchema,
2405
+ body: mailBodySchema,
2406
+ senderName: mailSenderNameSchema.optional(),
2407
+ replyTo: mailReplyToSchema.optional(),
2408
+ /** The language of the frame around the body; the instance's default unless set. */
2409
+ locale: z8.enum(localeCodes).optional()
2410
+ });
2411
+ var count2 = z8.number().int().min(0);
2412
+ var recipientCounts = z8.strictObject({ to: count2, cc: count2, bcc: count2 });
2413
+ var mailSendOutputSchema = z8.strictObject({
2414
+ sentAt: z8.iso.datetime({ offset: true }),
2415
+ messageId: z8.string().min(1).max(256).optional(),
2416
+ recipients: recipientCounts,
2417
+ skipped: count2,
2418
+ test: z8.literal(true).optional()
2419
+ });
2420
+ var mailPreviewRecipientSchema = z8.strictObject({
2421
+ kind: z8.enum(["person", "address"]),
2422
+ label: z8.string().min(1).max(MAIL_ADDRESS_MAX_LENGTH)
2423
+ });
2424
+ var mailSendPreviewSchema = z8.strictObject({
2425
+ from: z8.strictObject({ name: z8.string().min(1), address: mailAddressSchema }),
2426
+ replyTo: mailAddressSchema.optional(),
2427
+ to: z8.array(mailPreviewRecipientSchema),
2428
+ cc: z8.array(mailPreviewRecipientSchema),
2429
+ bcc: z8.array(mailPreviewRecipientSchema),
2430
+ skipped: count2,
2431
+ subject: z8.string(),
2432
+ html: z8.string(),
2433
+ text: z8.string()
2434
+ });
2435
+ var mailSendSimulatedOutputSchema = z8.strictObject({
2436
+ simulated: z8.literal(true),
2437
+ preview: mailSendPreviewSchema
2438
+ });
2439
+ var workflowMessageMailParamsSchema = z8.strictObject({
2440
+ subject: mailSubjectSchema,
2441
+ markdown: mailBodySchema,
2442
+ sentBy: z8.discriminatedUnion("kind", [
2443
+ z8.strictObject({ kind: z8.literal("workflow"), workflowName: z8.string().min(1).max(200) }),
2444
+ z8.strictObject({ kind: z8.literal("agent"), onBehalfOf: z8.string().min(1).max(200) })
2445
+ ]),
2446
+ test: z8.strictObject({
2447
+ intendedRecipients: z8.strictObject({
2448
+ to: z8.array(mailPreviewRecipientSchema),
2449
+ cc: z8.array(mailPreviewRecipientSchema),
2450
+ bcc: z8.array(mailPreviewRecipientSchema)
2451
+ })
2452
+ }).optional()
2453
+ });
2454
+ var workflowMailSenderFactSchema = z8.strictObject({
2455
+ sender: z8.string().min(1),
2456
+ title: z8.string().min(1),
2457
+ icon: z8.string().min(1),
2458
+ address: mailAddressSchema,
2459
+ recipientDomains: z8.array(mailRecipientDomainSchema)
2460
+ });
2461
+ var mailSendContract = {
2462
+ name: MAIL_SEND_OPERATION,
2463
+ description: "Send one e-mail as a sender of the instance (system unless set). Recipients are addresses, people of the instance and workspaces; an address outside the instance's recipient domains is refused. The body is Markdown in the instance's frame. A test run previews the mail and sends nothing.",
2464
+ inputSchema: mailSendInputSchema,
2465
+ outputSchema: mailSendOutputSchema,
2466
+ simulatedOutputSchema: mailSendSimulatedOutputSchema,
2467
+ effect: "changing",
2468
+ changeClass: "outward",
2469
+ right: MAIL_SENDER_USE_ACTION,
2470
+ resourceKind: MAIL_SENDER_RESOURCE_KIND,
2471
+ events: { after: "mail.sent", refused: "mail.refused" },
2472
+ errorCodes: MAIL_SEND_ERROR_CODES
2473
+ };
2474
+
2475
+ // src/data-scope.ts
2476
+ import { z as z9 } from "zod";
2477
+ var dataScopeNameSchema = z9.string().regex(/^[a-z][a-z0-9_]{0,62}$/u);
2478
+ var dataScopesSchema = z9.record(
2479
+ dataScopeNameSchema,
2480
+ z9.strictObject({
2481
+ label: z9.string().trim().min(1).max(120),
2482
+ valueType: z9.literal("text")
2483
+ })
2484
+ ).refine(
2485
+ (dimensions) => Object.keys(dimensions).length <= 1,
2486
+ "One data scope dimension is supported"
2487
+ );
2488
+ var scopeAssignmentInputSchema = z9.strictObject({
2489
+ dimension: dataScopeNameSchema,
2490
+ holderKind: z9.enum(["user", "group", "service_principal"]),
2491
+ holderId: z9.string().min(1).max(200).refine((value) => !value.includes("\0"), "NUL is not allowed"),
2492
+ effect: z9.enum(GRANT_EFFECTS),
2493
+ values: z9.union([
2494
+ z9.literal("all"),
2495
+ z9.array(
2496
+ z9.string().min(1).max(200).refine((value) => !value.includes("\0"), "NUL is not allowed")
2497
+ ).max(1e4)
2498
+ ])
2499
+ });
2500
+ var identifier = z9.string().regex(/^[a-z_][a-z0-9_]{0,62}$/u);
2501
+ var scopedTablesSchema = z9.record(
2502
+ identifier,
2503
+ z9.strictObject({
2504
+ scope: z9.record(dataScopeNameSchema, identifier).refine((scope) => Object.keys(scope).length === 1, "A scoped table names one dimension")
2505
+ })
2506
+ );
2507
+
2508
+ // src/feedback-values.ts
2509
+ var FEEDBACK_TEXT_MAX_LENGTH = 4e3;
2510
+ var FEEDBACK_SUMMARY_MAX_LENGTH = 1e3;
2511
+ var FEEDBACK_CATEGORY_MAX_LENGTH = 60;
2512
+ var FEEDBACK_NOTE_MAX_LENGTH = 2e3;
2513
+ var FEEDBACK_SUBJECT_KINDS = ["message", "app", "workflow_run"];
2514
+ var FEEDBACK_ASSET_KINDS = ["agent", "app", "workflow"];
2515
+ var FEEDBACK_STATES = ["new", "handled"];
2516
+
2517
+ // src/platform-report-values.ts
2518
+ var PLATFORM_REPORT_NOTE_MAX_LENGTH = 2e3;
2519
+
2520
+ // src/callable-operations.ts
2521
+ import { z as z10 } from "zod";
2522
+ var operationSourceSchema = z10.object({
2523
+ kind: z10.enum(OPERATION_SOURCE_KINDS),
2524
+ title: z10.string().optional(),
2525
+ /** The Connection's `service`, for its icon. */
2526
+ service: z10.string().optional()
2527
+ });
2528
+ var jsonSchemaObject = z10.record(z10.string(), z10.unknown());
2529
+ var callableOperationSchema = z10.object({
2530
+ /** What a step writes under `operation`. */
2531
+ name: z10.string(),
2532
+ effect: z10.enum(OPERATION_EFFECTS),
2533
+ title: z10.string(),
2534
+ /** The operation's own description, where its source gives one. */
2535
+ description: z10.string().optional(),
2536
+ source: operationSourceSchema,
2537
+ /** False where a call cannot reach its source now, such as a Connection that is off. */
2538
+ available: z10.boolean(),
2539
+ inputSchema: jsonSchemaObject.optional(),
2540
+ outputSchema: jsonSchemaObject.optional()
2541
+ });
2542
+ var callableOperationsPageSchema = z10.object({
2543
+ operations: z10.array(callableOperationSchema),
2544
+ /** Passed back as `cursor`, with the same filters, until it is absent. */
2545
+ nextCursor: z10.string().optional(),
2546
+ /** A source left operations out: a missing name proves no absence. */
2547
+ truncated: z10.boolean()
2548
+ });
2549
+
2550
+ // src/preview-capture.ts
2551
+ var PREVIEW_CAPTURE_TOOL_NAME = "preview.capture";
2552
+ var PREVIEW_CAPTURE_MAX_WIDTH = 1280;
2553
+ var PREVIEW_CAPTURE_MAX_HEIGHT = 1600;
2554
+ var PREVIEW_CAPTURE_MAX_BYTES = 4e5;
2555
+ var PREVIEW_CAPTURES_PER_RUN = 3;
2556
+ var PREVIEW_CAPTURES_PER_HOUR = 20;
2557
+ var PREVIEW_CAPTURE_WAIT_MS = 1e4;
2558
+ var PREVIEW_CAPTURE_REFUSALS = [
2559
+ "capture_limit",
2560
+ "capture_unavailable",
2561
+ "preview_not_viewed",
2562
+ "preview_personal_data"
2563
+ ];
2564
+ var ascii = (bytes, at, length) => String.fromCharCode(...bytes.subarray(at, at + length));
2565
+ var uint16 = (bytes, at) => (bytes[at] ?? 0) | (bytes[at + 1] ?? 0) << 8;
2566
+ var uint24 = (bytes, at) => uint16(bytes, at) | (bytes[at + 2] ?? 0) << 16;
2567
+ var uint32 = (bytes, at) => uint24(bytes, at) + (bytes[at + 3] ?? 0) * 2 ** 24;
2568
+ function readWebpSize(bytes) {
2569
+ if (bytes.byteLength < 30 || ascii(bytes, 0, 4) !== "RIFF" || ascii(bytes, 8, 4) !== "WEBP") {
2570
+ return void 0;
2571
+ }
2572
+ if (uint32(bytes, 4) + 8 !== bytes.byteLength) return void 0;
2573
+ const chunk = ascii(bytes, 12, 4);
2574
+ if (chunk === "VP8X") {
2575
+ if (((bytes[20] ?? 0) & 2) !== 0) return void 0;
2576
+ return { width: 1 + uint24(bytes, 24), height: 1 + uint24(bytes, 27) };
2577
+ }
2578
+ if (chunk === "VP8 ") {
2579
+ if (bytes[23] !== 157 || bytes[24] !== 1 || bytes[25] !== 42) return void 0;
2580
+ return { width: uint16(bytes, 26) & 16383, height: uint16(bytes, 28) & 16383 };
2581
+ }
2582
+ if (chunk === "VP8L") {
2583
+ if (bytes[20] !== 47) return void 0;
2584
+ const bits = uint32(bytes, 21);
2585
+ return { width: (bits & 16383) + 1, height: (Math.floor(bits / 2 ** 14) & 16383) + 1 };
2586
+ }
2587
+ return void 0;
2588
+ }
2589
+ function isPreviewCaptureWithinBounds(bytes) {
2590
+ if (bytes.byteLength > PREVIEW_CAPTURE_MAX_BYTES) return void 0;
2591
+ const size = readWebpSize(bytes);
2592
+ return size && size.width >= 1 && size.height >= 1 && size.width <= PREVIEW_CAPTURE_MAX_WIDTH && size.height <= PREVIEW_CAPTURE_MAX_HEIGHT ? size : void 0;
2593
+ }
2594
+
2595
+ // src/preview-report.ts
2596
+ import { z as z11 } from "zod";
2597
+ var PREVIEW_REPORT_MAX_ENTRIES = 10;
2598
+ var PREVIEW_REPORT_MAX_MESSAGE_CHARS = 200;
2599
+ var PREVIEW_REPORT_MAX_BYTES = 2048;
2600
+ var PREVIEW_REPORT_KEEP_MS = 24 * 60 * 60 * 1e3;
2601
+ var PREVIEW_REPORT_ENTRY_KINDS = [
2602
+ "error",
2603
+ "rejection",
2604
+ "console",
2605
+ "policy",
2606
+ "call"
2607
+ ];
2608
+ var PREVIEW_REPORT_BRIDGE_STATES = [
2609
+ "connected",
2610
+ "waiting",
2611
+ "not_connected",
2612
+ "not_used"
2613
+ ];
2614
+ var FILE_MAX_CHARS = 200;
2615
+ var CODE_PATTERN = /^[a-z0-9_.-]{1,64}$/u;
2616
+ var previewReportEntrySchema = z11.strictObject({
2617
+ kind: z11.enum(PREVIEW_REPORT_ENTRY_KINDS),
2618
+ /** The scrubbed message; for a failed call, the action's name. */
2619
+ message: z11.string().max(PREVIEW_REPORT_MAX_MESSAGE_CHARS),
2620
+ /** A failed call's refusal code. */
2621
+ code: z11.string().regex(CODE_PATTERN).optional(),
2622
+ /** The page's file the entry came from, relative to the page. */
2623
+ file: z11.string().min(1).max(FILE_MAX_CHARS).optional(),
2624
+ line: z11.number().int().min(0).max(1e7).optional(),
2625
+ /** One-based column; the server resolves bundle coordinates to authored source. */
2626
+ column: z11.number().int().min(0).max(1e7).optional(),
2627
+ count: z11.number().int().min(1).max(1e9)
2628
+ });
2629
+ var previewReportSchema = z11.strictObject({
2630
+ /** The page settled: after load, 1.5 seconds without a new entry, at most 8 seconds. */
2631
+ settled: z11.boolean(),
2632
+ /** The frame's document loaded. */
2633
+ loaded: z11.boolean(),
2634
+ bridge: z11.enum(PREVIEW_REPORT_BRIDGE_STATES),
2635
+ /** Whether the page drew nothing once it settled. Unknown before. */
2636
+ empty: z11.boolean().optional(),
2637
+ entries: z11.array(previewReportEntrySchema).max(PREVIEW_REPORT_MAX_ENTRIES),
2638
+ /** Entries that were not listed: past the limit or past the size. */
2639
+ more: z11.number().int().min(0).max(1e9)
2640
+ });
2641
+ var ELLIPSIS = "\u2026";
2642
+ var QUOTED = /"[^"\n]{25,}"|'[^'\n]{25,}'|`[^`\n]{25,}`|„[^“”\n]{25,}[“”]|“[^”\n]{25,}”|‘[^’\n]{25,}’|«[^»\n]{25,}»|»[^«\n]{25,}«/gu;
2643
+ var CONTENT_ADDRESS_IN_TEXT = /(?:\b[a-z][a-z0-9+.-]*:\/\/[^\s/"'`<>]*)?\/app-content\/[^/\s"'`<>]+\/[^/\s"'`<>]+\//giu;
2644
+ var ADDRESS_QUERY = /((?:\b[a-z][a-z0-9+.-]*:\/\/|\/)[^\s?#"'`<>]*)[?#][^\s"'`<>]*/giu;
2645
+ var MAIL = /[^\s@"'`<>()[\]{},;:]+(?:@|%40)[^\s@"'`<>()[\]{},;:]*/giu;
2646
+ var IBAN = /\b[a-z]{2}\d{2}(?:[a-z0-9]{11,30}|(?: [a-z0-9]{4}){2,7}(?: [a-z0-9]{1,4})?)\b/giu;
2647
+ var DIGIT_RUN = /\d(?:[ .,'/:-]?\d){3,}/gu;
2648
+ var CONTROL = new RegExp("[\\u0000-\\u001f\\u007f-\\u009f\\u2028\\u2029]+", "gu");
2649
+ function scrubPreviewText(text2) {
2650
+ const scrubbed = text2.replace(CONTROL, " ").replace(
2651
+ QUOTED,
2652
+ (quoted) => `${quoted.charAt(0)}${ELLIPSIS}${quoted.charAt(quoted.length - 1)}`
2653
+ ).replace(CONTENT_ADDRESS_IN_TEXT, "/").replace(ADDRESS_QUERY, `$1?${ELLIPSIS}`).replace(MAIL, ELLIPSIS).replace(IBAN, ELLIPSIS).replace(DIGIT_RUN, ELLIPSIS).replace(/\s+/gu, " ").trim();
2654
+ const characters = Array.from(scrubbed);
2655
+ return characters.length <= PREVIEW_REPORT_MAX_MESSAGE_CHARS ? scrubbed : `${characters.slice(0, PREVIEW_REPORT_MAX_MESSAGE_CHARS - 1).join("")}${ELLIPSIS}`;
2656
+ }
2657
+ var CONTENT_ADDRESS = /^.*\/app-content\/[^/]+\/[^/]+\//iu;
2658
+ var ORIGIN = /^[a-z][a-z0-9+.-]*:\/\/[^/]*/iu;
2659
+ var FILE_PATTERN = /^[\w./@~+-]+$/u;
2660
+ var BUILD_HASH = /-[A-Za-z0-9]{8}(?=\.[a-z]+$)/u;
2661
+ var LONG_DIGITS = /\d{5,}/u;
2662
+ function scrubPreviewFile(file) {
2663
+ if (file === void 0 || file.length === 0) return void 0;
2664
+ if (/^about:srcdoc/iu.test(file)) return "inline";
2665
+ const path = file.replace(/[?#].*$/su, "").replace(CONTENT_ADDRESS, "").replace(ORIGIN, "").replace(/^\/+(?=app-runtime\/)/u, "/");
2666
+ if (path.length === 0 || path.length > FILE_MAX_CHARS || !FILE_PATTERN.test(path)) {
2667
+ return void 0;
2668
+ }
2669
+ const unhashed = path.replace(BUILD_HASH, "");
2670
+ return LONG_DIGITS.test(unhashed) || unhashed.replace(MAIL, "").replace(IBAN, "") !== unhashed ? void 0 : path;
2671
+ }
2672
+ function scrubCode(code) {
2673
+ if (code === void 0) return void 0;
2674
+ const lower = code.toLowerCase();
2675
+ return CODE_PATTERN.test(lower) ? lower : "failed";
2676
+ }
2677
+ function byteLength(value) {
2678
+ return new TextEncoder().encode(JSON.stringify(value)).byteLength;
2679
+ }
2680
+ function wholeCount(value, fallback) {
2681
+ return value !== void 0 && Number.isFinite(value) ? Math.min(1e9, Math.max(0, Math.floor(value))) : fallback;
2682
+ }
2683
+ function boundPreviewReport(input) {
2684
+ const merged = [];
2685
+ const index = /* @__PURE__ */ new Map();
2686
+ let more = wholeCount(input.more, 0);
2687
+ for (const raw of input.entries) {
2688
+ const count3 = Math.max(1, wholeCount(raw.count, 1));
2689
+ const file = scrubPreviewFile(raw.file);
2690
+ const code = raw.kind === "call" ? scrubCode(raw.code ?? "failed") : void 0;
2691
+ const line = file !== void 0 && raw.line !== void 0 && Number.isInteger(raw.line) ? Math.min(1e7, Math.max(0, raw.line)) : void 0;
2692
+ const column = line !== void 0 && raw.column !== void 0 && Number.isInteger(raw.column) ? Math.min(1e7, Math.max(0, raw.column)) : void 0;
2693
+ const entry = {
2694
+ kind: raw.kind,
2695
+ message: scrubPreviewText(raw.message),
2696
+ ...code === void 0 ? {} : { code },
2697
+ ...file === void 0 ? {} : { file },
2698
+ ...line === void 0 ? {} : { line },
2699
+ ...column === void 0 ? {} : { column },
2700
+ count: count3
2701
+ };
2702
+ const key2 = JSON.stringify([
2703
+ entry.kind,
2704
+ entry.message,
2705
+ entry.code,
2706
+ entry.file,
2707
+ entry.line,
2708
+ entry.column
2709
+ ]);
2710
+ const at = index.get(key2);
2711
+ if (at !== void 0) {
2712
+ const kept = merged[at];
2713
+ if (kept) kept.count = Math.min(1e9, kept.count + count3);
2714
+ continue;
2715
+ }
2716
+ if (merged.length >= PREVIEW_REPORT_MAX_ENTRIES) {
2717
+ more += count3;
2718
+ continue;
2719
+ }
2720
+ index.set(key2, merged.length);
2721
+ merged.push(entry);
2722
+ }
2723
+ const report = {
2724
+ settled: input.settled,
2725
+ loaded: input.loaded,
2726
+ bridge: input.bridge,
2727
+ ...input.empty === void 0 ? {} : { empty: input.empty },
2728
+ entries: merged,
2729
+ more: Math.min(1e9, more)
2730
+ };
2731
+ while (byteLength(report) > PREVIEW_REPORT_MAX_BYTES && report.entries.length > 0) {
2732
+ const dropped = report.entries.pop();
2733
+ report.more = Math.min(1e9, report.more + (dropped?.count ?? 0));
2734
+ }
2735
+ return report;
2736
+ }
2737
+
2738
+ // src/data-store-description.ts
2739
+ import { z as z12 } from "zod";
2740
+ var DATA_STORE_DESCRIPTION_TOOL_NAME = "platform.data_stores.describe";
2741
+ var dataStoreDescriptionInputSchema = z12.strictObject({ store: z12.string().min(1) });
2742
+ var useSchema = z12.object({ kind: z12.string(), name: z12.string(), title: z12.string() });
2743
+ var dataStoreDescriptionSchema = z12.object({
2744
+ name: z12.string(),
2745
+ title: z12.string(),
2746
+ description: z12.string().optional(),
2747
+ owner: z12.union([
2748
+ z12.object({ kind: z12.literal("instance") }),
2749
+ z12.object({ kind: z12.literal("workspace"), workspaceId: z12.string() })
2750
+ ]),
2751
+ published: z12.boolean(),
2752
+ tables: z12.array(
2753
+ z12.object({
2754
+ name: z12.string(),
2755
+ description: z12.string().optional(),
2756
+ rowEstimate: z12.number().nullable(),
2757
+ fields: z12.array(
2758
+ z12.object({
2759
+ name: z12.string(),
2760
+ type: z12.string(),
2761
+ description: z12.string(),
2762
+ nullable: z12.boolean()
2763
+ })
2764
+ )
2765
+ })
2766
+ ),
2767
+ schemaAvailable: z12.boolean(),
2768
+ filledBy: z12.array(useSchema),
2769
+ readBy: z12.array(useSchema),
2770
+ usesTruncated: z12.boolean(),
2771
+ rights: z12.object({ read: z12.boolean(), add: z12.boolean(), change: z12.boolean() }),
2772
+ chat: z12.object({ canReadRows: z12.boolean(), reason: z12.string(), nextStep: z12.string().optional() })
2773
+ });
2774
+
2775
+ // src/server-preview-capture.ts
2776
+ import { z as z13 } from "zod";
2777
+ var serverPreviewCaptureInputSchema = z13.strictObject({
2778
+ themeColors: z13.strictObject({
2779
+ surfaceColor: z13.string().min(1).max(128),
2780
+ backgroundColor: z13.string().min(1).max(128),
2781
+ textColor: z13.string().min(1).max(128),
2782
+ mutedTextColor: z13.string().min(1).max(128),
2783
+ borderColor: z13.string().min(1).max(128),
2784
+ accentColor: z13.string().min(1).max(128),
2785
+ accentStrongColor: z13.string().min(1).max(128)
2786
+ }),
2787
+ contentPath: z13.string().max(1024).regex(/^\/app-content\/fset_[A-Za-z0-9_-]+\/[A-Za-z0-9_.-]+\/$/),
2788
+ session: z13.string().regex(/^capture:pcap_[A-Za-z0-9_-]+$/),
2789
+ deadline: z13.number().int().positive(),
2790
+ size: z13.enum(PREVIEW_CAPTURE_SIZES),
2791
+ theme: z13.enum(THEME_MODES),
2792
+ locale: z13.enum(localeCodes),
2793
+ number: z13.number().int().positive()
2794
+ });
2795
+ var serverPreviewCaptureOutcomeSchema = z13.discriminatedUnion("status", [
2796
+ z13.strictObject({
2797
+ status: z13.literal("done"),
2798
+ image: z13.string().max(54e4),
2799
+ report: z13.unknown(),
2800
+ blocked: z13.array(
2801
+ z13.strictObject({
2802
+ method: z13.string().max(16),
2803
+ host: z13.string().max(160),
2804
+ path: z13.string().max(240)
2805
+ })
2806
+ ).max(50),
2807
+ calls: z13.array(z13.strictObject({ name: z13.string().max(160), code: z13.string().max(80) })).max(20)
2808
+ }),
2809
+ z13.strictObject({
2810
+ status: z13.literal("refused"),
2811
+ code: z13.enum(SERVER_PREVIEW_CAPTURE_REFUSALS),
2812
+ message: z13.string().max(160).optional()
2813
+ })
2814
+ ]);
2815
+
2816
+ // src/html-pdf.ts
2817
+ import { z as z14 } from "zod";
2818
+ var HTML_PDF_MAX_HTML_BYTES = 4 * 1024 * 1024;
2819
+ var HTML_PDF_MAX_PDF_BYTES = 10 * 1024 * 1024;
2820
+ var HTML_PDF_MAX_PAGES = 50;
2821
+ var HTML_PDF_RENDER_MS = 2e4;
2822
+ var HTML_PDF_RENDERS_PER_MINUTE_PER_SESSION = 10;
2823
+ var HTML_PDF_OPTIONS_HEADER = "x-pdf-options";
2824
+ var HTML_PDF_PAGES_HEADER = "x-pdf-pages";
2825
+ var HTML_PDF_PAGE_FORMATS = ["A3", "A4", "A5", "Letter", "Legal"];
2826
+ var HTML_PDF_REFUSALS = [
2827
+ "pdf_unavailable",
2828
+ "pdf_too_large",
2829
+ "pdf_too_many_pages",
2830
+ "pdf_busy",
2831
+ "pdf_failed"
2832
+ ];
2833
+ var margin = z14.string().max(16).regex(/^(?:0|\d{1,3}(?:\.\d{1,2})?(?:mm|cm|in|px))$/u, "a length such as '12mm', '1in' or '0'");
2834
+ var htmlPdfOptionsSchema = z14.strictObject({
2835
+ format: z14.enum(HTML_PDF_PAGE_FORMATS).optional(),
2836
+ landscape: z14.boolean().optional(),
2837
+ margin: z14.strictObject({
2838
+ top: margin.optional(),
2839
+ right: margin.optional(),
2840
+ bottom: margin.optional(),
2841
+ left: margin.optional()
2842
+ }).optional()
1252
2843
  });
1253
2844
  export {
1254
2845
  ACCESS_SOURCES,
@@ -1257,26 +2848,37 @@ export {
1257
2848
  ADMINISTERED_USER_STATUSES,
1258
2849
  AGENT_AVAILABILITY_MODES,
1259
2850
  AGENT_EDITABLE_FIELDS,
2851
+ AGENT_PREVIEW_SOURCES,
1260
2852
  AGENT_RUN_FAILURE_CATEGORIES,
1261
2853
  AGENT_RUN_STATUSES,
1262
2854
  AGENT_STARTERS_MAX,
2855
+ AGENT_USE_SETTINGS,
2856
+ ALWAYS_ALLOW_LOCK_SOURCES,
1263
2857
  API_CREDENTIAL_SCOPES,
1264
2858
  APPROVAL_CHECK_FAILURE_OUTCOMES,
1265
2859
  APPROVAL_CHECK_STATUSES,
1266
2860
  APPROVAL_EXECUTIONS,
1267
2861
  APPROVAL_REQUEST_STATUSES,
1268
2862
  APP_ACTION_CALL_STATUSES,
2863
+ APP_AUDIENCES,
1269
2864
  APP_ERROR_CODES,
1270
2865
  APP_ERROR_STATUS_CODES,
1271
2866
  APP_MODES,
1272
2867
  ARTIFACT_PREVIEW_IMAGE_FORMATS,
1273
2868
  ARTIFACT_PREVIEW_IMAGE_MIME_TYPES,
1274
2869
  ARTIFACT_PREVIEW_STATUSES,
2870
+ ASSET_ACCESS_VERBS,
1275
2871
  ASSET_LIFECYCLES,
2872
+ ASSET_MOVE_EDITORS,
2873
+ ASSET_MOVE_PATHS,
2874
+ ASSET_MOVE_STATUSES,
2875
+ ASSET_MOVE_USERS,
1276
2876
  ASSET_NAME_REFUSAL_REASONS,
1277
2877
  ASSET_OWNER_KINDS,
2878
+ ASSET_OWNER_RUNGS,
1278
2879
  ASSET_REPO_BUNDLE_KINDS,
1279
2880
  ASSET_REPRESENTATIONS,
2881
+ ASSET_RIGHT_VERBS,
1280
2882
  ASSET_SYNC_CHANGE_TYPES,
1281
2883
  ATTACHMENT_CREATE_OUTCOMES,
1282
2884
  AUDIT_ACTOR_KINDS,
@@ -1285,12 +2887,17 @@ export {
1285
2887
  AUDIT_TIERS,
1286
2888
  AUTH_PRINCIPAL_KINDS,
1287
2889
  AUTH_SCOPE_WILDCARD,
2890
+ AWS_ACCOUNT_ID,
2891
+ BEDROCK_REGION,
2892
+ CATALOGUE_CATEGORIES,
2893
+ CATALOGUE_PARTS,
1288
2894
  CHAT_MESSAGE_ROLES,
1289
2895
  CHAT_SESSION_AUTH_SCOPES,
1290
2896
  COLLABORATION_WORKSPACE_KINDS,
1291
2897
  CONFIG_ASSET_CHANGE_OPERATIONS,
1292
2898
  CONFIG_ASSET_KINDS,
1293
2899
  CONNECTION_BINDING_STATES,
2900
+ CONNECTION_CREDENTIAL_MODES,
1294
2901
  CONNECTION_EXPOSURES,
1295
2902
  CONNECTION_HEALTH_STATES,
1296
2903
  CONNECTION_NAME_MAX_LENGTH,
@@ -1300,14 +2907,23 @@ export {
1300
2907
  CONNECTION_OPERATION_POLICIES,
1301
2908
  CONNECTION_OPERATION_STATUSES,
1302
2909
  CONNECTION_ORIGINS,
2910
+ CONNECTION_OWN_TOKEN_SCHEMES,
2911
+ CONNECTION_OWN_TOKEN_STATES,
2912
+ CONNECTION_PROPOSAL_BINDING_STATES,
2913
+ CONNECTION_PROPOSAL_STATES,
1303
2914
  CONNECTION_PROVIDER_REVOCATIONS,
1304
2915
  CONNECTION_SECRET_STATES,
2916
+ CONNECTION_SIGN_IN_NEEDS,
2917
+ CONNECTION_TEST_CREDENTIAL_STATES,
2918
+ CONNECTOR_FORM_FIELD_VALUES,
1305
2919
  CONNECTOR_TEST_STATUSES,
1306
2920
  CONVERSATION_ATTACHMENT_STATUSES,
1307
2921
  CONVERSATION_KINDS,
2922
+ CONVERSATION_TITLE_MAX_CHARS,
1308
2923
  CONVERSATION_VISIBILITIES,
1309
2924
  DATABASE_RELATION_TYPES,
1310
2925
  DATA_STORE_CONDITIONS,
2926
+ DATA_STORE_DESCRIPTION_TOOL_NAME,
1311
2927
  DATA_STORE_INSERT_CONFLICT_MODES,
1312
2928
  DATA_STORE_LOAD_CONFLICT_MODES,
1313
2929
  DATA_STORE_MIGRATION_OUTCOMES,
@@ -1315,19 +2931,38 @@ export {
1315
2931
  DATA_STORE_STATUSES,
1316
2932
  DECIDED_APPROVAL_REQUEST_STATUSES,
1317
2933
  DELETION_STATES,
2934
+ DRAFT_TEST_TARGETS,
1318
2935
  ENDED_AGENT_RUN_STATUSES,
1319
2936
  ENDED_APPROVAL_EXECUTIONS,
1320
2937
  FAILED_JOB_STATUSES,
2938
+ FEEDBACK_ASSET_KINDS,
2939
+ FEEDBACK_CATEGORY_MAX_LENGTH,
2940
+ FEEDBACK_NOTE_MAX_LENGTH,
2941
+ FEEDBACK_STATES,
2942
+ FEEDBACK_SUBJECT_KINDS,
2943
+ FEEDBACK_SUMMARY_MAX_LENGTH,
2944
+ FEEDBACK_TEXT_MAX_LENGTH,
1321
2945
  FIRST_PARTY_AUTH_SCOPES,
1322
2946
  FOLLOW_UP_MODES,
1323
2947
  FOLLOW_UP_STATUSES,
1324
2948
  GRANT_EFFECTS,
1325
2949
  GRANT_HOLDER_KINDS,
2950
+ GRANT_REQUEST_STALE_REASONS,
1326
2951
  GRANT_SCOPE_KINDS,
2952
+ GUARDRAIL_CHECK_KINDS,
1327
2953
  GUARDRAIL_HIT_OUTCOMES,
1328
2954
  GUARDRAIL_NAME_MAX_LENGTH,
1329
2955
  GUARDRAIL_NAME_PATTERN,
1330
2956
  GUARDRAIL_OUTCOMES,
2957
+ HTML_PDF_MAX_HTML_BYTES,
2958
+ HTML_PDF_MAX_PAGES,
2959
+ HTML_PDF_MAX_PDF_BYTES,
2960
+ HTML_PDF_OPTIONS_HEADER,
2961
+ HTML_PDF_PAGES_HEADER,
2962
+ HTML_PDF_PAGE_FORMATS,
2963
+ HTML_PDF_REFUSALS,
2964
+ HTML_PDF_RENDERS_PER_MINUTE_PER_SESSION,
2965
+ HTML_PDF_RENDER_MS,
1331
2966
  IDEMPOTENCY_KEY_MAX_LENGTH,
1332
2967
  INFRASTRUCTURE_SECRET_STATES,
1333
2968
  INFRASTRUCTURE_WITHHELD_FIELDS,
@@ -1336,7 +2971,14 @@ export {
1336
2971
  KNOWLEDGE_CHECK_STATUSES,
1337
2972
  KNOWLEDGE_DOCUMENT_FAILURE_CODES,
1338
2973
  KNOWLEDGE_DOCUMENT_STATES,
2974
+ KNOWLEDGE_DOCUMENT_TEXT_MAX_BYTES,
1339
2975
  KNOWLEDGE_DOCUMENT_WAIT_CODES,
2976
+ KNOWLEDGE_EMBEDDING_STATES,
2977
+ KNOWLEDGE_FILE_MAX_BYTES,
2978
+ KNOWLEDGE_FILE_MAX_BYTES_CEILING,
2979
+ KNOWLEDGE_ORIGIN_LINK_CHANGES,
2980
+ KNOWLEDGE_ORIGIN_LINK_MAX_CHARS,
2981
+ KNOWLEDGE_PENDING_MAX_LIMIT,
1340
2982
  KNOWLEDGE_SEARCH_SIGNALS,
1341
2983
  KNOWLEDGE_SOURCE_FAILURE_CODES,
1342
2984
  KNOWLEDGE_SOURCE_ITEM_FAILURE_CODES,
@@ -1347,18 +2989,44 @@ export {
1347
2989
  KNOWLEDGE_SYNC_RUN_STATES,
1348
2990
  LISTED_DATA_STORE_STATUSES,
1349
2991
  LIVE_JOB_STATUSES,
2992
+ MAIL_ADDRESS_MAX_LENGTH,
2993
+ MAIL_ATTACHMENTS_MAX_BYTES,
2994
+ MAIL_ATTACHMENTS_MAX_FILES,
2995
+ MAIL_AUDIT_MAX_DOMAINS,
2996
+ MAIL_BODY_MAX_BYTES,
2997
+ MAIL_OUTBOUND_DEFAULT_LIMITS,
2998
+ MAIL_OUTBOUND_FOOTER_MAX_LENGTH,
2999
+ MAIL_RECIPIENT_DOMAINS_ANY,
3000
+ MAIL_RECIPIENT_DOMAIN_PATTERN,
3001
+ MAIL_RECIPIENT_ID_PATTERN,
3002
+ MAIL_SENDER_CONNECTION_PREFIX,
3003
+ MAIL_SENDER_NAME_MAX_LENGTH,
3004
+ MAIL_SENDER_RESOURCE_KIND,
3005
+ MAIL_SENDER_SYSTEM,
3006
+ MAIL_SENDER_SYSTEM_ICON,
3007
+ MAIL_SENDER_USE_ACTION,
3008
+ MAIL_SEND_ERROR_CODES,
3009
+ MAIL_SEND_MAX_ADDRESSES,
3010
+ MAIL_SEND_OPERATION,
3011
+ MAIL_SEND_REFUSAL_REASONS,
3012
+ MAIL_SUBJECT_MAX_LENGTH,
3013
+ MAIL_WORKFLOW_MESSAGE_TEMPLATE,
1350
3014
  MANAGED_FILE_STATUSES,
3015
+ MEMBER_BUNDLE_CHANGES,
3016
+ MEMBER_BUNDLE_STATES,
1351
3017
  MESSAGE_FINISH_STATUSES,
3018
+ MODEL_FALLBACK_REASONS,
1352
3019
  MODEL_PROVIDER_AUTH_MODES,
1353
3020
  MODEL_USAGE_EVENT_STATUSES,
3021
+ MODEL_USAGE_LIMIT_METRICS,
3022
+ MODEL_USAGE_LIMIT_PERIODS,
3023
+ MODEL_USAGE_LIMIT_SCOPES,
1354
3024
  MODEL_USAGE_SOURCES,
1355
3025
  MODEL_USAGE_TIERS,
1356
- NAMESPACE_PREFIX_MAX_LENGTH,
1357
- NAMESPACE_PREFIX_MIN_LENGTH,
1358
- NAMESPACE_PREFIX_PATTERN,
1359
3026
  NOTIFY_CHANNELS,
1360
3027
  OPENAI_COMPATIBLE_APIS,
1361
3028
  OPERATIONS_AUDIENCES,
3029
+ OPERATION_CHANGE_CLASSES,
1362
3030
  OPERATION_CONFIRMATION_DECISIONS,
1363
3031
  OPERATION_DENIAL_REASONS,
1364
3032
  OPERATION_EFFECTS,
@@ -1366,14 +3034,64 @@ export {
1366
3034
  OPERATION_RUN_DECISION_MODES,
1367
3035
  OPERATION_RUN_DECISION_REASONS,
1368
3036
  OPERATION_RUN_STATUSES,
3037
+ OPERATION_SOURCE_KINDS,
1369
3038
  OPERATION_TARGETS,
3039
+ OWN_SERVER_SIGN_INS,
3040
+ PERSONAL_AGENTS_KEY,
3041
+ PERSONAL_WORKSPACES_KEY,
3042
+ PERSON_POLICY_SETTINGS,
3043
+ PLATFORM_REPORT_NOTE_MAX_LENGTH,
1370
3044
  POLICY_VALUES,
3045
+ PREVIEW_CAPTURES_PER_HOUR,
3046
+ PREVIEW_CAPTURES_PER_RUN,
3047
+ PREVIEW_CAPTURE_MAX_BYTES,
3048
+ PREVIEW_CAPTURE_MAX_HEIGHT,
3049
+ PREVIEW_CAPTURE_MAX_WIDTH,
3050
+ PREVIEW_CAPTURE_REFUSALS,
3051
+ PREVIEW_CAPTURE_SIZES,
3052
+ PREVIEW_CAPTURE_STATUSES,
3053
+ PREVIEW_CAPTURE_TOOL_NAME,
3054
+ PREVIEW_CAPTURE_WAIT_MS,
3055
+ PREVIEW_REPORT_BRIDGE_STATES,
3056
+ PREVIEW_REPORT_ENTRY_KINDS,
3057
+ PREVIEW_REPORT_KEEP_MS,
3058
+ PREVIEW_REPORT_MAX_BYTES,
3059
+ PREVIEW_REPORT_MAX_ENTRIES,
3060
+ PREVIEW_REPORT_MAX_MESSAGE_CHARS,
1371
3061
  PRINCIPAL_HOLDER_KINDS,
3062
+ PROJECT_ACTIONS,
3063
+ PROJECT_ASSET_KIND,
3064
+ PROJECT_AUDIENCES,
3065
+ PROJECT_CHOICE_REFUSALS,
3066
+ PROJECT_DELETION_CONVERSATIONS,
3067
+ PROJECT_DESCRIPTION_MAX_LENGTH,
3068
+ PROJECT_FILE_CHANGES,
3069
+ PROJECT_FILE_ORIGINS,
3070
+ PROJECT_FOLDER_WRITE_CHANGES,
3071
+ PROJECT_KNOWLEDGE_BASES_MAX,
3072
+ PROJECT_NAME_MAX_LENGTH,
3073
+ PROJECT_NAME_PATTERN,
3074
+ PROJECT_SKILLS_MAX,
3075
+ PROJECT_TITLE_MAX_LENGTH,
1372
3076
  PROVIDER_CHECK_ERROR_CLASSES,
1373
3077
  PROVIDER_PORTS,
1374
3078
  PROVIDER_REGIONS,
3079
+ PUBLISHED_DATA_CONSUMER_KINDS,
3080
+ PUBLISH_CHANGE_KINDS,
1375
3081
  READING_POLICY_VALUES,
1376
3082
  REASONING_EFFORTS,
3083
+ RECORDS_FLAGGED_MAX_ITEMS_PER_PAGE,
3084
+ RECORDS_PROPOSE_MAX_FIELDS_PER_ITEM,
3085
+ RECORDS_PROPOSE_MAX_ITEMS_PER_CALL,
3086
+ RECORD_FIELD_FAILURE_CODES,
3087
+ RECORD_FIELD_STATES,
3088
+ RECORD_FLAG_REASONS,
3089
+ ROLE_GRANT_SCOPE_KINDS,
3090
+ ROLE_PENDING_CHANGES,
3091
+ ROLE_PENDING_DECISIONS,
3092
+ SCHEDULED_START_STATES,
3093
+ SECRET_NAME_EXPECTATION,
3094
+ SERVER_PREVIEW_CAPTURE_REFUSALS,
1377
3095
  SERVICE_PRINCIPAL_PERMISSIONS,
1378
3096
  SERVICE_PRINCIPAL_STATUSES,
1379
3097
  SKILL_CHANGE_TYPES,
@@ -1390,6 +3108,7 @@ export {
1390
3108
  SKILL_STARTER_LINE_MAX_LENGTH,
1391
3109
  SKILL_SUMMARY_MAX_LENGTH,
1392
3110
  STRUCTURED_DATA_REVIEW_REASONS,
3111
+ STUDIO_KIND_PATHS,
1393
3112
  SUPPORTED_IMAGE_MIME_TYPES,
1394
3113
  SkillMarkdownError,
1395
3114
  THEME_MODES,
@@ -1400,35 +3119,102 @@ export {
1400
3119
  TOOL_DISPLAY_MODES,
1401
3120
  TOOL_GROUPS,
1402
3121
  TOOL_INPUT_PARSE_ERROR_CODES,
3122
+ USAGE_BREAKDOWN_DIMENSIONS,
1403
3123
  USAGE_COST_STATUSES,
3124
+ USAGE_ORIGINS,
3125
+ USAGE_SPEND_LIMIT_LEVELS,
1404
3126
  USER_STATUSES,
1405
3127
  WAITING_OPERATION_RUN_STATUSES,
1406
3128
  WEB_SOURCE_PROVIDERS,
3129
+ WORKFLOW_CAPABILITY_UNITS,
3130
+ WORKFLOW_CODE_STEP_AVAILABILITY,
3131
+ WORKFLOW_DATASET_DOWNLOAD_FORMATS,
3132
+ WORKFLOW_DATASET_STATES,
1407
3133
  WORKFLOW_ENDED_STATUSES,
3134
+ WORKFLOW_EXECUTED_STEP_TYPES,
3135
+ WORKFLOW_KINDS,
3136
+ WORKFLOW_MARKDOWN_MAX_COLUMNS,
3137
+ WORKFLOW_MARKDOWN_MAX_ROWS,
1408
3138
  WORKFLOW_NAME_PATTERN,
1409
3139
  WORKFLOW_NAME_RULE,
3140
+ WORKFLOW_PACKAGE_MANIFEST_STATES,
1410
3141
  WORKFLOW_RESERVED_STEP_TYPES,
3142
+ WORKFLOW_RIGHTS_REVISIONS,
3143
+ WORKFLOW_RIGHT_NEEDED_FOR,
3144
+ WORKFLOW_RIGHT_REFUSALS,
3145
+ WORKFLOW_RUN_ACCOUNT_STATUSES,
1411
3146
  WORKFLOW_RUN_MODES,
1412
3147
  WORKFLOW_RUN_STATUSES,
1413
3148
  WORKFLOW_STEP_RUN_STATUSES,
3149
+ WORKFLOW_STEP_SOURCE_KINDS,
1414
3150
  WORKFLOW_STEP_TYPES,
3151
+ WORKFLOW_TEST_REVISIONS,
3152
+ WORKFLOW_TEXT_FORMAT_MARKDOWN,
3153
+ WORKFLOW_TEXT_MAX_PARTS,
1415
3154
  WORKFLOW_TRIGGER_KINDS,
3155
+ WORKFLOW_WEBHOOK_HEADERS,
3156
+ WORKFLOW_WEBHOOK_LIMITS,
1416
3157
  WORKSPACE_ACCENT_COLORS,
1417
3158
  WORKSPACE_ACCESS_STATES,
3159
+ WORKSPACE_BUNDLES,
1418
3160
  WORKSPACE_COMMAND_STATUSES,
1419
3161
  WORKSPACE_FILE_KINDS,
1420
3162
  WORKSPACE_MEMBERSHIP_ROLES,
3163
+ WORKSPACE_OWNED_RIGHT_KINDS,
1421
3164
  WORKSPACE_SECTIONS,
3165
+ WORKSPACE_USE_ASSET_KINDS,
1422
3166
  WORKSPACE_VISIBILITIES,
1423
3167
  YAML_DATA_MAX_VALUES,
1424
3168
  YamlDataError,
1425
3169
  agentConfigSchema,
3170
+ appInterfacePath,
3171
+ assetPagePath,
3172
+ bedrockProfileRefusal,
3173
+ boundPreviewReport,
3174
+ callableOperationSchema,
3175
+ callableOperationsPageSchema,
1426
3176
  checkStorableTexts,
3177
+ conversationInterfacePath,
3178
+ dataScopeNameSchema,
3179
+ dataScopesSchema,
3180
+ dataStoreDescriptionInputSchema,
3181
+ dataStoreDescriptionSchema,
3182
+ dataStoreRecordFieldSchema,
3183
+ dataStoreRecordProposalItemSchema,
3184
+ dataStoreRecordsContracts,
3185
+ dataStoreRecordsDecideInputSchema,
3186
+ dataStoreRecordsDecideOutputSchema,
3187
+ dataStoreRecordsFlaggedInputSchema,
3188
+ dataStoreRecordsFlaggedOutputSchema,
3189
+ dataStoreRecordsProposeInputSchema,
3190
+ dataStoreRecordsRuleSchema,
1427
3191
  deriveSkillTitle,
1428
3192
  formatSkillMarkdown,
3193
+ htmlPdfOptionsSchema,
3194
+ inboxItemPath,
3195
+ isPlainConfigObject,
3196
+ isPreviewCaptureWithinBounds,
3197
+ isRecord,
3198
+ isSecretName,
1429
3199
  isStorableText,
3200
+ knowledgeExtractFieldsInputSchema,
3201
+ knowledgeExtractFieldsOutputSchema,
3202
+ knowledgeFieldValueSchema,
3203
+ knowledgeFirstPassConfirmationSchema,
3204
+ knowledgeIngestFetchSchema,
3205
+ knowledgeIngestInputSchema,
3206
+ knowledgeIngestItemSchema,
3207
+ knowledgeIngestOutputSchema,
1430
3208
  knowledgeLocateInputSchema,
1431
3209
  knowledgeLocateOutputSchema,
3210
+ knowledgeOriginLinkSchema,
3211
+ knowledgePendingInputSchema,
3212
+ knowledgePendingOutputSchema,
3213
+ knowledgePendingPageRowSchema,
3214
+ knowledgePendingRowSchema,
3215
+ knowledgeProcessorOutputSchema,
3216
+ knowledgePutProcessedInputSchema,
3217
+ knowledgeRecordsRefusalSchema,
1432
3218
  knowledgeRetryInputSchema,
1433
3219
  knowledgeRetryOutputSchema,
1434
3220
  knowledgeSourceItemsInputSchema,
@@ -1436,11 +3222,50 @@ export {
1436
3222
  knowledgeSourcesOutputSchema,
1437
3223
  knowledgeSyncInputSchema,
1438
3224
  knowledgeSyncResultSchema,
3225
+ knowledgeWithdrawInputSchema,
3226
+ knowledgeWithdrawOutputSchema,
3227
+ knowledgeWorkflowSourceSchema,
3228
+ knowledgeWorkflowSourcesOutputSchema,
3229
+ knowledgeWriteContracts,
1439
3230
  loadYamlData,
1440
3231
  localeCodes,
1441
3232
  localizedStringSchema,
3233
+ mailAddressSchema,
3234
+ mailBodySchema,
3235
+ mailCopyRecipientListSchema,
3236
+ mailPreviewRecipientSchema,
3237
+ mailRecipientDomainSchema,
3238
+ mailRecipientListSchema,
3239
+ mailRecipientSchema,
3240
+ mailReplyToSchema,
3241
+ mailSendContract,
3242
+ mailSendInputSchema,
3243
+ mailSendOutputSchema,
3244
+ mailSendPreviewSchema,
3245
+ mailSendRefusalDetailsSchema,
3246
+ mailSendSimulatedOutputSchema,
3247
+ mailSenderIdSchema,
3248
+ mailSenderNameSchema,
3249
+ mailSubjectSchema,
3250
+ mergeConfigObjects,
3251
+ operationBatchFailureSchema,
3252
+ operationBatchResultSchema,
3253
+ operationPagingSchema,
3254
+ operationSourceSchema,
1442
3255
  parseSkillMarkdown,
3256
+ previewReportEntrySchema,
3257
+ previewReportSchema,
3258
+ providerRegionSchema,
3259
+ readWebpSize,
1443
3260
  readYamlData,
3261
+ recordColumnTakes,
3262
+ recordEvidenceResultSchema,
3263
+ scopeAssignmentInputSchema,
3264
+ scopedTablesSchema,
3265
+ scrubPreviewFile,
3266
+ scrubPreviewText,
3267
+ serverPreviewCaptureInputSchema,
3268
+ serverPreviewCaptureOutcomeSchema,
1444
3269
  skillConfigSchema,
1445
3270
  skillFileEntrySchema,
1446
3271
  skillFileFrontmatterSchema,
@@ -1451,6 +3276,12 @@ export {
1451
3276
  skillResourcePathSchema,
1452
3277
  skillStarterSchema,
1453
3278
  workflowConfigSchema,
3279
+ workflowDataFlowsSchema,
3280
+ workflowDatasetReferenceSchema,
3281
+ workflowFileReferenceSchema,
3282
+ workflowMailSenderFactSchema,
3283
+ workflowMessageMailParamsSchema,
3284
+ writeYamlData,
1454
3285
  yamlValueIssue,
1455
3286
  yamlValueIssueSentence
1456
3287
  };