intentdna 1.9.0 → 1.9.3
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.
- package/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +227 -87
- package/dist/cli/commands/run-lifecycle.d.ts +61 -11
- package/dist/cli/commands/run-lifecycle.js +184 -50
- package/dist/cli/commands/run-observer.d.ts +15 -0
- package/dist/cli/commands/run-observer.js +210 -0
- package/dist/cli/commands/run.d.ts +16 -20
- package/dist/cli/commands/run.js +461 -659
- package/dist/cli/commands/sync.js +16 -12
- package/dist/cli/index.js +14 -5
- package/dist/compiler/compile.d.ts +1 -0
- package/dist/compiler/compile.js +1 -1
- package/dist/compiler/controller.d.ts +16 -0
- package/dist/compiler/controller.js +693 -0
- package/dist/compiler/input-resolver.d.ts +2 -0
- package/dist/compiler/input-resolver.js +22 -6
- package/dist/hooks/cli.d.ts +45 -0
- package/dist/hooks/cli.js +263 -31
- package/dist/hooks/host-event.d.ts +57 -0
- package/dist/hooks/host-event.js +187 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/protocol.d.ts +7 -0
- package/dist/hooks/schema.d.ts +1 -0
- package/dist/hooks/schema.js +89 -1
- package/dist/hooks/state.d.ts +23 -1
- package/dist/hooks/state.js +9 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/mcp/index.js +2 -0
- package/dist/mcp/tools-run.d.ts +4 -0
- package/dist/mcp/tools-run.js +419 -0
- package/dist/mcp/tools-state.d.ts +1 -1
- package/dist/mcp/tools-state.js +13 -241
- package/dist/runtime/artifact-store.d.ts +146 -0
- package/dist/runtime/artifact-store.js +1436 -0
- package/dist/runtime/canonical-attempt-outcome.d.ts +12 -0
- package/dist/runtime/canonical-attempt-outcome.js +195 -0
- package/dist/runtime/canonical-json.d.ts +10 -0
- package/dist/runtime/canonical-json.js +105 -0
- package/dist/runtime/canonical-run-application.d.ts +93 -0
- package/dist/runtime/canonical-run-application.js +229 -0
- package/dist/runtime/canonical-run-service.d.ts +454 -0
- package/dist/runtime/canonical-run-service.js +4760 -0
- package/dist/runtime/canonical-runtime-composition.d.ts +22 -0
- package/dist/runtime/canonical-runtime-composition.js +34 -0
- package/dist/runtime/canonical-runtime-projection.d.ts +3 -0
- package/dist/runtime/canonical-runtime-projection.js +4 -0
- package/dist/runtime/canonical-target-compiler.d.ts +46 -0
- package/dist/runtime/canonical-target-compiler.js +514 -0
- package/dist/runtime/claude-agent-identity.d.ts +2 -0
- package/dist/runtime/claude-agent-identity.js +21 -0
- package/dist/runtime/executable-run-plan.d.ts +328 -0
- package/dist/runtime/executable-run-plan.js +1485 -0
- package/dist/runtime/execution-authority.d.ts +83 -0
- package/dist/runtime/execution-authority.js +98 -0
- package/dist/runtime/handoff-resolver.js +4 -1
- package/dist/runtime/harness-pull-adapter.d.ts +146 -0
- package/dist/runtime/harness-pull-adapter.js +315 -0
- package/dist/runtime/index.d.ts +39 -14
- package/dist/runtime/index.js +29 -7
- package/dist/runtime/local-execution-authority.d.ts +194 -0
- package/dist/runtime/local-execution-authority.js +2897 -0
- package/dist/runtime/local-execution-reconciliation.d.ts +20 -0
- package/dist/runtime/local-execution-reconciliation.js +107 -0
- package/dist/runtime/local-execution-supervisor-script.d.ts +7 -0
- package/dist/runtime/local-execution-supervisor-script.js +793 -0
- package/dist/runtime/local-provider-sandbox.d.ts +42 -0
- package/dist/runtime/local-provider-sandbox.js +154 -0
- package/dist/runtime/local-verifier-execution.d.ts +24 -0
- package/dist/runtime/local-verifier-execution.js +290 -0
- package/dist/runtime/local-windows-execution-supervisor-script.d.ts +6 -0
- package/dist/runtime/local-windows-execution-supervisor-script.js +788 -0
- package/dist/runtime/plan-store.d.ts +30 -0
- package/dist/runtime/plan-store.js +231 -0
- package/dist/runtime/process-tree.d.ts +9 -0
- package/dist/runtime/process-tree.js +97 -24
- package/dist/runtime/providers/codex.js +2 -2
- package/dist/runtime/push-driver.d.ts +184 -0
- package/dist/runtime/push-driver.js +1002 -0
- package/dist/runtime/result-store.d.ts +34 -3
- package/dist/runtime/result-store.js +1073 -2
- package/dist/runtime/run-binding.d.ts +68 -0
- package/dist/runtime/run-binding.js +278 -0
- package/dist/runtime/run-contracts.d.ts +575 -0
- package/dist/runtime/run-contracts.js +58 -7
- package/dist/runtime/run-controller.d.ts +1 -6
- package/dist/runtime/run-controller.js +0 -41
- package/dist/runtime/run-store.d.ts +85 -7
- package/dist/runtime/run-store.js +2528 -186
- package/dist/runtime/skill-adapter.d.ts +18 -7
- package/dist/runtime/skill-adapter.js +100 -742
- package/dist/runtime/structured-output-validator.d.ts +44 -0
- package/dist/runtime/structured-output-validator.js +171 -0
- package/dist/runtime/verifier-command-binding.d.ts +22 -0
- package/dist/runtime/verifier-command-binding.js +162 -0
- package/dist/runtime/verifier.d.ts +46 -6
- package/dist/runtime/verifier.js +355 -53
- package/dist/runtime/windows-job-keeper.d.ts +47 -0
- package/dist/runtime/windows-job-keeper.js +231 -0
- package/dist/runtime/worker-executor.d.ts +17 -1
- package/dist/runtime/worker-executor.js +26 -5
- package/dist/runtime/workflow-plan-adapter.d.ts +19 -0
- package/dist/runtime/workflow-plan-adapter.js +502 -6
- package/dist/runtime/workflow-runtime-manifest.d.ts +1 -0
- package/dist/runtime/workflow-runtime-manifest.js +5 -0
- package/dist/runtime/workspace-isolation.d.ts +29 -2
- package/dist/runtime/workspace-isolation.js +488 -11
- package/dist/runtime/workspace-observation.d.ts +44 -0
- package/dist/runtime/workspace-observation.js +216 -0
- package/dist/schema/controller-registry.d.ts +0 -7
- package/dist/schema/controller-registry.js +0 -8
- package/dist/schema/types.d.ts +84 -10
- package/dist/schema/types.js +2 -0
- package/dist/schema/validate.js +151 -1
- package/dist/schema/validators/controllers.d.ts +1 -1
- package/dist/schema/validators/controllers.js +126 -41
- package/dist/schema/workflow-authoring-contract.js +2 -0
- package/dist/schema/yaml-parser.js +1 -1
- package/dist/templates/flutter-rewrite-new.dna.yaml +1 -0
- package/dist/templates/flutter-rewrite.dna.yaml +87 -60
- package/dist/templates/safe-refactoring.dna.yaml +1 -0
- package/native/windows-job-keeper/README.md +80 -0
- package/native/windows-job-keeper/bin/aarch64/intentdna-windows-job-keeper.exe +0 -0
- package/native/windows-job-keeper/bin/x86_64/intentdna-windows-job-keeper.exe +0 -0
- package/native/windows-job-keeper/keeper.c +979 -0
- package/native/windows-job-keeper/manifest.json +33 -0
- package/package.json +6 -2
- package/scripts/build-windows-job-keeper.mjs +172 -0
- package/scripts/verify-windows-job-keeper.mjs +184 -0
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import type { AcquireAttemptRequest, AcquireAttemptResponse, AttemptExecutionSubmission, AttemptLease, AttemptView, AttachAttemptRequest, HeartbeatRequest, LeaseView, RunView, SettleDriverFailureRequest, SubmitAttemptRequest, SubmitResponse } from "./canonical-run-service.js";
|
|
2
|
+
import type { DriverCapabilities, WorkerNode } from "./executable-run-plan.js";
|
|
3
|
+
import type { ExecutionProvider } from "./execution-provider.js";
|
|
4
|
+
import type { CanonicalAttemptOutcome, CanonicalEvidenceRef, CanonicalResultDigest, RunId, StepOutput, StepPacket, TerminalOutcome, WorkerSessionId } from "./run-contracts.js";
|
|
5
|
+
import { type RunBindingPayload } from "./run-binding.js";
|
|
6
|
+
import { executeWorkerAttempt, type WorkerExecutionAuthorityBinding, type WorkerExecutionWithEvents, type WorkerExecutorOptions } from "./worker-executor.js";
|
|
7
|
+
export type PushDriverErrorCode = "invalid_configuration" | "invalid_service_response" | "invalid_execution_result" | "invalid_provider_output" | "unsupported_output_contract" | "unsupported" | "attempt_relaunch" | "attach_indeterminate" | "authority_preparation_abandon_failed" | "driver_failure_settlement_failed" | "wait_stopped";
|
|
8
|
+
export declare class PushDriverError extends Error {
|
|
9
|
+
readonly code: PushDriverErrorCode;
|
|
10
|
+
constructor(code: PushDriverErrorCode, message: string, options?: ErrorOptions);
|
|
11
|
+
}
|
|
12
|
+
export declare class PushDriverIndeterminateAttachError extends PushDriverError {
|
|
13
|
+
readonly disposition: "retain_preparation";
|
|
14
|
+
constructor(attemptId: string, cause: unknown);
|
|
15
|
+
}
|
|
16
|
+
export interface PushDriverService {
|
|
17
|
+
inspect(runId: RunId): Promise<RunView>;
|
|
18
|
+
resume(runId: RunId): Promise<RunView>;
|
|
19
|
+
cancel(runId: RunId, reason?: string | null): Promise<RunView>;
|
|
20
|
+
acquireAttempt(request: AcquireAttemptRequest): Promise<AcquireAttemptResponse>;
|
|
21
|
+
attachAttempt(request: AttachAttemptRequest): Promise<AttemptView>;
|
|
22
|
+
heartbeat(request: HeartbeatRequest): Promise<LeaseView>;
|
|
23
|
+
submitAttempt(request: SubmitAttemptRequest): Promise<SubmitResponse>;
|
|
24
|
+
settleDriverFailure(request: SettleDriverFailureRequest): Promise<RunView>;
|
|
25
|
+
}
|
|
26
|
+
export interface PushDriverProviderContext {
|
|
27
|
+
readonly run: RunView;
|
|
28
|
+
readonly binding: RunBindingPayload;
|
|
29
|
+
readonly node: WorkerNode;
|
|
30
|
+
readonly packet: StepPacket;
|
|
31
|
+
}
|
|
32
|
+
export type PushDriverProviderFactory = (context: PushDriverProviderContext) => ExecutionProvider | Promise<ExecutionProvider>;
|
|
33
|
+
export interface PushDriverAttemptContext extends PushDriverProviderContext {
|
|
34
|
+
readonly lease: AttemptLease;
|
|
35
|
+
readonly attached: AttemptView;
|
|
36
|
+
readonly worker_session_id: WorkerSessionId;
|
|
37
|
+
}
|
|
38
|
+
export interface PushDriverExecutionAuthorityPreparationContext {
|
|
39
|
+
readonly run: RunView;
|
|
40
|
+
readonly binding: RunBindingPayload;
|
|
41
|
+
readonly node: WorkerNode;
|
|
42
|
+
readonly lease: AttemptLease;
|
|
43
|
+
readonly worker_session_id: WorkerSessionId;
|
|
44
|
+
readonly execution_claim_epoch: number;
|
|
45
|
+
}
|
|
46
|
+
export interface PushDriverExecutionAuthorityContext extends PushDriverAttemptContext {
|
|
47
|
+
readonly started_at: string;
|
|
48
|
+
readonly execution_claim_epoch: number;
|
|
49
|
+
}
|
|
50
|
+
export type PushDriverExecutionAuthorityResolution = {
|
|
51
|
+
readonly kind: "launch";
|
|
52
|
+
readonly binding: WorkerExecutionAuthorityBinding;
|
|
53
|
+
} | {
|
|
54
|
+
readonly kind: "observe";
|
|
55
|
+
readonly binding: WorkerExecutionAuthorityBinding;
|
|
56
|
+
};
|
|
57
|
+
export interface PushDriverExecutionAuthorityCoordinator {
|
|
58
|
+
prepare(context: PushDriverExecutionAuthorityPreparationContext): unknown | Promise<unknown>;
|
|
59
|
+
abandon(context: PushDriverExecutionAuthorityPreparationContext, preparation: unknown): void | Promise<void>;
|
|
60
|
+
bind(context: PushDriverExecutionAuthorityContext, preparation: unknown): WorkerExecutionAuthorityBinding | Promise<WorkerExecutionAuthorityBinding>;
|
|
61
|
+
recover(context: PushDriverExecutionAuthorityContext): PushDriverExecutionAuthorityResolution | Promise<PushDriverExecutionAuthorityResolution>;
|
|
62
|
+
}
|
|
63
|
+
export interface PushDriverCallerAttestationRequest {
|
|
64
|
+
readonly run_id: RunId;
|
|
65
|
+
readonly step_id: string;
|
|
66
|
+
readonly activation_id: string;
|
|
67
|
+
readonly attempt_id: string;
|
|
68
|
+
readonly claim_epoch: number;
|
|
69
|
+
readonly worker_session_id: WorkerSessionId;
|
|
70
|
+
readonly provider_session_id: string | null;
|
|
71
|
+
readonly submission_key_digest: CanonicalResultDigest;
|
|
72
|
+
readonly execution_digest: CanonicalResultDigest;
|
|
73
|
+
}
|
|
74
|
+
export interface PushDriverCallerAttestationAuthority {
|
|
75
|
+
readonly authority_id: string;
|
|
76
|
+
attest(request: PushDriverCallerAttestationRequest): Extract<CanonicalEvidenceRef, {
|
|
77
|
+
kind: "caller_attestation";
|
|
78
|
+
}> | Promise<Extract<CanonicalEvidenceRef, {
|
|
79
|
+
kind: "caller_attestation";
|
|
80
|
+
}>>;
|
|
81
|
+
}
|
|
82
|
+
export interface PushDriverAttemptLifecycleHooks {
|
|
83
|
+
before_execute?(context: PushDriverAttemptContext): Promise<void> | void;
|
|
84
|
+
after_execute?(context: PushDriverAttemptContext, execution: WorkerExecutionWithEvents): Promise<void> | void;
|
|
85
|
+
after_submit?(context: PushDriverAttemptContext, execution: WorkerExecutionWithEvents, response: SubmitResponse): Promise<void> | void;
|
|
86
|
+
on_attempt_error?(context: PushDriverAttemptContext | null, error: unknown): Promise<void> | void;
|
|
87
|
+
}
|
|
88
|
+
export type PushDriverRecoverableWaitReason = "attempt_active" | "dependencies_pending" | "retry_backoff" | "run_cancelling";
|
|
89
|
+
export interface PushDriverWaitContext {
|
|
90
|
+
readonly reason_code: string;
|
|
91
|
+
readonly run: RunView;
|
|
92
|
+
readonly active_attempts: number;
|
|
93
|
+
}
|
|
94
|
+
export type PushDriverWaitDecision = {
|
|
95
|
+
readonly action: "continue";
|
|
96
|
+
readonly delay_ms: number;
|
|
97
|
+
} | {
|
|
98
|
+
readonly action: "stop";
|
|
99
|
+
readonly reason: string | null;
|
|
100
|
+
};
|
|
101
|
+
export type PushDriverWaitStrategy = (context: PushDriverWaitContext) => PushDriverWaitDecision | Promise<PushDriverWaitDecision>;
|
|
102
|
+
export type PushDriverDiagnostic = {
|
|
103
|
+
readonly type: "wait";
|
|
104
|
+
readonly run_id: RunId;
|
|
105
|
+
readonly reason_code: string;
|
|
106
|
+
readonly delay_ms: number | null;
|
|
107
|
+
} | {
|
|
108
|
+
readonly type: "attempt_acquired";
|
|
109
|
+
readonly run_id: RunId;
|
|
110
|
+
readonly attempt_id: string;
|
|
111
|
+
readonly step_id: string;
|
|
112
|
+
} | {
|
|
113
|
+
readonly type: "attempt_attached";
|
|
114
|
+
readonly run_id: RunId;
|
|
115
|
+
readonly attempt_id: string;
|
|
116
|
+
readonly worker_session_id: WorkerSessionId;
|
|
117
|
+
} | {
|
|
118
|
+
readonly type: "heartbeat_failed";
|
|
119
|
+
readonly run_id: RunId;
|
|
120
|
+
readonly attempt_id: string;
|
|
121
|
+
readonly error: unknown;
|
|
122
|
+
} | {
|
|
123
|
+
readonly type: "submission_replayed";
|
|
124
|
+
readonly run_id: RunId;
|
|
125
|
+
readonly attempt_id: string;
|
|
126
|
+
} | {
|
|
127
|
+
readonly type: "attempt_failed";
|
|
128
|
+
readonly run_id: RunId;
|
|
129
|
+
readonly attempt_id: string | null;
|
|
130
|
+
readonly error: unknown;
|
|
131
|
+
};
|
|
132
|
+
export type PushDriverDiagnosticSink = (diagnostic: PushDriverDiagnostic) => Promise<void> | void;
|
|
133
|
+
export interface PushDriverOptions {
|
|
134
|
+
readonly service: PushDriverService;
|
|
135
|
+
readonly provider_factory: PushDriverProviderFactory;
|
|
136
|
+
readonly capabilities?: Partial<DriverCapabilities>;
|
|
137
|
+
readonly execution_authority?: PushDriverExecutionAuthorityCoordinator;
|
|
138
|
+
readonly caller_attestation_authority?: PushDriverCallerAttestationAuthority;
|
|
139
|
+
readonly lifecycle_hooks?: PushDriverAttemptLifecycleHooks;
|
|
140
|
+
readonly diagnostic_sink?: PushDriverDiagnosticSink;
|
|
141
|
+
readonly max_concurrency?: number;
|
|
142
|
+
readonly heartbeat_interval_ms?: number;
|
|
143
|
+
readonly wait_poll_ms?: number;
|
|
144
|
+
readonly wait_strategy?: PushDriverWaitStrategy;
|
|
145
|
+
readonly driver_id?: string;
|
|
146
|
+
readonly create_worker_session_id?: () => WorkerSessionId;
|
|
147
|
+
readonly execute_attempt?: typeof executeWorkerAttempt;
|
|
148
|
+
readonly worker_options?: Omit<WorkerExecutorOptions, "cancellationSignal" | "cancellationReason" | "execution_authority" | "startedAt">;
|
|
149
|
+
readonly sleep?: (milliseconds: number) => Promise<void>;
|
|
150
|
+
}
|
|
151
|
+
export interface PushDriverRunOptions {
|
|
152
|
+
readonly resume?: boolean;
|
|
153
|
+
readonly initial_view?: RunView;
|
|
154
|
+
}
|
|
155
|
+
export declare function mapProviderOutputsToSubmission(node: WorkerNode, outputs: readonly StepOutput[], requireRequiredOutputs: boolean): AttemptExecutionSubmission["outputs"];
|
|
156
|
+
export declare function terminalOutcomeToCanonicalAttemptOutcome(process: TerminalOutcome): CanonicalAttemptOutcome;
|
|
157
|
+
export declare class PushDriver {
|
|
158
|
+
readonly capabilities: Readonly<DriverCapabilities>;
|
|
159
|
+
private readonly service;
|
|
160
|
+
private readonly providerFactory;
|
|
161
|
+
private readonly executionAuthority;
|
|
162
|
+
private readonly callerAttestationAuthority;
|
|
163
|
+
private readonly lifecycleHooks;
|
|
164
|
+
private readonly diagnosticSink;
|
|
165
|
+
private readonly maxConcurrency;
|
|
166
|
+
private readonly heartbeatIntervalMs;
|
|
167
|
+
private readonly waitStrategy;
|
|
168
|
+
private readonly driverId;
|
|
169
|
+
private readonly createWorkerSessionId;
|
|
170
|
+
private readonly executeAttempt;
|
|
171
|
+
private readonly workerOptions;
|
|
172
|
+
private readonly sleep;
|
|
173
|
+
constructor(options: PushDriverOptions);
|
|
174
|
+
private emit;
|
|
175
|
+
private attemptError;
|
|
176
|
+
private assertHeartbeatLease;
|
|
177
|
+
private startHeartbeat;
|
|
178
|
+
private attachIsDefinitivelyFenced;
|
|
179
|
+
private abandonPreparation;
|
|
180
|
+
private reconcilePreparedAttach;
|
|
181
|
+
private driveAttempt;
|
|
182
|
+
private trackAttempt;
|
|
183
|
+
run(runId: RunId, options?: PushDriverRunOptions): Promise<RunView>;
|
|
184
|
+
}
|