@ultrst-armada/kloks 2.0.3 → 2.0.5

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 (81) hide show
  1. package/package.json +6 -1
  2. package/packages/backend/dist/api/index.js +2 -1
  3. package/packages/backend/dist/{chunk-5F5V7NAG.js → chunk-5Y7K7HAT.js} +4 -1
  4. package/packages/backend/dist/{chunk-SQKG3S6P.js → chunk-AUNIGE6Q.js} +2 -2
  5. package/packages/backend/dist/chunk-BRNWUIH5.js +197 -0
  6. package/packages/backend/dist/{chunk-NY2SQOXI.js → chunk-CDRHYO44.js} +4 -1
  7. package/packages/backend/dist/{chunk-ZBNSK26X.js → chunk-CV55JMT7.js} +6 -5
  8. package/packages/backend/dist/{chunk-OWMQLML7.js → chunk-EMSSTOOK.js} +33 -2
  9. package/packages/backend/dist/chunk-FSOOAU6G.js +1132 -0
  10. package/packages/backend/dist/chunk-GVMVYC6C.js +0 -0
  11. package/packages/backend/dist/chunk-I6T64MLT.js +171 -0
  12. package/packages/backend/dist/chunk-ICVDGH2I.js +889 -0
  13. package/packages/backend/dist/chunk-IP6XWQU2.js +48 -0
  14. package/packages/backend/dist/chunk-IRNQXVYA.js +746 -0
  15. package/packages/backend/dist/{chunk-POLVHTHJ.js → chunk-KCPQWJBO.js} +4 -1
  16. package/packages/backend/dist/chunk-LC6ULEM2.js +125 -0
  17. package/packages/backend/dist/{chunk-NTKUQVCQ.js → chunk-LMUMMVTU.js} +14 -2
  18. package/packages/backend/dist/chunk-LMY6MGFD.js +78 -0
  19. package/packages/backend/dist/{chunk-OQRQCDS6.js → chunk-TRJVVNO7.js} +2 -2
  20. package/packages/backend/dist/{chunk-KPLDYX5Z.js → chunk-TRP76UR2.js} +33 -26
  21. package/packages/backend/dist/{chunk-FK3OAUXM.js → chunk-WYEVA4RC.js} +4 -2
  22. package/packages/backend/dist/{chunk-Z6G32NQQ.js → chunk-XKUWLO2M.js} +12 -9
  23. package/packages/backend/dist/{chunk-OXEP3AP6.js → chunk-Z2CT2MJ2.js} +158 -1
  24. package/packages/backend/dist/control-plane/index.js +3 -1
  25. package/packages/backend/dist/core/b2DirectCore.test.d.ts +1 -0
  26. package/packages/backend/dist/core/cloudflareIntegrationCore.test.d.ts +1 -0
  27. package/packages/backend/dist/core/googleDriveOAuthCore.d.ts +51 -0
  28. package/packages/backend/dist/core/googleDriveOAuthCore.test.d.ts +1 -0
  29. package/packages/backend/dist/core/index.d.ts +3 -0
  30. package/packages/backend/dist/core/storageConnectionCore.d.ts +136 -0
  31. package/packages/backend/dist/core/storageConnectionCore.test.d.ts +1 -0
  32. package/packages/backend/dist/core/storageConnectionRuntimeCore.d.ts +57 -0
  33. package/packages/backend/dist/core/storageConnectionRuntimeCore.test.d.ts +1 -0
  34. package/packages/backend/dist/core/storageContracts.d.ts +77 -0
  35. package/packages/backend/dist/core/storageProviderRegistry.d.ts +7 -0
  36. package/packages/backend/dist/core/systemCredentialsCore.d.ts +46 -0
  37. package/packages/backend/dist/core/unifiedDb.d.ts +12 -2
  38. package/packages/backend/dist/core/unifiedDb.errors.test.d.ts +1 -0
  39. package/packages/backend/dist/core/unifiedDbNodeAdapter.d.ts +6 -0
  40. package/packages/backend/dist/core/workspaceBucketSyncCore.d.ts +3 -4
  41. package/packages/backend/dist/core/workspaceBucketSyncCore.test.d.ts +1 -0
  42. package/packages/backend/dist/core/workspaceCore.d.ts +25 -6
  43. package/packages/backend/dist/core/workspaceDataCore.test.d.ts +1 -0
  44. package/packages/backend/dist/core/workspaceFileCore.d.ts +25 -7
  45. package/packages/backend/dist/core/workspaceFileCore.test.d.ts +1 -0
  46. package/packages/backend/dist/core/workspaceFileNodeAdapter.d.ts +6 -0
  47. package/packages/backend/dist/core/workspaceStorageDetailsCore.d.ts +4 -8
  48. package/packages/backend/dist/core/workspaceStorageDetailsCore.test.d.ts +1 -0
  49. package/packages/backend/dist/development/index.js +1 -1
  50. package/packages/backend/dist/development/playwrightInspectionService.js +1 -1
  51. package/packages/backend/dist/development/playwrightInspectionSupport.d.ts +1 -0
  52. package/packages/backend/dist/index.js +22 -16
  53. package/packages/backend/dist/krnl-services.d.ts +0 -22
  54. package/packages/backend/dist/krnl-services.js +8 -19
  55. package/packages/backend/dist/krnl-services.node.d.ts +28 -0
  56. package/packages/backend/dist/node.d.ts +3 -0
  57. package/packages/backend/dist/node.js +645 -463
  58. package/packages/backend/dist/resolver/index.js +13 -0
  59. package/packages/backend/dist/resolver/systemDatabaseUrl.d.ts +16 -12
  60. package/packages/backend/dist/services/node.js +12 -10
  61. package/packages/backend/dist/srkl/index.js +6 -4
  62. package/packages/backend/dist/storage/B2DirectClient.d.ts +7 -13
  63. package/packages/backend/dist/storage/B2DirectClient.test.d.ts +1 -0
  64. package/packages/backend/dist/storage/GoogleDriveWorkspaceService.d.ts +5 -0
  65. package/packages/backend/dist/storage/index.js +4 -3
  66. package/packages/backend/dist/storage/node.js +7 -6
  67. package/packages/backend/dist/storage-workspace.js +1 -1
  68. package/packages/backend/dist/workspace/index.js +2 -1
  69. package/packages/backend/dist/workspace/node.js +12 -7
  70. package/packages/backend/dist/workspaceFileCore-UURQPP62.js +28 -0
  71. package/packages/backend/package.json +8 -3
  72. package/packages/services/dist/index.js +8 -2
  73. package/packages/state-graph/dist/browser.js +16 -16
  74. package/packages/state-graph/dist/index.js +16 -16
  75. package/packages/backend/dist/chunk-4QEMALXF.js +0 -90
  76. package/packages/backend/dist/chunk-AOZSDRNY.js +0 -159
  77. package/packages/backend/dist/chunk-GYSZ6CAX.js +0 -19
  78. package/packages/backend/dist/chunk-JCMB7BIM.js +0 -211
  79. package/packages/backend/dist/chunk-JGUWYVOL.js +0 -570
  80. package/packages/backend/dist/chunk-LMOM7CST.js +0 -427
  81. package/packages/state-graph/dist/{chunk-UKTICGGV.js → chunk-YUJC367F.js} +3 -3
@@ -0,0 +1,13 @@
1
+ import "../chunk-GVMVYC6C.js";
2
+ import {
3
+ normalizeSystemEnvironment,
4
+ resolveSystemDatabaseUrl,
5
+ resolveSystemDatabaseUrlCandidates,
6
+ tryResolveSystemDatabaseUrl
7
+ } from "../chunk-IP6XWQU2.js";
8
+ export {
9
+ normalizeSystemEnvironment,
10
+ resolveSystemDatabaseUrl,
11
+ resolveSystemDatabaseUrlCandidates,
12
+ tryResolveSystemDatabaseUrl
13
+ };
@@ -1,18 +1,22 @@
1
1
  /**
2
2
  * @file systemDatabaseUrl.ts
3
- * @description Centralized SYSTEM_DATABASE_URL resolver adhering to SKIPO Invariant §16.
4
- * Precedence: SYSTEM_DATABASE_URL_1 (primary) > SYSTEM_DATABASE_URL_2 (fallback #1) > SYSTEM_DATABASE_URL_3 (fallback #2).
5
- * Strictly forbids fallback to generic DATABASE_URL.
6
- */
7
- /**
8
- * Resolves the active system database URL following the strict 1 -> 2 -> 3 precedence.
9
- * Throws a deterministic descriptive error if no system database URL is configured.
3
+ * @description The canonical system database URL contract for all runtime targets.
10
4
  *
11
- * @param env - Environment record (defaults to process.env in Node runtime)
12
- * @returns Validated system database connection string
5
+ * SYSTEM_DATABASE_URL is the primary and required deployment binding.
6
+ * SYSTEM_DATABASE_URL_2 and SYSTEM_DATABASE_URL_3 are ordered failover URLs.
7
+ * Generic DATABASE_URL and the retired SYSTEM_DATABASE_URL_1 alias are not accepted.
13
8
  */
14
- export declare function resolveSystemDatabaseUrl(env?: Record<string, string | undefined>): string;
9
+ export type SystemDatabaseEnvironment = Record<string, unknown>;
10
+ /** Return unique configured URLs in primary-then-fallback order. */
11
+ export declare function resolveSystemDatabaseUrlCandidates(env?: SystemDatabaseEnvironment): string[];
12
+ /** Resolve the primary system database URL, followed by the supported failover URLs. */
13
+ export declare function tryResolveSystemDatabaseUrl(env?: SystemDatabaseEnvironment): string | null;
14
+ /** Resolve the configured system database or return a deterministic configuration error. */
15
+ export declare function resolveSystemDatabaseUrl(env?: SystemDatabaseEnvironment): string;
15
16
  /**
16
- * Safe version that returns null instead of throwing if unconfigured.
17
+ * Normalize the canonical system bindings at a Fetch entrypoint boundary.
18
+ * This helper is intentionally runtime-neutral: Node callers pass their
19
+ * environment explicitly; Workers pass platform bindings. It copies only
20
+ * system-owned configuration keys and preserves application-provided bindings.
17
21
  */
18
- export declare function tryResolveSystemDatabaseUrl(env?: Record<string, string | undefined>): string | null;
22
+ export declare function normalizeSystemEnvironment<T extends Record<string, unknown>>(env?: T, runtimeEnvironment?: Record<string, unknown>, requestUrl?: string): T & Record<string, unknown>;
@@ -10,18 +10,20 @@ import {
10
10
  exportGraphAsJsonFile,
11
11
  nodeGraphPersistence,
12
12
  parseGraphJsonFile,
13
- validateGraphDocument
14
- } from "../chunk-OXEP3AP6.js";
15
- import {
13
+ validateGraphDocument,
16
14
  workspaceGraphService
17
- } from "../chunk-AOZSDRNY.js";
18
- import "../chunk-SQKG3S6P.js";
19
- import "../chunk-JGUWYVOL.js";
20
- import "../chunk-OQRQCDS6.js";
21
- import "../chunk-JCMB7BIM.js";
15
+ } from "../chunk-Z2CT2MJ2.js";
16
+ import "../chunk-AUNIGE6Q.js";
17
+ import "../chunk-TRJVVNO7.js";
22
18
  import "../chunk-HUY4272L.js";
23
- import "../chunk-5F5V7NAG.js";
24
- import "../chunk-OWMQLML7.js";
19
+ import "../chunk-5Y7K7HAT.js";
20
+ import "../chunk-LMY6MGFD.js";
21
+ import "../chunk-IRNQXVYA.js";
22
+ import "../chunk-BRNWUIH5.js";
23
+ import "../chunk-FSOOAU6G.js";
24
+ import "../chunk-I6T64MLT.js";
25
+ import "../chunk-IP6XWQU2.js";
26
+ import "../chunk-EMSSTOOK.js";
25
27
  export {
26
28
  CompositeBackend,
27
29
  EndpointGenerator,
@@ -10,14 +10,16 @@ import {
10
10
  srklService,
11
11
  syncSrklAccounts,
12
12
  useSrklServices
13
- } from "../chunk-FK3OAUXM.js";
13
+ } from "../chunk-WYEVA4RC.js";
14
14
  import {
15
15
  getPrimarySrklDeploymentUrl,
16
16
  getSrklAccounts,
17
17
  srklListBackblazeBuckets
18
- } from "../chunk-KPLDYX5Z.js";
19
- import "../chunk-JCMB7BIM.js";
20
- import "../chunk-4QEMALXF.js";
18
+ } from "../chunk-TRP76UR2.js";
19
+ import "../chunk-FSOOAU6G.js";
20
+ import "../chunk-I6T64MLT.js";
21
+ import "../chunk-IP6XWQU2.js";
22
+ import "../chunk-EMSSTOOK.js";
21
23
  export {
22
24
  CANONICAL_SRKL_URL,
23
25
  SrklClient,
@@ -1,16 +1,10 @@
1
1
  /**
2
- * @file B2DirectClient.ts
3
- * @description Zero-dependency Web Standard Fetch client for Backblaze B2 Direct REST API.
4
- * Identical across Node.js, Vercel Serverless, and Cloudflare Workers (< 200 lines).
2
+ * Backward-compatible storage-layer entrypoint for the canonical B2 client.
3
+ * All provider behavior lives in core/b2DirectCore so connection discovery
4
+ * and workspace file operations share the same authorization and error rules.
5
5
  */
6
- export interface B2AuthToken {
7
- authorizationToken: string;
8
- apiUrl: string;
9
- downloadUrl: string;
10
- accountId: string;
11
- }
12
- export declare function authorizeB2(keyId: string, applicationKey: string): Promise<B2AuthToken>;
13
- export declare function b2ListBuckets(keyId: string, applicationKey: string): Promise<any[]>;
14
- export declare function b2ListFileNames(keyId: string, applicationKey: string, bucketName: string, prefix?: string): Promise<any[]>;
6
+ import { authorizeB2, b2ListBuckets, b2ListFileNames, b2DownloadFile } from '../core/b2DirectCore.js';
7
+ export { authorizeB2, b2ListBuckets, b2ListFileNames, b2DownloadFile };
8
+ export type { B2AuthData as B2AuthToken } from '../core/b2DirectCore.js';
9
+ /** Preserve the legacy string-or-byte payload contract. */
15
10
  export declare function b2UploadFile(keyId: string, applicationKey: string, bucketName: string, fileName: string, content: Uint8Array | string, contentType?: string): Promise<any>;
16
- export declare function b2DownloadFile(keyId: string, applicationKey: string, bucketName: string, fileName: string): Promise<Uint8Array | null>;
@@ -66,6 +66,11 @@ export declare class GoogleDriveWorkspaceService {
66
66
  accountId: string;
67
67
  email?: string;
68
68
  }>;
69
+ /**
70
+ * Folder browsing is always rooted at the persisted workspace root. A caller
71
+ * may browse a descendant, but cannot supply an unrelated Drive folder ID.
72
+ */
73
+ assertFolderWithinRoot(folderId: string): Promise<void>;
69
74
  listFolders(parentFolderId?: string): Promise<GoogleDriveWorkspaceFolder[]>;
70
75
  resolveFolder(folderId: string): Promise<GoogleDriveWorkspaceFolder>;
71
76
  selectRootFolder(folderId: string): Promise<GoogleDriveWorkspaceFolder>;
@@ -6,14 +6,15 @@ import {
6
6
  } from "../chunk-HUY4272L.js";
7
7
  import {
8
8
  BaseStorageAdapter
9
- } from "../chunk-5F5V7NAG.js";
9
+ } from "../chunk-5Y7K7HAT.js";
10
+ import "../chunk-LMY6MGFD.js";
10
11
  import {
11
12
  authorizeB2,
12
13
  b2DownloadFile,
13
14
  b2ListBuckets,
14
15
  b2ListFileNames,
15
- b2UploadFile
16
- } from "../chunk-4QEMALXF.js";
16
+ b2UploadFile2 as b2UploadFile
17
+ } from "../chunk-I6T64MLT.js";
17
18
  export {
18
19
  BaseStorageAdapter,
19
20
  authorizeB2,
@@ -10,10 +10,10 @@ import {
10
10
  permanentDeleteS3Folder,
11
11
  permanentDeleteS3Object,
12
12
  renameS3Folder
13
- } from "../chunk-SQKG3S6P.js";
13
+ } from "../chunk-AUNIGE6Q.js";
14
14
  import {
15
15
  GoogleDriveStorageService
16
- } from "../chunk-OQRQCDS6.js";
16
+ } from "../chunk-TRJVVNO7.js";
17
17
  import {
18
18
  isSecretMasked,
19
19
  normalizeBackblazeCredentials,
@@ -21,15 +21,16 @@ import {
21
21
  } from "../chunk-HUY4272L.js";
22
22
  import {
23
23
  BaseStorageAdapter
24
- } from "../chunk-5F5V7NAG.js";
24
+ } from "../chunk-5Y7K7HAT.js";
25
+ import "../chunk-LMY6MGFD.js";
25
26
  import {
26
27
  authorizeB2,
27
28
  b2DownloadFile,
28
29
  b2ListBuckets,
29
30
  b2ListFileNames,
30
- b2UploadFile
31
- } from "../chunk-4QEMALXF.js";
32
- import "../chunk-OWMQLML7.js";
31
+ b2UploadFile2 as b2UploadFile
32
+ } from "../chunk-I6T64MLT.js";
33
+ import "../chunk-EMSSTOOK.js";
33
34
  export {
34
35
  BackblazeB2Adapter,
35
36
  BaseStorageAdapter,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  GOOGLE_DRIVE_WORKSPACE_SCOPE,
3
3
  GoogleDriveWorkspaceService
4
- } from "./chunk-OWMQLML7.js";
4
+ } from "./chunk-EMSSTOOK.js";
5
5
  export {
6
6
  GOOGLE_DRIVE_WORKSPACE_SCOPE,
7
7
  GoogleDriveWorkspaceService
@@ -1,7 +1,8 @@
1
1
  import "../chunk-RABSY2JU.js";
2
2
  import {
3
3
  WorkspaceCloneSyncEngine
4
- } from "../chunk-NY2SQOXI.js";
4
+ } from "../chunk-CDRHYO44.js";
5
+ import "../chunk-LMY6MGFD.js";
5
6
  export {
6
7
  WorkspaceCloneSyncEngine
7
8
  };
@@ -5,19 +5,24 @@ import {
5
5
  WorkspaceFS,
6
6
  remoteWorkspaceService,
7
7
  workingWorkspaceService
8
- } from "../chunk-Z6G32NQQ.js";
8
+ } from "../chunk-XKUWLO2M.js";
9
+ import "../chunk-TRJVVNO7.js";
10
+ import "../chunk-LC6ULEM2.js";
9
11
  import {
10
12
  WorkspaceCloneSyncEngine
11
- } from "../chunk-NY2SQOXI.js";
13
+ } from "../chunk-CDRHYO44.js";
14
+ import "../chunk-5Y7K7HAT.js";
15
+ import "../chunk-LMY6MGFD.js";
12
16
  import {
13
17
  formatCanonicalWorkspaceFolderName,
14
18
  sanitizeWorkspaceName
15
19
  } from "../chunk-FZKBTF34.js";
16
- import "../chunk-JGUWYVOL.js";
17
- import "../chunk-OQRQCDS6.js";
18
- import "../chunk-JCMB7BIM.js";
19
- import "../chunk-5F5V7NAG.js";
20
- import "../chunk-OWMQLML7.js";
20
+ import "../chunk-IRNQXVYA.js";
21
+ import "../chunk-BRNWUIH5.js";
22
+ import "../chunk-FSOOAU6G.js";
23
+ import "../chunk-I6T64MLT.js";
24
+ import "../chunk-IP6XWQU2.js";
25
+ import "../chunk-EMSSTOOK.js";
21
26
  export {
22
27
  RemoteWorkspaceService,
23
28
  SyncEngine,
@@ -0,0 +1,28 @@
1
+ import {
2
+ configureLocalWorkspaceFileAdapter,
3
+ deleteWorkspaceFile,
4
+ deleteWorkspaceFolder,
5
+ getWorkspaceFolderPrefix,
6
+ isB2Workspace,
7
+ isGoogleDriveWorkspace,
8
+ listWorkspaceFiles,
9
+ normalizeWorkspaceStoragePath,
10
+ readWorkspaceFile,
11
+ writeWorkspaceFile
12
+ } from "./chunk-BRNWUIH5.js";
13
+ import "./chunk-FSOOAU6G.js";
14
+ import "./chunk-I6T64MLT.js";
15
+ import "./chunk-IP6XWQU2.js";
16
+ import "./chunk-EMSSTOOK.js";
17
+ export {
18
+ configureLocalWorkspaceFileAdapter,
19
+ deleteWorkspaceFile,
20
+ deleteWorkspaceFolder,
21
+ getWorkspaceFolderPrefix,
22
+ isB2Workspace,
23
+ isGoogleDriveWorkspace,
24
+ listWorkspaceFiles,
25
+ normalizeWorkspaceStoragePath,
26
+ readWorkspaceFile,
27
+ writeWorkspaceFile
28
+ };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kloks/backend",
3
- "version": "1.2.0",
4
- "description": "Kloks Backend Services \u2014 Auth, Storage, Workspace, Control Plane, API, Connectivity & Execution built on KrnlTS",
3
+ "version": "1.2.1",
4
+ "description": "Kloks Backend Services — Auth, Storage, Workspace, Control Plane, API, Connectivity & Execution built on KrnlTS",
5
5
  "type": "module",
6
6
  "private": false,
7
7
  "publishConfig": {
@@ -58,6 +58,11 @@
58
58
  "types": "./dist/srkl/index.d.ts",
59
59
  "default": "./dist/srkl/index.js"
60
60
  },
61
+ "./resolver": {
62
+ "import": "./dist/resolver/index.js",
63
+ "types": "./dist/resolver/index.d.ts",
64
+ "default": "./dist/resolver/index.js"
65
+ },
61
66
  "./services": {
62
67
  "import": "./dist/services/index.js",
63
68
  "types": "./dist/services/index.d.ts",
@@ -140,7 +145,7 @@
140
145
  }
141
146
  },
142
147
  "scripts": {
143
- "build": "tsup src/index.ts src/node.ts src/storage/node.ts src/services/node.ts src/workspace/node.ts src/krnl-services.ts src/krnl-ai-services.ts src/services/index.ts src/auth/index.ts src/storage/index.ts src/storage-workspace.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/development/webContainerService.ts src/development/webContainerRuntime.ts src/development/playwrightInspectionService.ts src/development/playwrightInspectionTypes.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 --clean --external @kloks/wasm-runtime --external react --external @kloks/state-graph --external @neondatabase/serverless --external @supabase/supabase-js --external @aws-sdk/client-s3 --external @aws-sdk/lib-storage --external zod --external ws --external @webcontainer/api --external playwright --external @dinilmusick/gutts && tsc --emitDeclarationOnly --declaration --project tsconfig.json && tsup src/development/client.ts --format esm --dts --out-dir dist/development --splitting false --platform browser --external @ultrst-armada/krnl",
148
+ "build": "tsup src/index.ts src/node.ts src/storage/node.ts src/services/node.ts src/workspace/node.ts src/krnl-services.ts src/krnl-ai-services.ts src/resolver/index.ts src/services/index.ts src/auth/index.ts src/storage/index.ts src/storage-workspace.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/development/webContainerService.ts src/development/webContainerRuntime.ts src/development/playwrightInspectionService.ts src/development/playwrightInspectionTypes.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 --clean --external @kloks/wasm-runtime --external react --external @kloks/state-graph --external @neondatabase/serverless --external @supabase/supabase-js --external @aws-sdk/client-s3 --external @aws-sdk/lib-storage --external zod --external ws --external @webcontainer/api --external playwright --external @dinilmusick/gutts && tsc --emitDeclarationOnly --declaration --project tsconfig.json && tsup src/development/client.ts --format esm --dts --out-dir dist/development --splitting false --platform browser --external @ultrst-armada/krnl",
144
149
  "typecheck": "tsc --noEmit",
145
150
  "clean": "rm -rf dist"
146
151
  },
@@ -2947,14 +2947,20 @@ var GitHubVcsProvider = class {
2947
2947
 
2948
2948
  // src/engineering/local-execution-provider.ts
2949
2949
  import { spawn } from "child_process";
2950
+ function buildExecutionEnvironment(explicit = {}) {
2951
+ return {
2952
+ PATH: process.env.PATH || "/usr/local/bin:/usr/bin:/bin",
2953
+ ...explicit
2954
+ };
2955
+ }
2950
2956
  var LocalExecutionProvider = class {
2951
2957
  id = "local";
2952
2958
  async execute(request) {
2953
2959
  const executionId = crypto.randomUUID();
2954
2960
  return new Promise((resolve) => {
2955
- const child = spawn("sh", ["-lc", request.command], {
2961
+ const child = spawn("sh", ["-c", request.command], {
2956
2962
  cwd: request.cwd,
2957
- env: { ...process.env, ...request.environment ?? {} }
2963
+ env: buildExecutionEnvironment(request.environment)
2958
2964
  });
2959
2965
  let stdout = "";
2960
2966
  let stderr = "";
@@ -252,7 +252,7 @@ import {
252
252
  validateProjectGraph,
253
253
  validateUniversalConnection,
254
254
  zoomAtPoint
255
- } from "./chunk-UKTICGGV.js";
255
+ } from "./chunk-YUJC367F.js";
256
256
  import {
257
257
  BaseHandle,
258
258
  DataHandle,
@@ -262,6 +262,21 @@ import {
262
262
  instantiateSubgraph
263
263
  } from "./chunk-OXUDG6HE.js";
264
264
  import "./chunk-RHRXPY2U.js";
265
+ import {
266
+ AttractionEngine,
267
+ GhostInferenceEngine,
268
+ GhostLayoutResolver,
269
+ GhostTracePathBuilder,
270
+ calculateSocketCoordinates,
271
+ getBeamPoints,
272
+ useMagneticTraces
273
+ } from "./chunk-JXDJZSFW.js";
274
+ import {
275
+ ConnectionRuleStore,
276
+ HandleTypeRegistry,
277
+ WireTypeRegistry,
278
+ initializeDefaultGraphRules
279
+ } from "./chunk-TZOL3RN7.js";
265
280
  import {
266
281
  LifecycleCycleError,
267
282
  LifecycleGraph,
@@ -285,21 +300,6 @@ import {
285
300
  CustomViewWindow,
286
301
  DEFAULT_GRAPH_SETTINGS
287
302
  } from "./chunk-5KP74NMF.js";
288
- import {
289
- AttractionEngine,
290
- GhostInferenceEngine,
291
- GhostLayoutResolver,
292
- GhostTracePathBuilder,
293
- calculateSocketCoordinates,
294
- getBeamPoints,
295
- useMagneticTraces
296
- } from "./chunk-JXDJZSFW.js";
297
- import {
298
- ConnectionRuleStore,
299
- HandleTypeRegistry,
300
- WireTypeRegistry,
301
- initializeDefaultGraphRules
302
- } from "./chunk-TZOL3RN7.js";
303
303
  import {
304
304
  AutoSolidify,
305
305
  SpatialEngine,
@@ -252,7 +252,7 @@ import {
252
252
  validateProjectGraph,
253
253
  validateUniversalConnection,
254
254
  zoomAtPoint
255
- } from "./chunk-UKTICGGV.js";
255
+ } from "./chunk-YUJC367F.js";
256
256
  import {
257
257
  BaseHandle,
258
258
  DataHandle,
@@ -262,6 +262,21 @@ import {
262
262
  instantiateSubgraph
263
263
  } from "./chunk-OXUDG6HE.js";
264
264
  import "./chunk-RHRXPY2U.js";
265
+ import {
266
+ AttractionEngine,
267
+ GhostInferenceEngine,
268
+ GhostLayoutResolver,
269
+ GhostTracePathBuilder,
270
+ calculateSocketCoordinates,
271
+ getBeamPoints,
272
+ useMagneticTraces
273
+ } from "./chunk-JXDJZSFW.js";
274
+ import {
275
+ ConnectionRuleStore,
276
+ HandleTypeRegistry,
277
+ WireTypeRegistry,
278
+ initializeDefaultGraphRules
279
+ } from "./chunk-TZOL3RN7.js";
265
280
  import {
266
281
  LifecycleCycleError,
267
282
  LifecycleGraph,
@@ -285,21 +300,6 @@ import {
285
300
  CustomViewWindow,
286
301
  DEFAULT_GRAPH_SETTINGS
287
302
  } from "./chunk-5KP74NMF.js";
288
- import {
289
- AttractionEngine,
290
- GhostInferenceEngine,
291
- GhostLayoutResolver,
292
- GhostTracePathBuilder,
293
- calculateSocketCoordinates,
294
- getBeamPoints,
295
- useMagneticTraces
296
- } from "./chunk-JXDJZSFW.js";
297
- import {
298
- ConnectionRuleStore,
299
- HandleTypeRegistry,
300
- WireTypeRegistry,
301
- initializeDefaultGraphRules
302
- } from "./chunk-TZOL3RN7.js";
303
303
  import {
304
304
  AutoSolidify,
305
305
  SpatialEngine,
@@ -1,90 +0,0 @@
1
- // src/storage/B2DirectClient.ts
2
- var authCache = /* @__PURE__ */ new Map();
3
- async function authorizeB2(keyId, applicationKey) {
4
- const cacheKey = `${keyId}:${applicationKey}`;
5
- const cached = authCache.get(cacheKey);
6
- if (cached && Date.now() < cached.expiresAt) return cached.token;
7
- const basic = btoa(`${keyId.trim()}:${applicationKey.trim()}`);
8
- const res = await fetch("https://api.backblazeb2.com/b2api/v2/b2_authorize_account", {
9
- headers: { Authorization: `Basic ${basic}` }
10
- });
11
- if (!res.ok) throw new Error(`B2 Authorization failed: ${res.status} ${await res.text()}`);
12
- const data = await res.json();
13
- const token = {
14
- authorizationToken: data.authorizationToken,
15
- apiUrl: data.apiUrl,
16
- downloadUrl: data.downloadUrl,
17
- accountId: data.accountId
18
- };
19
- authCache.set(cacheKey, { token, expiresAt: Date.now() + 20 * 60 * 1e3 });
20
- return token;
21
- }
22
- async function b2ListBuckets(keyId, applicationKey) {
23
- const auth = await authorizeB2(keyId, applicationKey);
24
- const res = await fetch(`${auth.apiUrl}/b2api/v2/b2_list_buckets`, {
25
- method: "POST",
26
- headers: { Authorization: auth.authorizationToken, "Content-Type": "application/json" },
27
- body: JSON.stringify({ accountId: auth.accountId })
28
- });
29
- if (!res.ok) throw new Error(`B2 list buckets failed: ${res.status}`);
30
- const data = await res.json();
31
- return data.buckets || [];
32
- }
33
- async function b2ListFileNames(keyId, applicationKey, bucketName, prefix = "") {
34
- const auth = await authorizeB2(keyId, applicationKey);
35
- const buckets = await b2ListBuckets(keyId, applicationKey);
36
- const bucket = buckets.find((b) => b.bucketName === bucketName);
37
- if (!bucket) return [];
38
- const res = await fetch(`${auth.apiUrl}/b2api/v2/b2_list_file_names`, {
39
- method: "POST",
40
- headers: { Authorization: auth.authorizationToken, "Content-Type": "application/json" },
41
- body: JSON.stringify({ bucketId: bucket.bucketId, prefix, maxFileCount: 1e3 })
42
- });
43
- if (!res.ok) return [];
44
- const data = await res.json();
45
- return data.files || [];
46
- }
47
- async function b2UploadFile(keyId, applicationKey, bucketName, fileName, content, contentType = "application/json") {
48
- const auth = await authorizeB2(keyId, applicationKey);
49
- const buckets = await b2ListBuckets(keyId, applicationKey);
50
- const bucket = buckets.find((b) => b.bucketName === bucketName);
51
- if (!bucket) throw new Error(`Bucket ${bucketName} not found`);
52
- const urlRes = await fetch(`${auth.apiUrl}/b2api/v2/b2_get_upload_url`, {
53
- method: "POST",
54
- headers: { Authorization: auth.authorizationToken, "Content-Type": "application/json" },
55
- body: JSON.stringify({ bucketId: bucket.bucketId })
56
- });
57
- if (!urlRes.ok) throw new Error(`B2 get upload url failed: ${urlRes.status}`);
58
- const { uploadUrl, authorizationToken } = await urlRes.json();
59
- const raw = typeof content === "string" ? new TextEncoder().encode(content) : content;
60
- const hashBuffer = await crypto.subtle.digest("SHA-1", raw);
61
- const sha1 = Array.from(new Uint8Array(hashBuffer)).map((b) => b.toString(16).padStart(2, "0")).join("");
62
- const upRes = await fetch(uploadUrl, {
63
- method: "POST",
64
- headers: {
65
- Authorization: authorizationToken,
66
- "X-Bz-File-Name": encodeURIComponent(fileName).replace(/%2F/g, "/"),
67
- "Content-Type": contentType,
68
- "Content-Length": String(raw.length),
69
- "X-Bz-Content-Sha1": sha1
70
- },
71
- body: raw
72
- });
73
- if (!upRes.ok) throw new Error(`B2 upload failed: ${upRes.status} ${await upRes.text()}`);
74
- return await upRes.json();
75
- }
76
- async function b2DownloadFile(keyId, applicationKey, bucketName, fileName) {
77
- const auth = await authorizeB2(keyId, applicationKey);
78
- const url = `${auth.downloadUrl}/file/${bucketName}/${encodeURI(fileName)}`;
79
- const res = await fetch(url, { headers: { Authorization: auth.authorizationToken } });
80
- if (!res.ok) return null;
81
- return new Uint8Array(await res.arrayBuffer());
82
- }
83
-
84
- export {
85
- authorizeB2,
86
- b2ListBuckets,
87
- b2ListFileNames,
88
- b2UploadFile,
89
- b2DownloadFile
90
- };