@ultrst-armada/kloks 1.26.2 → 1.26.3

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 (29) hide show
  1. package/package.json +12 -3
  2. package/packages/backend/dist/{chunk-3SWMKYCI.js → chunk-3S2NSIFA.js} +4 -1
  3. package/packages/backend/dist/{chunk-4TPSXGG5.js → chunk-EDKCP5CQ.js} +6 -6
  4. package/packages/backend/dist/{chunk-UCCFQCAE.js → chunk-FU6TYLI2.js} +1 -1
  5. package/packages/backend/dist/{chunk-GKXI5V23.js → chunk-KPZQUA7R.js} +4 -1
  6. package/packages/backend/dist/{chunk-BQLQTUDD.js → chunk-U4UI6KK4.js} +1 -1
  7. package/packages/backend/dist/{chunk-KVWBIDZG.js → chunk-WAQDOIGQ.js} +1 -1
  8. package/packages/backend/dist/development/index.js +5 -5
  9. package/packages/backend/dist/index.js +46 -46
  10. package/packages/backend/dist/krnl-ai-services.js +2 -2
  11. package/packages/backend/dist/krnl-services.js +4 -4
  12. package/packages/backend/dist/services/index.js +3 -3
  13. package/packages/backend/dist/storage/GoogleDriveWorkspaceService.d.ts +69 -0
  14. package/packages/backend/dist/storage/GoogleDriveWorkspaceService.test.d.ts +1 -0
  15. package/packages/backend/dist/storage/googleDriveSdk.d.ts +7 -0
  16. package/packages/backend/dist/storage/index.js +10 -10
  17. package/packages/backend/dist/storage-workspace.d.ts +2 -0
  18. package/packages/backend/dist/storage-workspace.js +339 -0
  19. package/packages/backend/dist/workspace/index.js +2 -2
  20. package/packages/backend/package.json +6 -1
  21. package/packages/state-graph/dist/browser.d.ts +28 -0
  22. package/packages/state-graph/dist/browser.js +302 -0
  23. package/packages/state-graph/dist/chunk-2CQQGFMF.js +7339 -0
  24. package/packages/state-graph/dist/index.js +289 -7266
  25. package/packages/state-graph/dist/runtime-entrypoint.test.d.ts +1 -0
  26. package/packages/state-graph/dist/store/CommandApi.d.ts +4 -4
  27. package/packages/state-graph/package.json +2 -1
  28. package/packages/backend/dist/{chunk-M45KQRPR.js → chunk-GWCLYVJT.js} +3 -3
  29. /package/packages/state-graph/dist/{dist-es-OECEAUXH.js → dist-es-QZ6GKMM7.js} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ultrst-armada/kloks",
3
- "version": "1.26.2",
3
+ "version": "1.26.3",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -36,6 +36,7 @@
36
36
  "default": "./packages/functions/dist/index.js"
37
37
  },
38
38
  "./state-graph": {
39
+ "browser": "./packages/state-graph/dist/browser.js",
39
40
  "types": "./packages/state-graph/dist/index.d.ts",
40
41
  "import": "./packages/state-graph/dist/index.js",
41
42
  "default": "./packages/state-graph/dist/index.js"
@@ -214,6 +215,11 @@
214
215
  "types": "./packages/audio-midi/dist/services/index.d.ts",
215
216
  "import": "./packages/audio-midi/dist/services/index.js",
216
217
  "default": "./packages/audio-midi/dist/services/index.js"
218
+ },
219
+ "./backend/storage-workspace": {
220
+ "types": "./packages/backend/dist/storage-workspace.d.ts",
221
+ "import": "./packages/backend/dist/storage-workspace.js",
222
+ "default": "./packages/backend/dist/storage-workspace.js"
217
223
  }
218
224
  },
219
225
  "scripts": {
@@ -223,10 +229,13 @@
223
229
  "test": "vitest run && pnpm run verify:npm-trusted-publishing",
224
230
  "typecheck": "pnpm -r run typecheck",
225
231
  "clean": "pnpm -r run clean",
226
- "verify:npm-trusted-publishing": "node scripts/verify-npm-trusted-publishing.mjs"
232
+ "verify:npm-trusted-publishing": "node scripts/verify-npm-trusted-publishing.mjs",
233
+ "boundary": "node scripts/architecture-boundary.mjs",
234
+ "boundary:clean-room": "node scripts/clean-room-boundary.mjs",
235
+ "boundary:relative": "node scripts/relative-package-boundary.mjs"
227
236
  },
228
237
  "dependencies": {
229
- "@dinilmusick/gutts": "^1.6.0",
238
+ "@dinilmusick/gutts": "^2.0.2",
230
239
  "@webcontainer/api": "^1.6.4",
231
240
  "ws": "^8.18.0",
232
241
  "zod": "^3.24.1",
@@ -1,5 +1,8 @@
1
+ import {
2
+ google
3
+ } from "./chunk-KPZQUA7R.js";
4
+
1
5
  // src/storage/GoogleDriveOAuth.ts
2
- import { google } from "@dinilmusick/gutts/storage";
3
6
  var GOOGLE_DRIVE_STORAGE_SCOPE = "https://www.googleapis.com/auth/drive";
4
7
  var GOOGLE_DRIVE_FILE_SCOPE = "https://www.googleapis.com/auth/drive.file";
5
8
  function createOAuthClient(config) {
@@ -1,7 +1,13 @@
1
+ import {
2
+ workspaceGraphService
3
+ } from "./chunk-WAQDOIGQ.js";
1
4
  import {
2
5
  getSrklAccounts,
3
6
  srklListBackblazeBuckets
4
7
  } from "./chunk-RIOYKF3X.js";
8
+ import {
9
+ StorageAdapterFactory
10
+ } from "./chunk-FU6TYLI2.js";
5
11
  import {
6
12
  b2ListBuckets
7
13
  } from "./chunk-4QEMALXF.js";
@@ -9,12 +15,6 @@ import {
9
15
  formatCanonicalWorkspaceFolderName,
10
16
  sanitizeWorkspaceName
11
17
  } from "./chunk-FZKBTF34.js";
12
- import {
13
- workspaceGraphService
14
- } from "./chunk-KVWBIDZG.js";
15
- import {
16
- StorageAdapterFactory
17
- } from "./chunk-UCCFQCAE.js";
18
18
  import {
19
19
  createWorkspace,
20
20
  deleteWorkspace,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  BaseStorageAdapter,
3
3
  GoogleDriveAdapter
4
- } from "./chunk-GKXI5V23.js";
4
+ } from "./chunk-KPZQUA7R.js";
5
5
 
6
6
  // src/storage/LocalFSAdapter.ts
7
7
  import { promises as fs } from "fs";
@@ -49,8 +49,10 @@ var BaseStorageAdapter = class extends SkipoBase {
49
49
  }
50
50
  };
51
51
 
52
- // src/storage/GoogleDriveAdapter.ts
52
+ // src/storage/googleDriveSdk.ts
53
53
  import { google } from "@dinilmusick/gutts/storage";
54
+
55
+ // src/storage/GoogleDriveAdapter.ts
54
56
  import { Readable } from "stream";
55
57
  var FOLDER_MIME_TYPE = "application/vnd.google-apps.folder";
56
58
  function toTokenSet(credentials, fallback) {
@@ -399,5 +401,6 @@ var GoogleDriveAdapter = class extends BaseStorageAdapter {
399
401
 
400
402
  export {
401
403
  BaseStorageAdapter,
404
+ google,
402
405
  GoogleDriveAdapter
403
406
  };
@@ -13,7 +13,7 @@ import {
13
13
  } from "./chunk-JCMB7BIM.js";
14
14
  import {
15
15
  GoogleDriveAdapter
16
- } from "./chunk-GKXI5V23.js";
16
+ } from "./chunk-KPZQUA7R.js";
17
17
 
18
18
  // src/workspace/WorkspaceFS.ts
19
19
  import { SkipoBase } from "@ultrst-armada/kloks/functions";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  StorageAdapterFactory
3
- } from "./chunk-UCCFQCAE.js";
3
+ } from "./chunk-FU6TYLI2.js";
4
4
  import {
5
5
  findUserWorkspace
6
6
  } from "./chunk-JGUWYVOL.js";
@@ -1,3 +1,8 @@
1
+ import {
2
+ PlaywrightInspectionRuntime,
3
+ PlaywrightInspectionServiceDefinition,
4
+ PlaywrightInspectionServiceFacade
5
+ } from "../chunk-3VWBZEMG.js";
1
6
  import "../chunk-YEGS4HTA.js";
2
7
  import {
3
8
  WebContainerServiceDefinition,
@@ -9,11 +14,6 @@ import {
9
14
  parseDevelopmentDiagnostics,
10
15
  resolveWebContainerCommand
11
16
  } from "../chunk-CA5HVC4X.js";
12
- import {
13
- PlaywrightInspectionRuntime,
14
- PlaywrightInspectionServiceDefinition,
15
- PlaywrightInspectionServiceFacade
16
- } from "../chunk-3VWBZEMG.js";
17
17
  import {
18
18
  createService,
19
19
  createServiceDefinition
@@ -1,3 +1,17 @@
1
+ import {
2
+ CompositeBackend,
3
+ EndpointGenerator,
4
+ LOCAL_STORAGE_GRAPHS_PREFIX,
5
+ NodeGraphPersistenceService,
6
+ createBackend,
7
+ createCompositeService,
8
+ createLocalService,
9
+ createRemoteService,
10
+ exportGraphAsJsonFile,
11
+ nodeGraphPersistence,
12
+ parseGraphJsonFile,
13
+ validateGraphDocument
14
+ } from "./chunk-JOTDEFRG.js";
1
15
  import {
2
16
  CANONICAL_SRKL_URL,
3
17
  SrklClient,
@@ -22,7 +36,7 @@ import {
22
36
  createGoogleDriveAuthorizationUrl,
23
37
  exchangeGoogleDriveCode,
24
38
  refreshGoogleDriveAccessToken
25
- } from "./chunk-3SWMKYCI.js";
39
+ } from "./chunk-3S2NSIFA.js";
26
40
  import {
27
41
  RemoteWorkspaceService,
28
42
  SyncEngine,
@@ -38,30 +52,17 @@ import {
38
52
  setWorkingWorkspaceConfig,
39
53
  syncWorkspace,
40
54
  workingWorkspaceService
41
- } from "./chunk-BQLQTUDD.js";
55
+ } from "./chunk-U4UI6KK4.js";
56
+ import "./chunk-WVDSMTW3.js";
42
57
  import {
43
- CompositeBackend,
44
- EndpointGenerator,
45
- LOCAL_STORAGE_GRAPHS_PREFIX,
46
- NodeGraphPersistenceService,
47
- createBackend,
48
- createCompositeService,
49
- createLocalService,
50
- createRemoteService,
51
- exportGraphAsJsonFile,
52
- nodeGraphPersistence,
53
- parseGraphJsonFile,
54
- validateGraphDocument
55
- } from "./chunk-JOTDEFRG.js";
58
+ validateToolInput
59
+ } from "./chunk-6GQNYRD6.js";
56
60
  import {
57
61
  BaseApiRoute,
58
62
  createSSEResponse,
59
63
  withAuth,
60
64
  withCors
61
65
  } from "./chunk-TWCEVES2.js";
62
- import {
63
- validateToolInput
64
- } from "./chunk-6GQNYRD6.js";
65
66
  import {
66
67
  LuthAuthClient,
67
68
  LuthAuthClient2,
@@ -121,7 +122,15 @@ import {
121
122
  AIRoutingServiceFacade,
122
123
  AIToolServiceDefinition,
123
124
  AIToolServiceFacade
124
- } from "./chunk-M45KQRPR.js";
125
+ } from "./chunk-GWCLYVJT.js";
126
+ import {
127
+ FailoverExecutionEngine,
128
+ HealthCheckService,
129
+ MetricsLogger,
130
+ failoverExecutionEngine,
131
+ healthCheckService,
132
+ metricsLogger
133
+ } from "./chunk-PT6J6UEU.js";
125
134
  import {
126
135
  MCPEngine,
127
136
  ToolManagerService,
@@ -161,26 +170,15 @@ import {
161
170
  krnlWorkspaceGraphServiceFacade,
162
171
  krnlWorkspaceServiceDefinition,
163
172
  krnlWorkspaceServiceFacade
164
- } from "./chunk-4TPSXGG5.js";
173
+ } from "./chunk-EDKCP5CQ.js";
174
+ import {
175
+ workspaceGraphService
176
+ } from "./chunk-WAQDOIGQ.js";
165
177
  import {
166
178
  getPrimarySrklDeploymentUrl,
167
179
  getSrklAccounts,
168
180
  srklListBackblazeBuckets
169
181
  } from "./chunk-RIOYKF3X.js";
170
- import {
171
- authorizeB2,
172
- b2DownloadFile,
173
- b2ListBuckets,
174
- b2ListFileNames,
175
- b2UploadFile
176
- } from "./chunk-4QEMALXF.js";
177
- import {
178
- formatCanonicalWorkspaceFolderName,
179
- sanitizeWorkspaceName
180
- } from "./chunk-FZKBTF34.js";
181
- import {
182
- workspaceGraphService
183
- } from "./chunk-KVWBIDZG.js";
184
182
  import {
185
183
  BackblazeB2Adapter,
186
184
  BucketStorageService,
@@ -196,7 +194,18 @@ import {
196
194
  permanentDeleteS3Object,
197
195
  renameS3Folder,
198
196
  resolveBackblazeEndpoint
199
- } from "./chunk-UCCFQCAE.js";
197
+ } from "./chunk-FU6TYLI2.js";
198
+ import {
199
+ authorizeB2,
200
+ b2DownloadFile,
201
+ b2ListBuckets,
202
+ b2ListFileNames,
203
+ b2UploadFile
204
+ } from "./chunk-4QEMALXF.js";
205
+ import {
206
+ formatCanonicalWorkspaceFolderName,
207
+ sanitizeWorkspaceName
208
+ } from "./chunk-FZKBTF34.js";
200
209
  import {
201
210
  createWorkspace,
202
211
  deleteWorkspace,
@@ -230,7 +239,7 @@ import {
230
239
  import {
231
240
  BaseStorageAdapter,
232
241
  GoogleDriveAdapter
233
- } from "./chunk-GKXI5V23.js";
242
+ } from "./chunk-KPZQUA7R.js";
234
243
  import {
235
244
  loginSystemUser,
236
245
  resolveUserFromToken
@@ -252,16 +261,6 @@ import {
252
261
  } from "./chunk-GCTQY24J.js";
253
262
  import "./chunk-IN3WRHXE.js";
254
263
  import "./chunk-UU6M3L3O.js";
255
- import "./chunk-LV55WKZR.js";
256
- import "./chunk-WVDSMTW3.js";
257
- import {
258
- FailoverExecutionEngine,
259
- HealthCheckService,
260
- MetricsLogger,
261
- failoverExecutionEngine,
262
- healthCheckService,
263
- metricsLogger
264
- } from "./chunk-PT6J6UEU.js";
265
264
  import {
266
265
  EndpointRefresher,
267
266
  ModelCatalogService,
@@ -278,6 +277,7 @@ import {
278
277
  keysStorage,
279
278
  validateApiKey
280
279
  } from "./chunk-P7H6TIEA.js";
280
+ import "./chunk-LV55WKZR.js";
281
281
  import {
282
282
  AIProviderService,
283
283
  aiProviderService
@@ -11,11 +11,11 @@ import {
11
11
  AIRoutingServiceFacade,
12
12
  AIToolServiceDefinition,
13
13
  AIToolServiceFacade
14
- } from "./chunk-M45KQRPR.js";
14
+ } from "./chunk-GWCLYVJT.js";
15
+ import "./chunk-PT6J6UEU.js";
15
16
  import "./chunk-U4HUGPRH.js";
16
17
  import "./chunk-SXDYW3QA.js";
17
18
  import "./chunk-GCTQY24J.js";
18
- import "./chunk-PT6J6UEU.js";
19
19
  import "./chunk-LMWXONZG.js";
20
20
  import "./chunk-P7H6TIEA.js";
21
21
  import "./chunk-SLR6SIEU.js";
@@ -31,15 +31,15 @@ import {
31
31
  krnlWorkspaceGraphServiceFacade,
32
32
  krnlWorkspaceServiceDefinition,
33
33
  krnlWorkspaceServiceFacade
34
- } from "./chunk-4TPSXGG5.js";
34
+ } from "./chunk-EDKCP5CQ.js";
35
+ import "./chunk-WAQDOIGQ.js";
35
36
  import "./chunk-RIOYKF3X.js";
37
+ import "./chunk-FU6TYLI2.js";
36
38
  import "./chunk-4QEMALXF.js";
37
39
  import "./chunk-FZKBTF34.js";
38
- import "./chunk-KVWBIDZG.js";
39
- import "./chunk-UCCFQCAE.js";
40
40
  import "./chunk-JGUWYVOL.js";
41
41
  import "./chunk-JCMB7BIM.js";
42
- import "./chunk-GKXI5V23.js";
42
+ import "./chunk-KPZQUA7R.js";
43
43
  import "./chunk-2COYZMUJ.js";
44
44
  import "./chunk-SXDYW3QA.js";
45
45
  export {
@@ -14,11 +14,11 @@ import {
14
14
  } from "../chunk-JOTDEFRG.js";
15
15
  import {
16
16
  workspaceGraphService
17
- } from "../chunk-KVWBIDZG.js";
18
- import "../chunk-UCCFQCAE.js";
17
+ } from "../chunk-WAQDOIGQ.js";
18
+ import "../chunk-FU6TYLI2.js";
19
19
  import "../chunk-JGUWYVOL.js";
20
20
  import "../chunk-JCMB7BIM.js";
21
- import "../chunk-GKXI5V23.js";
21
+ import "../chunk-KPZQUA7R.js";
22
22
  import "../chunk-SXDYW3QA.js";
23
23
  export {
24
24
  CompositeBackend,
@@ -0,0 +1,69 @@
1
+ import type { FileInfo } from './types.js';
2
+ export declare const GOOGLE_DRIVE_WORKSPACE_SCOPE = "https://www.googleapis.com/auth/drive";
3
+ export interface GoogleDriveWorkspaceTokens {
4
+ accessToken: string;
5
+ refreshToken?: string;
6
+ expiresAt?: number;
7
+ tokenType?: string;
8
+ }
9
+ export interface GoogleDriveWorkspaceOptions {
10
+ clientId: string;
11
+ clientSecret?: string;
12
+ redirectUri: string;
13
+ tokens?: GoogleDriveWorkspaceTokens;
14
+ rootFolderId?: string;
15
+ fetcher?: typeof fetch;
16
+ persistTokens?: (tokens: GoogleDriveWorkspaceTokens) => Promise<void> | void;
17
+ }
18
+ export interface GoogleDriveWorkspaceFolder {
19
+ id: string;
20
+ name: string;
21
+ mimeType: string;
22
+ parentIds: string[];
23
+ modifiedAt: number;
24
+ }
25
+ /**
26
+ * Fetch-native Google Drive implementation for Worker/edge runtimes.
27
+ *
28
+ * This class deliberately uses only the Web Fetch, URL, TextEncoder and
29
+ * Uint8Array APIs. It does not import googleapis, Node streams or filesystem
30
+ * modules, so it can be bundled into Cloudflare Workers and serverless APIs.
31
+ * OAuth credentials are supplied and persisted only by server-side callers.
32
+ */
33
+ export declare class GoogleDriveWorkspaceService {
34
+ private readonly options;
35
+ private readonly fetcher;
36
+ private tokens;
37
+ private refreshPromise?;
38
+ constructor(options: GoogleDriveWorkspaceOptions);
39
+ static createAuthorizationUrl(options: Pick<GoogleDriveWorkspaceOptions, 'clientId' | 'redirectUri'>, state: string, scopes?: string[]): string;
40
+ static exchangeAuthorizationCode(options: Pick<GoogleDriveWorkspaceOptions, 'clientId' | 'clientSecret' | 'redirectUri' | 'fetcher'>, code: string, existingRefreshToken?: string, codeVerifier?: string): Promise<GoogleDriveWorkspaceTokens>;
41
+ private static requestTokens;
42
+ private getAccessToken;
43
+ private api;
44
+ private listFiles;
45
+ private findChild;
46
+ private resolveParent;
47
+ private splitPath;
48
+ getAccountIdentity(): Promise<{
49
+ accountId: string;
50
+ email?: string;
51
+ }>;
52
+ listFolders(parentFolderId?: string): Promise<GoogleDriveWorkspaceFolder[]>;
53
+ resolveFolder(folderId: string): Promise<GoogleDriveWorkspaceFolder>;
54
+ selectRootFolder(folderId: string): Promise<GoogleDriveWorkspaceFolder>;
55
+ read(path: string): Promise<Uint8Array>;
56
+ write(path: string, bytes: Uint8Array | string, contentType?: string): Promise<void>;
57
+ delete(path: string): Promise<void>;
58
+ exists(path: string): Promise<boolean>;
59
+ list(path?: string): Promise<FileInfo[]>;
60
+ stat(path: string): Promise<FileInfo>;
61
+ mkdir(path: string): Promise<void>;
62
+ testConnection(): Promise<{
63
+ ok: boolean;
64
+ latencyMs: number;
65
+ error?: string;
66
+ details?: Record<string, unknown>;
67
+ }>;
68
+ getConnectionMetadata(): Record<string, string>;
69
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Canonical Google SDK boundary for storage integrations.
3
+ *
4
+ * This stable local module lets unit tests replace Google OAuth and Drive
5
+ * calls without requiring network credentials or reaching Google's API.
6
+ */
7
+ export { google } from '@dinilmusick/gutts/storage';
@@ -4,14 +4,7 @@ import {
4
4
  createGoogleDriveAuthorizationUrl,
5
5
  exchangeGoogleDriveCode,
6
6
  refreshGoogleDriveAccessToken
7
- } from "../chunk-3SWMKYCI.js";
8
- import {
9
- authorizeB2,
10
- b2DownloadFile,
11
- b2ListBuckets,
12
- b2ListFileNames,
13
- b2UploadFile
14
- } from "../chunk-4QEMALXF.js";
7
+ } from "../chunk-3S2NSIFA.js";
15
8
  import {
16
9
  BackblazeB2Adapter,
17
10
  BucketStorageService,
@@ -27,11 +20,18 @@ import {
27
20
  permanentDeleteS3Object,
28
21
  renameS3Folder,
29
22
  resolveBackblazeEndpoint
30
- } from "../chunk-UCCFQCAE.js";
23
+ } from "../chunk-FU6TYLI2.js";
24
+ import {
25
+ authorizeB2,
26
+ b2DownloadFile,
27
+ b2ListBuckets,
28
+ b2ListFileNames,
29
+ b2UploadFile
30
+ } from "../chunk-4QEMALXF.js";
31
31
  import {
32
32
  BaseStorageAdapter,
33
33
  GoogleDriveAdapter
34
- } from "../chunk-GKXI5V23.js";
34
+ } from "../chunk-KPZQUA7R.js";
35
35
  export {
36
36
  BackblazeB2Adapter,
37
37
  BaseStorageAdapter,
@@ -0,0 +1,2 @@
1
+ export { GOOGLE_DRIVE_WORKSPACE_SCOPE, GoogleDriveWorkspaceService, } from './storage/GoogleDriveWorkspaceService.js';
2
+ export type { GoogleDriveWorkspaceFolder, GoogleDriveWorkspaceOptions, GoogleDriveWorkspaceTokens, } from './storage/GoogleDriveWorkspaceService.js';