intentdna 1.8.6 → 1.8.7

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 (60) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/README.md +1 -0
  4. package/dist/cli/commands/run-lifecycle.d.ts +73 -0
  5. package/dist/cli/commands/run-lifecycle.js +240 -0
  6. package/dist/cli/commands/run.d.ts +22 -40
  7. package/dist/cli/commands/run.js +674 -392
  8. package/dist/cli/index.js +87 -2
  9. package/dist/compiler/workflow.js +3 -2
  10. package/dist/hooks/cli.d.ts +1 -2
  11. package/dist/hooks/cli.js +119 -80
  12. package/dist/hooks/enforce.d.ts +2 -0
  13. package/dist/hooks/enforce.js +56 -27
  14. package/dist/hooks/enforcement-boundary.d.ts +13 -0
  15. package/dist/hooks/enforcement-boundary.js +33 -0
  16. package/dist/hooks/index.d.ts +3 -2
  17. package/dist/hooks/index.js +3 -2
  18. package/dist/hooks/protocol.d.ts +12 -4
  19. package/dist/hooks/protocol.js +20 -14
  20. package/dist/hooks/schema.d.ts +2 -1
  21. package/dist/hooks/schema.js +6 -2
  22. package/dist/hooks/state-manager.d.ts +5 -5
  23. package/dist/hooks/state-manager.js +26 -24
  24. package/dist/hooks/state.d.ts +19 -3
  25. package/dist/hooks/state.js +327 -80
  26. package/dist/mcp/index.js +0 -0
  27. package/dist/runtime/diagnosis-contract-verifier.d.ts +11 -0
  28. package/dist/runtime/diagnosis-contract-verifier.js +417 -0
  29. package/dist/runtime/execution-provider.d.ts +40 -0
  30. package/dist/runtime/execution-provider.js +138 -0
  31. package/dist/runtime/handoff-resolver.d.ts +61 -0
  32. package/dist/runtime/handoff-resolver.js +167 -0
  33. package/dist/runtime/index.d.ts +24 -0
  34. package/dist/runtime/index.js +13 -0
  35. package/dist/runtime/process-tree.d.ts +47 -0
  36. package/dist/runtime/process-tree.js +402 -0
  37. package/dist/runtime/providers/claude.d.ts +9 -0
  38. package/dist/runtime/providers/claude.js +64 -0
  39. package/dist/runtime/providers/codex.d.ts +8 -0
  40. package/dist/runtime/providers/codex.js +72 -0
  41. package/dist/runtime/result-store.d.ts +32 -0
  42. package/dist/runtime/result-store.js +130 -0
  43. package/dist/runtime/run-contracts.d.ts +290 -0
  44. package/dist/runtime/run-contracts.js +58 -0
  45. package/dist/runtime/run-controller.d.ts +149 -0
  46. package/dist/runtime/run-controller.js +1108 -0
  47. package/dist/runtime/run-store.d.ts +96 -0
  48. package/dist/runtime/run-store.js +725 -0
  49. package/dist/runtime/worker-executor.d.ts +19 -0
  50. package/dist/runtime/worker-executor.js +194 -0
  51. package/dist/runtime/workflow-plan-adapter.d.ts +26 -0
  52. package/dist/runtime/workflow-plan-adapter.js +416 -0
  53. package/dist/runtime/workflow-runner.d.ts +15 -3
  54. package/dist/runtime/workflow-runner.js +13 -1
  55. package/dist/runtime/workspace-isolation.d.ts +103 -0
  56. package/dist/runtime/workspace-isolation.js +373 -0
  57. package/dist/schema/types.d.ts +1 -0
  58. package/dist/schema/validate.js +64 -6
  59. package/dist/schema/yaml-parser.js +7 -2
  60. package/package.json +1 -1
@@ -0,0 +1,96 @@
1
+ import type { AttemptRecord, CommittedStepResult, JsonValue, RunId, RuntimeEvent, TaskClaim, TaskRecord } from "./run-contracts.js";
2
+ export declare const RUN_STORE_SCHEMA_VERSION: 1;
3
+ export declare const RUN_STATUS_VALUES: readonly ["active", "cancelling", "succeeded", "failed", "cancelled"];
4
+ export type RunStatus = typeof RUN_STATUS_VALUES[number];
5
+ export type TerminalRunStatus = Extract<RunStatus, "succeeded" | "failed" | "cancelled">;
6
+ export interface RunCancellationIntent {
7
+ readonly requested_at: string;
8
+ readonly reason: string | null;
9
+ }
10
+ export interface RunTerminalRecord {
11
+ readonly status: TerminalRunStatus;
12
+ readonly reason: string | null;
13
+ readonly completed_at: string;
14
+ }
15
+ export interface RunRecord {
16
+ readonly run_id: RunId;
17
+ readonly workflow_id: string;
18
+ readonly workflow_version: string | null;
19
+ readonly plan_digest: string;
20
+ readonly status: RunStatus;
21
+ readonly cancellation: RunCancellationIntent | null;
22
+ readonly terminal: RunTerminalRecord | null;
23
+ readonly metadata: JsonValue;
24
+ readonly created_at: string;
25
+ readonly updated_at: string;
26
+ }
27
+ /**
28
+ * Claims are retained as history. The task and attempt records determine which
29
+ * claim is current; renewing a lease updates the matching claim token in place.
30
+ */
31
+ export type StoredTaskClaim = TaskClaim;
32
+ export interface RunStoreSnapshot {
33
+ readonly schema_version: typeof RUN_STORE_SCHEMA_VERSION;
34
+ readonly record_version: number;
35
+ readonly run: RunRecord;
36
+ readonly tasks: readonly TaskRecord[];
37
+ readonly attempts: readonly AttemptRecord[];
38
+ readonly claims: readonly StoredTaskClaim[];
39
+ readonly events: readonly RuntimeEvent[];
40
+ readonly results: readonly CommittedStepResult[];
41
+ readonly created_at: string;
42
+ readonly updated_at: string;
43
+ }
44
+ export interface CreateRunStoreRecord {
45
+ readonly run: RunRecord;
46
+ readonly tasks?: readonly TaskRecord[];
47
+ }
48
+ /**
49
+ * Collections are upserted by their durable identity. Events and results are
50
+ * append-only: an exact/idempotent replay is ignored and a conflict is rejected.
51
+ */
52
+ export interface RunStoreUpdate {
53
+ readonly run_id: RunId;
54
+ readonly expected_record_version: number;
55
+ readonly run?: RunRecord;
56
+ readonly tasks?: readonly TaskRecord[];
57
+ readonly attempts?: readonly AttemptRecord[];
58
+ readonly claims?: readonly StoredTaskClaim[];
59
+ readonly events?: readonly RuntimeEvent[];
60
+ readonly results?: readonly CommittedStepResult[];
61
+ }
62
+ export interface RunStoreUpdateResult {
63
+ readonly snapshot: RunStoreSnapshot;
64
+ readonly applied: boolean;
65
+ readonly duplicate_event_ids: readonly string[];
66
+ readonly duplicate_result_ids: readonly string[];
67
+ }
68
+ export interface DurableRunStoreOptions {
69
+ readonly root_directory: string;
70
+ readonly lock_wait_ms?: number;
71
+ readonly lock_stale_ms?: number;
72
+ readonly lock_retry_ms?: number;
73
+ readonly lock_heartbeat_ms?: number;
74
+ }
75
+ export type RunStoreErrorCode = "invalid_options" | "invalid_record" | "unsupported_schema" | "run_exists" | "run_not_found" | "version_conflict" | "immutable_record" | "identity_conflict" | "event_conflict" | "result_conflict" | "lock_timeout" | "lock_lost";
76
+ export declare class RunStoreError extends Error {
77
+ readonly code: RunStoreErrorCode;
78
+ constructor(code: RunStoreErrorCode, message: string);
79
+ }
80
+ export declare class DurableRunStore {
81
+ private readonly options;
82
+ constructor(options: DurableRunStoreOptions);
83
+ private runDirectory;
84
+ private ledgerPath;
85
+ private lockDirectory;
86
+ private readSnapshot;
87
+ createRun(input: CreateRunStoreRecord): Promise<RunStoreSnapshot>;
88
+ loadRun(runId: RunId): Promise<RunStoreSnapshot | null>;
89
+ requireRun(runId: RunId): Promise<RunStoreSnapshot>;
90
+ updateRun(update: RunStoreUpdate): Promise<RunStoreUpdateResult>;
91
+ /**
92
+ * Reads every valid run ledger after restart. No worker-session directory is
93
+ * consulted, and this store intentionally exposes no worker cleanup operation.
94
+ */
95
+ loadAllRuns(): Promise<readonly RunStoreSnapshot[]>;
96
+ }