@ultrst-armada/kloks 1.24.4 → 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 (60) 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 +652 -30
  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 -57
  32. package/packages/backend/dist/index.js +44 -188
  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 +25 -25
  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-FJ5LZFBV.js +0 -667
  56. package/packages/backend/dist/chunk-MWSYNRNZ.js +0 -871
  57. package/packages/backend/dist/chunk-QGM4M3NI.js +0 -37
  58. package/packages/backend/dist/dist-XMSSRYDR.js +0 -899
  59. package/packages/backend/dist/transformers.node-HWHOAE4H.js +0 -43879
  60. 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;