@codeworksh/plugin 0.0.1-dev.20260922103030

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +111 -0
  3. package/error-ClDISWlT.d.mts +11 -0
  4. package/event-rIZpnOTo.d.mts +895 -0
  5. package/event.d.mts +2 -0
  6. package/event.mjs +125 -0
  7. package/event.mjs.map +1 -0
  8. package/filesystem-Cp-KapCE.d.mts +142 -0
  9. package/ids-CHjmAdTc.d.mts +43 -0
  10. package/ids.d.mts +2 -0
  11. package/ids.mjs +48 -0
  12. package/ids.mjs.map +1 -0
  13. package/index.d.mts +3 -0
  14. package/index.mjs +3 -0
  15. package/io-BYs7hbiY.d.mts +497 -0
  16. package/location-D4hAfuXF.d.mts +61 -0
  17. package/location.d.mts +2 -0
  18. package/location.mjs +48 -0
  19. package/location.mjs.map +1 -0
  20. package/package.json +200 -0
  21. package/plugin/prompt.d.mts +2 -0
  22. package/plugin/prompt.mjs +7 -0
  23. package/plugin/prompt.mjs.map +1 -0
  24. package/plugin/tool.d.mts +2 -0
  25. package/plugin/tool.mjs +29 -0
  26. package/plugin/tool.mjs.map +1 -0
  27. package/plugin-DbJEpY3M.d.mts +140 -0
  28. package/plugin-lorpq7Oi.mjs +41 -0
  29. package/plugin-lorpq7Oi.mjs.map +1 -0
  30. package/plugin.d.mts +4 -0
  31. package/plugin.mjs +4 -0
  32. package/posix.d.mts +6 -0
  33. package/posix.mjs +8 -0
  34. package/posix.mjs.map +1 -0
  35. package/project-CLGsIFD-.d.mts +21 -0
  36. package/project.d.mts +2 -0
  37. package/project.mjs +22 -0
  38. package/project.mjs.map +1 -0
  39. package/prompt-BcpagjGh.d.mts +10 -0
  40. package/repo.d.mts +42 -0
  41. package/repo.mjs +46 -0
  42. package/repo.mjs.map +1 -0
  43. package/rolldown-runtime-D7D4PA-g.mjs +13 -0
  44. package/sandbox/driver.d.mts +2 -0
  45. package/sandbox/driver.mjs +63 -0
  46. package/sandbox/driver.mjs.map +1 -0
  47. package/sandbox/error.d.mts +7 -0
  48. package/sandbox/error.mjs +15 -0
  49. package/sandbox/error.mjs.map +1 -0
  50. package/sandbox/errors.d.mts +2 -0
  51. package/sandbox/errors.mjs +160 -0
  52. package/sandbox/errors.mjs.map +1 -0
  53. package/sandbox/filesystem.d.mts +2 -0
  54. package/sandbox/filesystem.mjs +142 -0
  55. package/sandbox/filesystem.mjs.map +1 -0
  56. package/sandbox/instance.d.mts +2 -0
  57. package/sandbox/instance.mjs +144 -0
  58. package/sandbox/instance.mjs.map +1 -0
  59. package/sandbox/io.d.mts +2 -0
  60. package/sandbox/io.mjs +127 -0
  61. package/sandbox/io.mjs.map +1 -0
  62. package/sandbox/resource.d.mts +28 -0
  63. package/sandbox/resource.mjs +29 -0
  64. package/sandbox/resource.mjs.map +1 -0
  65. package/sandbox/shell.d.mts +2 -0
  66. package/sandbox/shell.mjs +93 -0
  67. package/sandbox/shell.mjs.map +1 -0
  68. package/sandbox.d.mts +17 -0
  69. package/sandbox.mjs +39 -0
  70. package/sandbox.mjs.map +1 -0
  71. package/schema.d.mts +91 -0
  72. package/schema.mjs +105 -0
  73. package/schema.mjs.map +1 -0
  74. package/settings-CYL6yyDD.d.mts +193 -0
  75. package/settings.d.mts +2 -0
  76. package/settings.mjs +102 -0
  77. package/settings.mjs.map +1 -0
  78. package/shell-CZ6Y4lNU.d.mts +109 -0
  79. package/space-CR-9UxdT.d.mts +25 -0
  80. package/space.d.mts +2 -0
  81. package/space.mjs +33 -0
  82. package/space.mjs.map +1 -0
  83. package/tool/error.d.mts +2 -0
  84. package/tool/error.mjs +11 -0
  85. package/tool/error.mjs.map +1 -0
  86. package/tool/progress.d.mts +2 -0
  87. package/tool/progress.mjs +11 -0
  88. package/tool/progress.mjs.map +1 -0
  89. package/tool-BoVqkYvL.d.mts +287 -0
  90. package/tool-DuYBgiJf.d.mts +142 -0
  91. package/tool.d.mts +2 -0
  92. package/tool.mjs +71 -0
  93. package/tool.mjs.map +1 -0
@@ -0,0 +1,13 @@
1
+ //#region \0rolldown/runtime.js
2
+ var __defProp = Object.defineProperty;
3
+ var __exportAll = (all, no_symbols) => {
4
+ let target = {};
5
+ for (var name in all) __defProp(target, name, {
6
+ get: all[name],
7
+ enumerable: true
8
+ });
9
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
10
+ return target;
11
+ };
12
+ //#endregion
13
+ export { __exportAll as t };
@@ -0,0 +1,2 @@
1
+ import { A as apiVersion, C as Observed, D as RuntimeConfigBase, E as Registration, F as withSource, M as driver, N as driver_d_exports, O as RuntimeInput, P as erase, S as Name, T as Registered, _ as Capabilities, b as Module, g as ApiVersion, h as AbsolutePath, j as defineModule, k as Source, v as Definition, w as Provisioned, x as ModuleDefinition, y as Driver } from "../io-BYs7hbiY.mjs";
2
+ export { AbsolutePath, ApiVersion, Capabilities, Definition, Driver, Module, ModuleDefinition, Name, Observed, Provisioned, Registered, Registration, RuntimeConfigBase, RuntimeInput, driver_d_exports as SandboxDriver, Source, apiVersion, driver, erase, defineModule as module, withSource };
@@ -0,0 +1,63 @@
1
+ import { t as __exportAll } from "../rolldown-runtime-D7D4PA-g.mjs";
2
+ import "./instance.mjs";
3
+ import "./io.mjs";
4
+ import { Schema } from "effect";
5
+ //#region src/sandbox/driver.ts
6
+ var driver_exports = /* @__PURE__ */ __exportAll({
7
+ AbsolutePath: () => AbsolutePath,
8
+ Name: () => Name,
9
+ RuntimeConfigBase: () => RuntimeConfigBase,
10
+ SandboxDriver: () => driver_exports,
11
+ apiVersion: () => 1,
12
+ driver: () => driver,
13
+ erase: () => erase,
14
+ module: () => defineModule,
15
+ withSource: () => withSource
16
+ });
17
+ /** Version of the loadable sandbox-driver module ABI. */
18
+ const apiVersion = 1;
19
+ /** Open driver identity. Adding a driver never extends a union in core. */
20
+ const Name = Schema.String.check(Schema.isNonEmpty()).pipe(Schema.brand("SandboxDriver.Name"));
21
+ /** A path whose coordinate system is the mounted namespace. */
22
+ const AbsolutePath = Schema.String.check(Schema.isStartsWith("/")).pipe(Schema.brand("SandboxDriver.AbsolutePath"));
23
+ const RuntimeConfigBase = Schema.Struct({ defaultCwd: AbsolutePath });
24
+ const erase = (value) => ({
25
+ name: value.name,
26
+ kind: value.kind,
27
+ capabilities: value.capabilities,
28
+ createConfigCodec: value.createConfigCodec,
29
+ runtimeConfigCodec: value.runtimeConfigCodec,
30
+ create: (input) => value.create({
31
+ instanceId: input.instanceId,
32
+ config: input.config
33
+ }),
34
+ ...value.runtimeConfigFor === void 0 ? {} : { runtimeConfigFor: (input) => value.runtimeConfigFor({
35
+ providerResourceId: input.providerResourceId,
36
+ ...input.overrides === void 0 ? {} : { overrides: input.overrides }
37
+ }) },
38
+ attach: (input) => value.attach(input),
39
+ ...value.inspect === void 0 ? {} : { inspect: (input) => value.inspect(input) },
40
+ ...value.wake === void 0 ? {} : { wake: (input) => value.wake(input) },
41
+ ...value.stop === void 0 ? {} : { stop: (input) => value.stop(input) },
42
+ ...value.destroy === void 0 ? {} : { destroy: (input) => value.destroy(input) }
43
+ });
44
+ /** Define the default export of a loadable sandbox package. */
45
+ const defineModule = (value) => ({
46
+ ...value,
47
+ name: Name.make(value.name)
48
+ });
49
+ /** Construct a driver and its registry contribution. */
50
+ const driver = (value) => Object.assign(value, {
51
+ registered: erase(value),
52
+ apiVersion: 1,
53
+ source: "builtin"
54
+ });
55
+ /** Attach trusted origin metadata without changing the driver implementation. */
56
+ const withSource = (registration, source) => ({
57
+ ...registration,
58
+ source
59
+ });
60
+ //#endregion
61
+ export { AbsolutePath, Name, RuntimeConfigBase, driver_exports as SandboxDriver, apiVersion, driver, erase, defineModule as module, withSource };
62
+
63
+ //# sourceMappingURL=driver.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"driver.mjs","names":[],"sources":["../../../src/sandbox/driver.ts"],"sourcesContent":["import { type Effect, type Layer, Option, Schema } from \"effect\";\nimport type { SandboxProviderError } from \"./errors.ts\";\nimport { SandboxInstance } from \"./instance.ts\";\nimport { SandboxIO } from \"./io.ts\";\n\n/** Version of the loadable sandbox-driver module ABI. */\nexport const apiVersion = 1 as const;\nexport type ApiVersion = typeof apiVersion;\n\n/** Open driver identity. Adding a driver never extends a union in core. */\nexport const Name = Schema.String.check(Schema.isNonEmpty()).pipe(Schema.brand(\"SandboxDriver.Name\"));\nexport type Name = typeof Name.Type;\n\n/** A path whose coordinate system is the mounted namespace. */\nexport const AbsolutePath = Schema.String.check(Schema.isStartsWith(\"/\")).pipe(\n\tSchema.brand(\"SandboxDriver.AbsolutePath\"),\n);\nexport type AbsolutePath = typeof AbsolutePath.Type;\n\nexport const RuntimeConfigBase = Schema.Struct({ defaultCwd: AbsolutePath });\nexport interface RuntimeConfigBase extends Schema.Schema.Type<typeof RuntimeConfigBase> {}\n\nexport interface Capabilities {\n\treadonly inspect: boolean;\n\treadonly reattach: boolean;\n\treadonly wake: boolean;\n\treadonly stop: boolean;\n\treadonly destroy: boolean;\n\treadonly cancels: boolean;\n}\n\nexport interface Observed {\n\treadonly status: SandboxInstance.Status;\n\treadonly providerStatus?: string | undefined;\n\treadonly metadata?: Readonly<Record<string, string>> | undefined;\n}\n\nexport interface Provisioned<RuntimeConfig extends RuntimeConfigBase> {\n\treadonly providerResourceId?: string | undefined;\n\treadonly providerStatus?: string | undefined;\n\treadonly runtimeConfig: RuntimeConfig;\n\treadonly metadata?: Readonly<Record<string, string>> | undefined;\n}\n\nexport interface RuntimeInput<RuntimeConfig extends RuntimeConfigBase> {\n\treadonly id: SandboxInstance.ID;\n\treadonly providerResourceId: Option.Option<string>;\n\treadonly runtimeConfig: RuntimeConfig;\n}\n\nexport interface Driver<CreateConfig, RuntimeConfig extends RuntimeConfigBase> {\n\treadonly name: Name;\n\treadonly kind: Exclude<SandboxInstance.Kind, \"local\">;\n\treadonly capabilities: Capabilities;\n\treadonly createConfigCodec: Schema.Codec<CreateConfig, unknown>;\n\treadonly runtimeConfigCodec: Schema.Codec<RuntimeConfig, unknown>;\n\treadonly create: (input: {\n\t\treadonly instanceId: SandboxInstance.ID;\n\t\treadonly config: CreateConfig;\n\t}) => Effect.Effect<Provisioned<RuntimeConfig>, SandboxProviderError>;\n\treadonly runtimeConfigFor?:\n\t\t| ((input: {\n\t\t\t\treadonly providerResourceId: string;\n\t\t\t\treadonly overrides?: Partial<RuntimeConfig> | undefined;\n\t\t }) => Effect.Effect<RuntimeConfig, SandboxProviderError>)\n\t\t| undefined;\n\treadonly attach: (\n\t\tinput: RuntimeInput<RuntimeConfig>,\n\t) => Layer.Layer<SandboxIO.FileSystem | SandboxIO.Shell, SandboxProviderError>;\n\treadonly inspect?: (input: RuntimeInput<RuntimeConfig>) => Effect.Effect<Observed, SandboxProviderError>;\n\treadonly wake?: (input: RuntimeInput<RuntimeConfig>) => Effect.Effect<Observed, SandboxProviderError>;\n\treadonly stop?: (input: RuntimeInput<RuntimeConfig>) => Effect.Effect<Observed, SandboxProviderError>;\n\treadonly destroy?: (input: RuntimeInput<RuntimeConfig>) => Effect.Effect<void, SandboxProviderError>;\n}\n\nexport type Definition<CreateConfig, RuntimeConfig extends RuntimeConfigBase> = Pick<\n\tDriver<CreateConfig, RuntimeConfig>,\n\t\"name\" | \"createConfigCodec\" | \"runtimeConfigCodec\"\n>;\n\n/** Registry-only erased shape. Driver authors construct it via {@link driver}. */\nexport interface Registered {\n\treadonly name: Name;\n\treadonly kind: Exclude<SandboxInstance.Kind, \"local\">;\n\treadonly capabilities: Capabilities;\n\treadonly createConfigCodec: Schema.Codec<unknown, unknown>;\n\treadonly runtimeConfigCodec: Schema.Codec<RuntimeConfigBase, unknown>;\n\treadonly create: (input: {\n\t\treadonly instanceId: SandboxInstance.ID;\n\t\treadonly config: unknown;\n\t}) => Effect.Effect<Provisioned<RuntimeConfigBase>, SandboxProviderError>;\n\treadonly runtimeConfigFor?:\n\t\t| ((input: {\n\t\t\t\treadonly providerResourceId: string;\n\t\t\t\treadonly overrides?: Readonly<Record<string, unknown>> | undefined;\n\t\t }) => Effect.Effect<RuntimeConfigBase, SandboxProviderError>)\n\t\t| undefined;\n\treadonly attach: (\n\t\tinput: RuntimeInput<RuntimeConfigBase>,\n\t) => Layer.Layer<SandboxIO.FileSystem | SandboxIO.Shell, SandboxProviderError>;\n\treadonly inspect?: (input: RuntimeInput<RuntimeConfigBase>) => Effect.Effect<Observed, SandboxProviderError>;\n\treadonly wake?: (input: RuntimeInput<RuntimeConfigBase>) => Effect.Effect<Observed, SandboxProviderError>;\n\treadonly stop?: (input: RuntimeInput<RuntimeConfigBase>) => Effect.Effect<Observed, SandboxProviderError>;\n\treadonly destroy?: (input: RuntimeInput<RuntimeConfigBase>) => Effect.Effect<void, SandboxProviderError>;\n}\n\nexport const erase = <CreateConfig, RuntimeConfig extends RuntimeConfigBase>(\n\tvalue: Driver<CreateConfig, RuntimeConfig>,\n): Registered => ({\n\tname: value.name,\n\tkind: value.kind,\n\tcapabilities: value.capabilities,\n\tcreateConfigCodec: value.createConfigCodec as Schema.Codec<unknown, unknown>,\n\truntimeConfigCodec: value.runtimeConfigCodec as Schema.Codec<RuntimeConfigBase, unknown>,\n\tcreate: (input) => value.create({ instanceId: input.instanceId, config: input.config as CreateConfig }),\n\t...(value.runtimeConfigFor === undefined\n\t\t? {}\n\t\t: {\n\t\t\t\truntimeConfigFor: (input: {\n\t\t\t\t\treadonly providerResourceId: string;\n\t\t\t\t\treadonly overrides?: Readonly<Record<string, unknown>> | undefined;\n\t\t\t\t}) =>\n\t\t\t\t\tvalue.runtimeConfigFor!({\n\t\t\t\t\t\tproviderResourceId: input.providerResourceId,\n\t\t\t\t\t\t...(input.overrides === undefined ? {} : { overrides: input.overrides as Partial<RuntimeConfig> }),\n\t\t\t\t\t}),\n\t\t\t}),\n\tattach: (input) => value.attach(input as RuntimeInput<RuntimeConfig>),\n\t...(value.inspect === undefined\n\t\t? {}\n\t\t: { inspect: (input: RuntimeInput<RuntimeConfigBase>) => value.inspect!(input as RuntimeInput<RuntimeConfig>) }),\n\t...(value.wake === undefined\n\t\t? {}\n\t\t: { wake: (input: RuntimeInput<RuntimeConfigBase>) => value.wake!(input as RuntimeInput<RuntimeConfig>) }),\n\t...(value.stop === undefined\n\t\t? {}\n\t\t: { stop: (input: RuntimeInput<RuntimeConfigBase>) => value.stop!(input as RuntimeInput<RuntimeConfig>) }),\n\t...(value.destroy === undefined\n\t\t? {}\n\t\t: { destroy: (input: RuntimeInput<RuntimeConfigBase>) => value.destroy!(input as RuntimeInput<RuntimeConfig>) }),\n});\n\nexport type Source = \"core\" | \"builtin\" | \"package\" | \"file\";\n\nexport interface Registration {\n\treadonly registered: Registered;\n\treadonly apiVersion: ApiVersion;\n\treadonly source: Source;\n}\n\nexport interface Module<Options> {\n\treadonly apiVersion: ApiVersion;\n\treadonly name: Name;\n\treadonly options: Schema.Codec<Options, unknown>;\n\treadonly make: (options: Options) => Registration;\n}\n\nexport interface ModuleDefinition<Options> {\n\treadonly apiVersion: ApiVersion;\n\treadonly name: string | Name;\n\treadonly options: Schema.Codec<Options, unknown>;\n\treadonly make: (options: Options) => Registration;\n}\n\n/** Define the default export of a loadable sandbox package. */\nconst defineModule = <Options>(value: ModuleDefinition<Options>): Module<Options> => ({\n\t...value,\n\tname: Name.make(value.name),\n});\nexport { defineModule as module };\n\n/** Construct a driver and its registry contribution. */\nexport const driver = <CreateConfig, RuntimeConfig extends RuntimeConfigBase>(\n\tvalue: Driver<CreateConfig, RuntimeConfig>,\n): Driver<CreateConfig, RuntimeConfig> & Registration =>\n\tObject.assign(value, {\n\t\tregistered: erase(value),\n\t\tapiVersion,\n\t\tsource: \"builtin\" as const,\n\t});\n\n/** Attach trusted origin metadata without changing the driver implementation. */\nexport const withSource = (registration: Registration, source: Source): Registration => ({\n\t...registration,\n\tsource,\n});\n\nexport * as SandboxDriver from \"./driver.ts\";\n"],"mappings":";;;;;;;;;;;;;;;;;AAMA,MAAa,aAAa;;AAI1B,MAAa,OAAO,OAAO,OAAO,MAAM,OAAO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cAAc,cAA4B,YAAkC;CACxF,GAAG;CACH;AACD"}
@@ -0,0 +1,7 @@
1
+ import { I as Redactor, at as providerError, ct as sanitizeError, it as makeRedactor, ot as providerErrorCause, q as SandboxProviderError, st as providerErrorIsNotFound } from "../io-BYs7hbiY.mjs";
2
+ declare namespace error_d_exports {
3
+ export { Redactor, SandboxProviderError, makeRedactor, providerError, providerErrorCause, providerErrorIsNotFound, sanitizeError };
4
+ }
5
+ //#endregion
6
+ export { type Redactor, SandboxProviderError, makeRedactor, providerError, providerErrorCause, providerErrorIsNotFound, sanitizeError, error_d_exports as t };
7
+ //# sourceMappingURL=error.d.mts.map
@@ -0,0 +1,15 @@
1
+ import { t as __exportAll } from "../rolldown-runtime-D7D4PA-g.mjs";
2
+ import { SandboxProviderError, makeRedactor, providerError, providerErrorCause, providerErrorIsNotFound, sanitizeError } from "./errors.mjs";
3
+ //#region src/sandbox/error.ts
4
+ var error_exports = /* @__PURE__ */ __exportAll({
5
+ SandboxProviderError: () => SandboxProviderError,
6
+ makeRedactor: () => makeRedactor,
7
+ providerError: () => providerError,
8
+ providerErrorCause: () => providerErrorCause,
9
+ providerErrorIsNotFound: () => providerErrorIsNotFound,
10
+ sanitizeError: () => sanitizeError
11
+ });
12
+ //#endregion
13
+ export { SandboxProviderError, makeRedactor, providerError, providerErrorCause, providerErrorIsNotFound, sanitizeError, error_exports as t };
14
+
15
+ //# sourceMappingURL=error.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error.mjs","names":[],"sources":["../../../src/sandbox/error.ts"],"sourcesContent":["export {\n\tmakeRedactor,\n\tproviderError,\n\tproviderErrorCause,\n\tproviderErrorIsNotFound,\n\tSandboxProviderError,\n\tsanitizeError,\n} from \"./errors.ts\";\nexport type { Redactor } from \"./errors.ts\";\n"],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import { $ as SandboxTransitionConflictError, B as SandboxDriverLoadError, G as SandboxMustBeStoppedError, H as SandboxDriverNotRegisteredError, I as Redactor, J as SandboxReadError, K as SandboxNotFoundError, L as SandboxBusyError, Q as SandboxStopError, R as SandboxCreateError, U as SandboxDriverRegistrationError, V as SandboxDriverLoadPhase, W as SandboxMountError, X as SandboxRegisterError, Y as SandboxRefreshError, Z as SandboxRemovedError, at as providerError, ct as sanitizeError, et as SandboxUnavailError, it as makeRedactor, nt as SandboxWakeError, ot as providerErrorCause, q as SandboxProviderError, rt as errors_d_exports, st as providerErrorIsNotFound, tt as SandboxUnsupportedError, z as SandboxDestroyError } from "../io-BYs7hbiY.mjs";
2
+ export { Redactor, SandboxBusyError, SandboxCreateError, SandboxDestroyError, SandboxDriverLoadError, SandboxDriverLoadPhase, SandboxDriverNotRegisteredError, SandboxDriverRegistrationError, errors_d_exports as SandboxError, SandboxMountError, SandboxMustBeStoppedError, SandboxNotFoundError, SandboxProviderError, SandboxReadError, SandboxRefreshError, SandboxRegisterError, SandboxRemovedError, SandboxStopError, SandboxTransitionConflictError, SandboxUnavailError, SandboxUnsupportedError, SandboxWakeError, makeRedactor, providerError, providerErrorCause, providerErrorIsNotFound, sanitizeError };
@@ -0,0 +1,160 @@
1
+ import { t as __exportAll } from "../rolldown-runtime-D7D4PA-g.mjs";
2
+ import { ID, PersistedError, Status } from "./instance.mjs";
3
+ import { Schema } from "effect";
4
+ //#region src/sandbox/errors.ts
5
+ var errors_exports = /* @__PURE__ */ __exportAll({
6
+ SandboxBusyError: () => SandboxBusyError,
7
+ SandboxDriverLoadError: () => SandboxDriverLoadError,
8
+ SandboxDriverLoadPhase: () => SandboxDriverLoadPhase,
9
+ SandboxDriverNotRegisteredError: () => SandboxDriverNotRegisteredError,
10
+ SandboxDriverRegistrationError: () => SandboxDriverRegistrationError,
11
+ SandboxError: () => errors_exports,
12
+ SandboxMustBeStoppedError: () => SandboxMustBeStoppedError,
13
+ SandboxNotFoundError: () => SandboxNotFoundError,
14
+ SandboxProviderError: () => SandboxProviderError,
15
+ SandboxRemovedError: () => SandboxRemovedError,
16
+ SandboxTransitionConflictError: () => SandboxTransitionConflictError,
17
+ SandboxUnavailError: () => SandboxUnavailError,
18
+ SandboxUnsupportedError: () => SandboxUnsupportedError,
19
+ makeRedactor: () => makeRedactor,
20
+ providerError: () => providerError,
21
+ providerErrorCause: () => providerErrorCause,
22
+ providerErrorIsNotFound: () => providerErrorIsNotFound,
23
+ sanitizeError: () => sanitizeError
24
+ });
25
+ /**
26
+ * Lifecycle errors are confined to the control plane. Once a mount succeeds,
27
+ * consumers continue to see only FileSystemError and ShellError.
28
+ */
29
+ var SandboxNotFoundError = class extends Schema.TaggedError()("SandboxNotFoundError", { id: ID }) {};
30
+ var SandboxDriverNotRegisteredError = class extends Schema.TaggedError()("SandboxDriverNotRegisteredError", {
31
+ driver: Schema.String,
32
+ registered: Schema.optional(Schema.Array(Schema.String))
33
+ }) {};
34
+ var SandboxDriverRegistrationError = class extends Schema.TaggedError()("SandboxDriverRegistrationError", {
35
+ driver: Schema.String,
36
+ reason: Schema.String
37
+ }) {};
38
+ const SandboxDriverLoadPhase = Schema.Literals([
39
+ "resolve",
40
+ "import",
41
+ "module",
42
+ "api-version",
43
+ "options",
44
+ "factory",
45
+ "registration"
46
+ ]);
47
+ var SandboxDriverLoadError = class extends Schema.TaggedError()("SandboxDriverLoadError", {
48
+ specifier: Schema.String,
49
+ phase: SandboxDriverLoadPhase,
50
+ driver: Schema.optional(Schema.String),
51
+ reason: Schema.String
52
+ }) {};
53
+ var SandboxBusyError = class extends Schema.TaggedError()("SandboxBusyError", {
54
+ id: ID,
55
+ refCount: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))
56
+ }) {};
57
+ var SandboxMustBeStoppedError = class extends Schema.TaggedError()("SandboxMustBeStoppedError", {
58
+ id: ID,
59
+ status: Status
60
+ }) {};
61
+ var SandboxRemovedError = class extends Schema.TaggedError()("SandboxRemovedError", {
62
+ id: ID,
63
+ removedAt: Schema.optional(Schema.DateTimeUtc)
64
+ }) {};
65
+ var SandboxUnavailError = class extends Schema.TaggedError()("SandboxUnavailError", {
66
+ id: ID,
67
+ reason: Schema.String
68
+ }) {};
69
+ var SandboxUnsupportedError = class extends Schema.TaggedError()("SandboxUnsupportedError", {
70
+ id: Schema.optional(ID),
71
+ driver: Schema.String,
72
+ operation: Schema.String
73
+ }) {};
74
+ var SandboxTransitionConflictError = class extends Schema.TaggedError()("SandboxTransitionConflictError", {
75
+ id: ID,
76
+ expected: Schema.Array(Status),
77
+ actual: Status
78
+ }) {};
79
+ /**
80
+ * A lifecycle failure safe to serialize, persist, or log.
81
+ *
82
+ * The raw SDK defect is deliberately absent from the schema. It is retained on
83
+ * a non-enumerable symbol by {@link providerError}, so Effect's default
84
+ * formatting and JSON serialization cannot expose credentials nested in it.
85
+ */
86
+ var SandboxProviderError = class extends Schema.TaggedError()("SandboxProviderError", {
87
+ driver: Schema.String,
88
+ operation: Schema.String,
89
+ sanitized: PersistedError
90
+ }) {};
91
+ const rawCause = Symbol("@codework/sandbox/provider/error/raw/cause");
92
+ const missingResource = Symbol("@codework/sandbox/provider/error/missing/resource");
93
+ const providerErrorCause = (error) => error[rawCause];
94
+ const providerErrorIsNotFound = (error) => error[missingResource] === true;
95
+ const REDACTED = "<redacted>";
96
+ /**
97
+ * Conservative text redaction shared by every driver sanitizer.
98
+ *
99
+ * Disclaimer: This can really leak. Its never safe
100
+ *
101
+ * Configured secrets are removed exactly. Common authorization/header and URL
102
+ * query shapes are masked as a second line of defence for values the caller did
103
+ * not explicitly seed.
104
+ *
105
+ * Note: add support for diff regex as needed.
106
+ */
107
+ const makeRedactor = (secrets = []) => {
108
+ const configured = [...secrets].filter((secret) => secret.length > 0).sort((a, b) => b.length - a.length);
109
+ return (value) => {
110
+ let redacted = value;
111
+ for (const secret of configured) redacted = redacted.replaceAll(secret, REDACTED);
112
+ return redacted.replace(/\b(authorization\s*:\s*(?:bearer|basic)\s+)[^\s,;]+/gi, `$1${REDACTED}`).replace(/\b((?:api[-_]?key|token|secret|password)\s*[=:]\s*)[^\s,;&]+/gi, `$1${REDACTED}`).replace(/([?&](?:access_token|api_key|token|secret|password)=)[^&#\s]+/gi, `$1${REDACTED}`).replace(/\b(?:gh[opsu]_[A-Za-z0-9_]{20,}|github_pat_[A-Za-z0-9_]{20,})\b/g, REDACTED);
113
+ };
114
+ };
115
+ const errorCode = (cause) => {
116
+ if (typeof cause !== "object" || cause === null || !("code" in cause)) return void 0;
117
+ const code = cause.code;
118
+ return typeof code === "string" || typeof code === "number" ? String(code) : void 0;
119
+ };
120
+ const errorName = (cause) => {
121
+ if (typeof cause !== "object" || cause === null || !("name" in cause) || typeof cause.name !== "string") return "Error";
122
+ return cause.name;
123
+ };
124
+ const errorMessage = (cause) => {
125
+ if (typeof cause === "object" && cause !== null && "message" in cause && typeof cause.message === "string") return cause.message;
126
+ return String(cause);
127
+ };
128
+ const sanitizeError = (cause, redact = makeRedactor()) => {
129
+ const code = errorCode(cause);
130
+ return {
131
+ name: redact(errorName(cause)),
132
+ message: redact(errorMessage(cause)),
133
+ ...code === void 0 ? {} : { code: redact(code) }
134
+ };
135
+ };
136
+ const providerError = (input) => {
137
+ const redact = input.redact ?? makeRedactor();
138
+ const error = new SandboxProviderError({
139
+ driver: input.driver,
140
+ operation: input.operation,
141
+ sanitized: (input.sanitize ?? sanitizeError)(input.cause, redact)
142
+ });
143
+ Object.defineProperty(error, rawCause, {
144
+ configurable: false,
145
+ enumerable: false,
146
+ value: input.cause,
147
+ writable: false
148
+ });
149
+ Object.defineProperty(error, missingResource, {
150
+ configurable: false,
151
+ enumerable: false,
152
+ value: input.notFound === true,
153
+ writable: false
154
+ });
155
+ return error;
156
+ };
157
+ //#endregion
158
+ export { SandboxBusyError, SandboxDriverLoadError, SandboxDriverLoadPhase, SandboxDriverNotRegisteredError, SandboxDriverRegistrationError, errors_exports as SandboxError, SandboxMustBeStoppedError, SandboxNotFoundError, SandboxProviderError, SandboxRemovedError, SandboxTransitionConflictError, SandboxUnavailError, SandboxUnsupportedError, makeRedactor, providerError, providerErrorCause, providerErrorIsNotFound, sanitizeError };
159
+
160
+ //# sourceMappingURL=errors.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.mjs","names":["SandboxInstance.ID","SandboxInstance.Status","SandboxInstance.PersistedError"],"sources":["../../../src/sandbox/errors.ts"],"sourcesContent":["import { Schema } from \"effect\";\nimport { SandboxInstance } from \"./instance.ts\";\n\n/**\n * Lifecycle errors are confined to the control plane. Once a mount succeeds,\n * consumers continue to see only FileSystemError and ShellError.\n */\nexport class SandboxNotFoundError extends Schema.TaggedError<SandboxNotFoundError>()(\"SandboxNotFoundError\", {\n\tid: SandboxInstance.ID,\n}) {}\n\nexport class SandboxDriverNotRegisteredError extends Schema.TaggedError<SandboxDriverNotRegisteredError>()(\n\t\"SandboxDriverNotRegisteredError\",\n\t{\n\t\tdriver: Schema.String,\n\t\tregistered: Schema.optional(Schema.Array(Schema.String)),\n\t},\n) {}\n\nexport class SandboxDriverRegistrationError extends Schema.TaggedError<SandboxDriverRegistrationError>()(\n\t\"SandboxDriverRegistrationError\",\n\t{\n\t\tdriver: Schema.String,\n\t\treason: Schema.String,\n\t},\n) {}\n\nexport const SandboxDriverLoadPhase = Schema.Literals([\n\t\"resolve\",\n\t\"import\",\n\t\"module\",\n\t\"api-version\",\n\t\"options\",\n\t\"factory\",\n\t\"registration\",\n]);\nexport type SandboxDriverLoadPhase = typeof SandboxDriverLoadPhase.Type;\n\nexport class SandboxDriverLoadError extends Schema.TaggedError<SandboxDriverLoadError>()(\"SandboxDriverLoadError\", {\n\tspecifier: Schema.String,\n\tphase: SandboxDriverLoadPhase,\n\tdriver: Schema.optional(Schema.String),\n\treason: Schema.String,\n}) {}\n\nexport class SandboxBusyError extends Schema.TaggedError<SandboxBusyError>()(\"SandboxBusyError\", {\n\tid: SandboxInstance.ID,\n\trefCount: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n}) {}\n\nexport class SandboxMustBeStoppedError extends Schema.TaggedError<SandboxMustBeStoppedError>()(\n\t\"SandboxMustBeStoppedError\",\n\t{\n\t\tid: SandboxInstance.ID,\n\t\tstatus: SandboxInstance.Status,\n\t},\n) {}\n\nexport class SandboxRemovedError extends Schema.TaggedError<SandboxRemovedError>()(\"SandboxRemovedError\", {\n\tid: SandboxInstance.ID,\n\tremovedAt: Schema.optional(Schema.DateTimeUtc),\n}) {}\n\nexport class SandboxUnavailError extends Schema.TaggedError<SandboxUnavailError>()(\"SandboxUnavailError\", {\n\tid: SandboxInstance.ID,\n\treason: Schema.String,\n}) {}\n\nexport class SandboxUnsupportedError extends Schema.TaggedError<SandboxUnsupportedError>()(\"SandboxUnsupportedError\", {\n\tid: Schema.optional(SandboxInstance.ID),\n\tdriver: Schema.String,\n\toperation: Schema.String,\n}) {}\n\nexport class SandboxTransitionConflictError extends Schema.TaggedError<SandboxTransitionConflictError>()(\n\t\"SandboxTransitionConflictError\",\n\t{\n\t\tid: SandboxInstance.ID,\n\t\texpected: Schema.Array(SandboxInstance.Status),\n\t\tactual: SandboxInstance.Status,\n\t},\n) {}\n\n/**\n * A lifecycle failure safe to serialize, persist, or log.\n *\n * The raw SDK defect is deliberately absent from the schema. It is retained on\n * a non-enumerable symbol by {@link providerError}, so Effect's default\n * formatting and JSON serialization cannot expose credentials nested in it.\n */\nexport class SandboxProviderError extends Schema.TaggedError<SandboxProviderError>()(\"SandboxProviderError\", {\n\tdriver: Schema.String,\n\toperation: Schema.String,\n\tsanitized: SandboxInstance.PersistedError,\n}) {}\n\nconst rawCause = Symbol(\"@codework/sandbox/provider/error/raw/cause\");\nconst missingResource = Symbol(\"@codework/sandbox/provider/error/missing/resource\");\n\nexport const providerErrorCause = (error: SandboxProviderError): unknown =>\n\t(error as SandboxProviderError & { readonly [rawCause]?: unknown })[rawCause];\n\nexport const providerErrorIsNotFound = (error: SandboxProviderError): boolean =>\n\t(error as SandboxProviderError & { readonly [missingResource]?: boolean })[missingResource] === true;\n\nexport type Redactor = (value: string) => string;\n\nconst REDACTED = \"<redacted>\";\n\n/**\n * Conservative text redaction shared by every driver sanitizer.\n *\n * Disclaimer: This can really leak. Its never safe\n *\n * Configured secrets are removed exactly. Common authorization/header and URL\n * query shapes are masked as a second line of defence for values the caller did\n * not explicitly seed.\n *\n * Note: add support for diff regex as needed.\n */\nexport const makeRedactor = (secrets: Iterable<string> = []): Redactor => {\n\tconst configured = [...secrets].filter((secret) => secret.length > 0).sort((a, b) => b.length - a.length);\n\treturn (value) => {\n\t\tlet redacted = value;\n\t\tfor (const secret of configured) redacted = redacted.replaceAll(secret, REDACTED);\n\t\treturn redacted\n\t\t\t.replace(/\\b(authorization\\s*:\\s*(?:bearer|basic)\\s+)[^\\s,;]+/gi, `$1${REDACTED}`)\n\t\t\t.replace(/\\b((?:api[-_]?key|token|secret|password)\\s*[=:]\\s*)[^\\s,;&]+/gi, `$1${REDACTED}`)\n\t\t\t.replace(/([?&](?:access_token|api_key|token|secret|password)=)[^&#\\s]+/gi, `$1${REDACTED}`)\n\t\t\t.replace(/\\b(?:gh[opsu]_[A-Za-z0-9_]{20,}|github_pat_[A-Za-z0-9_]{20,})\\b/g, REDACTED);\n\t};\n};\n\nconst errorCode = (cause: unknown): string | undefined => {\n\tif (typeof cause !== \"object\" || cause === null || !(\"code\" in cause)) return undefined;\n\tconst code = cause.code;\n\treturn typeof code === \"string\" || typeof code === \"number\" ? String(code) : undefined;\n};\n\nconst errorName = (cause: unknown): string => {\n\tif (typeof cause !== \"object\" || cause === null || !(\"name\" in cause) || typeof cause.name !== \"string\")\n\t\treturn \"Error\";\n\treturn cause.name;\n};\n\nconst errorMessage = (cause: unknown): string => {\n\tif (typeof cause === \"object\" && cause !== null && \"message\" in cause && typeof cause.message === \"string\")\n\t\treturn cause.message;\n\treturn String(cause);\n};\n\nexport const sanitizeError = (cause: unknown, redact: Redactor = makeRedactor()): SandboxInstance.PersistedError => {\n\tconst code = errorCode(cause);\n\treturn {\n\t\tname: redact(errorName(cause)),\n\t\tmessage: redact(errorMessage(cause)),\n\t\t...(code === undefined ? {} : { code: redact(code) }),\n\t};\n};\n\nexport const providerError = (input: {\n\treadonly driver: string;\n\treadonly operation: string;\n\treadonly cause: unknown;\n\treadonly redact?: Redactor;\n\treadonly sanitize?: (cause: unknown, redact: Redactor) => SandboxInstance.PersistedError;\n\treadonly notFound?: boolean;\n}): SandboxProviderError => {\n\tconst redact = input.redact ?? makeRedactor();\n\tconst error = new SandboxProviderError({\n\t\tdriver: input.driver,\n\t\toperation: input.operation,\n\t\tsanitized: (input.sanitize ?? sanitizeError)(input.cause, redact),\n\t});\n\tObject.defineProperty(error, rawCause, {\n\t\tconfigurable: false,\n\t\tenumerable: false,\n\t\tvalue: input.cause,\n\t\twritable: false,\n\t});\n\tObject.defineProperty(error, missingResource, {\n\t\tconfigurable: false,\n\t\tenumerable: false,\n\t\tvalue: input.notFound === true,\n\t\twritable: false,\n\t});\n\treturn error;\n};\n\nexport type SandboxMountError =\n\t| SandboxNotFoundError\n\t| SandboxDriverNotRegisteredError\n\t| SandboxUnavailError\n\t| SandboxRemovedError\n\t| SandboxProviderError;\n\nexport type SandboxCreateError =\n\t| SandboxDriverNotRegisteredError\n\t| SandboxDriverRegistrationError\n\t| SandboxProviderError;\n\nexport type SandboxRegisterError =\n\t| SandboxDriverNotRegisteredError\n\t| SandboxDriverRegistrationError\n\t| SandboxUnsupportedError\n\t| SandboxProviderError;\n\nexport type SandboxReadError = never;\n\nexport type SandboxRefreshError =\n\t| SandboxNotFoundError\n\t| SandboxDriverNotRegisteredError\n\t| SandboxUnavailError\n\t| SandboxUnsupportedError\n\t| SandboxProviderError;\n\nexport type SandboxWakeError = SandboxRefreshError | SandboxRemovedError;\n\nexport type SandboxStopError = SandboxWakeError | SandboxBusyError | SandboxTransitionConflictError;\n\nexport type SandboxDestroyError = SandboxStopError | SandboxMustBeStoppedError;\n\nexport * as SandboxError from \"./errors.ts\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,IAAa,uBAAb,cAA0C,OAAO,YAAkC,CAAC,CAAC,wBAAwB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Q,EAAE,UAAU,UAAU,OAAO,MAAM,SAAS,UAC9F,OAAO;CACR,OAAO,MAAM;AACd;AAEA,MAAM,gBAAgB,UAA2B;CAChD,IAAI,OAAO,UAAU,YAAY,UAAU,QAAQ,aAAa,SAAS,OAAO,MAAM,YAAY,UACjG,OAAO,MAAM;CACd,OAAO,OAAO,KAAK;AACpB;AAEA,MAAa,iBAAiB,OAAgB,SAAmB,aAAa,MAAsC;CACnH,MAAM,OAAO,UAAU,KAAK;CAC5B,OAAO;EACN,MAAM,OAAO,UAAU,KAAK,CAAC;EAC7B,SAAS,OAAO,aAAa,KAAK,CAAC;EACnC,GAAI,SAAS,KAAA,IAAY,CAAC,IAAI,EAAE,MAAM,OAAO,IAAI,EAAE;CACpD;AACD;AAEA,MAAa,iBAAiB,UAOF;CAC3B,MAAM,SAAS,MAAM,UAAU,aAAa;CAC5C,MAAM,QAAQ,IAAI,qBAAqB;EACtC,QAAQ,MAAM;EACd,WAAW,MAAM;EACjB,YAAY,MAAM,YAAY,cAAA,CAAe,MAAM,OAAO,MAAM;CACjE,CAAC;CACD,OAAO,eAAe,OAAO,UAAU;EACtC,cAAc;EACd,YAAY;EACZ,OAAO,MAAM;EACb,UAAU;CACX,CAAC;CACD,OAAO,eAAe,OAAO,iBAAiB;EAC7C,cAAc;EACd,YAAY;EACZ,OAAO,MAAM,aAAa;EAC1B,UAAU;CACX,CAAC;CACD,OAAO;AACR"}
@@ -0,0 +1,2 @@
1
+ import { a as Provider, c as filesystem_d_exports, d as realpathScripts, f as validateRmOptions, i as OperationUnsupportedError, l as fromProvider, n as FileSystemError, o as RmOptions, p as withCwd, r as Interface, s as Service, t as FileStat, u as isNotFoundError } from "../filesystem-Cp-KapCE.mjs";
2
+ export { FileStat, FileSystemError, Interface, OperationUnsupportedError, Provider, RmOptions, filesystem_d_exports as SandboxFileSystem, Service, fromProvider, isNotFoundError, realpathScripts, validateRmOptions, withCwd };
@@ -0,0 +1,142 @@
1
+ import { t as __exportAll } from "../rolldown-runtime-D7D4PA-g.mjs";
2
+ import { posix } from "../posix.mjs";
3
+ import { Context, Effect, Schema } from "effect";
4
+ //#region src/sandbox/filesystem.ts
5
+ var filesystem_exports = /* @__PURE__ */ __exportAll({
6
+ FileSystemError: () => FileSystemError,
7
+ OperationUnsupportedError: () => OperationUnsupportedError,
8
+ SandboxFileSystem: () => filesystem_exports,
9
+ Service: () => Service,
10
+ fromProvider: () => fromProvider,
11
+ isNotFoundError: () => isNotFoundError,
12
+ realpathScripts: () => realpathScripts,
13
+ validateRmOptions: () => validateRmOptions,
14
+ withCwd: () => withCwd
15
+ });
16
+ /**
17
+ * The runtime filesystem contract, independent of any backend.
18
+ *
19
+ * Two surfaces, deliberately:
20
+ * - {@link Provider} is what a backend implements — plain promises that reject,
21
+ * matching every SDK we wrap.
22
+ * - {@link Interface} is what the harness consumes — Effect with a typed error
23
+ * channel and tracing spans. {@link fromProvider} bridges the two exactly
24
+ * once, so no consumer ever writes `Effect.tryPromise` against a filesystem.
25
+ *
26
+ * Implementations:
27
+ * - Local:
28
+ * implement it over a VFS (`./local`);
29
+ * local filesystem use OS primitives; hence have broader filesytem capabilities.
30
+ *
31
+ * - Remote:
32
+ * implement it over a provider (`./remote`).
33
+ * remote filesytems depends on the interface provided by the remote provider; hence can have limited filesytem capabilities.
34
+ *
35
+ * `isFile`/`isDirectory` are required booleans; size, mtime, and isSymbolicLink are omitted when the
36
+ * backend cannot report them — never fabricated.
37
+ *
38
+ * **Paths are POSIX, and the harness is Unix-only (for now!).** Every path uses `/`
39
+ * separators on both the host and inside a sandbox — Windows is not supported,
40
+ * so no translation layer exists. Consumers must use the shared Effect POSIX
41
+ * path implementation, never the platform default, or a host running the harness would
42
+ * impose its own flavour on a remote sandbox's paths. Relative paths resolve
43
+ * against the backend's configured `cwd`.
44
+ */
45
+ var OperationUnsupportedError = class extends Schema.TaggedError()("OperationUnsupportedError", {
46
+ operation: Schema.String,
47
+ message: Schema.String
48
+ }) {};
49
+ /** A backend operation failed. `cause` carries the provider's own rejection. */
50
+ var FileSystemError = class extends Schema.TaggedError()("SandboxFileSystemError", {
51
+ method: Schema.String,
52
+ path: Schema.String,
53
+ cause: Schema.optional(Schema.Defect())
54
+ }) {};
55
+ /** Whether a provider failure means the path itself is definitively absent. */
56
+ const isNotFoundError = (cause) => {
57
+ const code = cause?.code;
58
+ return code === "ENOENT" || code === "ENOTDIR";
59
+ };
60
+ /**
61
+ * Shell forms of `realpath` for backends that only expose a process API.
62
+ * `pwd -P` is the portable primitive: directories resolve directly, anything
63
+ * else resolves its parent and keeps the final name as given. Run as
64
+ * `sh -c <script> _ <path>`; try the first, fall back to the second.
65
+ */
66
+ const realpathScripts = ["cd -- \"$1\" && pwd -P", "cd -- \"$(dirname -- \"$1\")\" && printf '%s/%s' \"$(pwd -P)\" \"$(basename -- \"$1\")\""];
67
+ /** The runtime filesystem service — the live {@link Interface} for the active sandbox. */
68
+ var Service = class extends Context.Service()("@codeworksh/plugin/sandbox/filesystem/Service") {};
69
+ /**
70
+ * Reject `rm` options a provider does not implement, before any mutation. Only
71
+ * `recursive` and `force` are part of the contract; anything else is refused
72
+ * loudly rather than silently ignored.
73
+ */
74
+ const validateRmOptions = (options, operation = "rm") => Effect.suspend(() => {
75
+ for (const option of Object.keys(options ?? {})) {
76
+ if (option === "recursive" || option === "force") continue;
77
+ return Effect.fail(new OperationUnsupportedError({
78
+ operation,
79
+ message: `Unsupported rm option: ${option}`
80
+ }));
81
+ }
82
+ return Effect.void;
83
+ });
84
+ /**
85
+ * Lift a {@link Provider} into the runtime {@link Interface}: one place that
86
+ * converts rejections into {@link FileSystemError}, validates `rm` options,
87
+ * creates missing parents on write, and names a tracing span per operation.
88
+ */
89
+ const fromProvider = (provider) => {
90
+ const attempt = (method, path, run) => Effect.tryPromise({
91
+ try: run,
92
+ catch: (cause) => new FileSystemError({
93
+ method,
94
+ path,
95
+ cause
96
+ })
97
+ });
98
+ const writeCreatingParents = (path, content) => {
99
+ const write = attempt("writeFile", path, () => provider.writeFile(path, content));
100
+ const parent = posix.dirname(path);
101
+ return write.pipe(Effect.catch(() => attempt("mkdir", parent, () => provider.mkdir(parent, { recursive: true })).pipe(Effect.ignore, Effect.andThen(write))));
102
+ };
103
+ return {
104
+ readFile: Effect.fn("SandboxFileSystem.readFile")((path) => attempt("readFile", path, () => provider.readFile(path))),
105
+ readFileBuffer: Effect.fn("SandboxFileSystem.readFileBuffer")((path) => attempt("readFileBuffer", path, () => provider.readFileBuffer(path))),
106
+ writeFile: Effect.fn("SandboxFileSystem.writeFile")(writeCreatingParents),
107
+ stat: Effect.fn("SandboxFileSystem.stat")((path) => attempt("stat", path, () => provider.stat(path))),
108
+ ...provider.lstat === void 0 ? {} : { lstat: Effect.fn("SandboxFileSystem.lstat")((path) => attempt("lstat", path, () => provider.lstat(path))) },
109
+ readdir: Effect.fn("SandboxFileSystem.readdir")((path) => attempt("readdir", path, () => provider.readdir(path))),
110
+ exists: Effect.fn("SandboxFileSystem.exists")((path) => attempt("exists", path, () => provider.exists(path))),
111
+ mkdir: Effect.fn("SandboxFileSystem.mkdir")((path, options) => attempt("mkdir", path, () => provider.mkdir(path, options))),
112
+ rm: Effect.fn("SandboxFileSystem.rm")((path, options) => validateRmOptions(options).pipe(Effect.andThen(attempt("rm", path, () => provider.rm(path, options))))),
113
+ realpath: Effect.fn("SandboxFileSystem.realpath")((path) => attempt("realpath", path, () => provider.realpath(path)))
114
+ };
115
+ };
116
+ /**
117
+ * Bind a cwd-neutral filesystem to one mount's working directory.
118
+ *
119
+ * The counterpart of `Shell.withCwd`, and the reason relative paths mean the
120
+ * same thing to both: a shared transport stays rooted at the namespace root, so
121
+ * resolution happens here, per mount, rather than inside a VFS whose `chdir` is
122
+ * global state two mounts would fight over.
123
+ */
124
+ const withCwd = (fs, cwd) => {
125
+ const at = (path) => posix.resolve(cwd, path);
126
+ return {
127
+ readFile: (path) => fs.readFile(at(path)),
128
+ readFileBuffer: (path) => fs.readFileBuffer(at(path)),
129
+ writeFile: (path, content) => fs.writeFile(at(path), content),
130
+ stat: (path) => fs.stat(at(path)),
131
+ readdir: (path) => fs.readdir(at(path)),
132
+ exists: (path) => fs.exists(at(path)),
133
+ mkdir: (path, options) => fs.mkdir(at(path), options),
134
+ rm: (path, options) => fs.rm(at(path), options),
135
+ realpath: (path) => fs.realpath(at(path)),
136
+ ...fs.lstat === void 0 ? {} : { lstat: (path) => fs.lstat(at(path)) }
137
+ };
138
+ };
139
+ //#endregion
140
+ export { FileSystemError, OperationUnsupportedError, filesystem_exports as SandboxFileSystem, Service, fromProvider, isNotFoundError, realpathScripts, validateRmOptions, withCwd };
141
+
142
+ //# sourceMappingURL=filesystem.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filesystem.mjs","names":[],"sources":["../../../src/sandbox/filesystem.ts"],"sourcesContent":["import { Context, Effect, Schema } from \"effect\";\nimport { posix } from \"../posix.ts\";\n\n/**\n * The runtime filesystem contract, independent of any backend.\n *\n * Two surfaces, deliberately:\n * - {@link Provider} is what a backend implements — plain promises that reject,\n * matching every SDK we wrap.\n * - {@link Interface} is what the harness consumes — Effect with a typed error\n * channel and tracing spans. {@link fromProvider} bridges the two exactly\n * once, so no consumer ever writes `Effect.tryPromise` against a filesystem.\n *\n * Implementations:\n * - Local:\n * implement it over a VFS (`./local`);\n * local filesystem use OS primitives; hence have broader filesytem capabilities.\n *\n * - Remote:\n * implement it over a provider (`./remote`).\n * remote filesytems depends on the interface provided by the remote provider; hence can have limited filesytem capabilities.\n *\n * `isFile`/`isDirectory` are required booleans; size, mtime, and isSymbolicLink are omitted when the\n * backend cannot report them — never fabricated.\n *\n * **Paths are POSIX, and the harness is Unix-only (for now!).** Every path uses `/`\n * separators on both the host and inside a sandbox — Windows is not supported,\n * so no translation layer exists. Consumers must use the shared Effect POSIX\n * path implementation, never the platform default, or a host running the harness would\n * impose its own flavour on a remote sandbox's paths. Relative paths resolve\n * against the backend's configured `cwd`.\n */\n\nexport class OperationUnsupportedError extends Schema.TaggedError<OperationUnsupportedError>()(\n\t\"OperationUnsupportedError\",\n\t{\n\t\toperation: Schema.String,\n\t\tmessage: Schema.String,\n\t},\n) {}\n\n/** A backend operation failed. `cause` carries the provider's own rejection. */\nexport class FileSystemError extends Schema.TaggedError<FileSystemError>()(\"SandboxFileSystemError\", {\n\tmethod: Schema.String,\n\tpath: Schema.String,\n\tcause: Schema.optional(Schema.Defect()),\n}) {}\n\nexport interface FileStat {\n\treadonly isFile: boolean;\n\treadonly isDirectory: boolean;\n\treadonly isSymbolicLink?: boolean;\n\treadonly size?: number;\n\treadonly mtime?: Date;\n}\n\nexport interface RmOptions {\n\treadonly recursive?: boolean;\n\treadonly force?: boolean;\n}\n\n/** Whether a provider failure means the path itself is definitively absent. */\nexport const isNotFoundError = (cause: unknown) => {\n\tconst code = (cause as NodeJS.ErrnoException | undefined)?.code;\n\treturn code === \"ENOENT\" || code === \"ENOTDIR\";\n};\n\n/**\n * Shell forms of `realpath` for backends that only expose a process API.\n * `pwd -P` is the portable primitive: directories resolve directly, anything\n * else resolves its parent and keeps the final name as given. Run as\n * `sh -c <script> _ <path>`; try the first, fall back to the second.\n */\nexport const realpathScripts = [\n\t'cd -- \"$1\" && pwd -P',\n\t'cd -- \"$(dirname -- \"$1\")\" && printf \\'%s/%s\\' \"$(pwd -P)\" \"$(basename -- \"$1\")\"',\n] as const;\n\n/**\n * The backend-facing contract. Backends author plain promises and let them\n * reject; {@link fromProvider} turns rejections into typed failures.\n */\nexport interface Provider {\n\treadonly readFile: (path: string) => Promise<string>;\n\treadonly readFileBuffer: (path: string) => Promise<Uint8Array>;\n\t/**\n\t * Write the file. Parents may be missing — do not create them here;\n\t * {@link fromProvider} owns that guarantee for every backend.\n\t */\n\treadonly writeFile: (path: string, content: string | Uint8Array) => Promise<void>;\n\treadonly stat: (path: string) => Promise<FileStat>;\n\treadonly readdir: (path: string) => Promise<string[]>;\n\treadonly exists: (path: string) => Promise<boolean>;\n\treadonly mkdir: (path: string, options?: { recursive?: boolean }) => Promise<void>;\n\treadonly rm: (path: string, options?: RmOptions) => Promise<void>;\n\t/** Canonical absolute path with symlinks resolved; rejects when the path does not exist. */\n\treadonly realpath: (path: string) => Promise<string>;\n\t/**\n\t * Metadata for the directory entry itself rather than a symlink's target.\n\t * Optional: a backend whose `stat` has mixed symlink semantics implements it\n\t * so symlink identity is asked for explicitly, never inferred.\n\t */\n\treadonly lstat?: (path: string) => Promise<FileStat>;\n}\n\n/**\n * The consumer-facing contract. `exists` distinguishes \"absent\" from \"could not\n * tell\": a backend failure is a typed failure, not `false`, so a caller acting\n * on absence never acts on a network blip. Use `SandboxFs.existsOrFalse` where\n * a best-effort answer really is wanted.\n */\nexport interface Interface {\n\treadonly readFile: (path: string) => Effect.Effect<string, FileSystemError>;\n\treadonly readFileBuffer: (path: string) => Effect.Effect<Uint8Array, FileSystemError>;\n\t/** Creates missing parent directories, on every backend. */\n\treadonly writeFile: (path: string, content: string | Uint8Array) => Effect.Effect<void, FileSystemError>;\n\treadonly stat: (path: string) => Effect.Effect<FileStat, FileSystemError>;\n\treadonly readdir: (path: string) => Effect.Effect<string[], FileSystemError>;\n\treadonly exists: (path: string) => Effect.Effect<boolean, FileSystemError>;\n\treadonly mkdir: (path: string, options?: { recursive?: boolean }) => Effect.Effect<void, FileSystemError>;\n\treadonly rm: (path: string, options?: RmOptions) => Effect.Effect<void, FileSystemError | OperationUnsupportedError>;\n\t/** Canonical absolute path with symlinks resolved; fails when the path does not exist. */\n\treadonly realpath: (path: string) => Effect.Effect<string, FileSystemError>;\n\t// `lstat` is present only when the backend supports it; check before calling.\n\treadonly lstat?: (path: string) => Effect.Effect<FileStat, FileSystemError>;\n}\n\n/** The runtime filesystem service — the live {@link Interface} for the active sandbox. */\nexport class Service extends Context.Service<Service, Interface>()(\"@codeworksh/plugin/sandbox/filesystem/Service\") {}\n\n/**\n * Reject `rm` options a provider does not implement, before any mutation. Only\n * `recursive` and `force` are part of the contract; anything else is refused\n * loudly rather than silently ignored.\n */\nexport const validateRmOptions = (\n\toptions: RmOptions | undefined,\n\toperation = \"rm\",\n): Effect.Effect<void, OperationUnsupportedError> =>\n\tEffect.suspend(() => {\n\t\tfor (const option of Object.keys((options ?? {}) as Record<string, unknown>)) {\n\t\t\tif (option === \"recursive\" || option === \"force\") continue;\n\t\t\treturn Effect.fail(new OperationUnsupportedError({ operation, message: `Unsupported rm option: ${option}` }));\n\t\t}\n\t\treturn Effect.void;\n\t});\n\n/**\n * Lift a {@link Provider} into the runtime {@link Interface}: one place that\n * converts rejections into {@link FileSystemError}, validates `rm` options,\n * creates missing parents on write, and names a tracing span per operation.\n */\nexport const fromProvider = (provider: Provider): Interface => {\n\tconst attempt = <A>(method: string, path: string, run: () => Promise<A>) =>\n\t\tEffect.tryPromise({ try: run, catch: (cause) => new FileSystemError({ method, path, cause }) });\n\n\t// The parent-creation guarantee, installed once for every backend instead of\n\t// re-implemented per provider: anything that reaches `Interface` reaches it\n\t// through here, so a backend cannot forget it.\n\t//\n\t// Lazy by design — try the write first, so the happy path stays a single call\n\t// and no remote backend pays a round-trip per write. A failure is usually a\n\t// missing parent, so create it and retry once. The mkdir's own error is\n\t// dropped on purpose: when the write failed for some other reason (EACCES,\n\t// EROFS, a dropped connection), the retry reproduces it, and *that* is the\n\t// failure the caller must see rather than a misleading mkdir error standing\n\t// in for it.\n\tconst writeCreatingParents = (path: string, content: string | Uint8Array) => {\n\t\tconst write = attempt(\"writeFile\", path, () => provider.writeFile(path, content));\n\t\tconst parent = posix.dirname(path);\n\t\treturn write.pipe(\n\t\t\tEffect.catch(() =>\n\t\t\t\tattempt(\"mkdir\", parent, () => provider.mkdir(parent, { recursive: true })).pipe(\n\t\t\t\t\tEffect.ignore,\n\t\t\t\t\tEffect.andThen(write),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t};\n\n\treturn {\n\t\treadFile: Effect.fn(\"SandboxFileSystem.readFile\")((path: string) =>\n\t\t\tattempt(\"readFile\", path, () => provider.readFile(path)),\n\t\t),\n\t\treadFileBuffer: Effect.fn(\"SandboxFileSystem.readFileBuffer\")((path: string) =>\n\t\t\tattempt(\"readFileBuffer\", path, () => provider.readFileBuffer(path)),\n\t\t),\n\t\twriteFile: Effect.fn(\"SandboxFileSystem.writeFile\")(writeCreatingParents),\n\t\tstat: Effect.fn(\"SandboxFileSystem.stat\")((path: string) => attempt(\"stat\", path, () => provider.stat(path))),\n\t\t// carried through only when the backend actually implements it\n\t\t...(provider.lstat === undefined\n\t\t\t? {}\n\t\t\t: {\n\t\t\t\t\tlstat: Effect.fn(\"SandboxFileSystem.lstat\")((path: string) =>\n\t\t\t\t\t\tattempt(\"lstat\", path, () => provider.lstat!(path)),\n\t\t\t\t\t),\n\t\t\t\t}),\n\t\treaddir: Effect.fn(\"SandboxFileSystem.readdir\")((path: string) =>\n\t\t\tattempt(\"readdir\", path, () => provider.readdir(path)),\n\t\t),\n\t\t// A backend that cannot answer fails; it does not report \"absent\". A\n\t\t// caller acting on absence — deleting a record, say — must not be told\n\t\t// the path is gone because a token expired or a request timed out.\n\t\texists: Effect.fn(\"SandboxFileSystem.exists\")((path: string) =>\n\t\t\tattempt(\"exists\", path, () => provider.exists(path)),\n\t\t),\n\t\tmkdir: Effect.fn(\"SandboxFileSystem.mkdir\")((path: string, options?: { recursive?: boolean }) =>\n\t\t\tattempt(\"mkdir\", path, () => provider.mkdir(path, options)),\n\t\t),\n\t\trm: Effect.fn(\"SandboxFileSystem.rm\")((path: string, options?: RmOptions) =>\n\t\t\tvalidateRmOptions(options).pipe(Effect.andThen(attempt(\"rm\", path, () => provider.rm(path, options)))),\n\t\t),\n\t\trealpath: Effect.fn(\"SandboxFileSystem.realpath\")((path: string) =>\n\t\t\tattempt(\"realpath\", path, () => provider.realpath(path)),\n\t\t),\n\t};\n};\n\n/**\n * Bind a cwd-neutral filesystem to one mount's working directory.\n *\n * The counterpart of `Shell.withCwd`, and the reason relative paths mean the\n * same thing to both: a shared transport stays rooted at the namespace root, so\n * resolution happens here, per mount, rather than inside a VFS whose `chdir` is\n * global state two mounts would fight over.\n */\nexport const withCwd = (fs: Interface, cwd: string): Interface => {\n\tconst at = (path: string) => posix.resolve(cwd, path);\n\treturn {\n\t\treadFile: (path) => fs.readFile(at(path)),\n\t\treadFileBuffer: (path) => fs.readFileBuffer(at(path)),\n\t\twriteFile: (path, content) => fs.writeFile(at(path), content),\n\t\tstat: (path) => fs.stat(at(path)),\n\t\treaddir: (path) => fs.readdir(at(path)),\n\t\texists: (path) => fs.exists(at(path)),\n\t\tmkdir: (path, options) => fs.mkdir(at(path), options),\n\t\trm: (path, options) => fs.rm(at(path), options),\n\t\trealpath: (path) => fs.realpath(at(path)),\n\t\t// carried through only when the backend implements it, so a caller can\n\t\t// still detect absence by checking the property\n\t\t...(fs.lstat === undefined ? {} : { lstat: (path: string) => fs.lstat!(at(path)) }),\n\t};\n};\n\nexport * as SandboxFileSystem from \"./filesystem.ts\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCA,IAAa,4BAAb,cAA+C,OAAO,YAAuC,CAAC,CAC7F,6BACA;CACC,WAAW,OAAO;CAClB,SAAS,OAAO;AACjB,CACD,CAAC,CAAC,CAAC;;AAGH,IAAa,kBAAb,cAAqC,OAAO,YAA6B,CAAC,CAAC,0BAA0B;CACpG,QAAQ,OAAO;CACf,MAAM,OAAO;CACb,OAAO,OAAO,SAAS,OAAO,OAAO,CAAC;AACvC,CAAC,CAAC,CAAC,CAAC;;AAgBJ,MAAa,mBAAmB,UAAmB;CAClD,MAAM,OAAQ,OAA6C;CAC3D,OAAO,SAAS,YAAY,SAAS;AACtC;;;;;;;AAQA,MAAa,kBAAkB,CAC9B,0BACA,0FACD;;AAoDA,IAAa,UAAb,cAA6B,QAAQ,QAA4B,CAAC,CAAC,+CAA+C,CAAC,CAAC,CAAC;;;;;;AAOrH,MAAa,qBACZ,SACA,YAAY,SAEZ,OAAO,cAAc;CACpB,KAAK,MAAM,UAAU,OAAO,KAAM,WAA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CAClF;AACD"}
@@ -0,0 +1,2 @@
1
+ import { St as toField, _t as fromField, bt as mountable, dt as Kind, ft as Ownership, gt as fromColumn, ht as Usage, lt as ID, mt as Status, pt as PersistedError, ut as Info, vt as instance_d_exports, xt as toColumn, yt as isMountable } from "../io-BYs7hbiY.mjs";
2
+ export { ID, Info, Kind, Ownership, PersistedError, instance_d_exports as SandboxInstance, Status, Usage, fromColumn, fromField, isMountable, mountable, toColumn, toField };