@ultrst-armada/kloks 1.24.0 → 1.24.1

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 (26) hide show
  1. package/.krusbl-release-attestation.json +3 -3
  2. package/package.json +6 -1
  3. package/packages/backend/dist/ai-routing/index.js +2 -2
  4. package/packages/backend/dist/auth/index.d.ts +2 -0
  5. package/packages/backend/dist/auth/index.js +2 -2
  6. package/packages/backend/dist/{chunk-WTBAG4AV.js → chunk-2HCQ2SIR.js} +9 -3
  7. package/packages/backend/dist/{chunk-IJ5QNZCY.js → chunk-6TRVGWXP.js} +282 -47
  8. package/packages/backend/dist/{chunk-W6JNJD3Q.js → chunk-A3BE6ROS.js} +1 -1
  9. package/packages/backend/dist/{chunk-3IUA66RS.js → chunk-HF5SGQ5V.js} +1 -1
  10. package/packages/backend/dist/{chunk-47IVAXPJ.js → chunk-IGZB4RYT.js} +1 -1
  11. package/packages/backend/dist/{chunk-VAFCR2MS.js → chunk-JCMB7BIM.js} +11 -3
  12. package/packages/backend/dist/{chunk-VN2YMZJO.js → chunk-JGUWYVOL.js} +1 -1
  13. package/packages/backend/dist/{chunk-SJD574XG.js → chunk-OB65KZ2M.js} +4 -4
  14. package/packages/backend/dist/{chunk-NB2X3HEX.js → chunk-VTU6CNZD.js} +4 -4
  15. package/packages/backend/dist/{chunk-6DNGLKAV.js → chunk-WQ4XZY4L.js} +5 -5
  16. package/packages/backend/dist/development/index.d.ts +108 -6
  17. package/packages/backend/dist/development/index.js +15 -3
  18. package/packages/backend/dist/index.d.ts +1 -1
  19. package/packages/backend/dist/index.js +42 -30
  20. package/packages/backend/dist/krnl-ai-services.js +3 -3
  21. package/packages/backend/dist/krnl-services.js +5 -5
  22. package/packages/backend/dist/services/index.js +3 -3
  23. package/packages/backend/dist/srkl/index.js +2 -2
  24. package/packages/backend/dist/workspace/index.js +3 -3
  25. package/packages/backend/package.json +1 -1
  26. package/packages/backend/dist/{chunk-YAAGIU2H.js → chunk-PT6J6UEU.js} +3 -3
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schema": 1,
3
3
  "packageName": "@ultrst-armada/kloks",
4
- "version": "1.24.0",
5
- "sourceCommit": "82fd096f94e5ba9bd491c21fca1863b29be14e70",
4
+ "version": "1.24.1",
5
+ "sourceCommit": "55f07544f89f1924b7374305941b6444e6257095",
6
6
  "releaseWorkflow": "npm Release",
7
- "workflowRunId": "41218118420"
7
+ "workflowRunId": "41517983084"
8
8
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ultrst-armada/kloks",
3
- "version": "1.24.0",
3
+ "version": "1.24.1",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -112,6 +112,11 @@
112
112
  "import": "./packages/backend/dist/development/index.js",
113
113
  "default": "./packages/backend/dist/development/index.js"
114
114
  },
115
+ "./browser-inspection": {
116
+ "types": "./packages/backend/dist/development/playwrightInspectionTypes.d.ts",
117
+ "import": "./packages/backend/dist/development/playwrightInspectionService.js",
118
+ "default": "./packages/backend/dist/development/playwrightInspectionService.js"
119
+ },
115
120
  "./ai-provider": {
116
121
  "types": "./packages/backend/dist/ai-provider/index.d.ts",
117
122
  "import": "./packages/backend/dist/ai-provider/index.js",
@@ -6,10 +6,10 @@ import {
6
6
  failoverExecutionEngine,
7
7
  healthCheckService,
8
8
  metricsLogger
9
- } from "../chunk-YAAGIU2H.js";
10
- import "../chunk-SLR6SIEU.js";
9
+ } from "../chunk-PT6J6UEU.js";
11
10
  import "../chunk-LMWXONZG.js";
12
11
  import "../chunk-P7H6TIEA.js";
12
+ import "../chunk-SLR6SIEU.js";
13
13
  import "../chunk-MAMK4GDH.js";
14
14
  import "../chunk-JSQZAFBU.js";
15
15
  import "../chunk-QGM4M3NI.js";
@@ -52,6 +52,7 @@ interface AuthResult {
52
52
  session?: Record<string, unknown>;
53
53
  error?: string;
54
54
  redirectUrl?: string;
55
+ token?: string;
55
56
  }
56
57
  declare class CanonicalAuthClient {
57
58
  private readonly baseUrl;
@@ -64,6 +65,7 @@ declare class CanonicalAuthClient {
64
65
  signInGoogle(callbackURL: string): Promise<AuthResult>;
65
66
  requestGoogleDriveAccess(callbackURL?: string): Promise<AuthResult>;
66
67
  getSession(cookie?: string): Promise<CanonicalAuthSession | null>;
68
+ getSessionWithToken(token: string): Promise<CanonicalAuthSession | null>;
67
69
  signOut(): Promise<boolean>;
68
70
  }
69
71
  declare function createCanonicalAuthClient(baseUrl: string, fetcher?: typeof fetch): CanonicalAuthClient;
@@ -3,7 +3,7 @@ import {
3
3
  BaseAccountProvider,
4
4
  LocalAccountProvider,
5
5
  PasswordHasher
6
- } from "../chunk-W6JNJD3Q.js";
6
+ } from "../chunk-A3BE6ROS.js";
7
7
  import {
8
8
  CanonicalAuthClient,
9
9
  RateLimiter,
@@ -11,7 +11,7 @@ import {
11
11
  createCanonicalAuthClient,
12
12
  loginSystemUser,
13
13
  resolveUserFromToken
14
- } from "../chunk-WTBAG4AV.js";
14
+ } from "../chunk-2HCQ2SIR.js";
15
15
  import "../chunk-QGM4M3NI.js";
16
16
  export {
17
17
  AdminGuard,
@@ -74,7 +74,7 @@ var CanonicalAuthClient = class {
74
74
  } catch {
75
75
  data = { message: text };
76
76
  }
77
- return { status: response.status, data };
77
+ return { status: response.status, data, token: response.headers.get("set-auth-token") ?? void 0 };
78
78
  }
79
79
  async signInEmail(email, password) {
80
80
  const result = await this.request("/sign-in/email", {
@@ -84,7 +84,7 @@ var CanonicalAuthClient = class {
84
84
  if (result.status >= 400 || result.data?.error) {
85
85
  return { success: false, status: result.status, error: result.data?.error?.message ?? result.data?.message ?? "Authentication failed." };
86
86
  }
87
- return { success: true, status: result.status, user: result.data?.user, session: result.data?.session };
87
+ return { success: true, status: result.status, user: result.data?.user, session: result.data?.session, token: result.token };
88
88
  }
89
89
  async signUpEmail(email, password, name) {
90
90
  const result = await this.request("/sign-up/email", {
@@ -94,7 +94,7 @@ var CanonicalAuthClient = class {
94
94
  if (result.status >= 400 || result.data?.error) {
95
95
  return { success: false, status: result.status, error: result.data?.error?.message ?? result.data?.message ?? "Registration failed." };
96
96
  }
97
- return { success: true, status: result.status, user: result.data?.user, session: result.data?.session };
97
+ return { success: true, status: result.status, user: result.data?.user, session: result.data?.session, token: result.data?.token ?? result.data?.session?.token };
98
98
  }
99
99
  async signInGoogle(callbackURL) {
100
100
  const result = await this.request("/sign-in/social", {
@@ -133,6 +133,12 @@ var CanonicalAuthClient = class {
133
133
  if (result.status >= 400 || !result.data?.user) return null;
134
134
  return result.data;
135
135
  }
136
+ async getSessionWithToken(token) {
137
+ if (!token?.trim()) return null;
138
+ const result = await this.request("/get-session", { headers: { Authorization: `Bearer ${token}` } });
139
+ if (result.status >= 400 || !result.data?.user) return null;
140
+ return result.data;
141
+ }
136
142
  async signOut() {
137
143
  const result = await this.request("/sign-out", { method: "POST", body: "{}" });
138
144
  return result.status < 400 && !result.data?.error;
@@ -104,43 +104,97 @@ var COMMANDS = {
104
104
  lint: { command: "pnpm", args: ["lint"] },
105
105
  test: { command: "pnpm", args: ["test"] },
106
106
  build: { command: "pnpm", args: ["build"] },
107
- validate: { command: "pnpm", args: ["lint"] },
107
+ validate: { command: "pnpm", args: ["validate"] },
108
108
  check: { command: "pnpm", args: ["lint"] }
109
109
  };
110
+ function parseDevelopmentDiagnostics(output, exitCode = 0) {
111
+ const diagnostics = [];
112
+ const seen = /* @__PURE__ */ new Set();
113
+ const add = (diagnostic) => {
114
+ const key = [diagnostic.source, diagnostic.code, diagnostic.file, diagnostic.line, diagnostic.message].join("|");
115
+ if (!seen.has(key)) {
116
+ seen.add(key);
117
+ diagnostics.push(diagnostic);
118
+ }
119
+ };
120
+ for (const line of output.split(/\r?\n/)) {
121
+ const typescript = line.match(/^(.+?)\((\d+),(\d+)\):\s*(error|warning)\s+(TS\d+):\s*(.+)$/);
122
+ if (typescript) {
123
+ add({ source: "typescript", severity: typescript[4], file: typescript[1], line: Number(typescript[2]), column: Number(typescript[3]), code: typescript[5], message: typescript[6] });
124
+ continue;
125
+ }
126
+ const eslint = line.match(/^(.+?):(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+([^\s]+)$/);
127
+ if (eslint) {
128
+ add({ source: "eslint", severity: eslint[4], file: eslint[1], line: Number(eslint[2]), column: Number(eslint[3]), code: eslint[6], message: eslint[5] });
129
+ continue;
130
+ }
131
+ const bundler = line.match(/(?:✘|×|ERROR|error:|Error:)\s*(.+)$/);
132
+ if (bundler) add({ source: "bundler", severity: "error", message: bundler[1].trim() });
133
+ if (/\bWARN(?:ING)?\b/i.test(line)) add({ source: "package-manager", severity: "warning", message: line.trim() });
134
+ }
135
+ if (exitCode !== 0 && diagnostics.every((item) => item.severity !== "error")) {
136
+ add({ source: "unknown", severity: "error", message: "Command failed with exit code " + exitCode + "; inspect captured output for details." });
137
+ }
138
+ return diagnostics;
139
+ }
140
+ function captureDevelopmentProcess(process2) {
141
+ const [consumerOutput, diagnosticOutput] = process2.output.tee();
142
+ const logs = (async () => {
143
+ const reader = diagnosticOutput.getReader();
144
+ let output = "";
145
+ try {
146
+ while (true) {
147
+ const next = await reader.read();
148
+ if (next.done) break;
149
+ output += next.value;
150
+ }
151
+ } finally {
152
+ reader.releaseLock();
153
+ }
154
+ const exitCode = await process2.exit;
155
+ return { output, exitCode, diagnostics: parseDevelopmentDiagnostics(output, exitCode) };
156
+ })();
157
+ return { ...process2, output: consumerOutput, logs };
158
+ }
159
+ function resolveWebContainerCommand(task) {
160
+ const command = COMMANDS[task];
161
+ return { command: command.command, args: [...command.args] };
162
+ }
110
163
  var runQueue = Promise.resolve();
164
+ var sharedContainer = null;
165
+ var sharedContainerPromise = null;
111
166
  var WebContainerRuntime = class {
112
- container = null;
113
- instancePromise = null;
114
167
  async boot() {
115
168
  if (typeof window !== "undefined" && !window.crossOriginIsolated) {
116
169
  throw new Error("WebContainer requires a cross-origin-isolated page. Ensure COOP=same-origin and COEP=require-corp are served.");
117
170
  }
118
- if (this.container) return this.container;
119
- if (!this.instancePromise) {
120
- this.instancePromise = import("@webcontainer/api").then(async (module) => {
171
+ if (sharedContainer) return sharedContainer;
172
+ if (!sharedContainerPromise) {
173
+ sharedContainerPromise = import("@webcontainer/api").then(async (module) => {
121
174
  const container = await module.WebContainer.boot({
122
175
  coep: "require-corp",
123
176
  workdirName: "kloks-development"
124
177
  });
125
- this.container = container;
178
+ sharedContainer = container;
126
179
  return container;
127
180
  }).catch((error) => {
128
- this.instancePromise = null;
181
+ sharedContainerPromise = null;
129
182
  throw error;
130
183
  });
131
184
  }
132
- return this.instancePromise;
185
+ return sharedContainerPromise;
133
186
  }
134
- async mount(files) {
187
+ async mount(files, mountPoint) {
135
188
  const container = await this.boot();
136
- await container.mount(files);
137
- return { mounted: true };
189
+ await container.mount(files, mountPoint ? { mountPoint } : void 0);
190
+ return { mounted: true, mountPoint: mountPoint ?? "/" };
138
191
  }
139
192
  async runProcess(command, args, cwd, env) {
140
193
  const container = await this.boot();
141
- const process = await container.spawn(command, args, { cwd, env });
194
+ const process2 = await container.spawn(command, args, { cwd, env });
195
+ const started = Date.now();
142
196
  let output = "";
143
- const reader = process.output.getReader();
197
+ const reader = process2.output.getReader();
144
198
  try {
145
199
  while (true) {
146
200
  const next = await reader.read();
@@ -150,10 +204,11 @@ var WebContainerRuntime = class {
150
204
  } finally {
151
205
  reader.releaseLock();
152
206
  }
153
- return { exitCode: await process.exit, output };
207
+ const exitCode = await process2.exit;
208
+ return { exitCode, output, command: [command, ...args].join(" "), durationMs: Date.now() - started, diagnostics: parseDevelopmentDiagnostics(output, exitCode) };
154
209
  }
155
210
  async run(task, cwd, env) {
156
- const spec = COMMANDS[task];
211
+ const spec = resolveWebContainerCommand(task);
157
212
  return this.runCommand(spec.command, spec.args, cwd, env);
158
213
  }
159
214
  async runCommand(command, args = [], cwd, env) {
@@ -171,13 +226,14 @@ var WebContainerRuntime = class {
171
226
  }
172
227
  async spawnCommand(command, args = [], cwd, env) {
173
228
  const container = await this.boot();
174
- return container.spawn(command, args, { cwd, env });
229
+ const process2 = await container.spawn(command, args, { cwd, env });
230
+ return captureDevelopmentProcess(process2);
175
231
  }
176
232
  async teardown() {
177
- const container = this.container;
178
- this.container = null;
179
- this.instancePromise = null;
180
- container?.teardown();
233
+ const container = sharedContainer;
234
+ sharedContainer = null;
235
+ sharedContainerPromise = null;
236
+ await container?.teardown();
181
237
  return { tornDown: true };
182
238
  }
183
239
  };
@@ -185,17 +241,17 @@ var runtime = new WebContainerRuntime();
185
241
  var WebContainerServiceDefinition = createServiceDefinition({
186
242
  id: "kloks.backend.webContainer",
187
243
  name: "WebContainerService",
188
- version: "1.1.0",
244
+ version: "1.2.0",
189
245
  operations: {
190
246
  boot: { id: "WebContainerService.boot", name: "boot", handler: async () => {
191
247
  await runtime.boot();
192
248
  return { ready: true };
193
249
  } },
194
- mount: { id: "WebContainerService.mount", name: "mount", handler: async (input) => runtime.mount(input.files) },
250
+ mount: { id: "WebContainerService.mount", name: "mount", handler: async (input) => runtime.mount(input.files, input.mountPoint) },
195
251
  run: { id: "WebContainerService.run", name: "run", handler: async (input) => runtime.run(input.task, input.cwd, input.env) },
196
252
  runCommand: { id: "WebContainerService.runCommand", name: "runCommand", handler: async (input) => runtime.runCommand(input.command, input.args, input.cwd, input.env) },
197
253
  teardown: { id: "WebContainerService.teardown", name: "teardown", handler: async () => runtime.teardown() },
198
- command: { id: "WebContainerService.command", name: "command", handler: async (input) => ({ task: input.task, command: COMMANDS[input.task] }) }
254
+ command: { id: "WebContainerService.command", name: "command", handler: async (input) => ({ task: input.task, command: resolveWebContainerCommand(input.task) }) }
199
255
  }
200
256
  });
201
257
  var WebContainerServiceFacade = {
@@ -215,20 +271,13 @@ var WebContainerServiceFacade = {
215
271
 
216
272
  // src/development/developmentService.ts
217
273
  function resolveDevelopmentCommand(task) {
218
- const commands = {
219
- install: ["pnpm", ["install", "--no-frozen-lockfile"]],
220
- lint: ["pnpm", ["lint"]],
221
- test: ["pnpm", ["test"]],
222
- build: ["pnpm", ["build"]],
223
- validate: ["pnpm", ["validate"]],
224
- check: ["pnpm", ["lint"]]
225
- };
226
- return commands[task];
274
+ const { command, args } = resolveWebContainerCommand(task);
275
+ return [command, args];
227
276
  }
228
277
  var DevelopmentServiceDefinition = createServiceDefinition({
229
278
  id: "kloks.backend.development",
230
279
  name: "DevelopmentService",
231
- version: "1.0.0",
280
+ version: "1.1.0",
232
281
  operations: {
233
282
  plan: {
234
283
  id: "DevelopmentService.plan",
@@ -261,9 +310,8 @@ var DevelopmentRuntime = class {
261
310
  githubActions;
262
311
  async run(request) {
263
312
  if (request.provider === "webcontainer") {
264
- const [command, args] = resolveDevelopmentCommand(request.task);
265
313
  const result = await this.webContainer.run(request.task, request.cwd, request.env);
266
- return { provider: request.provider, task: request.task, ok: result.exitCode === 0, exitCode: result.exitCode, output: result.output };
314
+ return { provider: request.provider, task: request.task, ok: result.exitCode === 0, exitCode: result.exitCode, output: result.output, command: result.command, durationMs: result.durationMs, diagnostics: result.diagnostics };
267
315
  }
268
316
  if (!this.githubActions || !request.repository || !request.workflowId || !request.ref) {
269
317
  throw new Error("GitHub Actions execution requires repository, workflowId, ref, and an authenticated client");
@@ -303,8 +351,8 @@ var COMMANDS2 = {
303
351
  var DEFAULT_LAYERS = ["lockfile-check", "syntax", "lint", "krnl", "frnl"];
304
352
  var commandText = (command, args) => [command, ...args].join(" ");
305
353
  var CodeValidationRuntime = class {
306
- constructor(runtime5 = new WebContainerRuntime()) {
307
- this.runtime = runtime5;
354
+ constructor(runtime6 = new WebContainerRuntime()) {
355
+ this.runtime = runtime6;
308
356
  }
309
357
  runtime;
310
358
  async validate(input = {}) {
@@ -358,8 +406,8 @@ var CodeValidationServiceFacade = {
358
406
 
359
407
  // src/development/codeDiagnosticsService.ts
360
408
  var CodeDiagnosticsService = class {
361
- constructor(runtime5 = new WebContainerRuntime()) {
362
- this.runtime = runtime5;
409
+ constructor(runtime6 = new WebContainerRuntime()) {
410
+ this.runtime = runtime6;
363
411
  }
364
412
  runtime;
365
413
  async diagnostics(input = {}) {
@@ -377,8 +425,8 @@ var TYPESCRIPT_LANGUAGE_SERVER_VERSION = "6.0.2";
377
425
  var PACKAGE = TYPESCRIPT_LANGUAGE_SERVER_PACKAGE;
378
426
  var DEFAULT_VERSION = TYPESCRIPT_LANGUAGE_SERVER_VERSION;
379
427
  var TypeScriptLanguageServerRuntime = class {
380
- constructor(runtime5 = new WebContainerRuntime()) {
381
- this.runtime = runtime5;
428
+ constructor(runtime6 = new WebContainerRuntime()) {
429
+ this.runtime = runtime6;
382
430
  }
383
431
  runtime;
384
432
  process = null;
@@ -413,13 +461,13 @@ var TypeScriptLanguageServerRuntime = class {
413
461
  return { sent: true };
414
462
  }
415
463
  async stop() {
416
- const process = this.process;
464
+ const process2 = this.process;
417
465
  this.process = null;
418
466
  this.writer?.releaseLock();
419
467
  this.writer = null;
420
468
  for (const pending of this.pending.values()) pending.reject(new Error("Language server stopped"));
421
469
  this.pending.clear();
422
- if (process) await process.kill();
470
+ if (process2) await process2.kill();
423
471
  return { stopped: true };
424
472
  }
425
473
  status() {
@@ -529,8 +577,8 @@ var PROVIDERS = [
529
577
  }
530
578
  ];
531
579
  var AgentHarnessRuntime = class {
532
- constructor(runtime5 = new WebContainerRuntime()) {
533
- this.runtime = runtime5;
580
+ constructor(runtime6 = new WebContainerRuntime()) {
581
+ this.runtime = runtime6;
534
582
  }
535
583
  runtime;
536
584
  providers() {
@@ -590,10 +638,194 @@ var AgentHarnessServiceFacade = {
590
638
  }
591
639
  };
592
640
 
641
+ // src/development/playwrightInspectionService.ts
642
+ import { randomUUID } from "crypto";
643
+ import { mkdir, writeFile } from "fs/promises";
644
+ import { dirname, join } from "path";
645
+
646
+ // src/development/playwrightInspectionSupport.ts
647
+ import { createRequire } from "module";
648
+ var require2 = createRequire(import.meta.url);
649
+ function loadPlaywright() {
650
+ try {
651
+ return require2("playwright");
652
+ } catch {
653
+ throw new Error('Playwright is required for browser inspection. Install the optional "playwright" package and Chromium browser.');
654
+ }
655
+ }
656
+ function recordInspectionError(errors, kind, message, url, status, method) {
657
+ errors.push({ kind, message, ...url ? { url } : {}, ...status ? { status } : {}, ...method ? { method } : {} });
658
+ }
659
+ async function runInspectionCheck(page, check) {
660
+ try {
661
+ const locator = page.locator(check.selector);
662
+ if (await locator.count() === 0) throw new Error("Selector matched no elements");
663
+ if (check.visible !== void 0 && await locator.isVisible() !== check.visible) throw new Error(`Expected visible=${check.visible}`);
664
+ if (check.text !== void 0 && !(await locator.innerText()).includes(check.text)) throw new Error(`Expected text containing: ${check.text}`);
665
+ if (check.action?.type === "click") await locator.click();
666
+ if (check.action?.type === "fill") await locator.fill(check.action.value ?? "");
667
+ return { selector: check.selector, passed: true };
668
+ } catch (cause) {
669
+ return { selector: check.selector, passed: false, details: cause instanceof Error ? cause.message : String(cause) };
670
+ }
671
+ }
672
+
673
+ // src/development/playwrightInspectionService.ts
674
+ var PlaywrightInspectionRuntime = class {
675
+ async inspect(request) {
676
+ const started = Date.now();
677
+ const errors = [];
678
+ const logs = [];
679
+ const checks = [];
680
+ const screenshots = [];
681
+ const screenshotDirectory = request.screenshotDirectory ?? join(process.cwd(), "artifacts/playwright", randomUUID());
682
+ const reportPath = request.reportPath ?? join(screenshotDirectory, "report.json");
683
+ const timeout = request.timeoutMs ?? 15e3;
684
+ let browser;
685
+ try {
686
+ browser = await loadPlaywright().chromium.launch({ headless: true });
687
+ } catch (cause) {
688
+ recordInspectionError(errors, "browser", cause instanceof Error ? cause.message : String(cause), request.url);
689
+ const result2 = {
690
+ ok: false,
691
+ url: request.url,
692
+ durationMs: Date.now() - started,
693
+ errors,
694
+ logs,
695
+ checks,
696
+ screenshots,
697
+ reportPath
698
+ };
699
+ await mkdir(dirname(reportPath), { recursive: true });
700
+ await writeFile(reportPath, JSON.stringify(result2, null, 2), "utf8");
701
+ return result2;
702
+ }
703
+ const context = await browser.newContext({ ignoreHTTPSErrors: false });
704
+ const page = await context.newPage();
705
+ let status;
706
+ let title;
707
+ let domSnapshot;
708
+ page.on("console", (message) => {
709
+ const location = message.location();
710
+ const type = message.type();
711
+ logs.push({ type, message: message.text(), url: page.url(), ...location.lineNumber ? { line: location.lineNumber } : {}, ...location.columnNumber ? { column: location.columnNumber } : {} });
712
+ if (type === "error") recordInspectionError(errors, "console", message.text(), page.url());
713
+ });
714
+ page.on("pageerror", (cause) => recordInspectionError(errors, "pageerror", cause instanceof Error ? cause.stack ?? cause.message : String(cause), page.url()));
715
+ page.on("requestfailed", (requestInfo) => recordInspectionError(errors, "requestfailed", requestInfo.failure()?.errorText ?? "Request failed", requestInfo.url(), void 0, requestInfo.method()));
716
+ page.on("response", (response) => {
717
+ if (response.status() >= 400) recordInspectionError(errors, "http", `HTTP ${response.status()} ${response.statusText()}`, response.url(), response.status(), response.request().method());
718
+ });
719
+ page.on("crash", () => recordInspectionError(errors, "crash", "Browser page crashed", page.url()));
720
+ page.on("dialog", async (dialog) => {
721
+ recordInspectionError(errors, "dialog", `Unexpected ${dialog.type()} dialog: ${dialog.message()}`, page.url());
722
+ await dialog.dismiss();
723
+ });
724
+ try {
725
+ try {
726
+ const response = await page.goto(request.url, { waitUntil: request.waitUntil ?? "networkidle", timeout });
727
+ status = response?.status();
728
+ } catch (cause) {
729
+ recordInspectionError(errors, "navigation", cause instanceof Error ? cause.message : String(cause), request.url);
730
+ }
731
+ try {
732
+ await page.waitForLoadState("domcontentloaded", { timeout });
733
+ } catch {
734
+ }
735
+ try {
736
+ title = await page.title();
737
+ } catch {
738
+ }
739
+ for (const check of request.checks ?? []) checks.push(await runInspectionCheck(page, check));
740
+ for (const viewport of request.viewports ?? [{ width: 1440, height: 900 }, { width: 390, height: 844 }]) {
741
+ try {
742
+ await page.setViewportSize(viewport);
743
+ const layout = await page.evaluate(() => ({
744
+ viewportWidth: window.innerWidth,
745
+ documentWidth: document.documentElement.scrollWidth,
746
+ brokenImages: Array.from(document.images).filter((image) => image.complete && image.naturalWidth === 0).map((image) => image.src)
747
+ }));
748
+ if (layout.documentWidth > layout.viewportWidth + 1) {
749
+ recordInspectionError(errors, "layout", `Horizontal overflow: document width ${layout.documentWidth}px exceeds viewport ${layout.viewportWidth}px`, request.url);
750
+ }
751
+ for (const imageUrl of layout.brokenImages) recordInspectionError(errors, "asset", "Image failed to render", imageUrl);
752
+ {
753
+ await mkdir(screenshotDirectory, { recursive: true });
754
+ const path = join(screenshotDirectory, `inspection-${viewport.width}x${viewport.height}.png`);
755
+ await page.screenshot({ path, fullPage: true });
756
+ screenshots.push(path);
757
+ }
758
+ } catch (cause) {
759
+ recordInspectionError(errors, "screenshot", cause instanceof Error ? cause.message : String(cause), request.url);
760
+ }
761
+ }
762
+ if (request.captureDom) {
763
+ try {
764
+ const html = await page.content();
765
+ domSnapshot = html.slice(0, request.maxDomCharacters ?? 4e4);
766
+ } catch (cause) {
767
+ recordInspectionError(errors, "dom", cause instanceof Error ? cause.message : String(cause), request.url);
768
+ }
769
+ }
770
+ } finally {
771
+ await page.close().catch(() => void 0);
772
+ await context.close().catch(() => void 0);
773
+ await browser.close().catch(() => void 0);
774
+ }
775
+ for (const check of checks) if (!check.passed) recordInspectionError(errors, "assertion", check.details ?? "Inspection assertion failed", request.url);
776
+ const result = {
777
+ ok: errors.length === 0,
778
+ url: request.url,
779
+ ...title ? { title } : {},
780
+ ...status !== void 0 ? { status } : {},
781
+ durationMs: Date.now() - started,
782
+ errors,
783
+ logs,
784
+ checks,
785
+ screenshots,
786
+ reportPath,
787
+ ...domSnapshot ? { domSnapshot } : {}
788
+ };
789
+ await mkdir(dirname(reportPath), { recursive: true });
790
+ await writeFile(reportPath, JSON.stringify(result, null, 2), "utf8");
791
+ return result;
792
+ }
793
+ };
794
+ var runtime5 = new PlaywrightInspectionRuntime();
795
+ var PlaywrightInspectionServiceDefinition = createServiceDefinition({
796
+ id: "kloks.backend.playwrightInspection",
797
+ name: "PlaywrightInspectionService",
798
+ version: "1.0.0",
799
+ operations: {
800
+ inspect: {
801
+ id: "PlaywrightInspectionService.inspect",
802
+ name: "inspect",
803
+ handler: async (input) => runtime5.inspect(input)
804
+ }
805
+ }
806
+ });
807
+ var PlaywrightInspectionServiceFacade = {
808
+ id: PlaywrightInspectionServiceDefinition.id,
809
+ name: PlaywrightInspectionServiceDefinition.name,
810
+ version: PlaywrightInspectionServiceDefinition.version,
811
+ runtime: "server",
812
+ deployment: "local",
813
+ definition: PlaywrightInspectionServiceDefinition,
814
+ createInstance: () => createService(PlaywrightInspectionServiceDefinition),
815
+ execute: async (op, input) => {
816
+ const instance = createService(PlaywrightInspectionServiceDefinition);
817
+ await instance.start();
818
+ return instance.call(op, input);
819
+ }
820
+ };
821
+
593
822
  export {
594
823
  GitHubActionsClient,
595
824
  GitHubActionsServiceDefinition,
596
825
  GitHubActionsServiceFacade,
826
+ parseDevelopmentDiagnostics,
827
+ captureDevelopmentProcess,
828
+ resolveWebContainerCommand,
597
829
  WebContainerRuntime,
598
830
  WebContainerServiceDefinition,
599
831
  WebContainerServiceFacade,
@@ -612,5 +844,8 @@ export {
612
844
  TypeScriptLanguageServerServiceFacade,
613
845
  AgentHarnessRuntime,
614
846
  AgentHarnessServiceDefinition,
615
- AgentHarnessServiceFacade
847
+ AgentHarnessServiceFacade,
848
+ PlaywrightInspectionRuntime,
849
+ PlaywrightInspectionServiceDefinition,
850
+ PlaywrightInspectionServiceFacade
616
851
  };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  RateLimiter,
3
3
  SessionManager
4
- } from "./chunk-WTBAG4AV.js";
4
+ } from "./chunk-2HCQ2SIR.js";
5
5
 
6
6
  // src/auth/PasswordHasher.ts
7
7
  var bcrypt = null;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  b2ListBuckets,
3
3
  queryUnifiedDb
4
- } from "./chunk-VAFCR2MS.js";
4
+ } from "./chunk-JCMB7BIM.js";
5
5
 
6
6
  // src/srkl/SrklClient.ts
7
7
  var CANONICAL_SRKL_URL = "https://srkl-engine.vercel.app";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-SHZAQTIT.js";
4
4
  import {
5
5
  findUserWorkspace
6
- } from "./chunk-VN2YMZJO.js";
6
+ } from "./chunk-JGUWYVOL.js";
7
7
 
8
8
  // src/services/workspaceGraphService.ts
9
9
  function slugify(name) {
@@ -5,10 +5,18 @@ function cleanDbUrl(url) {
5
5
  return url.trim().replace(/^["']|["']$/g, "");
6
6
  }
7
7
  function getUnifiedDbUrl(env) {
8
- const fromEnv = cleanDbUrl(env?.SYSTEM_DATABASE_URL_1) || cleanDbUrl(env?.DATABASE_URL) || cleanDbUrl(env?.SYSTEM_DATABASE_URL_2);
9
- if (fromEnv) return fromEnv;
8
+ const fromBindings = [
9
+ env?.SYSTEM_DATABASE_URL_1,
10
+ env?.SYSTEM_DATABASE_URL_2,
11
+ env?.SYSTEM_DATABASE_URL_3
12
+ ].map(cleanDbUrl).find(Boolean);
13
+ if (fromBindings) return fromBindings;
10
14
  if (typeof process !== "undefined" && process.env) {
11
- return cleanDbUrl(process.env.SYSTEM_DATABASE_URL_1) || cleanDbUrl(process.env.DATABASE_URL) || cleanDbUrl(process.env.SYSTEM_DATABASE_URL_2) || cleanDbUrl(process.env.SYSTEM_DATABASE_URL_3) || "";
15
+ return [
16
+ process.env.SYSTEM_DATABASE_URL_1,
17
+ process.env.SYSTEM_DATABASE_URL_2,
18
+ process.env.SYSTEM_DATABASE_URL_3
19
+ ].map(cleanDbUrl).find(Boolean) || "";
12
20
  }
13
21
  return "";
14
22
  }
@@ -6,7 +6,7 @@ import {
6
6
  b2ListFileNames,
7
7
  b2UploadFile,
8
8
  queryUnifiedDb
9
- } from "./chunk-VAFCR2MS.js";
9
+ } from "./chunk-JCMB7BIM.js";
10
10
 
11
11
  // src/core/workspaceFileCore.ts
12
12
  async function getFs() {
@@ -10,16 +10,16 @@ import {
10
10
  } from "./chunk-GCTQY24J.js";
11
11
  import {
12
12
  failoverExecutionEngine
13
- } from "./chunk-YAAGIU2H.js";
14
- import {
15
- aiProviderService
16
- } from "./chunk-SLR6SIEU.js";
13
+ } from "./chunk-PT6J6UEU.js";
17
14
  import {
18
15
  modelCatalog
19
16
  } from "./chunk-LMWXONZG.js";
20
17
  import {
21
18
  keyStore
22
19
  } from "./chunk-P7H6TIEA.js";
20
+ import {
21
+ aiProviderService
22
+ } from "./chunk-SLR6SIEU.js";
23
23
 
24
24
  // src/krnl-ai-services.ts
25
25
  var AIProviderServiceDefinition = createServiceDefinition({
@@ -14,10 +14,10 @@ import {
14
14
  SessionManager,
15
15
  loginSystemUser,
16
16
  resolveUserFromToken
17
- } from "./chunk-WTBAG4AV.js";
17
+ } from "./chunk-2HCQ2SIR.js";
18
18
  import {
19
19
  workspaceGraphService
20
- } from "./chunk-47IVAXPJ.js";
20
+ } from "./chunk-IGZB4RYT.js";
21
21
  import {
22
22
  StorageAdapterFactory
23
23
  } from "./chunk-SHZAQTIT.js";
@@ -27,10 +27,10 @@ import {
27
27
  findUserWorkspace,
28
28
  getWorkspaces,
29
29
  updateWorkspace
30
- } from "./chunk-VN2YMZJO.js";
30
+ } from "./chunk-JGUWYVOL.js";
31
31
  import {
32
32
  queryUnifiedDb
33
- } from "./chunk-VAFCR2MS.js";
33
+ } from "./chunk-JCMB7BIM.js";
34
34
  import {
35
35
  createService,
36
36
  createServiceDefinition
@@ -4,16 +4,16 @@ import {
4
4
  findUserWorkspace,
5
5
  getWorkspaces,
6
6
  updateWorkspace
7
- } from "./chunk-VN2YMZJO.js";
7
+ } from "./chunk-JGUWYVOL.js";
8
+ import {
9
+ GoogleDriveAdapter
10
+ } from "./chunk-KKRWZDMN.js";
8
11
  import {
9
12
  b2DownloadFile,
10
13
  b2ListFileNames,
11
14
  b2UploadFile,
12
15
  queryUnifiedDb
13
- } from "./chunk-VAFCR2MS.js";
14
- import {
15
- GoogleDriveAdapter
16
- } from "./chunk-KKRWZDMN.js";
16
+ } from "./chunk-JCMB7BIM.js";
17
17
 
18
18
  // src/workspace/WorkspaceFS.ts
19
19
  import { SkipoBase } from "@ultrst-armada/kloks/functions";
@@ -13,12 +13,24 @@ interface DevelopmentRequest {
13
13
  cwd?: string;
14
14
  env?: Record<string, string>;
15
15
  }
16
+ interface DevelopmentDiagnostic {
17
+ severity: 'error' | 'warning' | 'info';
18
+ source: 'typescript' | 'eslint' | 'bundler' | 'package-manager' | 'runtime' | 'unknown';
19
+ code?: string;
20
+ file?: string;
21
+ line?: number;
22
+ column?: number;
23
+ message: string;
24
+ }
16
25
  interface DevelopmentResult {
17
26
  provider: DevelopmentProvider;
18
27
  task: DevelopmentTask;
19
28
  ok: boolean;
20
29
  exitCode?: number;
21
30
  output?: string;
31
+ command?: string;
32
+ durationMs?: number;
33
+ diagnostics?: DevelopmentDiagnostic[];
22
34
  runId?: number;
23
35
  url?: string;
24
36
  }
@@ -85,7 +97,19 @@ declare const GitHubActionsServiceFacade: {
85
97
  execute: <TIn = unknown, TOut = unknown>(op: string, input?: TIn) => Promise<TOut>;
86
98
  };
87
99
 
88
- declare const COMMANDS: Record<string, WebContainerCommand>;
100
+ declare function parseDevelopmentDiagnostics(output: string, exitCode?: number): DevelopmentDiagnostic[];
101
+ declare function captureDevelopmentProcess<T extends {
102
+ output: ReadableStream<string>;
103
+ exit: Promise<number>;
104
+ }>(process: T): T & {
105
+ output: ReadableStream<string>;
106
+ logs: Promise<{
107
+ output: string;
108
+ exitCode: number;
109
+ diagnostics: DevelopmentDiagnostic[];
110
+ }>;
111
+ };
112
+ declare function resolveWebContainerCommand(task: DevelopmentTask): WebContainerCommand;
89
113
  interface WebContainerRunCommandInput {
90
114
  command: string;
91
115
  args?: string[];
@@ -93,20 +117,25 @@ interface WebContainerRunCommandInput {
93
117
  env?: Record<string, string | number | boolean>;
94
118
  }
95
119
  declare class WebContainerRuntime {
96
- private container;
97
- private instancePromise;
98
120
  boot(): Promise<any>;
99
- mount(files: Record<string, unknown>): Promise<{
121
+ mount(files: Record<string, unknown>, mountPoint?: string): Promise<{
100
122
  mounted: boolean;
123
+ mountPoint: string;
101
124
  }>;
102
125
  private runProcess;
103
- run(task: keyof typeof COMMANDS, cwd?: string, env?: Record<string, string>): Promise<{
126
+ run(task: DevelopmentTask, cwd?: string, env?: Record<string, string>): Promise<{
104
127
  exitCode: any;
105
128
  output: string;
129
+ command: string;
130
+ durationMs: number;
131
+ diagnostics: DevelopmentDiagnostic[];
106
132
  }>;
107
133
  runCommand(command: string, args?: string[], cwd?: string, env?: Record<string, string | number | boolean>): Promise<{
108
134
  exitCode: any;
109
135
  output: string;
136
+ command: string;
137
+ durationMs: number;
138
+ diagnostics: DevelopmentDiagnostic[];
110
139
  }>;
111
140
  spawnCommand(command: string, args?: string[], cwd?: string, env?: Record<string, string | number | boolean>): Promise<any>;
112
141
  teardown(): Promise<{
@@ -298,4 +327,77 @@ declare const AgentHarnessServiceFacade: {
298
327
  execute: <TIn = unknown, TOut = unknown>(op: string, input?: TIn) => Promise<TOut>;
299
328
  };
300
329
 
301
- export { type AgentHarnessProvider, type AgentHarnessProviderInfo, type AgentHarnessResult, type AgentHarnessRunInput, AgentHarnessRuntime, type AgentHarnessServiceContract, AgentHarnessServiceDefinition, AgentHarnessServiceFacade, type CodeDiagnosticsInput, type CodeDiagnosticsResult, CodeDiagnosticsService, type CodeValidationInput, type CodeValidationResult, CodeValidationRuntime, CodeValidationServiceDefinition, CodeValidationServiceFacade, type DevelopmentProvider, type DevelopmentRequest, type DevelopmentResult, DevelopmentRuntime, type DevelopmentServiceContract, DevelopmentServiceDefinition, DevelopmentServiceFacade, type DevelopmentTask, GitHubActionsClient, type GitHubActionsConfig, GitHubActionsServiceDefinition, GitHubActionsServiceFacade, TYPESCRIPT_LANGUAGE_SERVER_PACKAGE, TYPESCRIPT_LANGUAGE_SERVER_VERSION, type TypeScriptLanguageServerNotificationInput, type TypeScriptLanguageServerRequestInput, type TypeScriptLanguageServerResponse, TypeScriptLanguageServerServiceDefinition, TypeScriptLanguageServerServiceFacade, type TypeScriptLanguageServerStartInput, type TypeScriptLanguageServerStatus, type ValidationDiagnostic, type ValidationLayer, type WebContainerCommand, type WebContainerRunCommandInput, WebContainerRuntime, WebContainerServiceDefinition, WebContainerServiceFacade, type WorkflowRun, codeDiagnosticsService, resolveDevelopmentCommand };
330
+ type InspectionErrorKind = 'console' | 'pageerror' | 'requestfailed' | 'http' | 'navigation' | 'assertion' | 'crash' | 'dialog' | 'browser' | 'screenshot' | 'dom' | 'layout' | 'asset';
331
+ interface InspectionError {
332
+ kind: InspectionErrorKind;
333
+ message: string;
334
+ url?: string;
335
+ status?: number;
336
+ method?: string;
337
+ }
338
+ interface InspectionLog {
339
+ type: 'error' | 'warning' | 'log' | 'info' | 'debug' | 'dir' | 'trace' | 'assert' | 'other';
340
+ message: string;
341
+ url?: string;
342
+ line?: number;
343
+ column?: number;
344
+ }
345
+ interface InspectionCheck {
346
+ selector: string;
347
+ visible?: boolean;
348
+ text?: string;
349
+ action?: {
350
+ type: 'click' | 'fill';
351
+ value?: string;
352
+ };
353
+ }
354
+ interface InspectionViewport {
355
+ width: number;
356
+ height: number;
357
+ }
358
+ interface PlaywrightInspectionRequest {
359
+ url: string;
360
+ timeoutMs?: number;
361
+ waitUntil?: 'load' | 'domcontentloaded' | 'networkidle';
362
+ viewports?: InspectionViewport[];
363
+ checks?: InspectionCheck[];
364
+ screenshotDirectory?: string;
365
+ reportPath?: string;
366
+ captureDom?: boolean;
367
+ maxDomCharacters?: number;
368
+ }
369
+ interface InspectionCheckResult {
370
+ selector: string;
371
+ passed: boolean;
372
+ details?: string;
373
+ }
374
+ interface PlaywrightInspectionResult {
375
+ ok: boolean;
376
+ url: string;
377
+ title?: string;
378
+ status?: number;
379
+ durationMs: number;
380
+ errors: InspectionError[];
381
+ logs: InspectionLog[];
382
+ checks: InspectionCheckResult[];
383
+ screenshots: string[];
384
+ reportPath?: string;
385
+ domSnapshot?: string;
386
+ }
387
+
388
+ declare class PlaywrightInspectionRuntime {
389
+ inspect(request: PlaywrightInspectionRequest): Promise<PlaywrightInspectionResult>;
390
+ }
391
+ declare const PlaywrightInspectionServiceDefinition: ServiceDefinition;
392
+ declare const PlaywrightInspectionServiceFacade: {
393
+ id: string;
394
+ name: string;
395
+ version: string;
396
+ runtime: "server";
397
+ deployment: "local";
398
+ definition: ServiceDefinition<Record<string, unknown>, Record<string, unknown>>;
399
+ createInstance: () => _ultrst_armada_krnl.ServiceInstance<Record<string, unknown>, Record<string, unknown>>;
400
+ execute: <TIn = unknown, TOut = unknown>(op: string, input?: TIn) => Promise<TOut>;
401
+ };
402
+
403
+ export { type AgentHarnessProvider, type AgentHarnessProviderInfo, type AgentHarnessResult, type AgentHarnessRunInput, AgentHarnessRuntime, type AgentHarnessServiceContract, AgentHarnessServiceDefinition, AgentHarnessServiceFacade, type CodeDiagnosticsInput, type CodeDiagnosticsResult, CodeDiagnosticsService, type CodeValidationInput, type CodeValidationResult, CodeValidationRuntime, CodeValidationServiceDefinition, CodeValidationServiceFacade, type DevelopmentDiagnostic, type DevelopmentProvider, type DevelopmentRequest, type DevelopmentResult, DevelopmentRuntime, type DevelopmentServiceContract, DevelopmentServiceDefinition, DevelopmentServiceFacade, type DevelopmentTask, GitHubActionsClient, type GitHubActionsConfig, GitHubActionsServiceDefinition, GitHubActionsServiceFacade, type InspectionCheck, type InspectionCheckResult, type InspectionError, type InspectionErrorKind, type InspectionLog, type InspectionViewport, type PlaywrightInspectionRequest, type PlaywrightInspectionResult, PlaywrightInspectionRuntime, PlaywrightInspectionServiceDefinition, PlaywrightInspectionServiceFacade, TYPESCRIPT_LANGUAGE_SERVER_PACKAGE, TYPESCRIPT_LANGUAGE_SERVER_VERSION, type TypeScriptLanguageServerNotificationInput, type TypeScriptLanguageServerRequestInput, type TypeScriptLanguageServerResponse, TypeScriptLanguageServerServiceDefinition, TypeScriptLanguageServerServiceFacade, type TypeScriptLanguageServerStartInput, type TypeScriptLanguageServerStatus, type ValidationDiagnostic, type ValidationLayer, type WebContainerCommand, type WebContainerRunCommandInput, WebContainerRuntime, WebContainerServiceDefinition, WebContainerServiceFacade, type WorkflowRun, captureDevelopmentProcess, codeDiagnosticsService, parseDevelopmentDiagnostics, resolveDevelopmentCommand, resolveWebContainerCommand };
@@ -12,6 +12,9 @@ import {
12
12
  GitHubActionsClient,
13
13
  GitHubActionsServiceDefinition,
14
14
  GitHubActionsServiceFacade,
15
+ PlaywrightInspectionRuntime,
16
+ PlaywrightInspectionServiceDefinition,
17
+ PlaywrightInspectionServiceFacade,
15
18
  TYPESCRIPT_LANGUAGE_SERVER_PACKAGE,
16
19
  TYPESCRIPT_LANGUAGE_SERVER_VERSION,
17
20
  TypeScriptLanguageServerServiceDefinition,
@@ -19,9 +22,12 @@ import {
19
22
  WebContainerRuntime,
20
23
  WebContainerServiceDefinition,
21
24
  WebContainerServiceFacade,
25
+ captureDevelopmentProcess,
22
26
  codeDiagnosticsService,
23
- resolveDevelopmentCommand
24
- } from "../chunk-IJ5QNZCY.js";
27
+ parseDevelopmentDiagnostics,
28
+ resolveDevelopmentCommand,
29
+ resolveWebContainerCommand
30
+ } from "../chunk-6TRVGWXP.js";
25
31
  import "../chunk-MWSYNRNZ.js";
26
32
  import "../chunk-QGM4M3NI.js";
27
33
  export {
@@ -38,6 +44,9 @@ export {
38
44
  GitHubActionsClient,
39
45
  GitHubActionsServiceDefinition,
40
46
  GitHubActionsServiceFacade,
47
+ PlaywrightInspectionRuntime,
48
+ PlaywrightInspectionServiceDefinition,
49
+ PlaywrightInspectionServiceFacade,
41
50
  TYPESCRIPT_LANGUAGE_SERVER_PACKAGE,
42
51
  TYPESCRIPT_LANGUAGE_SERVER_VERSION,
43
52
  TypeScriptLanguageServerServiceDefinition,
@@ -45,6 +54,9 @@ export {
45
54
  WebContainerRuntime,
46
55
  WebContainerServiceDefinition,
47
56
  WebContainerServiceFacade,
57
+ captureDevelopmentProcess,
48
58
  codeDiagnosticsService,
49
- resolveDevelopmentCommand
59
+ parseDevelopmentDiagnostics,
60
+ resolveDevelopmentCommand,
61
+ resolveWebContainerCommand
50
62
  };
@@ -13,7 +13,7 @@ export { AdaptedStorageConnection, AppAccountManifest, AppServiceDeclaration, CA
13
13
  export { CompositeBackend, EndpointGenerator, GeneratedEndpointSummary, LOCAL_STORAGE_GRAPHS_PREFIX, LocalService, NodeGraphPersistenceService, NodeGraphValidationResult, RemoteServiceProxy, SaveGraphOptions, UniversalAppEntity, UniversalGraphEdge, UniversalGraphNode, UniversalNodeGraphDocument, UniversalStorageConnection, WorkspaceGraphDocument, WorkspaceGraphSummary, createBackend, createCompositeService, createLocalService, createRemoteService, exportGraphAsJsonFile, nodeGraphPersistence, parseGraphJsonFile, validateGraphDocument, workspaceGraphService } from './services/index.js';
14
14
  import { AssetDataType as AssetDataType$1, AssetChannelType as AssetChannelType$1, GraphFolderInfo as GraphFolderInfo$1, GraphAssetItem as GraphAssetItem$1, SpaceNode, NodeConnection, DawProject } from '@ultrst-armada/kloks/state-graph';
15
15
  export { AuthServiceDefinition, AuthServiceFacade, ControlPlaneServiceDefinition, ControlPlaneServiceFacade, DatabaseServiceDefinition, DatabaseServiceFacade, GeminiServiceDefinition, GeminiServiceFacade, SrklServiceDefinition, SrklServiceFacade, StorageServiceDefinition, StorageServiceFacade, WorkspaceGraphServiceDefinition, WorkspaceGraphServiceFacade, WorkspaceServiceDefinition, WorkspaceServiceFacade, krnlAuthServiceDefinition, krnlAuthServiceFacade, krnlControlPlaneServiceDefinition, krnlControlPlaneServiceFacade, krnlDatabaseServiceDefinition, krnlDatabaseServiceFacade, krnlGeminiServiceDefinition, krnlGeminiServiceFacade, krnlSrklServiceDefinition, krnlSrklServiceFacade, krnlStorageServiceDefinition, krnlStorageServiceFacade, krnlWorkspaceGraphServiceDefinition, krnlWorkspaceGraphServiceFacade, krnlWorkspaceServiceDefinition, krnlWorkspaceServiceFacade } from './krnl-services.js';
16
- export { AgentHarnessProvider, AgentHarnessProviderInfo, AgentHarnessResult, AgentHarnessRunInput, AgentHarnessRuntime, AgentHarnessServiceContract, AgentHarnessServiceDefinition, AgentHarnessServiceFacade, CodeDiagnosticsInput, CodeDiagnosticsResult, CodeDiagnosticsService, CodeValidationInput, CodeValidationResult, CodeValidationRuntime, CodeValidationServiceDefinition, CodeValidationServiceFacade, DevelopmentProvider, DevelopmentRequest, DevelopmentResult, DevelopmentRuntime, DevelopmentServiceContract, DevelopmentServiceDefinition, DevelopmentServiceFacade, DevelopmentTask, GitHubActionsClient, GitHubActionsConfig, GitHubActionsServiceDefinition, GitHubActionsServiceFacade, TYPESCRIPT_LANGUAGE_SERVER_PACKAGE, TYPESCRIPT_LANGUAGE_SERVER_VERSION, TypeScriptLanguageServerNotificationInput, TypeScriptLanguageServerRequestInput, TypeScriptLanguageServerResponse, TypeScriptLanguageServerServiceDefinition, TypeScriptLanguageServerServiceFacade, TypeScriptLanguageServerStartInput, TypeScriptLanguageServerStatus, ValidationDiagnostic, ValidationLayer, WebContainerCommand, WebContainerRunCommandInput, WebContainerRuntime, WebContainerServiceDefinition, WebContainerServiceFacade, WorkflowRun, codeDiagnosticsService, resolveDevelopmentCommand } from './development/index.js';
16
+ export { AgentHarnessProvider, AgentHarnessProviderInfo, AgentHarnessResult, AgentHarnessRunInput, AgentHarnessRuntime, AgentHarnessServiceContract, AgentHarnessServiceDefinition, AgentHarnessServiceFacade, CodeDiagnosticsInput, CodeDiagnosticsResult, CodeDiagnosticsService, CodeValidationInput, CodeValidationResult, CodeValidationRuntime, CodeValidationServiceDefinition, CodeValidationServiceFacade, DevelopmentDiagnostic, DevelopmentProvider, DevelopmentRequest, DevelopmentResult, DevelopmentRuntime, DevelopmentServiceContract, DevelopmentServiceDefinition, DevelopmentServiceFacade, DevelopmentTask, GitHubActionsClient, GitHubActionsConfig, GitHubActionsServiceDefinition, GitHubActionsServiceFacade, InspectionCheck, InspectionCheckResult, InspectionError, InspectionErrorKind, InspectionLog, InspectionViewport, PlaywrightInspectionRequest, PlaywrightInspectionResult, PlaywrightInspectionRuntime, PlaywrightInspectionServiceDefinition, PlaywrightInspectionServiceFacade, TYPESCRIPT_LANGUAGE_SERVER_PACKAGE, TYPESCRIPT_LANGUAGE_SERVER_VERSION, TypeScriptLanguageServerNotificationInput, TypeScriptLanguageServerRequestInput, TypeScriptLanguageServerResponse, TypeScriptLanguageServerServiceDefinition, TypeScriptLanguageServerServiceFacade, TypeScriptLanguageServerStartInput, TypeScriptLanguageServerStatus, ValidationDiagnostic, ValidationLayer, WebContainerCommand, WebContainerRunCommandInput, WebContainerRuntime, WebContainerServiceDefinition, WebContainerServiceFacade, WorkflowRun, captureDevelopmentProcess, codeDiagnosticsService, parseDevelopmentDiagnostics, resolveDevelopmentCommand, resolveWebContainerCommand } from './development/index.js';
17
17
  export { A as AIProviderStatus, a as ProviderCapabilities, P as ProviderId, b as ProviderMeta } from './types-Di4ZAQYA.js';
18
18
  export { AIProviderService, PROVIDERS_META, PROVIDER_COLORS, aiProviderService, getProviderMeta, listProviders } from './ai-provider/index.js';
19
19
  export { A as AIHttpRequest, a as AIHttpResponse, b as AITransportClient } from './AITransportClient-dToGr8nj.js';
@@ -1,3 +1,6 @@
1
+ import {
2
+ S3Adapter
3
+ } from "./chunk-RBQ4CW3T.js";
1
4
  import {
2
5
  CANONICAL_SRKL_URL,
3
6
  SrklClient,
@@ -15,10 +18,7 @@ import {
15
18
  srklService,
16
19
  syncSrklAccounts,
17
20
  useSrklServices
18
- } from "./chunk-3IUA66RS.js";
19
- import {
20
- S3Adapter
21
- } from "./chunk-RBQ4CW3T.js";
21
+ } from "./chunk-HF5SGQ5V.js";
22
22
  import {
23
23
  RemoteWorkspaceService,
24
24
  SyncEngine,
@@ -34,22 +34,22 @@ import {
34
34
  setWorkingWorkspaceConfig,
35
35
  syncWorkspace,
36
36
  workingWorkspaceService
37
- } from "./chunk-6DNGLKAV.js";
37
+ } from "./chunk-WQ4XZY4L.js";
38
+ import {
39
+ validateToolInput
40
+ } from "./chunk-6GQNYRD6.js";
38
41
  import {
39
42
  BaseApiRoute,
40
43
  createSSEResponse,
41
44
  withAuth,
42
45
  withCors
43
46
  } from "./chunk-TWCEVES2.js";
44
- import {
45
- validateToolInput
46
- } from "./chunk-6GQNYRD6.js";
47
47
  import {
48
48
  AdminGuard,
49
49
  BaseAccountProvider,
50
50
  LocalAccountProvider,
51
51
  PasswordHasher
52
- } from "./chunk-W6JNJD3Q.js";
52
+ } from "./chunk-A3BE6ROS.js";
53
53
  import {
54
54
  BackendProvider,
55
55
  useBackend,
@@ -101,6 +101,9 @@ import {
101
101
  GitHubActionsClient,
102
102
  GitHubActionsServiceDefinition,
103
103
  GitHubActionsServiceFacade,
104
+ PlaywrightInspectionRuntime,
105
+ PlaywrightInspectionServiceDefinition,
106
+ PlaywrightInspectionServiceFacade,
104
107
  TYPESCRIPT_LANGUAGE_SERVER_PACKAGE,
105
108
  TYPESCRIPT_LANGUAGE_SERVER_VERSION,
106
109
  TypeScriptLanguageServerServiceDefinition,
@@ -108,9 +111,12 @@ import {
108
111
  WebContainerRuntime,
109
112
  WebContainerServiceDefinition,
110
113
  WebContainerServiceFacade,
114
+ captureDevelopmentProcess,
111
115
  codeDiagnosticsService,
112
- resolveDevelopmentCommand
113
- } from "./chunk-IJ5QNZCY.js";
116
+ parseDevelopmentDiagnostics,
117
+ resolveDevelopmentCommand,
118
+ resolveWebContainerCommand
119
+ } from "./chunk-6TRVGWXP.js";
114
120
  import {
115
121
  CompositeBackend,
116
122
  EndpointGenerator,
@@ -138,7 +144,7 @@ import {
138
144
  AIRoutingServiceFacade,
139
145
  AIToolServiceDefinition,
140
146
  AIToolServiceFacade
141
- } from "./chunk-SJD574XG.js";
147
+ } from "./chunk-OB65KZ2M.js";
142
148
  import {
143
149
  MCPEngine,
144
150
  ToolManagerService,
@@ -178,7 +184,7 @@ import {
178
184
  krnlWorkspaceGraphServiceFacade,
179
185
  krnlWorkspaceServiceDefinition,
180
186
  krnlWorkspaceServiceFacade
181
- } from "./chunk-NB2X3HEX.js";
187
+ } from "./chunk-VTU6CNZD.js";
182
188
  import {
183
189
  getPrimarySrklDeploymentUrl,
184
190
  getSrklAccounts,
@@ -202,10 +208,10 @@ import {
202
208
  createCanonicalAuthClient,
203
209
  loginSystemUser,
204
210
  resolveUserFromToken
205
- } from "./chunk-WTBAG4AV.js";
211
+ } from "./chunk-2HCQ2SIR.js";
206
212
  import {
207
213
  workspaceGraphService
208
- } from "./chunk-47IVAXPJ.js";
214
+ } from "./chunk-IGZB4RYT.js";
209
215
  import {
210
216
  BackblazeB2Adapter,
211
217
  LocalFSAdapter,
@@ -240,15 +246,7 @@ import {
240
246
  syncWorkspaceDeleteToBucket,
241
247
  updateWorkspace,
242
248
  writeWorkspaceFile
243
- } from "./chunk-VN2YMZJO.js";
244
- import {
245
- b2DeleteFileVersion,
246
- b2DeleteFolder,
247
- cleanDbUrl,
248
- getB2BucketId,
249
- getUnifiedDbUrl,
250
- queryUnifiedDb
251
- } from "./chunk-VAFCR2MS.js";
249
+ } from "./chunk-JGUWYVOL.js";
252
250
  import {
253
251
  BaseStorageAdapter,
254
252
  GoogleDriveAdapter,
@@ -256,6 +254,14 @@ import {
256
254
  exchangeGoogleDriveCode,
257
255
  refreshGoogleDriveAccessToken
258
256
  } from "./chunk-KKRWZDMN.js";
257
+ import {
258
+ b2DeleteFileVersion,
259
+ b2DeleteFolder,
260
+ cleanDbUrl,
261
+ getB2BucketId,
262
+ getUnifiedDbUrl,
263
+ queryUnifiedDb
264
+ } from "./chunk-JCMB7BIM.js";
259
265
  import "./chunk-MWSYNRNZ.js";
260
266
  import {
261
267
  DeterministicEndpointExecutor,
@@ -269,8 +275,8 @@ import {
269
275
  performInference
270
276
  } from "./chunk-GCTQY24J.js";
271
277
  import "./chunk-IN3WRHXE.js";
272
- import "./chunk-LV55WKZR.js";
273
278
  import "./chunk-UU6M3L3O.js";
279
+ import "./chunk-LV55WKZR.js";
274
280
  import "./chunk-WVDSMTW3.js";
275
281
  import {
276
282
  FailoverExecutionEngine,
@@ -279,11 +285,7 @@ import {
279
285
  failoverExecutionEngine,
280
286
  healthCheckService,
281
287
  metricsLogger
282
- } from "./chunk-YAAGIU2H.js";
283
- import {
284
- AIProviderService,
285
- aiProviderService
286
- } from "./chunk-SLR6SIEU.js";
288
+ } from "./chunk-PT6J6UEU.js";
287
289
  import {
288
290
  EndpointRefresher,
289
291
  ModelCatalogService,
@@ -300,6 +302,10 @@ import {
300
302
  keysStorage,
301
303
  validateApiKey
302
304
  } from "./chunk-P7H6TIEA.js";
305
+ import {
306
+ AIProviderService,
307
+ aiProviderService
308
+ } from "./chunk-SLR6SIEU.js";
303
309
  import {
304
310
  AITransportClient
305
311
  } from "./chunk-MAMK4GDH.js";
@@ -4500,6 +4506,9 @@ export {
4500
4506
  PROVIDERS_META,
4501
4507
  PROVIDER_COLORS,
4502
4508
  PasswordHasher,
4509
+ PlaywrightInspectionRuntime,
4510
+ PlaywrightInspectionServiceDefinition,
4511
+ PlaywrightInspectionServiceFacade,
4503
4512
  RateLimiter,
4504
4513
  RemoteExecutor,
4505
4514
  RemoteWorkspaceService,
@@ -4551,6 +4560,7 @@ export {
4551
4560
  b2UploadFile,
4552
4561
  buildProjectObservability,
4553
4562
  buildProjectsList,
4563
+ captureDevelopmentProcess,
4554
4564
  classifyAndFormatError,
4555
4565
  cleanDbUrl,
4556
4566
  codeDiagnosticsService,
@@ -4689,6 +4699,7 @@ export {
4689
4699
  modelHealthService,
4690
4700
  nodeGraphPersistence,
4691
4701
  normalizeBackblazeCredentials,
4702
+ parseDevelopmentDiagnostics,
4692
4703
  parseErrorJson,
4693
4704
  parseGraphJsonFile,
4694
4705
  pauseCloudflarePagesProject,
@@ -4710,6 +4721,7 @@ export {
4710
4721
  resolveSystemDatabaseClusterNodes,
4711
4722
  resolveSystemDatabaseUrl,
4712
4723
  resolveUserFromToken,
4724
+ resolveWebContainerCommand,
4713
4725
  resolveWorkspaceConnection,
4714
4726
  resolveWorkspaceDir,
4715
4727
  resumeCloudflarePagesProject,
@@ -11,14 +11,14 @@ import {
11
11
  AIRoutingServiceFacade,
12
12
  AIToolServiceDefinition,
13
13
  AIToolServiceFacade
14
- } from "./chunk-SJD574XG.js";
14
+ } from "./chunk-OB65KZ2M.js";
15
15
  import "./chunk-U4HUGPRH.js";
16
16
  import "./chunk-MWSYNRNZ.js";
17
17
  import "./chunk-GCTQY24J.js";
18
- import "./chunk-YAAGIU2H.js";
19
- import "./chunk-SLR6SIEU.js";
18
+ import "./chunk-PT6J6UEU.js";
20
19
  import "./chunk-LMWXONZG.js";
21
20
  import "./chunk-P7H6TIEA.js";
21
+ import "./chunk-SLR6SIEU.js";
22
22
  import "./chunk-MAMK4GDH.js";
23
23
  import "./chunk-JSQZAFBU.js";
24
24
  import "./chunk-QGM4M3NI.js";
@@ -31,16 +31,16 @@ import {
31
31
  krnlWorkspaceGraphServiceFacade,
32
32
  krnlWorkspaceServiceDefinition,
33
33
  krnlWorkspaceServiceFacade
34
- } from "./chunk-NB2X3HEX.js";
34
+ } from "./chunk-VTU6CNZD.js";
35
35
  import "./chunk-XHADDA75.js";
36
36
  import "./chunk-4QEMALXF.js";
37
37
  import "./chunk-FZKBTF34.js";
38
- import "./chunk-WTBAG4AV.js";
39
- import "./chunk-47IVAXPJ.js";
38
+ import "./chunk-2HCQ2SIR.js";
39
+ import "./chunk-IGZB4RYT.js";
40
40
  import "./chunk-SHZAQTIT.js";
41
- import "./chunk-VN2YMZJO.js";
42
- import "./chunk-VAFCR2MS.js";
41
+ import "./chunk-JGUWYVOL.js";
43
42
  import "./chunk-KKRWZDMN.js";
43
+ import "./chunk-JCMB7BIM.js";
44
44
  import "./chunk-MWSYNRNZ.js";
45
45
  import "./chunk-QGM4M3NI.js";
46
46
  export {
@@ -14,11 +14,11 @@ import {
14
14
  } from "../chunk-B3VJ4HDV.js";
15
15
  import {
16
16
  workspaceGraphService
17
- } from "../chunk-47IVAXPJ.js";
17
+ } from "../chunk-IGZB4RYT.js";
18
18
  import "../chunk-SHZAQTIT.js";
19
- import "../chunk-VN2YMZJO.js";
20
- import "../chunk-VAFCR2MS.js";
19
+ import "../chunk-JGUWYVOL.js";
21
20
  import "../chunk-KKRWZDMN.js";
21
+ import "../chunk-JCMB7BIM.js";
22
22
  import "../chunk-MWSYNRNZ.js";
23
23
  import "../chunk-QGM4M3NI.js";
24
24
  export {
@@ -10,14 +10,14 @@ import {
10
10
  srklService,
11
11
  syncSrklAccounts,
12
12
  useSrklServices
13
- } from "../chunk-3IUA66RS.js";
13
+ } from "../chunk-HF5SGQ5V.js";
14
14
  import {
15
15
  getPrimarySrklDeploymentUrl,
16
16
  getSrklAccounts,
17
17
  srklListBackblazeBuckets
18
18
  } from "../chunk-XHADDA75.js";
19
19
  import "../chunk-4QEMALXF.js";
20
- import "../chunk-VAFCR2MS.js";
20
+ import "../chunk-JCMB7BIM.js";
21
21
  import "../chunk-QGM4M3NI.js";
22
22
  export {
23
23
  CANONICAL_SRKL_URL,
@@ -6,14 +6,14 @@ import {
6
6
  WorkspaceFS,
7
7
  remoteWorkspaceService,
8
8
  workingWorkspaceService
9
- } from "../chunk-6DNGLKAV.js";
9
+ } from "../chunk-WQ4XZY4L.js";
10
10
  import {
11
11
  formatCanonicalWorkspaceFolderName,
12
12
  sanitizeWorkspaceName
13
13
  } from "../chunk-FZKBTF34.js";
14
- import "../chunk-VN2YMZJO.js";
15
- import "../chunk-VAFCR2MS.js";
14
+ import "../chunk-JGUWYVOL.js";
16
15
  import "../chunk-KKRWZDMN.js";
16
+ import "../chunk-JCMB7BIM.js";
17
17
  import "../chunk-QGM4M3NI.js";
18
18
  export {
19
19
  RemoteWorkspaceService,
@@ -110,7 +110,7 @@
110
110
  }
111
111
  },
112
112
  "scripts": {
113
- "build": "tsup src/index.ts src/krnl-services.ts src/krnl-ai-services.ts src/services/index.ts src/auth/index.ts src/storage/index.ts src/workspace/index.ts src/control-plane/index.ts src/api/index.ts src/connectivity/index.ts src/client/index.ts src/srkl/index.ts src/development/index.ts src/ai-provider/index.ts src/ai-inference/index.ts src/ai-models/index.ts src/ai-routing/index.ts src/ai-keys/index.ts src/ai-tools/index.ts --format esm --dts --clean --external @kloks/functions --external react --external @kloks/state-graph --external @neondatabase/serverless --external @supabase/supabase-js --external @aws-sdk/client-s3 --external @aws-sdk/lib-storage --external bcryptjs --external better-sqlite3 --external zod --external ws --external @webcontainer/api",
113
+ "build": "tsup src/index.ts src/krnl-services.ts src/krnl-ai-services.ts src/services/index.ts src/auth/index.ts src/storage/index.ts src/workspace/index.ts src/control-plane/index.ts src/api/index.ts src/connectivity/index.ts src/client/index.ts src/srkl/index.ts src/development/index.ts src/ai-provider/index.ts src/ai-inference/index.ts src/ai-models/index.ts src/ai-routing/index.ts src/ai-keys/index.ts src/ai-tools/index.ts --format esm --dts --clean --external @kloks/functions --external react --external @kloks/state-graph --external @neondatabase/serverless --external @supabase/supabase-js --external @aws-sdk/client-s3 --external @aws-sdk/lib-storage --external bcryptjs --external better-sqlite3 --external zod --external ws --external @webcontainer/api --external playwright",
114
114
  "typecheck": "tsc --noEmit",
115
115
  "clean": "rm -rf dist"
116
116
  },
@@ -1,6 +1,3 @@
1
- import {
2
- aiProviderService
3
- } from "./chunk-SLR6SIEU.js";
4
1
  import {
5
2
  modelCatalog,
6
3
  modelHealthService
@@ -8,6 +5,9 @@ import {
8
5
  import {
9
6
  keyStore
10
7
  } from "./chunk-P7H6TIEA.js";
8
+ import {
9
+ aiProviderService
10
+ } from "./chunk-SLR6SIEU.js";
11
11
 
12
12
  // src/ai-routing/metricsLogger.ts
13
13
  var MetricsLogger = class {