@opengeni/contracts 2.6.0-canary.0 → 2.9.2-canary.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/agent-authored-durable-text.d.ts +3 -0
  2. package/dist/agent-topology.d.ts +292 -0
  3. package/dist/atlassian.js +2 -1
  4. package/dist/chunk-4IVHBXRI.js +221 -0
  5. package/dist/chunk-4IVHBXRI.js.map +1 -0
  6. package/dist/{chunk-MJ3K6ICH.js → chunk-AWNGBY5I.js} +7153 -6946
  7. package/dist/chunk-AWNGBY5I.js.map +1 -0
  8. package/dist/company-profile.d.ts +275 -1
  9. package/dist/connection-authority.js +2 -1
  10. package/dist/connection-authority.js.map +1 -1
  11. package/dist/google-drive.js +2 -1
  12. package/dist/google-drive.js.map +1 -1
  13. package/dist/index.d.ts +273 -140
  14. package/dist/index.js +107 -5
  15. package/dist/managed-auth-session-sets.d.ts +19 -0
  16. package/dist/managed-auth-session-sets.js +12 -1
  17. package/dist/managed-auth-session-sets.js.map +1 -1
  18. package/dist/organization-membership-lifecycle.d.ts +3 -0
  19. package/dist/permissions.d.ts +1 -0
  20. package/dist/personal-github.js +2 -1
  21. package/dist/personal-github.js.map +1 -1
  22. package/dist/session-titles.d.ts +9 -0
  23. package/dist/session-titles.js +17 -0
  24. package/dist/session-titles.js.map +1 -0
  25. package/dist/session-topology-primitives.d.ts +22 -0
  26. package/dist/work-claims.d.ts +411 -0
  27. package/package.json +5 -1
  28. package/src/agent-authored-durable-text.ts +13 -6
  29. package/src/agent-topology.ts +69 -0
  30. package/src/company-profile.ts +46 -1
  31. package/src/index.ts +385 -249
  32. package/src/managed-auth-session-sets.ts +18 -0
  33. package/src/permissions.ts +1 -0
  34. package/src/session-titles.ts +12 -5
  35. package/src/session-topology-primitives.ts +21 -0
  36. package/src/work-claims.ts +266 -0
  37. package/dist/chunk-MJ3K6ICH.js.map +0 -1
@@ -0,0 +1,411 @@
1
+ import { z } from "zod";
2
+ export declare const WORK_CLAIM_NAMESPACE_MAX_BYTES = 64;
3
+ export declare const WORK_CLAIM_CANONICAL_KEY_MAX_BYTES = 512;
4
+ export declare const WORK_CLAIM_DISPLAY_LABEL_MAX_BYTES = 256;
5
+ export declare const WORK_CLAIM_VERSION_VALUE_MAX_BYTES = 256;
6
+ export declare const WORK_CLAIM_ACTIVE_SESSION_CAP = 64;
7
+ export declare const WORK_CLAIM_DISCOVERY_LIMIT = 8;
8
+ export declare const WORK_CLAIM_DISCOVERY_DEFAULT_LIMIT = 4;
9
+ export declare const WORK_DISCOVERY_QUERY_MAX_CHARS = 200;
10
+ export declare const WORK_DISCOVERY_RECENT_HOURS_MAX: number;
11
+ export declare function normalizeWorkClaimNamespace(value: string): string;
12
+ export declare function normalizeWorkClaimCanonicalKey(value: string): string;
13
+ export declare function normalizeWorkClaimDisplayLabel(value: string): string | null;
14
+ export declare const WorkClaimNamespace: z.ZodString;
15
+ export type WorkClaimNamespace = z.infer<typeof WorkClaimNamespace>;
16
+ export declare const WorkClaimCanonicalKey: z.ZodString;
17
+ export type WorkClaimCanonicalKey = z.infer<typeof WorkClaimCanonicalKey>;
18
+ export declare const WorkClaimDisplayLabel: z.ZodString;
19
+ export type WorkClaimDisplayLabel = z.infer<typeof WorkClaimDisplayLabel>;
20
+ export declare const WorkClaimSubjectType: z.ZodEnum<{
21
+ artifact: "artifact";
22
+ branch: "branch";
23
+ ci_run: "ci_run";
24
+ issue: "issue";
25
+ other: "other";
26
+ pull_request: "pull_request";
27
+ release: "release";
28
+ repository: "repository";
29
+ }>;
30
+ export type WorkClaimSubjectType = z.infer<typeof WorkClaimSubjectType>;
31
+ export declare const WorkClaimRole: z.ZodEnum<{
32
+ delivering: "delivering";
33
+ monitoring: "monitoring";
34
+ reviewing: "reviewing";
35
+ working: "working";
36
+ }>;
37
+ export type WorkClaimRole = z.infer<typeof WorkClaimRole>;
38
+ export declare const WorkClaimState: z.ZodEnum<{
39
+ active: "active";
40
+ released: "released";
41
+ stale: "stale";
42
+ superseded: "superseded";
43
+ }>;
44
+ export type WorkClaimState = z.infer<typeof WorkClaimState>;
45
+ export declare const WorkClaimProvenance: z.ZodEnum<{
46
+ explicit_agent: "explicit_agent";
47
+ session_resource: "session_resource";
48
+ system_lifecycle: "system_lifecycle";
49
+ trusted_integration: "trusted_integration";
50
+ user_api: "user_api";
51
+ }>;
52
+ export type WorkClaimProvenance = z.infer<typeof WorkClaimProvenance>;
53
+ export declare const WorkClaimVersionKind: z.ZodEnum<{
54
+ artifact_version: "artifact_version";
55
+ branch_head: "branch_head";
56
+ ci_run: "ci_run";
57
+ git_commit: "git_commit";
58
+ other: "other";
59
+ pull_request_head: "pull_request_head";
60
+ release_version: "release_version";
61
+ }>;
62
+ export type WorkClaimVersionKind = z.infer<typeof WorkClaimVersionKind>;
63
+ export declare const WorkClaimVersionValue: z.ZodString;
64
+ export type WorkClaimVersionValue = z.infer<typeof WorkClaimVersionValue>;
65
+ export declare const WorkClaimReleaseReason: z.ZodEnum<{
66
+ cancelled: "cancelled";
67
+ completed: "completed";
68
+ corrected: "corrected";
69
+ external_state_changed: "external_state_changed";
70
+ failed: "failed";
71
+ no_longer_active: "no_longer_active";
72
+ other: "other";
73
+ superseded: "superseded";
74
+ }>;
75
+ export type WorkClaimReleaseReason = z.infer<typeof WorkClaimReleaseReason>;
76
+ export declare const WorkClaimMutationKind: z.ZodEnum<{
77
+ created: "created";
78
+ released: "released";
79
+ stale: "stale";
80
+ superseded: "superseded";
81
+ updated: "updated";
82
+ }>;
83
+ export type WorkClaimMutationKind = z.infer<typeof WorkClaimMutationKind>;
84
+ export declare const WorkClaim: z.ZodObject<{
85
+ id: z.ZodString;
86
+ sessionId: z.ZodString;
87
+ rootSessionId: z.ZodString;
88
+ subject: z.ZodObject<{
89
+ namespace: z.ZodString;
90
+ type: z.ZodEnum<{
91
+ artifact: "artifact";
92
+ branch: "branch";
93
+ ci_run: "ci_run";
94
+ issue: "issue";
95
+ other: "other";
96
+ pull_request: "pull_request";
97
+ release: "release";
98
+ repository: "repository";
99
+ }>;
100
+ canonicalKey: z.ZodString;
101
+ displayLabel: z.ZodNullable<z.ZodString>;
102
+ }, z.core.$strip>;
103
+ role: z.ZodEnum<{
104
+ delivering: "delivering";
105
+ monitoring: "monitoring";
106
+ reviewing: "reviewing";
107
+ working: "working";
108
+ }>;
109
+ state: z.ZodEnum<{
110
+ active: "active";
111
+ released: "released";
112
+ stale: "stale";
113
+ superseded: "superseded";
114
+ }>;
115
+ revision: z.ZodNumber;
116
+ provenance: z.ZodEnum<{
117
+ explicit_agent: "explicit_agent";
118
+ session_resource: "session_resource";
119
+ system_lifecycle: "system_lifecycle";
120
+ trusted_integration: "trusted_integration";
121
+ user_api: "user_api";
122
+ }>;
123
+ version: z.ZodNullable<z.ZodObject<{
124
+ kind: z.ZodEnum<{
125
+ artifact_version: "artifact_version";
126
+ branch_head: "branch_head";
127
+ ci_run: "ci_run";
128
+ git_commit: "git_commit";
129
+ other: "other";
130
+ pull_request_head: "pull_request_head";
131
+ release_version: "release_version";
132
+ }>;
133
+ value: z.ZodString;
134
+ }, z.core.$strip>>;
135
+ observedAt: z.ZodString;
136
+ createdAt: z.ZodString;
137
+ updatedAt: z.ZodString;
138
+ settledAt: z.ZodNullable<z.ZodString>;
139
+ }, z.core.$strip>;
140
+ export type WorkClaim = z.infer<typeof WorkClaim>;
141
+ export declare const WorkClaimMutationResult: z.ZodObject<{
142
+ claim: z.ZodObject<{
143
+ id: z.ZodString;
144
+ sessionId: z.ZodString;
145
+ rootSessionId: z.ZodString;
146
+ subject: z.ZodObject<{
147
+ namespace: z.ZodString;
148
+ type: z.ZodEnum<{
149
+ artifact: "artifact";
150
+ branch: "branch";
151
+ ci_run: "ci_run";
152
+ issue: "issue";
153
+ other: "other";
154
+ pull_request: "pull_request";
155
+ release: "release";
156
+ repository: "repository";
157
+ }>;
158
+ canonicalKey: z.ZodString;
159
+ displayLabel: z.ZodNullable<z.ZodString>;
160
+ }, z.core.$strip>;
161
+ role: z.ZodEnum<{
162
+ delivering: "delivering";
163
+ monitoring: "monitoring";
164
+ reviewing: "reviewing";
165
+ working: "working";
166
+ }>;
167
+ state: z.ZodEnum<{
168
+ active: "active";
169
+ released: "released";
170
+ stale: "stale";
171
+ superseded: "superseded";
172
+ }>;
173
+ revision: z.ZodNumber;
174
+ provenance: z.ZodEnum<{
175
+ explicit_agent: "explicit_agent";
176
+ session_resource: "session_resource";
177
+ system_lifecycle: "system_lifecycle";
178
+ trusted_integration: "trusted_integration";
179
+ user_api: "user_api";
180
+ }>;
181
+ version: z.ZodNullable<z.ZodObject<{
182
+ kind: z.ZodEnum<{
183
+ artifact_version: "artifact_version";
184
+ branch_head: "branch_head";
185
+ ci_run: "ci_run";
186
+ git_commit: "git_commit";
187
+ other: "other";
188
+ pull_request_head: "pull_request_head";
189
+ release_version: "release_version";
190
+ }>;
191
+ value: z.ZodString;
192
+ }, z.core.$strip>>;
193
+ observedAt: z.ZodString;
194
+ createdAt: z.ZodString;
195
+ updatedAt: z.ZodString;
196
+ settledAt: z.ZodNullable<z.ZodString>;
197
+ }, z.core.$strip>;
198
+ mutation: z.ZodEnum<{
199
+ created: "created";
200
+ released: "released";
201
+ stale: "stale";
202
+ superseded: "superseded";
203
+ updated: "updated";
204
+ }>;
205
+ replayed: z.ZodBoolean;
206
+ }, z.core.$strip>;
207
+ export type WorkClaimMutationResult = z.infer<typeof WorkClaimMutationResult>;
208
+ export declare const WorkClaimDiscoverySummary: z.ZodObject<{
209
+ id: z.ZodString;
210
+ sessionId: z.ZodString;
211
+ subject: z.ZodObject<{
212
+ namespace: z.ZodString;
213
+ type: z.ZodEnum<{
214
+ artifact: "artifact";
215
+ branch: "branch";
216
+ ci_run: "ci_run";
217
+ issue: "issue";
218
+ other: "other";
219
+ pull_request: "pull_request";
220
+ release: "release";
221
+ repository: "repository";
222
+ }>;
223
+ canonicalKey: z.ZodString;
224
+ displayLabel: z.ZodNullable<z.ZodString>;
225
+ }, z.core.$strip>;
226
+ role: z.ZodEnum<{
227
+ delivering: "delivering";
228
+ monitoring: "monitoring";
229
+ reviewing: "reviewing";
230
+ working: "working";
231
+ }>;
232
+ state: z.ZodEnum<{
233
+ active: "active";
234
+ released: "released";
235
+ stale: "stale";
236
+ superseded: "superseded";
237
+ }>;
238
+ revision: z.ZodNumber;
239
+ provenance: z.ZodEnum<{
240
+ explicit_agent: "explicit_agent";
241
+ session_resource: "session_resource";
242
+ system_lifecycle: "system_lifecycle";
243
+ trusted_integration: "trusted_integration";
244
+ user_api: "user_api";
245
+ }>;
246
+ version: z.ZodNullable<z.ZodObject<{
247
+ kind: z.ZodEnum<{
248
+ artifact_version: "artifact_version";
249
+ branch_head: "branch_head";
250
+ ci_run: "ci_run";
251
+ git_commit: "git_commit";
252
+ other: "other";
253
+ pull_request_head: "pull_request_head";
254
+ release_version: "release_version";
255
+ }>;
256
+ value: z.ZodString;
257
+ }, z.core.$strip>>;
258
+ observedAt: z.ZodString;
259
+ updatedAt: z.ZodString;
260
+ settledAt: z.ZodNullable<z.ZodString>;
261
+ }, z.core.$strip>;
262
+ export type WorkClaimDiscoverySummary = z.infer<typeof WorkClaimDiscoverySummary>;
263
+ export declare const WorkClaimSubjectFilter: z.ZodObject<{
264
+ namespace: z.ZodString;
265
+ type: z.ZodEnum<{
266
+ artifact: "artifact";
267
+ branch: "branch";
268
+ ci_run: "ci_run";
269
+ issue: "issue";
270
+ other: "other";
271
+ pull_request: "pull_request";
272
+ release: "release";
273
+ repository: "repository";
274
+ }>;
275
+ canonicalKey: z.ZodString;
276
+ }, z.core.$strict>;
277
+ export type WorkClaimSubjectFilter = z.infer<typeof WorkClaimSubjectFilter>;
278
+ export declare const WorkDiscoveryMatchClass: z.ZodEnum<{
279
+ exact_subject: "exact_subject";
280
+ fuzzy: "fuzzy";
281
+ goal: "goal";
282
+ title: "title";
283
+ }>;
284
+ export type WorkDiscoveryMatchClass = z.infer<typeof WorkDiscoveryMatchClass>;
285
+ export declare const WorkDiscoveryMatchedField: z.ZodEnum<{
286
+ claim_key: "claim_key";
287
+ claim_label: "claim_label";
288
+ goal: "goal";
289
+ subject: "subject";
290
+ title: "title";
291
+ }>;
292
+ export type WorkDiscoveryMatchedField = z.infer<typeof WorkDiscoveryMatchedField>;
293
+ /**
294
+ * Deliberately stable bands rather than a raw ranking score. Raw full-text or
295
+ * trigram values are query-relative and become a misleading cross-query API.
296
+ */
297
+ export declare const WorkDiscoveryScoreBand: z.ZodEnum<{
298
+ exact: "exact";
299
+ related: "related";
300
+ strong: "strong";
301
+ }>;
302
+ export type WorkDiscoveryScoreBand = z.infer<typeof WorkDiscoveryScoreBand>;
303
+ export declare const WorkDiscoveryMatch: z.ZodObject<{
304
+ class: z.ZodEnum<{
305
+ exact_subject: "exact_subject";
306
+ fuzzy: "fuzzy";
307
+ goal: "goal";
308
+ title: "title";
309
+ }>;
310
+ field: z.ZodEnum<{
311
+ claim_key: "claim_key";
312
+ claim_label: "claim_label";
313
+ goal: "goal";
314
+ subject: "subject";
315
+ title: "title";
316
+ }>;
317
+ scoreBand: z.ZodEnum<{
318
+ exact: "exact";
319
+ related: "related";
320
+ strong: "strong";
321
+ }>;
322
+ claimId: z.ZodNullable<z.ZodString>;
323
+ }, z.core.$strict>;
324
+ export type WorkDiscoveryMatch = z.infer<typeof WorkDiscoveryMatch>;
325
+ /**
326
+ * Provider-neutral related-work evidence. The two literal booleans are part of
327
+ * the wire contract so a consumer cannot accidentally present a claim as a
328
+ * lock, authorization grant, ownership transfer, or mandatory instruction.
329
+ */
330
+ export declare const WorkDiscoveryProjection: z.ZodObject<{
331
+ claims: z.ZodArray<z.ZodObject<{
332
+ id: z.ZodString;
333
+ sessionId: z.ZodString;
334
+ subject: z.ZodObject<{
335
+ namespace: z.ZodString;
336
+ type: z.ZodEnum<{
337
+ artifact: "artifact";
338
+ branch: "branch";
339
+ ci_run: "ci_run";
340
+ issue: "issue";
341
+ other: "other";
342
+ pull_request: "pull_request";
343
+ release: "release";
344
+ repository: "repository";
345
+ }>;
346
+ canonicalKey: z.ZodString;
347
+ displayLabel: z.ZodNullable<z.ZodString>;
348
+ }, z.core.$strip>;
349
+ role: z.ZodEnum<{
350
+ delivering: "delivering";
351
+ monitoring: "monitoring";
352
+ reviewing: "reviewing";
353
+ working: "working";
354
+ }>;
355
+ state: z.ZodEnum<{
356
+ active: "active";
357
+ released: "released";
358
+ stale: "stale";
359
+ superseded: "superseded";
360
+ }>;
361
+ revision: z.ZodNumber;
362
+ provenance: z.ZodEnum<{
363
+ explicit_agent: "explicit_agent";
364
+ session_resource: "session_resource";
365
+ system_lifecycle: "system_lifecycle";
366
+ trusted_integration: "trusted_integration";
367
+ user_api: "user_api";
368
+ }>;
369
+ version: z.ZodNullable<z.ZodObject<{
370
+ kind: z.ZodEnum<{
371
+ artifact_version: "artifact_version";
372
+ branch_head: "branch_head";
373
+ ci_run: "ci_run";
374
+ git_commit: "git_commit";
375
+ other: "other";
376
+ pull_request_head: "pull_request_head";
377
+ release_version: "release_version";
378
+ }>;
379
+ value: z.ZodString;
380
+ }, z.core.$strip>>;
381
+ observedAt: z.ZodString;
382
+ updatedAt: z.ZodString;
383
+ settledAt: z.ZodNullable<z.ZodString>;
384
+ }, z.core.$strip>>;
385
+ claimsTruncated: z.ZodBoolean;
386
+ match: z.ZodNullable<z.ZodObject<{
387
+ class: z.ZodEnum<{
388
+ exact_subject: "exact_subject";
389
+ fuzzy: "fuzzy";
390
+ goal: "goal";
391
+ title: "title";
392
+ }>;
393
+ field: z.ZodEnum<{
394
+ claim_key: "claim_key";
395
+ claim_label: "claim_label";
396
+ goal: "goal";
397
+ subject: "subject";
398
+ title: "title";
399
+ }>;
400
+ scoreBand: z.ZodEnum<{
401
+ exact: "exact";
402
+ related: "related";
403
+ strong: "strong";
404
+ }>;
405
+ claimId: z.ZodNullable<z.ZodString>;
406
+ }, z.core.$strict>>;
407
+ possibleOverlap: z.ZodBoolean;
408
+ advisoryOnly: z.ZodLiteral<true>;
409
+ noAdditionalAccess: z.ZodLiteral<true>;
410
+ }, z.core.$strict>;
411
+ export type WorkDiscoveryProjection = z.infer<typeof WorkDiscoveryProjection>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeni/contracts",
3
- "version": "2.6.0-canary.0",
3
+ "version": "2.9.2-canary.0",
4
4
  "description": "Shared zod schemas and wire-contract types for the OpenGeni API.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -58,6 +58,10 @@
58
58
  "types": "./dist/canonical-human-identities.d.ts",
59
59
  "import": "./dist/canonical-human-identities.js"
60
60
  },
61
+ "./session-titles": {
62
+ "types": "./dist/session-titles.d.ts",
63
+ "import": "./dist/session-titles.js"
64
+ },
61
65
  "./managed-auth-session-sets": {
62
66
  "types": "./dist/managed-auth-session-sets.d.ts",
63
67
  "import": "./dist/managed-auth-session-sets.js"
@@ -57,8 +57,8 @@ export const AGENT_AUTHORED_PREFERENCE_CONTENT_TOO_LONG_MESSAGE =
57
57
  "A Skill is durable Agent Knowledge that agents retrieve on demand, so its length is " +
58
58
  "retrieval cost rather than standing prompt cost: only its short title and description are composed into " +
59
59
  `every session prompt. Keep it under ${AGENT_AUTHORED_PREFERENCE_CONTENT_MAX_CHARS} characters: state the ` +
60
- "preference plainly, no numbered procedure and no examples. Put procedure in a Document or Skill and " +
61
- "reference it instead.";
60
+ "trigger and outcome plainly, include only the necessary procedure, checks, and exceptions, and remove " +
61
+ "background, repeated guidance, and decorative examples.";
62
62
 
63
63
  export const AGENT_AUTHORED_COMPANY_PROFILE_TOO_LONG_MESSAGE =
64
64
  "Organization identity and mission are mandatory prompt context in every root session across the " +
@@ -84,10 +84,17 @@ export const AGENT_AUTHORED_REMEMBER_CONTENT_TOO_LONG_MESSAGE =
84
84
  * preference*. Deliberately not reused for the company profile, which is a
85
85
  * descriptive profile rather than an instruction and needs its own wording.
86
86
  */
87
- export const AGENT_AUTHORED_DURABLE_TEXT_STYLE =
88
- "Durable text is prompt cost, not a place to be thorough: write one imperative statement in 1-3 sentences, " +
89
- "with no numbered steps, no examples, no rationale and no restating of defaults. Prefer several small entries " +
90
- "over one long one, and keep procedure in a Document or Skill that the rule references instead of inlining it.";
87
+ export const AGENT_AUTHORED_INSTRUCTION_POLICY_STYLE =
88
+ "Write the shortest complete imperative rule in 1-3 sentences, with no numbered procedure, examples, " +
89
+ "rationale, or restated defaults. Split unrelated rules, and move conditional procedure into a Skill.";
90
+
91
+ export const AGENT_AUTHORED_SKILL_STYLE =
92
+ "Write one focused Skill with a clear trigger and outcome. Include only the prerequisites, necessary steps, " +
93
+ "verification, and important failure handling an agent needs to execute it; omit background, repetition, " +
94
+ "generic advice, and decorative examples. Split unrelated workflows into separate Skills.";
95
+
96
+ /** @deprecated Use the destination-specific instruction or Skill style. */
97
+ export const AGENT_AUTHORED_DURABLE_TEXT_STYLE = AGENT_AUTHORED_INSTRUCTION_POLICY_STYLE;
91
98
 
92
99
  /**
93
100
  * Actionable over-budget message including the text the caller actually sent,
@@ -0,0 +1,69 @@
1
+ import { z } from "zod";
2
+
3
+ import {
4
+ NestedAgentDepthValue,
5
+ SessionGoalStatus,
6
+ SessionStatus,
7
+ } from "./session-topology-primitives";
8
+ import { WorkDiscoveryProjection } from "./work-claims";
9
+
10
+ /** Compact, bounded session projection for workspace agent-topology browsers. */
11
+ export const AgentTopologySession = z.object({
12
+ id: z.string().uuid(),
13
+ title: z.string().nullable(),
14
+ titleTruncated: z.boolean(),
15
+ parentSessionId: z.string().uuid().nullable(),
16
+ rootSessionId: z.string().uuid(),
17
+ nestedAgentDepth: NestedAgentDepthValue,
18
+ ancestorPath: z.array(
19
+ z.object({
20
+ id: z.string().uuid(),
21
+ title: z.string().nullable(),
22
+ titleTruncated: z.boolean(),
23
+ }),
24
+ ),
25
+ status: SessionStatus,
26
+ goal: z
27
+ .object({
28
+ status: SessionGoalStatus,
29
+ summary: z.string(),
30
+ summaryTruncated: z.boolean(),
31
+ })
32
+ .nullable(),
33
+ pause: z.object({
34
+ state: z.enum(["active", "paused"]),
35
+ additionalBlockerCount: z.number().int().nonnegative(),
36
+ source: z
37
+ .object({
38
+ kind: z.enum(["session", "workspace"]),
39
+ sessionId: z.string().uuid().optional(),
40
+ displayName: z.string(),
41
+ displayNameTruncated: z.boolean(),
42
+ })
43
+ .nullable(),
44
+ }),
45
+ children: z.object({
46
+ directChildren: z.number().int().nonnegative(),
47
+ totalDescendants: z.number().int().nonnegative(),
48
+ runningDescendants: z.number().int().nonnegative(),
49
+ queuedDescendants: z.number().int().nonnegative(),
50
+ attentionDescendants: z.number().int().nonnegative(),
51
+ pausedDescendants: z.number().int().nonnegative(),
52
+ failedDescendants: z.number().int().nonnegative(),
53
+ truncated: z.boolean(),
54
+ }),
55
+ relatedWork: WorkDiscoveryProjection,
56
+ createdAt: z.string(),
57
+ updatedAt: z.string(),
58
+ });
59
+ export type AgentTopologySession = z.infer<typeof AgentTopologySession>;
60
+
61
+ export const AgentTopologyPageResponse = z.object({
62
+ sessions: z.array(AgentTopologySession),
63
+ total: z.number().int().nonnegative(),
64
+ hasMore: z.boolean(),
65
+ /** Operator rollout decision for human advisory presentation. */
66
+ humanAdvisoriesEnabled: z.boolean().optional(),
67
+ nextCursor: z.string().nullable(),
68
+ });
69
+ export type AgentTopologyPageResponse = z.infer<typeof AgentTopologyPageResponse>;
@@ -296,6 +296,29 @@ export type CompanyProfileMutationResponse = z.infer<typeof CompanyProfileMutati
296
296
  export const COMPANY_PROFILE_AGENT_APPROVE_OPTION = "activate" as const;
297
297
  export const COMPANY_PROFILE_AGENT_REJECT_OPTION = "skip" as const;
298
298
 
299
+ export const CompanyProfileAgentPolicyMode = z.enum(["off", "suggest", "automatic"]);
300
+ export type CompanyProfileAgentPolicyMode = z.infer<typeof CompanyProfileAgentPolicyMode>;
301
+
302
+ export const CompanyProfileAgentPolicy = z.object({
303
+ organizationId: z.string().uuid(),
304
+ mode: CompanyProfileAgentPolicyMode,
305
+ version: z.number().int().nonnegative(),
306
+ updatedAt: z.string().datetime({ offset: true }),
307
+ changed: z.boolean().optional(),
308
+ });
309
+ export type CompanyProfileAgentPolicy = z.infer<typeof CompanyProfileAgentPolicy>;
310
+
311
+ export const UpdateCompanyProfileAgentPolicyRequest = z
312
+ .object({
313
+ mode: CompanyProfileAgentPolicyMode,
314
+ expectedVersion: z.number().int().nonnegative(),
315
+ operationId: z.string().uuid(),
316
+ })
317
+ .strict();
318
+ export type UpdateCompanyProfileAgentPolicyRequest = z.infer<
319
+ typeof UpdateCompanyProfileAgentPolicyRequest
320
+ >;
321
+
299
322
  export const CompanyProfileAgentAttempt = z
300
323
  .object({
301
324
  accountId: z.string().uuid(),
@@ -328,15 +351,37 @@ export type CompanyProfileAgentHumanInputPrompt = z.infer<
328
351
  typeof CompanyProfileAgentHumanInputPrompt
329
352
  >;
330
353
 
331
- export const CompanyProfileAgentProposalReceipt = z.object({
354
+ export const CompanyProfileAgentReviewRequiredReceipt = z.object({
332
355
  status: z.literal("confirmation_required"),
333
356
  operationId: z.string().uuid(),
334
357
  proposalReceiptId: z.string().uuid(),
335
358
  revision: CompanyProfileRevision,
359
+ policyMode: z.literal("suggest"),
336
360
  humanInput: CompanyProfileAgentHumanInputPrompt,
337
361
  confirmWith: z.literal("company_profile_confirm"),
338
362
  replayed: z.boolean(),
339
363
  });
364
+ export type CompanyProfileAgentReviewRequiredReceipt = z.infer<
365
+ typeof CompanyProfileAgentReviewRequiredReceipt
366
+ >;
367
+
368
+ export const CompanyProfileAgentAutomaticActivationReceipt = z.object({
369
+ status: z.literal("activated"),
370
+ operationId: z.string().uuid(),
371
+ proposalReceiptId: z.string().uuid(),
372
+ automaticActivationReceiptId: z.string().uuid(),
373
+ policyMode: z.literal("automatic"),
374
+ mutation: CompanyProfileMutationResponse,
375
+ replayed: z.boolean(),
376
+ });
377
+ export type CompanyProfileAgentAutomaticActivationReceipt = z.infer<
378
+ typeof CompanyProfileAgentAutomaticActivationReceipt
379
+ >;
380
+
381
+ export const CompanyProfileAgentProposalReceipt = z.discriminatedUnion("status", [
382
+ CompanyProfileAgentReviewRequiredReceipt,
383
+ CompanyProfileAgentAutomaticActivationReceipt,
384
+ ]);
340
385
  export type CompanyProfileAgentProposalReceipt = z.infer<typeof CompanyProfileAgentProposalReceipt>;
341
386
 
342
387
  export const CompanyProfileAgentConfirmRequest = z