@ultrst-armada/kloks 1.22.2 → 1.24.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.
- package/.krusbl-release-attestation.json +3 -3
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/package.json +9 -2
- package/packages/backend/dist/ai-routing/index.js +2 -2
- package/packages/backend/dist/{chunk-OB65KZ2M.js → chunk-SJD574XG.js} +4 -4
- package/packages/backend/dist/index.js +10 -10
- package/packages/backend/dist/krnl-ai-services.js +3 -3
- package/packages/semantic-runtime/dist/index.d.ts +342 -0
- package/packages/semantic-runtime/dist/index.js +497 -0
- package/packages/semantic-runtime/package.json +11 -0
- package/packages/services/dist/index.d.ts +71 -1
- package/packages/services/dist/index.js +125 -0
- package/packages/state-graph/dist/index.js +23 -23
- package/packages/backend/dist/{chunk-PT6J6UEU.js → chunk-YAAGIU2H.js} +3 -3
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema": 1,
|
|
3
3
|
"packageName": "@ultrst-armada/kloks",
|
|
4
|
-
"version": "1.
|
|
5
|
-
"sourceCommit": "
|
|
4
|
+
"version": "1.24.0",
|
|
5
|
+
"sourceCommit": "82fd096f94e5ba9bd491c21fca1863b29be14e70",
|
|
6
6
|
"releaseWorkflow": "npm Release",
|
|
7
|
-
"workflowRunId": "
|
|
7
|
+
"workflowRunId": "41218118420"
|
|
8
8
|
}
|
package/index.d.ts
CHANGED
|
@@ -7,3 +7,4 @@ 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
9
|
export * from './packages/aiko/dist/index.d.ts';
|
|
10
|
+
export * from './packages/semantic-runtime/dist/index.d.ts';
|
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ultrst-armada/kloks",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.24.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -17,7 +17,9 @@
|
|
|
17
17
|
"packages/*/dist/**",
|
|
18
18
|
"packages/*/package.json",
|
|
19
19
|
"packages/*/kloks.manifest.json",
|
|
20
|
-
".krusbl-release-attestation.json"
|
|
20
|
+
".krusbl-release-attestation.json",
|
|
21
|
+
"packages/semantic-runtime/dist/**",
|
|
22
|
+
"packages/semantic-runtime/package.json"
|
|
21
23
|
],
|
|
22
24
|
"exports": {
|
|
23
25
|
".": {
|
|
@@ -154,6 +156,11 @@
|
|
|
154
156
|
"types": "./packages/aiko/dist/index.d.ts",
|
|
155
157
|
"import": "./packages/aiko/dist/index.js",
|
|
156
158
|
"default": "./packages/aiko/dist/index.js"
|
|
159
|
+
},
|
|
160
|
+
"./semantic-runtime": {
|
|
161
|
+
"types": "./packages/semantic-runtime/dist/index.d.ts",
|
|
162
|
+
"import": "./packages/semantic-runtime/dist/index.js",
|
|
163
|
+
"default": "./packages/semantic-runtime/dist/index.js"
|
|
157
164
|
}
|
|
158
165
|
},
|
|
159
166
|
"scripts": {
|
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
failoverExecutionEngine,
|
|
7
7
|
healthCheckService,
|
|
8
8
|
metricsLogger
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-YAAGIU2H.js";
|
|
10
|
+
import "../chunk-SLR6SIEU.js";
|
|
10
11
|
import "../chunk-LMWXONZG.js";
|
|
11
12
|
import "../chunk-P7H6TIEA.js";
|
|
12
|
-
import "../chunk-SLR6SIEU.js";
|
|
13
13
|
import "../chunk-MAMK4GDH.js";
|
|
14
14
|
import "../chunk-JSQZAFBU.js";
|
|
15
15
|
import "../chunk-QGM4M3NI.js";
|
|
@@ -10,16 +10,16 @@ import {
|
|
|
10
10
|
} from "./chunk-GCTQY24J.js";
|
|
11
11
|
import {
|
|
12
12
|
failoverExecutionEngine
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-YAAGIU2H.js";
|
|
14
|
+
import {
|
|
15
|
+
aiProviderService
|
|
16
|
+
} from "./chunk-SLR6SIEU.js";
|
|
14
17
|
import {
|
|
15
18
|
modelCatalog
|
|
16
19
|
} from "./chunk-LMWXONZG.js";
|
|
17
20
|
import {
|
|
18
21
|
keyStore
|
|
19
22
|
} from "./chunk-P7H6TIEA.js";
|
|
20
|
-
import {
|
|
21
|
-
aiProviderService
|
|
22
|
-
} from "./chunk-SLR6SIEU.js";
|
|
23
23
|
|
|
24
24
|
// src/krnl-ai-services.ts
|
|
25
25
|
var AIProviderServiceDefinition = createServiceDefinition({
|
|
@@ -35,15 +35,15 @@ import {
|
|
|
35
35
|
syncWorkspace,
|
|
36
36
|
workingWorkspaceService
|
|
37
37
|
} from "./chunk-6DNGLKAV.js";
|
|
38
|
-
import {
|
|
39
|
-
validateToolInput
|
|
40
|
-
} from "./chunk-6GQNYRD6.js";
|
|
41
38
|
import {
|
|
42
39
|
BaseApiRoute,
|
|
43
40
|
createSSEResponse,
|
|
44
41
|
withAuth,
|
|
45
42
|
withCors
|
|
46
43
|
} from "./chunk-TWCEVES2.js";
|
|
44
|
+
import {
|
|
45
|
+
validateToolInput
|
|
46
|
+
} from "./chunk-6GQNYRD6.js";
|
|
47
47
|
import {
|
|
48
48
|
AdminGuard,
|
|
49
49
|
BaseAccountProvider,
|
|
@@ -138,7 +138,7 @@ import {
|
|
|
138
138
|
AIRoutingServiceFacade,
|
|
139
139
|
AIToolServiceDefinition,
|
|
140
140
|
AIToolServiceFacade
|
|
141
|
-
} from "./chunk-
|
|
141
|
+
} from "./chunk-SJD574XG.js";
|
|
142
142
|
import {
|
|
143
143
|
MCPEngine,
|
|
144
144
|
ToolManagerService,
|
|
@@ -269,8 +269,8 @@ import {
|
|
|
269
269
|
performInference
|
|
270
270
|
} from "./chunk-GCTQY24J.js";
|
|
271
271
|
import "./chunk-IN3WRHXE.js";
|
|
272
|
-
import "./chunk-UU6M3L3O.js";
|
|
273
272
|
import "./chunk-LV55WKZR.js";
|
|
273
|
+
import "./chunk-UU6M3L3O.js";
|
|
274
274
|
import "./chunk-WVDSMTW3.js";
|
|
275
275
|
import {
|
|
276
276
|
FailoverExecutionEngine,
|
|
@@ -279,7 +279,11 @@ import {
|
|
|
279
279
|
failoverExecutionEngine,
|
|
280
280
|
healthCheckService,
|
|
281
281
|
metricsLogger
|
|
282
|
-
} from "./chunk-
|
|
282
|
+
} from "./chunk-YAAGIU2H.js";
|
|
283
|
+
import {
|
|
284
|
+
AIProviderService,
|
|
285
|
+
aiProviderService
|
|
286
|
+
} from "./chunk-SLR6SIEU.js";
|
|
283
287
|
import {
|
|
284
288
|
EndpointRefresher,
|
|
285
289
|
ModelCatalogService,
|
|
@@ -296,10 +300,6 @@ import {
|
|
|
296
300
|
keysStorage,
|
|
297
301
|
validateApiKey
|
|
298
302
|
} from "./chunk-P7H6TIEA.js";
|
|
299
|
-
import {
|
|
300
|
-
AIProviderService,
|
|
301
|
-
aiProviderService
|
|
302
|
-
} from "./chunk-SLR6SIEU.js";
|
|
303
303
|
import {
|
|
304
304
|
AITransportClient
|
|
305
305
|
} from "./chunk-MAMK4GDH.js";
|
|
@@ -11,14 +11,14 @@ import {
|
|
|
11
11
|
AIRoutingServiceFacade,
|
|
12
12
|
AIToolServiceDefinition,
|
|
13
13
|
AIToolServiceFacade
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-SJD574XG.js";
|
|
15
15
|
import "./chunk-U4HUGPRH.js";
|
|
16
16
|
import "./chunk-MWSYNRNZ.js";
|
|
17
17
|
import "./chunk-GCTQY24J.js";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-YAAGIU2H.js";
|
|
19
|
+
import "./chunk-SLR6SIEU.js";
|
|
19
20
|
import "./chunk-LMWXONZG.js";
|
|
20
21
|
import "./chunk-P7H6TIEA.js";
|
|
21
|
-
import "./chunk-SLR6SIEU.js";
|
|
22
22
|
import "./chunk-MAMK4GDH.js";
|
|
23
23
|
import "./chunk-JSQZAFBU.js";
|
|
24
24
|
import "./chunk-QGM4M3NI.js";
|
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
type CapabilityKind = 'endpoint' | 'service' | 'fod-flow' | 'gutts' | 'knowledge' | 'agent';
|
|
2
|
+
type TaskStatus = 'submitted' | 'working' | 'input-required' | 'auth-required' | 'completed' | 'failed' | 'canceled' | 'rejected';
|
|
3
|
+
interface JsonSchema {
|
|
4
|
+
type?: string;
|
|
5
|
+
properties?: Record<string, unknown>;
|
|
6
|
+
required?: string[];
|
|
7
|
+
[key: string]: unknown;
|
|
8
|
+
}
|
|
9
|
+
interface SemanticValueDescriptor {
|
|
10
|
+
semanticType: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
constraints?: Record<string, unknown>;
|
|
13
|
+
}
|
|
14
|
+
interface CapabilityDescriptor {
|
|
15
|
+
id: string;
|
|
16
|
+
name: string;
|
|
17
|
+
description: string;
|
|
18
|
+
kind: CapabilityKind;
|
|
19
|
+
inputSchema?: JsonSchema;
|
|
20
|
+
outputSchema?: JsonSchema;
|
|
21
|
+
requirements?: RequirementTemplate[];
|
|
22
|
+
provides?: SemanticValueDescriptor[];
|
|
23
|
+
examples?: unknown[];
|
|
24
|
+
sideEffects?: 'read' | 'compute' | 'write' | 'external' | 'irreversible';
|
|
25
|
+
metadata?: Record<string, unknown>;
|
|
26
|
+
}
|
|
27
|
+
interface RequirementTemplate {
|
|
28
|
+
id: string;
|
|
29
|
+
semanticType: string;
|
|
30
|
+
description: string;
|
|
31
|
+
required: boolean;
|
|
32
|
+
sourceField?: string;
|
|
33
|
+
constraints?: Record<string, unknown>;
|
|
34
|
+
}
|
|
35
|
+
interface Requirement {
|
|
36
|
+
id: string;
|
|
37
|
+
semanticType: string;
|
|
38
|
+
description: string;
|
|
39
|
+
required: boolean;
|
|
40
|
+
sourceCapability: string;
|
|
41
|
+
sourceField?: string;
|
|
42
|
+
constraints?: Record<string, unknown>;
|
|
43
|
+
value?: unknown;
|
|
44
|
+
}
|
|
45
|
+
interface RuntimeContext {
|
|
46
|
+
applicationId: string;
|
|
47
|
+
sessionId: string;
|
|
48
|
+
userId?: string;
|
|
49
|
+
locale?: string;
|
|
50
|
+
timezone?: string;
|
|
51
|
+
metadata?: Record<string, unknown>;
|
|
52
|
+
}
|
|
53
|
+
interface TaskContext {
|
|
54
|
+
taskId: string;
|
|
55
|
+
parentTaskId?: string;
|
|
56
|
+
request: string;
|
|
57
|
+
intent?: string;
|
|
58
|
+
requirements: Requirement[];
|
|
59
|
+
artifacts: Artifact[];
|
|
60
|
+
contextId?: string;
|
|
61
|
+
}
|
|
62
|
+
interface KnowledgeContext {
|
|
63
|
+
sources: string[];
|
|
64
|
+
retrieved: unknown[];
|
|
65
|
+
}
|
|
66
|
+
interface AgentContext {
|
|
67
|
+
runtime: RuntimeContext;
|
|
68
|
+
task: TaskContext;
|
|
69
|
+
capabilities: CapabilityDescriptor[];
|
|
70
|
+
knowledge?: KnowledgeContext;
|
|
71
|
+
}
|
|
72
|
+
interface Artifact {
|
|
73
|
+
id: string;
|
|
74
|
+
type: string;
|
|
75
|
+
value: unknown;
|
|
76
|
+
producer: string;
|
|
77
|
+
taskId: string;
|
|
78
|
+
provenance?: Record<string, unknown>;
|
|
79
|
+
}
|
|
80
|
+
interface SemanticRequest {
|
|
81
|
+
id: string;
|
|
82
|
+
contextId: string;
|
|
83
|
+
input: string;
|
|
84
|
+
intent?: string;
|
|
85
|
+
requirements?: Requirement[];
|
|
86
|
+
metadata?: Record<string, unknown>;
|
|
87
|
+
}
|
|
88
|
+
interface TaskNode {
|
|
89
|
+
id: string;
|
|
90
|
+
capabilityId: string;
|
|
91
|
+
dependsOn: string[];
|
|
92
|
+
input?: unknown;
|
|
93
|
+
status: TaskStatus;
|
|
94
|
+
}
|
|
95
|
+
interface TaskGraph {
|
|
96
|
+
id: string;
|
|
97
|
+
requestId: string;
|
|
98
|
+
nodes: TaskNode[];
|
|
99
|
+
}
|
|
100
|
+
interface Task {
|
|
101
|
+
id: string;
|
|
102
|
+
status: TaskStatus;
|
|
103
|
+
request: string;
|
|
104
|
+
context: TaskContext;
|
|
105
|
+
result?: unknown;
|
|
106
|
+
error?: string;
|
|
107
|
+
}
|
|
108
|
+
interface SemanticPlan {
|
|
109
|
+
intent?: string;
|
|
110
|
+
nodes: Omit<TaskNode, 'status'>[];
|
|
111
|
+
requirements?: Requirement[];
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
declare class CapabilityRegistry {
|
|
115
|
+
private readonly items;
|
|
116
|
+
register(capability: CapabilityDescriptor): void;
|
|
117
|
+
upsert(capability: CapabilityDescriptor): void;
|
|
118
|
+
get(id: string): CapabilityDescriptor | undefined;
|
|
119
|
+
list(): CapabilityDescriptor[];
|
|
120
|
+
findBySemanticType(semanticType: string): CapabilityDescriptor[];
|
|
121
|
+
findProviders(semanticType: string): CapabilityDescriptor[];
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
interface KnowledgeResolver {
|
|
125
|
+
resolve(query: string, context: TaskContext): Promise<KnowledgeContext>;
|
|
126
|
+
}
|
|
127
|
+
declare class ContextResolver {
|
|
128
|
+
private readonly capabilities;
|
|
129
|
+
private readonly knowledge?;
|
|
130
|
+
constructor(capabilities: CapabilityRegistry, knowledge?: KnowledgeResolver | undefined);
|
|
131
|
+
resolve(runtime: RuntimeContext, task: TaskContext): Promise<AgentContext>;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
interface ResolutionResult {
|
|
135
|
+
resolved: boolean;
|
|
136
|
+
value?: unknown;
|
|
137
|
+
source?: string;
|
|
138
|
+
reason?: string;
|
|
139
|
+
capabilityId?: string;
|
|
140
|
+
}
|
|
141
|
+
interface RequirementSource {
|
|
142
|
+
canResolve(requirement: Requirement, context: AgentContext): Promise<boolean>;
|
|
143
|
+
resolve(requirement: Requirement, context: AgentContext): Promise<unknown>;
|
|
144
|
+
name: string;
|
|
145
|
+
}
|
|
146
|
+
interface RequirementCapabilityExecutor {
|
|
147
|
+
execute(capability: CapabilityDescriptor, input: unknown, context: AgentContext): Promise<unknown>;
|
|
148
|
+
}
|
|
149
|
+
declare class CapabilityRequirementSource implements RequirementSource {
|
|
150
|
+
private readonly registry;
|
|
151
|
+
private readonly executor;
|
|
152
|
+
readonly name = "capability-execution";
|
|
153
|
+
constructor(registry: CapabilityRegistry, executor: RequirementCapabilityExecutor);
|
|
154
|
+
canResolve(requirement: Requirement): Promise<boolean>;
|
|
155
|
+
resolve(requirement: Requirement, context: AgentContext): Promise<unknown>;
|
|
156
|
+
private executeProvider;
|
|
157
|
+
}
|
|
158
|
+
declare class RequirementResolver {
|
|
159
|
+
private readonly registry;
|
|
160
|
+
private readonly sources;
|
|
161
|
+
constructor(registry: CapabilityRegistry, sources?: RequirementSource[]);
|
|
162
|
+
resolve(requirement: Requirement, context: AgentContext): Promise<ResolutionResult>;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
interface TaskStore {
|
|
166
|
+
get(id: string): Task | undefined;
|
|
167
|
+
set(task: Task): void;
|
|
168
|
+
list(): Task[];
|
|
169
|
+
}
|
|
170
|
+
interface TaskEventSink {
|
|
171
|
+
emit(event: {
|
|
172
|
+
type: string;
|
|
173
|
+
task: Task;
|
|
174
|
+
}): void;
|
|
175
|
+
}
|
|
176
|
+
declare class TaskRuntime {
|
|
177
|
+
private readonly events?;
|
|
178
|
+
private readonly store;
|
|
179
|
+
constructor(store?: TaskStore, events?: TaskEventSink | undefined);
|
|
180
|
+
create(request: string, parentTaskId?: string, contextId?: string): Task;
|
|
181
|
+
get(id: string): Task | undefined;
|
|
182
|
+
list(): Task[];
|
|
183
|
+
transition(id: string, status: TaskStatus): Task;
|
|
184
|
+
addRequirement(id: string, requirement: TaskContext['requirements'][number]): Task;
|
|
185
|
+
addArtifact(id: string, artifact: Artifact): Task;
|
|
186
|
+
private mustGet;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
declare class TaskGraphRuntime {
|
|
190
|
+
private readonly graphs;
|
|
191
|
+
create(requestId: string, nodes: Omit<TaskNode, 'status'>[]): TaskGraph;
|
|
192
|
+
get(id: string): TaskGraph | undefined;
|
|
193
|
+
ready(id: string): TaskNode[];
|
|
194
|
+
transition(graphId: string, nodeId: string, status: TaskNode['status']): TaskGraph;
|
|
195
|
+
private validate;
|
|
196
|
+
private mustGet;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
interface AgentCard {
|
|
200
|
+
id: string;
|
|
201
|
+
name: string;
|
|
202
|
+
description: string;
|
|
203
|
+
role: 'application' | 'endpoint' | 'capability';
|
|
204
|
+
capabilities: string[];
|
|
205
|
+
inputModes?: string[];
|
|
206
|
+
outputModes?: string[];
|
|
207
|
+
metadata?: Record<string, unknown>;
|
|
208
|
+
}
|
|
209
|
+
declare class AgentRegistry {
|
|
210
|
+
private readonly agents;
|
|
211
|
+
register(agent: AgentCard): void;
|
|
212
|
+
upsert(agent: AgentCard): void;
|
|
213
|
+
get(id: string): AgentCard | undefined;
|
|
214
|
+
list(): AgentCard[];
|
|
215
|
+
forCapability(capability: CapabilityDescriptor): AgentCard[];
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
declare function createSemanticRequest(input: string, intent?: string): SemanticRequest;
|
|
219
|
+
|
|
220
|
+
interface AuthorizationDecision {
|
|
221
|
+
allowed: boolean;
|
|
222
|
+
reason?: string;
|
|
223
|
+
}
|
|
224
|
+
interface AuthorizationPolicy {
|
|
225
|
+
authorize(capability: CapabilityDescriptor, context: AgentContext): Promise<AuthorizationDecision>;
|
|
226
|
+
}
|
|
227
|
+
interface CapabilityExecutor {
|
|
228
|
+
execute(capability: CapabilityDescriptor, input: unknown, context: AgentContext): Promise<unknown>;
|
|
229
|
+
}
|
|
230
|
+
interface ExecutionResult {
|
|
231
|
+
artifact: Artifact;
|
|
232
|
+
}
|
|
233
|
+
declare class CapabilityExecutionRuntime {
|
|
234
|
+
private readonly policy?;
|
|
235
|
+
constructor(policy?: AuthorizationPolicy | undefined);
|
|
236
|
+
execute(capability: CapabilityDescriptor, input: unknown, context: AgentContext, executor: CapabilityExecutor): Promise<ExecutionResult>;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
interface SemanticPlanner {
|
|
240
|
+
plan(request: string, context: AgentContext): Promise<SemanticPlan>;
|
|
241
|
+
}
|
|
242
|
+
interface SemanticExecutionAdapter {
|
|
243
|
+
execute(capability: CapabilityDescriptor, input: unknown, context: AgentContext): Promise<unknown>;
|
|
244
|
+
}
|
|
245
|
+
type OrchestrationResult = {
|
|
246
|
+
status: 'completed';
|
|
247
|
+
task: Task;
|
|
248
|
+
output: unknown[];
|
|
249
|
+
} | {
|
|
250
|
+
status: 'input-required';
|
|
251
|
+
task: Task;
|
|
252
|
+
requirements: Requirement[];
|
|
253
|
+
} | {
|
|
254
|
+
status: 'failed';
|
|
255
|
+
task: Task;
|
|
256
|
+
error: string;
|
|
257
|
+
};
|
|
258
|
+
declare class SemanticOrchestrator {
|
|
259
|
+
private readonly capabilities;
|
|
260
|
+
private readonly tasks;
|
|
261
|
+
private readonly requirements;
|
|
262
|
+
private readonly planner;
|
|
263
|
+
private readonly executor;
|
|
264
|
+
private readonly authorization?;
|
|
265
|
+
readonly graphs: TaskGraphRuntime;
|
|
266
|
+
constructor(capabilities: CapabilityRegistry, tasks: TaskRuntime, requirements: RequirementResolver, planner: SemanticPlanner, executor: SemanticExecutionAdapter, authorization?: AuthorizationPolicy | undefined);
|
|
267
|
+
run(task: Task, context: AgentContext): Promise<OrchestrationResult>;
|
|
268
|
+
private resolveInput;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
interface ConversationMessage {
|
|
272
|
+
id: string;
|
|
273
|
+
role: 'user' | 'agent' | 'system';
|
|
274
|
+
content: string;
|
|
275
|
+
taskId?: string;
|
|
276
|
+
createdAt: string;
|
|
277
|
+
}
|
|
278
|
+
interface Conversation {
|
|
279
|
+
id: string;
|
|
280
|
+
messages: ConversationMessage[];
|
|
281
|
+
taskIds: string[];
|
|
282
|
+
}
|
|
283
|
+
interface ConversationStore {
|
|
284
|
+
get(id: string): Conversation | undefined;
|
|
285
|
+
set(conversation: Conversation): void;
|
|
286
|
+
}
|
|
287
|
+
interface ConversationInputResolver {
|
|
288
|
+
resolve(input: string, requirement: Requirement, context: AgentContext): Promise<unknown>;
|
|
289
|
+
}
|
|
290
|
+
interface ConversationRuntimeOptions {
|
|
291
|
+
tasks: TaskRuntime;
|
|
292
|
+
orchestrator: SemanticOrchestrator;
|
|
293
|
+
buildContext: (taskId: string, conversationId: string) => Promise<AgentContext>;
|
|
294
|
+
inputResolver: ConversationInputResolver;
|
|
295
|
+
store?: ConversationStore;
|
|
296
|
+
}
|
|
297
|
+
declare class ConversationRuntime {
|
|
298
|
+
private readonly options;
|
|
299
|
+
private readonly store;
|
|
300
|
+
constructor(options: ConversationRuntimeOptions);
|
|
301
|
+
send(input: string, conversationId?: string, taskId?: string): Promise<OrchestrationResult>;
|
|
302
|
+
get(id: string): Conversation | undefined;
|
|
303
|
+
private getOrCreate;
|
|
304
|
+
private describe;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
interface WorkspaceFileAdapter {
|
|
308
|
+
readFile(workspaceId: string, path: string): Promise<string | Uint8Array>;
|
|
309
|
+
writeFile(workspaceId: string, path: string, content: string): Promise<unknown>;
|
|
310
|
+
deleteFile(workspaceId: string, path: string): Promise<unknown>;
|
|
311
|
+
listFiles(workspaceId: string, path: string): Promise<readonly {
|
|
312
|
+
name: string;
|
|
313
|
+
path: string;
|
|
314
|
+
isFolder?: boolean;
|
|
315
|
+
}[]>;
|
|
316
|
+
}
|
|
317
|
+
declare class WorkspaceTaskStore implements TaskStore {
|
|
318
|
+
private readonly workspace;
|
|
319
|
+
private readonly workspaceId;
|
|
320
|
+
private readonly root;
|
|
321
|
+
private readonly items;
|
|
322
|
+
constructor(workspace: WorkspaceFileAdapter, workspaceId: string, root?: string);
|
|
323
|
+
hydrate(): Promise<Task[]>;
|
|
324
|
+
get(id: string): Task | undefined;
|
|
325
|
+
set(task: Task): void;
|
|
326
|
+
list(): Task[];
|
|
327
|
+
delete(id: string): Promise<void>;
|
|
328
|
+
}
|
|
329
|
+
declare class WorkspaceConversationStore implements ConversationStore {
|
|
330
|
+
private readonly workspace;
|
|
331
|
+
private readonly workspaceId;
|
|
332
|
+
private readonly root;
|
|
333
|
+
private readonly items;
|
|
334
|
+
constructor(workspace: WorkspaceFileAdapter, workspaceId: string, root?: string);
|
|
335
|
+
hydrate(): Promise<Conversation[]>;
|
|
336
|
+
get(id: string): Conversation | undefined;
|
|
337
|
+
set(conversation: Conversation): void;
|
|
338
|
+
list(): Conversation[];
|
|
339
|
+
delete(id: string): Promise<void>;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
export { type AgentCard, type AgentContext, AgentRegistry, type Artifact, type AuthorizationDecision, type AuthorizationPolicy, type CapabilityDescriptor, CapabilityExecutionRuntime, type CapabilityExecutor, type CapabilityKind, CapabilityRegistry, CapabilityRequirementSource, ContextResolver, type Conversation, type ConversationInputResolver, type ConversationMessage, ConversationRuntime, type ConversationRuntimeOptions, type ConversationStore, type ExecutionResult, type JsonSchema, type KnowledgeContext, type KnowledgeResolver, type OrchestrationResult, type Requirement, type RequirementCapabilityExecutor, RequirementResolver, type RequirementSource, type RequirementTemplate, type ResolutionResult, type RuntimeContext, type SemanticExecutionAdapter, SemanticOrchestrator, type SemanticPlan, type SemanticPlanner, type SemanticRequest, type SemanticValueDescriptor, type Task, type TaskContext, type TaskEventSink, type TaskGraph, TaskGraphRuntime, type TaskNode, TaskRuntime, type TaskStatus, type TaskStore, WorkspaceConversationStore, type WorkspaceFileAdapter, WorkspaceTaskStore, createSemanticRequest };
|
|
@@ -0,0 +1,497 @@
|
|
|
1
|
+
// src/registry.ts
|
|
2
|
+
var CapabilityRegistry = class {
|
|
3
|
+
items = /* @__PURE__ */ new Map();
|
|
4
|
+
register(capability) {
|
|
5
|
+
if (this.items.has(capability.id)) throw new Error(`Capability already registered: ${capability.id}`);
|
|
6
|
+
this.items.set(capability.id, capability);
|
|
7
|
+
}
|
|
8
|
+
upsert(capability) {
|
|
9
|
+
this.items.set(capability.id, capability);
|
|
10
|
+
}
|
|
11
|
+
get(id) {
|
|
12
|
+
return this.items.get(id);
|
|
13
|
+
}
|
|
14
|
+
list() {
|
|
15
|
+
return [...this.items.values()];
|
|
16
|
+
}
|
|
17
|
+
findBySemanticType(semanticType) {
|
|
18
|
+
return this.list().filter(
|
|
19
|
+
(c) => (c.requirements ?? []).some((r) => r.semanticType === semanticType) || (c.provides ?? []).some((p) => p.semanticType === semanticType)
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
findProviders(semanticType) {
|
|
23
|
+
return this.list().filter(
|
|
24
|
+
(c) => (c.provides ?? []).some((p) => p.semanticType === semanticType)
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
// src/context.ts
|
|
30
|
+
var ContextResolver = class {
|
|
31
|
+
constructor(capabilities, knowledge) {
|
|
32
|
+
this.capabilities = capabilities;
|
|
33
|
+
this.knowledge = knowledge;
|
|
34
|
+
}
|
|
35
|
+
capabilities;
|
|
36
|
+
knowledge;
|
|
37
|
+
async resolve(runtime, task) {
|
|
38
|
+
const knowledge = this.knowledge ? await this.knowledge.resolve(task.request, task) : void 0;
|
|
39
|
+
return { runtime, task, capabilities: this.capabilities.list(), knowledge };
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
// src/resolution.ts
|
|
44
|
+
var CapabilityRequirementSource = class {
|
|
45
|
+
constructor(registry, executor) {
|
|
46
|
+
this.registry = registry;
|
|
47
|
+
this.executor = executor;
|
|
48
|
+
}
|
|
49
|
+
registry;
|
|
50
|
+
executor;
|
|
51
|
+
name = "capability-execution";
|
|
52
|
+
async canResolve(requirement) {
|
|
53
|
+
return this.registry.findProviders(requirement.semanticType).length > 0;
|
|
54
|
+
}
|
|
55
|
+
async resolve(requirement, context) {
|
|
56
|
+
const candidates = this.registry.findProviders(requirement.semanticType);
|
|
57
|
+
if (candidates.length === 0) throw new Error(`No capability provides ${requirement.semanticType}`);
|
|
58
|
+
return this.executeProvider(candidates[0], context, /* @__PURE__ */ new Set([candidates[0].id]));
|
|
59
|
+
}
|
|
60
|
+
async executeProvider(capability, context, visiting) {
|
|
61
|
+
const input = {};
|
|
62
|
+
for (const template of capability.requirements ?? []) {
|
|
63
|
+
if (!template.required) continue;
|
|
64
|
+
const existing = context.task.requirements.find((r) => r.semanticType === template.semanticType && r.value !== void 0);
|
|
65
|
+
if (existing) {
|
|
66
|
+
input[template.sourceField ?? template.id] = existing.value;
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
const providers = this.registry.findProviders(template.semanticType).filter((candidate) => !visiting.has(candidate.id));
|
|
70
|
+
if (!providers.length)
|
|
71
|
+
throw new Error(`CAPABILITY_REQUIRES_EXECUTION:${capability.id}:${template.semanticType}`);
|
|
72
|
+
const provider = providers[0];
|
|
73
|
+
visiting.add(provider.id);
|
|
74
|
+
const value = await this.executeProvider(provider, context, visiting);
|
|
75
|
+
input[template.sourceField ?? template.id] = value;
|
|
76
|
+
visiting.delete(provider.id);
|
|
77
|
+
}
|
|
78
|
+
return this.executor.execute(capability, input, context);
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
var RequirementResolver = class {
|
|
82
|
+
constructor(registry, sources = []) {
|
|
83
|
+
this.registry = registry;
|
|
84
|
+
this.sources = sources;
|
|
85
|
+
}
|
|
86
|
+
registry;
|
|
87
|
+
sources;
|
|
88
|
+
async resolve(requirement, context) {
|
|
89
|
+
if (requirement.value !== void 0)
|
|
90
|
+
return { resolved: true, value: requirement.value, source: "task-context" };
|
|
91
|
+
for (const source of this.sources) {
|
|
92
|
+
if (await source.canResolve(requirement, context))
|
|
93
|
+
return { resolved: true, value: await source.resolve(requirement, context), source: source.name };
|
|
94
|
+
}
|
|
95
|
+
const providers = this.registry.findProviders(requirement.semanticType);
|
|
96
|
+
if (providers.length) return { resolved: false, reason: "CAPABILITY_REQUIRES_EXECUTION", source: providers[0].id, capabilityId: providers[0].id };
|
|
97
|
+
const candidates = this.registry.list().filter((capability) => capability.inputSchema?.properties?.[requirement.sourceField ?? ""] !== void 0);
|
|
98
|
+
if (candidates.length) return { resolved: false, reason: "CAPABILITY_REQUIRES_EXECUTION", source: candidates[0].id, capabilityId: candidates[0].id };
|
|
99
|
+
return { resolved: false, reason: "NO_INTERNAL_RESOLUTION" };
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
// src/tasks.ts
|
|
104
|
+
var MemoryTaskStore = class {
|
|
105
|
+
items = /* @__PURE__ */ new Map();
|
|
106
|
+
get(id) {
|
|
107
|
+
return this.items.get(id);
|
|
108
|
+
}
|
|
109
|
+
set(task) {
|
|
110
|
+
this.items.set(task.id, task);
|
|
111
|
+
}
|
|
112
|
+
list() {
|
|
113
|
+
return [...this.items.values()];
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
var TaskRuntime = class {
|
|
117
|
+
constructor(store = new MemoryTaskStore(), events) {
|
|
118
|
+
this.events = events;
|
|
119
|
+
this.store = store;
|
|
120
|
+
}
|
|
121
|
+
events;
|
|
122
|
+
store;
|
|
123
|
+
create(request, parentTaskId, contextId) {
|
|
124
|
+
const id = crypto.randomUUID();
|
|
125
|
+
const context = { taskId: id, parentTaskId, request, requirements: [], artifacts: [], contextId: contextId ?? crypto.randomUUID() };
|
|
126
|
+
const task = { id, status: "submitted", request, context };
|
|
127
|
+
this.store.set(task);
|
|
128
|
+
this.events?.emit({ type: "task.created", task });
|
|
129
|
+
return task;
|
|
130
|
+
}
|
|
131
|
+
get(id) {
|
|
132
|
+
return this.store.get(id);
|
|
133
|
+
}
|
|
134
|
+
list() {
|
|
135
|
+
return this.store.list();
|
|
136
|
+
}
|
|
137
|
+
transition(id, status) {
|
|
138
|
+
const task = this.mustGet(id);
|
|
139
|
+
task.status = status;
|
|
140
|
+
this.store.set(task);
|
|
141
|
+
this.events?.emit({ type: "task.status", task });
|
|
142
|
+
return task;
|
|
143
|
+
}
|
|
144
|
+
addRequirement(id, requirement) {
|
|
145
|
+
const task = this.mustGet(id);
|
|
146
|
+
const existing = task.context.requirements.find((r) => r.id === requirement.id);
|
|
147
|
+
if (existing) Object.assign(existing, requirement);
|
|
148
|
+
else task.context.requirements.push(requirement);
|
|
149
|
+
task.status = "input-required";
|
|
150
|
+
this.store.set(task);
|
|
151
|
+
this.events?.emit({ type: "task.requirement", task });
|
|
152
|
+
return task;
|
|
153
|
+
}
|
|
154
|
+
addArtifact(id, artifact) {
|
|
155
|
+
const task = this.mustGet(id);
|
|
156
|
+
task.context.artifacts.push(artifact);
|
|
157
|
+
this.store.set(task);
|
|
158
|
+
this.events?.emit({ type: "task.artifact", task });
|
|
159
|
+
return task;
|
|
160
|
+
}
|
|
161
|
+
mustGet(id) {
|
|
162
|
+
const task = this.store.get(id);
|
|
163
|
+
if (!task) throw new Error(`Unknown task: ${id}`);
|
|
164
|
+
return task;
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
// src/graph.ts
|
|
169
|
+
var TaskGraphRuntime = class {
|
|
170
|
+
graphs = /* @__PURE__ */ new Map();
|
|
171
|
+
create(requestId, nodes) {
|
|
172
|
+
const graph = { id: crypto.randomUUID(), requestId, nodes: nodes.map((n) => ({ ...n, status: "submitted" })) };
|
|
173
|
+
this.validate(graph);
|
|
174
|
+
this.graphs.set(graph.id, graph);
|
|
175
|
+
return graph;
|
|
176
|
+
}
|
|
177
|
+
get(id) {
|
|
178
|
+
return this.graphs.get(id);
|
|
179
|
+
}
|
|
180
|
+
ready(id) {
|
|
181
|
+
const graph = this.mustGet(id);
|
|
182
|
+
return graph.nodes.filter((n) => n.status === "submitted" && n.dependsOn.every((dep) => {
|
|
183
|
+
const node = graph.nodes.find((x) => x.id === dep);
|
|
184
|
+
return node?.status === "completed";
|
|
185
|
+
}));
|
|
186
|
+
}
|
|
187
|
+
transition(graphId, nodeId, status) {
|
|
188
|
+
const graph = this.mustGet(graphId);
|
|
189
|
+
const node = graph.nodes.find((n) => n.id === nodeId);
|
|
190
|
+
if (!node) throw new Error(`Unknown task graph node: ${nodeId}`);
|
|
191
|
+
node.status = status;
|
|
192
|
+
return graph;
|
|
193
|
+
}
|
|
194
|
+
validate(graph) {
|
|
195
|
+
const ids = new Set(graph.nodes.map((n) => n.id));
|
|
196
|
+
for (const node of graph.nodes) {
|
|
197
|
+
for (const dep of node.dependsOn) if (!ids.has(dep)) throw new Error(`Unknown dependency: ${dep}`);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
mustGet(id) {
|
|
201
|
+
const graph = this.graphs.get(id);
|
|
202
|
+
if (!graph) throw new Error(`Unknown task graph: ${id}`);
|
|
203
|
+
return graph;
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
// src/agent.ts
|
|
208
|
+
var AgentRegistry = class {
|
|
209
|
+
agents = /* @__PURE__ */ new Map();
|
|
210
|
+
register(agent) {
|
|
211
|
+
if (this.agents.has(agent.id)) throw new Error(`Agent already registered: ${agent.id}`);
|
|
212
|
+
this.agents.set(agent.id, agent);
|
|
213
|
+
}
|
|
214
|
+
upsert(agent) {
|
|
215
|
+
this.agents.set(agent.id, agent);
|
|
216
|
+
}
|
|
217
|
+
get(id) {
|
|
218
|
+
return this.agents.get(id);
|
|
219
|
+
}
|
|
220
|
+
list() {
|
|
221
|
+
return [...this.agents.values()];
|
|
222
|
+
}
|
|
223
|
+
forCapability(capability) {
|
|
224
|
+
return this.list().filter((a) => a.capabilities.includes(capability.id));
|
|
225
|
+
}
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
// src/request.ts
|
|
229
|
+
function createSemanticRequest(input, intent) {
|
|
230
|
+
return { id: crypto.randomUUID(), contextId: crypto.randomUUID(), input, intent, requirements: [] };
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
// src/execution.ts
|
|
234
|
+
var CapabilityExecutionRuntime = class {
|
|
235
|
+
constructor(policy) {
|
|
236
|
+
this.policy = policy;
|
|
237
|
+
}
|
|
238
|
+
policy;
|
|
239
|
+
async execute(capability, input, context, executor) {
|
|
240
|
+
if (this.policy) {
|
|
241
|
+
const decision = await this.policy.authorize(capability, context);
|
|
242
|
+
if (!decision.allowed) throw new Error(decision.reason ?? "CAPABILITY_NOT_AUTHORIZED");
|
|
243
|
+
}
|
|
244
|
+
const value = await executor.execute(capability, input, context);
|
|
245
|
+
return { artifact: { id: crypto.randomUUID(), type: capability.outputSchema?.type ?? "application/json", value, producer: capability.id, taskId: context.task.taskId, provenance: { capabilityId: capability.id } } };
|
|
246
|
+
}
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
// src/orchestrator.ts
|
|
250
|
+
var SemanticOrchestrator = class {
|
|
251
|
+
constructor(capabilities, tasks, requirements, planner, executor, authorization) {
|
|
252
|
+
this.capabilities = capabilities;
|
|
253
|
+
this.tasks = tasks;
|
|
254
|
+
this.requirements = requirements;
|
|
255
|
+
this.planner = planner;
|
|
256
|
+
this.executor = executor;
|
|
257
|
+
this.authorization = authorization;
|
|
258
|
+
}
|
|
259
|
+
capabilities;
|
|
260
|
+
tasks;
|
|
261
|
+
requirements;
|
|
262
|
+
planner;
|
|
263
|
+
executor;
|
|
264
|
+
authorization;
|
|
265
|
+
graphs = new TaskGraphRuntime();
|
|
266
|
+
async run(task, context) {
|
|
267
|
+
this.tasks.transition(task.id, "working");
|
|
268
|
+
try {
|
|
269
|
+
const plan = await this.planner.plan(task.request, context);
|
|
270
|
+
task.context.intent = plan.intent;
|
|
271
|
+
if (plan.requirements?.length) for (const requirement of plan.requirements) {
|
|
272
|
+
const existing = task.context.requirements.find((r) => r.id === requirement.id);
|
|
273
|
+
if (existing) Object.assign(existing, { ...requirement, value: existing.value });
|
|
274
|
+
else task.context.requirements.push(requirement);
|
|
275
|
+
}
|
|
276
|
+
for (const requirement of task.context.requirements) {
|
|
277
|
+
if (!requirement.required || requirement.value !== void 0) continue;
|
|
278
|
+
const resolved = await this.requirements.resolve(requirement, context);
|
|
279
|
+
if (resolved.resolved) {
|
|
280
|
+
requirement.value = resolved.value;
|
|
281
|
+
continue;
|
|
282
|
+
}
|
|
283
|
+
this.tasks.addRequirement(task.id, requirement);
|
|
284
|
+
return { status: "input-required", task: this.tasks.get(task.id), requirements: [requirement] };
|
|
285
|
+
}
|
|
286
|
+
const graph = this.graphs.create(task.id, plan.nodes);
|
|
287
|
+
const outputs = [];
|
|
288
|
+
while (true) {
|
|
289
|
+
const ready = this.graphs.ready(graph.id);
|
|
290
|
+
if (ready.length === 0) break;
|
|
291
|
+
await Promise.all(ready.map(async (node) => {
|
|
292
|
+
const capability = this.capabilities.get(node.capabilityId);
|
|
293
|
+
if (!capability) throw new Error(`Unknown capability: ${node.capabilityId}`);
|
|
294
|
+
const input = this.resolveInput(node.input, task.context.requirements);
|
|
295
|
+
const executionResult = this.authorization ? await new CapabilityExecutionRuntime(this.authorization).execute(capability, input, context, this.executor) : await new CapabilityExecutionRuntime().execute(capability, input, context, this.executor);
|
|
296
|
+
this.tasks.addArtifact(task.id, executionResult.artifact);
|
|
297
|
+
outputs.push(executionResult.artifact.value);
|
|
298
|
+
this.graphs.transition(graph.id, node.id, "completed");
|
|
299
|
+
}));
|
|
300
|
+
}
|
|
301
|
+
const unfinished = graph.nodes.some((n) => n.status !== "completed");
|
|
302
|
+
if (unfinished) throw new Error("TASK_GRAPH_STALLED");
|
|
303
|
+
task.result = outputs.length === 1 ? outputs[0] : outputs;
|
|
304
|
+
this.tasks.transition(task.id, "completed");
|
|
305
|
+
return { status: "completed", task: this.tasks.get(task.id), output: outputs };
|
|
306
|
+
} catch (error) {
|
|
307
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
308
|
+
task.error = message;
|
|
309
|
+
this.tasks.transition(task.id, "failed");
|
|
310
|
+
return { status: "failed", task: this.tasks.get(task.id), error: message };
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
resolveInput(input, requirements) {
|
|
314
|
+
if (!input || typeof input !== "object") return input;
|
|
315
|
+
const values = new Map(requirements.map((r) => [r.id, r.value]));
|
|
316
|
+
const visit = (value) => {
|
|
317
|
+
if (typeof value === "string" && value.startsWith("$requirement:"))
|
|
318
|
+
return values.get(value.slice("$requirement:".length));
|
|
319
|
+
if (Array.isArray(value)) return value.map(visit);
|
|
320
|
+
if (value && typeof value === "object")
|
|
321
|
+
return Object.fromEntries(Object.entries(value).map(([k, v]) => [k, visit(v)]));
|
|
322
|
+
return value;
|
|
323
|
+
};
|
|
324
|
+
return visit(input);
|
|
325
|
+
}
|
|
326
|
+
};
|
|
327
|
+
|
|
328
|
+
// src/conversation.ts
|
|
329
|
+
var MemoryConversationStore = class {
|
|
330
|
+
items = /* @__PURE__ */ new Map();
|
|
331
|
+
get(id) {
|
|
332
|
+
return this.items.get(id);
|
|
333
|
+
}
|
|
334
|
+
set(conversation) {
|
|
335
|
+
this.items.set(conversation.id, conversation);
|
|
336
|
+
}
|
|
337
|
+
};
|
|
338
|
+
var ConversationRuntime = class {
|
|
339
|
+
constructor(options) {
|
|
340
|
+
this.options = options;
|
|
341
|
+
this.store = options.store ?? new MemoryConversationStore();
|
|
342
|
+
}
|
|
343
|
+
options;
|
|
344
|
+
store;
|
|
345
|
+
async send(input, conversationId, taskId) {
|
|
346
|
+
const conversation = this.getOrCreate(conversationId);
|
|
347
|
+
let task = taskId ? this.options.tasks.get(taskId) : void 0;
|
|
348
|
+
if (!task && conversation.taskIds.length > 0) {
|
|
349
|
+
const lastTaskId = conversation.taskIds[conversation.taskIds.length - 1];
|
|
350
|
+
const candidate = this.options.tasks.get(lastTaskId);
|
|
351
|
+
if (candidate && candidate.status === "input-required") task = candidate;
|
|
352
|
+
}
|
|
353
|
+
const activeTask = task ?? this.options.tasks.create(input, void 0, conversation.id);
|
|
354
|
+
if (!task) conversation.taskIds.push(activeTask.id);
|
|
355
|
+
conversation.messages.push({
|
|
356
|
+
id: crypto.randomUUID(),
|
|
357
|
+
role: "user",
|
|
358
|
+
content: input,
|
|
359
|
+
taskId: activeTask.id,
|
|
360
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
361
|
+
});
|
|
362
|
+
this.store.set(conversation);
|
|
363
|
+
const context = await this.options.buildContext(activeTask.id, conversation.id);
|
|
364
|
+
if (task && activeTask.status === "input-required") {
|
|
365
|
+
const requirement = activeTask.context.requirements.find((r) => r.required && r.value === void 0);
|
|
366
|
+
if (requirement) {
|
|
367
|
+
requirement.value = await this.options.inputResolver.resolve(input, requirement, context);
|
|
368
|
+
activeTask.status = "submitted";
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
const result = await this.options.orchestrator.run(activeTask, context);
|
|
372
|
+
conversation.messages.push({
|
|
373
|
+
id: crypto.randomUUID(),
|
|
374
|
+
role: "agent",
|
|
375
|
+
content: this.describe(result),
|
|
376
|
+
taskId: activeTask.id,
|
|
377
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
378
|
+
});
|
|
379
|
+
this.store.set(conversation);
|
|
380
|
+
return result;
|
|
381
|
+
}
|
|
382
|
+
get(id) {
|
|
383
|
+
return this.store.get(id);
|
|
384
|
+
}
|
|
385
|
+
getOrCreate(id) {
|
|
386
|
+
if (id) {
|
|
387
|
+
const existing = this.store.get(id);
|
|
388
|
+
if (existing) return existing;
|
|
389
|
+
}
|
|
390
|
+
const conversation = { id: id ?? crypto.randomUUID(), messages: [], taskIds: [] };
|
|
391
|
+
this.store.set(conversation);
|
|
392
|
+
return conversation;
|
|
393
|
+
}
|
|
394
|
+
describe(result) {
|
|
395
|
+
if (result.status === "completed") return "Task completed.";
|
|
396
|
+
if (result.status === "input-required")
|
|
397
|
+
return result.requirements.map((r) => r.description).join(" ");
|
|
398
|
+
return `Task failed: ${result.error}`;
|
|
399
|
+
}
|
|
400
|
+
};
|
|
401
|
+
|
|
402
|
+
// src/workspaceStore.ts
|
|
403
|
+
function text(value) {
|
|
404
|
+
return typeof value === "string" ? value : Buffer.from(value).toString("utf8");
|
|
405
|
+
}
|
|
406
|
+
function safe(id) {
|
|
407
|
+
return id.replace(/[^a-zA-Z0-9._-]/g, "_");
|
|
408
|
+
}
|
|
409
|
+
var WorkspaceTaskStore = class {
|
|
410
|
+
constructor(workspace, workspaceId, root = "SEMANTIC/tasks") {
|
|
411
|
+
this.workspace = workspace;
|
|
412
|
+
this.workspaceId = workspaceId;
|
|
413
|
+
this.root = root;
|
|
414
|
+
}
|
|
415
|
+
workspace;
|
|
416
|
+
workspaceId;
|
|
417
|
+
root;
|
|
418
|
+
items = /* @__PURE__ */ new Map();
|
|
419
|
+
async hydrate() {
|
|
420
|
+
const entries = await this.workspace.listFiles(this.workspaceId, this.root);
|
|
421
|
+
for (const entry of entries) {
|
|
422
|
+
if (entry.isFolder || !entry.name.endsWith(".json")) continue;
|
|
423
|
+
try {
|
|
424
|
+
const task = JSON.parse(text(await this.workspace.readFile(this.workspaceId, entry.path)));
|
|
425
|
+
this.items.set(task.id, task);
|
|
426
|
+
} catch {
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
return this.list();
|
|
430
|
+
}
|
|
431
|
+
get(id) {
|
|
432
|
+
return this.items.get(id);
|
|
433
|
+
}
|
|
434
|
+
set(task) {
|
|
435
|
+
this.items.set(task.id, task);
|
|
436
|
+
void this.workspace.writeFile(this.workspaceId, `${this.root}/${safe(task.id)}.json`, JSON.stringify(task, null, 2));
|
|
437
|
+
}
|
|
438
|
+
list() {
|
|
439
|
+
return [...this.items.values()];
|
|
440
|
+
}
|
|
441
|
+
async delete(id) {
|
|
442
|
+
this.items.delete(id);
|
|
443
|
+
await this.workspace.deleteFile(this.workspaceId, `${this.root}/${safe(id)}.json`);
|
|
444
|
+
}
|
|
445
|
+
};
|
|
446
|
+
var WorkspaceConversationStore = class {
|
|
447
|
+
constructor(workspace, workspaceId, root = "SEMANTIC/conversations") {
|
|
448
|
+
this.workspace = workspace;
|
|
449
|
+
this.workspaceId = workspaceId;
|
|
450
|
+
this.root = root;
|
|
451
|
+
}
|
|
452
|
+
workspace;
|
|
453
|
+
workspaceId;
|
|
454
|
+
root;
|
|
455
|
+
items = /* @__PURE__ */ new Map();
|
|
456
|
+
async hydrate() {
|
|
457
|
+
const entries = await this.workspace.listFiles(this.workspaceId, this.root);
|
|
458
|
+
for (const entry of entries) {
|
|
459
|
+
if (entry.isFolder || !entry.name.endsWith(".json")) continue;
|
|
460
|
+
try {
|
|
461
|
+
const conversation = JSON.parse(text(await this.workspace.readFile(this.workspaceId, entry.path)));
|
|
462
|
+
this.items.set(conversation.id, conversation);
|
|
463
|
+
} catch {
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
return this.list();
|
|
467
|
+
}
|
|
468
|
+
get(id) {
|
|
469
|
+
return this.items.get(id);
|
|
470
|
+
}
|
|
471
|
+
set(conversation) {
|
|
472
|
+
this.items.set(conversation.id, conversation);
|
|
473
|
+
void this.workspace.writeFile(this.workspaceId, `${this.root}/${safe(conversation.id)}.json`, JSON.stringify(conversation, null, 2));
|
|
474
|
+
}
|
|
475
|
+
list() {
|
|
476
|
+
return [...this.items.values()];
|
|
477
|
+
}
|
|
478
|
+
async delete(id) {
|
|
479
|
+
this.items.delete(id);
|
|
480
|
+
await this.workspace.deleteFile(this.workspaceId, `${this.root}/${safe(id)}.json`);
|
|
481
|
+
}
|
|
482
|
+
};
|
|
483
|
+
export {
|
|
484
|
+
AgentRegistry,
|
|
485
|
+
CapabilityExecutionRuntime,
|
|
486
|
+
CapabilityRegistry,
|
|
487
|
+
CapabilityRequirementSource,
|
|
488
|
+
ContextResolver,
|
|
489
|
+
ConversationRuntime,
|
|
490
|
+
RequirementResolver,
|
|
491
|
+
SemanticOrchestrator,
|
|
492
|
+
TaskGraphRuntime,
|
|
493
|
+
TaskRuntime,
|
|
494
|
+
WorkspaceConversationStore,
|
|
495
|
+
WorkspaceTaskStore,
|
|
496
|
+
createSemanticRequest
|
|
497
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name":"@ultrst-armada/kloks-semantic-runtime",
|
|
3
|
+
"version":"0.1.0",
|
|
4
|
+
"type":"module",
|
|
5
|
+
"main":"dist/index.js",
|
|
6
|
+
"types":"dist/index.d.ts",
|
|
7
|
+
"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},
|
|
8
|
+
"scripts":{"build":"tsup --config tsup.config.ts","test":"vitest run","typecheck":"tsc --noEmit -p tsconfig.json"},
|
|
9
|
+
"dependencies":{"zod":"^3.24.1"},
|
|
10
|
+
"devDependencies":{"tsup":"^8.4.0","typescript":"^5.7.3","vitest":"^3.1.0"}
|
|
11
|
+
}
|
|
@@ -454,6 +454,76 @@ declare const krnlSystemDbClientServiceFacade: {
|
|
|
454
454
|
execute: <TIn = unknown, TOut = unknown>(op: string, input?: TIn) => Promise<TOut>;
|
|
455
455
|
};
|
|
456
456
|
|
|
457
|
+
interface GitHubVcsProviderOptions {
|
|
458
|
+
token: string;
|
|
459
|
+
apiBaseUrl?: string;
|
|
460
|
+
}
|
|
461
|
+
interface GitHubFile {
|
|
462
|
+
path: string;
|
|
463
|
+
content: string;
|
|
464
|
+
sha?: string;
|
|
465
|
+
}
|
|
466
|
+
declare class GitHubVcsProvider {
|
|
467
|
+
private readonly options;
|
|
468
|
+
readonly id = "github";
|
|
469
|
+
private readonly apiBaseUrl;
|
|
470
|
+
constructor(options: GitHubVcsProviderOptions);
|
|
471
|
+
private request;
|
|
472
|
+
getRepository(repository: string): Promise<unknown>;
|
|
473
|
+
createBranch(repository: string, branch: string, sha: string): Promise<unknown>;
|
|
474
|
+
getFile(repository: string, path: string, ref?: string): Promise<GitHubFile>;
|
|
475
|
+
writeFile(repository: string, file: GitHubFile, message: string, branch: string): Promise<unknown>;
|
|
476
|
+
createPullRequest(repository: string, title: string, body: string, head: string, base?: string): Promise<unknown>;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
interface LocalExecutionRequest {
|
|
480
|
+
command: string;
|
|
481
|
+
cwd?: string;
|
|
482
|
+
environment?: Readonly<Record<string, string>>;
|
|
483
|
+
timeoutMs?: number;
|
|
484
|
+
}
|
|
485
|
+
interface LocalExecutionResult {
|
|
486
|
+
executionId: string;
|
|
487
|
+
status: "succeeded" | "failed" | "timed-out";
|
|
488
|
+
exitCode?: number;
|
|
489
|
+
stdout: string;
|
|
490
|
+
stderr: string;
|
|
491
|
+
}
|
|
492
|
+
declare class LocalExecutionProvider {
|
|
493
|
+
readonly id = "local";
|
|
494
|
+
execute(request: LocalExecutionRequest): Promise<LocalExecutionResult>;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
interface Workspace {
|
|
498
|
+
id: string;
|
|
499
|
+
root: string;
|
|
500
|
+
}
|
|
501
|
+
declare class LocalWorkspaceProvider {
|
|
502
|
+
readonly id = "local-workspace";
|
|
503
|
+
private readonly workspaces;
|
|
504
|
+
create(prefix?: string): Promise<Workspace>;
|
|
505
|
+
get(workspaceId: string): Workspace;
|
|
506
|
+
destroy(workspaceId: string): Promise<void>;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
interface VerificationStep {
|
|
510
|
+
id: string;
|
|
511
|
+
name: string;
|
|
512
|
+
command: string;
|
|
513
|
+
cwd?: string;
|
|
514
|
+
}
|
|
515
|
+
interface VerificationReport {
|
|
516
|
+
id: string;
|
|
517
|
+
status: "passed" | "failed";
|
|
518
|
+
checks: readonly LocalExecutionResult[];
|
|
519
|
+
}
|
|
520
|
+
declare class CommandVerificationProvider {
|
|
521
|
+
private readonly execution;
|
|
522
|
+
readonly id = "command-verification";
|
|
523
|
+
constructor(execution?: LocalExecutionProvider);
|
|
524
|
+
verify(steps: readonly VerificationStep[]): Promise<VerificationReport>;
|
|
525
|
+
}
|
|
526
|
+
|
|
457
527
|
interface ServiceFacade<TState extends Record<string, unknown> = Record<string, unknown>, TEvents extends Record<string, unknown> = Record<string, unknown>> {
|
|
458
528
|
readonly id: string;
|
|
459
529
|
readonly name: string;
|
|
@@ -510,4 +580,4 @@ declare const krnlServiceDDefinition: ServiceDefinition<Record<string, unknown>,
|
|
|
510
580
|
declare const krnlServiceDFacade: ServiceFacade<Record<string, unknown>, Record<string, unknown>>;
|
|
511
581
|
declare const krnlExposeServiceD: typeof exposeServiceD;
|
|
512
582
|
|
|
513
|
-
export { AuthClientServiceDefinition, AuthClientServiceFacade, type AuthListener, AuthService, AuthServiceUISchema, CLEAN_DATABASE_CLUSTER, type CounterState, DEFAULT_CONNECTIONS, type EcosystemServiceCategory, type IAuthStore, type MathInput, MonacoIdeServiceDefinition, MonacoIdeServiceFacade, type ProtocolExposureHandle, STORAGE_KEY_CONNECTIONS, ServiceADefinition, ServiceAFacade, ServiceBDefinition, ServiceBFacade, ServiceCDefinition, ServiceCFacade, ServiceDDefinition, ServiceDFacade, type ServiceFacade, type SrklAccount, SrklAccountClient, type SrklAccountClientOptions, type SrklAccountManifest, type SrklAccountSyncResult, StorageClientServiceDefinition, StorageClientServiceFacade, StorageService, StorageServiceUISchema, SystemDbClientServiceDefinition, SystemDbClientServiceFacade, SystemDbService, SystemDbServiceUISchema, type SystemEnvironmentStatus, type SystemTelemetry, type TelemetryEvents, UIAuthoringServiceDefinition, UIAuthoringServiceFacade, authService, clearSession, createMonacoIdeService, createServiceB, createServiceC, createSrklAccountClient, createUIAuthoringService, createWorkspace, deleteWorkspace, exposeServiceD, fetchWorkspaces, krnlAuthClientServiceDefinition, krnlAuthClientServiceFacade, krnlCreateServiceB, krnlCreateServiceC, krnlExposeServiceD, krnlServiceADefinition, krnlServiceAFacade, krnlServiceBDefinition, krnlServiceBFacade, krnlServiceCDefinition, krnlServiceCFacade, krnlServiceDDefinition, krnlServiceDFacade, krnlStorageClientServiceDefinition, krnlStorageClientServiceFacade, krnlSystemDbClientServiceDefinition, krnlSystemDbClientServiceFacade, loadDatabase, loginAdmin, loginUser, mergeSrklAccounts, persistDatabase, register, restoreSession, setActiveWorkspace, setSession, storageService, systemDbService, updateWorkspace, verifyPassword };
|
|
583
|
+
export { AuthClientServiceDefinition, AuthClientServiceFacade, type AuthListener, AuthService, AuthServiceUISchema, CLEAN_DATABASE_CLUSTER, CommandVerificationProvider, type CounterState, DEFAULT_CONNECTIONS, type EcosystemServiceCategory, type GitHubFile, GitHubVcsProvider, type GitHubVcsProviderOptions, type IAuthStore, LocalExecutionProvider, type LocalExecutionRequest, type LocalExecutionResult, LocalWorkspaceProvider, type MathInput, MonacoIdeServiceDefinition, MonacoIdeServiceFacade, type ProtocolExposureHandle, STORAGE_KEY_CONNECTIONS, ServiceADefinition, ServiceAFacade, ServiceBDefinition, ServiceBFacade, ServiceCDefinition, ServiceCFacade, ServiceDDefinition, ServiceDFacade, type ServiceFacade, type SrklAccount, SrklAccountClient, type SrklAccountClientOptions, type SrklAccountManifest, type SrklAccountSyncResult, StorageClientServiceDefinition, StorageClientServiceFacade, StorageService, StorageServiceUISchema, SystemDbClientServiceDefinition, SystemDbClientServiceFacade, SystemDbService, SystemDbServiceUISchema, type SystemEnvironmentStatus, type SystemTelemetry, type TelemetryEvents, UIAuthoringServiceDefinition, UIAuthoringServiceFacade, type VerificationReport, type VerificationStep, type Workspace, authService, clearSession, createMonacoIdeService, createServiceB, createServiceC, createSrklAccountClient, createUIAuthoringService, createWorkspace, deleteWorkspace, exposeServiceD, fetchWorkspaces, krnlAuthClientServiceDefinition, krnlAuthClientServiceFacade, krnlCreateServiceB, krnlCreateServiceC, krnlExposeServiceD, krnlServiceADefinition, krnlServiceAFacade, krnlServiceBDefinition, krnlServiceBFacade, krnlServiceCDefinition, krnlServiceCFacade, krnlServiceDDefinition, krnlServiceDFacade, krnlStorageClientServiceDefinition, krnlStorageClientServiceFacade, krnlSystemDbClientServiceDefinition, krnlSystemDbClientServiceFacade, loadDatabase, loginAdmin, loginUser, mergeSrklAccounts, persistDatabase, register, restoreSession, setActiveWorkspace, setSession, storageService, systemDbService, updateWorkspace, verifyPassword };
|
|
@@ -2787,6 +2787,127 @@ var krnlStorageClientServiceFacade = StorageClientServiceFacade;
|
|
|
2787
2787
|
var krnlSystemDbClientServiceDefinition = SystemDbClientServiceDefinition;
|
|
2788
2788
|
var krnlSystemDbClientServiceFacade = SystemDbClientServiceFacade;
|
|
2789
2789
|
|
|
2790
|
+
// src/engineering/github-vcs-provider.ts
|
|
2791
|
+
var GitHubVcsProvider = class {
|
|
2792
|
+
constructor(options) {
|
|
2793
|
+
this.options = options;
|
|
2794
|
+
this.apiBaseUrl = options.apiBaseUrl ?? "https://api.github.com";
|
|
2795
|
+
}
|
|
2796
|
+
options;
|
|
2797
|
+
id = "github";
|
|
2798
|
+
apiBaseUrl;
|
|
2799
|
+
async request(path2, init = {}) {
|
|
2800
|
+
const response = await fetch(this.apiBaseUrl + path2, {
|
|
2801
|
+
...init,
|
|
2802
|
+
headers: {
|
|
2803
|
+
accept: "application/vnd.github+json",
|
|
2804
|
+
authorization: `Bearer ${this.options.token}`,
|
|
2805
|
+
"x-github-api-version": "2022-11-28",
|
|
2806
|
+
"content-type": "application/json",
|
|
2807
|
+
...init.headers ?? {}
|
|
2808
|
+
}
|
|
2809
|
+
});
|
|
2810
|
+
if (!response.ok) throw new Error(`GitHub API ${response.status}: ${await response.text()}`);
|
|
2811
|
+
return response.status === 204 ? void 0 : await response.json();
|
|
2812
|
+
}
|
|
2813
|
+
getRepository(repository) {
|
|
2814
|
+
return this.request(`/repos/${repository}`);
|
|
2815
|
+
}
|
|
2816
|
+
createBranch(repository, branch, sha) {
|
|
2817
|
+
return this.request(`/repos/${repository}/git/refs`, { method: "POST", body: JSON.stringify({ ref: `refs/heads/${branch}`, sha }) });
|
|
2818
|
+
}
|
|
2819
|
+
getFile(repository, path2, ref) {
|
|
2820
|
+
const query = ref ? `?ref=${encodeURIComponent(ref)}` : "";
|
|
2821
|
+
return this.request(`/repos/${repository}/contents/${path2}${query}`);
|
|
2822
|
+
}
|
|
2823
|
+
writeFile(repository, file, message, branch) {
|
|
2824
|
+
return this.request(`/repos/${repository}/contents/${file.path}`, { method: "PUT", body: JSON.stringify({ message, content: Buffer.from(file.content, "utf8").toString("base64"), sha: file.sha, branch }) });
|
|
2825
|
+
}
|
|
2826
|
+
createPullRequest(repository, title, body, head, base = "main") {
|
|
2827
|
+
return this.request(`/repos/${repository}/pulls`, { method: "POST", body: JSON.stringify({ title, body, head, base }) });
|
|
2828
|
+
}
|
|
2829
|
+
};
|
|
2830
|
+
|
|
2831
|
+
// src/engineering/local-execution-provider.ts
|
|
2832
|
+
import { spawn } from "child_process";
|
|
2833
|
+
var LocalExecutionProvider = class {
|
|
2834
|
+
id = "local";
|
|
2835
|
+
async execute(request) {
|
|
2836
|
+
const executionId = crypto.randomUUID();
|
|
2837
|
+
return new Promise((resolve) => {
|
|
2838
|
+
const child = spawn("sh", ["-lc", request.command], {
|
|
2839
|
+
cwd: request.cwd,
|
|
2840
|
+
env: { ...process.env, ...request.environment ?? {} }
|
|
2841
|
+
});
|
|
2842
|
+
let stdout = "";
|
|
2843
|
+
let stderr = "";
|
|
2844
|
+
let settled = false;
|
|
2845
|
+
let timer;
|
|
2846
|
+
const finish = (result) => {
|
|
2847
|
+
if (settled) return;
|
|
2848
|
+
settled = true;
|
|
2849
|
+
if (timer) clearTimeout(timer);
|
|
2850
|
+
resolve(result);
|
|
2851
|
+
};
|
|
2852
|
+
child.stdout.on("data", (chunk2) => {
|
|
2853
|
+
stdout += chunk2.toString();
|
|
2854
|
+
});
|
|
2855
|
+
child.stderr.on("data", (chunk2) => {
|
|
2856
|
+
stderr += chunk2.toString();
|
|
2857
|
+
});
|
|
2858
|
+
child.on("error", (error) => finish({ executionId, status: "failed", exitCode: void 0, stdout, stderr: stderr + error.message }));
|
|
2859
|
+
child.on("close", (code) => finish({ executionId, status: code === 0 ? "succeeded" : "failed", exitCode: code ?? void 0, stdout, stderr }));
|
|
2860
|
+
if (request.timeoutMs && request.timeoutMs > 0) timer = setTimeout(() => {
|
|
2861
|
+
child.kill("SIGTERM");
|
|
2862
|
+
finish({ executionId, status: "timed-out", stdout, stderr });
|
|
2863
|
+
}, request.timeoutMs);
|
|
2864
|
+
});
|
|
2865
|
+
}
|
|
2866
|
+
};
|
|
2867
|
+
|
|
2868
|
+
// src/engineering/workspace-provider.ts
|
|
2869
|
+
import { mkdtemp, rm } from "fs/promises";
|
|
2870
|
+
import { tmpdir } from "os";
|
|
2871
|
+
import { join } from "path";
|
|
2872
|
+
var LocalWorkspaceProvider = class {
|
|
2873
|
+
id = "local-workspace";
|
|
2874
|
+
workspaces = /* @__PURE__ */ new Map();
|
|
2875
|
+
async create(prefix = "krusbl-") {
|
|
2876
|
+
const root = await mkdtemp(join(tmpdir(), prefix));
|
|
2877
|
+
const workspace = { id: crypto.randomUUID(), root };
|
|
2878
|
+
this.workspaces.set(workspace.id, workspace);
|
|
2879
|
+
return workspace;
|
|
2880
|
+
}
|
|
2881
|
+
get(workspaceId) {
|
|
2882
|
+
const workspace = this.workspaces.get(workspaceId);
|
|
2883
|
+
if (!workspace) throw new Error(`Unknown workspace: ${workspaceId}`);
|
|
2884
|
+
return workspace;
|
|
2885
|
+
}
|
|
2886
|
+
async destroy(workspaceId) {
|
|
2887
|
+
const workspace = this.get(workspaceId);
|
|
2888
|
+
await rm(workspace.root, { recursive: true, force: true });
|
|
2889
|
+
this.workspaces.delete(workspaceId);
|
|
2890
|
+
}
|
|
2891
|
+
};
|
|
2892
|
+
|
|
2893
|
+
// src/engineering/verification-provider.ts
|
|
2894
|
+
var CommandVerificationProvider = class {
|
|
2895
|
+
constructor(execution = new LocalExecutionProvider()) {
|
|
2896
|
+
this.execution = execution;
|
|
2897
|
+
}
|
|
2898
|
+
execution;
|
|
2899
|
+
id = "command-verification";
|
|
2900
|
+
async verify(steps) {
|
|
2901
|
+
const checks = [];
|
|
2902
|
+
for (const step of steps) {
|
|
2903
|
+
const result = await this.execution.execute({ command: step.command, cwd: step.cwd });
|
|
2904
|
+
checks.push(result);
|
|
2905
|
+
if (result.status !== "succeeded") return { id: crypto.randomUUID(), status: "failed", checks };
|
|
2906
|
+
}
|
|
2907
|
+
return { id: crypto.randomUUID(), status: "passed", checks };
|
|
2908
|
+
}
|
|
2909
|
+
};
|
|
2910
|
+
|
|
2790
2911
|
// src/index.ts
|
|
2791
2912
|
var ServiceADefinition = createServiceDefinition({
|
|
2792
2913
|
id: "kloks.service.a",
|
|
@@ -3012,7 +3133,11 @@ export {
|
|
|
3012
3133
|
AuthService,
|
|
3013
3134
|
AuthServiceUISchema,
|
|
3014
3135
|
CLEAN_DATABASE_CLUSTER,
|
|
3136
|
+
CommandVerificationProvider,
|
|
3015
3137
|
DEFAULT_CONNECTIONS,
|
|
3138
|
+
GitHubVcsProvider,
|
|
3139
|
+
LocalExecutionProvider,
|
|
3140
|
+
LocalWorkspaceProvider,
|
|
3016
3141
|
MonacoIdeServiceDefinition,
|
|
3017
3142
|
MonacoIdeServiceFacade,
|
|
3018
3143
|
STORAGE_KEY_CONNECTIONS,
|
|
@@ -8,20 +8,14 @@ import {
|
|
|
8
8
|
} from "./chunk-S22PMERU.js";
|
|
9
9
|
import "./chunk-RHRXPY2U.js";
|
|
10
10
|
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
} from "./chunk-
|
|
19
|
-
import {
|
|
20
|
-
ConnectionRuleStore,
|
|
21
|
-
HandleTypeRegistry,
|
|
22
|
-
WireTypeRegistry,
|
|
23
|
-
initializeDefaultGraphRules
|
|
24
|
-
} from "./chunk-TZOL3RN7.js";
|
|
11
|
+
LifecycleCycleError,
|
|
12
|
+
LifecycleGraph,
|
|
13
|
+
SKIPO_STATE,
|
|
14
|
+
SkipoStateEngine,
|
|
15
|
+
useLifecycleScope,
|
|
16
|
+
useSkipoBind,
|
|
17
|
+
useSkipoState
|
|
18
|
+
} from "./chunk-EW4ACSZB.js";
|
|
25
19
|
import {
|
|
26
20
|
CommandApi,
|
|
27
21
|
GhostStore,
|
|
@@ -36,6 +30,21 @@ import {
|
|
|
36
30
|
CustomViewWindow,
|
|
37
31
|
DEFAULT_GRAPH_SETTINGS
|
|
38
32
|
} from "./chunk-KG6QYS26.js";
|
|
33
|
+
import {
|
|
34
|
+
AttractionEngine,
|
|
35
|
+
GhostInferenceEngine,
|
|
36
|
+
GhostLayoutResolver,
|
|
37
|
+
GhostTracePathBuilder,
|
|
38
|
+
calculateSocketCoordinates,
|
|
39
|
+
getBeamPoints,
|
|
40
|
+
useMagneticTraces
|
|
41
|
+
} from "./chunk-JXDJZSFW.js";
|
|
42
|
+
import {
|
|
43
|
+
ConnectionRuleStore,
|
|
44
|
+
HandleTypeRegistry,
|
|
45
|
+
WireTypeRegistry,
|
|
46
|
+
initializeDefaultGraphRules
|
|
47
|
+
} from "./chunk-TZOL3RN7.js";
|
|
39
48
|
import {
|
|
40
49
|
AutoSolidify,
|
|
41
50
|
SpatialEngine,
|
|
@@ -49,15 +58,6 @@ import {
|
|
|
49
58
|
import {
|
|
50
59
|
CompatibilityMatrix
|
|
51
60
|
} from "./chunk-ISFNY7EZ.js";
|
|
52
|
-
import {
|
|
53
|
-
LifecycleCycleError,
|
|
54
|
-
LifecycleGraph,
|
|
55
|
-
SKIPO_STATE,
|
|
56
|
-
SkipoStateEngine,
|
|
57
|
-
useLifecycleScope,
|
|
58
|
-
useSkipoBind,
|
|
59
|
-
useSkipoState
|
|
60
|
-
} from "./chunk-EW4ACSZB.js";
|
|
61
61
|
import "./chunk-QGM4M3NI.js";
|
|
62
62
|
|
|
63
63
|
// ../../node_modules/.pnpm/@ultrst-armada+krnl@1.0.9_@types+node@22.20.5/node_modules/@ultrst-armada/krnl/packages/core/dist/index.js
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
aiProviderService
|
|
3
|
+
} from "./chunk-SLR6SIEU.js";
|
|
1
4
|
import {
|
|
2
5
|
modelCatalog,
|
|
3
6
|
modelHealthService
|
|
@@ -5,9 +8,6 @@ import {
|
|
|
5
8
|
import {
|
|
6
9
|
keyStore
|
|
7
10
|
} from "./chunk-P7H6TIEA.js";
|
|
8
|
-
import {
|
|
9
|
-
aiProviderService
|
|
10
|
-
} from "./chunk-SLR6SIEU.js";
|
|
11
11
|
|
|
12
12
|
// src/ai-routing/metricsLogger.ts
|
|
13
13
|
var MetricsLogger = class {
|