@osstack/protocol 0.20.0 → 0.22.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 (52) hide show
  1. package/dist/attention.d.ts +863 -0
  2. package/dist/attention.d.ts.map +1 -0
  3. package/dist/attention.js +112 -0
  4. package/dist/attention.js.map +1 -0
  5. package/dist/autonomy.d.ts +14 -14
  6. package/dist/delivery-contract.d.ts +734 -0
  7. package/dist/delivery-contract.d.ts.map +1 -0
  8. package/dist/delivery-contract.js +111 -0
  9. package/dist/delivery-contract.js.map +1 -0
  10. package/dist/envelope.d.ts +42 -42
  11. package/dist/event.d.ts +4 -4
  12. package/dist/follow-up-delivery.d.ts +1831 -0
  13. package/dist/follow-up-delivery.d.ts.map +1 -0
  14. package/dist/follow-up-delivery.js +174 -0
  15. package/dist/follow-up-delivery.js.map +1 -0
  16. package/dist/follow-up.d.ts +1100 -0
  17. package/dist/follow-up.d.ts.map +1 -0
  18. package/dist/follow-up.js +28 -0
  19. package/dist/follow-up.js.map +1 -0
  20. package/dist/generate.d.ts.map +1 -1
  21. package/dist/generate.js +18 -0
  22. package/dist/generate.js.map +1 -1
  23. package/dist/graph-checkpoint.d.ts +6 -6
  24. package/dist/graph-worker.d.ts +26 -26
  25. package/dist/graph.d.ts +886 -592
  26. package/dist/graph.d.ts.map +1 -1
  27. package/dist/graph.js +4 -0
  28. package/dist/graph.js.map +1 -1
  29. package/dist/index.d.ts +4 -0
  30. package/dist/index.d.ts.map +1 -1
  31. package/dist/index.js +4 -0
  32. package/dist/index.js.map +1 -1
  33. package/dist/policy.d.ts +10 -10
  34. package/dist/run.d.ts +4 -4
  35. package/dist/session-continuation-grant.d.ts +36 -36
  36. package/dist/session-continuation.d.ts +26 -26
  37. package/dist/task.d.ts +2 -2
  38. package/package.json +10 -9
  39. package/schemas/attention-inbox.schema.json +271 -0
  40. package/schemas/attention-status.schema.json +434 -0
  41. package/schemas/delivery-contract-v2.schema.json +238 -0
  42. package/schemas/delivery-verification-receipt-v2.schema.json +223 -0
  43. package/schemas/follow-up-create-params.schema.json +78 -0
  44. package/schemas/follow-up-draft-params.schema.json +39 -0
  45. package/schemas/follow-up-list-params.schema.json +42 -0
  46. package/schemas/follow-up-list-result.schema.json +241 -0
  47. package/schemas/follow-up-mutation-result.schema.json +361 -0
  48. package/schemas/follow-up-obligation.schema.json +343 -0
  49. package/schemas/follow-up-resolve-params.schema.json +53 -0
  50. package/schemas/frozen-delivery-contract-v2.schema.json +258 -0
  51. package/schemas/graph.schema.json +30 -0
  52. package/LICENSE +0 -21
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delivery-contract.d.ts","sourceRoot":"","sources":["../src/delivery-contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAWxB,eAAO,MAAM,oBAAoB,kEAAgE,CAAC;AAClG,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;IAUrC,CAAC;AACH,+FAA+F;AAC/F,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2C7B,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AACpE,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA2G,CAAC;AACjJ,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAChF,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;EAA+F,CAAC;AACxI,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AACtF,yFAAyF;AACzF,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0B/B,CAAC;AACZ,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAC1F,eAAO,MAAM,0BAA0B;;;;;;;;;EAA2E,CAAC;AACnH,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC"}
@@ -0,0 +1,111 @@
1
+ import { z } from "zod";
2
+ const Digest = z.string().regex(/^[a-f0-9]{64}$/);
3
+ const Commit = z.string().regex(/^(?:[a-f0-9]{40}|[a-f0-9]{64})$/);
4
+ const Id = z.string().min(1).max(256);
5
+ const hasControlCharacter = (value) => [...value].some(char => char.charCodeAt(0) < 32 || char.charCodeAt(0) === 127);
6
+ const Ref = z.string().min(1).max(255).refine((value) => !value.startsWith("-") && !/\s/.test(value) && !hasControlCharacter(value), "unsafe ref");
7
+ const RelativePath = z.string().min(1).max(4096).refine((value) => !value.startsWith("/") && !value.split(/[\\/]/).includes("..") && !hasControlCharacter(value), "unsafe relative path");
8
+ export const DeliveryCompletionV2 = z.enum(["local_verified", "pr_opened", "merged", "deployed"]);
9
+ export const DeliveryPublicationScopeV2 = z.discriminatedUnion("mode", [
10
+ z.object({ mode: z.literal("none") }).strict(),
11
+ z.object({
12
+ mode: z.enum(["push", "draft_pr", "review_pr"]),
13
+ hostname: z.literal("github.com"),
14
+ repository: z.string().regex(/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/),
15
+ remote: z.string().regex(/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/),
16
+ base_ref: Ref,
17
+ head_ref: Ref,
18
+ }).strict(),
19
+ ]);
20
+ /** Scope and authority references constrain existing host authorization. Neither grants it. */
21
+ export const DeliveryContractV2 = z.object({
22
+ schema_version: z.literal(2),
23
+ contract_id: Id,
24
+ parent_contract_id: Id.optional(),
25
+ task_id: Id,
26
+ canonical_repo: z.string().min(1).max(4096).refine((value) => value.startsWith("/") && !hasControlCharacter(value), "absolute repo required"),
27
+ mode: z.enum(["scout", "implement"]),
28
+ base_head: Commit,
29
+ goal: z.string().min(1).max(16000),
30
+ required_checks: z.array(z.object({ id: Id, registry_ref: z.string().regex(/^sha256:[a-f0-9]{64}$/) }).strict()).min(1).max(100),
31
+ review_policy_ref: Id,
32
+ requested_completion: DeliveryCompletionV2,
33
+ allowed_paths: z.array(RelativePath).min(1).max(1000),
34
+ requested_actions: z.array(z.enum(["build", "verify", "commit", "push", "open_pr", "merge", "deploy:staging", "deploy:production"])).min(1).max(8),
35
+ budget_ref: Id,
36
+ policy_digest: Digest,
37
+ publication_scope: DeliveryPublicationScopeV2,
38
+ merge_authority: z.discriminatedUnion("mode", [
39
+ z.object({ mode: z.literal("none") }).strict(),
40
+ z.object({ mode: z.literal("existing_guarded_policy"), policy_ref: z.string().regex(/^sha256:[a-f0-9]{64}$/) }).strict(),
41
+ ]),
42
+ }).strict().superRefine((value, context) => {
43
+ const error = (message) => context.addIssue({ code: z.ZodIssueCode.custom, message });
44
+ if (new Set(value.required_checks.map((check) => check.id)).size !== value.required_checks.length)
45
+ error("duplicate check ID");
46
+ if (new Set(value.required_checks.map((check) => check.registry_ref)).size !== value.required_checks.length)
47
+ error("duplicate check reference");
48
+ if (value.mode === "implement" && (!["build", "verify"].every(action => value.requested_actions.includes(action))))
49
+ error("implement requires build and verify actions");
50
+ if (["pr_opened", "merged", "deployed"].includes(value.requested_completion)
51
+ && !["commit", "push", "open_pr"].every(action => value.requested_actions.some(requested => requested === action)))
52
+ error("published completion requires commit, push and open_pr actions");
53
+ if (["merged", "deployed"].includes(value.requested_completion) && !value.requested_actions.includes("merge"))
54
+ error("merged completion requires merge action");
55
+ if (value.requested_completion === "deployed" && !value.requested_actions.some(action => action.startsWith("deploy:")))
56
+ error("deployed completion requires an explicit deployment target action");
57
+ if (value.parent_contract_id === value.contract_id)
58
+ error("contract cannot parent itself");
59
+ if (value.mode === "scout" && (value.requested_completion !== "local_verified" || value.publication_scope.mode !== "none"
60
+ || value.merge_authority.mode !== "none" || value.requested_actions.some((action) => action !== "verify")))
61
+ error("scout must remain read-only and local");
62
+ if (value.requested_completion === "local_verified" && (value.publication_scope.mode !== "none"
63
+ || value.requested_actions.some((action) => !["build", "verify"].includes(action))))
64
+ error("local completion forbids publication and commit");
65
+ if (value.requested_completion === "merged" && value.requested_actions.some((action) => action.startsWith("deploy:")))
66
+ error("merge completion forbids deployment");
67
+ if (value.requested_completion === "pr_opened" && !["draft_pr", "review_pr"].includes(value.publication_scope.mode))
68
+ error("PR completion requires PR scope");
69
+ if (["local_verified", "pr_opened"].includes(value.requested_completion)
70
+ && (value.merge_authority.mode !== "none" || value.requested_actions.some((action) => action === "merge" || action.startsWith("deploy:"))))
71
+ error("requested completion forbids merge/deploy authority");
72
+ if (["merged", "deployed"].includes(value.requested_completion)
73
+ && (value.publication_scope.mode !== "review_pr" || value.merge_authority.mode !== "existing_guarded_policy"))
74
+ error("merge requires an existing guarded policy reference");
75
+ if (value.merge_authority.mode === "existing_guarded_policy" && value.merge_authority.policy_ref !== `sha256:${value.policy_digest}`)
76
+ error("merge policy reference mismatch");
77
+ if (value.publication_scope.mode !== "none" && value.publication_scope.base_ref === value.publication_scope.head_ref)
78
+ error("publication base and head must differ");
79
+ });
80
+ export const FrozenDeliveryContractV2 = z.object({ contract: DeliveryContractV2, digest: Digest, brief: z.string().min(1).max(32000) }).strict();
81
+ export const DeliveryCandidateIdentityV2 = z.object({ base_head: Commit, head: Commit, tree_id: Commit, diff_digest: Digest }).strict();
82
+ /** Host-generated receipt. Parsing validates structure, never establishes provenance. */
83
+ export const DeliveryVerificationReceiptV2 = z.object({
84
+ schema_version: z.literal(2),
85
+ source: z.literal("osstack_loop_host"),
86
+ run_id: Id,
87
+ task_id: Id,
88
+ run_kind: z.enum(["guarded-local", "guarded-git"]),
89
+ contract_digest: Digest,
90
+ policy_digest: Digest,
91
+ candidate: DeliveryCandidateIdentityV2,
92
+ workspace_state_digest: Digest,
93
+ checks: z.array(z.object({ id: Id, registry_ref: z.string().regex(/^sha256:[a-f0-9]{64}$/), command_digest: Digest,
94
+ exit_code: z.number().int(), duration_ms: z.number().finite().nonnegative() }).strict()).min(1).max(200),
95
+ review: z.object({
96
+ policy_ref: Id,
97
+ verdict: z.enum(["approved", "changes_requested", "blocked", "inconclusive"]),
98
+ builder_agent_id: Id,
99
+ reviewer_agent_id: Id,
100
+ builder_provider: Id,
101
+ builder_model: Id,
102
+ reviewer_provider: Id,
103
+ reviewer_model: Id,
104
+ identity_source: z.literal("reported"),
105
+ artifact_digest: Digest,
106
+ }).strict(),
107
+ observed_at: z.string().datetime(),
108
+ context_receipt_refs: z.array(z.object({ path: z.string().min(1), digest: Digest }).strict()).max(100).default([]),
109
+ }).strict();
110
+ export const DeliveryReceiptReferenceV2 = z.object({ path: z.string().min(1).max(4096), digest: Digest }).strict();
111
+ //# sourceMappingURL=delivery-contract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delivery-contract.js","s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andResult: z.ZodEffects<z.ZodObject<{
263
263
  retryable: boolean;
264
264
  }>>>;
265
265
  }, "strict", z.ZodTypeAny, {
266
- status: "blocked" | "ok" | "needs_approval" | "error";
266
+ status: "ok" | "blocked" | "needs_approval" | "error";
267
267
  protocol_version: string;
268
+ evidence_refs?: {
269
+ kind: "report" | "scorecard" | "proof" | "loop_state" | "external";
270
+ ref: string;
271
+ run_id?: string | undefined;
272
+ sha256?: string | undefined;
273
+ }[] | undefined;
268
274
  error?: {
269
275
  code: "bad_request" | "unsupported_protocol_version" | "unknown_command" | "policy_denied" | "not_found" | "conflict" | "budget_exceeded" | "internal";
270
276
  message: string;
@@ -278,19 +284,19 @@ export declare const AgentCommandResult: z.ZodEffects<z.ZodObject<{
278
284
  run_id?: string | undefined;
279
285
  }[] | undefined;
280
286
  result?: Record<string, unknown> | undefined;
281
- evidence_refs?: {
282
- kind: "report" | "scorecard" | "proof" | "loop_state" | "external";
283
- ref: string;
284
- run_id?: string | undefined;
285
- sha256?: string | undefined;
286
- }[] | undefined;
287
287
  next_actions?: {
288
288
  reason: string;
289
289
  command: string;
290
290
  }[] | undefined;
291
291
  }, {
292
- status: "blocked" | "ok" | "needs_approval" | "error";
292
+ status: "ok" | "blocked" | "needs_approval" | "error";
293
293
  protocol_version: string;
294
+ evidence_refs?: {
295
+ kind: "report" | "scorecard" | "proof" | "loop_state" | "external";
296
+ ref: string;
297
+ run_id?: string | undefined;
298
+ sha256?: string | undefined;
299
+ }[] | undefined;
294
300
  error?: {
295
301
  code: "bad_request" | "unsupported_protocol_version" | "unknown_command" | "policy_denied" | "not_found" | "conflict" | "budget_exceeded" | "internal";
296
302
  message: string;
@@ -304,19 +310,19 @@ export declare const AgentCommandResult: z.ZodEffects<z.ZodObject<{
304
310
  run_id?: string | undefined;
305
311
  }[] | undefined;
306
312
  result?: Record<string, unknown> | undefined;
307
- evidence_refs?: {
308
- kind: "report" | "scorecard" | "proof" | "loop_state" | "external";
309
- ref: string;
310
- run_id?: string | undefined;
311
- sha256?: string | undefined;
312
- }[] | undefined;
313
313
  next_actions?: {
314
314
  reason: string;
315
315
  command: string;
316
316
  }[] | undefined;
317
317
  }>, {
318
- status: "blocked" | "ok" | "needs_approval" | "error";
318
+ status: "ok" | "blocked" | "needs_approval" | "error";
319
319
  protocol_version: string;
320
+ evidence_refs?: {
321
+ kind: "report" | "scorecard" | "proof" | "loop_state" | "external";
322
+ ref: string;
323
+ run_id?: string | undefined;
324
+ sha256?: string | undefined;
325
+ }[] | undefined;
320
326
  error?: {
321
327
  code: "bad_request" | "unsupported_protocol_version" | "unknown_command" | "policy_denied" | "not_found" | "conflict" | "budget_exceeded" | "internal";
322
328
  message: string;
@@ -330,19 +336,19 @@ export declare const AgentCommandResult: z.ZodEffects<z.ZodObject<{
330
336
  run_id?: string | undefined;
331
337
  }[] | undefined;
332
338
  result?: Record<string, unknown> | undefined;
333
- evidence_refs?: {
334
- kind: "report" | "scorecard" | "proof" | "loop_state" | "external";
335
- ref: string;
336
- run_id?: string | undefined;
337
- sha256?: string | undefined;
338
- }[] | undefined;
339
339
  next_actions?: {
340
340
  reason: string;
341
341
  command: string;
342
342
  }[] | undefined;
343
343
  }, {
344
- status: "blocked" | "ok" | "needs_approval" | "error";
344
+ status: "ok" | "blocked" | "needs_approval" | "error";
345
345
  protocol_version: string;
346
+ evidence_refs?: {
347
+ kind: "report" | "scorecard" | "proof" | "loop_state" | "external";
348
+ ref: string;
349
+ run_id?: string | undefined;
350
+ sha256?: string | undefined;
351
+ }[] | undefined;
346
352
  error?: {
347
353
  code: "bad_request" | "unsupported_protocol_version" | "unknown_command" | "policy_denied" | "not_found" | "conflict" | "budget_exceeded" | "internal";
348
354
  message: string;
@@ -356,12 +362,6 @@ export declare const AgentCommandResult: z.ZodEffects<z.ZodObject<{
356
362
  run_id?: string | undefined;
357
363
  }[] | undefined;
358
364
  result?: Record<string, unknown> | undefined;
359
- evidence_refs?: {
360
- kind: "report" | "scorecard" | "proof" | "loop_state" | "external";
361
- ref: string;
362
- run_id?: string | undefined;
363
- sha256?: string | undefined;
364
- }[] | undefined;
365
365
  next_actions?: {
366
366
  reason: string;
367
367
  command: string;
@@ -826,8 +826,14 @@ export declare const AgentCommandResultObject: z.ZodObject<{
826
826
  retryable: boolean;
827
827
  }>>>;
828
828
  }, "strict", z.ZodTypeAny, {
829
- status: "blocked" | "ok" | "needs_approval" | "error";
829
+ status: "ok" | "blocked" | "needs_approval" | "error";
830
830
  protocol_version: string;
831
+ evidence_refs?: {
832
+ kind: "report" | "scorecard" | "proof" | "loop_state" | "external";
833
+ ref: string;
834
+ run_id?: string | undefined;
835
+ sha256?: string | undefined;
836
+ }[] | undefined;
831
837
  error?: {
832
838
  code: "bad_request" | "unsupported_protocol_version" | "unknown_command" | "policy_denied" | "not_found" | "conflict" | "budget_exceeded" | "internal";
833
839
  message: string;
@@ -841,19 +847,19 @@ export declare const AgentCommandResultObject: z.ZodObject<{
841
847
  run_id?: string | undefined;
842
848
  }[] | undefined;
843
849
  result?: Record<string, unknown> | undefined;
844
- evidence_refs?: {
845
- kind: "report" | "scorecard" | "proof" | "loop_state" | "external";
846
- ref: string;
847
- run_id?: string | undefined;
848
- sha256?: string | undefined;
849
- }[] | undefined;
850
850
  next_actions?: {
851
851
  reason: string;
852
852
  command: string;
853
853
  }[] | undefined;
854
854
  }, {
855
- status: "blocked" | "ok" | "needs_approval" | "error";
855
+ status: "ok" | "blocked" | "needs_approval" | "error";
856
856
  protocol_version: string;
857
+ evidence_refs?: {
858
+ kind: "report" | "scorecard" | "proof" | "loop_state" | "external";
859
+ ref: string;
860
+ run_id?: string | undefined;
861
+ sha256?: string | undefined;
862
+ }[] | undefined;
857
863
  error?: {
858
864
  code: "bad_request" | "unsupported_protocol_version" | "unknown_command" | "policy_denied" | "not_found" | "conflict" | "budget_exceeded" | "internal";
859
865
  message: string;
@@ -867,12 +873,6 @@ export declare const AgentCommandResultObject: z.ZodObject<{
867
873
  run_id?: string | undefined;
868
874
  }[] | undefined;
869
875
  result?: Record<string, unknown> | undefined;
870
- evidence_refs?: {
871
- kind: "report" | "scorecard" | "proof" | "loop_state" | "external";
872
- ref: string;
873
- run_id?: string | undefined;
874
- sha256?: string | undefined;
875
- }[] | undefined;
876
876
  next_actions?: {
877
877
  reason: string;
878
878
  command: string;
package/dist/event.d.ts CHANGED
@@ -16,20 +16,20 @@ export declare const EventEnvelope: z.ZodObject<{
16
16
  }, "strict", z.ZodTypeAny, {
17
17
  type: string;
18
18
  run_id: string;
19
+ session_id: string;
20
+ created_at: number;
19
21
  payload: Record<string, unknown>;
20
22
  event_id: string;
21
23
  seq: number;
22
- session_id: string;
23
- created_at: number;
24
24
  terminal: boolean;
25
25
  }, {
26
26
  type: string;
27
27
  run_id: string;
28
+ session_id: string;
29
+ created_at: number;
28
30
  payload: Record<string, unknown>;
29
31
  event_id: string;
30
32
  seq: number;
31
- session_id: string;
32
- created_at: number;
33
33
  terminal?: boolean | undefined;
34
34
  }>;
35
35
  export type EventEnvelope = z.infer<typeof EventEnvelope>;