@fusionkit/protocol 0.1.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 (45) hide show
  1. package/dist/api.d.ts +106 -0
  2. package/dist/api.js +6 -0
  3. package/dist/chain.d.ts +14 -0
  4. package/dist/chain.js +49 -0
  5. package/dist/constants.d.ts +25 -0
  6. package/dist/constants.js +36 -0
  7. package/dist/contract.d.ts +6 -0
  8. package/dist/contract.js +32 -0
  9. package/dist/execution.d.ts +67 -0
  10. package/dist/execution.js +27 -0
  11. package/dist/generated/model-fusion-openapi.d.ts +44 -0
  12. package/dist/generated/model-fusion-openapi.js +23 -0
  13. package/dist/hash.d.ts +10 -0
  14. package/dist/hash.js +31 -0
  15. package/dist/index.d.ts +42 -0
  16. package/dist/index.js +30 -0
  17. package/dist/jcs.d.ts +14 -0
  18. package/dist/jcs.js +49 -0
  19. package/dist/keys.d.ts +14 -0
  20. package/dist/keys.js +36 -0
  21. package/dist/model-fusion.d.ts +167 -0
  22. package/dist/model-fusion.js +596 -0
  23. package/dist/receipt-story.d.ts +27 -0
  24. package/dist/receipt-story.js +127 -0
  25. package/dist/receipt.d.ts +20 -0
  26. package/dist/receipt.js +162 -0
  27. package/dist/test/model-fusion.test.d.ts +1 -0
  28. package/dist/test/model-fusion.test.js +213 -0
  29. package/dist/test/protocol.test.d.ts +1 -0
  30. package/dist/test/protocol.test.js +240 -0
  31. package/dist/test/tool-executor.test.d.ts +1 -0
  32. package/dist/test/tool-executor.test.js +86 -0
  33. package/dist/test/trace.test.d.ts +1 -0
  34. package/dist/test/trace.test.js +75 -0
  35. package/dist/tool-executor.d.ts +58 -0
  36. package/dist/tool-executor.js +80 -0
  37. package/dist/trace.d.ts +119 -0
  38. package/dist/trace.js +248 -0
  39. package/dist/types.d.ts +375 -0
  40. package/dist/types.js +14 -0
  41. package/dist/validators.d.ts +7 -0
  42. package/dist/validators.js +32 -0
  43. package/dist/vocabulary.d.ts +12 -0
  44. package/dist/vocabulary.js +79 -0
  45. package/package.json +27 -0
@@ -0,0 +1,79 @@
1
+ export const RUN_STATUSES = [
2
+ "created",
3
+ "claimed",
4
+ "provisioning",
5
+ "running",
6
+ "awaiting_approval",
7
+ "completed",
8
+ "failed",
9
+ "cancelled"
10
+ ];
11
+ export const TERMINAL_RUN_STATUSES = [
12
+ "completed",
13
+ "failed",
14
+ "cancelled"
15
+ ];
16
+ export const AGENT_KINDS = [
17
+ "claude-code",
18
+ "codex",
19
+ "pi",
20
+ "mock",
21
+ "command"
22
+ ];
23
+ export const SESSION_ISOLATIONS = [
24
+ "process",
25
+ "hermetic",
26
+ "vercel-sandbox"
27
+ ];
28
+ export const DISCLOSURE_MODES = [
29
+ "none",
30
+ "metadata-only",
31
+ "redacted",
32
+ "minimal-context",
33
+ "full"
34
+ ];
35
+ export const CHECKPOINT_TIERS = [
36
+ "semantic",
37
+ "workspace"
38
+ ];
39
+ export const ACTOR_KINDS = [
40
+ "human",
41
+ "service"
42
+ ];
43
+ /**
44
+ * Every event type a run can record. The `Record` satisfies-check makes the
45
+ * map provably complete: adding a `RunEvent` variant fails compilation here
46
+ * until the vocabulary (and therefore every renderer parity test) learns
47
+ * it. Renderers that cannot import this module (the dependency-free control
48
+ * panel) are held to the same set by a parity test instead.
49
+ */
50
+ const RUN_EVENT_TYPE_MAP = {
51
+ "run.created": true,
52
+ "run.claimed": true,
53
+ "workspace.materialized": true,
54
+ "policy.evaluated": true,
55
+ "consent.requested": true,
56
+ "consent.granted": true,
57
+ "secret.released": true,
58
+ "command.executed": true,
59
+ "file.changed": true,
60
+ "network.connected": true,
61
+ "model.called": true,
62
+ "boundary.crossed": true,
63
+ "artifact.created": true,
64
+ "checkpoint.created": true,
65
+ "run.completed": true,
66
+ "run.failed": true,
67
+ "run.cancelled": true
68
+ };
69
+ export const RUN_EVENT_TYPES = Object.keys(RUN_EVENT_TYPE_MAP);
70
+ export const HEX_HASH_PATTERN = /^[0-9a-f]{64}$/;
71
+ function includes(values, value) {
72
+ return values.includes(value);
73
+ }
74
+ export function isTerminalStatus(status) {
75
+ return includes(TERMINAL_RUN_STATUSES, status);
76
+ }
77
+ export function isAgentKind(value) {
78
+ return includes(AGENT_KINDS, value);
79
+ }
package/package.json ADDED
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "@fusionkit/protocol",
3
+ "private": false,
4
+ "version": "0.1.0",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/velum-labs/handoffkit.git",
8
+ "directory": "packages/protocol"
9
+ },
10
+ "description": "Warrant protocol schemas and primitives: contracts, receipts, event chains, manifests, checkpoints, and handoff envelopes. Zero runtime dependencies.",
11
+ "license": "UNLICENSED",
12
+ "type": "module",
13
+ "exports": {
14
+ ".": {
15
+ "types": "./dist/index.d.ts",
16
+ "default": "./dist/index.js"
17
+ }
18
+ },
19
+ "files": [
20
+ "dist"
21
+ ],
22
+ "publishConfig": {
23
+ "registry": "https://registry.npmjs.org",
24
+ "access": "public",
25
+ "provenance": true
26
+ }
27
+ }