@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.
- package/package.json +6 -1
- package/packages/backend/dist/api/index.js +2 -1
- package/packages/backend/dist/{chunk-5F5V7NAG.js → chunk-5Y7K7HAT.js} +4 -1
- package/packages/backend/dist/{chunk-SQKG3S6P.js → chunk-AUNIGE6Q.js} +2 -2
- package/packages/backend/dist/chunk-BRNWUIH5.js +197 -0
- package/packages/backend/dist/{chunk-NY2SQOXI.js → chunk-CDRHYO44.js} +4 -1
- package/packages/backend/dist/{chunk-ZBNSK26X.js → chunk-CV55JMT7.js} +6 -5
- package/packages/backend/dist/{chunk-OWMQLML7.js → chunk-EMSSTOOK.js} +33 -2
- package/packages/backend/dist/chunk-FSOOAU6G.js +1132 -0
- package/packages/backend/dist/chunk-GVMVYC6C.js +0 -0
- package/packages/backend/dist/chunk-I6T64MLT.js +171 -0
- package/packages/backend/dist/chunk-ICVDGH2I.js +889 -0
- package/packages/backend/dist/chunk-IP6XWQU2.js +48 -0
- package/packages/backend/dist/chunk-IRNQXVYA.js +746 -0
- package/packages/backend/dist/{chunk-POLVHTHJ.js → chunk-KCPQWJBO.js} +4 -1
- package/packages/backend/dist/chunk-LC6ULEM2.js +125 -0
- package/packages/backend/dist/{chunk-NTKUQVCQ.js → chunk-LMUMMVTU.js} +14 -2
- package/packages/backend/dist/chunk-LMY6MGFD.js +78 -0
- package/packages/backend/dist/{chunk-OQRQCDS6.js → chunk-TRJVVNO7.js} +2 -2
- package/packages/backend/dist/{chunk-KPLDYX5Z.js → chunk-TRP76UR2.js} +33 -26
- package/packages/backend/dist/{chunk-FK3OAUXM.js → chunk-WYEVA4RC.js} +4 -2
- package/packages/backend/dist/{chunk-Z6G32NQQ.js → chunk-XKUWLO2M.js} +12 -9
- package/packages/backend/dist/{chunk-OXEP3AP6.js → chunk-Z2CT2MJ2.js} +158 -1
- package/packages/backend/dist/control-plane/index.js +3 -1
- package/packages/backend/dist/core/b2DirectCore.test.d.ts +1 -0
- package/packages/backend/dist/core/cloudflareIntegrationCore.test.d.ts +1 -0
- package/packages/backend/dist/core/googleDriveOAuthCore.d.ts +51 -0
- package/packages/backend/dist/core/googleDriveOAuthCore.test.d.ts +1 -0
- package/packages/backend/dist/core/index.d.ts +3 -0
- package/packages/backend/dist/core/storageConnectionCore.d.ts +136 -0
- package/packages/backend/dist/core/storageConnectionCore.test.d.ts +1 -0
- package/packages/backend/dist/core/storageConnectionRuntimeCore.d.ts +57 -0
- package/packages/backend/dist/core/storageConnectionRuntimeCore.test.d.ts +1 -0
- package/packages/backend/dist/core/storageContracts.d.ts +77 -0
- package/packages/backend/dist/core/storageProviderRegistry.d.ts +7 -0
- package/packages/backend/dist/core/systemCredentialsCore.d.ts +46 -0
- package/packages/backend/dist/core/unifiedDb.d.ts +12 -2
- package/packages/backend/dist/core/unifiedDb.errors.test.d.ts +1 -0
- package/packages/backend/dist/core/unifiedDbNodeAdapter.d.ts +6 -0
- package/packages/backend/dist/core/workspaceBucketSyncCore.d.ts +3 -4
- package/packages/backend/dist/core/workspaceBucketSyncCore.test.d.ts +1 -0
- package/packages/backend/dist/core/workspaceCore.d.ts +25 -6
- package/packages/backend/dist/core/workspaceDataCore.test.d.ts +1 -0
- package/packages/backend/dist/core/workspaceFileCore.d.ts +25 -7
- package/packages/backend/dist/core/workspaceFileCore.test.d.ts +1 -0
- package/packages/backend/dist/core/workspaceFileNodeAdapter.d.ts +6 -0
- package/packages/backend/dist/core/workspaceStorageDetailsCore.d.ts +4 -8
- package/packages/backend/dist/core/workspaceStorageDetailsCore.test.d.ts +1 -0
- package/packages/backend/dist/development/index.js +1 -1
- package/packages/backend/dist/development/playwrightInspectionService.js +1 -1
- package/packages/backend/dist/development/playwrightInspectionSupport.d.ts +1 -0
- package/packages/backend/dist/index.js +22 -16
- package/packages/backend/dist/krnl-services.d.ts +0 -22
- package/packages/backend/dist/krnl-services.js +8 -19
- package/packages/backend/dist/krnl-services.node.d.ts +28 -0
- package/packages/backend/dist/node.d.ts +3 -0
- package/packages/backend/dist/node.js +645 -463
- package/packages/backend/dist/resolver/index.js +13 -0
- package/packages/backend/dist/resolver/systemDatabaseUrl.d.ts +16 -12
- package/packages/backend/dist/services/node.js +12 -10
- package/packages/backend/dist/srkl/index.js +6 -4
- package/packages/backend/dist/storage/B2DirectClient.d.ts +7 -13
- package/packages/backend/dist/storage/B2DirectClient.test.d.ts +1 -0
- package/packages/backend/dist/storage/GoogleDriveWorkspaceService.d.ts +5 -0
- package/packages/backend/dist/storage/index.js +4 -3
- package/packages/backend/dist/storage/node.js +7 -6
- package/packages/backend/dist/storage-workspace.js +1 -1
- package/packages/backend/dist/workspace/index.js +2 -1
- package/packages/backend/dist/workspace/node.js +12 -7
- package/packages/backend/dist/workspaceFileCore-UURQPP62.js +28 -0
- package/packages/backend/package.json +8 -3
- package/packages/services/dist/index.js +8 -2
- package/packages/state-graph/dist/browser.js +16 -16
- package/packages/state-graph/dist/index.js +16 -16
- package/packages/backend/dist/chunk-4QEMALXF.js +0 -90
- package/packages/backend/dist/chunk-AOZSDRNY.js +0 -159
- package/packages/backend/dist/chunk-GYSZ6CAX.js +0 -19
- package/packages/backend/dist/chunk-JCMB7BIM.js +0 -211
- package/packages/backend/dist/chunk-JGUWYVOL.js +0 -570
- package/packages/backend/dist/chunk-LMOM7CST.js +0 -427
- 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
|
|
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
|
-
*
|
|
12
|
-
*
|
|
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
|
|
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
|
-
*
|
|
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
|
|
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-
|
|
18
|
-
import "../chunk-
|
|
19
|
-
import "../chunk-
|
|
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-
|
|
24
|
-
import "../chunk-
|
|
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-
|
|
13
|
+
} from "../chunk-WYEVA4RC.js";
|
|
14
14
|
import {
|
|
15
15
|
getPrimarySrklDeploymentUrl,
|
|
16
16
|
getSrklAccounts,
|
|
17
17
|
srklListBackblazeBuckets
|
|
18
|
-
} from "../chunk-
|
|
19
|
-
import "../chunk-
|
|
20
|
-
import "../chunk-
|
|
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
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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-
|
|
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-
|
|
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-
|
|
13
|
+
} from "../chunk-AUNIGE6Q.js";
|
|
14
14
|
import {
|
|
15
15
|
GoogleDriveStorageService
|
|
16
|
-
} from "../chunk-
|
|
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-
|
|
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-
|
|
32
|
-
import "../chunk-
|
|
31
|
+
b2UploadFile2 as b2UploadFile
|
|
32
|
+
} from "../chunk-I6T64MLT.js";
|
|
33
|
+
import "../chunk-EMSSTOOK.js";
|
|
33
34
|
export {
|
|
34
35
|
BackblazeB2Adapter,
|
|
35
36
|
BaseStorageAdapter,
|
|
@@ -5,19 +5,24 @@ import {
|
|
|
5
5
|
WorkspaceFS,
|
|
6
6
|
remoteWorkspaceService,
|
|
7
7
|
workingWorkspaceService
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-XKUWLO2M.js";
|
|
9
|
+
import "../chunk-TRJVVNO7.js";
|
|
10
|
+
import "../chunk-LC6ULEM2.js";
|
|
9
11
|
import {
|
|
10
12
|
WorkspaceCloneSyncEngine
|
|
11
|
-
} from "../chunk-
|
|
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-
|
|
17
|
-
import "../chunk-
|
|
18
|
-
import "../chunk-
|
|
19
|
-
import "../chunk-
|
|
20
|
-
import "../chunk-
|
|
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.
|
|
4
|
-
"description": "Kloks Backend Services
|
|
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", ["-
|
|
2961
|
+
const child = spawn("sh", ["-c", request.command], {
|
|
2956
2962
|
cwd: request.cwd,
|
|
2957
|
-
env:
|
|
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-
|
|
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-
|
|
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
|
-
};
|