@work-shape/catalyst-api-contract 0.8.0-rc.7 → 0.8.0-rc.8

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.
package/dist/index.js CHANGED
@@ -10,7 +10,8 @@ import {
10
10
  IDEMPOTENCY_KEY_MAX_LENGTH,
11
11
  POLICY_VALUES,
12
12
  THEME_MODES,
13
- WORKFLOW_RUN_STATUSES
13
+ WORKFLOW_RUN_STATUSES,
14
+ WORKFLOW_TEST_REVISIONS
14
15
  } from "@work-shape/catalyst-asset-schemas";
15
16
  import { z } from "zod";
16
17
  var APP_BRIDGE_MARK = "catalystBridge";
@@ -126,7 +127,23 @@ var appWorkflowRunSchema = z.strictObject({
126
127
  /** Why the run did not end `done`: a code and a sentence of the product. */
127
128
  error: z.strictObject({ code: z.string(), message: z.string() }).optional(),
128
129
  startedAt: z.string().optional(),
129
- finishedAt: z.string().optional()
130
+ finishedAt: z.string().optional(),
131
+ /**
132
+ * `test` on a run a click in an App's draft started (DP-1): it ran in mode test, as the
133
+ * viewer bounded by the Workflow's principal, and nothing of it is live. Missing on a run of
134
+ * a published App.
135
+ */
136
+ mode: z.literal("test").optional(),
137
+ /**
138
+ * On a test run: the revision of the Workflow that ran, the draft or the published one, with
139
+ * its number where that revision is still the draft or the published one.
140
+ */
141
+ workflowRevision: z.strictObject({
142
+ kind: z.enum(WORKFLOW_TEST_REVISIONS),
143
+ number: z.number().int().positive().optional()
144
+ }).optional(),
145
+ /** On a test run: the steps whose calls were simulated, by step id. Their results are not real. */
146
+ simulatedSteps: z.array(z.string()).optional()
130
147
  });
131
148
  var callFailure = z.strictObject({
132
149
  /** `action_unknown`, `draft_safe_mode`, `forbidden`, `input_invalid` and so on. */
@@ -806,7 +823,7 @@ import { z as z46 } from "zod";
806
823
  // package.json
807
824
  var package_default = {
808
825
  name: "@work-shape/catalyst-api-contract",
809
- version: "0.8.0-rc.7",
826
+ version: "0.8.0-rc.8",
810
827
  license: "MIT",
811
828
  repository: {
812
829
  type: "git",
@@ -1045,7 +1062,7 @@ var scheduledStartOperations = {
1045
1062
  };
1046
1063
 
1047
1064
  // src/operations/access.ts
1048
- import { dataScopesSchema, scopeAssignmentInputSchema } from "@work-shape/catalyst-asset-schemas";
1065
+ import { dataScopesSchema as dataScopesSchema2, scopeAssignmentInputSchema as scopeAssignmentInputSchema2 } from "@work-shape/catalyst-asset-schemas";
1049
1066
  import { z as z11 } from "zod";
1050
1067
 
1051
1068
  // src/access.ts
@@ -1058,7 +1075,9 @@ import {
1058
1075
  PRINCIPAL_HOLDER_KINDS as PRINCIPAL_HOLDER_KINDS2,
1059
1076
  ROLE_GRANT_SCOPE_KINDS,
1060
1077
  ROLE_PENDING_CHANGES,
1061
- ROLE_PENDING_DECISIONS
1078
+ ROLE_PENDING_DECISIONS,
1079
+ dataScopesSchema,
1080
+ scopeAssignmentInputSchema
1062
1081
  } from "@work-shape/catalyst-asset-schemas";
1063
1082
  import { z as z10 } from "zod";
1064
1083
  var grantHolderKindSchema = z10.enum(GRANT_HOLDER_KINDS);
@@ -1251,6 +1270,19 @@ var updateWorkspaceBuildLimitsRequestSchema = z10.object({
1251
1270
  allowedToolNames: buildLimitListSchema.optional(),
1252
1271
  allowedModelBindingIds: buildLimitListSchema.optional()
1253
1272
  });
1273
+ var dataScopeValuesSchema = z10.union([z10.literal("all"), z10.array(z10.string())]);
1274
+ var scopeAssignmentsOverviewSchema = z10.object({
1275
+ dimensions: dataScopesSchema,
1276
+ assignments: z10.array(scopeAssignmentInputSchema),
1277
+ people: z10.array(
1278
+ z10.object({
1279
+ id: z10.string(),
1280
+ displayLabel: z10.string(),
1281
+ groups: z10.array(z10.string()),
1282
+ effective: z10.record(z10.string(), dataScopeValuesSchema)
1283
+ })
1284
+ )
1285
+ });
1254
1286
 
1255
1287
  // src/operations/access.ts
1256
1288
  var accessOperations = {
@@ -1264,17 +1296,31 @@ var accessOperations = {
1264
1296
  scope: "user_admin:read",
1265
1297
  requires: ["users.manage"],
1266
1298
  effect: "reading",
1267
- query: scopeAssignmentInputSchema.pick({ holderKind: true, holderId: true }),
1299
+ query: scopeAssignmentInputSchema2.pick({ holderKind: true, holderId: true }),
1268
1300
  response: json(
1269
1301
  z11.object({
1270
- dimensions: dataScopesSchema,
1271
- assignments: z11.array(scopeAssignmentInputSchema),
1302
+ dimensions: dataScopesSchema2,
1303
+ assignments: z11.array(scopeAssignmentInputSchema2),
1272
1304
  effective: z11.record(z11.string(), z11.union([z11.literal("all"), z11.array(z11.string())])).optional()
1273
1305
  })
1274
1306
  ),
1275
1307
  errors: ["NOT_FOUND"],
1276
1308
  rateClass: "read"
1277
1309
  }),
1310
+ "scope_assignments.overview": defineOperation({
1311
+ id: "scope_assignments.overview",
1312
+ method: "GET",
1313
+ path: "/api/v1/instance/access/scope-assignments/overview",
1314
+ summary: "Read the declared data scope, every assignment the reader may see, and each active person's groups and effective values",
1315
+ tag: "Access",
1316
+ auth: "user",
1317
+ scope: "user_admin:read",
1318
+ requires: ["users.manage"],
1319
+ effect: "reading",
1320
+ response: json(scopeAssignmentsOverviewSchema),
1321
+ errors: [],
1322
+ rateClass: "read"
1323
+ }),
1278
1324
  "scope_assignments.set": defineRegisteredOperation({
1279
1325
  id: "scope_assignments.set",
1280
1326
  method: "PUT",
@@ -1285,8 +1331,8 @@ var accessOperations = {
1285
1331
  scope: "user_admin:write",
1286
1332
  requires: ["users.manage"],
1287
1333
  effect: "changing",
1288
- body: scopeAssignmentInputSchema,
1289
- response: json(scopeAssignmentInputSchema),
1334
+ body: scopeAssignmentInputSchema2,
1335
+ response: json(scopeAssignmentInputSchema2),
1290
1336
  errors: ["NOT_FOUND"],
1291
1337
  rateClass: "write"
1292
1338
  }),
@@ -2170,12 +2216,14 @@ import { z as z17 } from "zod";
2170
2216
 
2171
2217
  // src/assets.ts
2172
2218
  import {
2219
+ AGENT_USE_SETTINGS,
2173
2220
  APP_AUDIENCES as APP_AUDIENCES2,
2174
2221
  OPERATION_EFFECTS as OPERATION_EFFECTS3,
2175
2222
  WORKSPACE_USE_ASSET_KINDS,
2176
2223
  ASSET_ACCESS_VERBS,
2177
2224
  ASSET_NAME_REFUSAL_REASONS,
2178
- ASSET_SYNC_CHANGE_TYPES
2225
+ ASSET_SYNC_CHANGE_TYPES,
2226
+ operationSourceSchema
2179
2227
  } from "@work-shape/catalyst-asset-schemas";
2180
2228
  import { z as z15 } from "zod";
2181
2229
  var ASSET_SYNC_MAX_ITEMS = 200;
@@ -2191,6 +2239,7 @@ var assetScopeSchema = z15.discriminatedUnion("kind", [
2191
2239
  z15.object({ kind: z15.literal("workspace"), workspaceId: z15.string() })
2192
2240
  ]);
2193
2241
  var revisionNumberSchema = z15.number().int().positive();
2242
+ var APP_PUBLISH_WORKFLOWS_MAX = 20;
2194
2243
  var expectedRevisionSchema = revisionNumberSchema.optional();
2195
2244
  var expectedRevisionOrNewSchema = revisionNumberSchema.nullable().optional();
2196
2245
  var NUL = "\0";
@@ -2204,6 +2253,7 @@ var assetDefinitionSchema = configAssetConfigSchema.refine(
2204
2253
  );
2205
2254
  var workspaceIdSchema = nameText(z15.string().min(1)).optional();
2206
2255
  var isDefaultSchema = z15.literal(true).optional();
2256
+ var agentUseSchema = z15.enum(AGENT_USE_SETTINGS);
2207
2257
  var dependencyAvailabilitySchema = z15.object({
2208
2258
  /** The workspaces reviewed by the publisher; a later change must be read again. */
2209
2259
  availability: agentAvailabilitySchema.nullable().optional(),
@@ -2278,11 +2328,7 @@ var publishNarrativeSchema = z15.object({
2278
2328
  warnings: z15.array(z15.string())
2279
2329
  });
2280
2330
  var saveApprovalSchema = z15.object({ approverNames: z15.array(z15.string()) });
2281
- var workflowFactSourceSchema = z15.object({
2282
- kind: z15.enum(["connection", "data_store", "knowledge_base", "workflow", "other"]),
2283
- title: z15.string().optional(),
2284
- service: z15.string().optional()
2285
- });
2331
+ var workflowFactSourceSchema = operationSourceSchema;
2286
2332
  var workflowOperationFactSchema = z15.object({
2287
2333
  source: workflowFactSourceSchema,
2288
2334
  title: z15.string().optional(),
@@ -2352,6 +2398,8 @@ var assetSchema = z15.object({
2352
2398
  availability: agentAvailabilitySchema.optional(),
2353
2399
  dependencyAvailability: dependencyAvailabilitySchema.optional(),
2354
2400
  canSetAvailability: z15.boolean().optional(),
2401
+ /** Only on agent reads: who uses the agent where it is available (AGENT-USE-1). */
2402
+ agentUse: agentUseSchema.optional(),
2355
2403
  /** Only on agent reads. The stored config stays intact; these references cannot run. */
2356
2404
  unavailableTools: z15.array(unavailableToolSchema).optional(),
2357
2405
  unavailableSkills: z15.array(unavailableSkillSchema).optional(),
@@ -2463,7 +2511,14 @@ var publishAssetRequestSchema = z15.object({
2463
2511
  * never means "whatever the draft is now". Naming an earlier number is the way back.
2464
2512
  */
2465
2513
  revision: revisionNumberSchema,
2466
- workspaceId: workspaceIdSchema
2514
+ workspaceId: workspaceIdSchema,
2515
+ /**
2516
+ * Of an App only: the Workflow drafts this publish makes live with it (DP-3), each with the
2517
+ * revision the person reviewed, as `apps.publish_review` lists the pending ones. Each must be
2518
+ * a Workflow the App's revision reaches, directly or as a child. They are published children
2519
+ * first and then the App, in one transaction: a refusal of any publishes none of them.
2520
+ */
2521
+ workflows: z15.array(z15.object({ name: z15.string().min(1), revision: revisionNumberSchema }).strict()).max(APP_PUBLISH_WORKFLOWS_MAX).optional()
2467
2522
  });
2468
2523
  var discardAssetDraftRequestSchema = z15.object({
2469
2524
  /** The draft revision the caller last read. Required. */
@@ -2474,7 +2529,16 @@ var assetPointersResponseSchema = z15.object({
2474
2529
  draftRevision: revisionNumberSchema,
2475
2530
  publishedRevision: revisionNumberSchema,
2476
2531
  /** The revision that was published before a publish, left out on the first one. */
2477
- replacedRevision: revisionNumberSchema.optional()
2532
+ replacedRevision: revisionNumberSchema.optional(),
2533
+ /** The Workflows a publish of an App made live with it, in the order they were published. */
2534
+ publishedWith: z15.array(
2535
+ z15.object({
2536
+ kind: z15.literal("workflow"),
2537
+ name: z15.string(),
2538
+ publishedRevision: revisionNumberSchema,
2539
+ replacedRevision: revisionNumberSchema.optional()
2540
+ })
2541
+ ).optional()
2478
2542
  });
2479
2543
  var LIVE_ONCE_PART_MAX_LENGTH = 200;
2480
2544
  var runLiveOnceRequestSchema = z15.object({
@@ -3498,6 +3562,12 @@ var discardAgentDraftRequestSchema = z17.object({
3498
3562
  workspaceId: z17.string().optional()
3499
3563
  });
3500
3564
  var discardAgentDraftResponseSchema = z17.object({ discarded: z17.literal(true) });
3565
+ var setAgentUseRequestSchema = z17.object({
3566
+ use: agentUseSchema,
3567
+ /** The id of the agent as the caller read it. Another agent of the name is a conflict. */
3568
+ expectedAssetId: z17.string().min(1).optional()
3569
+ });
3570
+ var setAgentUseResponseSchema = z17.object({ use: agentUseSchema });
3501
3571
  var agentTryConversationResponseSchema = z17.object({
3502
3572
  conversation: conversationSchema,
3503
3573
  /** A Try conversation is a preview: its head says so. */
@@ -3536,6 +3606,23 @@ var agentOperations = {
3536
3606
  errors: ["NOT_FOUND", "REVISION_CONFLICT"],
3537
3607
  rateClass: "write"
3538
3608
  }),
3609
+ // Who uses the agent where it is available (AGENT-USE-1). The right is decided as for its
3610
+ // availability: the agent's write right on the whole instance.
3611
+ "agents.use.set": defineRegisteredOperation({
3612
+ id: "agents.use.set",
3613
+ method: "PUT",
3614
+ path: "/api/v1/agents/:name/use",
3615
+ summary: "Set who uses one agent where it is available: everyone, or holders of agent.use",
3616
+ tag: "Agents",
3617
+ auth: "user",
3618
+ scope: "config_assets:write",
3619
+ requires: [],
3620
+ effect: "changing",
3621
+ body: setAgentUseRequestSchema,
3622
+ response: json(setAgentUseResponseSchema),
3623
+ errors: ["NOT_FOUND", "CONFLICT"],
3624
+ rateClass: "write"
3625
+ }),
3539
3626
  "agents.try.open": defineRegisteredOperation({
3540
3627
  id: "agents.try.open",
3541
3628
  method: "POST",
@@ -3637,7 +3724,9 @@ var apiAccessOperations = {
3637
3724
  import {
3638
3725
  APP_ACTION_CALL_STATUSES as APP_ACTION_CALL_STATUSES2,
3639
3726
  APP_MODES,
3640
- OPERATION_EFFECTS as OPERATION_EFFECTS4
3727
+ OPERATION_EFFECTS as OPERATION_EFFECTS4,
3728
+ WORKFLOW_RUN_STATUSES as WORKFLOW_RUN_STATUSES2,
3729
+ WORKFLOW_TEST_REVISIONS as WORKFLOW_TEST_REVISIONS2
3641
3730
  } from "@work-shape/catalyst-asset-schemas";
3642
3731
  import { z as z19 } from "zod";
3643
3732
 
@@ -3858,6 +3947,63 @@ var appActionCallResultSchema = z19.union([
3858
3947
  result: z19.unknown()
3859
3948
  })
3860
3949
  ]);
3950
+ var appTryActionRequestSchema = z19.object({ input: z19.record(z19.string(), z19.unknown()).default({}) }).strict();
3951
+ var appTryActionResultSchema = z19.object({
3952
+ operationRunId: z19.string().optional(),
3953
+ status: z19.enum([...APP_ACTION_CALL_STATUSES2, "dry_run"]),
3954
+ target: operationTargetSchema.optional(),
3955
+ result: z19.unknown().optional(),
3956
+ /** What a simulated call would have done. */
3957
+ message: z19.string().optional(),
3958
+ workflowRun: z19.object({
3959
+ runId: z19.string(),
3960
+ workflow: z19.string(),
3961
+ status: z19.enum(WORKFLOW_RUN_STATUSES2),
3962
+ revision: z19.object({
3963
+ kind: z19.enum(WORKFLOW_TEST_REVISIONS2),
3964
+ number: z19.number().int().positive().optional()
3965
+ })
3966
+ }).optional()
3967
+ });
3968
+ var appPublishRefusalSchema = z19.object({
3969
+ /** `no_grant`, `workflow_not_published`, `workflow_unavailable` and the like. */
3970
+ reason: z19.string(),
3971
+ message: z19.string(),
3972
+ /** The right the caller lacks, where a right is missing. */
3973
+ right: z19.string().optional()
3974
+ });
3975
+ var appPublishReviewItemSchema = z19.object({
3976
+ name: z19.string(),
3977
+ title: z19.string(),
3978
+ draftRevision: z19.number().int().positive(),
3979
+ publishedRevision: z19.number().int().positive().optional(),
3980
+ /** The draft holds changes its published revision does not, or nothing is published yet. */
3981
+ pending: z19.boolean(),
3982
+ /** The sentence the person's publish question leads with, for the draft revision. */
3983
+ narrative: publishNarrativeSchema.optional(),
3984
+ /** Who wrote the draft revision, as people read their name. */
3985
+ lastChangedBy: z19.string().optional(),
3986
+ refusals: z19.array(appPublishRefusalSchema)
3987
+ });
3988
+ var appPublishReviewSchema = z19.object({
3989
+ app: appPublishReviewItemSchema,
3990
+ workflows: z19.array(
3991
+ appPublishReviewItemSchema.extend({
3992
+ /** The actions of the App's draft that call it. None for a child of another Workflow. */
3993
+ actions: z19.array(z19.string()),
3994
+ /** The newest test run of the Workflow among its recent runs, by anyone. */
3995
+ lastTestRun: z19.object({ runId: z19.string(), status: z19.enum(WORKFLOW_RUN_STATUSES2), at: z19.string() }).optional()
3996
+ })
3997
+ ),
3998
+ /**
3999
+ * One Publish of the App also publishes the pending Workflow drafts it reaches, when the
4000
+ * publish names them in `workflows` (DP-3). Where false, each pending Workflow is published
4001
+ * before the App, by its own publish.
4002
+ */
4003
+ publishesTogether: z19.boolean(),
4004
+ /** Nothing in the review would be refused. */
4005
+ ready: z19.boolean()
4006
+ });
3861
4007
  var appActionsListQuerySchema = listQuerySchema.extend({
3862
4008
  /**
3863
4009
  * The id of one App. Named, the answer holds that App alone: its draft for whoever writes
@@ -3893,8 +4039,9 @@ var listedAppAction = {
3893
4039
  /**
3894
4040
  * In the draft (ADR-0031): where the caller's next call of the action goes. `live` for a
3895
4041
  * reading action, and for a changing one the caller switched "Run live once" on for;
3896
- * `dry_run` for any other changing action, which is simulated. Missing for a published
3897
- * revision, every call of which is live.
4042
+ * `dry_run` for any other changing action, which is simulated; `test` for a `workflow` action,
4043
+ * which starts a test run of the Workflow (DP-1). Missing for a published revision, every
4044
+ * call of which is live.
3898
4045
  */
3899
4046
  target: operationTargetSchema.optional(),
3900
4047
  /** An agent that lists `toolName` carries the action as a tool now. */
@@ -4049,6 +4196,38 @@ var appOperations = {
4049
4196
  errors: ["NOT_FOUND"],
4050
4197
  rateClass: "read"
4051
4198
  }),
4199
+ // An agent tries an action of an App's draft as the person's click would (DP-2): the same
4200
+ // draft context and answer, without a frame. An agent tries only the conversation's subject
4201
+ // App or an App the conversation created.
4202
+ "apps.try_action": defineRegisteredOperation({
4203
+ id: "apps.try_action",
4204
+ method: "POST",
4205
+ path: "/api/v1/apps/:app/draft-actions/:action/tries",
4206
+ summary: "Try one action of an App's draft as its button does: reads read, changes are simulated, and a workflow action starts a test run",
4207
+ tag: "Apps",
4208
+ auth: "user",
4209
+ scope: "config_assets:write",
4210
+ requires: [],
4211
+ effect: "changing",
4212
+ body: appTryActionRequestSchema,
4213
+ response: json(appTryActionResultSchema),
4214
+ errors: ["NOT_FOUND", "FORBIDDEN", "CONFLICT", "TIMEOUT", "VALIDATION_FAILED"],
4215
+ rateClass: "write"
4216
+ }),
4217
+ "apps.publish_review": defineRegisteredOperation({
4218
+ id: "apps.publish_review",
4219
+ method: "GET",
4220
+ path: "/api/v1/apps/:app/publish-review",
4221
+ summary: "Read what publishing an App's draft comes to: the App and the Workflows it calls, their pending drafts, publish questions and what would refuse them",
4222
+ tag: "Apps",
4223
+ auth: "user",
4224
+ scope: "config_assets:read",
4225
+ requires: [],
4226
+ effect: "reading",
4227
+ response: json(appPublishReviewSchema),
4228
+ errors: ["NOT_FOUND", "FORBIDDEN"],
4229
+ rateClass: "read"
4230
+ }),
4052
4231
  // POST because it carries the token of the frame's address, which never stands in a path.
4053
4232
  "apps.sessions.context": defineOperation({
4054
4233
  id: "apps.sessions.context",
@@ -5036,6 +5215,8 @@ var configAssetOperations = {
5036
5215
 
5037
5216
  // src/operations/connections.ts
5038
5217
  import {
5218
+ CATALOGUE_CATEGORIES,
5219
+ CATALOGUE_PARTS,
5039
5220
  PUBLISHED_DATA_CONSUMER_KINDS,
5040
5221
  CONNECTION_BINDING_STATES,
5041
5222
  GRANT_HOLDER_KINDS as GRANT_HOLDER_KINDS2,
@@ -5221,11 +5402,67 @@ var connectorTypeOffersSchema = z24.object({
5221
5402
  })
5222
5403
  )
5223
5404
  })
5224
- )
5405
+ ),
5406
+ /**
5407
+ * The catalogue's entries (CAT-1): one card each in "Dienste". `offered` is false for one
5408
+ * the operator has not named, which is shown greyed and cannot be installed. A part lists the
5409
+ * operations it proposes; none of them is enabled before the admin confirms the review step.
5410
+ */
5411
+ entries: z24.array(
5412
+ z24.object({
5413
+ id: z24.string(),
5414
+ version: z24.number().int(),
5415
+ service: z24.string(),
5416
+ title: localizedTextSchema,
5417
+ description: localizedTextSchema,
5418
+ category: z24.enum(CATALOGUE_CATEGORIES),
5419
+ examplePrompts: z24.array(localizedTextSchema),
5420
+ mark: z24.object({ color: z24.string().optional(), logo: z24.string().optional() }),
5421
+ offered: z24.boolean(),
5422
+ parts: z24.array(
5423
+ z24.object({
5424
+ part: z24.enum(CATALOGUE_PARTS),
5425
+ connectorType: z24.string(),
5426
+ name: z24.string(),
5427
+ title: localizedTextSchema.optional(),
5428
+ description: localizedTextSchema,
5429
+ authScheme: z24.string(),
5430
+ settings: z24.record(z24.string(), z24.unknown()),
5431
+ fields: z24.array(
5432
+ z24.object({
5433
+ label: localizedTextSchema,
5434
+ help: localizedTextSchema.optional(),
5435
+ optional: z24.boolean(),
5436
+ setting: z24.string().optional(),
5437
+ secret: z24.boolean(),
5438
+ default: z24.string().optional()
5439
+ })
5440
+ ),
5441
+ prerequisites: z24.array(
5442
+ z24.object({ text: localizedTextSchema, value: z24.string().optional() })
5443
+ ),
5444
+ hosts: z24.array(z24.string()),
5445
+ operations: z24.array(
5446
+ z24.object({
5447
+ name: z24.string(),
5448
+ title: z24.string().optional(),
5449
+ description: z24.string().optional(),
5450
+ effect: z24.enum(OPERATION_EFFECTS5),
5451
+ recommended: z24.boolean(),
5452
+ declaration: z24.record(z24.string(), z24.unknown()).optional()
5453
+ })
5454
+ ),
5455
+ sharedAccountNote: localizedTextSchema,
5456
+ documentSource: z24.boolean()
5457
+ })
5458
+ )
5459
+ })
5460
+ ).default([])
5225
5461
  });
5226
5462
  var connectionSecretWriteSchema = z24.object({
5227
5463
  value: z24.string().min(1).max(SECRET_VALUE_MAX_CHARS),
5228
- expectedVersion: z24.number().int().positive().nullable()
5464
+ expectedVersion: z24.number().int().positive().nullable(),
5465
+ expectedRevision: z24.number().int().positive()
5229
5466
  });
5230
5467
  var connectionDiscoveryRequestSchema = z24.object({ status: z24.literal("queued") });
5231
5468
  var personContextSubjectSchema = z24.object({
@@ -6596,7 +6833,10 @@ var auditActivityTargetSchema = z30.object({
6596
6833
  var auditActivitySchema = z30.object({
6597
6834
  correlationId: z30.string(),
6598
6835
  at: timestampSchema,
6599
- label: z30.string(),
6836
+ /** The type of the event that titles the activity; the interface words it. */
6837
+ type: z30.string(),
6838
+ /** What a tool says it did, such as `workspace.exec`, where a tool's event titles it. */
6839
+ action: z30.string().optional(),
6600
6840
  tier: z30.enum(AUDIT_TIERS),
6601
6841
  outcome: z30.enum(AUDIT_OUTCOMES),
6602
6842
  actor: auditActivityActorSchema,
@@ -7609,6 +7849,7 @@ var knowledgeOperations = {
7609
7849
 
7610
7850
  // src/operations/operations.ts
7611
7851
  import {
7852
+ callableOperationsPageSchema,
7612
7853
  OPERATION_CONFIRMATION_DECISIONS,
7613
7854
  OPERATION_EFFECTS as OPERATION_EFFECTS6,
7614
7855
  OPERATION_ORIGIN_KINDS
@@ -7675,6 +7916,31 @@ var operationRunOperations = {
7675
7916
  errors: [],
7676
7917
  rateClass: "read"
7677
7918
  }),
7919
+ "operations.list_callable": defineRegisteredOperation({
7920
+ id: "operations.list_callable",
7921
+ method: "GET",
7922
+ path: "/api/v1/operations/callable",
7923
+ summary: "List a page of the operations a step of a Workflow may call, as far as the caller may call them",
7924
+ tag: "Operations",
7925
+ auth: "principal",
7926
+ scope: "config_assets:read",
7927
+ // No right of its own: each operation is listed exactly where its own check of a call
7928
+ // from a Workflow step lets the caller call it. The listing grants nothing.
7929
+ requires: [],
7930
+ effect: "reading",
7931
+ query: z38.object({
7932
+ /** Who calls: a step of a Workflow. An App's listing is the agent's alone. */
7933
+ for: z38.enum(["workflow"]).default("workflow"),
7934
+ cursor: z38.string().min(1).optional(),
7935
+ /** An exact full operation name. */
7936
+ name: z38.string().min(1).optional(),
7937
+ /** Only operation names starting with this, such as `connection.crm.`. */
7938
+ prefix: z38.string().min(1).optional()
7939
+ }),
7940
+ response: json(callableOperationsPageSchema),
7941
+ errors: [],
7942
+ rateClass: "read"
7943
+ }),
7678
7944
  "operations.decide": defineRegisteredOperation({
7679
7945
  id: "operations.decide",
7680
7946
  method: "POST",
@@ -8589,8 +8855,9 @@ import {
8589
8855
  WORKFLOW_RESERVED_STEP_TYPES,
8590
8856
  WORKFLOW_DATASET_STATES,
8591
8857
  WORKFLOW_RUN_MODES,
8592
- WORKFLOW_RUN_STATUSES as WORKFLOW_RUN_STATUSES2,
8858
+ WORKFLOW_RUN_STATUSES as WORKFLOW_RUN_STATUSES3,
8593
8859
  WORKFLOW_STEP_RUN_STATUSES,
8860
+ WORKFLOW_TEST_REVISIONS as WORKFLOW_TEST_REVISIONS3,
8594
8861
  WORKFLOW_STEP_TYPES,
8595
8862
  WORKFLOW_DATASET_DOWNLOAD_FORMATS,
8596
8863
  WORKFLOW_TRIGGER_KINDS
@@ -8599,7 +8866,7 @@ import { z as z44 } from "zod";
8599
8866
  var WORKFLOW_RUN_OUTPUT_PREVIEW_MAX_CHARS = 2e3;
8600
8867
  var WORKFLOW_RUN_KEY_MAX_CHARS = 200;
8601
8868
  var runKeySchema = z44.string().min(1).max(WORKFLOW_RUN_KEY_MAX_CHARS);
8602
- var runStatusSchema = z44.enum(WORKFLOW_RUN_STATUSES2);
8869
+ var runStatusSchema = z44.enum(WORKFLOW_RUN_STATUSES3);
8603
8870
  var stepRunStatusSchema = z44.enum(WORKFLOW_STEP_RUN_STATUSES);
8604
8871
  var stepTypeSchema = z44.enum([...WORKFLOW_STEP_TYPES, ...WORKFLOW_RESERVED_STEP_TYPES]);
8605
8872
  var countsSchema = z44.object({
@@ -8675,6 +8942,18 @@ var workflowRunSchema = z44.object({
8675
8942
  }).optional(),
8676
8943
  /** The Operation Run of the call that started the run. */
8677
8944
  operationRunId: z44.string().optional(),
8945
+ /**
8946
+ * The action of an App's draft whose click started this test run (DP-1): the App, the
8947
+ * revision of its draft and the action, by name, and whether the Workflow's draft or its
8948
+ * published revision ran. Missing on every other run.
8949
+ */
8950
+ startedFrom: z44.object({
8951
+ kind: z44.literal("app"),
8952
+ app: z44.string(),
8953
+ appRevisionId: z44.string(),
8954
+ action: z44.string(),
8955
+ workflowRevision: z44.enum(WORKFLOW_TEST_REVISIONS3)
8956
+ }).optional(),
8678
8957
  parentRunId: z44.string().optional(),
8679
8958
  parentStepRunId: z44.string().optional(),
8680
8959
  rootRunId: z44.string(),
@@ -8817,6 +9096,8 @@ var workflowSummarySchema = z44.object({
8817
9096
  description: z44.string().optional(),
8818
9097
  /** The published revision: what a run started now has as its `definitionRevisionId`. */
8819
9098
  definitionRevisionId: z44.string(),
9099
+ /** The workspace that owns the Workflow (WS-OWN-1b). Missing where the instance owns it. */
9100
+ workspaceId: z44.string().optional(),
8820
9101
  /** Whether a start by hand is accepted now, as far as that is known before its input. */
8821
9102
  runnable: z44.boolean(),
8822
9103
  /** Why not. Empty exactly where `runnable` is true. */
@@ -8826,6 +9107,11 @@ var workflowSummarySchema = z44.object({
8826
9107
  * from which a page builds its start form. Missing where the definition cannot be read.
8827
9108
  */
8828
9109
  inputs: z44.record(z44.string(), z44.unknown()).optional(),
9110
+ /**
9111
+ * How the published revision is started, the kinds of its trigger: `manual`, `schedule`,
9112
+ * `parent` (by a step of another Workflow). Missing where the definition cannot be read.
9113
+ */
9114
+ triggers: z44.array(z44.string()).optional(),
8829
9115
  /**
8830
9116
  * The display label of the service principal every run of the Workflow acts as. Missing
8831
9117
  * where that principal is disabled or gone, which `reasons` then says.
@@ -9163,6 +9449,7 @@ var schemas_exports = {};
9163
9449
  __export(schemas_exports, {
9164
9450
  API_ERROR_MEANINGS: () => API_ERROR_MEANINGS,
9165
9451
  APP_ASSET_KIND: () => APP_ASSET_KIND,
9452
+ APP_PUBLISH_WORKFLOWS_MAX: () => APP_PUBLISH_WORKFLOWS_MAX,
9166
9453
  ASSET_CHECK_VERBS: () => ASSET_CHECK_VERBS,
9167
9454
  ASSET_GET_FILES_MAX_BYTES: () => ASSET_GET_FILES_MAX_BYTES,
9168
9455
  ASSET_PUT_FILES_MAX_BYTES: () => ASSET_PUT_FILES_MAX_BYTES,
@@ -9207,6 +9494,7 @@ __export(schemas_exports, {
9207
9494
  agentRuntimeMessageMetadataSchema: () => agentRuntimeMessageMetadataSchema,
9208
9495
  agentToolReferenceSchema: () => agentToolReferenceSchema,
9209
9496
  agentTryConversationResponseSchema: () => agentTryConversationResponseSchema,
9497
+ agentUseSchema: () => agentUseSchema,
9210
9498
  allowDraftHostRequestSchema: () => allowDraftHostRequestSchema,
9211
9499
  allowDraftHostResponseSchema: () => allowDraftHostResponseSchema,
9212
9500
  annotateFeedbackRequestSchema: () => annotateFeedbackRequestSchema,
@@ -9228,11 +9516,15 @@ __export(schemas_exports, {
9228
9516
  appModeSchema: () => appModeSchema,
9229
9517
  appPreviewRequestSchema: () => appPreviewRequestSchema,
9230
9518
  appPreviewSchema: () => appPreviewSchema,
9519
+ appPublishRefusalSchema: () => appPublishRefusalSchema,
9520
+ appPublishReviewSchema: () => appPublishReviewSchema,
9231
9521
  appSessionContextRequestSchema: () => appSessionContextRequestSchema,
9232
9522
  appSessionContextSchema: () => appSessionContextSchema,
9233
9523
  appSqlActionUnavailableSchema: () => appSqlActionUnavailableSchema,
9234
9524
  appStorageWriteRequestSchema: () => appStorageWriteRequestSchema,
9235
9525
  appStorageWriteResponseSchema: () => appStorageWriteResponseSchema,
9526
+ appTryActionRequestSchema: () => appTryActionRequestSchema,
9527
+ appTryActionResultSchema: () => appTryActionResultSchema,
9236
9528
  appWorkflowActionUnavailableSchema: () => appWorkflowActionUnavailableSchema,
9237
9529
  approvalCheckResultSchema: () => approvalCheckResultSchema,
9238
9530
  approvalDecisionMessageMetadataSchema: () => approvalDecisionMessageMetadataSchema,
@@ -9445,6 +9737,7 @@ __export(schemas_exports, {
9445
9737
  runObservationSchema: () => runObservationSchema,
9446
9738
  safeConfigSchema: () => safeConfigSchema,
9447
9739
  saveApprovalSchema: () => saveApprovalSchema,
9740
+ scopeAssignmentsOverviewSchema: () => scopeAssignmentsOverviewSchema,
9448
9741
  sendAdministeredUserInvitationResponseSchema: () => sendAdministeredUserInvitationResponseSchema,
9449
9742
  sendFeedbackRequestSchema: () => sendFeedbackRequestSchema,
9450
9743
  servicePrincipalDetailSchema: () => servicePrincipalDetailSchema,
@@ -9452,6 +9745,8 @@ __export(schemas_exports, {
9452
9745
  servicePrincipalSchema: () => servicePrincipalSchema,
9453
9746
  servicePrincipalStatusSchema: () => servicePrincipalStatusSchema,
9454
9747
  sessionTokenDelegatedActorSchema: () => sessionTokenDelegatedActorSchema,
9748
+ setAgentUseRequestSchema: () => setAgentUseRequestSchema,
9749
+ setAgentUseResponseSchema: () => setAgentUseResponseSchema,
9455
9750
  setAssetAvailabilityRequestSchema: () => setAssetAvailabilityRequestSchema,
9456
9751
  setAssetDefaultRequestSchema: () => setAssetDefaultRequestSchema,
9457
9752
  setAssetDefaultResponseSchema: () => setAssetDefaultResponseSchema,
@@ -10202,6 +10497,7 @@ export {
10202
10497
  APP_BRIDGE_NAME_MAX_CHARS,
10203
10498
  APP_BRIDGE_REQUEST_ID_MAX_CHARS,
10204
10499
  APP_BRIDGE_VERSION,
10500
+ APP_PUBLISH_WORKFLOWS_MAX,
10205
10501
  ASSET_CHECK_VERBS,
10206
10502
  ASSET_GET_FILES_MAX_BYTES,
10207
10503
  ASSET_PUT_FILES_MAX_BYTES,
@@ -10260,6 +10556,7 @@ export {
10260
10556
  agentRuntimeMessageMetadataSchema,
10261
10557
  agentToolReferenceSchema,
10262
10558
  agentTryConversationResponseSchema,
10559
+ agentUseSchema,
10263
10560
  allowDraftHostRequestSchema,
10264
10561
  allowDraftHostResponseSchema,
10265
10562
  annotateFeedbackRequestSchema,
@@ -10288,12 +10585,16 @@ export {
10288
10585
  appModeSchema,
10289
10586
  appPreviewRequestSchema,
10290
10587
  appPreviewSchema,
10588
+ appPublishRefusalSchema,
10589
+ appPublishReviewSchema,
10291
10590
  appSessionContextRequestSchema,
10292
10591
  appSessionContextSchema,
10293
10592
  appSqlActionUnavailableSchema,
10294
10593
  appStorageMutationSchema,
10295
10594
  appStorageWriteRequestSchema,
10296
10595
  appStorageWriteResponseSchema,
10596
+ appTryActionRequestSchema,
10597
+ appTryActionResultSchema,
10297
10598
  appWorkflowActionUnavailableSchema,
10298
10599
  appWorkflowRunSchema,
10299
10600
  approvalCheckResultSchema,
@@ -10556,6 +10857,7 @@ export {
10556
10857
  scheduledStartFieldsSchema,
10557
10858
  scheduledStartRunSchema,
10558
10859
  scheduledStartSchema,
10860
+ scopeAssignmentsOverviewSchema,
10559
10861
  selectContractBaseline,
10560
10862
  sendAdministeredUserInvitationResponseSchema,
10561
10863
  sendFeedbackRequestSchema,
@@ -10564,6 +10866,8 @@ export {
10564
10866
  servicePrincipalSchema,
10565
10867
  servicePrincipalStatusSchema,
10566
10868
  sessionTokenDelegatedActorSchema,
10869
+ setAgentUseRequestSchema,
10870
+ setAgentUseResponseSchema,
10567
10871
  setAssetAvailabilityRequestSchema,
10568
10872
  setAssetDefaultRequestSchema,
10569
10873
  setAssetDefaultResponseSchema,