@codeworksh/plugin 0.2.1-canary.35.1.gd8b65e21 → 0.2.1-canary.37.1.g89a70d77

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.
@@ -149,26 +149,13 @@ declare const AikitAssistantMessage: Schema.decodeTo<Schema.declare<{
149
149
  completed: number;
150
150
  };
151
151
  parts: ({
152
- type: "text";
153
- text: string;
154
- textSignature?: string;
155
- } | {
156
- type: "image";
157
- data: string;
158
- mimeType: string;
159
- } | {
160
- type: "thinking";
161
- thinking: string;
162
- thinkingSignature?: string;
163
- redacted?: boolean;
164
- } | {
165
152
  addedToolNames?: string[];
166
153
  arguments: Record<string, any>;
167
154
  callID: string;
168
155
  name: string;
169
156
  namespace?: string;
170
- partial?: {
171
- content?: ({
157
+ result: {
158
+ content: ({
172
159
  type: "text";
173
160
  text: string;
174
161
  textSignature?: string;
@@ -178,8 +165,9 @@ declare const AikitAssistantMessage: Schema.decodeTo<Schema.declare<{
178
165
  mimeType: string;
179
166
  })[];
180
167
  details?: any;
168
+ isError: false;
181
169
  };
182
- status: "running";
170
+ status: "completed";
183
171
  thoughtSignature?: string;
184
172
  time: {
185
173
  start: number;
@@ -203,9 +191,9 @@ declare const AikitAssistantMessage: Schema.decodeTo<Schema.declare<{
203
191
  mimeType: string;
204
192
  })[];
205
193
  details?: any;
206
- isError: false;
194
+ isError: true;
207
195
  };
208
- status: "completed";
196
+ status: "error";
209
197
  thoughtSignature?: string;
210
198
  time: {
211
199
  start: number;
@@ -231,7 +219,7 @@ declare const AikitAssistantMessage: Schema.decodeTo<Schema.declare<{
231
219
  details?: any;
232
220
  isError: true;
233
221
  };
234
- status: "error";
222
+ status: "skipped";
235
223
  thoughtSignature?: string;
236
224
  time: {
237
225
  start: number;
@@ -257,21 +245,34 @@ declare const AikitAssistantMessage: Schema.decodeTo<Schema.declare<{
257
245
  details?: any;
258
246
  isError: true;
259
247
  };
260
- status: "skipped";
248
+ status: "aborted";
261
249
  thoughtSignature?: string;
262
250
  time: {
263
251
  start: number;
264
252
  end: number;
265
253
  };
266
254
  type: "toolCall";
255
+ } | {
256
+ type: "text";
257
+ text: string;
258
+ textSignature?: string;
259
+ } | {
260
+ type: "image";
261
+ data: string;
262
+ mimeType: string;
263
+ } | {
264
+ type: "thinking";
265
+ thinking: string;
266
+ thinkingSignature?: string;
267
+ redacted?: boolean;
267
268
  } | {
268
269
  addedToolNames?: string[];
269
270
  arguments: Record<string, any>;
270
271
  callID: string;
271
272
  name: string;
272
273
  namespace?: string;
273
- result: {
274
- content: ({
274
+ partial?: {
275
+ content?: ({
275
276
  type: "text";
276
277
  text: string;
277
278
  textSignature?: string;
@@ -281,9 +282,8 @@ declare const AikitAssistantMessage: Schema.decodeTo<Schema.declare<{
281
282
  mimeType: string;
282
283
  })[];
283
284
  details?: any;
284
- isError: true;
285
285
  };
286
- status: "aborted";
286
+ status: "running";
287
287
  thoughtSignature?: string;
288
288
  time: {
289
289
  start: number;
@@ -451,26 +451,13 @@ declare const AikitAssistantMessage: Schema.decodeTo<Schema.declare<{
451
451
  completed: number;
452
452
  };
453
453
  parts: ({
454
- type: "text";
455
- text: string;
456
- textSignature?: string;
457
- } | {
458
- type: "image";
459
- data: string;
460
- mimeType: string;
461
- } | {
462
- type: "thinking";
463
- thinking: string;
464
- thinkingSignature?: string;
465
- redacted?: boolean;
466
- } | {
467
454
  addedToolNames?: string[];
468
455
  arguments: Record<string, any>;
469
456
  callID: string;
470
457
  name: string;
471
458
  namespace?: string;
472
- partial?: {
473
- content?: ({
459
+ result: {
460
+ content: ({
474
461
  type: "text";
475
462
  text: string;
476
463
  textSignature?: string;
@@ -480,8 +467,9 @@ declare const AikitAssistantMessage: Schema.decodeTo<Schema.declare<{
480
467
  mimeType: string;
481
468
  })[];
482
469
  details?: any;
470
+ isError: false;
483
471
  };
484
- status: "running";
472
+ status: "completed";
485
473
  thoughtSignature?: string;
486
474
  time: {
487
475
  start: number;
@@ -505,9 +493,9 @@ declare const AikitAssistantMessage: Schema.decodeTo<Schema.declare<{
505
493
  mimeType: string;
506
494
  })[];
507
495
  details?: any;
508
- isError: false;
496
+ isError: true;
509
497
  };
510
- status: "completed";
498
+ status: "error";
511
499
  thoughtSignature?: string;
512
500
  time: {
513
501
  start: number;
@@ -533,7 +521,7 @@ declare const AikitAssistantMessage: Schema.decodeTo<Schema.declare<{
533
521
  details?: any;
534
522
  isError: true;
535
523
  };
536
- status: "error";
524
+ status: "skipped";
537
525
  thoughtSignature?: string;
538
526
  time: {
539
527
  start: number;
@@ -559,21 +547,34 @@ declare const AikitAssistantMessage: Schema.decodeTo<Schema.declare<{
559
547
  details?: any;
560
548
  isError: true;
561
549
  };
562
- status: "skipped";
550
+ status: "aborted";
563
551
  thoughtSignature?: string;
564
552
  time: {
565
553
  start: number;
566
554
  end: number;
567
555
  };
568
556
  type: "toolCall";
557
+ } | {
558
+ type: "text";
559
+ text: string;
560
+ textSignature?: string;
561
+ } | {
562
+ type: "image";
563
+ data: string;
564
+ mimeType: string;
565
+ } | {
566
+ type: "thinking";
567
+ thinking: string;
568
+ thinkingSignature?: string;
569
+ redacted?: boolean;
569
570
  } | {
570
571
  addedToolNames?: string[];
571
572
  arguments: Record<string, any>;
572
573
  callID: string;
573
574
  name: string;
574
575
  namespace?: string;
575
- result: {
576
- content: ({
576
+ partial?: {
577
+ content?: ({
577
578
  type: "text";
578
579
  text: string;
579
580
  textSignature?: string;
@@ -583,9 +584,8 @@ declare const AikitAssistantMessage: Schema.decodeTo<Schema.declare<{
583
584
  mimeType: string;
584
585
  })[];
585
586
  details?: any;
586
- isError: true;
587
587
  };
588
- status: "aborted";
588
+ status: "running";
589
589
  thoughtSignature?: string;
590
590
  time: {
591
591
  start: number;
@@ -896,4 +896,4 @@ declare function durable<const Definitions extends ReadonlyArray<Definition>>(de
896
896
  declare function latest(definitions: ReadonlyArray<Definition>): ReadonlyMap<string, Definition<string, Schema.Codec<unknown, unknown, never, never>>>;
897
897
  //#endregion
898
898
  export { ID as a, define as c, inventory as d, latest as f, Definition as i, durable as l, AikitToolCallTerminalPart as n, Payload as o, versionedType as p, Data as r, PublishOptions as s, AikitAssistantMessage as t, event_d_exports as u };
899
- //# sourceMappingURL=event-6sTQ_4bq.d.mts.map
899
+ //# sourceMappingURL=event-COPs5rMu.d.mts.map
package/event.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { a as ID, c as define, d as inventory, f as latest, i as Definition, l as durable, n as AikitToolCallTerminalPart, o as Payload, p as versionedType, r as Data, s as PublishOptions, t as AikitAssistantMessage, u as event_d_exports } from "./event-6sTQ_4bq.mjs";
1
+ import { a as ID, c as define, d as inventory, f as latest, i as Definition, l as durable, n as AikitToolCallTerminalPart, o as Payload, p as versionedType, r as Data, s as PublishOptions, t as AikitAssistantMessage, u as event_d_exports } from "./event-COPs5rMu.mjs";
2
2
  export { AikitAssistantMessage, AikitToolCallTerminalPart, Data, Definition, event_d_exports as EventSchema, ID, Payload, PublishOptions, define, durable, inventory, latest, versionedType };
package/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
1
  import { t as section_d_exports } from "./plugin/section.mjs";
2
2
  import { g as tool_d_exports } from "./tool-_ajVYIY5.mjs";
3
- import { t as plugin_d_exports } from "./plugin-Deb2QWIP.mjs";
3
+ import { t as plugin_d_exports } from "./plugin-Dwank4TZ.mjs";
4
4
  export { plugin_d_exports as Plugin, section_d_exports as Section, tool_d_exports as Tool };
@@ -144,12 +144,16 @@ declare const SandboxNotFoundError_base: Schema.Class<SandboxNotFoundError, Sche
144
144
  * Lifecycle errors are confined to the control plane. Once a mount succeeds,
145
145
  * consumers continue to see only FileSystemError and ShellError.
146
146
  */
147
- declare class SandboxNotFoundError extends SandboxNotFoundError_base {}
147
+ declare class SandboxNotFoundError extends SandboxNotFoundError_base {
148
+ get message(): string;
149
+ }
148
150
  declare const SandboxDriverNotRegisteredError_base: Schema.Class<SandboxDriverNotRegisteredError, Schema.TaggedStruct<"SandboxDriverNotRegisteredError", {
149
151
  readonly driver: Schema.String;
150
152
  readonly registered: Schema.optional<Schema.$Array<Schema.String>>;
151
153
  }>, import("effect/Cause").YieldableError>;
152
- declare class SandboxDriverNotRegisteredError extends SandboxDriverNotRegisteredError_base {}
154
+ declare class SandboxDriverNotRegisteredError extends SandboxDriverNotRegisteredError_base {
155
+ get message(): string;
156
+ }
153
157
  declare const SandboxDriverRegistrationError_base: Schema.Class<SandboxDriverRegistrationError, Schema.TaggedStruct<"SandboxDriverRegistrationError", {
154
158
  readonly driver: Schema.String;
155
159
  readonly reason: Schema.String;
@@ -187,7 +191,9 @@ declare const SandboxRemovedError_base: Schema.Class<SandboxRemovedError, Schema
187
191
  };
188
192
  readonly removedAt: Schema.optional<Schema.DateTimeUtc>;
189
193
  }>, import("effect/Cause").YieldableError>;
190
- declare class SandboxRemovedError extends SandboxRemovedError_base {}
194
+ declare class SandboxRemovedError extends SandboxRemovedError_base {
195
+ get message(): string;
196
+ }
191
197
  declare const SandboxUnavailError_base: Schema.Class<SandboxUnavailError, Schema.TaggedStruct<"SandboxUnavailError", {
192
198
  readonly id: Schema.brand<Schema.String, "SandboxInstance.ID"> & {
193
199
  local: string & import("effect/Brand").Brand<"SandboxInstance.ID">;
@@ -195,7 +201,9 @@ declare const SandboxUnavailError_base: Schema.Class<SandboxUnavailError, Schema
195
201
  };
196
202
  readonly reason: Schema.String;
197
203
  }>, import("effect/Cause").YieldableError>;
198
- declare class SandboxUnavailError extends SandboxUnavailError_base {}
204
+ declare class SandboxUnavailError extends SandboxUnavailError_base {
205
+ get message(): string;
206
+ }
199
207
  declare const SandboxUnsupportedError_base: Schema.Class<SandboxUnsupportedError, Schema.TaggedStruct<"SandboxUnsupportedError", {
200
208
  readonly id: Schema.optional<Schema.brand<Schema.String, "SandboxInstance.ID"> & {
201
209
  local: string & import("effect/Brand").Brand<"SandboxInstance.ID">;
@@ -230,7 +238,9 @@ declare const SandboxProviderError_base: Schema.Class<SandboxProviderError, Sche
230
238
  * a non-enumerable symbol by {@link providerError}, so Effect's default
231
239
  * formatting and JSON serialization cannot expose credentials nested in it.
232
240
  */
233
- declare class SandboxProviderError extends SandboxProviderError_base {}
241
+ declare class SandboxProviderError extends SandboxProviderError_base {
242
+ get message(): string;
243
+ }
234
244
  declare const providerErrorCause: (error: SandboxProviderError) => unknown;
235
245
  declare const providerErrorIsNotFound: (error: SandboxProviderError) => boolean;
236
246
  type Redactor = (value: string) => string;
@@ -537,4 +547,4 @@ declare const remote: (input: {
537
547
  }) => Identity;
538
548
  //#endregion
539
549
  export { SandboxRegisterError as $, RuntimeConfigBase as A, SandboxBusyError as B, Module as C, mountable as Ct, Provisioned as D, Observed as E, driver as F, SandboxDriverNotRegisteredError as G, SandboxDestroyError as H, driver_d_exports as I, SandboxMustBeStoppedError as J, SandboxDriverRegistrationError as K, erase as L, Source as M, apiVersion as N, Registered as O, defineModule as P, SandboxRefreshError as Q, withSource as R, Driver as S, isMountable as St, Name as T, toField as Tt, SandboxDriverLoadError as U, SandboxCreateError as V, SandboxDriverLoadPhase as W, SandboxProviderError as X, SandboxNotFoundError as Y, SandboxReadError as Z, withMutation as _, Status as _t, Layer$1 as a, SandboxWakeError as at, Capabilities as b, fromField as bt, Shell as c, providerError as ct, identityLayer as d, sanitizeError as dt, SandboxRemovedError as et, io_d_exports as f, ID as ft, virtual as g, PersistedError as gt, resolveMountCwd as h, Ownership as ht, Identity as i, SandboxUnsupportedError as it, RuntimeInput as j, Registration as k, host as l, providerErrorCause as lt, remote as m, Kind as mt, DEFAULT_SPILL_PATH as n, SandboxTransitionConflictError as nt, Mutation as o, errors_d_exports as ot, mount as p, Info as pt, SandboxMountError as q, FileSystem as r, SandboxUnavailError as rt, Provides as s, makeRedactor as st, Current as t, SandboxStopError as tt, hostLayer as u, providerErrorIsNotFound as ut, AbsolutePath as v, Usage as vt, ModuleDefinition as w, toColumn as wt, Definition as x, instance_d_exports as xt, ApiVersion as y, fromColumn as yt, Redactor as z };
540
- //# sourceMappingURL=io-nhvNKC33.d.mts.map
550
+ //# sourceMappingURL=io-Br9WZTsG.d.mts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codeworksh/plugin",
3
- "version": "0.2.1-canary.35.1.gd8b65e21",
3
+ "version": "0.2.1-canary.37.1.g89a70d77",
4
4
  "description": "SDK for building CodeWork plugins — the plugin, tool, and sandbox contracts shared with @codeworksh/harness.",
5
5
  "keywords": [
6
6
  "agent",
@@ -168,7 +168,7 @@
168
168
  "uuidv7": "^1.2.1"
169
169
  },
170
170
  "peerDependencies": {
171
- "@codeworksh/aikit": "0.11.0-canary.35.1.gd8b65e21",
171
+ "@codeworksh/aikit": "0.11.0-canary.37.1.g89a70d77",
172
172
  "effect": "4.0.5"
173
173
  }
174
174
  }
@@ -1,7 +1,7 @@
1
- import { i as Definition, o as Payload, r as Data, s as PublishOptions } from "./event-6sTQ_4bq.mjs";
1
+ import { i as Definition, o as Payload, r as Data, s as PublishOptions } from "./event-COPs5rMu.mjs";
2
2
  import { n as SessionID } from "./ids-CHjmAdTc.mjs";
3
3
  import { o as Service, r as Info } from "./location-Q39els63.mjs";
4
- import { f as io_d_exports, i as Identity, s as Provides } from "./io-nhvNKC33.mjs";
4
+ import { f as io_d_exports, i as Identity, s as Provides } from "./io-Br9WZTsG.mjs";
5
5
  import { i as Info$1 } from "./settings-47Mzxhl0.mjs";
6
6
  import { t as section_d_exports } from "./plugin/section.mjs";
7
7
  import { n as prompt_d_exports, t as PromptRegistry } from "./prompt-DWaA5ZXj.mjs";
@@ -155,4 +155,4 @@ declare namespace plugin_d_exports {
155
155
  }
156
156
  //#endregion
157
157
  export { PluginRegistry as _, define as a, PluginOptions as c, PluginSpec as d, Config as f, SharedPluginContext as g, PromptResolver as h, PluginKind as i, PluginPatch as l, Paths as m, Mount as n, domains as o, Events as p, Plugin as r, rank as s, plugin_d_exports as t, PluginRef as u };
158
- //# sourceMappingURL=plugin-Deb2QWIP.d.mts.map
158
+ //# sourceMappingURL=plugin-Dwank4TZ.d.mts.map
package/plugin.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { t as section_d_exports } from "./plugin/section.mjs";
2
2
  import { n as prompt_d_exports } from "./prompt-DWaA5ZXj.mjs";
3
3
  import { p as tool_d_exports } from "./tool-D4_I_rzy.mjs";
4
- import { _ as PluginRegistry, a as define, c as PluginOptions, d as PluginSpec, f as Config, g as SharedPluginContext, h as PromptResolver, i as PluginKind, l as PluginPatch, m as Paths, n as Mount, o as domains, p as Events, r as Plugin, s as rank, u as PluginRef } from "./plugin-Deb2QWIP.mjs";
4
+ import { _ as PluginRegistry, a as define, c as PluginOptions, d as PluginSpec, f as Config, g as SharedPluginContext, h as PromptResolver, i as PluginKind, l as PluginPatch, m as Paths, n as Mount, o as domains, p as Events, r as Plugin, s as rank, u as PluginRef } from "./plugin-Dwank4TZ.mjs";
5
5
  export { type Config, type Events, type Mount, type Paths, type Plugin, type PluginKind, type PluginOptions, type PluginPatch, type PluginRef, type PluginRegistry, type PluginSpec, prompt_d_exports as Prompt, type PromptResolver, section_d_exports as Section, type SharedPluginContext, tool_d_exports as Tool, define, domains, rank };
@@ -1,2 +1,2 @@
1
- import { A as RuntimeConfigBase, C as Module, D as Provisioned, E as Observed, F as driver, I as driver_d_exports, L as erase, M as Source, N as apiVersion, O as Registered, P as defineModule, R as withSource, S as Driver, T as Name, b as Capabilities, j as RuntimeInput, k as Registration, v as AbsolutePath, w as ModuleDefinition, x as Definition, y as ApiVersion } from "../io-nhvNKC33.mjs";
1
+ import { A as RuntimeConfigBase, C as Module, D as Provisioned, E as Observed, F as driver, I as driver_d_exports, L as erase, M as Source, N as apiVersion, O as Registered, P as defineModule, R as withSource, S as Driver, T as Name, b as Capabilities, j as RuntimeInput, k as Registration, v as AbsolutePath, w as ModuleDefinition, x as Definition, y as ApiVersion } from "../io-Br9WZTsG.mjs";
2
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 };
@@ -1,2 +1,2 @@
1
- import { $ as SandboxRegisterError, B as SandboxBusyError, G as SandboxDriverNotRegisteredError, H as SandboxDestroyError, J as SandboxMustBeStoppedError, K as SandboxDriverRegistrationError, Q as SandboxRefreshError, U as SandboxDriverLoadError, V as SandboxCreateError, W as SandboxDriverLoadPhase, X as SandboxProviderError, Y as SandboxNotFoundError, Z as SandboxReadError, at as SandboxWakeError, ct as providerError, dt as sanitizeError, et as SandboxRemovedError, it as SandboxUnsupportedError, lt as providerErrorCause, nt as SandboxTransitionConflictError, ot as errors_d_exports, q as SandboxMountError, rt as SandboxUnavailError, st as makeRedactor, tt as SandboxStopError, ut as providerErrorIsNotFound, z as Redactor } from "../io-nhvNKC33.mjs";
1
+ import { $ as SandboxRegisterError, B as SandboxBusyError, G as SandboxDriverNotRegisteredError, H as SandboxDestroyError, J as SandboxMustBeStoppedError, K as SandboxDriverRegistrationError, Q as SandboxRefreshError, U as SandboxDriverLoadError, V as SandboxCreateError, W as SandboxDriverLoadPhase, X as SandboxProviderError, Y as SandboxNotFoundError, Z as SandboxReadError, at as SandboxWakeError, ct as providerError, dt as sanitizeError, et as SandboxRemovedError, it as SandboxUnsupportedError, lt as providerErrorCause, nt as SandboxTransitionConflictError, ot as errors_d_exports, q as SandboxMountError, rt as SandboxUnavailError, st as makeRedactor, tt as SandboxStopError, ut as providerErrorIsNotFound, z as Redactor } from "../io-Br9WZTsG.mjs";
2
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 };
@@ -26,11 +26,19 @@ var errors_exports = /* @__PURE__ */ __exportAll({
26
26
  * Lifecycle errors are confined to the control plane. Once a mount succeeds,
27
27
  * consumers continue to see only FileSystemError and ShellError.
28
28
  */
29
- var SandboxNotFoundError = class extends Schema.TaggedError()("SandboxNotFoundError", { id: ID }) {};
29
+ var SandboxNotFoundError = class extends Schema.TaggedError()("SandboxNotFoundError", { id: ID }) {
30
+ get message() {
31
+ return `Sandbox ${this.id} does not exist.`;
32
+ }
33
+ };
30
34
  var SandboxDriverNotRegisteredError = class extends Schema.TaggedError()("SandboxDriverNotRegisteredError", {
31
35
  driver: Schema.String,
32
36
  registered: Schema.optional(Schema.Array(Schema.String))
33
- }) {};
37
+ }) {
38
+ get message() {
39
+ return `No sandbox driver named "${this.driver}" is registered.`;
40
+ }
41
+ };
34
42
  var SandboxDriverRegistrationError = class extends Schema.TaggedError()("SandboxDriverRegistrationError", {
35
43
  driver: Schema.String,
36
44
  reason: Schema.String
@@ -61,11 +69,19 @@ var SandboxMustBeStoppedError = class extends Schema.TaggedError()("SandboxMustB
61
69
  var SandboxRemovedError = class extends Schema.TaggedError()("SandboxRemovedError", {
62
70
  id: ID,
63
71
  removedAt: Schema.optional(Schema.DateTimeUtc)
64
- }) {};
72
+ }) {
73
+ get message() {
74
+ return `Sandbox ${this.id} was removed.`;
75
+ }
76
+ };
65
77
  var SandboxUnavailError = class extends Schema.TaggedError()("SandboxUnavailError", {
66
78
  id: ID,
67
79
  reason: Schema.String
68
- }) {};
80
+ }) {
81
+ get message() {
82
+ return `Sandbox ${this.id} is unavailable: ${this.reason}`;
83
+ }
84
+ };
69
85
  var SandboxUnsupportedError = class extends Schema.TaggedError()("SandboxUnsupportedError", {
70
86
  id: Schema.optional(ID),
71
87
  driver: Schema.String,
@@ -87,7 +103,11 @@ var SandboxProviderError = class extends Schema.TaggedError()("SandboxProviderEr
87
103
  driver: Schema.String,
88
104
  operation: Schema.String,
89
105
  sanitized: PersistedError
90
- }) {};
106
+ }) {
107
+ get message() {
108
+ return `The ${this.driver} sandbox failed to ${this.operation}: ${this.sanitized.message}`;
109
+ }
110
+ };
91
111
  const rawCause = Symbol("@codework/sandbox/provider/error/raw/cause");
92
112
  const missingResource = Symbol("@codework/sandbox/provider/error/missing/resource");
93
113
  const providerErrorCause = (error) => error[rawCause];
@@ -1 +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,EAC5G,IAAIA,GACL,CAAC,CAAC,CAAC,CAAC;AAEJ,IAAa,kCAAb,cAAqD,OAAO,YAA6C,CAAC,CACzG,mCACA;CACC,QAAQ,OAAO;CACf,YAAY,OAAO,SAAS,OAAO,MAAM,OAAO,MAAM,CAAC;AACxD,CACD,CAAC,CAAC,CAAC;AAEH,IAAa,iCAAb,cAAoD,OAAO,YAA4C,CAAC,CACvG,kCACA;CACC,QAAQ,OAAO;CACf,QAAQ,OAAO;AAChB,CACD,CAAC,CAAC,CAAC;AAEH,MAAa,yBAAyB,OAAO,SAAS;CACrD;CACA;CACA;CACA;CACA;CACA;CACA;AACD,CAAC;AAGD,IAAa,yBAAb,cAA4C,OAAO,YAAoC,CAAC,CAAC,0BAA0B;CAClH,WAAW,OAAO;CAClB,OAAO;CACP,QAAQ,OAAO,SAAS,OAAO,MAAM;CACrC,QAAQ,OAAO;AAChB,CAAC,CAAC,CAAC,CAAC;AAEJ,IAAa,mBAAb,cAAsC,OAAO,YAA8B,CAAC,CAAC,oBAAoB;CAChG,IAAIA;CACJ,UAAU,OAAO,IAAI,MAAM,OAAO,uBAAuB,CAAC,CAAC;AAC5D,CAAC,CAAC,CAAC,CAAC;AAEJ,IAAa,4BAAb,cAA+C,OAAO,YAAuC,CAAC,CAC7F,6BACA;CACC,IAAIA;CACJ,QAAQC;AACT,CACD,CAAC,CAAC,CAAC;AAEH,IAAa,sBAAb,cAAyC,OAAO,YAAiC,CAAC,CAAC,uBAAuB;CACzG,IAAID;CACJ,WAAW,OAAO,SAAS,OAAO,WAAW;AAC9C,CAAC,CAAC,CAAC,CAAC;AAEJ,IAAa,sBAAb,cAAyC,OAAO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,EAAE,UAAU,QAAQ,OAAO,KAAA;CAC9E,MAAM,OAAO,MAAM;CACnB,OAAO,OAAO,SAAS,YAAY,OAAO,SAAS,WAAW,OAAO,IAAI,IAAI,KAAA;AAC9E;AAEA,MAAM,aAAa,UAA2B;CAC7C,IAAI,OAAO,UAAU,YAAY,UAAU,QAAQ,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"}
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\toverride get message(): string {\n\t\treturn `Sandbox ${this.id} does not exist.`;\n\t}\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\toverride get message(): string {\n\t\treturn `No sandbox driver named \"${this.driver}\" is registered.`;\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\toverride get message(): string {\n\t\treturn `Sandbox ${this.id} was removed.`;\n\t}\n}\n\nexport class SandboxUnavailError extends Schema.TaggedError<SandboxUnavailError>()(\"SandboxUnavailError\", {\n\tid: SandboxInstance.ID,\n\treason: Schema.String,\n}) {\n\toverride get message(): string {\n\t\treturn `Sandbox ${this.id} is unavailable: ${this.reason}`;\n\t}\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\toverride get message(): string {\n\t\treturn `The ${this.driver} sandbox failed to ${this.operation}: ${this.sanitized.message}`;\n\t}\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 \"./err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C,cAAc;EACd,YAAY;EACZ,OAAO,MAAM,aAAa;EAC1B,UAAU;CACX,CAAC;CACD,OAAO;AACR"}
@@ -1,2 +1,2 @@
1
- import { Ct as mountable, St as isMountable, Tt as toField, _t as Status, bt as fromField, ft as ID, gt as PersistedError, ht as Ownership, mt as Kind, pt as Info, vt as Usage, wt as toColumn, xt as instance_d_exports, yt as fromColumn } from "../io-nhvNKC33.mjs";
1
+ import { Ct as mountable, St as isMountable, Tt as toField, _t as Status, bt as fromField, ft as ID, gt as PersistedError, ht as Ownership, mt as Kind, pt as Info, vt as Usage, wt as toColumn, xt as instance_d_exports, yt as fromColumn } from "../io-Br9WZTsG.mjs";
2
2
  export { ID, Info, Kind, Ownership, PersistedError, instance_d_exports as SandboxInstance, Status, Usage, fromColumn, fromField, isMountable, mountable, toColumn, toField };
package/sandbox/io.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { _ as withMutation, a as Layer, c as Shell, d as identityLayer, f as io_d_exports, g as virtual, h as resolveMountCwd, i as Identity, l as host, m as remote, n as DEFAULT_SPILL_PATH, o as Mutation, p as mount, r as FileSystem, s as Provides, t as Current, u as hostLayer } from "../io-nhvNKC33.mjs";
1
+ import { _ as withMutation, a as Layer, c as Shell, d as identityLayer, f as io_d_exports, g as virtual, h as resolveMountCwd, i as Identity, l as host, m as remote, n as DEFAULT_SPILL_PATH, o as Mutation, p as mount, r as FileSystem, s as Provides, t as Current, u as hostLayer } from "../io-Br9WZTsG.mjs";
2
2
  export { Current, DEFAULT_SPILL_PATH, FileSystem, Identity, Layer, Mutation, Provides, io_d_exports as SandboxIO, Shell, host, hostLayer, identityLayer, mount, remote, resolveMountCwd, virtual, withMutation };
package/sandbox.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { A as RuntimeConfigBase, C as Module, D as Provisioned, E as Observed, F as driver, N as apiVersion, P as defineModule, S as Driver, T as Name, X as SandboxProviderError, _ as withMutation, a as Layer, b as Capabilities, c as Shell, ct as providerError, dt as sanitizeError, i as Identity, j as RuntimeInput, k as Registration, lt as providerErrorCause, n as DEFAULT_SPILL_PATH, o as Mutation, r as FileSystem, s as Provides, st as makeRedactor, t as Current, ut as providerErrorIsNotFound, v as AbsolutePath, w as ModuleDefinition, x as Definition, xt as instance_d_exports, y as ApiVersion, z as Redactor } from "./io-nhvNKC33.mjs";
1
+ import { A as RuntimeConfigBase, C as Module, D as Provisioned, E as Observed, F as driver, N as apiVersion, P as defineModule, S as Driver, T as Name, X as SandboxProviderError, _ as withMutation, a as Layer, b as Capabilities, c as Shell, ct as providerError, dt as sanitizeError, i as Identity, j as RuntimeInput, k as Registration, lt as providerErrorCause, n as DEFAULT_SPILL_PATH, o as Mutation, r as FileSystem, s as Provides, st as makeRedactor, t as Current, ut as providerErrorIsNotFound, v as AbsolutePath, w as ModuleDefinition, x as Definition, xt as instance_d_exports, y as ApiVersion, z as Redactor } from "./io-Br9WZTsG.mjs";
2
2
  import { c as filesystem_d_exports } from "./filesystem-CuGE9poU.mjs";
3
3
  import { a as ShellError, i as Shell$1, l as quote, n as ExecResult, o as ShellOptions, r as ISandboxExe, s as fromExec, t as ExecChunk, u as quoteArgv } from "./shell-CZ6Y4lNU.mjs";
4
4
  import { SandboxResource as resource_d_exports } from "./sandbox/resource.mjs";