@ultrst-armada/kloks 1.24.5 → 1.24.8

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 (59) hide show
  1. package/.krusbl-release-attestation.json +3 -3
  2. package/README.md +11 -0
  3. package/package.json +15 -12
  4. package/packages/audio-midi/dist/index.js +16 -16
  5. package/packages/backend/dist/ai-inference/index.js +0 -1
  6. package/packages/backend/dist/ai-keys/index.js +0 -1
  7. package/packages/backend/dist/ai-models/index.js +0 -1
  8. package/packages/backend/dist/ai-provider/index.js +0 -1
  9. package/packages/backend/dist/ai-routing/index.js +0 -1
  10. package/packages/backend/dist/ai-tools/index.js +0 -1
  11. package/packages/backend/dist/api/index.js +0 -1
  12. package/packages/backend/dist/auth/index.d.ts +5 -74
  13. package/packages/backend/dist/auth/index.js +16 -19
  14. package/packages/backend/dist/{chunk-2OPIDIIB.js → chunk-3VWBZEMG.js} +26 -2
  15. package/packages/backend/dist/{chunk-AHJ2EWQW.js → chunk-6D55GT3L.js} +9 -28
  16. package/packages/backend/dist/chunk-ED32WV3T.js +75 -0
  17. package/packages/backend/dist/chunk-EO5VUYYU.js +20 -0
  18. package/packages/backend/dist/{chunk-B3VJ4HDV.js → chunk-JOTDEFRG.js} +1 -1
  19. package/packages/backend/dist/{chunk-OB65KZ2M.js → chunk-M45KQRPR.js} +1 -1
  20. package/packages/backend/dist/chunk-SXDYW3QA.js +579 -0
  21. package/packages/backend/dist/client/index.js +0 -1
  22. package/packages/backend/dist/connectivity/index.js +0 -1
  23. package/packages/backend/dist/control-plane/index.d.ts +3 -3
  24. package/packages/backend/dist/control-plane/index.js +0 -1
  25. package/packages/backend/dist/development/client.d.ts +20 -6
  26. package/packages/backend/dist/development/client.js +42 -28
  27. package/packages/backend/dist/development/index.d.ts +20 -6
  28. package/packages/backend/dist/development/index.js +43 -32
  29. package/packages/backend/dist/development/playwrightInspectionService.js +2 -3
  30. package/packages/backend/dist/development/playwrightInspectionTypes.d.ts +1 -0
  31. package/packages/backend/dist/index.d.ts +3 -54
  32. package/packages/backend/dist/index.js +44 -127
  33. package/packages/backend/dist/krnl-ai-services.js +2 -3
  34. package/packages/backend/dist/krnl-services.js +6 -7
  35. package/packages/backend/dist/services/index.js +4 -5
  36. package/packages/backend/dist/srkl/index.js +1 -2
  37. package/packages/backend/dist/storage/index.js +0 -1
  38. package/packages/backend/dist/workspace/index.js +0 -1
  39. package/packages/backend/package.json +3 -10
  40. package/packages/client/dist/index.d.ts +2 -0
  41. package/packages/client/dist/index.js +29 -1
  42. package/packages/client/package.json +2 -1
  43. package/packages/fod/dist/index.d.ts +11 -1
  44. package/packages/fod/dist/index.js +2 -0
  45. package/packages/fod/package.json +2 -3
  46. package/packages/functions/dist/index.js +16 -16
  47. package/packages/functions/package.json +2 -1
  48. package/packages/services/dist/index.d.ts +46 -1
  49. package/packages/services/dist/index.js +96 -18
  50. package/packages/services/kloks.manifest.json +19 -0
  51. package/packages/state-graph/dist/index.js +31 -31
  52. package/packages/backend/dist/BaseAccountProvider-DduKf5HG.d.ts +0 -66
  53. package/packages/backend/dist/chunk-2HCQ2SIR.js +0 -213
  54. package/packages/backend/dist/chunk-A3BE6ROS.js +0 -180
  55. package/packages/backend/dist/chunk-MWSYNRNZ.js +0 -871
  56. package/packages/backend/dist/chunk-QGM4M3NI.js +0 -37
  57. package/packages/backend/dist/dist-XMSSRYDR.js +0 -899
  58. package/packages/backend/dist/transformers.node-HWHOAE4H.js +0 -43879
  59. package/packages/backend/dist/{chunk-IGZB4RYT.js → chunk-R6ZNF6FW.js} +3 -3
@@ -12,6 +12,7 @@ interface DevelopmentRequest {
12
12
  workflowInputs?: Record<string, string>;
13
13
  cwd?: string;
14
14
  env?: Record<string, string>;
15
+ sourceSha?: string;
15
16
  }
16
17
  interface DevelopmentDiagnostic {
17
18
  severity: 'error' | 'warning' | 'info';
@@ -31,6 +32,7 @@ interface DevelopmentResult {
31
32
  command?: string;
32
33
  durationMs?: number;
33
34
  diagnostics?: DevelopmentDiagnostic[];
35
+ sourceSha?: string;
34
36
  runId?: number;
35
37
  url?: string;
36
38
  }
@@ -42,6 +44,7 @@ interface DevelopmentServiceContract {
42
44
  definition: ServiceDefinition;
43
45
  }
44
46
 
47
+ declare function resolveWebContainerCommand(task: DevelopmentTask): WebContainerCommand;
45
48
  declare function parseDevelopmentDiagnostics(output: string, exitCode?: number): DevelopmentDiagnostic[];
46
49
  declare function captureDevelopmentProcess<T extends {
47
50
  output: ReadableStream<string>;
@@ -54,39 +57,50 @@ declare function captureDevelopmentProcess<T extends {
54
57
  diagnostics: DevelopmentDiagnostic[];
55
58
  }>;
56
59
  };
57
- declare function resolveWebContainerCommand(task: DevelopmentTask): WebContainerCommand;
58
60
  interface WebContainerRunCommandInput {
59
61
  command: string;
60
62
  args?: string[];
61
63
  cwd?: string;
62
64
  env?: Record<string, string | number | boolean>;
65
+ sourceSha?: string;
63
66
  }
64
67
  declare class WebContainerRuntime {
65
68
  boot(): Promise<any>;
66
- mount(files: Record<string, unknown>, mountPoint?: string): Promise<{
69
+ mount(files: Record<string, unknown>, mountPoint?: string, sourceSha?: string): Promise<{
67
70
  mounted: boolean;
68
71
  mountPoint: string;
72
+ sourceSha: string;
69
73
  }>;
70
74
  private runProcess;
71
- run(task: DevelopmentTask, cwd?: string, env?: Record<string, string>): Promise<{
75
+ run(task: DevelopmentTask, cwd?: string, env?: Record<string, string>, sourceSha?: string): Promise<{
72
76
  exitCode: any;
73
77
  output: string;
74
78
  command: string;
75
79
  durationMs: number;
76
80
  diagnostics: DevelopmentDiagnostic[];
81
+ sourceSha: string;
77
82
  }>;
78
- runCommand(command: string, args?: string[], cwd?: string, env?: Record<string, string | number | boolean>): Promise<{
83
+ runCommand(command: string, args?: string[], cwd?: string, env?: Record<string, string | number | boolean>, sourceSha?: string): Promise<{
79
84
  exitCode: any;
80
85
  output: string;
81
86
  command: string;
82
87
  durationMs: number;
83
88
  diagnostics: DevelopmentDiagnostic[];
89
+ sourceSha: string;
90
+ }>;
91
+ spawnCommand(command: string, args?: string[], cwd?: string, env?: Record<string, string | number | boolean>, sourceSha?: string): Promise<{
92
+ processId: `${string}-${string}-${string}-${string}-${string}`;
93
+ sourceSha: string;
94
+ command: string;
95
+ startedAt: string;
96
+ process: any;
84
97
  }>;
85
- spawnCommand(command: string, args?: string[], cwd?: string, env?: Record<string, string | number | boolean>): Promise<any>;
86
- teardown(): Promise<{
98
+ teardown(mountPoint?: string): Promise<{
87
99
  tornDown: boolean;
100
+ mountPoint: string;
88
101
  }>;
89
102
  }
103
+
90
104
  declare const WebContainerServiceDefinition: ServiceDefinition;
91
105
  declare const WebContainerServiceFacade: {
92
106
  id: string;
@@ -3,14 +3,20 @@ import {
3
3
  createService,
4
4
  createServiceDefinition
5
5
  } from "@ultrst-armada/krnl";
6
+
7
+ // src/development/webContainerRuntime.ts
6
8
  var COMMANDS = {
7
- install: { command: "pnpm", args: ["install", "--no-frozen-lockfile"] },
9
+ install: { command: "pnpm", args: ["install", "--frozen-lockfile"] },
8
10
  lint: { command: "pnpm", args: ["lint"] },
9
11
  test: { command: "pnpm", args: ["test"] },
10
12
  build: { command: "pnpm", args: ["build"] },
11
13
  validate: { command: "pnpm", args: ["validate"] },
12
14
  check: { command: "pnpm", args: ["lint"] }
13
15
  };
16
+ function resolveWebContainerCommand(task) {
17
+ const command = COMMANDS[task];
18
+ return { command: command.command, args: [...command.args] };
19
+ }
14
20
  function parseDevelopmentDiagnostics(output, exitCode = 0) {
15
21
  const diagnostics = [];
16
22
  const seen = /* @__PURE__ */ new Set();
@@ -60,10 +66,6 @@ function captureDevelopmentProcess(process) {
60
66
  })();
61
67
  return { ...process, output: consumerOutput, logs };
62
68
  }
63
- function resolveWebContainerCommand(task) {
64
- const command = COMMANDS[task];
65
- return { command: command.command, args: [...command.args] };
66
- }
67
69
  var runQueue = Promise.resolve();
68
70
  var sharedContainer = null;
69
71
  var sharedContainerPromise = null;
@@ -75,10 +77,7 @@ var WebContainerRuntime = class {
75
77
  if (sharedContainer) return sharedContainer;
76
78
  if (!sharedContainerPromise) {
77
79
  sharedContainerPromise = import("@webcontainer/api").then(async (module) => {
78
- const container = await module.WebContainer.boot({
79
- coep: "require-corp",
80
- workdirName: "kloks-development"
81
- });
80
+ const container = await module.WebContainer.boot({ coep: "require-corp", workdirName: "kloks-development" });
82
81
  sharedContainer = container;
83
82
  return container;
84
83
  }).catch((error) => {
@@ -88,12 +87,12 @@ var WebContainerRuntime = class {
88
87
  }
89
88
  return sharedContainerPromise;
90
89
  }
91
- async mount(files, mountPoint) {
90
+ async mount(files, mountPoint = "/", sourceSha) {
92
91
  const container = await this.boot();
93
- await container.mount(files, mountPoint ? { mountPoint } : void 0);
94
- return { mounted: true, mountPoint: mountPoint ?? "/" };
92
+ await container.mount(files, mountPoint === "/" ? void 0 : { mountPoint });
93
+ return { mounted: true, mountPoint, sourceSha };
95
94
  }
96
- async runProcess(command, args, cwd, env) {
95
+ async runProcess(command, args, cwd, env, sourceSha) {
97
96
  const container = await this.boot();
98
97
  const process = await container.spawn(command, args, { cwd, env });
99
98
  const started = Date.now();
@@ -109,13 +108,20 @@ var WebContainerRuntime = class {
109
108
  reader.releaseLock();
110
109
  }
111
110
  const exitCode = await process.exit;
112
- return { exitCode, output, command: [command, ...args].join(" "), durationMs: Date.now() - started, diagnostics: parseDevelopmentDiagnostics(output, exitCode) };
111
+ return {
112
+ exitCode,
113
+ output,
114
+ command: [command, ...args].join(" "),
115
+ durationMs: Date.now() - started,
116
+ diagnostics: parseDevelopmentDiagnostics(output, exitCode),
117
+ sourceSha
118
+ };
113
119
  }
114
- async run(task, cwd, env) {
120
+ async run(task, cwd, env, sourceSha) {
115
121
  const spec = resolveWebContainerCommand(task);
116
- return this.runCommand(spec.command, spec.args, cwd, env);
122
+ return this.runCommand(spec.command, spec.args, cwd, env, sourceSha);
117
123
  }
118
- async runCommand(command, args = [], cwd, env) {
124
+ async runCommand(command, args = [], cwd, env, sourceSha) {
119
125
  const previous = runQueue;
120
126
  let release;
121
127
  runQueue = new Promise((resolve) => {
@@ -123,38 +129,46 @@ var WebContainerRuntime = class {
123
129
  });
124
130
  await previous;
125
131
  try {
126
- return await this.runProcess(command, args, cwd, env);
132
+ return await this.runProcess(command, args, cwd, env, sourceSha);
127
133
  } finally {
128
134
  release();
129
135
  }
130
136
  }
131
- async spawnCommand(command, args = [], cwd, env) {
137
+ async spawnCommand(command, args = [], cwd, env, sourceSha) {
132
138
  const container = await this.boot();
133
139
  const process = await container.spawn(command, args, { cwd, env });
134
- return captureDevelopmentProcess(process);
140
+ return { processId: globalThis.crypto.randomUUID(), sourceSha, command: [command, ...args].join(" "), startedAt: (/* @__PURE__ */ new Date()).toISOString(), process: captureDevelopmentProcess(process) };
135
141
  }
136
- async teardown() {
142
+ async teardown(mountPoint) {
137
143
  const container = sharedContainer;
144
+ if (!container) return { tornDown: true, mountPoint };
145
+ if (mountPoint && mountPoint !== "/") {
146
+ await container.fs.rm(mountPoint, { recursive: true, force: true });
147
+ return { tornDown: true, mountPoint };
148
+ }
138
149
  sharedContainer = null;
139
150
  sharedContainerPromise = null;
140
- await container?.teardown();
141
- return { tornDown: true };
151
+ await container.teardown();
152
+ return { tornDown: true, mountPoint: "/" };
142
153
  }
143
154
  };
155
+
156
+ // src/development/webContainerService.ts
144
157
  var runtime = new WebContainerRuntime();
145
158
  var WebContainerServiceDefinition = createServiceDefinition({
146
159
  id: "kloks.backend.webContainer",
147
160
  name: "WebContainerService",
148
- version: "1.2.0",
161
+ version: "1.3.0",
149
162
  operations: {
150
163
  boot: { id: "WebContainerService.boot", name: "boot", handler: async () => {
151
164
  await runtime.boot();
152
165
  return { ready: true };
153
166
  } },
154
- mount: { id: "WebContainerService.mount", name: "mount", handler: async (input) => runtime.mount(input.files, input.mountPoint) },
155
- run: { id: "WebContainerService.run", name: "run", handler: async (input) => runtime.run(input.task, input.cwd, input.env) },
156
- runCommand: { id: "WebContainerService.runCommand", name: "runCommand", handler: async (input) => runtime.runCommand(input.command, input.args, input.cwd, input.env) },
157
- teardown: { id: "WebContainerService.teardown", name: "teardown", handler: async () => runtime.teardown() },
167
+ mount: { id: "WebContainerService.mount", name: "mount", handler: async (input) => runtime.mount(input.files, input.mountPoint, input.sourceSha) },
168
+ run: { id: "WebContainerService.run", name: "run", handler: async (input) => runtime.run(input.task, input.cwd, input.env, input.sourceSha) },
169
+ runCommand: { id: "WebContainerService.runCommand", name: "runCommand", handler: async (input) => runtime.runCommand(input.command, input.args, input.cwd, input.env, input.sourceSha) },
170
+ spawnCommand: { id: "WebContainerService.spawnCommand", name: "spawnCommand", handler: async (input) => runtime.spawnCommand(input.command, input.args, input.cwd, input.env, input.sourceSha) },
171
+ teardown: { id: "WebContainerService.teardown", name: "teardown", handler: async (input) => runtime.teardown(input?.mountPoint) },
158
172
  command: { id: "WebContainerService.command", name: "command", handler: async (input) => ({ task: input.task, command: resolveWebContainerCommand(input.task) }) }
159
173
  }
160
174
  });
@@ -14,6 +14,7 @@ interface DevelopmentRequest {
14
14
  workflowInputs?: Record<string, string>;
15
15
  cwd?: string;
16
16
  env?: Record<string, string>;
17
+ sourceSha?: string;
17
18
  }
18
19
  interface DevelopmentDiagnostic {
19
20
  severity: 'error' | 'warning' | 'info';
@@ -33,6 +34,7 @@ interface DevelopmentResult {
33
34
  command?: string;
34
35
  durationMs?: number;
35
36
  diagnostics?: DevelopmentDiagnostic[];
37
+ sourceSha?: string;
36
38
  runId?: number;
37
39
  url?: string;
38
40
  }
@@ -99,6 +101,7 @@ declare const GitHubActionsServiceFacade: {
99
101
  execute: <TIn = unknown, TOut = unknown>(op: string, input?: TIn) => Promise<TOut>;
100
102
  };
101
103
 
104
+ declare function resolveWebContainerCommand(task: DevelopmentTask): WebContainerCommand;
102
105
  declare function parseDevelopmentDiagnostics(output: string, exitCode?: number): DevelopmentDiagnostic[];
103
106
  declare function captureDevelopmentProcess<T extends {
104
107
  output: ReadableStream<string>;
@@ -111,39 +114,50 @@ declare function captureDevelopmentProcess<T extends {
111
114
  diagnostics: DevelopmentDiagnostic[];
112
115
  }>;
113
116
  };
114
- declare function resolveWebContainerCommand(task: DevelopmentTask): WebContainerCommand;
115
117
  interface WebContainerRunCommandInput {
116
118
  command: string;
117
119
  args?: string[];
118
120
  cwd?: string;
119
121
  env?: Record<string, string | number | boolean>;
122
+ sourceSha?: string;
120
123
  }
121
124
  declare class WebContainerRuntime {
122
125
  boot(): Promise<any>;
123
- mount(files: Record<string, unknown>, mountPoint?: string): Promise<{
126
+ mount(files: Record<string, unknown>, mountPoint?: string, sourceSha?: string): Promise<{
124
127
  mounted: boolean;
125
128
  mountPoint: string;
129
+ sourceSha: string;
126
130
  }>;
127
131
  private runProcess;
128
- run(task: DevelopmentTask, cwd?: string, env?: Record<string, string>): Promise<{
132
+ run(task: DevelopmentTask, cwd?: string, env?: Record<string, string>, sourceSha?: string): Promise<{
129
133
  exitCode: any;
130
134
  output: string;
131
135
  command: string;
132
136
  durationMs: number;
133
137
  diagnostics: DevelopmentDiagnostic[];
138
+ sourceSha: string;
134
139
  }>;
135
- runCommand(command: string, args?: string[], cwd?: string, env?: Record<string, string | number | boolean>): Promise<{
140
+ runCommand(command: string, args?: string[], cwd?: string, env?: Record<string, string | number | boolean>, sourceSha?: string): Promise<{
136
141
  exitCode: any;
137
142
  output: string;
138
143
  command: string;
139
144
  durationMs: number;
140
145
  diagnostics: DevelopmentDiagnostic[];
146
+ sourceSha: string;
147
+ }>;
148
+ spawnCommand(command: string, args?: string[], cwd?: string, env?: Record<string, string | number | boolean>, sourceSha?: string): Promise<{
149
+ processId: `${string}-${string}-${string}-${string}-${string}`;
150
+ sourceSha: string;
151
+ command: string;
152
+ startedAt: string;
153
+ process: any;
141
154
  }>;
142
- spawnCommand(command: string, args?: string[], cwd?: string, env?: Record<string, string | number | boolean>): Promise<any>;
143
- teardown(): Promise<{
155
+ teardown(mountPoint?: string): Promise<{
144
156
  tornDown: boolean;
157
+ mountPoint: string;
145
158
  }>;
146
159
  }
160
+
147
161
  declare const WebContainerServiceDefinition: ServiceDefinition;
148
162
  declare const WebContainerServiceFacade: {
149
163
  id: string;
@@ -3,12 +3,11 @@ import {
3
3
  PlaywrightInspectionRuntime,
4
4
  PlaywrightInspectionServiceDefinition,
5
5
  PlaywrightInspectionServiceFacade
6
- } from "../chunk-2OPIDIIB.js";
6
+ } from "../chunk-3VWBZEMG.js";
7
7
  import {
8
8
  createService,
9
9
  createServiceDefinition
10
- } from "../chunk-MWSYNRNZ.js";
11
- import "../chunk-QGM4M3NI.js";
10
+ } from "../chunk-SXDYW3QA.js";
12
11
 
13
12
  // src/development/githubActionsService.ts
14
13
  var GitHubActionsClient = class {
@@ -105,15 +104,19 @@ var GitHubActionsServiceFacade = {
105
104
  }
106
105
  };
107
106
 
108
- // src/development/webContainerService.ts
107
+ // src/development/webContainerRuntime.ts
109
108
  var COMMANDS = {
110
- install: { command: "pnpm", args: ["install", "--no-frozen-lockfile"] },
109
+ install: { command: "pnpm", args: ["install", "--frozen-lockfile"] },
111
110
  lint: { command: "pnpm", args: ["lint"] },
112
111
  test: { command: "pnpm", args: ["test"] },
113
112
  build: { command: "pnpm", args: ["build"] },
114
113
  validate: { command: "pnpm", args: ["validate"] },
115
114
  check: { command: "pnpm", args: ["lint"] }
116
115
  };
116
+ function resolveWebContainerCommand(task) {
117
+ const command = COMMANDS[task];
118
+ return { command: command.command, args: [...command.args] };
119
+ }
117
120
  function parseDevelopmentDiagnostics(output, exitCode = 0) {
118
121
  const diagnostics = [];
119
122
  const seen = /* @__PURE__ */ new Set();
@@ -163,10 +166,6 @@ function captureDevelopmentProcess(process) {
163
166
  })();
164
167
  return { ...process, output: consumerOutput, logs };
165
168
  }
166
- function resolveWebContainerCommand(task) {
167
- const command = COMMANDS[task];
168
- return { command: command.command, args: [...command.args] };
169
- }
170
169
  var runQueue = Promise.resolve();
171
170
  var sharedContainer = null;
172
171
  var sharedContainerPromise = null;
@@ -178,10 +177,7 @@ var WebContainerRuntime = class {
178
177
  if (sharedContainer) return sharedContainer;
179
178
  if (!sharedContainerPromise) {
180
179
  sharedContainerPromise = import("@webcontainer/api").then(async (module) => {
181
- const container = await module.WebContainer.boot({
182
- coep: "require-corp",
183
- workdirName: "kloks-development"
184
- });
180
+ const container = await module.WebContainer.boot({ coep: "require-corp", workdirName: "kloks-development" });
185
181
  sharedContainer = container;
186
182
  return container;
187
183
  }).catch((error) => {
@@ -191,12 +187,12 @@ var WebContainerRuntime = class {
191
187
  }
192
188
  return sharedContainerPromise;
193
189
  }
194
- async mount(files, mountPoint) {
190
+ async mount(files, mountPoint = "/", sourceSha) {
195
191
  const container = await this.boot();
196
- await container.mount(files, mountPoint ? { mountPoint } : void 0);
197
- return { mounted: true, mountPoint: mountPoint ?? "/" };
192
+ await container.mount(files, mountPoint === "/" ? void 0 : { mountPoint });
193
+ return { mounted: true, mountPoint, sourceSha };
198
194
  }
199
- async runProcess(command, args, cwd, env) {
195
+ async runProcess(command, args, cwd, env, sourceSha) {
200
196
  const container = await this.boot();
201
197
  const process = await container.spawn(command, args, { cwd, env });
202
198
  const started = Date.now();
@@ -212,13 +208,20 @@ var WebContainerRuntime = class {
212
208
  reader.releaseLock();
213
209
  }
214
210
  const exitCode = await process.exit;
215
- return { exitCode, output, command: [command, ...args].join(" "), durationMs: Date.now() - started, diagnostics: parseDevelopmentDiagnostics(output, exitCode) };
211
+ return {
212
+ exitCode,
213
+ output,
214
+ command: [command, ...args].join(" "),
215
+ durationMs: Date.now() - started,
216
+ diagnostics: parseDevelopmentDiagnostics(output, exitCode),
217
+ sourceSha
218
+ };
216
219
  }
217
- async run(task, cwd, env) {
220
+ async run(task, cwd, env, sourceSha) {
218
221
  const spec = resolveWebContainerCommand(task);
219
- return this.runCommand(spec.command, spec.args, cwd, env);
222
+ return this.runCommand(spec.command, spec.args, cwd, env, sourceSha);
220
223
  }
221
- async runCommand(command, args = [], cwd, env) {
224
+ async runCommand(command, args = [], cwd, env, sourceSha) {
222
225
  const previous = runQueue;
223
226
  let release;
224
227
  runQueue = new Promise((resolve) => {
@@ -226,38 +229,46 @@ var WebContainerRuntime = class {
226
229
  });
227
230
  await previous;
228
231
  try {
229
- return await this.runProcess(command, args, cwd, env);
232
+ return await this.runProcess(command, args, cwd, env, sourceSha);
230
233
  } finally {
231
234
  release();
232
235
  }
233
236
  }
234
- async spawnCommand(command, args = [], cwd, env) {
237
+ async spawnCommand(command, args = [], cwd, env, sourceSha) {
235
238
  const container = await this.boot();
236
239
  const process = await container.spawn(command, args, { cwd, env });
237
- return captureDevelopmentProcess(process);
240
+ return { processId: globalThis.crypto.randomUUID(), sourceSha, command: [command, ...args].join(" "), startedAt: (/* @__PURE__ */ new Date()).toISOString(), process: captureDevelopmentProcess(process) };
238
241
  }
239
- async teardown() {
242
+ async teardown(mountPoint) {
240
243
  const container = sharedContainer;
244
+ if (!container) return { tornDown: true, mountPoint };
245
+ if (mountPoint && mountPoint !== "/") {
246
+ await container.fs.rm(mountPoint, { recursive: true, force: true });
247
+ return { tornDown: true, mountPoint };
248
+ }
241
249
  sharedContainer = null;
242
250
  sharedContainerPromise = null;
243
- await container?.teardown();
244
- return { tornDown: true };
251
+ await container.teardown();
252
+ return { tornDown: true, mountPoint: "/" };
245
253
  }
246
254
  };
255
+
256
+ // src/development/webContainerService.ts
247
257
  var runtime = new WebContainerRuntime();
248
258
  var WebContainerServiceDefinition = createServiceDefinition({
249
259
  id: "kloks.backend.webContainer",
250
260
  name: "WebContainerService",
251
- version: "1.2.0",
261
+ version: "1.3.0",
252
262
  operations: {
253
263
  boot: { id: "WebContainerService.boot", name: "boot", handler: async () => {
254
264
  await runtime.boot();
255
265
  return { ready: true };
256
266
  } },
257
- mount: { id: "WebContainerService.mount", name: "mount", handler: async (input) => runtime.mount(input.files, input.mountPoint) },
258
- run: { id: "WebContainerService.run", name: "run", handler: async (input) => runtime.run(input.task, input.cwd, input.env) },
259
- runCommand: { id: "WebContainerService.runCommand", name: "runCommand", handler: async (input) => runtime.runCommand(input.command, input.args, input.cwd, input.env) },
260
- teardown: { id: "WebContainerService.teardown", name: "teardown", handler: async () => runtime.teardown() },
267
+ mount: { id: "WebContainerService.mount", name: "mount", handler: async (input) => runtime.mount(input.files, input.mountPoint, input.sourceSha) },
268
+ run: { id: "WebContainerService.run", name: "run", handler: async (input) => runtime.run(input.task, input.cwd, input.env, input.sourceSha) },
269
+ runCommand: { id: "WebContainerService.runCommand", name: "runCommand", handler: async (input) => runtime.runCommand(input.command, input.args, input.cwd, input.env, input.sourceSha) },
270
+ spawnCommand: { id: "WebContainerService.spawnCommand", name: "spawnCommand", handler: async (input) => runtime.spawnCommand(input.command, input.args, input.cwd, input.env, input.sourceSha) },
271
+ teardown: { id: "WebContainerService.teardown", name: "teardown", handler: async (input) => runtime.teardown(input?.mountPoint) },
261
272
  command: { id: "WebContainerService.command", name: "command", handler: async (input) => ({ task: input.task, command: resolveWebContainerCommand(input.task) }) }
262
273
  }
263
274
  });
@@ -2,9 +2,8 @@ import {
2
2
  PlaywrightInspectionRuntime,
3
3
  PlaywrightInspectionServiceDefinition,
4
4
  PlaywrightInspectionServiceFacade
5
- } from "../chunk-2OPIDIIB.js";
6
- import "../chunk-MWSYNRNZ.js";
7
- import "../chunk-QGM4M3NI.js";
5
+ } from "../chunk-3VWBZEMG.js";
6
+ import "../chunk-SXDYW3QA.js";
8
7
  export {
9
8
  PlaywrightInspectionRuntime,
10
9
  PlaywrightInspectionServiceDefinition,
@@ -36,6 +36,7 @@ interface PlaywrightInspectionRequest {
36
36
  reportPath?: string;
37
37
  captureDom?: boolean;
38
38
  maxDomCharacters?: number;
39
+ executablePath?: string;
39
40
  }
40
41
  interface InspectionCheckResult {
41
42
  selector: string;
@@ -1,5 +1,5 @@
1
- export { A as AuthCredentials, a as AuthSession, B as BaseAccountProvider, C as CreateUserData, R as RateLimiter, S as SessionManager, b as SignupInput, U as User, c as UserRole } from './BaseAccountProvider-DduKf5HG.js';
2
- export { AdminGuard, AuthEnvironment, AuthResult, CanonicalAuthClient, CanonicalAuthClientOptions, CanonicalAuthSession, CanonicalAuthUser, LocalAccountProvider, PasswordHasher, SystemUser, createCanonicalAuthClient, loginSystemUser, resolveUserFromToken } from './auth/index.js';
1
+ export { LuthAuthClient as CanonicalAuthClient, LuthSession as CanonicalAuthSession, LuthUser as CanonicalAuthUser, DeploymentEnvironment, EmailSignInCredentials, EmailSignUpData, GoogleSignInOptions, LuthAuthClient, LuthAuthClientConfig, LuthAuthError, LuthAuthTokenStore, LuthSession, LuthSessionResult, LuthUser, RegisterApplicationResult, createLuthAuthClient as createCanonicalAuthClient, createLuthAuthClient, resolveClientEnvironment, resolveClientOrigin } from '@dinilmusick/gutts';
2
+ export { AuthEnvironment, SystemUser, loginSystemUser, resolveUserFromToken } from './auth/index.js';
3
3
  export { B as BaseStorageAdapter, C as ConnectionTestResult, D as DeleteFolderResult, F as FileInfo, R as RenameFolderResult, S as StorageConfig, a as StorageMode, b as StorageProviderType, U as UploadResult } from './BaseStorageAdapter-EUCSvJse.js';
4
4
  export { B2AuthToken, BackblazeB2Adapter, GoogleDriveAdapter, GoogleDriveOAuthConfig, GoogleDriveTokenSet, LocalFSAdapter, S3Adapter, StorageAdapterFactory, SupabaseStorageAdapter, authorizeB2, b2DownloadFile, b2ListBuckets, b2ListFileNames, b2UploadFile, createGoogleDriveAuthorizationUrl, ensureS3DirectoryMarker, exchangeGoogleDriveCode, isSecretMasked, normalizeBackblazeCredentials, permanentDeleteS3Folder, permanentDeleteS3Object, refreshGoogleDriveAccessToken, renameS3Folder, resolveBackblazeEndpoint } from './storage/index.js';
5
5
  export { CloneReplicationResult, ConflictPolicy, RemoteWorkspaceService, SyncEngine, SyncState, WorkingWorkspaceService, WorkspaceCloneSyncEngine, WorkspaceConfig, WorkspaceDescriptor, WorkspaceFS, WorkspaceFileEntry, WorkspaceListResult, WorkspaceLookupResult, WorkspaceMutationResult, WorkspaceSecondaryClone, WorkspaceService, WorkspaceSyncSummary, formatCanonicalWorkspaceFolderName, remoteWorkspaceService, sanitizeWorkspaceName, workingWorkspaceService } from './workspace/index.js';
@@ -115,57 +115,6 @@ interface ServiceRegistryRecord {
115
115
  metadata?: Record<string, unknown>;
116
116
  }
117
117
 
118
- /**
119
- * @file authCore.ts
120
- * @description Universal Authentication Core Service for DEPM.
121
- * Governs user login, admin credentials verification, and user listing.
122
- * Runs identically in Node.js, Vercel Serverless, and Cloudflare Workers (< 200 lines).
123
- */
124
- declare function loginUser(email?: string, password?: string, isAdmin?: boolean, env?: Record<string, unknown>): Promise<{
125
- success: boolean;
126
- status: number;
127
- token: string;
128
- user: {
129
- id: string;
130
- email: any;
131
- role: string;
132
- username: string;
133
- name?: undefined;
134
- status?: undefined;
135
- };
136
- error?: undefined;
137
- } | {
138
- success: boolean;
139
- status: number;
140
- token: string;
141
- user: {
142
- id: any;
143
- email: any;
144
- username: any;
145
- name: any;
146
- role: any;
147
- status: any;
148
- };
149
- error?: undefined;
150
- } | {
151
- success: boolean;
152
- error: any;
153
- status: number;
154
- token?: undefined;
155
- user?: undefined;
156
- }>;
157
- declare function getUsers(env?: Record<string, unknown>): Promise<{
158
- success: boolean;
159
- count: number;
160
- users: any[];
161
- error?: undefined;
162
- } | {
163
- success: boolean;
164
- error: any;
165
- count: number;
166
- users: any[];
167
- }>;
168
-
169
118
  /**
170
119
  * @file b2DirectCore.ts
171
120
  * @description Direct REST API Client for Backblaze B2 Object Storage in Qwnsr.
@@ -1687,4 +1636,4 @@ declare function resolveSystemDatabaseUrl(env?: Record<string, string | undefine
1687
1636
  */
1688
1637
  declare function tryResolveSystemDatabaseUrl(env?: Record<string, string | undefined>): string | null;
1689
1638
 
1690
- export { type AssetChannelType, type AssetDataType, type AssetFolderInfo, type AssetPoolItem, type AssetPoolScope, type B2AuthData, type BackendFacade, BaseDataProvider, BaseResourceFetcher, type CloudflareObservability, type CloudflarePagesPauseState, type CloudflarePagesPreviewSetting, type CloudflareProjectItem, CloudflareResourceFetcher, type CloudflareUsageMetrics, type CredentialEntry, type CredentialManifest, type Deployment, type DeploymentControlResult, type FunctionSet, FunctionalityTable, GRAPHS_ROOT, type IDataProvider, LEGACY_PROJECTS_ROOT, type OrchestrationFn, PROJECTS_ROOT, type ProjectMetadata, type PublicRouteRecord, type QueryFilter, ResourceFetcherRegistry, type Runtime, SAMPLES_GLOBAL_ROOT, SUPPORTED_AUDIO_EXTS, SUPPORTED_MIDI_EXTS, type ServerAudioSampleItem, type ServiceFacade, type ServiceRegistryRecord, type SortOrder, type SrklB2Account, SrklStorageService, type SyncFileResult, type UnifiedQueryResult, type UnifiedResourceMetricItem, type UnifiedResourceMetrics, VercelResourceFetcher, WORKSPACE_ASSETS_ROOT, WORKSPACE_ROOT, type WorkingWorkspaceConfig, type WorkspaceFolderResolution, type WorkspaceStorageConfig, b2DeleteFileVersion, b2DeleteFolder, buildProjectObservability, buildProjectsList, cleanDbUrl, computeDeploymentFinalWeight, computeUsageWeightScore, configureStarterProjectTemplate, createAssetSubfolder, createCredential, createGraphAssetFolder, createGraphAssetFolder as createGraphAssetSubfolder, createGraphPackage, createWavBuffer, createWorkspace, createWorkspaceGraph, decryptSecretFromBlob, deleteAssetFromGraph, deleteAssetFromPool, deleteCredential, deleteGlobalSample, deleteGraphPackage, deleteProject, deleteProjectSample, deleteRoute, deleteWorkspace, deleteWorkspaceFile, deleteWorkspaceFolder, deleteWorkspaceGraph, encryptSecretToBlob, ensureAssetPoolDirectories, ensureGlobalSamples, ensureGraphAssetDirectories, ensureProjectAssets, ensureProjectsRoot, ensureWorkspaceStructure, exportEncryptedCredentials, fetchCloudflareData, fetchVercelData, findUserWorkspace, findWorkspaceRecord, formatRelativeCreated, getAllRoutes, getAssetPoolLocationPath, getAssetPoolPublicUrl, getB2BucketId, getConnectedDeploymentNode, getConnectedWeightModifiers, getCredential, getDefaultWorkingWorkspaceDir, getExecutions, getGatewayConfig, getGraphPackageById, getPrimarySrklDeploymentUrl as getPrimarySrklCoreDeploymentUrl, getProjectById, getPublicRouteByPath, getPublicRoutes, getSrklAccounts as getSrklCoreAccounts, getSrklStatus, getUnifiedDbUrl, getUsers, getWeightModifierScore, getWorkingWorkspaceConfig, getWorkingWorkspaceDir, getWorkspaceFolderKey, getWorkspaceFolderPrefix, getWorkspaceGraph, getWorkspaceStorageDetails, getWorkspaces, importEncryptedCredentials, importGraphDependency, initGlobalSamplesDirectory, isB2Workspace, listAllGraphPackages, listAllProjects, listBackblazeBuckets, listCredentials, listGlobalSamples, listProjectSamples, listWorkspaceFiles, listWorkspaceGraphs, loadCredentialManifest, loadWorkspaceData, loginUser, matchGatewayIngress, matchGatewayIngressAsync, pauseCloudflarePagesProject, pauseVercelProject, queryUnifiedDb, readWorkspaceFile, recordExecution, removeGraphDependency, renameAppInWorkspaceData, resolveDynamicRouteFromDb, resolveSystemDatabaseUrl, resolveWorkspaceConnection, resolveWorkspaceDir, resumeCloudflarePagesProject, resumeVercelProject, saveAssetToGraph, saveAssetToPool, saveCredentialManifest, saveGlobalSample, saveGraphPackage, saveProject, saveProjectSample, saveWorkspaceData, saveWorkspaceGraph, scanAssetPool, scanGraphAssets, seedDefaultAssets, seedStarterGraphAssets, serverPublicRoutes, setServerPublicRoutes, setWorkingWorkspaceConfig, srklListBackblazeBuckets as srklCoreListBackblazeBuckets, syncWorkspace, syncWorkspaceCreateToBucket, syncWorkspaceDataToBucket, syncWorkspaceDeleteToBucket, tryResolveSystemDatabaseUrl, updateCredential, updateWorkspace, upsertRoute, validateServiceDefinition, writeWorkspaceFile };
1639
+ export { type AssetChannelType, type AssetDataType, type AssetFolderInfo, type AssetPoolItem, type AssetPoolScope, type B2AuthData, type BackendFacade, BaseDataProvider, BaseResourceFetcher, type CloudflareObservability, type CloudflarePagesPauseState, type CloudflarePagesPreviewSetting, type CloudflareProjectItem, CloudflareResourceFetcher, type CloudflareUsageMetrics, type CredentialEntry, type CredentialManifest, type Deployment, type DeploymentControlResult, type FunctionSet, FunctionalityTable, GRAPHS_ROOT, type IDataProvider, LEGACY_PROJECTS_ROOT, type OrchestrationFn, PROJECTS_ROOT, type ProjectMetadata, type PublicRouteRecord, type QueryFilter, ResourceFetcherRegistry, type Runtime, SAMPLES_GLOBAL_ROOT, SUPPORTED_AUDIO_EXTS, SUPPORTED_MIDI_EXTS, type ServerAudioSampleItem, type ServiceFacade, type ServiceRegistryRecord, type SortOrder, type SrklB2Account, SrklStorageService, type SyncFileResult, type UnifiedQueryResult, type UnifiedResourceMetricItem, type UnifiedResourceMetrics, VercelResourceFetcher, WORKSPACE_ASSETS_ROOT, WORKSPACE_ROOT, type WorkingWorkspaceConfig, type WorkspaceFolderResolution, type WorkspaceStorageConfig, b2DeleteFileVersion, b2DeleteFolder, buildProjectObservability, buildProjectsList, cleanDbUrl, computeDeploymentFinalWeight, computeUsageWeightScore, configureStarterProjectTemplate, createAssetSubfolder, createCredential, createGraphAssetFolder, createGraphAssetFolder as createGraphAssetSubfolder, createGraphPackage, createWavBuffer, createWorkspace, createWorkspaceGraph, decryptSecretFromBlob, deleteAssetFromGraph, deleteAssetFromPool, deleteCredential, deleteGlobalSample, deleteGraphPackage, deleteProject, deleteProjectSample, deleteRoute, deleteWorkspace, deleteWorkspaceFile, deleteWorkspaceFolder, deleteWorkspaceGraph, encryptSecretToBlob, ensureAssetPoolDirectories, ensureGlobalSamples, ensureGraphAssetDirectories, ensureProjectAssets, ensureProjectsRoot, ensureWorkspaceStructure, exportEncryptedCredentials, fetchCloudflareData, fetchVercelData, findUserWorkspace, findWorkspaceRecord, formatRelativeCreated, getAllRoutes, getAssetPoolLocationPath, getAssetPoolPublicUrl, getB2BucketId, getConnectedDeploymentNode, getConnectedWeightModifiers, getCredential, getDefaultWorkingWorkspaceDir, getExecutions, getGatewayConfig, getGraphPackageById, getPrimarySrklDeploymentUrl as getPrimarySrklCoreDeploymentUrl, getProjectById, getPublicRouteByPath, getPublicRoutes, getSrklAccounts as getSrklCoreAccounts, getSrklStatus, getUnifiedDbUrl, getWeightModifierScore, getWorkingWorkspaceConfig, getWorkingWorkspaceDir, getWorkspaceFolderKey, getWorkspaceFolderPrefix, getWorkspaceGraph, getWorkspaceStorageDetails, getWorkspaces, importEncryptedCredentials, importGraphDependency, initGlobalSamplesDirectory, isB2Workspace, listAllGraphPackages, listAllProjects, listBackblazeBuckets, listCredentials, listGlobalSamples, listProjectSamples, listWorkspaceFiles, listWorkspaceGraphs, loadCredentialManifest, loadWorkspaceData, matchGatewayIngress, matchGatewayIngressAsync, pauseCloudflarePagesProject, pauseVercelProject, queryUnifiedDb, readWorkspaceFile, recordExecution, removeGraphDependency, renameAppInWorkspaceData, resolveDynamicRouteFromDb, resolveSystemDatabaseUrl, resolveWorkspaceConnection, resolveWorkspaceDir, resumeCloudflarePagesProject, resumeVercelProject, saveAssetToGraph, saveAssetToPool, saveCredentialManifest, saveGlobalSample, saveGraphPackage, saveProject, saveProjectSample, saveWorkspaceData, saveWorkspaceGraph, scanAssetPool, scanGraphAssets, seedDefaultAssets, seedStarterGraphAssets, serverPublicRoutes, setServerPublicRoutes, setWorkingWorkspaceConfig, srklListBackblazeBuckets as srklCoreListBackblazeBuckets, syncWorkspace, syncWorkspaceCreateToBucket, syncWorkspaceDataToBucket, syncWorkspaceDeleteToBucket, tryResolveSystemDatabaseUrl, updateCredential, updateWorkspace, upsertRoute, validateServiceDefinition, writeWorkspaceFile };