@the-open-engine/zeroshot 6.11.0 → 6.13.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 (76) hide show
  1. package/cli/commands/providers.js +13 -13
  2. package/cli/index.js +77 -35
  3. package/cli/lib/first-run.js +12 -11
  4. package/cli/lib/update-checker.js +517 -132
  5. package/lib/agent-cli-provider/adapters/opencode.d.ts.map +1 -1
  6. package/lib/agent-cli-provider/adapters/opencode.js +3 -0
  7. package/lib/agent-cli-provider/adapters/opencode.js.map +1 -1
  8. package/lib/agent-cli-provider/types.d.ts +1 -0
  9. package/lib/agent-cli-provider/types.d.ts.map +1 -1
  10. package/lib/agent-cli-provider/types.js.map +1 -1
  11. package/lib/cluster/client.cjs +146 -0
  12. package/lib/cluster/client.d.ts +44 -0
  13. package/lib/cluster/client.mjs +141 -0
  14. package/lib/cluster/connection.cjs +382 -0
  15. package/lib/cluster/connection.d.ts +41 -0
  16. package/lib/cluster/connection.mjs +378 -0
  17. package/lib/cluster/errors.cjs +44 -0
  18. package/lib/cluster/errors.d.ts +23 -0
  19. package/lib/cluster/errors.mjs +32 -0
  20. package/lib/cluster/frames.cjs +49 -0
  21. package/lib/cluster/frames.d.ts +12 -0
  22. package/lib/cluster/frames.mjs +45 -0
  23. package/lib/cluster/generated/protocol-schema.cjs +5 -0
  24. package/lib/cluster/generated/protocol-schema.d.ts +1 -0
  25. package/lib/cluster/generated/protocol-schema.mjs +2 -0
  26. package/lib/cluster/generated/protocol.cjs +22 -0
  27. package/lib/cluster/generated/protocol.d.ts +781 -0
  28. package/lib/cluster/generated/protocol.mjs +19 -0
  29. package/lib/cluster/index.cjs +40 -0
  30. package/lib/cluster/index.d.ts +10 -0
  31. package/lib/cluster/index.mjs +6 -0
  32. package/lib/cluster/queue.cjs +71 -0
  33. package/lib/cluster/queue.d.ts +15 -0
  34. package/lib/cluster/queue.mjs +67 -0
  35. package/lib/cluster/socket.cjs +15 -0
  36. package/lib/cluster/socket.d.ts +11 -0
  37. package/lib/cluster/socket.mjs +12 -0
  38. package/lib/cluster/subscriptions.cjs +270 -0
  39. package/lib/cluster/subscriptions.d.ts +69 -0
  40. package/lib/cluster/subscriptions.mjs +264 -0
  41. package/lib/cluster/validators.cjs +46 -0
  42. package/lib/cluster/validators.d.ts +3 -0
  43. package/lib/cluster/validators.mjs +42 -0
  44. package/lib/settings.js +195 -23
  45. package/lib/setup-apply.js +45 -32
  46. package/lib/setup-undo.js +25 -16
  47. package/package.json +25 -3
  48. package/scripts/build-cluster.js +43 -0
  49. package/scripts/generate-cluster-types.js +203 -0
  50. package/scripts/release-dry-run.js +6 -6
  51. package/scripts/rust-distribution.js +933 -0
  52. package/src/agent/agent-hook-executor.js +14 -6
  53. package/src/agent/agent-lifecycle.js +25 -8
  54. package/src/agent/agent-task-executor.js +711 -139
  55. package/src/agent/output-reformatter.js +54 -41
  56. package/src/agent/pr-verification.js +11 -3
  57. package/src/agent/task-execution-handle.js +373 -0
  58. package/src/agent-cli-provider/adapters/opencode.ts +3 -0
  59. package/src/agent-cli-provider/types.ts +1 -0
  60. package/src/agent-wrapper.js +5 -2
  61. package/src/cluster/client.ts +199 -0
  62. package/src/cluster/connection.ts +300 -0
  63. package/src/cluster/errors.ts +32 -0
  64. package/src/cluster/frames.ts +44 -0
  65. package/src/cluster/generated/protocol-schema.ts +2 -0
  66. package/src/cluster/generated/protocol.ts +183 -0
  67. package/src/cluster/index.ts +38 -0
  68. package/src/cluster/queue.ts +84 -0
  69. package/src/cluster/socket.ts +31 -0
  70. package/src/cluster/subscriptions.ts +256 -0
  71. package/src/cluster/validators.ts +56 -0
  72. package/src/cluster/ws.d.ts +7 -0
  73. package/src/isolation-manager.js +16 -0
  74. package/src/issue-providers/jira-provider.js +1 -1
  75. package/src/issue-providers/linear-provider.js +4 -4
  76. package/task-lib/runner.js +3 -0
@@ -0,0 +1,2 @@
1
+ // Generated from protocol/openengine-cluster/v1/schema.json. Do not edit.
2
+ export const CLUSTER_PROTOCOL_SCHEMA: unknown = {"$defs":{"AdmissionTransition":{"additionalProperties":false,"properties":{"runId":{"type":"string"},"seedInput":true,"spec":{"$ref":"#/$defs/GraphSpec"}},"required":["runId","spec","seedInput"],"type":"object"},"AgentAttachClosedNotification":{"additionalProperties":false,"description":"Wire body of the terminal `subscription/closed` server notification for an `agent/attach`\nsubscription. Deliberately carries no cursor field -- `agent/attach` gives a type-level\n\"cursorless\" guarantee, unlike [`crate::SubscriptionClosedNotification`].","properties":{"reason":{"$ref":"#/$defs/SubscriptionCloseReason"},"subscriptionId":{"type":"string"}},"required":["subscriptionId","reason"],"type":"object"},"AgentAttachEvent":{"description":"The closed public agent-attach progress algebra. This is the only representable shape:\nreasoning, tools, provider frames, usage, and session identifiers have no variant. `Working`\nand `Settled` are empty struct variants rather than bare units: serde's internally tagged enum\ndeserialization silently ignores unknown fields on a unit variant regardless of\n`deny_unknown_fields`, which would otherwise let an unrepresentable field ride along\nundetected on either of these two variants.","oneOf":[{"additionalProperties":false,"properties":{"type":{"const":"working","type":"string"}},"required":["type"],"type":"object"},{"additionalProperties":false,"properties":{"text":{"maxLength":16384,"pattern":"^[^\\u0000-\\u001f\\u007f-\\u009f]*$","type":"string"},"type":{"const":"output","type":"string"}},"required":["type","text"],"type":"object"},{"additionalProperties":false,"properties":{"type":{"const":"settled","type":"string"}},"required":["type"],"type":"object"}]},"AgentAttachEventNotification":{"$ref":"#/$defs/AgentAttachEventNotificationWire"},"AgentAttachEventNotificationWire":{"additionalProperties":false,"properties":{"event":{"$ref":"#/$defs/AgentAttachEvent"},"subscriptionId":{"type":"string"}},"required":["subscriptionId","event"],"type":"object"},"AgentAttachParams":{"additionalProperties":false,"description":"`agent/attach` establishment parameters: the named `{execution}` request. Deliberately closed,\nrejecting any unknown field.","properties":{"execution":{"maxLength":128,"minLength":1,"pattern":"^[^\\u0000-\\u001f\\u007f-\\u009f]+$","type":"string"}},"required":["execution"],"type":"object"},"AgentAttachResult":{"additionalProperties":false,"description":"The `agent/attach` establishment result: only a `subscriptionId`. Deliberately carries no\n`runId` or `atCursor` -- `agent/attach` is not run-scoped and has no cursor.","properties":{"subscriptionId":{"type":"string"}},"required":["subscriptionId"],"type":"object"},"ApplyParams":{"additionalProperties":false,"properties":{"dryRun":{"default":false,"type":"boolean"},"graph":{"$ref":"#/$defs/GraphSpec"},"idempotencyKey":{"maxLength":256,"minLength":1,"pattern":"^[^\\u0000-\\u001f\\u007f-\\u009f]+$","type":"string"},"ifGeneration":{"maximum":9007199254740991,"minimum":0,"type":"integer"},"input":true},"required":["graph"],"type":"object"},"ApplyResult":{"additionalProperties":false,"properties":{"deduped":{"type":"boolean"},"diff":{"anyOf":[{"$ref":"#/$defs/GraphDiff"},{"type":"null"}]},"generation":{"maximum":9007199254740991,"minimum":0,"type":["integer","null"]},"phase":{"$ref":"#/$defs/Phase"},"runId":{"type":["string","null"]}},"required":["phase","deduped"],"type":"object"},"ArtifactLineage":{"additionalProperties":false,"properties":{"attempt":{"maximum":9007199254740991,"minimum":1,"type":"integer"},"generation":{"maximum":9007199254740991,"minimum":0,"type":"integer"},"runId":{"type":"string"}},"required":["generation","runId","attempt"],"type":"object"},"ArtifactProducer":{"additionalProperties":false,"properties":{"node":{"maxLength":128,"minLength":1,"pattern":"^[A-Za-z_][A-Za-z0-9_.-]*$","type":"string"},"worker":{"maxLength":256,"pattern":"^[A-Za-z_][A-Za-z0-9_.-]*@[1-9][0-9]*$","type":"string"}},"required":["node","worker"],"type":"object"},"ArtifactRef":{"additionalProperties":false,"properties":{"artifactId":{"maxLength":256,"minLength":1,"pattern":"^[^\\u0000-\\u001f\\u007f-\\u009f]+$","type":"string"},"byteLength":{"maximum":9007199254740991,"minimum":0,"type":"integer"},"lineage":{"$ref":"#/$defs/ArtifactLineage"},"mediaType":{"maxLength":256,"minLength":1,"pattern":"^[^\\u0000-\\u001f\\u007f-\\u009f]+$","type":"string"},"producer":{"$ref":"#/$defs/ArtifactProducer"},"redaction":{"$ref":"#/$defs/RedactionClass"},"sha256":{"pattern":"^[0-9a-f]{64}$","type":"string"},"typeId":{"maxLength":256,"pattern":"^[A-Za-z_][A-Za-z0-9_.-]*@[1-9][0-9]*$","type":"string"}},"required":["artifactId","sha256","byteLength","mediaType","typeId","producer","lineage","redaction"],"type":"object"},"BackendFault":{"$ref":"#/$defs/BackendFaultWire"},"BackendFaultWire":{"additionalProperties":false,"properties":{"action":{"$ref":"#/$defs/FaultAction"},"code":{"$ref":"#/$defs/FaultCode"},"consequence":{"$ref":"#/$defs/FaultConsequence"},"eventId":{"maxLength":256,"minLength":1,"pattern":"^[^\\u0000-\\u001f\\u007f-\\u009f]+$","type":"string"},"executionRef":{"default":null,"maxLength":256,"minLength":1,"pattern":"^[^\\u0000-\\u001f\\u007f-\\u009f]+$","type":["string","null"]},"retry":{"$ref":"#/$defs/FaultRetryDisposition"},"severity":{"$ref":"#/$defs/FaultSeverity"},"source":{"items":{"$ref":"#/$defs/FaultSourceFrame"},"maxItems":8,"type":"array"},"summary":{"maxLength":256,"minLength":1,"pattern":"^[^\\u0000-\\u001f\\u007f-\\u009f]+$","type":"string"}},"required":["eventId","code","consequence","retry","action","severity","summary","source"],"type":"object"},"CancelRequestParams":{"additionalProperties":false,"description":"Wire body of the `$/cancelRequest` client notification: best-effort cancellation of an\nin-flight unary request by its `RequestId`. Unknown or already-completed ids are a silent\nno-op; cancelling after the backend has committed leaves that committed state unchanged and\nemits no response or compensation.","properties":{"id":{"$ref":"#/$defs/RequestId"}},"required":["id"],"type":"object"},"ChoiceBranch":{"additionalProperties":false,"properties":{"node":{"$ref":"#/$defs/GraphNode"},"when":{"$ref":"#/$defs/Guard"}},"required":["when","node"],"type":"object"},"ClusterStatus":{"properties":{"atCursor":{"type":["string","null"]},"currentRunId":{"type":["string","null"]},"observedGeneration":{"maximum":9007199254740991,"minimum":0,"type":["integer","null"]},"operational":{"anyOf":[{"$ref":"#/$defs/OperationalStatus"},{"type":"null"}]},"phase":{"$ref":"#/$defs/Phase"}},"required":["phase"],"type":"object"},"ControlSelector":{"additionalProperties":false,"properties":{"field":{"maxLength":128,"minLength":1,"pattern":"^[A-Za-z_][A-Za-z0-9_.-]*$","type":["string","null"]},"name":{"maxLength":128,"minLength":1,"pattern":"^[A-Za-z_][A-Za-z0-9_.-]*$","type":"string"},"source":{"$ref":"#/$defs/ControlSource"}},"required":["name","source"],"type":"object"},"ControlSource":{"enum":["signal","error","group"],"type":"string"},"DataSelector":{"oneOf":[{"additionalProperties":false,"properties":{"path":{"items":{"maxLength":128,"minLength":1,"pattern":"^[A-Za-z_][A-Za-z0-9_.-]*$","type":"string"},"maxItems":64,"minItems":1,"type":"array"},"source":{"const":"state","type":"string"}},"required":["source","path"],"type":"object"},{"additionalProperties":false,"properties":{"path":{"items":{"maxLength":128,"minLength":1,"pattern":"^[A-Za-z_][A-Za-z0-9_.-]*$","type":"string"},"maxItems":64,"minItems":1,"type":"array"},"source":{"const":"item","type":"string"}},"required":["source","path"],"type":"object"}]},"DeleteParams":{"additionalProperties":false,"properties":{"idempotencyKey":{"maxLength":256,"minLength":1,"pattern":"^[^\\u0000-\\u001f\\u007f-\\u009f]+$","type":"string"},"ifGeneration":{"maximum":9007199254740991,"minimum":0,"type":"integer"},"ifRunId":{"type":["string","null"]}},"required":["ifGeneration","idempotencyKey"],"type":"object"},"DeleteResult":{"additionalProperties":false,"properties":{"atCursor":{"type":["string","null"]},"deduped":{"type":"boolean"},"deleted":{"type":"boolean"},"generation":{"maximum":9007199254740991,"minimum":0,"type":["integer","null"]},"phase":{"$ref":"#/$defs/Phase"},"runId":{"type":["string","null"]}},"required":["deleted","phase","deduped"],"type":"object"},"DiagnosticPathSegment":{"oneOf":[{"additionalProperties":false,"properties":{"kind":{"const":"field","type":"string"},"name":{"maxLength":128,"minLength":1,"pattern":"^[A-Za-z_][A-Za-z0-9_.-]*$","type":"string"}},"required":["kind","name"],"type":"object"},{"additionalProperties":false,"properties":{"index":{"format":"uint32","maximum":4294967295,"minimum":0,"type":"integer"},"kind":{"const":"index","type":"string"}},"required":["kind","index"],"type":"object"},{"additionalProperties":false,"properties":{"kind":{"const":"node","type":"string"},"name":{"maxLength":128,"minLength":1,"pattern":"^[A-Za-z_][A-Za-z0-9_.-]*$","type":"string"}},"required":["kind","name"],"type":"object"}]},"DiagnosticSeverity":{"enum":["error","warning","info"],"type":"string"},"DispatchState":{"enum":["active","suspended","draining","force_stopping","stopped"],"type":"string"},"DomainErrorData":{"properties":{"code":{"type":"string"},"details":true},"required":["code"],"type":"object"},"EventNotification":{"additionalProperties":false,"description":"Wire body of the generic `event` server notification.","properties":{"cursor":{"type":"string"},"event":{"$ref":"#/$defs/WatchEvent"},"runId":{"type":"string"},"subscriptionId":{"type":"string"}},"required":["subscriptionId","runId","cursor","event"],"type":"object"},"FaultAction":{"description":"Descriptive only, like [`FaultRetryDisposition`]: naming `Retry` never itself retries or\nauthorizes a retry.","enum":["none","retry","wait","escalate","abort"],"type":"string"},"FaultCode":{"enum":["unavailable","resource_exhausted","deadline_exceeded","permission_denied","failed_precondition","not_found","aborted","internal","unknown"],"type":"string"},"FaultConsequence":{"enum":["turn_failed","run_failed","run_degraded","no_observable_effect"],"type":"string"},"FaultRetryDisposition":{"description":"Descriptive only: no `BackendFault` and no `fault` event ever performs or authorizes a retry.\nEvent ordering and emission never themselves change terminal semantics.","enum":["retryable","retryable_after_backoff","not_retryable","indeterminate"],"type":"string"},"FaultSeverity":{"enum":["info","warning","error","critical"],"type":"string"},"FaultSourceFrame":{"additionalProperties":false,"properties":{"component":{"maxLength":256,"minLength":1,"pattern":"^[^\\u0000-\\u001f\\u007f-\\u009f]+$","type":"string"}},"required":["component"],"type":"object"},"GetParams":{"additionalProperties":false,"properties":{"atCursor":{"default":null,"type":["string","null"]}},"type":"object"},"GetResult":{"properties":{"atCursor":{"type":["string","null"]},"spec":{"anyOf":[{"$ref":"#/$defs/GraphSpec"},{"type":"null"}]},"status":{"$ref":"#/$defs/ClusterStatus"}},"required":["status"],"type":"object"},"GraphDiagnostic":{"additionalProperties":false,"properties":{"code":{"$ref":"#/$defs/GraphDiagnosticCode"},"message":{"type":"string"},"path":{"items":{"$ref":"#/$defs/DiagnosticPathSegment"},"type":"array"},"relatedNodes":{"items":{"maxLength":128,"minLength":1,"pattern":"^[A-Za-z_][A-Za-z0-9_.-]*$","type":"string"},"type":"array"},"severity":{"$ref":"#/$defs/DiagnosticSeverity"}},"required":["severity","code","message","path","relatedNodes"],"type":"object"},"GraphDiagnosticCode":{"enum":["schema_safety","reachability","choice_exhaustiveness","loop_exit_satisfiability","missing_bound","write_conflict","ceiling_exceeded","cyclic_reference","undefined_read","invalid_graph_shape"],"type":"string"},"GraphDiff":{"additionalProperties":false,"properties":{"added":{"items":{"maxLength":128,"minLength":1,"pattern":"^[A-Za-z_][A-Za-z0-9_.-]*$","type":"string"},"type":"array"},"changed":{"items":{"maxLength":128,"minLength":1,"pattern":"^[A-Za-z_][A-Za-z0-9_.-]*$","type":"string"},"type":"array"},"removed":{"items":{"maxLength":128,"minLength":1,"pattern":"^[A-Za-z_][A-Za-z0-9_.-]*$","type":"string"},"type":"array"}},"required":["added","removed","changed"],"type":"object"},"GraphNode":{"oneOf":[{"additionalProperties":false,"properties":{"attempts":{"maximum":9007199254740991,"minimum":1,"type":"integer"},"input":{"$ref":"#/$defs/PayloadType"},"inputBindings":{"items":{"$ref":"#/$defs/InputBinding"},"type":"array"},"kind":{"const":"step","type":"string"},"name":{"maxLength":128,"minLength":1,"pattern":"^[A-Za-z_][A-Za-z0-9_.-]*$","type":"string"},"output":{"$ref":"#/$defs/PayloadType"},"timeoutMs":{"maximum":9007199254740991,"minimum":1,"type":"integer"},"worker":{"maxLength":256,"pattern":"^[A-Za-z_][A-Za-z0-9_.-]*@[1-9][0-9]*$","type":"string"},"writeBindings":{"items":{"$ref":"#/$defs/WriteBinding"},"type":"array"}},"required":["kind","name","worker","input","output","inputBindings","writeBindings","timeoutMs","attempts"],"type":"object"},{"additionalProperties":false,"properties":{"attempts":{"maximum":9007199254740991,"minimum":1,"type":"integer"},"diagnostic":{"$ref":"#/$defs/PayloadType"},"input":{"$ref":"#/$defs/PayloadType"},"inputBindings":{"items":{"$ref":"#/$defs/InputBinding"},"type":"array"},"kind":{"const":"verifier","type":"string"},"name":{"maxLength":128,"minLength":1,"pattern":"^[A-Za-z_][A-Za-z0-9_.-]*$","type":"string"},"output":{"$ref":"#/$defs/PayloadType"},"signals":{"additionalProperties":{"items":{"maxLength":128,"minLength":1,"pattern":"^[A-Za-z_][A-Za-z0-9_.-]*$","type":"string"},"maxItems":4096,"minItems":1,"type":"array","uniqueItems":true},"propertyNames":{"maxLength":128,"minLength":1,"pattern":"^[A-Za-z_][A-Za-z0-9_.-]*$","type":"string"},"type":"object"},"timeoutMs":{"maximum":9007199254740991,"minimum":1,"type":"integer"},"worker":{"maxLength":256,"pattern":"^[A-Za-z_][A-Za-z0-9_.-]*@[1-9][0-9]*$","type":"string"},"writeBindings":{"items":{"$ref":"#/$defs/WriteBinding"},"type":"array"}},"required":["kind","name","worker","input","output","inputBindings","writeBindings","timeoutMs","attempts","signals","diagnostic"],"type":"object"},{"additionalProperties":false,"properties":{"children":{"$ref":"#/$defs/NonEmptyVec_of_GraphNode"},"kind":{"const":"seq","type":"string"},"name":{"maxLength":128,"minLength":1,"pattern":"^[A-Za-z_][A-Za-z0-9_.-]*$","type":"string"},"promotedStatePaths":{"items":{"items":{"maxLength":128,"minLength":1,"pattern":"^[A-Za-z_][A-Za-z0-9_.-]*$","type":"string"},"maxItems":64,"minItems":1,"type":"array"},"type":"array"},"state":{"$ref":"#/$defs/PayloadType"}},"required":["kind","name","state","children","promotedStatePaths"],"type":"object"},{"additionalProperties":false,"properties":{"branches":{"$ref":"#/$defs/NonEmptyVec_of_ChoiceBranch"},"kind":{"const":"choice","type":"string"},"name":{"maxLength":128,"minLength":1,"pattern":"^[A-Za-z_][A-Za-z0-9_.-]*$","type":"string"},"otherwise":{"anyOf":[{"$ref":"#/$defs/GraphNode"},{"type":"null"}]},"promotedStatePaths":{"items":{"items":{"maxLength":128,"minLength":1,"pattern":"^[A-Za-z_][A-Za-z0-9_.-]*$","type":"string"},"maxItems":64,"minItems":1,"type":"array"},"type":"array"},"state":{"$ref":"#/$defs/PayloadType"}},"required":["kind","name","state","branches","promotedStatePaths"],"type":"object"},{"additionalProperties":false,"properties":{"branches":{"$ref":"#/$defs/NonEmptyVec_of_GraphNode"},"join":{"$ref":"#/$defs/Join"},"kind":{"const":"par","type":"string"},"name":{"maxLength":128,"minLength":1,"pattern":"^[A-Za-z_][A-Za-z0-9_.-]*$","type":"string"},"promotedStatePaths":{"items":{"items":{"maxLength":128,"minLength":1,"pattern":"^[A-Za-z_][A-Za-z0-9_.-]*$","type":"string"},"maxItems":64,"minItems":1,"type":"array"},"type":"array"},"state":{"$ref":"#/$defs/PayloadType"}},"required":["kind","name","state","branches","promotedStatePaths","join"],"type":"object"},{"additionalProperties":false,"properties":{"body":{"$ref":"#/$defs/GraphNode"},"kind":{"const":"loop","type":"string"},"maxIterations":{"maximum":9007199254740991,"minimum":1,"type":"integer"},"name":{"maxLength":128,"minLength":1,"pattern":"^[A-Za-z_][A-Za-z0-9_.-]*$","type":"string"},"promotedStatePaths":{"items":{"items":{"maxLength":128,"minLength":1,"pattern":"^[A-Za-z_][A-Za-z0-9_.-]*$","type":"string"},"maxItems":64,"minItems":1,"type":"array"},"type":"array"},"state":{"$ref":"#/$defs/PayloadType"},"until":{"$ref":"#/$defs/Guard"}},"required":["kind","name","state","body","until","maxIterations","promotedStatePaths"],"type":"object"},{"additionalProperties":false,"properties":{"body":{"$ref":"#/$defs/GraphNode"},"kind":{"const":"map","type":"string"},"maxItems":{"maximum":9007199254740991,"minimum":1,"type":"integer"},"name":{"maxLength":128,"minLength":1,"pattern":"^[A-Za-z_][A-Za-z0-9_.-]*$","type":"string"},"over":{"$ref":"#/$defs/DataSelector"},"promotedStatePaths":{"items":{"items":{"maxLength":128,"minLength":1,"pattern":"^[A-Za-z_][A-Za-z0-9_.-]*$","type":"string"},"maxItems":64,"minItems":1,"type":"array"},"type":"array"},"state":{"$ref":"#/$defs/PayloadType"}},"required":["kind","name","state","body","over","maxItems","promotedStatePaths"],"type":"object"},{"additionalProperties":false,"properties":{"bindings":{"items":{"$ref":"#/$defs/InputBinding"},"type":"array"},"kind":{"const":"succeed","type":"string"},"name":{"maxLength":128,"minLength":1,"pattern":"^[A-Za-z_][A-Za-z0-9_.-]*$","type":"string"},"output":{"$ref":"#/$defs/PayloadType"}},"required":["kind","name","output","bindings"],"type":"object"},{"additionalProperties":false,"properties":{"kind":{"const":"fail","type":"string"},"name":{"maxLength":128,"minLength":1,"pattern":"^[A-Za-z_][A-Za-z0-9_.-]*$","type":"string"},"reason":{"maxLength":128,"minLength":1,"pattern":"^(?!unhandled$)[A-Za-z_][A-Za-z0-9_.-]*$","type":"string"}},"required":["kind","name","reason"],"type":"object"}]},"GraphProfile":{"enum":["openengine.graph.full/v1","openengine.graph.single-worker/v1"],"type":"string"},"GraphSpec":{"additionalProperties":false,"properties":{"initialInput":{"$ref":"#/$defs/PayloadType"},"policy":{"$ref":"#/$defs/PolicyBinding"},"profile":{"$ref":"#/$defs/GraphProfile"},"root":{"$ref":"#/$defs/GraphNode"}},"required":["profile","initialInput","policy","root"],"type":"object"},"Guard":{"oneOf":[{"additionalProperties":false,"properties":{"kind":{"const":"in","type":"string"},"labels":{"items":{"maxLength":128,"minLength":1,"pattern":"^[A-Za-z_][A-Za-z0-9_.-]*$","type":"string"},"maxItems":4096,"minItems":1,"type":"array","uniqueItems":true},"value":{"$ref":"#/$defs/ControlSelector"}},"required":["kind","value","labels"],"type":"object"},{"additionalProperties":false,"properties":{"guards":{"$ref":"#/$defs/NonEmptyVec_of_Guard"},"kind":{"const":"all","type":"string"}},"required":["kind","guards"],"type":"object"},{"additionalProperties":false,"properties":{"guards":{"$ref":"#/$defs/NonEmptyVec_of_Guard"},"kind":{"const":"any","type":"string"}},"required":["kind","guards"],"type":"object"},{"additionalProperties":false,"properties":{"guard":{"$ref":"#/$defs/Guard"},"kind":{"const":"not","type":"string"}},"required":["kind","guard"],"type":"object"},{"additionalProperties":false,"properties":{"count":{"maximum":9007199254740991,"minimum":1,"type":"integer"},"kind":{"const":"k_of_n","type":"string"},"labels":{"items":{"maxLength":128,"minLength":1,"pattern":"^[A-Za-z_][A-Za-z0-9_.-]*$","type":"string"},"maxItems":4096,"minItems":1,"type":"array","uniqueItems":true},"values":{"$ref":"#/$defs/NonEmptyVec_of_ControlSelector"}},"required":["kind","count","values","labels"],"type":"object"},{"additionalProperties":false,"properties":{"count":{"maximum":9007199254740991,"minimum":1,"type":"integer"},"kind":{"const":"k_of_map","type":"string"},"labels":{"items":{"maxLength":128,"minLength":1,"pattern":"^[A-Za-z_][A-Za-z0-9_.-]*$","type":"string"},"maxItems":4096,"minItems":1,"type":"array","uniqueItems":true},"value":{"$ref":"#/$defs/ControlSelector"}},"required":["kind","count","value","labels"],"type":"object"}]},"InitializeParams":{"additionalProperties":false,"properties":{"protocolVersion":{"const":"openengine.cluster/v1","type":"string"}},"required":["protocolVersion"],"type":"object"},"InitializeResult":{"properties":{"capabilities":{"$ref":"#/$defs/ServerCapabilities"},"protocolVersion":{"const":"openengine.cluster/v1","type":"string"},"status":{"$ref":"#/$defs/ClusterStatus"}},"required":["protocolVersion","capabilities","status"],"type":"object"},"InputBinding":{"additionalProperties":false,"properties":{"target":{"items":{"maxLength":128,"minLength":1,"pattern":"^[A-Za-z_][A-Za-z0-9_.-]*$","type":"string"},"maxItems":64,"minItems":1,"type":"array"},"value":{"$ref":"#/$defs/DataSelector"}},"required":["target","value"],"type":"object"},"Join":{"oneOf":[{"additionalProperties":false,"properties":{"kind":{"const":"all","type":"string"}},"required":["kind"],"type":"object"},{"additionalProperties":false,"properties":{"kind":{"const":"any","type":"string"}},"required":["kind"],"type":"object"},{"additionalProperties":false,"properties":{"count":{"maximum":9007199254740991,"minimum":1,"type":"integer"},"kind":{"const":"quorum","type":"string"}},"required":["kind","count"],"type":"object"},{"additionalProperties":false,"properties":{"kind":{"const":"first","type":"string"},"when":{"$ref":"#/$defs/Guard"}},"required":["kind","when"],"type":"object"}]},"JsonRpcError":{"properties":{"code":{"format":"int64","type":"integer"},"data":{"anyOf":[{"$ref":"#/$defs/DomainErrorData"},{"type":"null"}]},"message":{"type":"string"}},"required":["code","message"],"type":"object"},"JsonRpcErrorResponse":{"properties":{"error":{"$ref":"#/$defs/JsonRpcError"},"id":{"anyOf":[{"$ref":"#/$defs/RequestId"},{"type":"null"}]},"jsonrpc":{"type":"string"}},"required":["jsonrpc","error"],"type":"object"},"JsonRpcNotification":{"properties":{"jsonrpc":{"type":"string"},"method":{"type":"string"},"params":{"$ref":"#/$defs/EventNotification"}},"required":["jsonrpc","method","params"],"type":"object"},"JsonRpcNotification2":{"properties":{"jsonrpc":{"type":"string"},"method":{"type":"string"},"params":{"$ref":"#/$defs/SubscriptionCancelParams"}},"required":["jsonrpc","method","params"],"type":"object"},"JsonRpcNotification3":{"properties":{"jsonrpc":{"type":"string"},"method":{"type":"string"},"params":{"$ref":"#/$defs/SubscriptionClosedNotification"}},"required":["jsonrpc","method","params"],"type":"object"},"JsonRpcNotification4":{"properties":{"jsonrpc":{"type":"string"},"method":{"type":"string"},"params":{"$ref":"#/$defs/CancelRequestParams"}},"required":["jsonrpc","method","params"],"type":"object"},"JsonRpcNotification5":{"properties":{"jsonrpc":{"type":"string"},"method":{"type":"string"},"params":{"$ref":"#/$defs/LogEventNotification"}},"required":["jsonrpc","method","params"],"type":"object"},"JsonRpcNotification6":{"properties":{"jsonrpc":{"type":"string"},"method":{"type":"string"},"params":{"$ref":"#/$defs/LogsClosedNotification"}},"required":["jsonrpc","method","params"],"type":"object"},"JsonRpcNotification7":{"properties":{"jsonrpc":{"type":"string"},"method":{"type":"string"},"params":{"$ref":"#/$defs/AgentAttachEventNotification"}},"required":["jsonrpc","method","params"],"type":"object"},"JsonRpcNotification8":{"properties":{"jsonrpc":{"type":"string"},"method":{"type":"string"},"params":{"$ref":"#/$defs/AgentAttachClosedNotification"}},"required":["jsonrpc","method","params"],"type":"object"},"JsonRpcRequest":{"properties":{"id":{"$ref":"#/$defs/RequestId"},"jsonrpc":{"type":"string"},"method":{"type":"string"},"params":{"$ref":"#/$defs/InitializeParams"}},"required":["jsonrpc","id","method","params"],"type":"object"},"JsonRpcRequest10":{"properties":{"id":{"$ref":"#/$defs/RequestId"},"jsonrpc":{"type":"string"},"method":{"type":"string"},"params":{"$ref":"#/$defs/WatchParams"}},"required":["jsonrpc","id","method","params"],"type":"object"},"JsonRpcRequest11":{"properties":{"id":{"$ref":"#/$defs/RequestId"},"jsonrpc":{"type":"string"},"method":{"type":"string"},"params":{"$ref":"#/$defs/LogsParams"}},"required":["jsonrpc","id","method","params"],"type":"object"},"JsonRpcRequest12":{"properties":{"id":{"$ref":"#/$defs/RequestId"},"jsonrpc":{"type":"string"},"method":{"type":"string"},"params":{"$ref":"#/$defs/AgentAttachParams"}},"required":["jsonrpc","id","method","params"],"type":"object"},"JsonRpcRequest2":{"properties":{"id":{"$ref":"#/$defs/RequestId"},"jsonrpc":{"type":"string"},"method":{"type":"string"},"params":{"$ref":"#/$defs/PlanParams"}},"required":["jsonrpc","id","method","params"],"type":"object"},"JsonRpcRequest3":{"properties":{"id":{"$ref":"#/$defs/RequestId"},"jsonrpc":{"type":"string"},"method":{"type":"string"},"params":{"$ref":"#/$defs/ApplyParams"}},"required":["jsonrpc","id","method","params"],"type":"object"},"JsonRpcRequest4":{"properties":{"id":{"$ref":"#/$defs/RequestId"},"jsonrpc":{"type":"string"},"method":{"type":"string"},"params":{"$ref":"#/$defs/GetParams"}},"required":["jsonrpc","id","method","params"],"type":"object"},"JsonRpcRequest5":{"properties":{"id":{"$ref":"#/$defs/RequestId"},"jsonrpc":{"type":"string"},"method":{"type":"string"},"params":{"$ref":"#/$defs/UpdateParams"}},"required":["jsonrpc","id","method","params"],"type":"object"},"JsonRpcRequest6":{"properties":{"id":{"$ref":"#/$defs/RequestId"},"jsonrpc":{"type":"string"},"method":{"type":"string"},"params":{"$ref":"#/$defs/StopParams"}},"required":["jsonrpc","id","method","params"],"type":"object"},"JsonRpcRequest7":{"properties":{"id":{"$ref":"#/$defs/RequestId"},"jsonrpc":{"type":"string"},"method":{"type":"string"},"params":{"$ref":"#/$defs/RetryParams"}},"required":["jsonrpc","id","method","params"],"type":"object"},"JsonRpcRequest8":{"properties":{"id":{"$ref":"#/$defs/RequestId"},"jsonrpc":{"type":"string"},"method":{"type":"string"},"params":{"$ref":"#/$defs/ResubmitParams"}},"required":["jsonrpc","id","method","params"],"type":"object"},"JsonRpcRequest9":{"properties":{"id":{"$ref":"#/$defs/RequestId"},"jsonrpc":{"type":"string"},"method":{"type":"string"},"params":{"$ref":"#/$defs/DeleteParams"}},"required":["jsonrpc","id","method","params"],"type":"object"},"JsonRpcResponse":{"anyOf":[{"$ref":"#/$defs/JsonRpcSuccess"},{"$ref":"#/$defs/JsonRpcErrorResponse"}]},"JsonRpcResponse10":{"anyOf":[{"$ref":"#/$defs/JsonRpcSuccess10"},{"$ref":"#/$defs/JsonRpcErrorResponse"}]},"JsonRpcResponse11":{"anyOf":[{"$ref":"#/$defs/JsonRpcSuccess11"},{"$ref":"#/$defs/JsonRpcErrorResponse"}]},"JsonRpcResponse12":{"anyOf":[{"$ref":"#/$defs/JsonRpcSuccess12"},{"$ref":"#/$defs/JsonRpcErrorResponse"}]},"JsonRpcResponse2":{"anyOf":[{"$ref":"#/$defs/JsonRpcSuccess2"},{"$ref":"#/$defs/JsonRpcErrorResponse"}]},"JsonRpcResponse3":{"anyOf":[{"$ref":"#/$defs/JsonRpcSuccess3"},{"$ref":"#/$defs/JsonRpcErrorResponse"}]},"JsonRpcResponse4":{"anyOf":[{"$ref":"#/$defs/JsonRpcSuccess4"},{"$ref":"#/$defs/JsonRpcErrorResponse"}]},"JsonRpcResponse5":{"anyOf":[{"$ref":"#/$defs/JsonRpcSuccess5"},{"$ref":"#/$defs/JsonRpcErrorResponse"}]},"JsonRpcResponse6":{"anyOf":[{"$ref":"#/$defs/JsonRpcSuccess6"},{"$ref":"#/$defs/JsonRpcErrorResponse"}]},"JsonRpcResponse7":{"anyOf":[{"$ref":"#/$defs/JsonRpcSuccess7"},{"$ref":"#/$defs/JsonRpcErrorResponse"}]},"JsonRpcResponse8":{"anyOf":[{"$ref":"#/$defs/JsonRpcSuccess8"},{"$ref":"#/$defs/JsonRpcErrorResponse"}]},"JsonRpcResponse9":{"anyOf":[{"$ref":"#/$defs/JsonRpcSuccess9"},{"$ref":"#/$defs/JsonRpcErrorResponse"}]},"JsonRpcSuccess":{"properties":{"id":{"$ref":"#/$defs/RequestId"},"jsonrpc":{"type":"string"},"result":{"$ref":"#/$defs/InitializeResult"}},"required":["jsonrpc","id","result"],"type":"object"},"JsonRpcSuccess10":{"properties":{"id":{"$ref":"#/$defs/RequestId"},"jsonrpc":{"type":"string"},"result":{"$ref":"#/$defs/WatchResult"}},"required":["jsonrpc","id","result"],"type":"object"},"JsonRpcSuccess11":{"properties":{"id":{"$ref":"#/$defs/RequestId"},"jsonrpc":{"type":"string"},"result":{"$ref":"#/$defs/LogsResult"}},"required":["jsonrpc","id","result"],"type":"object"},"JsonRpcSuccess12":{"properties":{"id":{"$ref":"#/$defs/RequestId"},"jsonrpc":{"type":"string"},"result":{"$ref":"#/$defs/AgentAttachResult"}},"required":["jsonrpc","id","result"],"type":"object"},"JsonRpcSuccess2":{"properties":{"id":{"$ref":"#/$defs/RequestId"},"jsonrpc":{"type":"string"},"result":{"$ref":"#/$defs/PlanResult"}},"required":["jsonrpc","id","result"],"type":"object"},"JsonRpcSuccess3":{"properties":{"id":{"$ref":"#/$defs/RequestId"},"jsonrpc":{"type":"string"},"result":{"$ref":"#/$defs/ApplyResult"}},"required":["jsonrpc","id","result"],"type":"object"},"JsonRpcSuccess4":{"properties":{"id":{"$ref":"#/$defs/RequestId"},"jsonrpc":{"type":"string"},"result":{"$ref":"#/$defs/GetResult"}},"required":["jsonrpc","id","result"],"type":"object"},"JsonRpcSuccess5":{"properties":{"id":{"$ref":"#/$defs/RequestId"},"jsonrpc":{"type":"string"},"result":{"$ref":"#/$defs/UpdateResult"}},"required":["jsonrpc","id","result"],"type":"object"},"JsonRpcSuccess6":{"properties":{"id":{"$ref":"#/$defs/RequestId"},"jsonrpc":{"type":"string"},"result":{"$ref":"#/$defs/StopResult"}},"required":["jsonrpc","id","result"],"type":"object"},"JsonRpcSuccess7":{"properties":{"id":{"$ref":"#/$defs/RequestId"},"jsonrpc":{"type":"string"},"result":{"$ref":"#/$defs/RetryResult"}},"required":["jsonrpc","id","result"],"type":"object"},"JsonRpcSuccess8":{"properties":{"id":{"$ref":"#/$defs/RequestId"},"jsonrpc":{"type":"string"},"result":{"$ref":"#/$defs/ResubmitResult"}},"required":["jsonrpc","id","result"],"type":"object"},"JsonRpcSuccess9":{"properties":{"id":{"$ref":"#/$defs/RequestId"},"jsonrpc":{"type":"string"},"result":{"$ref":"#/$defs/DeleteResult"}},"required":["jsonrpc","id","result"],"type":"object"},"Labels":{"additionalProperties":{"maxLength":256,"minLength":1,"pattern":"^[^\\u0000-\\u001f\\u007f-\\u009f]+$","type":"string"},"maxProperties":64,"propertyNames":{"maxLength":256,"minLength":1,"pattern":"^[^\\u0000-\\u001f\\u007f-\\u009f]+$","type":"string"},"type":"object"},"LogEventNotification":{"$ref":"#/$defs/LogEventNotificationWire"},"LogEventNotificationWire":{"additionalProperties":false,"properties":{"record":{"$ref":"#/$defs/LogRecord"},"subscriptionId":{"type":"string"}},"required":["subscriptionId","record"],"type":"object"},"LogLevel":{"enum":["trace","debug","info","warn","error"],"type":"string"},"LogRecord":{"additionalProperties":false,"description":"The closed public log record shape: a level, a bounded target, and a bounded (possibly\nredacted) message. No raw bytes, reasoning, tools, credentials, env, or provider/session IDs\nare representable.","properties":{"level":{"$ref":"#/$defs/LogLevel"},"message":{"maxLength":16384,"pattern":"^[^\\u0000-\\u001f\\u007f-\\u009f]*$","type":"string"},"target":{"maxLength":128,"minLength":1,"pattern":"^[^\\u0000-\\u001f\\u007f-\\u009f]+$","type":"string"}},"required":["level","target","message"],"type":"object"},"LogsClosedNotification":{"additionalProperties":false,"description":"Wire body of the terminal `subscription/closed` server notification for a `logs` subscription.\nDeliberately carries no cursor field -- `logs` gives a type-level \"cursorless\" guarantee, unlike\n[`crate::SubscriptionClosedNotification`].","properties":{"reason":{"$ref":"#/$defs/SubscriptionCloseReason"},"subscriptionId":{"type":"string"}},"required":["subscriptionId","reason"],"type":"object"},"LogsParams":{"additionalProperties":false,"description":"`logs` establishment parameters. v1 has zero caller filters: this is deliberately empty and\nclosed, rejecting any unknown field.","type":"object"},"LogsResult":{"additionalProperties":false,"description":"The `logs` establishment result: only a `subscriptionId`. Deliberately carries no `runId` or\n`atCursor` -- `logs` is not run-scoped and has no cursor.","properties":{"subscriptionId":{"type":"string"}},"required":["subscriptionId"],"type":"object"},"NodeAddress":{"additionalProperties":false,"properties":{"attempt":{"maximum":9007199254740991,"minimum":1,"type":"integer"},"node":{"maxLength":128,"minLength":1,"pattern":"^[A-Za-z_][A-Za-z0-9_.-]*$","type":"string"}},"required":["node","attempt"],"type":"object"},"NodeOutputChannel":{"enum":["out","signal","diagnostic"],"type":"string"},"NodeOutputSelector":{"additionalProperties":false,"properties":{"channel":{"$ref":"#/$defs/NodeOutputChannel"},"node":{"maxLength":128,"minLength":1,"pattern":"^[A-Za-z_][A-Za-z0-9_.-]*$","type":"string"},"path":{"items":{"maxLength":128,"minLength":1,"pattern":"^[A-Za-z_][A-Za-z0-9_.-]*$","type":"string"},"maxItems":64,"minItems":1,"type":"array"}},"required":["node","channel","path"],"type":"object"},"NonEmptyVec_of_ChoiceBranch":{"items":{"$ref":"#/$defs/ChoiceBranch"},"maxItems":4096,"minItems":1,"type":"array"},"NonEmptyVec_of_ControlSelector":{"items":{"$ref":"#/$defs/ControlSelector"},"maxItems":4096,"minItems":1,"type":"array"},"NonEmptyVec_of_FieldPath":{"items":{"items":{"maxLength":128,"minLength":1,"pattern":"^[A-Za-z_][A-Za-z0-9_.-]*$","type":"string"},"maxItems":64,"minItems":1,"type":"array"},"maxItems":4096,"minItems":1,"type":"array"},"NonEmptyVec_of_GraphNode":{"items":{"$ref":"#/$defs/GraphNode"},"maxItems":4096,"minItems":1,"type":"array"},"NonEmptyVec_of_Guard":{"items":{"$ref":"#/$defs/Guard"},"maxItems":4096,"minItems":1,"type":"array"},"NonEmptyVec_of_NodeName":{"items":{"maxLength":128,"minLength":1,"pattern":"^[A-Za-z_][A-Za-z0-9_.-]*$","type":"string"},"maxItems":4096,"minItems":1,"type":"array"},"OperationalStatus":{"additionalProperties":false,"properties":{"dispatchState":{"$ref":"#/$defs/DispatchState"},"inFlight":{"format":"uint32","minimum":0,"type":"integer"},"labels":{"$ref":"#/$defs/Labels"},"logLevel":{"$ref":"#/$defs/LogLevel"},"stopMode":{"anyOf":[{"$ref":"#/$defs/StopMode"},{"type":"null"}]}},"required":["labels","logLevel","dispatchState","inFlight"],"type":"object"},"PayloadType":{"oneOf":[{"additionalProperties":false,"properties":{"kind":{"const":"null","type":"string"}},"required":["kind"],"type":"object"},{"additionalProperties":false,"properties":{"kind":{"const":"boolean","type":"string"}},"required":["kind"],"type":"object"},{"additionalProperties":false,"properties":{"kind":{"const":"integer","type":"string"}},"required":["kind"],"type":"object"},{"additionalProperties":false,"properties":{"kind":{"const":"number","type":"string"}},"required":["kind"],"type":"object"},{"additionalProperties":false,"properties":{"kind":{"const":"string","type":"string"}},"required":["kind"],"type":"object"},{"additionalProperties":false,"properties":{"fields":{"additionalProperties":{"$ref":"#/$defs/RecordField"},"propertyNames":{"maxLength":128,"minLength":1,"pattern":"^[A-Za-z_][A-Za-z0-9_.-]*$","type":"string"},"type":"object"},"kind":{"const":"record","type":"string"}},"required":["kind","fields"],"type":"object"},{"additionalProperties":false,"properties":{"items":{"$ref":"#/$defs/PayloadType"},"kind":{"const":"array","type":"string"}},"required":["kind","items"],"type":"object"},{"additionalProperties":false,"properties":{"kind":{"const":"enum","type":"string"},"values":{"items":{"maxLength":128,"minLength":1,"pattern":"^[A-Za-z_][A-Za-z0-9_.-]*$","type":"string"},"maxItems":4096,"minItems":1,"type":"array","uniqueItems":true}},"required":["kind","values"],"type":"object"}]},"Phase":{"enum":["empty","admitting","running","finished","deleting"],"type":"string"},"PlanParams":{"additionalProperties":false,"properties":{"graph":{"$ref":"#/$defs/GraphSpec"}},"required":["graph"],"type":"object"},"PlanResult":{"additionalProperties":false,"properties":{"bounds":{"anyOf":[{"$ref":"#/$defs/StructuralBounds"},{"type":"null"}]},"diagnostics":{"items":{"$ref":"#/$defs/GraphDiagnostic"},"type":"array"},"ok":{"type":"boolean"}},"required":["ok","diagnostics"],"type":"object"},"PolicyBinding":{"additionalProperties":false,"properties":{"default":{"$ref":"#/$defs/PolicyDefault"},"policy":{"maxLength":256,"pattern":"^[A-Za-z_][A-Za-z0-9_.-]*@[1-9][0-9]*$","type":"string"}},"required":["policy","default"],"type":"object"},"PolicyDefault":{"enum":["deny"],"type":"string"},"RecordField":{"additionalProperties":false,"properties":{"required":{"type":"boolean"},"type":{"$ref":"#/$defs/PayloadType"}},"required":["type","required"],"type":"object"},"RedactionClass":{"enum":["public","internal","confidential","restricted"],"type":"string"},"RequestId":{"anyOf":[{"type":"string"},{"format":"int64","type":"integer"}]},"ResubmitParams":{"additionalProperties":false,"properties":{"idempotencyKey":{"maxLength":256,"minLength":1,"pattern":"^[^\\u0000-\\u001f\\u007f-\\u009f]+$","type":"string"},"ifGeneration":{"maximum":9007199254740991,"minimum":0,"type":"integer"},"ifRunId":{"type":"string"},"replacementInput":true},"required":["ifGeneration","ifRunId","idempotencyKey"],"type":"object"},"ResubmitResult":{"additionalProperties":false,"properties":{"atCursor":{"type":"string"},"deduped":{"type":"boolean"},"generation":{"maximum":9007199254740991,"minimum":0,"type":"integer"},"operational":{"$ref":"#/$defs/OperationalStatus"},"phase":{"$ref":"#/$defs/Phase"},"priorRunId":{"type":"string"},"runId":{"type":"string"}},"required":["generation","priorRunId","runId","phase","operational","atCursor","deduped"],"type":"object"},"RetryParams":{"additionalProperties":false,"properties":{"idempotencyKey":{"maxLength":256,"minLength":1,"pattern":"^[^\\u0000-\\u001f\\u007f-\\u009f]+$","type":"string"},"ifGeneration":{"maximum":9007199254740991,"minimum":0,"type":"integer"}},"required":["ifGeneration","idempotencyKey"],"type":"object"},"RetryResult":{"additionalProperties":false,"properties":{"atCursor":{"type":"string"},"deduped":{"type":"boolean"},"generation":{"maximum":9007199254740991,"minimum":0,"type":"integer"},"operational":{"$ref":"#/$defs/OperationalStatus"},"phase":{"$ref":"#/$defs/Phase"},"retriedTurnId":{"type":"string"},"retryTurnId":{"type":"string"},"runId":{"type":"string"}},"required":["generation","runId","phase","retriedTurnId","retryTurnId","operational","atCursor","deduped"],"type":"object"},"ServerCapabilities":{"additionalProperties":false,"properties":{"agentAttach":{"default":false,"type":"boolean"},"graphProfiles":{"default":[],"items":{"$ref":"#/$defs/GraphProfile"},"maxItems":2,"not":{"minItems":2,"prefixItems":[{"const":"openengine.graph.single-worker/v1"},{"const":"openengine.graph.full/v1"}]},"type":"array","uniqueItems":true},"logs":{"default":false,"type":"boolean"}},"type":"object"},"StopMode":{"enum":["drain","force"],"type":"string"},"StopParams":{"additionalProperties":false,"properties":{"idempotencyKey":{"maxLength":256,"minLength":1,"pattern":"^[^\\u0000-\\u001f\\u007f-\\u009f]+$","type":"string"},"ifGeneration":{"maximum":9007199254740991,"minimum":0,"type":"integer"},"mode":{"$ref":"#/$defs/StopMode"}},"required":["mode","ifGeneration","idempotencyKey"],"type":"object"},"StopResult":{"additionalProperties":false,"properties":{"acceptedMode":{"$ref":"#/$defs/StopMode"},"atCursor":{"type":"string"},"deduped":{"type":"boolean"},"effectiveMode":{"$ref":"#/$defs/StopMode"},"generation":{"maximum":9007199254740991,"minimum":0,"type":"integer"},"operational":{"$ref":"#/$defs/OperationalStatus"},"phase":{"$ref":"#/$defs/Phase"},"runId":{"type":"string"}},"required":["generation","runId","phase","acceptedMode","effectiveMode","operational","atCursor","deduped"],"type":"object"},"StructuralBounds":{"additionalProperties":false,"properties":{"attemptsPerNode":{"additionalProperties":{"maximum":9007199254740991,"minimum":1,"type":"integer"},"propertyNames":{"maxLength":128,"minLength":1,"pattern":"^[A-Za-z_][A-Za-z0-9_.-]*$","type":"string"},"type":"object"},"maxNodeExecutions":{"maximum":9007199254740991,"minimum":1,"type":"integer"},"peakConcurrency":{"maximum":9007199254740991,"minimum":1,"type":"integer"},"termination":{"$ref":"#/$defs/TerminationWitness"}},"required":["termination","maxNodeExecutions","peakConcurrency","attemptsPerNode"],"type":"object"},"SubscriptionCancelParams":{"additionalProperties":false,"description":"Wire body of the generic `subscription/cancel` client notification.","properties":{"subscriptionId":{"type":"string"}},"required":["subscriptionId"],"type":"object"},"SubscriptionCloseReason":{"enum":["done","SLOW_CONSUMER"],"type":"string"},"SubscriptionClosedNotification":{"additionalProperties":false,"description":"Wire body of the terminal `subscription/closed` server notification.","properties":{"lastDeliveredCursor":{"type":["string","null"]},"reason":{"$ref":"#/$defs/SubscriptionCloseReason"},"subscriptionId":{"type":"string"}},"required":["subscriptionId","reason"],"type":"object"},"TerminationWitness":{"oneOf":[{"additionalProperties":false,"properties":{"kind":{"const":"acyclic","type":"string"},"order":{"$ref":"#/$defs/NonEmptyVec_of_NodeName"}},"required":["kind","order"],"type":"object"},{"additionalProperties":false,"properties":{"kind":{"const":"bounded","type":"string"},"maxIterations":{"maximum":9007199254740991,"minimum":1,"type":"integer"},"ranking":{"$ref":"#/$defs/NonEmptyVec_of_FieldPath"}},"required":["kind","ranking","maxIterations"],"type":"object"}]},"UpdateParams":{"additionalProperties":false,"anyOf":[{"required":["labels"]},{"required":["logLevel"]},{"required":["suspended"]}],"properties":{"idempotencyKey":{"maxLength":256,"minLength":1,"pattern":"^[^\\u0000-\\u001f\\u007f-\\u009f]+$","type":"string"},"ifGeneration":{"maximum":9007199254740991,"minimum":0,"type":"integer"},"labels":{"$ref":"#/$defs/Labels"},"logLevel":{"$ref":"#/$defs/LogLevel"},"suspended":{"type":"boolean"}},"required":["ifGeneration","idempotencyKey"],"type":"object"},"UpdateResult":{"additionalProperties":false,"properties":{"atCursor":{"type":"string"},"deduped":{"type":"boolean"},"generation":{"maximum":9007199254740991,"minimum":0,"type":"integer"},"operational":{"$ref":"#/$defs/OperationalStatus"},"phase":{"$ref":"#/$defs/Phase"},"runId":{"type":"string"}},"required":["generation","runId","phase","operational","atCursor","deduped"],"type":"object"},"WatchEvent":{"description":"The closed public event algebra. `Phase` folds the observable cluster status (admission\ncommit, update, suspend/resume, stop-request); `NodeBegin`/`NodeEnd` are a testkit-only\nsynthetic hook decoupled from the real dispatch/lease turn mechanism, since no native graph\nexecutor exists yet; `Bookmark` advances the cursor without changing folded public state;\n`Fault` carries a durable, backend-neutral projected `BackendFault`: it correlates to the\nenclosing `EventNotification.run_id` plus its own optional opaque `executionRef`, and its\nordering/emission never itself authorizes a retry or changes terminal semantics -- it folds to\nno public status change, exactly like `Bookmark`; `Finished` is always the last event for a\nrun.","oneOf":[{"additionalProperties":false,"properties":{"admission":{"anyOf":[{"$ref":"#/$defs/AdmissionTransition"},{"type":"null"}]},"status":{"$ref":"#/$defs/ClusterStatus"},"type":{"const":"phase","type":"string"}},"required":["type","status"],"type":"object"},{"additionalProperties":false,"properties":{"input":true,"node":{"$ref":"#/$defs/NodeAddress"},"type":{"const":"node_begin","type":"string"}},"required":["type","node","input"],"type":"object"},{"additionalProperties":false,"properties":{"node":{"$ref":"#/$defs/NodeAddress"},"outcome":{"$ref":"#/$defs/WorkerOutcome"},"type":{"const":"node_end","type":"string"}},"required":["type","node","outcome"],"type":"object"},{"additionalProperties":false,"properties":{"type":{"const":"bookmark","type":"string"}},"required":["type"],"type":"object"},{"additionalProperties":false,"properties":{"fault":{"$ref":"#/$defs/BackendFault"},"type":{"const":"fault","type":"string"}},"required":["type","fault"],"type":"object"},{"additionalProperties":false,"properties":{"final_status":{"$ref":"#/$defs/ClusterStatus"},"stop_mode":{"anyOf":[{"$ref":"#/$defs/StopMode"},{"type":"null"}]},"type":{"const":"finished","type":"string"}},"required":["type","final_status"],"type":"object"}]},"WatchParams":{"additionalProperties":false,"properties":{"fromCursor":{"default":null,"type":["string","null"]},"runId":{"default":null,"type":["string","null"]}},"type":"object"},"WatchResult":{"properties":{"atCursor":{"type":["string","null"]},"runId":{"type":["string","null"]},"subscriptionId":{"type":"string"}},"required":["subscriptionId"],"type":"object"},"WorkerErrorCode":{"enum":["timeout","crash","malformed","refusal"],"type":"string"},"WorkerFailureReason":{"enum":["declared_failure","policy_denied","interactive_input_required","authentication_required","malformed_result"],"type":"string"},"WorkerOutcome":{"allOf":[{"$ref":"#/$defs/WorkerOutcomeWire"},{"if":{"properties":{"status":{"const":"error"}},"required":["status"]},"then":{"oneOf":[{"properties":{"reason":{"const":"declared_failure"}},"required":["reason"]},{"properties":{"code":{"const":"refusal"},"reason":{"enum":["policy_denied","interactive_input_required","authentication_required"]}},"required":["code","reason"]},{"properties":{"code":{"const":"malformed"},"reason":{"const":"malformed_result"}},"required":["code","reason"]}]}}]},"WorkerOutcomeWire":{"oneOf":[{"additionalProperties":false,"properties":{"artifacts":{"items":{"$ref":"#/$defs/ArtifactRef"},"type":"array"},"output":true,"status":{"const":"verified","type":"string"}},"required":["status","output","artifacts"],"type":"object"},{"additionalProperties":false,"properties":{"artifacts":{"items":{"$ref":"#/$defs/ArtifactRef"},"type":"array"},"diagnostic":true,"output":true,"signals":{"additionalProperties":{"maxLength":128,"minLength":1,"pattern":"^[A-Za-z_][A-Za-z0-9_.-]*$","type":"string"},"propertyNames":{"maxLength":128,"minLength":1,"pattern":"^[A-Za-z_][A-Za-z0-9_.-]*$","type":"string"},"type":"object"},"status":{"const":"verifier","type":"string"}},"required":["status","output","signals","diagnostic","artifacts"],"type":"object"},{"additionalProperties":false,"properties":{"code":{"$ref":"#/$defs/WorkerErrorCode"},"reason":{"$ref":"#/$defs/WorkerFailureReason"},"status":{"const":"error","type":"string"}},"required":["status","code","reason"],"type":"object"}]},"WriteBinding":{"additionalProperties":false,"properties":{"target":{"items":{"maxLength":128,"minLength":1,"pattern":"^[A-Za-z_][A-Za-z0-9_.-]*$","type":"string"},"maxItems":64,"minItems":1,"type":"array"},"value":{"$ref":"#/$defs/NodeOutputSelector"}},"required":["value","target"],"type":"object"}},"$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"agent_attach_closed_notification":{"$ref":"#/$defs/JsonRpcNotification8"},"agent_attach_event_notification":{"$ref":"#/$defs/JsonRpcNotification7"},"agent_attach_request":{"$ref":"#/$defs/JsonRpcRequest12"},"agent_attach_response":{"$ref":"#/$defs/JsonRpcResponse12"},"apply_request":{"$ref":"#/$defs/JsonRpcRequest3"},"apply_response":{"$ref":"#/$defs/JsonRpcResponse3"},"cancel_request_notification":{"$ref":"#/$defs/JsonRpcNotification4"},"delete_request":{"$ref":"#/$defs/JsonRpcRequest9"},"delete_response":{"$ref":"#/$defs/JsonRpcResponse9"},"event_notification":{"$ref":"#/$defs/JsonRpcNotification"},"get_request":{"$ref":"#/$defs/JsonRpcRequest4"},"get_response":{"$ref":"#/$defs/JsonRpcResponse4"},"initialize_request":{"$ref":"#/$defs/JsonRpcRequest"},"initialize_response":{"$ref":"#/$defs/JsonRpcResponse"},"log_event_notification":{"$ref":"#/$defs/JsonRpcNotification5"},"logs_closed_notification":{"$ref":"#/$defs/JsonRpcNotification6"},"logs_request":{"$ref":"#/$defs/JsonRpcRequest11"},"logs_response":{"$ref":"#/$defs/JsonRpcResponse11"},"plan_request":{"$ref":"#/$defs/JsonRpcRequest2"},"plan_response":{"$ref":"#/$defs/JsonRpcResponse2"},"resubmit_request":{"$ref":"#/$defs/JsonRpcRequest8"},"resubmit_response":{"$ref":"#/$defs/JsonRpcResponse8"},"retry_request":{"$ref":"#/$defs/JsonRpcRequest7"},"retry_response":{"$ref":"#/$defs/JsonRpcResponse7"},"stop_request":{"$ref":"#/$defs/JsonRpcRequest6"},"stop_response":{"$ref":"#/$defs/JsonRpcResponse6"},"subscription_cancel_notification":{"$ref":"#/$defs/JsonRpcNotification2"},"subscription_closed_notification":{"$ref":"#/$defs/JsonRpcNotification3"},"update_request":{"$ref":"#/$defs/JsonRpcRequest5"},"update_response":{"$ref":"#/$defs/JsonRpcResponse5"},"watch_request":{"$ref":"#/$defs/JsonRpcRequest10"},"watch_response":{"$ref":"#/$defs/JsonRpcResponse10"}},"required":["initialize_request","initialize_response","plan_request","plan_response","apply_request","apply_response","get_request","get_response","update_request","update_response","stop_request","stop_response","retry_request","retry_response","resubmit_request","resubmit_response","delete_request","delete_response","watch_request","watch_response","event_notification","subscription_cancel_notification","subscription_closed_notification","cancel_request_notification","logs_request","logs_response","log_event_notification","logs_closed_notification","agent_attach_request","agent_attach_response","agent_attach_event_notification","agent_attach_closed_notification"],"title":"ImplementedProtocolSchema","type":"object"};
@@ -0,0 +1,183 @@
1
+ // Generated by scripts/generate-cluster-types.js from the checked-in Cluster Protocol v1 artifacts.
2
+ // Do not edit this file by hand. Run npm run protocol:generate.
3
+
4
+ export const JSON_RPC_VERSION = "2.0" as const;
5
+ export const PROTOCOL_VERSION = "openengine.cluster/v1" as const;
6
+ export const SUBSCRIPTION_QUEUE_CAPACITY = 1024 as const;
7
+ export const MAX_FRAME_BYTES = 1048576 as const;
8
+ export const CLUSTER_METHODS = ["initialize","plan","apply","update","stop","retry","resubmit","delete","get","watch","logs","agent/attach"] as const;
9
+ export type ClusterMethod = (typeof CLUSTER_METHODS)[number];
10
+
11
+ export const UNARY_METHODS = ["initialize","plan","apply","update","stop","retry","resubmit","delete","get"] as const;
12
+ export type UnaryClusterMethod = (typeof UNARY_METHODS)[number];
13
+ export const SUBSCRIPTION_METHODS = ["watch","logs","agent/attach"] as const;
14
+ export type SubscriptionMethod = (typeof SUBSCRIPTION_METHODS)[number];
15
+ export const METHOD_RESULT_DEFINITIONS = {"initialize":"InitializeResult","plan":"PlanResult","apply":"ApplyResult","update":"UpdateResult","stop":"StopResult","retry":"RetryResult","resubmit":"ResubmitResult","delete":"DeleteResult","get":"GetResult","watch":"WatchResult","logs":"LogsResult","agent/attach":"AgentAttachResult"} as const;
16
+
17
+ export const JSON_RPC_ERROR_CODES = {
18
+ PARSE_ERROR: -32700,
19
+ INVALID_REQUEST: -32600,
20
+ METHOD_NOT_FOUND: -32601,
21
+ INVALID_PARAMS: -32602,
22
+ INTERNAL_ERROR: -32603,
23
+ APPLICATION_ERROR: -32000,
24
+ } as const;
25
+
26
+ export const DOMAIN_ERROR_CODES = ["NOT_FOUND","GONE","SLOW_CONSUMER","UNSUPPORTED_PROTOCOL_VERSION","INTERNAL_ERROR"] as const;
27
+
28
+ export type AdmissionTransition = { readonly "runId": string; readonly "seedInput": unknown; readonly "spec": GraphSpec; };
29
+ export type AgentAttachClosedNotification = { readonly "reason": SubscriptionCloseReason; readonly "subscriptionId": string; };
30
+ export type AgentAttachEvent = { readonly "type": "working"; } | { readonly "text": string; readonly "type": "output"; } | { readonly "type": "settled"; };
31
+ export type AgentAttachEventNotification = AgentAttachEventNotificationWire;
32
+ export type AgentAttachEventNotificationWire = { readonly "event": AgentAttachEvent; readonly "subscriptionId": string; };
33
+ export type AgentAttachParams = { readonly "execution": string; };
34
+ export type AgentAttachResult = { readonly "subscriptionId": string; };
35
+ export type ApplyParams = { readonly "dryRun"?: boolean; readonly "graph": GraphSpec; readonly "idempotencyKey"?: string; readonly "ifGeneration"?: number; readonly "input"?: unknown; };
36
+ export type ApplyResult = { readonly "deduped": boolean; readonly "diff"?: GraphDiff | null; readonly "generation"?: number | null; readonly "phase": Phase; readonly "runId"?: string | null; };
37
+ export type ArtifactLineage = { readonly "attempt": number; readonly "generation": number; readonly "runId": string; };
38
+ export type ArtifactProducer = { readonly "node": string; readonly "worker": string; };
39
+ export type ArtifactRef = { readonly "artifactId": string; readonly "byteLength": number; readonly "lineage": ArtifactLineage; readonly "mediaType": string; readonly "producer": ArtifactProducer; readonly "redaction": RedactionClass; readonly "sha256": string; readonly "typeId": string; };
40
+ export type BackendFault = BackendFaultWire;
41
+ export type BackendFaultWire = { readonly "action": FaultAction; readonly "code": FaultCode; readonly "consequence": FaultConsequence; readonly "eventId": string; readonly "executionRef"?: string | null; readonly "retry": FaultRetryDisposition; readonly "severity": FaultSeverity; readonly "source": ReadonlyArray<FaultSourceFrame>; readonly "summary": string; };
42
+ export type CancelRequestParams = { readonly "id": RequestId; };
43
+ export type ChoiceBranch = { readonly "node": GraphNode; readonly "when": Guard; };
44
+ export type ClusterStatus = { readonly "atCursor"?: string | null; readonly "currentRunId"?: string | null; readonly "observedGeneration"?: number | null; readonly "operational"?: OperationalStatus | null; readonly "phase": Phase; };
45
+ export type ControlSelector = { readonly "field"?: string | null; readonly "name": string; readonly "source": ControlSource; };
46
+ export type ControlSource = "signal" | "error" | "group";
47
+ export type DataSelector = { readonly "path": ReadonlyArray<string>; readonly "source": "state"; } | { readonly "path": ReadonlyArray<string>; readonly "source": "item"; };
48
+ export type DeleteParams = { readonly "idempotencyKey": string; readonly "ifGeneration": number; readonly "ifRunId"?: string | null; };
49
+ export type DeleteResult = { readonly "atCursor"?: string | null; readonly "deduped": boolean; readonly "deleted": boolean; readonly "generation"?: number | null; readonly "phase": Phase; readonly "runId"?: string | null; };
50
+ export type DiagnosticPathSegment = { readonly "kind": "field"; readonly "name": string; } | { readonly "index": number; readonly "kind": "index"; } | { readonly "kind": "node"; readonly "name": string; };
51
+ export type DiagnosticSeverity = "error" | "warning" | "info";
52
+ export type DispatchState = "active" | "suspended" | "draining" | "force_stopping" | "stopped";
53
+ export type DomainErrorData = { readonly "code": string; readonly "details"?: unknown; };
54
+ export type EventNotification = { readonly "cursor": string; readonly "event": WatchEvent; readonly "runId": string; readonly "subscriptionId": string; };
55
+ export type FaultAction = "none" | "retry" | "wait" | "escalate" | "abort";
56
+ export type FaultCode = "unavailable" | "resource_exhausted" | "deadline_exceeded" | "permission_denied" | "failed_precondition" | "not_found" | "aborted" | "internal" | "unknown";
57
+ export type FaultConsequence = "turn_failed" | "run_failed" | "run_degraded" | "no_observable_effect";
58
+ export type FaultRetryDisposition = "retryable" | "retryable_after_backoff" | "not_retryable" | "indeterminate";
59
+ export type FaultSeverity = "info" | "warning" | "error" | "critical";
60
+ export type FaultSourceFrame = { readonly "component": string; };
61
+ export type GetParams = { readonly "atCursor"?: string | null; };
62
+ export type GetResult = { readonly "atCursor"?: string | null; readonly "spec"?: GraphSpec | null; readonly "status": ClusterStatus; };
63
+ export type GraphDiagnostic = { readonly "code": GraphDiagnosticCode; readonly "message": string; readonly "path": ReadonlyArray<DiagnosticPathSegment>; readonly "relatedNodes": ReadonlyArray<string>; readonly "severity": DiagnosticSeverity; };
64
+ export type GraphDiagnosticCode = "schema_safety" | "reachability" | "choice_exhaustiveness" | "loop_exit_satisfiability" | "missing_bound" | "write_conflict" | "ceiling_exceeded" | "cyclic_reference" | "undefined_read" | "invalid_graph_shape";
65
+ export type GraphDiff = { readonly "added": ReadonlyArray<string>; readonly "changed": ReadonlyArray<string>; readonly "removed": ReadonlyArray<string>; };
66
+ export type GraphNode = { readonly "attempts": number; readonly "input": PayloadType; readonly "inputBindings": ReadonlyArray<InputBinding>; readonly "kind": "step"; readonly "name": string; readonly "output": PayloadType; readonly "timeoutMs": number; readonly "worker": string; readonly "writeBindings": ReadonlyArray<WriteBinding>; } | { readonly "attempts": number; readonly "diagnostic": PayloadType; readonly "input": PayloadType; readonly "inputBindings": ReadonlyArray<InputBinding>; readonly "kind": "verifier"; readonly "name": string; readonly "output": PayloadType; readonly "signals": { readonly [key: string]: ReadonlyArray<string> }; readonly "timeoutMs": number; readonly "worker": string; readonly "writeBindings": ReadonlyArray<WriteBinding>; } | { readonly "children": NonEmptyVec_of_GraphNode; readonly "kind": "seq"; readonly "name": string; readonly "promotedStatePaths": ReadonlyArray<ReadonlyArray<string>>; readonly "state": PayloadType; } | ({ readonly "branches": NonEmptyVec_of_ChoiceBranch; readonly "kind": "choice"; readonly "name": string; readonly "otherwise"?: GraphNode | null; readonly "promotedStatePaths": ReadonlyArray<ReadonlyArray<string>>; readonly "state": PayloadType; }) | { readonly "branches": NonEmptyVec_of_GraphNode; readonly "join": Join; readonly "kind": "par"; readonly "name": string; readonly "promotedStatePaths": ReadonlyArray<ReadonlyArray<string>>; readonly "state": PayloadType; } | { readonly "body": GraphNode; readonly "kind": "loop"; readonly "maxIterations": number; readonly "name": string; readonly "promotedStatePaths": ReadonlyArray<ReadonlyArray<string>>; readonly "state": PayloadType; readonly "until": Guard; } | { readonly "body": GraphNode; readonly "kind": "map"; readonly "maxItems": number; readonly "name": string; readonly "over": DataSelector; readonly "promotedStatePaths": ReadonlyArray<ReadonlyArray<string>>; readonly "state": PayloadType; } | { readonly "bindings": ReadonlyArray<InputBinding>; readonly "kind": "succeed"; readonly "name": string; readonly "output": PayloadType; } | { readonly "kind": "fail"; readonly "name": string; readonly "reason": string; };
67
+ export type GraphProfile = "openengine.graph.full/v1" | "openengine.graph.single-worker/v1";
68
+ export type GraphSpec = { readonly "initialInput": PayloadType; readonly "policy": PolicyBinding; readonly "profile": GraphProfile; readonly "root": GraphNode; };
69
+ export type Guard = { readonly "kind": "in"; readonly "labels": ReadonlyArray<string>; readonly "value": ControlSelector; } | { readonly "guards": NonEmptyVec_of_Guard; readonly "kind": "all"; } | { readonly "guards": NonEmptyVec_of_Guard; readonly "kind": "any"; } | { readonly "guard": Guard; readonly "kind": "not"; } | { readonly "count": number; readonly "kind": "k_of_n"; readonly "labels": ReadonlyArray<string>; readonly "values": NonEmptyVec_of_ControlSelector; } | { readonly "count": number; readonly "kind": "k_of_map"; readonly "labels": ReadonlyArray<string>; readonly "value": ControlSelector; };
70
+ export type InitializeParams = { readonly "protocolVersion": "openengine.cluster/v1"; };
71
+ export type InitializeResult = { readonly "capabilities": ServerCapabilities; readonly "protocolVersion": "openengine.cluster/v1"; readonly "status": ClusterStatus; };
72
+ export type InputBinding = { readonly "target": ReadonlyArray<string>; readonly "value": DataSelector; };
73
+ export type Join = { readonly "kind": "all"; } | { readonly "kind": "any"; } | { readonly "count": number; readonly "kind": "quorum"; } | { readonly "kind": "first"; readonly "when": Guard; };
74
+ export type JsonRpcError = { readonly "code": number; readonly "data"?: DomainErrorData | null; readonly "message": string; };
75
+ export type JsonRpcErrorResponse = { readonly "error": JsonRpcError; readonly "id"?: RequestId | null; readonly "jsonrpc": string; };
76
+ export type JsonRpcNotification = { readonly "jsonrpc": string; readonly "method": string; readonly "params": EventNotification; };
77
+ export type JsonRpcNotification2 = { readonly "jsonrpc": string; readonly "method": string; readonly "params": SubscriptionCancelParams; };
78
+ export type JsonRpcNotification3 = { readonly "jsonrpc": string; readonly "method": string; readonly "params": SubscriptionClosedNotification; };
79
+ export type JsonRpcNotification4 = { readonly "jsonrpc": string; readonly "method": string; readonly "params": CancelRequestParams; };
80
+ export type JsonRpcNotification5 = { readonly "jsonrpc": string; readonly "method": string; readonly "params": LogEventNotification; };
81
+ export type JsonRpcNotification6 = { readonly "jsonrpc": string; readonly "method": string; readonly "params": LogsClosedNotification; };
82
+ export type JsonRpcNotification7 = { readonly "jsonrpc": string; readonly "method": string; readonly "params": AgentAttachEventNotification; };
83
+ export type JsonRpcNotification8 = { readonly "jsonrpc": string; readonly "method": string; readonly "params": AgentAttachClosedNotification; };
84
+ export type JsonRpcRequest = { readonly "id": RequestId; readonly "jsonrpc": string; readonly "method": string; readonly "params": InitializeParams; };
85
+ export type JsonRpcRequest10 = { readonly "id": RequestId; readonly "jsonrpc": string; readonly "method": string; readonly "params": WatchParams; };
86
+ export type JsonRpcRequest11 = { readonly "id": RequestId; readonly "jsonrpc": string; readonly "method": string; readonly "params": LogsParams; };
87
+ export type JsonRpcRequest12 = { readonly "id": RequestId; readonly "jsonrpc": string; readonly "method": string; readonly "params": AgentAttachParams; };
88
+ export type JsonRpcRequest2 = { readonly "id": RequestId; readonly "jsonrpc": string; readonly "method": string; readonly "params": PlanParams; };
89
+ export type JsonRpcRequest3 = { readonly "id": RequestId; readonly "jsonrpc": string; readonly "method": string; readonly "params": ApplyParams; };
90
+ export type JsonRpcRequest4 = { readonly "id": RequestId; readonly "jsonrpc": string; readonly "method": string; readonly "params": GetParams; };
91
+ export type JsonRpcRequest5 = { readonly "id": RequestId; readonly "jsonrpc": string; readonly "method": string; readonly "params": UpdateParams; };
92
+ export type JsonRpcRequest6 = { readonly "id": RequestId; readonly "jsonrpc": string; readonly "method": string; readonly "params": StopParams; };
93
+ export type JsonRpcRequest7 = { readonly "id": RequestId; readonly "jsonrpc": string; readonly "method": string; readonly "params": RetryParams; };
94
+ export type JsonRpcRequest8 = { readonly "id": RequestId; readonly "jsonrpc": string; readonly "method": string; readonly "params": ResubmitParams; };
95
+ export type JsonRpcRequest9 = { readonly "id": RequestId; readonly "jsonrpc": string; readonly "method": string; readonly "params": DeleteParams; };
96
+ export type JsonRpcResponse = JsonRpcSuccess | JsonRpcErrorResponse;
97
+ export type JsonRpcResponse10 = JsonRpcSuccess10 | JsonRpcErrorResponse;
98
+ export type JsonRpcResponse11 = JsonRpcSuccess11 | JsonRpcErrorResponse;
99
+ export type JsonRpcResponse12 = JsonRpcSuccess12 | JsonRpcErrorResponse;
100
+ export type JsonRpcResponse2 = JsonRpcSuccess2 | JsonRpcErrorResponse;
101
+ export type JsonRpcResponse3 = JsonRpcSuccess3 | JsonRpcErrorResponse;
102
+ export type JsonRpcResponse4 = JsonRpcSuccess4 | JsonRpcErrorResponse;
103
+ export type JsonRpcResponse5 = JsonRpcSuccess5 | JsonRpcErrorResponse;
104
+ export type JsonRpcResponse6 = JsonRpcSuccess6 | JsonRpcErrorResponse;
105
+ export type JsonRpcResponse7 = JsonRpcSuccess7 | JsonRpcErrorResponse;
106
+ export type JsonRpcResponse8 = JsonRpcSuccess8 | JsonRpcErrorResponse;
107
+ export type JsonRpcResponse9 = JsonRpcSuccess9 | JsonRpcErrorResponse;
108
+ export type JsonRpcSuccess = { readonly "id": RequestId; readonly "jsonrpc": string; readonly "result": InitializeResult; };
109
+ export type JsonRpcSuccess10 = { readonly "id": RequestId; readonly "jsonrpc": string; readonly "result": WatchResult; };
110
+ export type JsonRpcSuccess11 = { readonly "id": RequestId; readonly "jsonrpc": string; readonly "result": LogsResult; };
111
+ export type JsonRpcSuccess12 = { readonly "id": RequestId; readonly "jsonrpc": string; readonly "result": AgentAttachResult; };
112
+ export type JsonRpcSuccess2 = { readonly "id": RequestId; readonly "jsonrpc": string; readonly "result": PlanResult; };
113
+ export type JsonRpcSuccess3 = { readonly "id": RequestId; readonly "jsonrpc": string; readonly "result": ApplyResult; };
114
+ export type JsonRpcSuccess4 = { readonly "id": RequestId; readonly "jsonrpc": string; readonly "result": GetResult; };
115
+ export type JsonRpcSuccess5 = { readonly "id": RequestId; readonly "jsonrpc": string; readonly "result": UpdateResult; };
116
+ export type JsonRpcSuccess6 = { readonly "id": RequestId; readonly "jsonrpc": string; readonly "result": StopResult; };
117
+ export type JsonRpcSuccess7 = { readonly "id": RequestId; readonly "jsonrpc": string; readonly "result": RetryResult; };
118
+ export type JsonRpcSuccess8 = { readonly "id": RequestId; readonly "jsonrpc": string; readonly "result": ResubmitResult; };
119
+ export type JsonRpcSuccess9 = { readonly "id": RequestId; readonly "jsonrpc": string; readonly "result": DeleteResult; };
120
+ export type Labels = { readonly [key: string]: string };
121
+ export type LogEventNotification = LogEventNotificationWire;
122
+ export type LogEventNotificationWire = { readonly "record": LogRecord; readonly "subscriptionId": string; };
123
+ export type LogLevel = "trace" | "debug" | "info" | "warn" | "error";
124
+ export type LogRecord = { readonly "level": LogLevel; readonly "message": string; readonly "target": string; };
125
+ export type LogsClosedNotification = { readonly "reason": SubscriptionCloseReason; readonly "subscriptionId": string; };
126
+ export type LogsParams = Record<string, never>;
127
+ export type LogsResult = { readonly "subscriptionId": string; };
128
+ export type NodeAddress = { readonly "attempt": number; readonly "node": string; };
129
+ export type NodeOutputChannel = "out" | "signal" | "diagnostic";
130
+ export type NodeOutputSelector = { readonly "channel": NodeOutputChannel; readonly "node": string; readonly "path": ReadonlyArray<string>; };
131
+ export type NonEmptyVec_of_ChoiceBranch = ReadonlyArray<ChoiceBranch>;
132
+ export type NonEmptyVec_of_ControlSelector = ReadonlyArray<ControlSelector>;
133
+ export type NonEmptyVec_of_FieldPath = ReadonlyArray<ReadonlyArray<string>>;
134
+ export type NonEmptyVec_of_GraphNode = ReadonlyArray<GraphNode>;
135
+ export type NonEmptyVec_of_Guard = ReadonlyArray<Guard>;
136
+ export type NonEmptyVec_of_NodeName = ReadonlyArray<string>;
137
+ export type OperationalStatus = { readonly "dispatchState": DispatchState; readonly "inFlight": number; readonly "labels": Labels; readonly "logLevel": LogLevel; readonly "stopMode"?: StopMode | null; };
138
+ export type PayloadType = { readonly "kind": "null"; } | { readonly "kind": "boolean"; } | { readonly "kind": "integer"; } | { readonly "kind": "number"; } | { readonly "kind": "string"; } | { readonly "fields": { readonly [key: string]: RecordField }; readonly "kind": "record"; } | { readonly "items": PayloadType; readonly "kind": "array"; } | { readonly "kind": "enum"; readonly "values": ReadonlyArray<string>; };
139
+ export type Phase = "empty" | "admitting" | "running" | "finished" | "deleting";
140
+ export type PlanParams = { readonly "graph": GraphSpec; };
141
+ export type PlanResult = { readonly "bounds"?: StructuralBounds | null; readonly "diagnostics": ReadonlyArray<GraphDiagnostic>; readonly "ok": boolean; };
142
+ export type PolicyBinding = { readonly "default": PolicyDefault; readonly "policy": string; };
143
+ export type PolicyDefault = "deny";
144
+ export type RecordField = { readonly "required": boolean; readonly "type": PayloadType; };
145
+ export type RedactionClass = "public" | "internal" | "confidential" | "restricted";
146
+ export type RequestId = string | number;
147
+ export type ResubmitParams = { readonly "idempotencyKey": string; readonly "ifGeneration": number; readonly "ifRunId": string; readonly "replacementInput"?: unknown; };
148
+ export type ResubmitResult = { readonly "atCursor": string; readonly "deduped": boolean; readonly "generation": number; readonly "operational": OperationalStatus; readonly "phase": Phase; readonly "priorRunId": string; readonly "runId": string; };
149
+ export type RetryParams = { readonly "idempotencyKey": string; readonly "ifGeneration": number; };
150
+ export type RetryResult = { readonly "atCursor": string; readonly "deduped": boolean; readonly "generation": number; readonly "operational": OperationalStatus; readonly "phase": Phase; readonly "retriedTurnId": string; readonly "retryTurnId": string; readonly "runId": string; };
151
+ export type ServerCapabilities = { readonly "agentAttach"?: boolean; readonly "graphProfiles"?: ReadonlyArray<GraphProfile>; readonly "logs"?: boolean; };
152
+ export type StopMode = "drain" | "force";
153
+ export type StopParams = { readonly "idempotencyKey": string; readonly "ifGeneration": number; readonly "mode": StopMode; };
154
+ export type StopResult = { readonly "acceptedMode": StopMode; readonly "atCursor": string; readonly "deduped": boolean; readonly "effectiveMode": StopMode; readonly "generation": number; readonly "operational": OperationalStatus; readonly "phase": Phase; readonly "runId": string; };
155
+ export type StructuralBounds = { readonly "attemptsPerNode": { readonly [key: string]: number }; readonly "maxNodeExecutions": number; readonly "peakConcurrency": number; readonly "termination": TerminationWitness; };
156
+ export type SubscriptionCancelParams = { readonly "subscriptionId": string; };
157
+ export type SubscriptionCloseReason = "done" | "SLOW_CONSUMER";
158
+ export type SubscriptionClosedNotification = { readonly "lastDeliveredCursor"?: string | null; readonly "reason": SubscriptionCloseReason; readonly "subscriptionId": string; };
159
+ export type TerminationWitness = { readonly "kind": "acyclic"; readonly "order": NonEmptyVec_of_NodeName; } | { readonly "kind": "bounded"; readonly "maxIterations": number; readonly "ranking": NonEmptyVec_of_FieldPath; };
160
+ export type UpdateParams = ({ readonly "idempotencyKey": string; readonly "ifGeneration": number; readonly "labels"?: Labels; readonly "logLevel"?: LogLevel; readonly "suspended"?: boolean; }) & ({ readonly "labels": unknown; } | { readonly "logLevel": unknown; } | { readonly "suspended": unknown; });
161
+ export type UpdateResult = { readonly "atCursor": string; readonly "deduped": boolean; readonly "generation": number; readonly "operational": OperationalStatus; readonly "phase": Phase; readonly "runId": string; };
162
+ export type WatchEvent = ({ readonly "admission"?: AdmissionTransition | null; readonly "status": ClusterStatus; readonly "type": "phase"; }) | { readonly "input": unknown; readonly "node": NodeAddress; readonly "type": "node_begin"; } | { readonly "node": NodeAddress; readonly "outcome": WorkerOutcome; readonly "type": "node_end"; } | { readonly "type": "bookmark"; } | { readonly "fault": BackendFault; readonly "type": "fault"; } | ({ readonly "final_status": ClusterStatus; readonly "stop_mode"?: StopMode | null; readonly "type": "finished"; });
163
+ export type WatchParams = { readonly "fromCursor"?: string | null; readonly "runId"?: string | null; };
164
+ export type WatchResult = { readonly "atCursor"?: string | null; readonly "runId"?: string | null; readonly "subscriptionId": string; };
165
+ export type WorkerErrorCode = "timeout" | "crash" | "malformed" | "refusal";
166
+ export type WorkerFailureReason = "declared_failure" | "policy_denied" | "interactive_input_required" | "authentication_required" | "malformed_result";
167
+ export type WorkerOutcome = WorkerOutcomeWire & unknown;
168
+ export type WorkerOutcomeWire = { readonly "artifacts": ReadonlyArray<ArtifactRef>; readonly "output": unknown; readonly "status": "verified"; } | { readonly "artifacts": ReadonlyArray<ArtifactRef>; readonly "diagnostic": unknown; readonly "output": unknown; readonly "signals": { readonly [key: string]: string }; readonly "status": "verifier"; } | { readonly "code": WorkerErrorCode; readonly "reason": WorkerFailureReason; readonly "status": "error"; };
169
+ export type WriteBinding = { readonly "target": ReadonlyArray<string>; readonly "value": NodeOutputSelector; };
170
+
171
+ export interface ClusterMethodParams {
172
+ readonly initialize: InitializeParams; readonly plan: PlanParams; readonly apply: ApplyParams;
173
+ readonly update: UpdateParams; readonly stop: StopParams; readonly retry: RetryParams;
174
+ readonly resubmit: ResubmitParams; readonly delete: DeleteParams; readonly get: GetParams;
175
+ readonly watch: WatchParams; readonly logs: LogsParams; readonly 'agent/attach': AgentAttachParams;
176
+ }
177
+
178
+ export interface ClusterMethodResults {
179
+ readonly initialize: InitializeResult; readonly plan: PlanResult; readonly apply: ApplyResult;
180
+ readonly update: UpdateResult; readonly stop: StopResult; readonly retry: RetryResult;
181
+ readonly resubmit: ResubmitResult; readonly delete: DeleteResult; readonly get: GetResult;
182
+ readonly watch: WatchResult; readonly logs: LogsResult; readonly 'agent/attach': AgentAttachResult;
183
+ }
@@ -0,0 +1,38 @@
1
+ export * from './generated/protocol.js';
2
+ export { SUBSCRIPTION_QUEUE_MAX_BYTES } from './queue.js';
3
+ export {
4
+ ClusterConfigError,
5
+ ClusterError,
6
+ ClusterInternalError,
7
+ ClusterProtocolError,
8
+ ClusterRpcError,
9
+ ClusterStateError,
10
+ ClusterTimeoutError,
11
+ ClusterTransportError,
12
+ } from './errors.js';
13
+ export { CONNECTION_TRANSITIONS, PROTOCOL_DIAGNOSTIC_CAPACITY, Connection } from './connection.js';
14
+ export type {
15
+ CallOptions,
16
+ ConnectionState,
17
+ } from './connection.js';
18
+ export type { WebSocketLike } from './socket.js';
19
+ export {
20
+ AgentAttachSubscriptionStream,
21
+ LogsSubscriptionStream,
22
+ WatchSubscriptionStream,
23
+ } from './subscriptions.js';
24
+ export type {
25
+ Subscription,
26
+ SubscriptionClosedItem,
27
+ SubscriptionItem,
28
+ WatchSubscriptionItem,
29
+ WatchSubscriptionClosedItem,
30
+ } from './subscriptions.js';
31
+ export { ClusterClient, connect } from './client.js';
32
+ export type {
33
+ AgentAttachSubscription,
34
+ CoherentWatchSubscription,
35
+ ConnectOptions,
36
+ LogsSubscription,
37
+ WatchSubscription,
38
+ } from './client.js';
@@ -0,0 +1,84 @@
1
+ import { SUBSCRIPTION_QUEUE_CAPACITY } from './generated/protocol.js';
2
+ import { ClusterInternalError } from './errors.js';
3
+
4
+ export const SUBSCRIPTION_QUEUE_MAX_BYTES = 8 * 1024 * 1024;
5
+
6
+ type Deferred<T> = {
7
+ readonly promise: Promise<T>;
8
+ readonly resolve: (value: T) => void;
9
+ };
10
+
11
+ function deferred<T>(): Deferred<T> {
12
+ let resolve!: (value: T) => void;
13
+ const promise = new Promise<T>((onResolve) => { resolve = onResolve; });
14
+ return { promise, resolve };
15
+ }
16
+
17
+ export type QueueValue<T> =
18
+ | { readonly done: false; readonly value: T }
19
+ | { readonly done: true };
20
+
21
+ export class BoundedQueue<T> {
22
+ readonly #items: Array<{ readonly value: T; readonly bytes: number }> = [];
23
+ readonly #waiters: Array<Deferred<QueueValue<T>>> = [];
24
+ #bytes = 0;
25
+ #producerClosed = false;
26
+
27
+ get retainedCount(): number { return this.#items.length; }
28
+
29
+ push(value: T, bytes: number): 'buffered' | 'delivered' | 'overflow' | 'closed' {
30
+ if (this.#producerClosed) return 'closed';
31
+ const waiter = this.#waiters.shift();
32
+ if (waiter) {
33
+ waiter.resolve({ done: false, value });
34
+ this.#assertInvariant();
35
+ return 'delivered';
36
+ }
37
+ if (
38
+ this.#items.length >= SUBSCRIPTION_QUEUE_CAPACITY ||
39
+ this.#bytes + bytes > SUBSCRIPTION_QUEUE_MAX_BYTES
40
+ ) return 'overflow';
41
+ this.#items.push({ value, bytes });
42
+ this.#bytes += bytes;
43
+ this.#assertInvariant();
44
+ return 'buffered';
45
+ }
46
+
47
+ recv(): Promise<QueueValue<T>> {
48
+ const item = this.#items.shift();
49
+ if (item) {
50
+ this.#bytes -= item.bytes;
51
+ this.#assertInvariant();
52
+ return Promise.resolve({ done: false, value: item.value });
53
+ }
54
+ if (this.#producerClosed) return Promise.resolve({ done: true });
55
+ const waiter = deferred<QueueValue<T>>();
56
+ this.#waiters.push(waiter);
57
+ this.#assertInvariant();
58
+ return waiter.promise;
59
+ }
60
+
61
+ endRetainingBuffer(): void {
62
+ if (this.#producerClosed) return;
63
+ this.#producerClosed = true;
64
+ while (this.#waiters.length > 0) this.#waiters.shift()!.resolve({ done: true });
65
+ this.#assertInvariant();
66
+ }
67
+
68
+ closeAndDiscard(): void {
69
+ this.#producerClosed = true;
70
+ this.#items.length = 0;
71
+ this.#bytes = 0;
72
+ while (this.#waiters.length > 0) this.#waiters.shift()!.resolve({ done: true });
73
+ this.#assertInvariant();
74
+ }
75
+
76
+ #assertInvariant(): void {
77
+ if (this.#items.length > 0 && this.#waiters.length > 0) {
78
+ throw new ClusterInternalError(
79
+ 'queue contains both buffered items and waiters',
80
+ 'QUEUE_INVARIANT',
81
+ );
82
+ }
83
+ }
84
+ }
@@ -0,0 +1,31 @@
1
+ import { ClusterConfigError } from './errors.js';
2
+
3
+ export interface WebSocketLike {
4
+ readonly readyState: number;
5
+ send(data: string, callback?: (error?: Error) => void): void | Promise<void>;
6
+ close(code?: number, reason?: string): void | Promise<void>;
7
+ addEventListener?(type: string, listener: (...args: unknown[]) => void): void;
8
+ removeEventListener?(type: string, listener: (...args: unknown[]) => void): void;
9
+ on?(type: string, listener: (...args: unknown[]) => void): void;
10
+ off?(type: string, listener: (...args: unknown[]) => void): void;
11
+ removeListener?(type: string, listener: (...args: unknown[]) => void): void;
12
+ }
13
+
14
+ export function addSocketListener(
15
+ socket: WebSocketLike,
16
+ type: string,
17
+ listener: (...args: unknown[]) => void,
18
+ ): () => void {
19
+ if (socket.addEventListener) {
20
+ socket.addEventListener(type, listener);
21
+ return () => socket.removeEventListener?.(type, listener);
22
+ }
23
+ if (socket.on) {
24
+ socket.on(type, listener);
25
+ return () => (socket.off ?? socket.removeListener)?.call(socket, type, listener);
26
+ }
27
+ throw new ClusterConfigError(
28
+ 'WebSocket implementation must support event listeners',
29
+ 'INVALID_WEBSOCKET',
30
+ );
31
+ }