@agent-vm/managed-vm 0.0.118 → 0.0.120

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/dist/index.d.ts CHANGED
@@ -149,6 +149,9 @@ type ManagedVmMount = {
149
149
  readonly directory: OwnedHostDirectory;
150
150
  readonly kind: 'owned-filtered-workspace';
151
151
  readonly policy: ManagedVmFilteredWorkspacePolicy;
152
+ } | {
153
+ readonly access: 'read-only' | 'read-write';
154
+ readonly kind: 'finalizable-memory';
152
155
  } | {
153
156
  readonly kind: 'memory';
154
157
  } | {
@@ -198,12 +201,26 @@ interface ManagedVmCreateRequest {
198
201
  readonly sshEgress?: ManagedVmGitReadOnlySshEgress;
199
202
  readonly tcpHosts: readonly ManagedVmTcpHostMapping[];
200
203
  }
204
+ interface ManagedVmFinalizableMemoryFile {
205
+ readonly contents: Uint8Array;
206
+ readonly mode: number;
207
+ readonly relativePath: string;
208
+ }
209
+ interface ManagedVmFinalizeMemoryMountRequest {
210
+ readonly files: readonly ManagedVmFinalizableMemoryFile[];
211
+ readonly guestPath: string;
212
+ }
213
+ interface ManagedVmFinalizableMemoryMountCapability {
214
+ finalizeMemoryMount(request: ManagedVmFinalizeMemoryMountRequest): Promise<void>;
215
+ }
216
+ declare function validateManagedVmFinalizeMemoryMountRequest(request: ManagedVmFinalizeMemoryMountRequest): ManagedVmFinalizeMemoryMountRequest;
201
217
  interface ManagedVm {
202
218
  close(): Promise<void>;
203
219
  configureIngressRoutes(routes: readonly ManagedVmIngressRoute[]): void;
204
220
  enableIngress(options?: ManagedVmIngressOptions): Promise<ManagedVmAccessHandle>;
205
221
  enableSsh(options?: ManagedVmEnableSshOptions): Promise<ManagedVmSshAccess>;
206
222
  exec(command: ManagedVmExecCommand, options?: ManagedVmExecOptions): ManagedVmExecProcess;
223
+ readonly finalizeMemoryMount?: ManagedVmFinalizableMemoryMountCapability['finalizeMemoryMount'];
207
224
  /** Null before start succeeds or after the owned host process exits. */
208
225
  getHostProcessId(): number | null;
209
226
  readonly id: string;
@@ -286,5 +303,5 @@ interface OwnedHostDirectoryControllerOptions {
286
303
  declare function createOwnedHostDirectoryController(options: OwnedHostDirectoryControllerOptions): OwnedHostDirectory;
287
304
  declare function assertPositiveHostProcessId(hostProcessId: number | null): number;
288
305
  //#endregion
289
- export { ManagedVm, ManagedVmAccessHandle, ManagedVmCanonicalDirectoryIdentity, ManagedVmCompatibilityDiagnostic, ManagedVmCreateRequest, ManagedVmDiagnosticsCapability, ManagedVmEnableSshOptions, ManagedVmExactProcessTerminationCapability, ManagedVmExactProcessTerminationOutcome, ManagedVmExactProcessTerminationRequest, ManagedVmExecCommand, ManagedVmExecOptions, ManagedVmExecOutputChunk, ManagedVmExecProcess, ManagedVmExecResult, ManagedVmExecStreamMode, ManagedVmExecStreamingOptions, ManagedVmFactory, ManagedVmFilteredWorkspacePolicy, ManagedVmFilteredWorkspaceReadonlyInput, ManagedVmFilteredWorkspaceVisibility, ManagedVmGitReadOnlySshEgress, ManagedVmHostProcessIdentity, ManagedVmImageBuildRequest, ManagedVmImageBuildResult, ManagedVmImageCapability, ManagedVmIngressOptions, ManagedVmIngressRoute, ManagedVmMediatedSecretDescriptor, ManagedVmMount, ManagedVmOwnedDirectoryCapability, ManagedVmProvider, ManagedVmRequestMediation, ManagedVmResources, ManagedVmRootfsMode, ManagedVmSshAccess, ManagedVmSshServerHostKey, ManagedVmTcpHostMapping, OwnedHostDirectory, OwnedHostDirectoryControllerOptions, OwnedHostDirectoryState, OwnedHostDirectoryTransfer, assertPositiveHostProcessId, createOwnedHostDirectoryController, validateManagedVmFilteredWorkspacePolicy };
306
+ export { ManagedVm, ManagedVmAccessHandle, ManagedVmCanonicalDirectoryIdentity, ManagedVmCompatibilityDiagnostic, ManagedVmCreateRequest, ManagedVmDiagnosticsCapability, ManagedVmEnableSshOptions, ManagedVmExactProcessTerminationCapability, ManagedVmExactProcessTerminationOutcome, ManagedVmExactProcessTerminationRequest, ManagedVmExecCommand, ManagedVmExecOptions, ManagedVmExecOutputChunk, ManagedVmExecProcess, ManagedVmExecResult, ManagedVmExecStreamMode, ManagedVmExecStreamingOptions, ManagedVmFactory, ManagedVmFilteredWorkspacePolicy, ManagedVmFilteredWorkspaceReadonlyInput, ManagedVmFilteredWorkspaceVisibility, ManagedVmFinalizableMemoryFile, ManagedVmFinalizableMemoryMountCapability, ManagedVmFinalizeMemoryMountRequest, ManagedVmGitReadOnlySshEgress, ManagedVmHostProcessIdentity, ManagedVmImageBuildRequest, ManagedVmImageBuildResult, ManagedVmImageCapability, ManagedVmIngressOptions, ManagedVmIngressRoute, ManagedVmMediatedSecretDescriptor, ManagedVmMount, ManagedVmOwnedDirectoryCapability, ManagedVmProvider, ManagedVmRequestMediation, ManagedVmResources, ManagedVmRootfsMode, ManagedVmSshAccess, ManagedVmSshServerHostKey, ManagedVmTcpHostMapping, OwnedHostDirectory, OwnedHostDirectoryControllerOptions, OwnedHostDirectoryState, OwnedHostDirectoryTransfer, assertPositiveHostProcessId, createOwnedHostDirectoryController, validateManagedVmFilteredWorkspacePolicy, validateManagedVmFinalizeMemoryMountRequest };
290
307
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/managed-vm-contracts.ts","../src/filtered-workspace-policy.ts","../src/owned-host-directory.ts"],"mappings":";;KACY,oBAAA;AAAA,KAEA,uBAAA;EAAA,SAAqC,IAAA;AAAA;EAAA,SAA+B,IAAA;AAAA;;;;;UAM/D,6BAAA;EAAA,SACP,MAAA,EAAQ,uBAAA;EAAA,SACR,MAAA,EAAQ,uBAAA;EAAA,SACR,WAAA;AAAA;AAAA,UAGO,oBAAA;EAAA,SACP,IAAA;EAAA,SACA,GAAA;EAAA,SACA,GAAA,uBAA0B,QAAA,CAAS,MAAA;EAAA,SACnC,MAAA,GAAS,6BAAA;EAAA,SACT,GAAA;EAAA,SACA,MAAA,GAAS,WAAA;EAAA,SACT,KAAA,YAAiB,UA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EAAA,SACA,WAAA;EAAA,SACA,cAAA;AAAA;AAAA,UAGO,wBAAA;EAChB,YAAA,CAAa,OAAA,EAAS,0BAAA,GAA6B,OAAA,CAAQ,yBAAA;AAAA;AAAA,UAG3C,gCAAA;EAAA,SACP,IAAA;EAAA,SACA,OAAA;EAAA,SACA,QAAA;AAAA;AAAA,UAGO,8BAAA;EAChB,kBAAA,IAAsB,OAAA,UAAiB,gCAAA;AAAA;AAAA,UAGvB,iCAAA;EAChB,iBAAA,CAAkB,QAAA,WAAmB,kBAAA;AAAA;;UAIrB,iBAAA;EAAA,SACP,WAAA,EAAa,8BAAA;EAAA,SACb,uBAAA,EAAyB,0CAAA;EAAA,SACzB,OAAA,EAAS,gBAAA;EAAA,SACT,MAAA,EAAQ,wBAAA;EAAA,SACR,gBAAA,EAAkB,iCAAA;AAAA;;;AApZ5B;;;;AAAA,iBCuIgB,wCAAA,CACf,MAAA,EAAQ,gCAAA,GACN,gCAAA;;;UCnIc,mCAAA;EAAA,SACP,QAAA,EAAU,mCAAA;EAAA,SACV,OAAA;EAAA,SACA,SAAA;AAAA;AFPV;;;;AAAA,iBEcgB,kCAAA,CACf,OAAA,EAAS,mCAAA,GACP,kBAAA;AAAA,iBA4Fa,2BAAA,CAA4B,aAAA"}
package/dist/index.js CHANGED
@@ -1,4 +1,38 @@
1
1
  import path from "node:path";
2
+ //#region src/managed-vm-contracts.ts
3
+ function isCanonicalRelativeMemoryFilePath(relativePath) {
4
+ if (relativePath.length === 0 || relativePath.startsWith("/") || relativePath.endsWith("/") || relativePath.includes("\\") || relativePath.includes("\0")) return false;
5
+ return relativePath.split("/").every((segment) => segment.length > 0 && segment !== "." && segment !== "..");
6
+ }
7
+ function isCanonicalAbsoluteGuestPath(guestPath) {
8
+ if (!guestPath.startsWith("/") || guestPath.length === 1 || guestPath.endsWith("/") || guestPath.includes("\\") || guestPath.includes("\0")) return false;
9
+ return guestPath.slice(1).split("/").every((segment) => segment.length > 0 && segment !== "." && segment !== "..");
10
+ }
11
+ function validateManagedVmFinalizeMemoryMountRequest(request) {
12
+ if (!isCanonicalAbsoluteGuestPath(request.guestPath)) throw new Error("Managed VM finalizable memory mount guest path must be absolute and canonical.");
13
+ const copiedFiles = request.files.map((file) => {
14
+ if (!isCanonicalRelativeMemoryFilePath(file.relativePath)) throw new Error(`Managed VM finalizable memory file path must be one canonical relative path: ${file.relativePath}`);
15
+ if (!Number.isSafeInteger(file.mode) || file.mode < 0 || file.mode > 511) throw new Error(`Managed VM finalizable memory file '${file.relativePath}' must use a permission mode between 0000 and 0777.`);
16
+ if (!(file.contents instanceof Uint8Array)) throw new Error(`Managed VM finalizable memory file '${file.relativePath}' contents must be a Uint8Array.`);
17
+ return {
18
+ contents: new Uint8Array(file.contents),
19
+ mode: file.mode,
20
+ relativePath: file.relativePath
21
+ };
22
+ });
23
+ const sortedPaths = copiedFiles.map((file) => file.relativePath).toSorted();
24
+ for (let index = 0; index < sortedPaths.length; index += 1) {
25
+ const currentPath = sortedPaths[index];
26
+ const nextPath = sortedPaths[index + 1];
27
+ if (currentPath === nextPath) throw new Error(`Managed VM finalizable memory inventory contains duplicate relative path: ${currentPath}`);
28
+ if (currentPath !== void 0 && nextPath?.startsWith(`${currentPath}/`)) throw new Error(`Managed VM finalizable memory inventory contains a file-directory collision: ${currentPath}`);
29
+ }
30
+ return {
31
+ files: copiedFiles,
32
+ guestPath: request.guestPath
33
+ };
34
+ }
35
+ //#endregion
2
36
  //#region src/filtered-workspace-policy.ts
3
37
  function assertNormalizedRelativePath(relativePath, fieldName) {
4
38
  if (relativePath.length === 0 || relativePath.includes("\0") || relativePath.includes("\\") || relativePath.endsWith("/") || path.posix.isAbsolute(relativePath) || path.posix.normalize(relativePath) !== relativePath || relativePath.split("/").some((segment) => segment === "." || segment === "..")) throw new Error(`${fieldName} must be a normalized workspace-relative path: ${relativePath}`);
@@ -157,6 +191,6 @@ function assertPositiveHostProcessId(hostProcessId) {
157
191
  return hostProcessId;
158
192
  }
159
193
  //#endregion
160
- export { assertPositiveHostProcessId, createOwnedHostDirectoryController, validateManagedVmFilteredWorkspacePolicy };
194
+ export { assertPositiveHostProcessId, createOwnedHostDirectoryController, validateManagedVmFilteredWorkspacePolicy, validateManagedVmFinalizeMemoryMountRequest };
161
195
 
162
196
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/filtered-workspace-policy.ts","../src/owned-host-directory.ts"],"sourcesContent":["import path from 'node:path';\n\nimport type {\n\tManagedVmFilteredWorkspacePolicy,\n\tManagedVmFilteredWorkspaceReadonlyInput,\n} from './managed-vm-contracts.js';\n\nfunction assertNormalizedRelativePath(relativePath: string, fieldName: string): void {\n\tif (\n\t\trelativePath.length === 0 ||\n\t\trelativePath.includes('\\0') ||\n\t\trelativePath.includes('\\\\') ||\n\t\trelativePath.endsWith('/') ||\n\t\tpath.posix.isAbsolute(relativePath) ||\n\t\tpath.posix.normalize(relativePath) !== relativePath ||\n\t\trelativePath.split('/').some((segment) => segment === '.' || segment === '..')\n\t) {\n\t\tthrow new Error(`${fieldName} must be a normalized workspace-relative path: ${relativePath}`);\n\t}\n}\n\nfunction isEqualOrDescendant(candidatePath: string, ancestorPath: string): boolean {\n\treturn candidatePath === ancestorPath || candidatePath.startsWith(`${ancestorPath}/`);\n}\n\nfunction pathsOverlap(firstPath: string, secondPath: string): boolean {\n\treturn isEqualOrDescendant(firstPath, secondPath) || isEqualOrDescendant(secondPath, firstPath);\n}\n\nfunction validatePathSet(paths: readonly string[], label: string): void {\n\tfor (const relativePath of paths) {\n\t\tassertNormalizedRelativePath(relativePath, label);\n\t}\n\tconst seenPaths = new Set<string>();\n\tfor (const relativePath of paths) {\n\t\tif (seenPaths.has(relativePath)) {\n\t\t\tthrow new Error(\n\t\t\t\t`Managed filtered workspace policy has a duplicate ${label}: ${relativePath}`,\n\t\t\t);\n\t\t}\n\t\tseenPaths.add(relativePath);\n\t}\n\tfor (let pathIndex = 0; pathIndex < paths.length; pathIndex += 1) {\n\t\tconst firstPath = paths[pathIndex];\n\t\tif (!firstPath) {\n\t\t\tcontinue;\n\t\t}\n\t\tfor (let comparedIndex = pathIndex + 1; comparedIndex < paths.length; comparedIndex += 1) {\n\t\t\tconst secondPath = paths[comparedIndex];\n\t\t\tif (secondPath && pathsOverlap(firstPath, secondPath)) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Managed filtered workspace policy has overlapping ${label}s: ${firstPath} and ${secondPath}`,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction validateReadonlyInputs(\n\treadonlyInputs: readonly ManagedVmFilteredWorkspaceReadonlyInput[],\n): void {\n\tfor (const readonlyInput of readonlyInputs) {\n\t\tassertNormalizedRelativePath(readonlyInput.sourceRelativePath, 'Read-only input source path');\n\t\tassertNormalizedRelativePath(\n\t\t\treadonlyInput.destinationRelativePath,\n\t\t\t'Read-only input destination path',\n\t\t);\n\t}\n\tconst destinationPaths = readonlyInputs.map(\n\t\t(readonlyInput) => readonlyInput.destinationRelativePath,\n\t);\n\tconst seenDestinations = new Set<string>();\n\tfor (const destinationPath of destinationPaths) {\n\t\tif (seenDestinations.has(destinationPath)) {\n\t\t\tthrow new Error(\n\t\t\t\t`Managed filtered workspace policy has a duplicate read-only destination: ${destinationPath}`,\n\t\t\t);\n\t\t}\n\t\tseenDestinations.add(destinationPath);\n\t}\n\tfor (let inputIndex = 0; inputIndex < destinationPaths.length; inputIndex += 1) {\n\t\tconst firstDestination = destinationPaths[inputIndex];\n\t\tif (!firstDestination) {\n\t\t\tcontinue;\n\t\t}\n\t\tfor (\n\t\t\tlet comparedIndex = inputIndex + 1;\n\t\t\tcomparedIndex < destinationPaths.length;\n\t\t\tcomparedIndex += 1\n\t\t) {\n\t\t\tconst secondDestination = destinationPaths[comparedIndex];\n\t\t\tif (secondDestination && pathsOverlap(firstDestination, secondDestination)) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Managed filtered workspace policy has overlapping read-only destinations: ${firstDestination} and ${secondDestination}`,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction assertWithinPositiveVisibility(\n\trelativePath: string,\n\tvisiblePaths: readonly string[],\n\tfieldName: string,\n): void {\n\tif (!visiblePaths.some((visiblePath) => isEqualOrDescendant(relativePath, visiblePath))) {\n\t\tthrow new Error(`${fieldName} '${relativePath}' is outside the positive visibility allowlist.`);\n\t}\n}\n\nfunction readonlyInputSourceIsWritable(\n\treadonlyInput: ManagedVmFilteredWorkspaceReadonlyInput,\n\tpolicy: ManagedVmFilteredWorkspacePolicy,\n): boolean {\n\tconst sourcePath = readonlyInput.sourceRelativePath;\n\tif (\n\t\tpolicy.hiddenPaths.some((hiddenPath) => isEqualOrDescendant(sourcePath, hiddenPath)) ||\n\t\tpolicy.temporaryPaths.some((temporaryPath) => isEqualOrDescendant(sourcePath, temporaryPath)) ||\n\t\tpolicy.readonlyInputs.some((candidateInput) =>\n\t\t\tisEqualOrDescendant(sourcePath, candidateInput.destinationRelativePath),\n\t\t)\n\t) {\n\t\treturn false;\n\t}\n\tif (policy.visibility.kind === 'whole-root-writable') {\n\t\treturn true;\n\t}\n\treturn policy.visibility.writablePaths.some((writablePath) =>\n\t\tisEqualOrDescendant(sourcePath, writablePath),\n\t);\n}\n\n/**\n * Validates the complete policy before VM construction reaches a native provider.\n * Paths are rejected rather than silently normalized so one spelling has one meaning.\n */\nexport function validateManagedVmFilteredWorkspacePolicy(\n\tpolicy: ManagedVmFilteredWorkspacePolicy,\n): ManagedVmFilteredWorkspacePolicy {\n\tvalidatePathSet(policy.hiddenPaths, 'hidden path');\n\tvalidatePathSet(policy.temporaryPaths, 'temporary path');\n\tvalidateReadonlyInputs(policy.readonlyInputs);\n\n\tif (policy.visibility.kind === 'positive-paths') {\n\t\tvalidatePathSet(policy.visibility.visiblePaths, 'visible path');\n\t\tvalidatePathSet(policy.visibility.writablePaths, 'writable path');\n\t\tif (policy.visibility.visiblePaths.length === 0) {\n\t\t\tthrow new Error('A positive filtered workspace policy must admit at least one visible path.');\n\t\t}\n\t\tfor (const writablePath of policy.visibility.writablePaths) {\n\t\t\tassertWithinPositiveVisibility(writablePath, policy.visibility.visiblePaths, 'Writable path');\n\t\t}\n\t\tfor (const temporaryPath of policy.temporaryPaths) {\n\t\t\tassertWithinPositiveVisibility(\n\t\t\t\ttemporaryPath,\n\t\t\t\tpolicy.visibility.visiblePaths,\n\t\t\t\t'Temporary path',\n\t\t\t);\n\t\t}\n\t\tfor (const readonlyInput of policy.readonlyInputs) {\n\t\t\tassertWithinPositiveVisibility(\n\t\t\t\treadonlyInput.destinationRelativePath,\n\t\t\t\tpolicy.visibility.visiblePaths,\n\t\t\t\t'Read-only destination',\n\t\t\t);\n\t\t}\n\t\tfor (const hiddenPath of policy.hiddenPaths) {\n\t\t\tif (\n\t\t\t\t!policy.visibility.visiblePaths.some((visiblePath) => pathsOverlap(hiddenPath, visiblePath))\n\t\t\t) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Hidden path '${hiddenPath}' is outside the positive visibility allowlist.`,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tfor (const readonlyInput of policy.readonlyInputs) {\n\t\tif (readonlyInputSourceIsWritable(readonlyInput, policy)) {\n\t\t\tthrow new Error(\n\t\t\t\t`Read-only input source '${readonlyInput.sourceRelativePath}' remains writable at its original workspace path.`,\n\t\t\t);\n\t\t}\n\t\tfor (const writablePath of policy.visibility.kind === 'positive-paths'\n\t\t\t? policy.visibility.writablePaths\n\t\t\t: []) {\n\t\t\tif (\n\t\t\t\twritablePath !== readonlyInput.destinationRelativePath &&\n\t\t\t\tisEqualOrDescendant(writablePath, readonlyInput.destinationRelativePath)\n\t\t\t) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`writable path '${writablePath}' has read-only ancestor '${readonlyInput.destinationRelativePath}'.`,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn {\n\t\thiddenPaths: [...policy.hiddenPaths],\n\t\treadonlyInputs: policy.readonlyInputs.map((readonlyInput) => ({ ...readonlyInput })),\n\t\ttemporaryPaths: [...policy.temporaryPaths],\n\t\tvisibility:\n\t\t\tpolicy.visibility.kind === 'whole-root-writable'\n\t\t\t\t? { kind: 'whole-root-writable' }\n\t\t\t\t: {\n\t\t\t\t\t\tkind: 'positive-paths',\n\t\t\t\t\t\tvisiblePaths: [...policy.visibility.visiblePaths],\n\t\t\t\t\t\twritablePaths: [...policy.visibility.writablePaths],\n\t\t\t\t\t},\n\t};\n}\n","import type {\n\tManagedVmCanonicalDirectoryIdentity,\n\tOwnedHostDirectory,\n\tOwnedHostDirectoryState,\n\tOwnedHostDirectoryTransfer,\n} from './managed-vm-contracts.js';\n\nexport interface OwnedHostDirectoryControllerOptions {\n\treadonly identity: ManagedVmCanonicalDirectoryIdentity;\n\treadonly onClose: () => void;\n\treadonly onConsume?: () => void;\n}\n\n/**\n * Creates the backend-neutral half of an owned-directory capability. Native\n * resources remain captured by provider callbacks and never enter this object.\n */\nexport function createOwnedHostDirectoryController(\n\toptions: OwnedHostDirectoryControllerOptions,\n): OwnedHostDirectory {\n\ttype InternalOwnedHostDirectoryState = OwnedHostDirectoryState | 'transferring';\n\tlet currentState: InternalOwnedHostDirectoryState = 'acquired';\n\tlet resourceClosed = false;\n\tlet resourceClosing = false;\n\tconst getInternalState = (): InternalOwnedHostDirectoryState => currentState;\n\n\tconst closeResource = (): boolean => {\n\t\tif (resourceClosed) {\n\t\t\treturn true;\n\t\t}\n\t\tif (resourceClosing) {\n\t\t\treturn false;\n\t\t}\n\t\tresourceClosing = true;\n\t\ttry {\n\t\t\toptions.onClose();\n\t\t\tresourceClosed = true;\n\t\t\treturn true;\n\t\t} finally {\n\t\t\tresourceClosing = false;\n\t\t}\n\t};\n\n\tconst transfer: OwnedHostDirectoryTransfer = {\n\t\tclose(): void {\n\t\t\tif (currentState !== 'adapter-owned') {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (closeResource()) {\n\t\t\t\tcurrentState = 'closed';\n\t\t\t}\n\t\t},\n\t\tget identity(): ManagedVmCanonicalDirectoryIdentity {\n\t\t\treturn options.identity;\n\t\t},\n\t\tget state(): 'adapter-owned' | 'closed' {\n\t\t\treturn currentState === 'adapter-owned' ? 'adapter-owned' : 'closed';\n\t\t},\n\t};\n\n\treturn {\n\t\tclose(): void {\n\t\t\tif (currentState === 'adapter-owned') {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t'Owned host directory cannot be closed by its former owner after transfer.',\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (getInternalState() === 'closed') {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (closeResource()) {\n\t\t\t\tcurrentState = 'closed';\n\t\t\t}\n\t\t},\n\t\tconsume(): OwnedHostDirectoryTransfer {\n\t\t\tif (currentState !== 'acquired') {\n\t\t\t\tthrow new Error(`Owned host directory cannot be consumed while ${currentState}.`);\n\t\t\t}\n\t\t\tcurrentState = 'transferring';\n\t\t\ttry {\n\t\t\t\toptions.onConsume?.();\n\t\t\t} catch (consumeError) {\n\t\t\t\ttry {\n\t\t\t\t\tif (closeResource()) {\n\t\t\t\t\t\tcurrentState = 'closed';\n\t\t\t\t\t}\n\t\t\t\t} catch (closeError) {\n\t\t\t\t\t// oxlint-disable-next-line preserve-caught-error -- AggregateError.errors retains cleanup failure while cause retains the transfer failure.\n\t\t\t\t\tthrow new AggregateError(\n\t\t\t\t\t\t[consumeError, closeError],\n\t\t\t\t\t\t'Owned host directory transfer and cleanup both failed.',\n\t\t\t\t\t\t{ cause: consumeError },\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tthrow consumeError;\n\t\t\t}\n\t\t\tif (getInternalState() === 'closed') {\n\t\t\t\tthrow new Error('Owned host directory closed during ownership transfer.');\n\t\t\t}\n\t\t\tcurrentState = 'adapter-owned';\n\t\t\treturn transfer;\n\t\t},\n\t\tget identity(): ManagedVmCanonicalDirectoryIdentity {\n\t\t\treturn options.identity;\n\t\t},\n\t\tget state(): OwnedHostDirectoryState {\n\t\t\treturn currentState === 'transferring' ? 'acquired' : currentState;\n\t\t},\n\t};\n}\n\nexport function assertPositiveHostProcessId(hostProcessId: number | null): number {\n\tif (!Number.isSafeInteger(hostProcessId) || hostProcessId === null || hostProcessId <= 0) {\n\t\tthrow new Error('A started managed VM must expose a positive stable host process ID.');\n\t}\n\treturn hostProcessId;\n}\n"],"mappings":";;AAOA,SAAS,6BAA6B,cAAsB,WAAyB;CACpF,IACC,aAAa,WAAW,KACxB,aAAa,SAAS,KAAK,IAC3B,aAAa,SAAS,KAAK,IAC3B,aAAa,SAAS,IAAI,IAC1B,KAAK,MAAM,WAAW,aAAa,IACnC,KAAK,MAAM,UAAU,aAAa,KAAK,gBACvC,aAAa,MAAM,IAAI,CAAC,MAAM,YAAY,YAAY,OAAO,YAAY,KAAK,EAE9E,MAAM,IAAI,MAAM,GAAG,UAAU,iDAAiD,eAAe;;AAI/F,SAAS,oBAAoB,eAAuB,cAA+B;CAClF,OAAO,kBAAkB,gBAAgB,cAAc,WAAW,GAAG,aAAa,GAAG;;AAGtF,SAAS,aAAa,WAAmB,YAA6B;CACrE,OAAO,oBAAoB,WAAW,WAAW,IAAI,oBAAoB,YAAY,UAAU;;AAGhG,SAAS,gBAAgB,OAA0B,OAAqB;CACvE,KAAK,MAAM,gBAAgB,OAC1B,6BAA6B,cAAc,MAAM;CAElD,MAAM,4BAAY,IAAI,KAAa;CACnC,KAAK,MAAM,gBAAgB,OAAO;EACjC,IAAI,UAAU,IAAI,aAAa,EAC9B,MAAM,IAAI,MACT,qDAAqD,MAAM,IAAI,eAC/D;EAEF,UAAU,IAAI,aAAa;;CAE5B,KAAK,IAAI,YAAY,GAAG,YAAY,MAAM,QAAQ,aAAa,GAAG;EACjE,MAAM,YAAY,MAAM;EACxB,IAAI,CAAC,WACJ;EAED,KAAK,IAAI,gBAAgB,YAAY,GAAG,gBAAgB,MAAM,QAAQ,iBAAiB,GAAG;GAC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;;EAEhB,IAAI,QAAiC;GACpC,OAAO,iBAAiB,iBAAiB,aAAa;;EAEvD;;AAGF,SAAgB,4BAA4B,eAAsC;CACjF,IAAI,CAAC,OAAO,cAAc,cAAc,IAAI,kBAAkB,QAAQ,iBAAiB,GACtF,MAAM,IAAI,MAAM,sEAAsE;CAEvF,OAAO"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/managed-vm-contracts.ts","../src/filtered-workspace-policy.ts","../src/owned-host-directory.ts"],"sourcesContent":["/** A command executed in the guest. */\nexport type ManagedVmExecCommand = string | readonly string[];\n\nexport type ManagedVmExecStreamMode = { readonly kind: 'discard' } | { readonly kind: 'pipe' };\n\n/**\n * Explicit bounded streaming policy. Omitting this group preserves the\n * backend's buffered execution behavior for existing non-streaming callers.\n */\nexport interface ManagedVmExecStreamingOptions {\n\treadonly stderr: ManagedVmExecStreamMode;\n\treadonly stdout: ManagedVmExecStreamMode;\n\treadonly windowBytes: number;\n}\n\nexport interface ManagedVmExecOptions {\n\treadonly argv?: readonly string[];\n\treadonly cwd?: string;\n\treadonly env?: readonly string[] | Readonly<Record<string, string>>;\n\treadonly output?: ManagedVmExecStreamingOptions;\n\treadonly pty?: boolean;\n\treadonly signal?: AbortSignal;\n\treadonly stdin?: string | Uint8Array | AsyncIterable<Uint8Array>;\n}\n\nexport interface ManagedVmExecResult {\n\treadonly exitCode: number;\n\treadonly ok: boolean;\n\treadonly signal?: number;\n\treadonly stderr: string;\n\treadonly stderrBuffer: Uint8Array;\n\treadonly stdout: string;\n\treadonly stdoutBuffer: Uint8Array;\n\tjson<TValue>(): TValue;\n\tlines(): readonly string[];\n\ttoString(): string;\n}\n\n/**\n * A guest execution is awaitable and may also stream decoded output. The\n * contract deliberately excludes backend process handles and Node streams.\n */\nexport interface ManagedVmExecProcess\n\textends PromiseLike<ManagedVmExecResult>, AsyncIterable<string> {\n\tcatch<TResult = never>(\n\t\tonRejected?: (reason: Error) => TResult | PromiseLike<TResult>,\n\t): Promise<ManagedVmExecResult | TResult>;\n\tend(): void;\n\tfinally(onFinally?: () => void): Promise<ManagedVmExecResult>;\n\tlines(): AsyncIterable<string>;\n\toutput(): AsyncIterable<ManagedVmExecOutputChunk>;\n\treadonly result: Promise<ManagedVmExecResult>;\n\tresize(rows: number, columns: number): void;\n\twrite(data: string | Uint8Array): void;\n}\n\nexport interface ManagedVmExecOutputChunk {\n\treadonly data: Uint8Array;\n\treadonly stream: 'stderr' | 'stdout';\n\treadonly text: string;\n}\n\nexport interface ManagedVmSshServerHostKey {\n\treadonly algorithm: 'ssh-ed25519';\n\treadonly publicKeyBase64: string;\n}\n\nexport interface ManagedVmAccessHandle {\n\tclose(): Promise<void>;\n\treadonly host: string;\n\treadonly port: number;\n\treadonly url?: string;\n}\n\nexport interface ManagedVmSshAccess extends ManagedVmAccessHandle {\n\treadonly command: string;\n\treadonly identityFile: string;\n\treadonly serverHostKey: ManagedVmSshServerHostKey;\n\treadonly user: string;\n}\n\nexport interface ManagedVmEnableSshOptions {\n\treadonly listenHost?: string;\n\treadonly listenPort?: number;\n\treadonly user?: string;\n}\n\nexport interface ManagedVmIngressOptions {\n\treadonly allowWebSockets?: boolean;\n\treadonly listenHost?: string;\n\treadonly bufferResponseBody?: boolean;\n\treadonly listenPort?: number;\n\treadonly maxBufferedResponseBodyBytes?: number;\n\treadonly upstreamHeaderTimeoutMs?: number;\n\treadonly upstreamResponseTimeoutMs?: number;\n}\n\nexport interface ManagedVmIngressRoute {\n\treadonly port: number;\n\treadonly prefix: string;\n\treadonly stripPrefix: boolean;\n}\n\nexport interface ManagedVmResources {\n\treadonly cpuCount: number;\n\treadonly memory: string;\n}\n\nexport type ManagedVmRootfsMode = 'readonly' | 'memory' | 'cow';\n\nexport interface ManagedVmCanonicalDirectoryIdentity {\n\t/** Canonical path is descriptive identity; it is never a mount authority. */\n\treadonly canonicalPath: string;\n\treadonly device: number;\n\treadonly inode: number;\n}\n\nexport type OwnedHostDirectoryState = 'acquired' | 'adapter-owned' | 'closed';\n\n/**\n * Single-use host-directory authority. Passing this object to createManagedVm\n * authorizes the provider to call consume exactly once. It exposes no native\n * handle, file descriptor, or raw-path fallback.\n */\nexport interface OwnedHostDirectory {\n\tclose(): void;\n\tconsume(): OwnedHostDirectoryTransfer;\n\treadonly identity: ManagedVmCanonicalDirectoryIdentity;\n\treadonly state: OwnedHostDirectoryState;\n}\n\n/** Ownership retained by the provider after successful consumption. */\nexport interface OwnedHostDirectoryTransfer {\n\tclose(): void;\n\treadonly identity: ManagedVmCanonicalDirectoryIdentity;\n\treadonly state: 'adapter-owned' | 'closed';\n}\n\nexport type ManagedVmFilteredWorkspaceVisibility =\n\t| { readonly kind: 'whole-root-writable' }\n\t| {\n\t\t\treadonly kind: 'positive-paths';\n\t\t\treadonly visiblePaths: readonly string[];\n\t\t\treadonly writablePaths: readonly string[];\n\t };\n\nexport interface ManagedVmFilteredWorkspaceReadonlyInput {\n\treadonly destinationRelativePath: string;\n\treadonly sourceRelativePath: string;\n}\n\n/** Controller-authored policy over one owned canonical workspace root. */\nexport interface ManagedVmFilteredWorkspacePolicy {\n\treadonly hiddenPaths: readonly string[];\n\treadonly readonlyInputs: readonly ManagedVmFilteredWorkspaceReadonlyInput[];\n\treadonly temporaryPaths: readonly string[];\n\treadonly visibility: ManagedVmFilteredWorkspaceVisibility;\n}\n\nexport type ManagedVmMount =\n\t| {\n\t\t\treadonly access: 'read-only' | 'read-write';\n\t\t\treadonly hostPath: string;\n\t\t\treadonly kind: 'host-directory';\n\t }\n\t| {\n\t\t\treadonly access: 'read-only' | 'read-write';\n\t\t\treadonly directory: OwnedHostDirectory;\n\t\t\treadonly kind: 'owned-host-directory';\n\t }\n\t| {\n\t\t\treadonly directory: OwnedHostDirectory;\n\t\t\treadonly kind: 'owned-filtered-workspace';\n\t\t\treadonly policy: ManagedVmFilteredWorkspacePolicy;\n\t }\n\t| {\n\t\t\treadonly access: 'read-only' | 'read-write';\n\t\t\treadonly kind: 'finalizable-memory';\n\t }\n\t| { readonly kind: 'memory' }\n\t| {\n\t\t\treadonly deny: readonly string[];\n\t\t\treadonly hostPath: string;\n\t\t\treadonly kind: 'shadow';\n\t\t\treadonly temporaryFilesystems: readonly string[];\n\t };\n\nexport interface ManagedVmMediatedSecretDescriptor {\n\treadonly allowedHosts: readonly string[];\n\treadonly environmentVariable: string;\n\t/** Opaque, non-secret token used to represent the mediated value inside the guest. */\n\treadonly guestPlaceholder?: string;\n\t/**\n\t * Resolved only at the trusted host/provider boundary. The provider must use\n\t * this value solely for outbound HTTP mediation and must never inject the raw\n\t * value into the guest environment or VM image.\n\t */\n\treadonly value: string;\n}\n\nexport interface ManagedVmRequestMediation {\n\treadonly onRequest?: (request: Request) => Promise<Request | Response | void>;\n\treadonly onResponse?: (response: Response) => Promise<Response | void>;\n}\n\nexport interface ManagedVmTcpHostMapping {\n\treadonly guestHost: string;\n\treadonly target: string;\n}\n\nexport interface ManagedVmGitReadOnlySshEgress {\n\treadonly allowedHosts: readonly string[];\n\treadonly allowedRepositories?: readonly string[];\n\treadonly agentSocket?: string;\n\treadonly kind: 'git-read-only';\n\treadonly knownHostsFile?: string;\n}\n\nexport interface ManagedVmCreateRequest {\n\treadonly allowedHosts: readonly string[];\n\treadonly environment: Readonly<Record<string, string>>;\n\treadonly imageReference: string;\n\treadonly mediatedSecrets: readonly ManagedVmMediatedSecretDescriptor[];\n\treadonly mediation?: ManagedVmRequestMediation;\n\treadonly mounts: Readonly<Record<string, ManagedVmMount>>;\n\treadonly resources: ManagedVmResources;\n\treadonly rootfsMode: ManagedVmRootfsMode;\n\treadonly runtimeRootfsSize?: string;\n\treadonly sessionLabel: string;\n\treadonly sshEgress?: ManagedVmGitReadOnlySshEgress;\n\treadonly tcpHosts: readonly ManagedVmTcpHostMapping[];\n}\n\nexport interface ManagedVmFinalizableMemoryFile {\n\treadonly contents: Uint8Array;\n\treadonly mode: number;\n\treadonly relativePath: string;\n}\n\nexport interface ManagedVmFinalizeMemoryMountRequest {\n\treadonly files: readonly ManagedVmFinalizableMemoryFile[];\n\treadonly guestPath: string;\n}\n\nexport interface ManagedVmFinalizableMemoryMountCapability {\n\tfinalizeMemoryMount(request: ManagedVmFinalizeMemoryMountRequest): Promise<void>;\n}\n\nfunction isCanonicalRelativeMemoryFilePath(relativePath: string): boolean {\n\tif (\n\t\trelativePath.length === 0 ||\n\t\trelativePath.startsWith('/') ||\n\t\trelativePath.endsWith('/') ||\n\t\trelativePath.includes('\\\\') ||\n\t\trelativePath.includes('\\0')\n\t) {\n\t\treturn false;\n\t}\n\tconst segments = relativePath.split('/');\n\treturn segments.every((segment) => segment.length > 0 && segment !== '.' && segment !== '..');\n}\n\nfunction isCanonicalAbsoluteGuestPath(guestPath: string): boolean {\n\tif (\n\t\t!guestPath.startsWith('/') ||\n\t\tguestPath.length === 1 ||\n\t\tguestPath.endsWith('/') ||\n\t\tguestPath.includes('\\\\') ||\n\t\tguestPath.includes('\\0')\n\t) {\n\t\treturn false;\n\t}\n\treturn guestPath\n\t\t.slice(1)\n\t\t.split('/')\n\t\t.every((segment) => segment.length > 0 && segment !== '.' && segment !== '..');\n}\n\nexport function validateManagedVmFinalizeMemoryMountRequest(\n\trequest: ManagedVmFinalizeMemoryMountRequest,\n): ManagedVmFinalizeMemoryMountRequest {\n\tif (!isCanonicalAbsoluteGuestPath(request.guestPath)) {\n\t\tthrow new Error(\n\t\t\t'Managed VM finalizable memory mount guest path must be absolute and canonical.',\n\t\t);\n\t}\n\tconst copiedFiles = request.files.map((file) => {\n\t\tif (!isCanonicalRelativeMemoryFilePath(file.relativePath)) {\n\t\t\tthrow new Error(\n\t\t\t\t`Managed VM finalizable memory file path must be one canonical relative path: ${file.relativePath}`,\n\t\t\t);\n\t\t}\n\t\tif (!Number.isSafeInteger(file.mode) || file.mode < 0 || file.mode > 0o777) {\n\t\t\tthrow new Error(\n\t\t\t\t`Managed VM finalizable memory file '${file.relativePath}' must use a permission mode between 0000 and 0777.`,\n\t\t\t);\n\t\t}\n\t\tif (!(file.contents instanceof Uint8Array)) {\n\t\t\tthrow new Error(\n\t\t\t\t`Managed VM finalizable memory file '${file.relativePath}' contents must be a Uint8Array.`,\n\t\t\t);\n\t\t}\n\t\treturn {\n\t\t\tcontents: new Uint8Array(file.contents),\n\t\t\tmode: file.mode,\n\t\t\trelativePath: file.relativePath,\n\t\t} satisfies ManagedVmFinalizableMemoryFile;\n\t});\n\tconst sortedPaths = copiedFiles.map((file) => file.relativePath).toSorted();\n\tfor (let index = 0; index < sortedPaths.length; index += 1) {\n\t\tconst currentPath = sortedPaths[index];\n\t\tconst nextPath = sortedPaths[index + 1];\n\t\tif (currentPath === nextPath) {\n\t\t\tthrow new Error(\n\t\t\t\t`Managed VM finalizable memory inventory contains duplicate relative path: ${currentPath}`,\n\t\t\t);\n\t\t}\n\t\tif (currentPath !== undefined && nextPath?.startsWith(`${currentPath}/`)) {\n\t\t\tthrow new Error(\n\t\t\t\t`Managed VM finalizable memory inventory contains a file-directory collision: ${currentPath}`,\n\t\t\t);\n\t\t}\n\t}\n\treturn {\n\t\tfiles: copiedFiles,\n\t\tguestPath: request.guestPath,\n\t};\n}\n\nexport interface ManagedVm {\n\tclose(): Promise<void>;\n\tconfigureIngressRoutes(routes: readonly ManagedVmIngressRoute[]): void;\n\tenableIngress(options?: ManagedVmIngressOptions): Promise<ManagedVmAccessHandle>;\n\tenableSsh(options?: ManagedVmEnableSshOptions): Promise<ManagedVmSshAccess>;\n\texec(command: ManagedVmExecCommand, options?: ManagedVmExecOptions): ManagedVmExecProcess;\n\treadonly finalizeMemoryMount?: ManagedVmFinalizableMemoryMountCapability['finalizeMemoryMount'];\n\t/** Null before start succeeds or after the owned host process exits. */\n\tgetHostProcessId(): number | null;\n\treadonly id: string;\n\tstart(): Promise<void>;\n}\n\n/** Durable controller identity captured before authority admission. */\nexport interface ManagedVmHostProcessIdentity {\n\treadonly command: string;\n\treadonly hostProcessId: number;\n\treadonly processStartIdentity: string;\n\treadonly vmId: string;\n}\n\nexport interface ManagedVmExactProcessTerminationRequest {\n\treadonly contextLabel: string;\n\treadonly identity: ManagedVmHostProcessIdentity;\n}\n\nexport type ManagedVmExactProcessTerminationOutcome =\n\t| { readonly hostProcessId: number; readonly kind: 'already-absent' }\n\t| { readonly hostProcessId: number; readonly kind: 'terminated' };\n\nexport interface ManagedVmExactProcessTerminationCapability {\n\tterminateRecordedHostProcess(\n\t\trequest: ManagedVmExactProcessTerminationRequest,\n\t): Promise<ManagedVmExactProcessTerminationOutcome>;\n}\n\nexport interface ManagedVmFactory {\n\tcreateManagedVm(request: ManagedVmCreateRequest): Promise<ManagedVm>;\n}\n\nexport interface ManagedVmImageBuildRequest {\n\treadonly cacheDirectory: string;\n\treadonly forceRebuild?: boolean;\n\treadonly recipePath: string;\n}\n\nexport interface ManagedVmImageBuildResult {\n\treadonly built: boolean;\n\treadonly fingerprint: string;\n\treadonly imageReference: string;\n}\n\nexport interface ManagedVmImageCapability {\n\tprepareImage(request: ManagedVmImageBuildRequest): Promise<ManagedVmImageBuildResult>;\n}\n\nexport interface ManagedVmCompatibilityDiagnostic {\n\treadonly code: string;\n\treadonly message: string;\n\treadonly severity: 'error' | 'warning';\n}\n\nexport interface ManagedVmDiagnosticsCapability {\n\tcheckCompatibility(): Promise<readonly ManagedVmCompatibilityDiagnostic[]>;\n}\n\nexport interface ManagedVmOwnedDirectoryCapability {\n\topenHostDirectory(hostPath: string): OwnedHostDirectory;\n}\n\n/** Aggregate available only at application composition boundaries. */\nexport interface ManagedVmProvider {\n\treadonly diagnostics: ManagedVmDiagnosticsCapability;\n\treadonly exactProcessTermination: ManagedVmExactProcessTerminationCapability;\n\treadonly factory: ManagedVmFactory;\n\treadonly images: ManagedVmImageCapability;\n\treadonly ownedDirectories: ManagedVmOwnedDirectoryCapability;\n}\n","import path from 'node:path';\n\nimport type {\n\tManagedVmFilteredWorkspacePolicy,\n\tManagedVmFilteredWorkspaceReadonlyInput,\n} from './managed-vm-contracts.js';\n\nfunction assertNormalizedRelativePath(relativePath: string, fieldName: string): void {\n\tif (\n\t\trelativePath.length === 0 ||\n\t\trelativePath.includes('\\0') ||\n\t\trelativePath.includes('\\\\') ||\n\t\trelativePath.endsWith('/') ||\n\t\tpath.posix.isAbsolute(relativePath) ||\n\t\tpath.posix.normalize(relativePath) !== relativePath ||\n\t\trelativePath.split('/').some((segment) => segment === '.' || segment === '..')\n\t) {\n\t\tthrow new Error(`${fieldName} must be a normalized workspace-relative path: ${relativePath}`);\n\t}\n}\n\nfunction isEqualOrDescendant(candidatePath: string, ancestorPath: string): boolean {\n\treturn candidatePath === ancestorPath || candidatePath.startsWith(`${ancestorPath}/`);\n}\n\nfunction pathsOverlap(firstPath: string, secondPath: string): boolean {\n\treturn isEqualOrDescendant(firstPath, secondPath) || isEqualOrDescendant(secondPath, firstPath);\n}\n\nfunction validatePathSet(paths: readonly string[], label: string): void {\n\tfor (const relativePath of paths) {\n\t\tassertNormalizedRelativePath(relativePath, label);\n\t}\n\tconst seenPaths = new Set<string>();\n\tfor (const relativePath of paths) {\n\t\tif (seenPaths.has(relativePath)) {\n\t\t\tthrow new Error(\n\t\t\t\t`Managed filtered workspace policy has a duplicate ${label}: ${relativePath}`,\n\t\t\t);\n\t\t}\n\t\tseenPaths.add(relativePath);\n\t}\n\tfor (let pathIndex = 0; pathIndex < paths.length; pathIndex += 1) {\n\t\tconst firstPath = paths[pathIndex];\n\t\tif (!firstPath) {\n\t\t\tcontinue;\n\t\t}\n\t\tfor (let comparedIndex = pathIndex + 1; comparedIndex < paths.length; comparedIndex += 1) {\n\t\t\tconst secondPath = paths[comparedIndex];\n\t\t\tif (secondPath && pathsOverlap(firstPath, secondPath)) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Managed filtered workspace policy has overlapping ${label}s: ${firstPath} and ${secondPath}`,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction validateReadonlyInputs(\n\treadonlyInputs: readonly ManagedVmFilteredWorkspaceReadonlyInput[],\n): void {\n\tfor (const readonlyInput of readonlyInputs) {\n\t\tassertNormalizedRelativePath(readonlyInput.sourceRelativePath, 'Read-only input source path');\n\t\tassertNormalizedRelativePath(\n\t\t\treadonlyInput.destinationRelativePath,\n\t\t\t'Read-only input destination path',\n\t\t);\n\t}\n\tconst destinationPaths = readonlyInputs.map(\n\t\t(readonlyInput) => readonlyInput.destinationRelativePath,\n\t);\n\tconst seenDestinations = new Set<string>();\n\tfor (const destinationPath of destinationPaths) {\n\t\tif (seenDestinations.has(destinationPath)) {\n\t\t\tthrow new Error(\n\t\t\t\t`Managed filtered workspace policy has a duplicate read-only destination: ${destinationPath}`,\n\t\t\t);\n\t\t}\n\t\tseenDestinations.add(destinationPath);\n\t}\n\tfor (let inputIndex = 0; inputIndex < destinationPaths.length; inputIndex += 1) {\n\t\tconst firstDestination = destinationPaths[inputIndex];\n\t\tif (!firstDestination) {\n\t\t\tcontinue;\n\t\t}\n\t\tfor (\n\t\t\tlet comparedIndex = inputIndex + 1;\n\t\t\tcomparedIndex < destinationPaths.length;\n\t\t\tcomparedIndex += 1\n\t\t) {\n\t\t\tconst secondDestination = destinationPaths[comparedIndex];\n\t\t\tif (secondDestination && pathsOverlap(firstDestination, secondDestination)) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Managed filtered workspace policy has overlapping read-only destinations: ${firstDestination} and ${secondDestination}`,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction assertWithinPositiveVisibility(\n\trelativePath: string,\n\tvisiblePaths: readonly string[],\n\tfieldName: string,\n): void {\n\tif (!visiblePaths.some((visiblePath) => isEqualOrDescendant(relativePath, visiblePath))) {\n\t\tthrow new Error(`${fieldName} '${relativePath}' is outside the positive visibility allowlist.`);\n\t}\n}\n\nfunction readonlyInputSourceIsWritable(\n\treadonlyInput: ManagedVmFilteredWorkspaceReadonlyInput,\n\tpolicy: ManagedVmFilteredWorkspacePolicy,\n): boolean {\n\tconst sourcePath = readonlyInput.sourceRelativePath;\n\tif (\n\t\tpolicy.hiddenPaths.some((hiddenPath) => isEqualOrDescendant(sourcePath, hiddenPath)) ||\n\t\tpolicy.temporaryPaths.some((temporaryPath) => isEqualOrDescendant(sourcePath, temporaryPath)) ||\n\t\tpolicy.readonlyInputs.some((candidateInput) =>\n\t\t\tisEqualOrDescendant(sourcePath, candidateInput.destinationRelativePath),\n\t\t)\n\t) {\n\t\treturn false;\n\t}\n\tif (policy.visibility.kind === 'whole-root-writable') {\n\t\treturn true;\n\t}\n\treturn policy.visibility.writablePaths.some((writablePath) =>\n\t\tisEqualOrDescendant(sourcePath, writablePath),\n\t);\n}\n\n/**\n * Validates the complete policy before VM construction reaches a native provider.\n * Paths are rejected rather than silently normalized so one spelling has one meaning.\n */\nexport function validateManagedVmFilteredWorkspacePolicy(\n\tpolicy: ManagedVmFilteredWorkspacePolicy,\n): ManagedVmFilteredWorkspacePolicy {\n\tvalidatePathSet(policy.hiddenPaths, 'hidden path');\n\tvalidatePathSet(policy.temporaryPaths, 'temporary path');\n\tvalidateReadonlyInputs(policy.readonlyInputs);\n\n\tif (policy.visibility.kind === 'positive-paths') {\n\t\tvalidatePathSet(policy.visibility.visiblePaths, 'visible path');\n\t\tvalidatePathSet(policy.visibility.writablePaths, 'writable path');\n\t\tif (policy.visibility.visiblePaths.length === 0) {\n\t\t\tthrow new Error('A positive filtered workspace policy must admit at least one visible path.');\n\t\t}\n\t\tfor (const writablePath of policy.visibility.writablePaths) {\n\t\t\tassertWithinPositiveVisibility(writablePath, policy.visibility.visiblePaths, 'Writable path');\n\t\t}\n\t\tfor (const temporaryPath of policy.temporaryPaths) {\n\t\t\tassertWithinPositiveVisibility(\n\t\t\t\ttemporaryPath,\n\t\t\t\tpolicy.visibility.visiblePaths,\n\t\t\t\t'Temporary path',\n\t\t\t);\n\t\t}\n\t\tfor (const readonlyInput of policy.readonlyInputs) {\n\t\t\tassertWithinPositiveVisibility(\n\t\t\t\treadonlyInput.destinationRelativePath,\n\t\t\t\tpolicy.visibility.visiblePaths,\n\t\t\t\t'Read-only destination',\n\t\t\t);\n\t\t}\n\t\tfor (const hiddenPath of policy.hiddenPaths) {\n\t\t\tif (\n\t\t\t\t!policy.visibility.visiblePaths.some((visiblePath) => pathsOverlap(hiddenPath, visiblePath))\n\t\t\t) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Hidden path '${hiddenPath}' is outside the positive visibility allowlist.`,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tfor (const readonlyInput of policy.readonlyInputs) {\n\t\tif (readonlyInputSourceIsWritable(readonlyInput, policy)) {\n\t\t\tthrow new Error(\n\t\t\t\t`Read-only input source '${readonlyInput.sourceRelativePath}' remains writable at its original workspace path.`,\n\t\t\t);\n\t\t}\n\t\tfor (const writablePath of policy.visibility.kind === 'positive-paths'\n\t\t\t? policy.visibility.writablePaths\n\t\t\t: []) {\n\t\t\tif (\n\t\t\t\twritablePath !== readonlyInput.destinationRelativePath &&\n\t\t\t\tisEqualOrDescendant(writablePath, readonlyInput.destinationRelativePath)\n\t\t\t) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`writable path '${writablePath}' has read-only ancestor '${readonlyInput.destinationRelativePath}'.`,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn {\n\t\thiddenPaths: [...policy.hiddenPaths],\n\t\treadonlyInputs: policy.readonlyInputs.map((readonlyInput) => ({ ...readonlyInput })),\n\t\ttemporaryPaths: [...policy.temporaryPaths],\n\t\tvisibility:\n\t\t\tpolicy.visibility.kind === 'whole-root-writable'\n\t\t\t\t? { kind: 'whole-root-writable' }\n\t\t\t\t: {\n\t\t\t\t\t\tkind: 'positive-paths',\n\t\t\t\t\t\tvisiblePaths: [...policy.visibility.visiblePaths],\n\t\t\t\t\t\twritablePaths: [...policy.visibility.writablePaths],\n\t\t\t\t\t},\n\t};\n}\n","import type {\n\tManagedVmCanonicalDirectoryIdentity,\n\tOwnedHostDirectory,\n\tOwnedHostDirectoryState,\n\tOwnedHostDirectoryTransfer,\n} from './managed-vm-contracts.js';\n\nexport interface OwnedHostDirectoryControllerOptions {\n\treadonly identity: ManagedVmCanonicalDirectoryIdentity;\n\treadonly onClose: () => void;\n\treadonly onConsume?: () => void;\n}\n\n/**\n * Creates the backend-neutral half of an owned-directory capability. Native\n * resources remain captured by provider callbacks and never enter this object.\n */\nexport function createOwnedHostDirectoryController(\n\toptions: OwnedHostDirectoryControllerOptions,\n): OwnedHostDirectory {\n\ttype InternalOwnedHostDirectoryState = OwnedHostDirectoryState | 'transferring';\n\tlet currentState: InternalOwnedHostDirectoryState = 'acquired';\n\tlet resourceClosed = false;\n\tlet resourceClosing = false;\n\tconst getInternalState = (): InternalOwnedHostDirectoryState => currentState;\n\n\tconst closeResource = (): boolean => {\n\t\tif (resourceClosed) {\n\t\t\treturn true;\n\t\t}\n\t\tif (resourceClosing) {\n\t\t\treturn false;\n\t\t}\n\t\tresourceClosing = true;\n\t\ttry {\n\t\t\toptions.onClose();\n\t\t\tresourceClosed = true;\n\t\t\treturn true;\n\t\t} finally {\n\t\t\tresourceClosing = false;\n\t\t}\n\t};\n\n\tconst transfer: OwnedHostDirectoryTransfer = {\n\t\tclose(): void {\n\t\t\tif (currentState !== 'adapter-owned') {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (closeResource()) {\n\t\t\t\tcurrentState = 'closed';\n\t\t\t}\n\t\t},\n\t\tget identity(): ManagedVmCanonicalDirectoryIdentity {\n\t\t\treturn options.identity;\n\t\t},\n\t\tget state(): 'adapter-owned' | 'closed' {\n\t\t\treturn currentState === 'adapter-owned' ? 'adapter-owned' : 'closed';\n\t\t},\n\t};\n\n\treturn {\n\t\tclose(): void {\n\t\t\tif (currentState === 'adapter-owned') {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t'Owned host directory cannot be closed by its former owner after transfer.',\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (getInternalState() === 'closed') {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (closeResource()) {\n\t\t\t\tcurrentState = 'closed';\n\t\t\t}\n\t\t},\n\t\tconsume(): OwnedHostDirectoryTransfer {\n\t\t\tif (currentState !== 'acquired') {\n\t\t\t\tthrow new Error(`Owned host directory cannot be consumed while ${currentState}.`);\n\t\t\t}\n\t\t\tcurrentState = 'transferring';\n\t\t\ttry {\n\t\t\t\toptions.onConsume?.();\n\t\t\t} catch (consumeError) {\n\t\t\t\ttry {\n\t\t\t\t\tif (closeResource()) {\n\t\t\t\t\t\tcurrentState = 'closed';\n\t\t\t\t\t}\n\t\t\t\t} catch (closeError) {\n\t\t\t\t\t// oxlint-disable-next-line preserve-caught-error -- AggregateError.errors retains cleanup failure while cause retains the transfer failure.\n\t\t\t\t\tthrow new AggregateError(\n\t\t\t\t\t\t[consumeError, closeError],\n\t\t\t\t\t\t'Owned host directory transfer and cleanup both failed.',\n\t\t\t\t\t\t{ cause: consumeError },\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tthrow consumeError;\n\t\t\t}\n\t\t\tif (getInternalState() === 'closed') {\n\t\t\t\tthrow new Error('Owned host directory closed during ownership transfer.');\n\t\t\t}\n\t\t\tcurrentState = 'adapter-owned';\n\t\t\treturn transfer;\n\t\t},\n\t\tget identity(): ManagedVmCanonicalDirectoryIdentity {\n\t\t\treturn options.identity;\n\t\t},\n\t\tget state(): OwnedHostDirectoryState {\n\t\t\treturn currentState === 'transferring' ? 'acquired' : currentState;\n\t\t},\n\t};\n}\n\nexport function assertPositiveHostProcessId(hostProcessId: number | null): number {\n\tif (!Number.isSafeInteger(hostProcessId) || hostProcessId === null || hostProcessId <= 0) {\n\t\tthrow new Error('A started managed VM must expose a positive stable host process ID.');\n\t}\n\treturn hostProcessId;\n}\n"],"mappings":";;AAwPA,SAAS,kCAAkC,cAA+B;CACzE,IACC,aAAa,WAAW,KACxB,aAAa,WAAW,IAAI,IAC5B,aAAa,SAAS,IAAI,IAC1B,aAAa,SAAS,KAAK,IAC3B,aAAa,SAAS,KAAK,EAE3B,OAAO;CAGR,OADiB,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 +1,6 @@
1
1
  {
2
2
  "name": "@agent-vm/managed-vm",
3
- "version": "0.0.118",
3
+ "version": "0.0.120",
4
4
  "description": "Backend-neutral managed VM contracts and ownership semantics for agent-vm.",
5
5
  "homepage": "https://github.com/ShravanSunder/agent-vm#readme",
6
6
  "bugs": {