harnery 0.22.1 → 0.23.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.
- package/README.md +1 -0
- package/dist/commands/workflow.d.ts.map +1 -1
- package/dist/commands/workflow.js +91 -2
- package/dist/core/work/state.d.ts +7 -0
- package/dist/core/work/state.d.ts.map +1 -1
- package/dist/core/work/state.js +112 -23
- package/dist/core/workflow/child-env.d.ts +10 -6
- package/dist/core/workflow/child-env.d.ts.map +1 -1
- package/dist/core/workflow/child-env.js +15 -7
- package/dist/core/workflow/durable-record.d.ts +7 -0
- package/dist/core/workflow/durable-record.d.ts.map +1 -0
- package/dist/core/workflow/durable-record.js +83 -0
- package/dist/core/workflow/engine.d.ts.map +1 -1
- package/dist/core/workflow/engine.js +208 -29
- package/dist/core/workflow/index.d.ts +2 -0
- package/dist/core/workflow/index.d.ts.map +1 -1
- package/dist/core/workflow/index.js +1 -0
- package/dist/core/workflow/proof.d.ts +4 -0
- package/dist/core/workflow/proof.d.ts.map +1 -1
- package/dist/core/workflow/proof.js +50 -15
- package/dist/core/workflow/run-state.d.ts +3 -0
- package/dist/core/workflow/run-state.d.ts.map +1 -1
- package/dist/core/workflow/run-state.js +25 -13
- package/dist/core/workflow/types.d.ts +10 -0
- package/dist/core/workflow/types.d.ts.map +1 -1
- package/dist/core/workflow/workspaces/attestation-error.d.ts +7 -0
- package/dist/core/workflow/workspaces/attestation-error.d.ts.map +1 -0
- package/dist/core/workflow/workspaces/attestation-error.js +25 -0
- package/dist/core/workflow/workspaces/cancellation.d.ts +8 -0
- package/dist/core/workflow/workspaces/cancellation.d.ts.map +1 -0
- package/dist/core/workflow/workspaces/cancellation.js +95 -0
- package/dist/core/workflow/workspaces/cleanup.d.ts +9 -0
- package/dist/core/workflow/workspaces/cleanup.d.ts.map +1 -0
- package/dist/core/workflow/workspaces/cleanup.js +223 -0
- package/dist/core/workflow/workspaces/execution.d.ts +25 -0
- package/dist/core/workflow/workspaces/execution.d.ts.map +1 -0
- package/dist/core/workflow/workspaces/execution.js +316 -0
- package/dist/core/workflow/workspaces/git.d.ts +25 -0
- package/dist/core/workflow/workspaces/git.d.ts.map +1 -0
- package/dist/core/workflow/workspaces/git.js +102 -0
- package/dist/core/workflow/workspaces/index.d.ts +15 -0
- package/dist/core/workflow/workspaces/index.d.ts.map +1 -0
- package/dist/core/workflow/workspaces/index.js +7 -0
- package/dist/core/workflow/workspaces/inspect.d.ts +85 -0
- package/dist/core/workflow/workspaces/inspect.d.ts.map +1 -0
- package/dist/core/workflow/workspaces/inspect.js +255 -0
- package/dist/core/workflow/workspaces/integration.d.ts +24 -0
- package/dist/core/workflow/workspaces/integration.d.ts.map +1 -0
- package/dist/core/workflow/workspaces/integration.js +617 -0
- package/dist/core/workflow/workspaces/leases.d.ts +37 -0
- package/dist/core/workflow/workspaces/leases.d.ts.map +1 -0
- package/dist/core/workflow/workspaces/leases.js +380 -0
- package/dist/core/workflow/workspaces/lifecycle.d.ts +43 -0
- package/dist/core/workflow/workspaces/lifecycle.d.ts.map +1 -0
- package/dist/core/workflow/workspaces/lifecycle.js +622 -0
- package/dist/core/workflow/workspaces/local-git.d.ts +8 -0
- package/dist/core/workflow/workspaces/local-git.d.ts.map +1 -0
- package/dist/core/workflow/workspaces/local-git.js +1474 -0
- package/dist/core/workflow/workspaces/paths.d.ts +23 -0
- package/dist/core/workflow/workspaces/paths.d.ts.map +1 -0
- package/dist/core/workflow/workspaces/paths.js +191 -0
- package/dist/core/workflow/workspaces/recovery.d.ts +3 -0
- package/dist/core/workflow/workspaces/recovery.d.ts.map +1 -0
- package/dist/core/workflow/workspaces/recovery.js +50 -0
- package/dist/core/workflow/workspaces/state.d.ts +60 -0
- package/dist/core/workflow/workspaces/state.d.ts.map +1 -0
- package/dist/core/workflow/workspaces/state.js +296 -0
- package/dist/core/workflow/workspaces/types.d.ts +445 -0
- package/dist/core/workflow/workspaces/types.d.ts.map +1 -0
- package/dist/core/workflow/workspaces/types.js +2 -0
- package/dist/core/workflow/workspaces/validate.d.ts +14 -0
- package/dist/core/workflow/workspaces/validate.d.ts.map +1 -0
- package/dist/core/workflow/workspaces/validate.js +476 -0
- package/package.json +5 -3
- package/src/commands/workflow.ts +110 -4
- package/src/core/work/state.ts +156 -28
- package/src/core/workflow/child-env.ts +18 -7
- package/src/core/workflow/durable-record.ts +94 -0
- package/src/core/workflow/engine.ts +230 -30
- package/src/core/workflow/index.ts +73 -0
- package/src/core/workflow/proof.ts +70 -22
- package/src/core/workflow/run-state.ts +46 -11
- package/src/core/workflow/types.ts +14 -0
- package/src/core/workflow/workspaces/attestation-error.ts +30 -0
- package/src/core/workflow/workspaces/cancellation.ts +137 -0
- package/src/core/workflow/workspaces/cleanup.ts +308 -0
- package/src/core/workflow/workspaces/execution.ts +412 -0
- package/src/core/workflow/workspaces/git.ts +125 -0
- package/src/core/workflow/workspaces/index.ts +85 -0
- package/src/core/workflow/workspaces/inspect.ts +421 -0
- package/src/core/workflow/workspaces/integration.ts +829 -0
- package/src/core/workflow/workspaces/leases.ts +495 -0
- package/src/core/workflow/workspaces/lifecycle.ts +792 -0
- package/src/core/workflow/workspaces/local-git.ts +1892 -0
- package/src/core/workflow/workspaces/paths.ts +247 -0
- package/src/core/workflow/workspaces/recovery.ts +56 -0
- package/src/core/workflow/workspaces/state.ts +481 -0
- package/src/core/workflow/workspaces/types.ts +517 -0
- package/src/core/workflow/workspaces/validate.ts +595 -0
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import { policyDigest } from "../../policy/index.js";
|
|
3
|
+
import { WorkspaceAttestationError, workspaceAttestationFromError } from "./attestation-error.js";
|
|
4
|
+
import { assertContainedExisting, containsPath, filesystemIdentity, sameFilesystemIdentity, validateConfiguredRoot, } from "./paths.js";
|
|
5
|
+
import { appendWorkflowJournalEvent, stableDigest, writeWorkspaceRequest } from "./state.js";
|
|
6
|
+
import { isWorkspaceAttestation, isWorkspaceBinding } from "./validate.js";
|
|
7
|
+
export async function resolveWorkspaceBinding(input) {
|
|
8
|
+
if (input.isolation === "shared")
|
|
9
|
+
return undefined;
|
|
10
|
+
if (input.isolation !== "worktree" &&
|
|
11
|
+
input.isolation !== "sandbox" &&
|
|
12
|
+
input.isolation !== "remote") {
|
|
13
|
+
throw new Error(`unsupported workflow isolation ${JSON.stringify(input.isolation)}`);
|
|
14
|
+
}
|
|
15
|
+
if (input.resumeState && !input.resumeState.manifest.execution.workspace_binding) {
|
|
16
|
+
return undefined;
|
|
17
|
+
}
|
|
18
|
+
const capability = input.isolation;
|
|
19
|
+
const provider = input.provider;
|
|
20
|
+
if (!provider) {
|
|
21
|
+
if (input.resumeState?.manifest.execution.workspace_binding) {
|
|
22
|
+
throw new Error("isolated workflow resume requires the frozen workspace provider");
|
|
23
|
+
}
|
|
24
|
+
const fallback = {
|
|
25
|
+
schema_version: 1,
|
|
26
|
+
run_id: input.runId,
|
|
27
|
+
requested_isolation: capability,
|
|
28
|
+
effective_isolation: "shared",
|
|
29
|
+
selection_reason: "provider_not_configured",
|
|
30
|
+
terminal_lifecycle_state: "shared",
|
|
31
|
+
drift: [],
|
|
32
|
+
unsupported: [
|
|
33
|
+
{
|
|
34
|
+
code: "provider_not_configured",
|
|
35
|
+
message: "no workspace provider is configured; shared execution was selected",
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
unknowns: [],
|
|
39
|
+
receipts: {},
|
|
40
|
+
};
|
|
41
|
+
appendWorkflowJournalEvent(input.opts.coordRoot, input.runId, "workspace.compatibility", {
|
|
42
|
+
requested_isolation: fallback.requested_isolation,
|
|
43
|
+
effective_isolation: fallback.effective_isolation,
|
|
44
|
+
selection_reason: fallback.selection_reason,
|
|
45
|
+
unsupported: fallback.unsupported,
|
|
46
|
+
});
|
|
47
|
+
input.onUnsupportedFallback?.(fallback);
|
|
48
|
+
return undefined;
|
|
49
|
+
}
|
|
50
|
+
const frozenBinding = input.resumeState?.manifest.execution.workspace_binding;
|
|
51
|
+
if (frozenBinding) {
|
|
52
|
+
const roots = input.opts.workspace?.writableRoots;
|
|
53
|
+
if (!roots || roots.length === 0) {
|
|
54
|
+
throw new Error("isolated workflow resume requires explicit writable roots");
|
|
55
|
+
}
|
|
56
|
+
assertWorkspaceRootAuthority(frozenBinding, roots, input.policy?.allowed_paths ?? []);
|
|
57
|
+
const probe = await provider.probe({
|
|
58
|
+
requested_cwd: frozenBinding.repository?.source_root.configured ?? input.cwd,
|
|
59
|
+
writable_roots: roots,
|
|
60
|
+
});
|
|
61
|
+
if (probe.capabilities.provider_id !== frozenBinding.provider.id ||
|
|
62
|
+
probe.capabilities.provider_version !== frozenBinding.provider.version ||
|
|
63
|
+
probe.capabilities.capability_digest !== frozenBinding.provider.capability_digest) {
|
|
64
|
+
throw new Error("parked workflow provider identity or capabilities drifted");
|
|
65
|
+
}
|
|
66
|
+
const providerBinding = await provider.readBinding(frozenBinding);
|
|
67
|
+
if (JSON.stringify(providerBinding) !== JSON.stringify(frozenBinding)) {
|
|
68
|
+
throw new Error("parked workflow binding differs from the immutable provider record");
|
|
69
|
+
}
|
|
70
|
+
const reattached = await provider.reattach(frozenBinding);
|
|
71
|
+
if (!isWorkspaceAttestation(reattached, frozenBinding) || reattached.status !== "ok") {
|
|
72
|
+
if (isWorkspaceAttestation(reattached, frozenBinding)) {
|
|
73
|
+
throw new WorkspaceAttestationError(`workflow run ${input.runId} could not reattach its frozen workspace`, reattached);
|
|
74
|
+
}
|
|
75
|
+
throw new Error(`workflow run ${input.runId} could not reattach its frozen workspace`);
|
|
76
|
+
}
|
|
77
|
+
appendWorkflowJournalEvent(input.opts.coordRoot, input.runId, "workspace.reattach", {
|
|
78
|
+
binding_id: frozenBinding.binding_id,
|
|
79
|
+
provider_id: frozenBinding.provider.id,
|
|
80
|
+
attestation_sha256: stableDigest(reattached),
|
|
81
|
+
});
|
|
82
|
+
return frozenBinding;
|
|
83
|
+
}
|
|
84
|
+
const roots = input.opts.workspace?.writableRoots;
|
|
85
|
+
if (roots?.length !== 1) {
|
|
86
|
+
throw new Error("isolated workflow allocation requires one explicitly selected writable root");
|
|
87
|
+
}
|
|
88
|
+
const selectedRoot = validateConfiguredRoot(roots[0]);
|
|
89
|
+
const sourceRoot = validateConfiguredRoot(input.cwd);
|
|
90
|
+
const allowedRoots = (input.policy?.allowed_paths ?? []).map((path) => validateConfiguredRoot(path));
|
|
91
|
+
if (sourceRoot.configured !== input.cwd ||
|
|
92
|
+
(allowedRoots.length > 0 &&
|
|
93
|
+
!allowedRoots.some((path) => containsPath(path.realpath, sourceRoot.realpath)))) {
|
|
94
|
+
throw new Error("workflow source root is outside frozen path authority");
|
|
95
|
+
}
|
|
96
|
+
if (allowedRoots.length > 0 &&
|
|
97
|
+
!allowedRoots.some((path) => containsPath(path.realpath, selectedRoot.realpath))) {
|
|
98
|
+
throw new Error("workspace writable root is outside frozen path authority");
|
|
99
|
+
}
|
|
100
|
+
const probe = await provider.probe({
|
|
101
|
+
requested_cwd: input.cwd,
|
|
102
|
+
writable_roots: [selectedRoot.configured],
|
|
103
|
+
});
|
|
104
|
+
if (!probe.supported ||
|
|
105
|
+
probe.unsupported.length > 0 ||
|
|
106
|
+
!probe.capabilities.isolation.includes(capability)) {
|
|
107
|
+
if (input.policy?.allowed_isolation?.includes("shared")) {
|
|
108
|
+
const unsupported = probe.unsupported.length > 0
|
|
109
|
+
? [...probe.unsupported]
|
|
110
|
+
: [
|
|
111
|
+
{
|
|
112
|
+
code: "isolation_unsupported",
|
|
113
|
+
message: `provider does not support ${capability} isolation`,
|
|
114
|
+
},
|
|
115
|
+
];
|
|
116
|
+
const fallback = {
|
|
117
|
+
schema_version: 1,
|
|
118
|
+
run_id: input.runId,
|
|
119
|
+
requested_isolation: capability,
|
|
120
|
+
effective_isolation: "shared",
|
|
121
|
+
selection_reason: "provider_unsupported",
|
|
122
|
+
provider: {
|
|
123
|
+
id: probe.capabilities.provider_id,
|
|
124
|
+
version: probe.capabilities.provider_version,
|
|
125
|
+
capability_digest: probe.capabilities.capability_digest,
|
|
126
|
+
},
|
|
127
|
+
terminal_lifecycle_state: "shared",
|
|
128
|
+
drift: [],
|
|
129
|
+
unsupported,
|
|
130
|
+
unknowns: [...probe.unknowns],
|
|
131
|
+
receipts: {},
|
|
132
|
+
};
|
|
133
|
+
appendWorkflowJournalEvent(input.opts.coordRoot, input.runId, "workspace.fallback", {
|
|
134
|
+
requested_isolation: fallback.requested_isolation,
|
|
135
|
+
effective_isolation: fallback.effective_isolation,
|
|
136
|
+
selection_reason: fallback.selection_reason,
|
|
137
|
+
provider_id: fallback.provider?.id,
|
|
138
|
+
unsupported: fallback.unsupported,
|
|
139
|
+
});
|
|
140
|
+
input.onUnsupportedFallback?.(fallback);
|
|
141
|
+
return undefined;
|
|
142
|
+
}
|
|
143
|
+
throw new Error(`workspace provider ${probe.capabilities.provider_id} does not support ${capability}: ${probe.unsupported.map((item) => item.message).join("; ") || "unsupported capability"}`);
|
|
144
|
+
}
|
|
145
|
+
if (input.opts.workItemId && !input.attemptContext) {
|
|
146
|
+
throw new Error("isolated work-linked execution requires a frozen attempt identity");
|
|
147
|
+
}
|
|
148
|
+
const requestWithoutKey = {
|
|
149
|
+
schema_version: 1,
|
|
150
|
+
run_id: input.runId,
|
|
151
|
+
owner: input.opts.workItemId && input.attemptContext
|
|
152
|
+
? {
|
|
153
|
+
kind: "work_attempt",
|
|
154
|
+
work_item_id: input.opts.workItemId,
|
|
155
|
+
attempt: input.attemptContext.number,
|
|
156
|
+
}
|
|
157
|
+
: { kind: "standalone", work_item_id: null, attempt: null },
|
|
158
|
+
requested_cwd: input.cwd,
|
|
159
|
+
requested_isolation: capability,
|
|
160
|
+
network_access: input.opts.networkAccess ?? "unknown",
|
|
161
|
+
script: { path: input.absScript, sha256: input.scriptSha256 },
|
|
162
|
+
policy_sha256: input.policy ? policyDigest(input.policy) : null,
|
|
163
|
+
allowed_paths: allowedRoots,
|
|
164
|
+
writable_roots: [selectedRoot],
|
|
165
|
+
selected_writable_root: selectedRoot,
|
|
166
|
+
provider_id: probe.capabilities.provider_id,
|
|
167
|
+
capability_digest: probe.capabilities.capability_digest,
|
|
168
|
+
};
|
|
169
|
+
const request = {
|
|
170
|
+
...requestWithoutKey,
|
|
171
|
+
idempotency_key: stableDigest(requestWithoutKey),
|
|
172
|
+
};
|
|
173
|
+
writeWorkspaceRequest(input.opts.coordRoot, request);
|
|
174
|
+
appendWorkflowJournalEvent(input.opts.coordRoot, input.runId, "execution.allocate.start", {
|
|
175
|
+
provider_id: probe.capabilities.provider_id,
|
|
176
|
+
request_sha256: stableDigest(request),
|
|
177
|
+
});
|
|
178
|
+
const binding = await provider.allocate(request);
|
|
179
|
+
if (!isWorkspaceBinding(binding, input.runId) ||
|
|
180
|
+
binding.request_sha256 !== stableDigest(request) ||
|
|
181
|
+
stableDigest(binding.owner) !== stableDigest(request.owner) ||
|
|
182
|
+
binding.provider.id !== probe.capabilities.provider_id ||
|
|
183
|
+
binding.provider.version !== probe.capabilities.provider_version ||
|
|
184
|
+
binding.provider.capability_digest !== probe.capabilities.capability_digest ||
|
|
185
|
+
binding.isolation !== capability) {
|
|
186
|
+
throw new Error("workspace provider returned a binding that does not match the frozen request");
|
|
187
|
+
}
|
|
188
|
+
const providerBinding = await provider.readBinding(binding);
|
|
189
|
+
if (JSON.stringify(providerBinding) !== JSON.stringify(binding)) {
|
|
190
|
+
throw new Error("workspace provider returned bytes that differ from its immutable binding");
|
|
191
|
+
}
|
|
192
|
+
assertWorkspaceRootAuthority(binding, [selectedRoot.configured], input.policy?.allowed_paths ?? []);
|
|
193
|
+
const attestation = await provider.reattach(binding);
|
|
194
|
+
if (!isWorkspaceAttestation(attestation, binding) || attestation.status !== "ok") {
|
|
195
|
+
if (isWorkspaceAttestation(attestation, binding)) {
|
|
196
|
+
throw new WorkspaceAttestationError("workspace provider returned a binding that failed initial attestation", attestation);
|
|
197
|
+
}
|
|
198
|
+
throw new Error("workspace provider returned a binding that failed initial attestation");
|
|
199
|
+
}
|
|
200
|
+
appendWorkflowJournalEvent(input.opts.coordRoot, input.runId, "execution.allocate.end", {
|
|
201
|
+
binding_id: binding.binding_id,
|
|
202
|
+
provider_id: binding.provider.id,
|
|
203
|
+
active_root: binding.active_root,
|
|
204
|
+
attestation_sha256: stableDigest(attestation),
|
|
205
|
+
});
|
|
206
|
+
return binding;
|
|
207
|
+
}
|
|
208
|
+
function assertWorkspaceRootAuthority(binding, configuredRoots, allowedPaths) {
|
|
209
|
+
const roots = configuredRoots.map((root) => validateConfiguredRoot(root));
|
|
210
|
+
const authority = roots.find((root) => root.configured === binding.writable_root.configured &&
|
|
211
|
+
root.realpath === binding.writable_root.realpath &&
|
|
212
|
+
sameFilesystemIdentity(root.identity, binding.writable_root.identity));
|
|
213
|
+
if (!authority) {
|
|
214
|
+
throw new Error("workspace provider binding is outside the explicit writable-root authority");
|
|
215
|
+
}
|
|
216
|
+
if (allowedPaths.length > 0 &&
|
|
217
|
+
(!allowedPaths.some((root) => containsPath(root, binding.workspace_root)) ||
|
|
218
|
+
!allowedPaths.some((root) => containsPath(root, binding.active_root)) ||
|
|
219
|
+
(binding.repository !== undefined &&
|
|
220
|
+
(!allowedPaths.some((root) => containsPath(root, binding.repository.source_root.realpath)) ||
|
|
221
|
+
!allowedPaths.some((root) => containsPath(root, binding.repository.common_dir.realpath)))))) {
|
|
222
|
+
throw new Error("workspace provider binding is outside frozen policy path authority");
|
|
223
|
+
}
|
|
224
|
+
assertContainedExisting(authority, binding.workspace_root, "workspace root");
|
|
225
|
+
assertContainedExisting(authority, binding.active_root, "active workspace root");
|
|
226
|
+
if (!sameFilesystemIdentity(filesystemIdentity(binding.workspace_root), binding.workspace_root_identity)) {
|
|
227
|
+
throw new Error("workspace root identity differs from the frozen binding");
|
|
228
|
+
}
|
|
229
|
+
if (!sameFilesystemIdentity(filesystemIdentity(binding.active_root), binding.active_root_identity)) {
|
|
230
|
+
throw new Error("active workspace root identity differs from the frozen binding");
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
export async function attestTerminal(provider, binding) {
|
|
234
|
+
if (!provider)
|
|
235
|
+
return failedWorkspaceAttestation(binding, "workspace provider is unavailable");
|
|
236
|
+
try {
|
|
237
|
+
const attestation = await provider.attest(binding);
|
|
238
|
+
return isWorkspaceAttestation(attestation, binding)
|
|
239
|
+
? attestation
|
|
240
|
+
: failedWorkspaceAttestation(binding, "workspace provider returned invalid attestation");
|
|
241
|
+
}
|
|
242
|
+
catch (error) {
|
|
243
|
+
return (workspaceAttestationFromError(error, binding) ??
|
|
244
|
+
failedWorkspaceAttestation(binding, errorMessage(error)));
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
export async function attestWorkspaceFailure(provider, binding, error) {
|
|
248
|
+
const carried = workspaceAttestationFromError(error, binding);
|
|
249
|
+
if (carried)
|
|
250
|
+
return carried;
|
|
251
|
+
const observed = await attestTerminal(provider, binding);
|
|
252
|
+
if (observed.status !== "ok")
|
|
253
|
+
return observed;
|
|
254
|
+
return {
|
|
255
|
+
...observed,
|
|
256
|
+
provider_drift: [...observed.provider_drift, errorMessage(error)],
|
|
257
|
+
resource_state: observed.workspace_exists ? "blocked" : "lost",
|
|
258
|
+
status: observed.workspace_exists ? "blocked" : "lost",
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
function failedWorkspaceAttestation(binding, message) {
|
|
262
|
+
const workspaceExists = existsSync(binding.workspace_root);
|
|
263
|
+
let rootMatch = false;
|
|
264
|
+
let workspaceContained = false;
|
|
265
|
+
let activeContained = false;
|
|
266
|
+
let workspaceIdentity;
|
|
267
|
+
let activeIdentity;
|
|
268
|
+
try {
|
|
269
|
+
const root = validateConfiguredRoot(binding.writable_root.configured);
|
|
270
|
+
rootMatch =
|
|
271
|
+
root.realpath === binding.writable_root.realpath &&
|
|
272
|
+
sameFilesystemIdentity(root.identity, binding.writable_root.identity);
|
|
273
|
+
if (workspaceExists) {
|
|
274
|
+
const workspaceReal = assertContainedExisting(root, binding.workspace_root, "workspace root");
|
|
275
|
+
workspaceContained = workspaceReal === binding.workspace_root;
|
|
276
|
+
workspaceIdentity = filesystemIdentity(workspaceReal);
|
|
277
|
+
}
|
|
278
|
+
if (existsSync(binding.active_root)) {
|
|
279
|
+
const activeReal = assertContainedExisting(root, binding.active_root, "active root");
|
|
280
|
+
activeContained = activeReal === binding.active_root;
|
|
281
|
+
activeIdentity = filesystemIdentity(activeReal);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
catch {
|
|
285
|
+
// Preserve the facts that could be observed before path validation failed.
|
|
286
|
+
}
|
|
287
|
+
return {
|
|
288
|
+
schema_version: 1,
|
|
289
|
+
binding_id: binding.binding_id,
|
|
290
|
+
workspace_id: binding.workspace_id,
|
|
291
|
+
run_id: binding.run_id,
|
|
292
|
+
owner: binding.owner,
|
|
293
|
+
provider: binding.provider,
|
|
294
|
+
recorded_at: new Date().toISOString(),
|
|
295
|
+
containment: {
|
|
296
|
+
writable_root: rootMatch,
|
|
297
|
+
workspace_root: workspaceContained,
|
|
298
|
+
active_root: activeContained,
|
|
299
|
+
integration_root: null,
|
|
300
|
+
},
|
|
301
|
+
filesystem: {
|
|
302
|
+
root_identity_match: rootMatch,
|
|
303
|
+
workspace_identity: workspaceIdentity,
|
|
304
|
+
active_identity: activeIdentity,
|
|
305
|
+
},
|
|
306
|
+
provider_drift: [message],
|
|
307
|
+
workspace_exists: workspaceExists,
|
|
308
|
+
resource_state: workspaceExists ? "blocked" : "lost",
|
|
309
|
+
unsupported: [],
|
|
310
|
+
unknowns: [],
|
|
311
|
+
status: workspaceExists ? "blocked" : "lost",
|
|
312
|
+
};
|
|
313
|
+
}
|
|
314
|
+
function errorMessage(error) {
|
|
315
|
+
return error instanceof Error ? error.message : String(error);
|
|
316
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export type GitResult = {
|
|
2
|
+
ok: true;
|
|
3
|
+
out: string;
|
|
4
|
+
} | {
|
|
5
|
+
ok: false;
|
|
6
|
+
err: string;
|
|
7
|
+
};
|
|
8
|
+
export declare function git(cwd: string, args: readonly string[]): string;
|
|
9
|
+
export declare function gitMaybe(cwd: string, args: readonly string[]): GitResult;
|
|
10
|
+
export declare function gitMaybeWithDirectoryDescriptor(cwd: string, args: readonly string[], fd: number): GitResult;
|
|
11
|
+
export declare function worktreeInventory(cwd: string): Array<{
|
|
12
|
+
path: string;
|
|
13
|
+
ref?: string;
|
|
14
|
+
head?: string;
|
|
15
|
+
}>;
|
|
16
|
+
export declare function parseWorktreeInventory(body: string): Array<{
|
|
17
|
+
path: string;
|
|
18
|
+
ref?: string;
|
|
19
|
+
head?: string;
|
|
20
|
+
}>;
|
|
21
|
+
export declare function gitOperations(cwd: string): string[];
|
|
22
|
+
export declare function overwriteRiskPaths(cwd: string, changed: readonly string[]): string[];
|
|
23
|
+
export declare function isAncestor(cwd: string, ancestor: string, descendant: string): boolean;
|
|
24
|
+
export declare function nulEntries(value: string): string[];
|
|
25
|
+
//# sourceMappingURL=git.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../../../src/core/workflow/workspaces/git.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,SAAS,GAAG;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAE/E,wBAAgB,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAIhE;AAED,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAExE;AAED,wBAAgB,+BAA+B,CAC7C,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,EAAE,EAAE,MAAM,GACT,SAAS,CAKX;AAED,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,MAAM,GACV,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAEtD;AAED,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,MAAM,GACX,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAgBtD;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAenD;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAOpF;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAErF;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAElD"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { spawnSync } from "node:child_process";
|
|
2
|
+
import { existsSync, realpathSync } from "node:fs";
|
|
3
|
+
import { join, resolve } from "node:path";
|
|
4
|
+
const MAX_GIT_OUTPUT = 8 * 1024 * 1024;
|
|
5
|
+
const GIT_TIMEOUT_MS = 30_000;
|
|
6
|
+
export function git(cwd, args) {
|
|
7
|
+
const result = gitMaybe(cwd, args);
|
|
8
|
+
if (!result.ok)
|
|
9
|
+
throw new Error(result.err || `git ${args.join(" ")} failed`);
|
|
10
|
+
return result.out;
|
|
11
|
+
}
|
|
12
|
+
export function gitMaybe(cwd, args) {
|
|
13
|
+
return runGit(cwd, args);
|
|
14
|
+
}
|
|
15
|
+
export function gitMaybeWithDirectoryDescriptor(cwd, args, fd) {
|
|
16
|
+
const stdio = ["ignore", "pipe", "pipe"];
|
|
17
|
+
while (stdio.length <= fd)
|
|
18
|
+
stdio.push("ignore");
|
|
19
|
+
stdio[fd] = fd;
|
|
20
|
+
return runGit(cwd, args, stdio);
|
|
21
|
+
}
|
|
22
|
+
export function worktreeInventory(cwd) {
|
|
23
|
+
return parseWorktreeInventory(git(cwd, ["worktree", "list", "--porcelain"]));
|
|
24
|
+
}
|
|
25
|
+
export function parseWorktreeInventory(body) {
|
|
26
|
+
const entries = [];
|
|
27
|
+
let current;
|
|
28
|
+
const fields = body.includes("\0") ? body.split("\0") : body.split("\n");
|
|
29
|
+
for (const field of fields) {
|
|
30
|
+
if (field.startsWith("worktree ")) {
|
|
31
|
+
if (current)
|
|
32
|
+
entries.push(current);
|
|
33
|
+
current = { path: field.slice("worktree ".length) };
|
|
34
|
+
}
|
|
35
|
+
else if (current && field.startsWith("HEAD ")) {
|
|
36
|
+
current.head = field.slice("HEAD ".length);
|
|
37
|
+
}
|
|
38
|
+
else if (current && field.startsWith("branch ")) {
|
|
39
|
+
current.ref = field.slice("branch ".length);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
if (current)
|
|
43
|
+
entries.push(current);
|
|
44
|
+
return entries;
|
|
45
|
+
}
|
|
46
|
+
export function gitOperations(cwd) {
|
|
47
|
+
const gitDir = realpathSync(resolve(cwd, git(cwd, ["rev-parse", "--git-dir"])));
|
|
48
|
+
const candidates = [
|
|
49
|
+
["MERGE_HEAD", "merge"],
|
|
50
|
+
["CHERRY_PICK_HEAD", "cherry-pick"],
|
|
51
|
+
["REVERT_HEAD", "revert"],
|
|
52
|
+
["BISECT_LOG", "bisect"],
|
|
53
|
+
["rebase-merge", "rebase"],
|
|
54
|
+
["rebase-apply", "rebase"],
|
|
55
|
+
];
|
|
56
|
+
return [
|
|
57
|
+
...new Set(candidates.filter(([entry]) => existsSync(join(gitDir, entry))).map(([, name]) => name)),
|
|
58
|
+
];
|
|
59
|
+
}
|
|
60
|
+
export function overwriteRiskPaths(cwd, changed) {
|
|
61
|
+
const untracked = nulEntries(git(cwd, ["ls-files", "-z", "--others", "--exclude-standard"]));
|
|
62
|
+
const ignored = nulEntries(git(cwd, ["ls-files", "-z", "--others", "--ignored", "--exclude-standard"]));
|
|
63
|
+
const candidates = new Set([...untracked, ...ignored]);
|
|
64
|
+
return changed.filter((path) => candidates.has(path));
|
|
65
|
+
}
|
|
66
|
+
export function isAncestor(cwd, ancestor, descendant) {
|
|
67
|
+
return gitMaybe(cwd, ["merge-base", "--is-ancestor", ancestor, descendant]).ok;
|
|
68
|
+
}
|
|
69
|
+
export function nulEntries(value) {
|
|
70
|
+
return value.split("\0").filter(Boolean);
|
|
71
|
+
}
|
|
72
|
+
function runGit(cwd, args, stdio) {
|
|
73
|
+
const result = spawnSync("git", [...args], {
|
|
74
|
+
cwd,
|
|
75
|
+
encoding: "utf8",
|
|
76
|
+
env: isolatedGitEnvironment(),
|
|
77
|
+
maxBuffer: MAX_GIT_OUTPUT,
|
|
78
|
+
timeout: GIT_TIMEOUT_MS,
|
|
79
|
+
stdio,
|
|
80
|
+
});
|
|
81
|
+
if (result.status !== 0) {
|
|
82
|
+
return {
|
|
83
|
+
ok: false,
|
|
84
|
+
err: (result.stderr || result.stdout || result.error?.message || "git failed").trim(),
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
return { ok: true, out: result.stdout.replace(/\n$/, "") };
|
|
88
|
+
}
|
|
89
|
+
function isolatedGitEnvironment() {
|
|
90
|
+
const env = { ...process.env };
|
|
91
|
+
for (const key of Object.keys(env)) {
|
|
92
|
+
if (key.startsWith("GIT_"))
|
|
93
|
+
delete env[key];
|
|
94
|
+
}
|
|
95
|
+
env.GIT_TERMINAL_PROMPT = "0";
|
|
96
|
+
env.GIT_CONFIG_NOSYSTEM = "1";
|
|
97
|
+
env.GCM_INTERACTIVE = "Never";
|
|
98
|
+
env.GIT_CONFIG_COUNT = "1";
|
|
99
|
+
env.GIT_CONFIG_KEY_0 = "core.hooksPath";
|
|
100
|
+
env.GIT_CONFIG_VALUE_0 = process.platform === "win32" ? "NUL" : "/dev/null";
|
|
101
|
+
return env;
|
|
102
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type { CancelWorkspaceInput } from "./cancellation.js";
|
|
2
|
+
export { cancelWorkspace } from "./cancellation.js";
|
|
3
|
+
export type { CleanupWorkspaceInput } from "./cleanup.js";
|
|
4
|
+
export { cleanupWorkspace } from "./cleanup.js";
|
|
5
|
+
export type { WorkflowWorkspaceInspection, WorkflowWorkspaceSelection, WorkflowWorkspaceStatus, WorkflowWorkspaceVerification, } from "./inspect.js";
|
|
6
|
+
export { inspectWorkflowWorkspace, listWorkflowWorkspaceInspections, readWorkflowWorkspaceStatus, renderWorkflowWorkspaceStatus, } from "./inspect.js";
|
|
7
|
+
export type { ApplyIntegrationInput, PrepareIntegrationInput } from "./integration.js";
|
|
8
|
+
export { applyIntegration, prepareIntegration } from "./integration.js";
|
|
9
|
+
export type { WorkspaceLifecycleProjection, WorkspaceLifecycleProjectionInput, } from "./lifecycle.js";
|
|
10
|
+
export { assertWorkspaceLifecycleTransition, deriveWorkspaceLifecycle, isWorkspaceLifecycleState, validateProviderEventChain, } from "./lifecycle.js";
|
|
11
|
+
export type { LocalGitWorktreeProviderOptions } from "./local-git.js";
|
|
12
|
+
export { createLocalGitWorktreeProvider, probe as probeLocalGitWorktreeProvider, } from "./local-git.js";
|
|
13
|
+
export type { AuthorizedIntegrationPlan, AuthorizedProviderIntegrationInput, FilesystemIdentity, GitRepositoryBinding, IntegrationApplyAttempt, IntegrationApplyReceipt, IntegrationAuthorization, IntegrationPlan, IntegrationReviewRecord, IntegrationTarget, ProviderIntegrationInput, ProviderIntegrationPreview, ProviderIntegrationResult, ProviderUnknown, ProviderUnsupportedReason, RepositoryBinding, RepositoryObservation, ValidatedFilesystemPath, ValidatedFilesystemRoot, WorkspaceAllocationRequest, WorkspaceAttestation, WorkspaceBinding, WorkspaceBoundExecutionEvidence, WorkspaceCancellationReceipt, WorkspaceCancellationResult, WorkspaceCleanupAttempt, WorkspaceCleanupIntent, WorkspaceCleanupMode, WorkspaceCleanupReceipt, WorkspaceCleanupResult, WorkspaceCompatibilityExecutionEvidence, WorkspaceExecutionEvidence, WorkspaceIntegrationState, WorkspaceIsolation, WorkspaceLifecycleState, WorkspaceObservation, WorkspaceOwner, WorkspaceProbeInput, WorkspaceProbeResult, WorkspaceProofLifecycleState, WorkspaceProofOutcome, WorkspaceProvider, WorkspaceProviderCapabilities, WorkspaceProviderRef, WorkspaceResourceState, WorkspaceUnsupportedExecutionEvidence, } from "./types.js";
|
|
14
|
+
export { WORKSPACE_BINDING_SCHEMA_VERSION, WORKSPACE_RECEIPT_SCHEMA_VERSION, } from "./types.js";
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/workflow/workspaces/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,YAAY,EACV,2BAA2B,EAC3B,0BAA0B,EAC1B,uBAAuB,EACvB,6BAA6B,GAC9B,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,wBAAwB,EACxB,gCAAgC,EAChC,2BAA2B,EAC3B,6BAA6B,GAC9B,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AACvF,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACxE,YAAY,EACV,4BAA4B,EAC5B,iCAAiC,GAClC,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,kCAAkC,EAClC,wBAAwB,EACxB,yBAAyB,EACzB,0BAA0B,GAC3B,MAAM,gBAAgB,CAAC;AACxB,YAAY,EAAE,+BAA+B,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,EACL,8BAA8B,EAC9B,KAAK,IAAI,6BAA6B,GACvC,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACV,yBAAyB,EACzB,kCAAkC,EAClC,kBAAkB,EAClB,oBAAoB,EACpB,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,eAAe,EACf,uBAAuB,EACvB,iBAAiB,EACjB,wBAAwB,EACxB,0BAA0B,EAC1B,yBAAyB,EACzB,eAAe,EACf,yBAAyB,EACzB,iBAAiB,EACjB,qBAAqB,EACrB,uBAAuB,EACvB,uBAAuB,EACvB,0BAA0B,EAC1B,oBAAoB,EACpB,gBAAgB,EAChB,+BAA+B,EAC/B,4BAA4B,EAC5B,2BAA2B,EAC3B,uBAAuB,EACvB,sBAAsB,EACtB,oBAAoB,EACpB,uBAAuB,EACvB,sBAAsB,EACtB,uCAAuC,EACvC,0BAA0B,EAC1B,yBAAyB,EACzB,kBAAkB,EAClB,uBAAuB,EACvB,oBAAoB,EACpB,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,4BAA4B,EAC5B,qBAAqB,EACrB,iBAAiB,EACjB,6BAA6B,EAC7B,oBAAoB,EACpB,sBAAsB,EACtB,qCAAqC,GACtC,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,gCAAgC,EAChC,gCAAgC,GACjC,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { cancelWorkspace } from "./cancellation.js";
|
|
2
|
+
export { cleanupWorkspace } from "./cleanup.js";
|
|
3
|
+
export { inspectWorkflowWorkspace, listWorkflowWorkspaceInspections, readWorkflowWorkspaceStatus, renderWorkflowWorkspaceStatus, } from "./inspect.js";
|
|
4
|
+
export { applyIntegration, prepareIntegration } from "./integration.js";
|
|
5
|
+
export { assertWorkspaceLifecycleTransition, deriveWorkspaceLifecycle, isWorkspaceLifecycleState, validateProviderEventChain, } from "./lifecycle.js";
|
|
6
|
+
export { createLocalGitWorktreeProvider, probe as probeLocalGitWorktreeProvider, } from "./local-git.js";
|
|
7
|
+
export { WORKSPACE_BINDING_SCHEMA_VERSION, WORKSPACE_RECEIPT_SCHEMA_VERSION, } from "./types.js";
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import type { WorkflowProof } from "../types.js";
|
|
2
|
+
import { type WorkspaceLifecycleProjection } from "./lifecycle.js";
|
|
3
|
+
import type { WorkspaceCompatibilityExecutionEvidence, WorkspaceIsolation, WorkspaceProviderRef } from "./types.js";
|
|
4
|
+
export type WorkflowWorkspaceSelection = "shared" | "compatibility" | "isolated";
|
|
5
|
+
export type WorkflowWorkspaceVerification = "not_applicable" | "pending" | "ok" | "blocked" | "lost";
|
|
6
|
+
export interface WorkflowWorkspaceStatus {
|
|
7
|
+
schema_version: 1;
|
|
8
|
+
run_id: string;
|
|
9
|
+
run_name: string;
|
|
10
|
+
work_item_id?: string;
|
|
11
|
+
started_at: string;
|
|
12
|
+
selection: WorkflowWorkspaceSelection;
|
|
13
|
+
requested_isolation: "shared" | WorkspaceIsolation;
|
|
14
|
+
effective_isolation: "shared" | WorkspaceIsolation;
|
|
15
|
+
provider?: WorkspaceProviderRef;
|
|
16
|
+
compatibility?: {
|
|
17
|
+
reason: WorkspaceCompatibilityExecutionEvidence["selection_reason"];
|
|
18
|
+
unsupported: WorkspaceCompatibilityExecutionEvidence["unsupported"];
|
|
19
|
+
unknowns: WorkspaceCompatibilityExecutionEvidence["unknowns"];
|
|
20
|
+
};
|
|
21
|
+
allocation?: {
|
|
22
|
+
binding_id: string;
|
|
23
|
+
workspace_id: string;
|
|
24
|
+
workspace_root: string;
|
|
25
|
+
active_root: string;
|
|
26
|
+
created_at: string;
|
|
27
|
+
};
|
|
28
|
+
lifecycle: WorkspaceLifecycleProjection;
|
|
29
|
+
verification: {
|
|
30
|
+
status: WorkflowWorkspaceVerification;
|
|
31
|
+
workflow_status?: WorkflowProof["run"]["status"];
|
|
32
|
+
attested_at?: string;
|
|
33
|
+
drift: string[];
|
|
34
|
+
unsupported: Array<{
|
|
35
|
+
code: string;
|
|
36
|
+
message: string;
|
|
37
|
+
}>;
|
|
38
|
+
unknowns: Array<{
|
|
39
|
+
code: string;
|
|
40
|
+
message: string;
|
|
41
|
+
}>;
|
|
42
|
+
};
|
|
43
|
+
integration: {
|
|
44
|
+
state: WorkspaceLifecycleProjection["integration_state"];
|
|
45
|
+
changed_paths: string[];
|
|
46
|
+
target_ref?: string;
|
|
47
|
+
target_commit?: string;
|
|
48
|
+
receipt_id?: string;
|
|
49
|
+
};
|
|
50
|
+
cleanup: {
|
|
51
|
+
state: "not_requested" | "pending" | "released" | "preserved_dirty" | "blocked";
|
|
52
|
+
attempts: number;
|
|
53
|
+
reason?: string;
|
|
54
|
+
receipt_id?: string;
|
|
55
|
+
};
|
|
56
|
+
repository: {
|
|
57
|
+
dirty_paths: string[];
|
|
58
|
+
conflicts: string[];
|
|
59
|
+
operations_in_progress: string[];
|
|
60
|
+
};
|
|
61
|
+
integrity: {
|
|
62
|
+
status: "verified";
|
|
63
|
+
proof_sha256?: string;
|
|
64
|
+
provider_event_chain_sha256: string | null;
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
export type WorkflowWorkspaceInspection = {
|
|
68
|
+
ok: true;
|
|
69
|
+
value: WorkflowWorkspaceStatus;
|
|
70
|
+
} | {
|
|
71
|
+
ok: false;
|
|
72
|
+
run_id: string;
|
|
73
|
+
error: string;
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* Read one workflow's workspace state from validated durable authority.
|
|
77
|
+
*
|
|
78
|
+
* Corrupt, contradictory, or foreign records throw instead of being projected
|
|
79
|
+
* as healthy. Use inspectWorkflowWorkspace when a UI needs a typed error row.
|
|
80
|
+
*/
|
|
81
|
+
export declare function readWorkflowWorkspaceStatus(coordRoot: string, runId: string): WorkflowWorkspaceStatus;
|
|
82
|
+
export declare function inspectWorkflowWorkspace(coordRoot: string, runId: string): WorkflowWorkspaceInspection;
|
|
83
|
+
export declare function listWorkflowWorkspaceInspections(coordRoot: string): WorkflowWorkspaceInspection[];
|
|
84
|
+
export declare function renderWorkflowWorkspaceStatus(status: WorkflowWorkspaceStatus): string;
|
|
85
|
+
//# sourceMappingURL=inspect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inspect.d.ts","sourceRoot":"","sources":["../../../../src/core/workflow/workspaces/inspect.ts"],"names":[],"mappings":"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"}
|