@ultrst-armada/kloks 1.19.0 → 1.21.0

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.
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schema": 1,
3
3
  "packageName": "@ultrst-armada/kloks",
4
- "version": "1.19.0",
5
- "sourceCommit": "5af44cb81c5dcd3db7c1118ada75b24d619b3adb",
4
+ "version": "1.21.0",
5
+ "sourceCommit": "16094cb698ff64e642910be6d921d0209de43151",
6
6
  "releaseWorkflow": "npm Release",
7
- "workflowRunId": "40941286261"
7
+ "workflowRunId": "41025580233"
8
8
  }
package/index.d.ts CHANGED
@@ -6,3 +6,4 @@ export * from './packages/backend/dist/index.d.ts';
6
6
  export * from './packages/orchestrations/dist/index.d.ts';
7
7
  export * from './packages/contracts/dist/index.d.ts';
8
8
  export * from './packages/fod/dist/index.d.ts';
9
+ export * from './packages/aiko/dist/index.d.ts';
package/index.js CHANGED
@@ -5,4 +5,5 @@ export * from './packages/services/dist/index.js';
5
5
  export * from './packages/backend/dist/index.js';
6
6
  export * from './packages/orchestrations/dist/index.js';
7
7
  export * from './packages/contracts/dist/index.js';
8
- export * from './packages/fod/dist/index';
8
+ export * from './packages/fod/dist/index.js';
9
+ export * from './packages/aiko/dist/index.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ultrst-armada/kloks",
3
- "version": "1.19.0",
3
+ "version": "1.21.0",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -149,6 +149,11 @@
149
149
  "types": "./packages/fod/dist/index.d.ts",
150
150
  "import": "./packages/fod/dist/index.js",
151
151
  "default": "./packages/fod/dist/index.js"
152
+ },
153
+ "./aiko": {
154
+ "types": "./packages/aiko/dist/index.d.ts",
155
+ "import": "./packages/aiko/dist/index.js",
156
+ "default": "./packages/aiko/dist/index.js"
152
157
  }
153
158
  },
154
159
  "scripts": {
@@ -0,0 +1,105 @@
1
+ type AikoSourceKind = 'endpoint' | 'fod-flow' | 'gutts-api' | 'custom';
2
+ interface AikoIntelligenceSpec {
3
+ [key: string]: unknown;
4
+ }
5
+ interface AikoTool {
6
+ id: string;
7
+ name: string;
8
+ description?: string;
9
+ inputSchema?: unknown;
10
+ execute: (input: unknown) => Promise<unknown>;
11
+ sourceKind: AikoSourceKind;
12
+ sourceId: string;
13
+ }
14
+ interface AikoAgentDefinition {
15
+ schemaVersion: '1.0.0';
16
+ id: string;
17
+ name: string;
18
+ description: string;
19
+ agentType: 'TOOL' | 'ENDPOINT' | 'AIKO';
20
+ tool: AikoTool;
21
+ intelligenceSpec: AikoIntelligenceSpec;
22
+ intelligenceSpecId?: string;
23
+ sourceKind: AikoSourceKind;
24
+ sourceId: string;
25
+ allowedToolIds?: string[];
26
+ custom?: boolean;
27
+ }
28
+ interface AikoCapability {
29
+ id: string;
30
+ name: string;
31
+ description?: string;
32
+ sourceKind: AikoSourceKind;
33
+ sourceId: string;
34
+ inputSchema?: unknown;
35
+ execute: (input: unknown) => Promise<unknown>;
36
+ }
37
+ interface AikoKey {
38
+ id: string;
39
+ providerId: string;
40
+ label: string;
41
+ status?: string;
42
+ isActive?: boolean;
43
+ emailGroup?: string;
44
+ expiresAt?: string | null;
45
+ }
46
+ interface AikoIntelligenceResolver {
47
+ resolve(specId?: string, context?: {
48
+ agent?: AikoAgentDefinition;
49
+ tool?: AikoTool;
50
+ }): Promise<{
51
+ spec: AikoIntelligenceSpec;
52
+ specId?: string;
53
+ }> | {
54
+ spec: AikoIntelligenceSpec;
55
+ specId?: string;
56
+ };
57
+ }
58
+ interface AikoKeyRuntime {
59
+ listKeys(): Promise<AikoKey[]>;
60
+ getActiveKey(providerId: string): Promise<AikoKey | null>;
61
+ rotateKey(providerId: string): Promise<AikoKey | null>;
62
+ addKey?(input: {
63
+ providerId: string;
64
+ label: string;
65
+ key: string;
66
+ emailGroup?: string;
67
+ }): Promise<AikoKey>;
68
+ syncFromAikoEngine(): Promise<{
69
+ synced: number;
70
+ message?: string;
71
+ }>;
72
+ }
73
+ interface AikoRuntimeOptions {
74
+ customAgents?: AikoAgentDefinition[];
75
+ capabilities: (() => Promise<AikoCapability[]> | AikoCapability[]) | AikoCapability[];
76
+ resolver: AikoIntelligenceResolver;
77
+ resolveNaturalLanguage?: (agent: AikoAgentDefinition, input: string) => Promise<unknown>;
78
+ keys: AikoKeyRuntime;
79
+ }
80
+
81
+ declare class AikoRuntime {
82
+ private readonly options;
83
+ private readonly agents;
84
+ constructor(options: AikoRuntimeOptions);
85
+ listCapabilities(): Promise<AikoCapability[]>;
86
+ refreshAgents(): Promise<AikoAgentDefinition[]>;
87
+ listAgents(): Promise<AikoAgentDefinition[]>;
88
+ executeAgent(agentId: string, input: unknown): Promise<unknown>;
89
+ createCustomAgent(name: string, capabilityIds: string[], specId?: string): Promise<AikoAgentDefinition>;
90
+ listKeys(): Promise<AikoKey[]>;
91
+ getActiveKey(providerId: string): Promise<AikoKey | null>;
92
+ rotateKey(providerId: string): Promise<AikoKey | null>;
93
+ syncFromAikoEngine(): Promise<{
94
+ synced: number;
95
+ message?: string;
96
+ }>;
97
+ addKey(input: {
98
+ providerId: string;
99
+ label: string;
100
+ key: string;
101
+ emailGroup?: string;
102
+ }): Promise<AikoKey>;
103
+ }
104
+
105
+ export { type AikoAgentDefinition, type AikoCapability, type AikoIntelligenceResolver, type AikoIntelligenceSpec, type AikoKey, type AikoKeyRuntime, AikoRuntime, type AikoRuntimeOptions, type AikoSourceKind, type AikoTool };
@@ -0,0 +1,84 @@
1
+ // src/runtime.ts
2
+ var AikoRuntime = class {
3
+ options;
4
+ agents = /* @__PURE__ */ new Map();
5
+ constructor(options) {
6
+ this.options = options;
7
+ for (const agent of options.customAgents ?? []) this.agents.set(agent.id, agent);
8
+ }
9
+ async listCapabilities() {
10
+ const caps = this.options.capabilities;
11
+ return typeof caps === "function" ? await caps() : caps;
12
+ }
13
+ async refreshAgents() {
14
+ const capabilities = await this.listCapabilities();
15
+ const next = /* @__PURE__ */ new Map();
16
+ for (const agent of this.agents.values()) {
17
+ if (agent.custom || agent.sourceKind === "custom") next.set(agent.id, agent);
18
+ }
19
+ for (const capability of capabilities) {
20
+ const tool = { id: capability.id, name: capability.name, description: capability.description, inputSchema: capability.inputSchema, execute: capability.execute, sourceKind: capability.sourceKind, sourceId: capability.sourceId };
21
+ const resolved = await this.options.resolver.resolve(void 0, { tool });
22
+ const agent = {
23
+ schemaVersion: "1.0.0",
24
+ id: "aiko-" + capability.sourceKind + "-" + capability.sourceId,
25
+ name: capability.name + " Agent",
26
+ description: capability.description ?? "Aiko agent for " + capability.name,
27
+ agentType: capability.sourceKind === "endpoint" ? "ENDPOINT" : "TOOL",
28
+ tool,
29
+ intelligenceSpec: resolved.spec,
30
+ intelligenceSpecId: resolved.specId,
31
+ sourceKind: capability.sourceKind,
32
+ sourceId: capability.sourceId
33
+ };
34
+ next.set(agent.id, agent);
35
+ }
36
+ this.agents.clear();
37
+ for (const agent of next.values()) this.agents.set(agent.id, agent);
38
+ return [...this.agents.values()];
39
+ }
40
+ async listAgents() {
41
+ return this.agents.size ? [...this.agents.values()] : this.refreshAgents();
42
+ }
43
+ async executeAgent(agentId, input) {
44
+ const agent = this.agents.get(agentId) ?? (await this.refreshAgents()).find((item) => item.id === agentId);
45
+ if (!agent) throw new Error("Aiko agent not found: " + agentId);
46
+ const resolvedInput = typeof input === "string" && this.options.resolveNaturalLanguage ? await this.options.resolveNaturalLanguage(agent, input) : input;
47
+ return agent.tool.execute(resolvedInput);
48
+ }
49
+ async createCustomAgent(name, capabilityIds, specId) {
50
+ const capabilities = await this.listCapabilities();
51
+ const allowed = capabilities.filter((item) => capabilityIds.includes(item.id));
52
+ if (allowed.length === 0) throw new Error("A custom Aiko agent requires at least one permitted capability.");
53
+ const resolved = await this.options.resolver.resolve(specId, {});
54
+ const tool = { id: "custom-" + name, name, description: "Custom Aiko capability set", execute: async (input) => {
55
+ const request = input;
56
+ if (!request?.toolId || !capabilityIds.includes(request.toolId)) throw new Error("Capability is not permitted for this custom agent.");
57
+ const capability = allowed.find((item) => item.id === request.toolId);
58
+ if (!capability) throw new Error("Capability not found.");
59
+ return capability.execute(request.input);
60
+ }, sourceKind: "custom", sourceId: name };
61
+ const agent = { schemaVersion: "1.0.0", id: "aiko-custom-" + name.toLowerCase().replace(/\s+/g, "-"), name, description: "Custom Aiko agent", agentType: "AIKO", tool, intelligenceSpec: resolved.spec, intelligenceSpecId: resolved.specId, sourceKind: "custom", sourceId: name, allowedToolIds: capabilityIds, custom: true };
62
+ this.agents.set(agent.id, agent);
63
+ return agent;
64
+ }
65
+ listKeys() {
66
+ return this.options.keys.listKeys();
67
+ }
68
+ getActiveKey(providerId) {
69
+ return this.options.keys.getActiveKey(providerId);
70
+ }
71
+ rotateKey(providerId) {
72
+ return this.options.keys.rotateKey(providerId);
73
+ }
74
+ syncFromAikoEngine() {
75
+ return this.options.keys.syncFromAikoEngine();
76
+ }
77
+ addKey(input) {
78
+ if (!this.options.keys.addKey) throw new Error("Local Aiko key storage is unavailable.");
79
+ return this.options.keys.addKey(input);
80
+ }
81
+ };
82
+ export {
83
+ AikoRuntime
84
+ };
@@ -0,0 +1,32 @@
1
+ {
2
+ "$schema": "https://skipo.dev/schemas/kloks-manifest.v1.json",
3
+ "package": "@kloks/aiko",
4
+ "version": "1.0.0",
5
+ "services": [
6
+ {
7
+ "id": "aiko",
8
+ "name": "Aiko Application Module",
9
+ "version": "1.0.0",
10
+ "description": "Embedded Aiko agent runtime, intelligence resolution, and API key synchronization module for Skipo applications.",
11
+ "backend": {
12
+ "package": "@ultrst-armada/kloks",
13
+ "subpath": "aiko",
14
+ "export": "AikoRuntime",
15
+ "facade": "AikoRuntime"
16
+ },
17
+ "modes": [
18
+ "backend",
19
+ "fullstack"
20
+ ],
21
+ "targets": {
22
+ "backend": [
23
+ "BackendFacade.services"
24
+ ],
25
+ "frontend": [
26
+ "Main.tabs.aiko"
27
+ ]
28
+ },
29
+ "dependencies": []
30
+ }
31
+ ]
32
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "name":"@kloks/aiko",
3
+ "version":"1.0.0",
4
+ "description":"Embedded Aiko application module runtime for Skipo applications.",
5
+ "type":"module",
6
+ "private":false,
7
+ "publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},
8
+ "main":"./dist/index.js",
9
+ "types":"./dist/index.d.ts",
10
+ "module":"./dist/index.js",
11
+ "exports":{".":{"import":"./dist/index.js","types":"./dist/index.d.ts","default":"./dist/index.js"}},
12
+ "scripts":{"build":"tsup src/index.ts --format esm --dts --clean","typecheck":"tsc --noEmit","test":"vitest run","clean":"rm -rf dist"},
13
+ "devDependencies":{"tsup":"^8.4.0","typescript":"^5.7.3","vitest":"^3.1.0"}
14
+ }
@@ -1,4 +1,4 @@
1
- import { a as KeyValidationResult, A as ApiKeyEntry, R as RotationStrategy, K as KeyModelUsageStats } from '../types-B0aSwTAt.js';
1
+ import { a as KeyValidationResult, A as ApiKeyEntry, R as RotationStrategy, K as KeyModelUsageStats } from '../types-NITEaxAh.js';
2
2
  import { P as ProviderId } from '../types-Di4ZAQYA.js';
3
3
 
4
4
  /**
@@ -21,7 +21,7 @@ export { DeterministicEndpointExecutor, EndpointExecutionParams, EndpointExecuti
21
21
  export { M as ModelCatalogEntry, a as ModelHealthStatus } from './types-fYUdf9oB.js';
22
22
  export { EndpointRefresher, ModelCatalogService, ModelHealthService, STATIC_MODELS_CATALOG, endpointRefresher, modelCatalog, modelHealthService } from './ai-models/index.js';
23
23
  export { AIMetricRecord, AIRoutingStrategy, FailoverExecutionEngine, HealthCheckService, MetricsLogger, RetryPolicy, RouteCandidate, RouteExecutionResult, failoverExecutionEngine, healthCheckService, metricsLogger } from './ai-routing/index.js';
24
- export { A as ApiKeyEntry, K as KeyModelUsageStats, a as KeyValidationResult, R as RotationStrategy } from './types-B0aSwTAt.js';
24
+ export { A as ApiKeyEntry, K as KeyModelUsageStats, a as KeyValidationResult, R as RotationStrategy } from './types-NITEaxAh.js';
25
25
  export { KeyStoreService, KeysStorage, keyStore, keysStorage, validateApiKey } from './ai-keys/index.js';
26
26
  export { MCPEngine, MCPServerConfig, MCPTool, MCPToolParameter, ToolExecutionResult, ToolInputValidationResult, ToolManagerService, mcpEngine, toolManagerService, validateToolInput } from './ai-tools/index.js';
27
27
  export { AIInferenceServiceDefinition, AIInferenceServiceFacade, AIKeyServiceDefinition, AIKeyServiceFacade, AIModelCatalogServiceDefinition, AIModelCatalogServiceFacade, AIProviderServiceDefinition, AIProviderServiceFacade, AIRoutingServiceDefinition, AIRoutingServiceFacade, AIToolServiceDefinition, AIToolServiceFacade } from './krnl-ai-services.js';
@@ -1,21 +1,3 @@
1
- import {
2
- CANONICAL_SRKL_URL,
3
- SrklClient,
4
- SrklCredentialRegistry,
5
- SrklVaultAccessClient,
6
- createSrklClient,
7
- decryptVaultBufferInBrowser,
8
- getPrimarySrklDeploymentUrl as getPrimarySrklDeploymentUrl2,
9
- getSrklAccounts as getSrklAccounts2,
10
- getSrklStatus,
11
- globalCredentialRegistry,
12
- hexToBytes,
13
- listBackblazeBuckets,
14
- srklListBackblazeBuckets as srklListBackblazeBuckets2,
15
- srklService,
16
- syncSrklAccounts,
17
- useSrklServices
18
- } from "./chunk-3IUA66RS.js";
19
1
  import {
20
2
  S3Adapter
21
3
  } from "./chunk-RBQ4CW3T.js";
@@ -34,16 +16,30 @@ import {
34
16
  setWorkingWorkspaceConfig,
35
17
  syncWorkspace,
36
18
  workingWorkspaceService
37
- } from "./chunk-6DNGLKAV.js";
19
+ } from "./chunk-2XTHJI4I.js";
38
20
  import {
39
- validateToolInput
40
- } from "./chunk-6GQNYRD6.js";
21
+ CompositeBackend,
22
+ EndpointGenerator,
23
+ LOCAL_STORAGE_GRAPHS_PREFIX,
24
+ NodeGraphPersistenceService,
25
+ createBackend,
26
+ createCompositeService,
27
+ createLocalService,
28
+ createRemoteService,
29
+ exportGraphAsJsonFile,
30
+ nodeGraphPersistence,
31
+ parseGraphJsonFile,
32
+ validateGraphDocument
33
+ } from "./chunk-RBF2OGMC.js";
41
34
  import {
42
35
  BaseApiRoute,
43
36
  createSSEResponse,
44
37
  withAuth,
45
38
  withCors
46
39
  } from "./chunk-TWCEVES2.js";
40
+ import {
41
+ validateToolInput
42
+ } from "./chunk-6GQNYRD6.js";
47
43
  import {
48
44
  AdminGuard,
49
45
  BaseAccountProvider,
@@ -112,19 +108,23 @@ import {
112
108
  resolveDevelopmentCommand
113
109
  } from "./chunk-OYVHKYJW.js";
114
110
  import {
115
- CompositeBackend,
116
- EndpointGenerator,
117
- LOCAL_STORAGE_GRAPHS_PREFIX,
118
- NodeGraphPersistenceService,
119
- createBackend,
120
- createCompositeService,
121
- createLocalService,
122
- createRemoteService,
123
- exportGraphAsJsonFile,
124
- nodeGraphPersistence,
125
- parseGraphJsonFile,
126
- validateGraphDocument
127
- } from "./chunk-RBF2OGMC.js";
111
+ CANONICAL_SRKL_URL,
112
+ SrklClient,
113
+ SrklCredentialRegistry,
114
+ SrklVaultAccessClient,
115
+ createSrklClient,
116
+ decryptVaultBufferInBrowser,
117
+ getPrimarySrklDeploymentUrl as getPrimarySrklDeploymentUrl2,
118
+ getSrklAccounts as getSrklAccounts2,
119
+ getSrklStatus,
120
+ globalCredentialRegistry,
121
+ hexToBytes,
122
+ listBackblazeBuckets,
123
+ srklListBackblazeBuckets as srklListBackblazeBuckets2,
124
+ srklService,
125
+ syncSrklAccounts,
126
+ useSrklServices
127
+ } from "./chunk-3IUA66RS.js";
128
128
  import {
129
129
  AIInferenceServiceDefinition,
130
130
  AIInferenceServiceFacade,
@@ -178,31 +178,11 @@ import {
178
178
  krnlWorkspaceGraphServiceFacade,
179
179
  krnlWorkspaceServiceDefinition,
180
180
  krnlWorkspaceServiceFacade
181
- } from "./chunk-LCRK2QSY.js";
182
- import {
183
- getPrimarySrklDeploymentUrl,
184
- getSrklAccounts,
185
- srklListBackblazeBuckets
186
- } from "./chunk-XHADDA75.js";
187
- import {
188
- authorizeB2,
189
- b2DownloadFile,
190
- b2ListBuckets,
191
- b2ListFileNames,
192
- b2UploadFile
193
- } from "./chunk-4QEMALXF.js";
181
+ } from "./chunk-4ONX56XS.js";
194
182
  import {
195
183
  formatCanonicalWorkspaceFolderName,
196
184
  sanitizeWorkspaceName
197
185
  } from "./chunk-FZKBTF34.js";
198
- import {
199
- CanonicalAuthClient,
200
- RateLimiter,
201
- SessionManager,
202
- createCanonicalAuthClient,
203
- loginSystemUser,
204
- resolveUserFromToken
205
- } from "./chunk-WTBAG4AV.js";
206
186
  import {
207
187
  workspaceGraphService
208
188
  } from "./chunk-47IVAXPJ.js";
@@ -241,6 +221,33 @@ import {
241
221
  updateWorkspace,
242
222
  writeWorkspaceFile
243
223
  } from "./chunk-VN2YMZJO.js";
224
+ import {
225
+ BaseStorageAdapter,
226
+ GoogleDriveAdapter,
227
+ createGoogleDriveAuthorizationUrl,
228
+ exchangeGoogleDriveCode,
229
+ refreshGoogleDriveAccessToken
230
+ } from "./chunk-KKRWZDMN.js";
231
+ import {
232
+ CanonicalAuthClient,
233
+ RateLimiter,
234
+ SessionManager,
235
+ createCanonicalAuthClient,
236
+ loginSystemUser,
237
+ resolveUserFromToken
238
+ } from "./chunk-WTBAG4AV.js";
239
+ import {
240
+ getPrimarySrklDeploymentUrl,
241
+ getSrklAccounts,
242
+ srklListBackblazeBuckets
243
+ } from "./chunk-XHADDA75.js";
244
+ import {
245
+ authorizeB2,
246
+ b2DownloadFile,
247
+ b2ListBuckets,
248
+ b2ListFileNames,
249
+ b2UploadFile
250
+ } from "./chunk-4QEMALXF.js";
244
251
  import {
245
252
  b2DeleteFileVersion,
246
253
  b2DeleteFolder,
@@ -249,13 +256,6 @@ import {
249
256
  getUnifiedDbUrl,
250
257
  queryUnifiedDb
251
258
  } from "./chunk-VAFCR2MS.js";
252
- import {
253
- BaseStorageAdapter,
254
- GoogleDriveAdapter,
255
- createGoogleDriveAuthorizationUrl,
256
- exchangeGoogleDriveCode,
257
- refreshGoogleDriveAccessToken
258
- } from "./chunk-KKRWZDMN.js";
259
259
  import "./chunk-TY32TUNI.js";
260
260
  import {
261
261
  DeterministicEndpointExecutor,
@@ -2,7 +2,7 @@ import * as _ultrst_armada_krnl from '@ultrst-armada/krnl';
2
2
  import { ServiceDefinition } from '@ultrst-armada/krnl';
3
3
  import { P as ProviderId } from './types-Di4ZAQYA.js';
4
4
  import { M as ModelCatalogEntry } from './types-fYUdf9oB.js';
5
- import { A as ApiKeyEntry, R as RotationStrategy, K as KeyModelUsageStats } from './types-B0aSwTAt.js';
5
+ import { A as ApiKeyEntry, R as RotationStrategy, K as KeyModelUsageStats } from './types-NITEaxAh.js';
6
6
 
7
7
  declare const AIProviderServiceDefinition: ServiceDefinition;
8
8
  declare const AIProviderServiceFacade: {
@@ -31,16 +31,16 @@ import {
31
31
  krnlWorkspaceGraphServiceFacade,
32
32
  krnlWorkspaceServiceDefinition,
33
33
  krnlWorkspaceServiceFacade
34
- } from "./chunk-LCRK2QSY.js";
35
- import "./chunk-XHADDA75.js";
36
- import "./chunk-4QEMALXF.js";
34
+ } from "./chunk-4ONX56XS.js";
37
35
  import "./chunk-FZKBTF34.js";
38
- import "./chunk-WTBAG4AV.js";
39
36
  import "./chunk-47IVAXPJ.js";
40
37
  import "./chunk-SHZAQTIT.js";
41
38
  import "./chunk-VN2YMZJO.js";
42
- import "./chunk-VAFCR2MS.js";
43
39
  import "./chunk-KKRWZDMN.js";
40
+ import "./chunk-WTBAG4AV.js";
41
+ import "./chunk-XHADDA75.js";
42
+ import "./chunk-4QEMALXF.js";
43
+ import "./chunk-VAFCR2MS.js";
44
44
  import "./chunk-TY32TUNI.js";
45
45
  export {
46
46
  AuthServiceDefinition,
@@ -17,8 +17,8 @@ import {
17
17
  } from "../chunk-47IVAXPJ.js";
18
18
  import "../chunk-SHZAQTIT.js";
19
19
  import "../chunk-VN2YMZJO.js";
20
- import "../chunk-VAFCR2MS.js";
21
20
  import "../chunk-KKRWZDMN.js";
21
+ import "../chunk-VAFCR2MS.js";
22
22
  import "../chunk-TY32TUNI.js";
23
23
  export {
24
24
  CompositeBackend,
@@ -1,13 +1,6 @@
1
1
  import {
2
2
  S3Adapter
3
3
  } from "../chunk-RBQ4CW3T.js";
4
- import {
5
- authorizeB2,
6
- b2DownloadFile,
7
- b2ListBuckets,
8
- b2ListFileNames,
9
- b2UploadFile
10
- } from "../chunk-4QEMALXF.js";
11
4
  import {
12
5
  BackblazeB2Adapter,
13
6
  LocalFSAdapter,
@@ -28,6 +21,13 @@ import {
28
21
  exchangeGoogleDriveCode,
29
22
  refreshGoogleDriveAccessToken
30
23
  } from "../chunk-KKRWZDMN.js";
24
+ import {
25
+ authorizeB2,
26
+ b2DownloadFile,
27
+ b2ListBuckets,
28
+ b2ListFileNames,
29
+ b2UploadFile
30
+ } from "../chunk-4QEMALXF.js";
31
31
  export {
32
32
  BackblazeB2Adapter,
33
33
  BaseStorageAdapter,
@@ -10,6 +10,7 @@ interface ApiKeyEntry {
10
10
  id: string;
11
11
  providerId: ProviderId;
12
12
  label: string;
13
+ emailGroup?: string;
13
14
  key: string;
14
15
  keyValue?: string;
15
16
  status: 'active' | 'valid' | 'invalid' | 'rate-limited' | 'checking';
@@ -6,14 +6,14 @@ import {
6
6
  WorkspaceFS,
7
7
  remoteWorkspaceService,
8
8
  workingWorkspaceService
9
- } from "../chunk-6DNGLKAV.js";
9
+ } from "../chunk-2XTHJI4I.js";
10
10
  import {
11
11
  formatCanonicalWorkspaceFolderName,
12
12
  sanitizeWorkspaceName
13
13
  } from "../chunk-FZKBTF34.js";
14
14
  import "../chunk-VN2YMZJO.js";
15
- import "../chunk-VAFCR2MS.js";
16
15
  import "../chunk-KKRWZDMN.js";
16
+ import "../chunk-VAFCR2MS.js";
17
17
  export {
18
18
  RemoteWorkspaceService,
19
19
  SyncEngine,
@@ -109,7 +109,7 @@ declare class FodFlowStore {
109
109
  delete(workspaceId: string, flowId: string): Promise<boolean>;
110
110
  }
111
111
 
112
- declare function executeFodFlow(flow: FodFlow, endpoints: Map<string, FodEndpointDescriptor>, onEvent?: (event: FodExecutionEvent) => void): Promise<FodExecutionResult>;
112
+ declare function executeFodFlow(flow: FodFlow, endpoints: Map<string, FodEndpointDescriptor>, onEvent?: (event: FodExecutionEvent) => void, initialInput?: unknown): Promise<FodExecutionResult>;
113
113
 
114
114
  declare class FodRuntime {
115
115
  private readonly options;
@@ -128,7 +128,7 @@ declare class FodRuntime {
128
128
  getFlow(flowId: string): Promise<FodFlow | null>;
129
129
  saveFlow(flow: FodFlow): Promise<FodFlow>;
130
130
  deleteFlow(flowId: string): Promise<boolean>;
131
- executeFlow(flowId: string): Promise<FodExecutionResult>;
131
+ executeFlow(flowId: string, input?: unknown): Promise<FodExecutionResult>;
132
132
  }
133
133
 
134
134
  declare function createFodServiceFacade(runtime: FodRuntime): {
@@ -108,7 +108,7 @@ var FodFlowStore = class {
108
108
  };
109
109
 
110
110
  // src/executor.ts
111
- async function executeFodFlow(flow, endpoints, onEvent) {
111
+ async function executeFodFlow(flow, endpoints, onEvent, initialInput) {
112
112
  const events = [];
113
113
  const errors = [];
114
114
  const emit = (event) => {
@@ -136,6 +136,13 @@ async function executeFodFlow(flow, endpoints, onEvent) {
136
136
  const endpoint = endpoints.get(endpointId);
137
137
  if (!endpoint) throw new Error(`No executable endpoint registered for node '${node.type}'.`);
138
138
  const input = {};
139
+ if (incoming(node.id).length === 0 && initialInput !== void 0) {
140
+ if (typeof initialInput === "object" && initialInput !== null) {
141
+ Object.assign(input, initialInput);
142
+ } else {
143
+ input.input = initialInput;
144
+ }
145
+ }
139
146
  for (const edge of incoming(node.id)) {
140
147
  input[String(edge.targetHandle ?? "input")] = values.get(`${edge.source}:${edge.sourceHandle ?? "result"}`);
141
148
  }
@@ -195,10 +202,10 @@ var FodRuntime = class {
195
202
  async deleteFlow(flowId) {
196
203
  return this.flowStore.delete(this.options.workspaceId, flowId);
197
204
  }
198
- async executeFlow(flowId) {
205
+ async executeFlow(flowId, input) {
199
206
  const flow = await this.getFlow(flowId);
200
207
  if (!flow) throw new Error(`FOD flow '${flowId}' not found.`);
201
- return executeFodFlow(flow, this.endpoints, this.options.onEvent);
208
+ return executeFodFlow(flow, this.endpoints, this.options.onEvent, input);
202
209
  }
203
210
  };
204
211
 
@@ -214,7 +221,7 @@ function createFodServiceFacade(runtime) {
214
221
  getFlow: { id: "FodService.getFlow", name: "getFlow", inputSchema: { type: "object", properties: { flowId: { type: "string" } }, required: ["flowId"] }, outputSchema: { type: "object" }, handler: async (input) => runtime.getFlow(String(input.flowId)) },
215
222
  saveFlow: { id: "FodService.saveFlow", name: "saveFlow", inputSchema: { type: "object" }, outputSchema: { type: "object" }, handler: async (input) => runtime.saveFlow(input.flow) },
216
223
  deleteFlow: { id: "FodService.deleteFlow", name: "deleteFlow", inputSchema: { type: "object", properties: { flowId: { type: "string" } }, required: ["flowId"] }, outputSchema: { type: "object" }, handler: async (input) => ({ success: await runtime.deleteFlow(String(input.flowId)) }) },
217
- executeFlow: { id: "FodService.executeFlow", name: "executeFlow", inputSchema: { type: "object", properties: { flowId: { type: "string" } }, required: ["flowId"] }, outputSchema: { type: "object" }, handler: async (input) => runtime.executeFlow(String(input.flowId)) }
224
+ executeFlow: { id: "FodService.executeFlow", name: "executeFlow", inputSchema: { type: "object", properties: { flowId: { type: "string" }, input: { type: "object" } }, required: ["flowId"] }, outputSchema: { type: "object" }, handler: async (input) => runtime.executeFlow(String(input.flowId), input.input) }
218
225
  }
219
226
  };
220
227
  const service = createService(definition);
@@ -233,7 +240,7 @@ function createFodServiceFacadeForWorkspace(buildRuntime) {
233
240
  getFlow: { id: "FodService.getFlow", name: "getFlow", inputSchema: { type: "object", properties: { workspaceId: { type: "string" }, flowId: { type: "string" } }, required: ["workspaceId", "flowId"] }, outputSchema: { type: "object" }, handler: async (input) => buildRuntime(String(input.workspaceId)).getFlow(String(input.flowId)) },
234
241
  saveFlow: { id: "FodService.saveFlow", name: "saveFlow", inputSchema: { type: "object", properties: { workspaceId: { type: "string" }, flow: { type: "object" } }, required: ["workspaceId", "flow"] }, outputSchema: { type: "object" }, handler: async (input) => buildRuntime(String(input.workspaceId)).saveFlow(input.flow) },
235
242
  deleteFlow: { id: "FodService.deleteFlow", name: "deleteFlow", inputSchema: { type: "object", properties: { workspaceId: { type: "string" }, flowId: { type: "string" } }, required: ["workspaceId", "flowId"] }, outputSchema: { type: "object" }, handler: async (input) => ({ success: await buildRuntime(String(input.workspaceId)).deleteFlow(String(input.flowId)) }) },
236
- executeFlow: { id: "FodService.executeFlow", name: "executeFlow", inputSchema: { type: "object", properties: { workspaceId: { type: "string" }, flowId: { type: "string" } }, required: ["workspaceId", "flowId"] }, outputSchema: { type: "object" }, handler: async (input) => buildRuntime(String(input.workspaceId)).executeFlow(String(input.flowId)) }
243
+ executeFlow: { id: "FodService.executeFlow", name: "executeFlow", inputSchema: { type: "object", properties: { workspaceId: { type: "string" }, flowId: { type: "string" }, input: { type: "object" } }, required: ["workspaceId", "flowId"] }, outputSchema: { type: "object" }, handler: async (input) => buildRuntime(String(input.workspaceId)).executeFlow(String(input.flowId), input.input) }
237
244
  }
238
245
  };
239
246
  const service = createService(definition);
@@ -7,15 +7,6 @@ import {
7
7
  instantiateSubgraph
8
8
  } from "./chunk-S22PMERU.js";
9
9
  import "./chunk-RHRXPY2U.js";
10
- import {
11
- LifecycleCycleError,
12
- LifecycleGraph,
13
- SKIPO_STATE,
14
- SkipoStateEngine,
15
- useLifecycleScope,
16
- useSkipoBind,
17
- useSkipoState
18
- } from "./chunk-EW4ACSZB.js";
19
10
  import {
20
11
  AttractionEngine,
21
12
  GhostInferenceEngine,
@@ -31,6 +22,15 @@ import {
31
22
  WireTypeRegistry,
32
23
  initializeDefaultGraphRules
33
24
  } from "./chunk-TZOL3RN7.js";
25
+ import {
26
+ LifecycleCycleError,
27
+ LifecycleGraph,
28
+ SKIPO_STATE,
29
+ SkipoStateEngine,
30
+ useLifecycleScope,
31
+ useSkipoBind,
32
+ useSkipoState
33
+ } from "./chunk-EW4ACSZB.js";
34
34
  import {
35
35
  CommandApi,
36
36
  GhostStore,
@@ -5,15 +5,15 @@ import {
5
5
  getWorkspaces,
6
6
  updateWorkspace
7
7
  } from "./chunk-VN2YMZJO.js";
8
+ import {
9
+ GoogleDriveAdapter
10
+ } from "./chunk-KKRWZDMN.js";
8
11
  import {
9
12
  b2DownloadFile,
10
13
  b2ListFileNames,
11
14
  b2UploadFile,
12
15
  queryUnifiedDb
13
16
  } from "./chunk-VAFCR2MS.js";
14
- import {
15
- GoogleDriveAdapter
16
- } from "./chunk-KKRWZDMN.js";
17
17
 
18
18
  // src/workspace/WorkspaceFS.ts
19
19
  import { SkipoBase } from "@ultrst-armada/kloks/functions";
@@ -1,20 +1,7 @@
1
- import {
2
- getSrklAccounts,
3
- srklListBackblazeBuckets
4
- } from "./chunk-XHADDA75.js";
5
- import {
6
- b2ListBuckets
7
- } from "./chunk-4QEMALXF.js";
8
1
  import {
9
2
  formatCanonicalWorkspaceFolderName,
10
3
  sanitizeWorkspaceName
11
4
  } from "./chunk-FZKBTF34.js";
12
- import {
13
- RateLimiter,
14
- SessionManager,
15
- loginSystemUser,
16
- resolveUserFromToken
17
- } from "./chunk-WTBAG4AV.js";
18
5
  import {
19
6
  workspaceGraphService
20
7
  } from "./chunk-47IVAXPJ.js";
@@ -28,6 +15,19 @@ import {
28
15
  getWorkspaces,
29
16
  updateWorkspace
30
17
  } from "./chunk-VN2YMZJO.js";
18
+ import {
19
+ RateLimiter,
20
+ SessionManager,
21
+ loginSystemUser,
22
+ resolveUserFromToken
23
+ } from "./chunk-WTBAG4AV.js";
24
+ import {
25
+ getSrklAccounts,
26
+ srklListBackblazeBuckets
27
+ } from "./chunk-XHADDA75.js";
28
+ import {
29
+ b2ListBuckets
30
+ } from "./chunk-4QEMALXF.js";
31
31
  import {
32
32
  queryUnifiedDb
33
33
  } from "./chunk-VAFCR2MS.js";