@maxanstey-meridian/tandem 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -0
- package/dist/index.d.ts +46 -4
- package/dist/index.js +144 -9
- package/dist/runtime/Tandem.Advanced.dll +0 -0
- package/dist/runtime/Tandem.Ledger.dll +0 -0
- package/dist/runtime/Tandem.NodeApiSpike.Bridge.cjs +1 -1
- package/dist/runtime/Tandem.NodeApiSpike.Bridge.d.ts +8 -1
- package/dist/runtime/Tandem.NodeApiSpike.Bridge.deps.json +55 -55
- package/dist/runtime/Tandem.NodeApiSpike.Bridge.dll +0 -0
- package/dist/runtime/Tandem.NodeApiSpike.Bridge.mjs +1 -1
- package/dist/runtime/Tandem.OpenAICompatible.dll +0 -0
- package/dist/runtime/Tandem.Terminal.dll +0 -0
- package/dist/runtime/Tandem.dll +0 -0
- package/dist/runtime/loader.mjs +5 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -79,3 +79,38 @@ npm pack
|
|
|
79
79
|
`npm pack` and `npm publish` build fresh output before packaging. The npm package contains
|
|
80
80
|
`dist`, including one copy of the vendored bridge in `dist/runtime`. Update `runtime` from
|
|
81
81
|
a tested Tandem bridge build before releasing runtime changes.
|
|
82
|
+
|
|
83
|
+
## Runtime-sized collections
|
|
84
|
+
|
|
85
|
+
Use `collection` for a list whose size is known at execution time. Declare its
|
|
86
|
+
item/result schemas and agents, select items from state, and apply the ordered
|
|
87
|
+
results. Native Tandem owns scheduling through `max`; zero and one item need no
|
|
88
|
+
special graph.
|
|
89
|
+
|
|
90
|
+
`taskAgent<Input, Output>` defines a model participant with validated input and
|
|
91
|
+
output. Inside a collection, `context.run(agent, input)` invokes only agents
|
|
92
|
+
declared on that collection. Await each call before the next. Scope use after
|
|
93
|
+
completion and sibling parallel agent calls are rejected. Operational failure
|
|
94
|
+
fails the collection, drains active work, and skips application of results.
|
|
95
|
+
|
|
96
|
+
```ts
|
|
97
|
+
const canonicalise = collection({
|
|
98
|
+
id: "canonicalise",
|
|
99
|
+
item: Proposition,
|
|
100
|
+
result: Claim,
|
|
101
|
+
agents: [canonicaliser],
|
|
102
|
+
max: 6,
|
|
103
|
+
items: (state: SourceState) => state.propositions,
|
|
104
|
+
execute: (proposition, context) => context.run(canonicaliser, proposition),
|
|
105
|
+
apply: (state, claims) => ({ ...state, claims }),
|
|
106
|
+
});
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
The executable [collection example](tests/collection-child.ts) includes
|
|
110
|
+
conditional recovery, persistence, cancellation and concurrent source runs.
|
|
111
|
+
Agent visits remain in the source run's native observations and ledger.
|
|
112
|
+
|
|
113
|
+
Agent definitions may be reused across collections. Native Tandem binds each under
|
|
114
|
+
its collection name. Scoped observations and accepted ledger values carry a
|
|
115
|
+
`visitId` so concurrent calls can be correlated without changing their semantic
|
|
116
|
+
`stepId`.
|
package/dist/index.d.ts
CHANGED
|
@@ -55,7 +55,7 @@ export interface Parallel<TState> extends Participant<TState> {
|
|
|
55
55
|
export interface Terminal<TState> extends Participant<TState> {
|
|
56
56
|
readonly kind: "terminal";
|
|
57
57
|
}
|
|
58
|
-
type Node<TState> = Stage<TState> | Interaction<TState, unknown, unknown> | Agent<TState> | Parallel<TState> | Terminal<TState>;
|
|
58
|
+
type Node<TState> = Collection<TState> | Stage<TState> | Interaction<TState, unknown, unknown> | Agent<TState> | Parallel<TState> | Terminal<TState>;
|
|
59
59
|
export declare function stage<TState>(definition: {
|
|
60
60
|
id: string;
|
|
61
61
|
execute: (state: TState, context: {
|
|
@@ -63,6 +63,44 @@ export declare function stage<TState>(definition: {
|
|
|
63
63
|
}) => TState | Promise<TState>;
|
|
64
64
|
persist?: boolean;
|
|
65
65
|
}): Stage<TState>;
|
|
66
|
+
declare const taskAgentBrand: unique symbol;
|
|
67
|
+
export interface TaskAgentReference {
|
|
68
|
+
readonly id: string;
|
|
69
|
+
readonly [taskAgentBrand]: true;
|
|
70
|
+
}
|
|
71
|
+
export interface TaskAgent<TInput, TOutput> extends TaskAgentReference {
|
|
72
|
+
readonly input: z.ZodType<TInput>;
|
|
73
|
+
readonly result: z.ZodType<TOutput>;
|
|
74
|
+
}
|
|
75
|
+
export interface CollectionContext {
|
|
76
|
+
readonly signal: AbortSignal;
|
|
77
|
+
run<TInput, TOutput>(agent: TaskAgent<TInput, TOutput>, input: NoInfer<TInput>): Promise<TOutput>;
|
|
78
|
+
}
|
|
79
|
+
export interface Collection<TState> extends Participant<TState> {
|
|
80
|
+
readonly kind: "collection";
|
|
81
|
+
}
|
|
82
|
+
export interface TaskAgentDefinition<TInput, TOutput> extends Omit<AgentDefinition<TInput, TOutput>, "output" | "capabilities" | "workspace" | "checkpoint"> {
|
|
83
|
+
input: z.ZodType<TInput>;
|
|
84
|
+
result: z.ZodType<TOutput>;
|
|
85
|
+
output: Omit<Extract<NonNullable<AgentDefinition<TInput, TOutput>["output"]>, {
|
|
86
|
+
schema: unknown;
|
|
87
|
+
}>, "apply"> | Omit<Extract<NonNullable<AgentDefinition<TInput, TOutput>["output"]>, {
|
|
88
|
+
raw: true;
|
|
89
|
+
}>, "apply">;
|
|
90
|
+
}
|
|
91
|
+
export declare function taskAgent<TInput, TOutput>(definition: TaskAgentDefinition<TInput, TOutput>): TaskAgent<TInput, TOutput>;
|
|
92
|
+
interface CollectionDefinition<TState, TItem, TResult> {
|
|
93
|
+
id: string;
|
|
94
|
+
item: z.ZodType<TItem>;
|
|
95
|
+
result: z.ZodType<TResult>;
|
|
96
|
+
items: (state: TState) => readonly TItem[];
|
|
97
|
+
agents: readonly TaskAgentReference[];
|
|
98
|
+
execute: (item: TItem, context: CollectionContext) => Promise<TResult> | TResult;
|
|
99
|
+
apply: (state: TState, results: readonly TResult[]) => TState;
|
|
100
|
+
max: number;
|
|
101
|
+
persist?: boolean;
|
|
102
|
+
}
|
|
103
|
+
export declare function collection<TState, TItem, TResult>(definition: CollectionDefinition<TState, TItem, TResult>): Collection<TState>;
|
|
66
104
|
export declare function interaction<TState, TRequest, TResponse>(definition: {
|
|
67
105
|
id: string;
|
|
68
106
|
requestSchema: z.ZodType<TRequest>;
|
|
@@ -221,7 +259,7 @@ export declare function output<TState>(definition: {
|
|
|
221
259
|
persist?: boolean;
|
|
222
260
|
}): Terminal<TState>;
|
|
223
261
|
export interface OrdinaryRoute<TState> {
|
|
224
|
-
readonly from: Stage<TState> | Interaction<TState, unknown, unknown>;
|
|
262
|
+
readonly from: Stage<TState> | Collection<TState> | Interaction<TState, unknown, unknown>;
|
|
225
263
|
readonly to: Node<TState>;
|
|
226
264
|
readonly label: string;
|
|
227
265
|
readonly outcome?: never;
|
|
@@ -275,7 +313,8 @@ export interface InspectedRoute {
|
|
|
275
313
|
}
|
|
276
314
|
export interface InspectedNode {
|
|
277
315
|
readonly id: string;
|
|
278
|
-
readonly kind: "stage" | "interaction" | "agent" | "parallel" | "completion" | "failure";
|
|
316
|
+
readonly kind: "stage" | "interaction" | "agent" | "parallel" | "collection" | "completion" | "failure";
|
|
317
|
+
readonly agents?: readonly string[];
|
|
279
318
|
readonly persist?: boolean;
|
|
280
319
|
readonly interaction?: {
|
|
281
320
|
readonly requestSchema: unknown;
|
|
@@ -304,6 +343,8 @@ export interface RunResult<TState> {
|
|
|
304
343
|
readonly summary: string | null;
|
|
305
344
|
}
|
|
306
345
|
export type RunObservation = {
|
|
346
|
+
readonly visitId?: string | null;
|
|
347
|
+
} & ({
|
|
307
348
|
readonly version: 1;
|
|
308
349
|
readonly kind: "stepStarted";
|
|
309
350
|
readonly stepId: string;
|
|
@@ -354,7 +395,7 @@ export type RunObservation = {
|
|
|
354
395
|
readonly message: string;
|
|
355
396
|
}[];
|
|
356
397
|
readonly rawResponse: string;
|
|
357
|
-
};
|
|
398
|
+
});
|
|
358
399
|
export interface TerminalPresentationOptions {
|
|
359
400
|
readonly truncatedToolNames?: readonly string[];
|
|
360
401
|
}
|
|
@@ -377,6 +418,7 @@ export type AcceptedValue = {
|
|
|
377
418
|
readonly version: 1;
|
|
378
419
|
readonly kind: K;
|
|
379
420
|
readonly stepId: string;
|
|
421
|
+
readonly visitId?: string | null;
|
|
380
422
|
readonly valueType: string | null;
|
|
381
423
|
readonly payload: unknown | null;
|
|
382
424
|
};
|
package/dist/index.js
CHANGED
|
@@ -332,6 +332,55 @@ class StageImplementation extends NodeImplementation {
|
|
|
332
332
|
export function stage(definition) {
|
|
333
333
|
return new StageImplementation(definition.id, definition.persist, definition.execute);
|
|
334
334
|
}
|
|
335
|
+
const taskAgentBrand = Symbol("taskAgent");
|
|
336
|
+
class TaskAgentImplementation {
|
|
337
|
+
id;
|
|
338
|
+
input;
|
|
339
|
+
result;
|
|
340
|
+
[taskAgentBrand] = true;
|
|
341
|
+
state;
|
|
342
|
+
participant;
|
|
343
|
+
constructor(id, input, result, definition) {
|
|
344
|
+
this.id = id;
|
|
345
|
+
this.input = input;
|
|
346
|
+
this.result = result;
|
|
347
|
+
this.state = z.object({ input, output: z.object({ value: result }).nullable() });
|
|
348
|
+
this.participant = agent({
|
|
349
|
+
...definition,
|
|
350
|
+
message: (state) => definition.message(state.input),
|
|
351
|
+
output: {
|
|
352
|
+
...definition.output,
|
|
353
|
+
validateFor: definition.output.validateFor
|
|
354
|
+
? (state, value) => definition.output.validateFor(state.input, value)
|
|
355
|
+
: undefined,
|
|
356
|
+
apply: (state, value) => ({
|
|
357
|
+
...state,
|
|
358
|
+
output: { value },
|
|
359
|
+
}),
|
|
360
|
+
},
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
export function taskAgent(definition) {
|
|
365
|
+
return new TaskAgentImplementation(definition.id, definition.input, definition.result, definition);
|
|
366
|
+
}
|
|
367
|
+
class CollectionImplementation extends NodeImplementation {
|
|
368
|
+
definition;
|
|
369
|
+
kind = "collection";
|
|
370
|
+
constructor(definition) {
|
|
371
|
+
super(definition.id, definition.persist);
|
|
372
|
+
this.definition = definition;
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
export function collection(definition) {
|
|
376
|
+
if (!Number.isInteger(definition.max) || definition.max < 1 || definition.max > 2147483647) {
|
|
377
|
+
throw new TandemError("Collection max must be a positive 32-bit integer.");
|
|
378
|
+
}
|
|
379
|
+
if (new Set(definition.agents.map((agent) => agent.id)).size !== definition.agents.length) {
|
|
380
|
+
throw new TandemError("Collection agent IDs must be unique.");
|
|
381
|
+
}
|
|
382
|
+
return new CollectionImplementation(definition);
|
|
383
|
+
}
|
|
335
384
|
class InteractionImplementation extends NodeImplementation {
|
|
336
385
|
requestSchema;
|
|
337
386
|
responseSchema;
|
|
@@ -823,6 +872,15 @@ export function inspectPipeline(graph) {
|
|
|
823
872
|
const inspectNode = (node) => {
|
|
824
873
|
const implementation = node;
|
|
825
874
|
const persist = implementation.persist;
|
|
875
|
+
if (implementation instanceof CollectionImplementation) {
|
|
876
|
+
return {
|
|
877
|
+
id: node.id,
|
|
878
|
+
kind: "collection",
|
|
879
|
+
persist,
|
|
880
|
+
max: implementation.definition.max,
|
|
881
|
+
agents: implementation.definition.agents.map((agent) => node.id + "/" + agent.id),
|
|
882
|
+
};
|
|
883
|
+
}
|
|
826
884
|
if (node.kind === "interaction") {
|
|
827
885
|
const interaction = implementation;
|
|
828
886
|
return {
|
|
@@ -892,19 +950,35 @@ export function inspectPipeline(graph) {
|
|
|
892
950
|
}
|
|
893
951
|
const runObservationSchema = z.discriminatedUnion("kind", [
|
|
894
952
|
z
|
|
895
|
-
.object({
|
|
953
|
+
.object({
|
|
954
|
+
version: z.literal(1),
|
|
955
|
+
kind: z.literal("stepStarted"),
|
|
956
|
+
stepId: z.string().min(1),
|
|
957
|
+
visitId: z.string().nullable().optional(),
|
|
958
|
+
})
|
|
896
959
|
.strict(),
|
|
897
960
|
z
|
|
898
|
-
.object({
|
|
961
|
+
.object({
|
|
962
|
+
version: z.literal(1),
|
|
963
|
+
kind: z.literal("stepCompleted"),
|
|
964
|
+
stepId: z.string().min(1),
|
|
965
|
+
visitId: z.string().nullable().optional(),
|
|
966
|
+
})
|
|
899
967
|
.strict(),
|
|
900
968
|
z
|
|
901
|
-
.object({
|
|
969
|
+
.object({
|
|
970
|
+
version: z.literal(1),
|
|
971
|
+
kind: z.literal("stepCancelled"),
|
|
972
|
+
stepId: z.string().min(1),
|
|
973
|
+
visitId: z.string().nullable().optional(),
|
|
974
|
+
})
|
|
902
975
|
.strict(),
|
|
903
976
|
z
|
|
904
977
|
.object({
|
|
905
978
|
version: z.literal(1),
|
|
906
979
|
kind: z.literal("stepFaulted"),
|
|
907
980
|
stepId: z.string().min(1),
|
|
981
|
+
visitId: z.string().nullable().optional(),
|
|
908
982
|
error: z.string(),
|
|
909
983
|
})
|
|
910
984
|
.strict(),
|
|
@@ -913,6 +987,7 @@ const runObservationSchema = z.discriminatedUnion("kind", [
|
|
|
913
987
|
version: z.literal(1),
|
|
914
988
|
kind: z.literal("agentText"),
|
|
915
989
|
stepId: z.string().min(1),
|
|
990
|
+
visitId: z.string().nullable().optional(),
|
|
916
991
|
text: z.string(),
|
|
917
992
|
})
|
|
918
993
|
.strict(),
|
|
@@ -921,6 +996,7 @@ const runObservationSchema = z.discriminatedUnion("kind", [
|
|
|
921
996
|
version: z.literal(1),
|
|
922
997
|
kind: z.literal("agentModelSelected"),
|
|
923
998
|
stepId: z.string().min(1),
|
|
999
|
+
visitId: z.string().nullable().optional(),
|
|
924
1000
|
modelId: z.string().min(1),
|
|
925
1001
|
})
|
|
926
1002
|
.strict(),
|
|
@@ -929,6 +1005,7 @@ const runObservationSchema = z.discriminatedUnion("kind", [
|
|
|
929
1005
|
version: z.literal(1),
|
|
930
1006
|
kind: z.literal("agentReasoning"),
|
|
931
1007
|
stepId: z.string().min(1),
|
|
1008
|
+
visitId: z.string().nullable().optional(),
|
|
932
1009
|
text: z.string(),
|
|
933
1010
|
})
|
|
934
1011
|
.strict(),
|
|
@@ -937,6 +1014,7 @@ const runObservationSchema = z.discriminatedUnion("kind", [
|
|
|
937
1014
|
version: z.literal(1),
|
|
938
1015
|
kind: z.literal("agentUsage"),
|
|
939
1016
|
stepId: z.string().min(1),
|
|
1017
|
+
visitId: z.string().nullable().optional(),
|
|
940
1018
|
inputTokens: z.number().int().nonnegative(),
|
|
941
1019
|
outputTokens: z.number().int().nonnegative(),
|
|
942
1020
|
reasoningTokens: z.number().int().nonnegative(),
|
|
@@ -949,6 +1027,7 @@ const runObservationSchema = z.discriminatedUnion("kind", [
|
|
|
949
1027
|
version: z.literal(1),
|
|
950
1028
|
kind: z.literal("structuredOutputRejected"),
|
|
951
1029
|
stepId: z.string().min(1),
|
|
1030
|
+
visitId: z.string().nullable().optional(),
|
|
952
1031
|
attempt: z.number().int().positive(),
|
|
953
1032
|
problems: z.array(z.object({ field: z.string(), message: z.string().min(1) }).strict()),
|
|
954
1033
|
rawResponse: z.string(),
|
|
@@ -965,6 +1044,7 @@ const acceptedKinds = [
|
|
|
965
1044
|
const acceptedValueSchema = z
|
|
966
1045
|
.object({
|
|
967
1046
|
kind: z.enum(acceptedKinds),
|
|
1047
|
+
visitId: z.string().nullable().optional(),
|
|
968
1048
|
stepId: z.string().min(1),
|
|
969
1049
|
valueType: z.string().min(1).nullable(),
|
|
970
1050
|
payload: z.unknown().nullable(),
|
|
@@ -989,6 +1069,7 @@ export async function inspectAccepted(options) {
|
|
|
989
1069
|
version: 1,
|
|
990
1070
|
kind: value.kind,
|
|
991
1071
|
stepId: value.stepId,
|
|
1072
|
+
...(value.visitId == null ? {} : { visitId: value.visitId }),
|
|
992
1073
|
valueType: value.valueType,
|
|
993
1074
|
payload: value.payload,
|
|
994
1075
|
}));
|
|
@@ -1137,6 +1218,64 @@ function interactionHandlerEntries(handlers) {
|
|
|
1137
1218
|
function compileNode(node, stateSchema, callbacks) {
|
|
1138
1219
|
const implementation = node;
|
|
1139
1220
|
const base = { id: node.id, persist: implementation.persist };
|
|
1221
|
+
if (implementation instanceof CollectionImplementation) {
|
|
1222
|
+
const definition = implementation.definition;
|
|
1223
|
+
const agents = definition.agents.map((value) => {
|
|
1224
|
+
if (!(value instanceof TaskAgentImplementation))
|
|
1225
|
+
throw new TandemError("Use taskAgent to declare collection agents.");
|
|
1226
|
+
return compileNode(value.participant, value.state, callbacks);
|
|
1227
|
+
});
|
|
1228
|
+
const itemsCallback = callbacks.registerSync((state) => serializeBoundary(z.array(definition.item), definition.items(parseJson(stateSchema, state, node.id + " state")), node.id + " items"));
|
|
1229
|
+
const runCallback = callbacks.registerAsync(async (item, scopeId, signal) => {
|
|
1230
|
+
let active = false;
|
|
1231
|
+
let closed = false;
|
|
1232
|
+
const context = {
|
|
1233
|
+
signal,
|
|
1234
|
+
async run(value, input) {
|
|
1235
|
+
if (closed)
|
|
1236
|
+
throw new TandemError("Collection scope has ended.");
|
|
1237
|
+
if (active)
|
|
1238
|
+
throw new TandemError("Collection item agents must be awaited serially.");
|
|
1239
|
+
if (!definition.agents.includes(value) || !(value instanceof TaskAgentImplementation)) {
|
|
1240
|
+
throw new TandemError("Agent is not declared in this collection.");
|
|
1241
|
+
}
|
|
1242
|
+
signal.throwIfAborted();
|
|
1243
|
+
active = true;
|
|
1244
|
+
try {
|
|
1245
|
+
const { runCollectionAgentAsync } = await import("./runtime/loader.mjs");
|
|
1246
|
+
const response = await runCollectionAgentAsync(scopeId, value.id, serializeBoundary(value.state, { input, output: null }, value.id + " input"));
|
|
1247
|
+
const state = parseJson(value.state, response, value.id + " output");
|
|
1248
|
+
if (state.output === null)
|
|
1249
|
+
throw new TandemError("Agent returned no output.");
|
|
1250
|
+
return parse(value.result, state.output.value, value.id + " result");
|
|
1251
|
+
}
|
|
1252
|
+
finally {
|
|
1253
|
+
active = false;
|
|
1254
|
+
}
|
|
1255
|
+
},
|
|
1256
|
+
};
|
|
1257
|
+
try {
|
|
1258
|
+
const result = await definition.execute(parseJson(definition.item, item, node.id + " item"), context);
|
|
1259
|
+
if (active)
|
|
1260
|
+
throw new TandemError("Collection item returned before its agent completed.");
|
|
1261
|
+
signal.throwIfAborted();
|
|
1262
|
+
return serializeBoundary(definition.result, result, node.id + " result");
|
|
1263
|
+
}
|
|
1264
|
+
finally {
|
|
1265
|
+
closed = true;
|
|
1266
|
+
}
|
|
1267
|
+
});
|
|
1268
|
+
const applyCallback = callbacks.registerSync((state, results) => serializeBoundary(stateSchema, definition.apply(parseJson(stateSchema, state, node.id + " state"), parseJson(z.array(definition.result), results, node.id + " results")), node.id + " output"));
|
|
1269
|
+
return {
|
|
1270
|
+
...base,
|
|
1271
|
+
kind: "collection",
|
|
1272
|
+
agents,
|
|
1273
|
+
max: definition.max,
|
|
1274
|
+
itemsCallback,
|
|
1275
|
+
runCallback,
|
|
1276
|
+
applyCallback,
|
|
1277
|
+
};
|
|
1278
|
+
}
|
|
1140
1279
|
if (implementation instanceof StageImplementation) {
|
|
1141
1280
|
const run = callbacks.registerAsync(async (state, _, signal) => serializeBoundary(stateSchema, await implementation.execute(parseJson(stateSchema, state, `${node.id} input`), {
|
|
1142
1281
|
signal,
|
|
@@ -1326,13 +1465,9 @@ function compileAgentOutput(id, output, stateSchema, callbacks) {
|
|
|
1326
1465
|
? callbacks.registerSync((_, input) => issuesParsed(z.unknown(), output.parse(JSON.parse(input))))
|
|
1327
1466
|
: callbacks.registerSync((_, input) => issues(output.schema, input));
|
|
1328
1467
|
const validateFor = output.validateFor
|
|
1329
|
-
? callbacks.registerSync((state, input) => validationProblems(output.validateFor(parseJson(stateSchema, state, `${id} state`), raw
|
|
1330
|
-
? JSON.parse(input)
|
|
1331
|
-
: parseJson(output.schema, input, `${id} output`)), `${id} output contextual validation`))
|
|
1468
|
+
? callbacks.registerSync((state, input) => validationProblems(output.validateFor(parseJson(stateSchema, state, `${id} state`), raw ? JSON.parse(input) : parseJson(output.schema, input, `${id} output`)), `${id} output contextual validation`))
|
|
1332
1469
|
: undefined;
|
|
1333
|
-
const apply = callbacks.registerSync((state, input) => serializeBoundary(stateSchema, output.apply(parseJson(stateSchema, state, `${id} state`), raw
|
|
1334
|
-
? JSON.parse(input)
|
|
1335
|
-
: parseJson(output.schema, input, `${id} output`)), `${id} applied state`));
|
|
1470
|
+
const apply = callbacks.registerSync((state, input) => serializeBoundary(stateSchema, output.apply(parseJson(stateSchema, state, `${id} state`), raw ? JSON.parse(input) : parseJson(output.schema, input, `${id} output`)), `${id} applied state`));
|
|
1336
1471
|
return {
|
|
1337
1472
|
instructions: output.instructions,
|
|
1338
1473
|
...(raw
|
|
Binary file
|
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Generated for: Tandem.NodeApiSpike.Bridge 0.1.0
|
|
1
|
+
// Generated for: Tandem.NodeApiSpike.Bridge 0.2.1.0
|
|
2
2
|
// Generated by: Microsoft.JavaScript.NodeApi.Generator 0.9.0.0
|
|
3
3
|
/* eslint-disable */
|
|
4
4
|
|
|
@@ -7,6 +7,13 @@ import './System.Runtime';
|
|
|
7
7
|
|
|
8
8
|
/** Adapts JavaScript-authored participants to the Tandem runtime. */
|
|
9
9
|
export namespace NodePipelineBridge {
|
|
10
|
+
/** Executes a declared agent within an active collection item. */
|
|
11
|
+
export function runCollectionAgentAsync(
|
|
12
|
+
scopeId: string,
|
|
13
|
+
agentId: string,
|
|
14
|
+
state: string,
|
|
15
|
+
): Promise<string>;
|
|
16
|
+
|
|
10
17
|
/** Reads accepted semantic journal values from a packaged SQLite ledger. */
|
|
11
18
|
export function inspectAcceptedAsync(
|
|
12
19
|
ledgerPath: string,
|
|
@@ -7,23 +7,23 @@
|
|
|
7
7
|
"targets": {
|
|
8
8
|
".NETCoreApp,Version=v10.0": {},
|
|
9
9
|
".NETCoreApp,Version=v10.0/osx-arm64": {
|
|
10
|
-
"Tandem.NodeApiSpike.Bridge/0.1
|
|
10
|
+
"Tandem.NodeApiSpike.Bridge/0.2.1": {
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"Meridian.Tandem": "0.1
|
|
13
|
-
"Meridian.Tandem.Advanced": "0.1
|
|
14
|
-
"Meridian.Tandem.Ledger": "0.1
|
|
15
|
-
"Meridian.Tandem.OpenAICompatible": "0.1
|
|
16
|
-
"Meridian.Tandem.Terminal": "0.1
|
|
12
|
+
"Meridian.Tandem": "0.2.1",
|
|
13
|
+
"Meridian.Tandem.Advanced": "0.2.1",
|
|
14
|
+
"Meridian.Tandem.Ledger": "0.2.1",
|
|
15
|
+
"Meridian.Tandem.OpenAICompatible": "0.2.1",
|
|
16
|
+
"Meridian.Tandem.Terminal": "0.2.1",
|
|
17
17
|
"Microsoft.Extensions.AI.OpenAI": "10.8.3",
|
|
18
18
|
"Microsoft.JavaScript.NodeApi": "0.9.26",
|
|
19
19
|
"Microsoft.JavaScript.NodeApi.Generator": "0.9.26",
|
|
20
20
|
"OpenAI": "2.12.0",
|
|
21
21
|
"System.ClientModel": "1.14.0",
|
|
22
|
-
"Tandem.Advanced": "0.1.0
|
|
23
|
-
"Tandem": "0.1.0
|
|
24
|
-
"Tandem.Ledger": "0.1.0
|
|
25
|
-
"Tandem.OpenAICompatible": "0.1.0
|
|
26
|
-
"Tandem.Terminal": "0.1.0
|
|
22
|
+
"Tandem.Advanced": "0.2.1.0",
|
|
23
|
+
"Tandem": "0.2.1.0",
|
|
24
|
+
"Tandem.Ledger": "0.2.1.0",
|
|
25
|
+
"Tandem.OpenAICompatible": "0.2.1.0",
|
|
26
|
+
"Tandem.Terminal": "0.2.1.0"
|
|
27
27
|
},
|
|
28
28
|
"runtime": {
|
|
29
29
|
"Tandem.NodeApiSpike.Bridge.dll": {}
|
|
@@ -643,7 +643,7 @@
|
|
|
643
643
|
}
|
|
644
644
|
}
|
|
645
645
|
},
|
|
646
|
-
"Meridian.Tandem/0.1
|
|
646
|
+
"Meridian.Tandem/0.2.1": {
|
|
647
647
|
"dependencies": {
|
|
648
648
|
"FluentValidation": "12.1.1",
|
|
649
649
|
"JsonSchema.Net.Generation": "7.3.11",
|
|
@@ -653,15 +653,15 @@
|
|
|
653
653
|
},
|
|
654
654
|
"runtime": {
|
|
655
655
|
"Tandem.dll": {
|
|
656
|
-
"assemblyVersion": "0.1.0
|
|
657
|
-
"fileVersion": "0.1.0
|
|
656
|
+
"assemblyVersion": "0.2.1.0",
|
|
657
|
+
"fileVersion": "0.2.1.0"
|
|
658
658
|
}
|
|
659
659
|
}
|
|
660
660
|
},
|
|
661
|
-
"Meridian.Tandem.Advanced/0.1
|
|
661
|
+
"Meridian.Tandem.Advanced/0.2.1": {
|
|
662
662
|
"dependencies": {
|
|
663
663
|
"FluentValidation": "12.1.1",
|
|
664
|
-
"Meridian.Tandem": "0.1
|
|
664
|
+
"Meridian.Tandem": "0.2.1",
|
|
665
665
|
"Microsoft.Agents.AI.Harness": "1.16.0",
|
|
666
666
|
"Microsoft.Agents.AI.Tools.Shell": "1.16.0-preview.260730.1",
|
|
667
667
|
"Microsoft.Extensions.AI": "10.8.3",
|
|
@@ -669,25 +669,25 @@
|
|
|
669
669
|
},
|
|
670
670
|
"runtime": {
|
|
671
671
|
"Tandem.Advanced.dll": {
|
|
672
|
-
"assemblyVersion": "0.1.0
|
|
673
|
-
"fileVersion": "0.1.0
|
|
672
|
+
"assemblyVersion": "0.2.1.0",
|
|
673
|
+
"fileVersion": "0.2.1.0"
|
|
674
674
|
}
|
|
675
675
|
}
|
|
676
676
|
},
|
|
677
|
-
"Meridian.Tandem.Ledger/0.1
|
|
677
|
+
"Meridian.Tandem.Ledger/0.2.1": {
|
|
678
678
|
"dependencies": {
|
|
679
|
-
"Meridian.Tandem": "0.1
|
|
679
|
+
"Meridian.Tandem": "0.2.1",
|
|
680
680
|
"Microsoft.Data.Sqlite": "10.0.10",
|
|
681
681
|
"SQLitePCLRaw.bundle_e_sqlite3": "2.1.12"
|
|
682
682
|
},
|
|
683
683
|
"runtime": {
|
|
684
684
|
"Tandem.Ledger.dll": {
|
|
685
|
-
"assemblyVersion": "0.1.0
|
|
686
|
-
"fileVersion": "0.1.0
|
|
685
|
+
"assemblyVersion": "0.2.1.0",
|
|
686
|
+
"fileVersion": "0.2.1.0"
|
|
687
687
|
}
|
|
688
688
|
}
|
|
689
689
|
},
|
|
690
|
-
"Meridian.Tandem.OpenAICompatible/0.1
|
|
690
|
+
"Meridian.Tandem.OpenAICompatible/0.2.1": {
|
|
691
691
|
"dependencies": {
|
|
692
692
|
"Microsoft.Extensions.AI": "10.8.3",
|
|
693
693
|
"OpenAI": "2.12.0",
|
|
@@ -695,67 +695,67 @@
|
|
|
695
695
|
},
|
|
696
696
|
"runtime": {
|
|
697
697
|
"Tandem.OpenAICompatible.dll": {
|
|
698
|
-
"assemblyVersion": "0.1.0
|
|
699
|
-
"fileVersion": "0.1.0
|
|
698
|
+
"assemblyVersion": "0.2.1.0",
|
|
699
|
+
"fileVersion": "0.2.1.0"
|
|
700
700
|
}
|
|
701
701
|
}
|
|
702
702
|
},
|
|
703
|
-
"Meridian.Tandem.Terminal/0.1
|
|
703
|
+
"Meridian.Tandem.Terminal/0.2.1": {
|
|
704
704
|
"dependencies": {
|
|
705
|
-
"Meridian.Tandem": "0.1
|
|
705
|
+
"Meridian.Tandem": "0.2.1",
|
|
706
706
|
"Spectre.Console": "0.57.2"
|
|
707
707
|
},
|
|
708
708
|
"runtime": {
|
|
709
709
|
"Tandem.Terminal.dll": {
|
|
710
|
-
"assemblyVersion": "0.1.0
|
|
711
|
-
"fileVersion": "0.1.0
|
|
710
|
+
"assemblyVersion": "0.2.1.0",
|
|
711
|
+
"fileVersion": "0.2.1.0"
|
|
712
712
|
}
|
|
713
713
|
}
|
|
714
714
|
},
|
|
715
|
-
"Tandem.Advanced/0.1.0
|
|
715
|
+
"Tandem.Advanced/0.2.1.0": {
|
|
716
716
|
"runtime": {
|
|
717
717
|
"Tandem.Advanced.dll": {
|
|
718
|
-
"assemblyVersion": "0.1.0
|
|
719
|
-
"fileVersion": "0.1.0
|
|
718
|
+
"assemblyVersion": "0.2.1.0",
|
|
719
|
+
"fileVersion": "0.2.1.0"
|
|
720
720
|
}
|
|
721
721
|
}
|
|
722
722
|
},
|
|
723
|
-
"Tandem/0.1.0
|
|
723
|
+
"Tandem/0.2.1.0": {
|
|
724
724
|
"runtime": {
|
|
725
725
|
"Tandem.dll": {
|
|
726
|
-
"assemblyVersion": "0.1.0
|
|
727
|
-
"fileVersion": "0.1.0
|
|
726
|
+
"assemblyVersion": "0.2.1.0",
|
|
727
|
+
"fileVersion": "0.2.1.0"
|
|
728
728
|
}
|
|
729
729
|
}
|
|
730
730
|
},
|
|
731
|
-
"Tandem.Ledger/0.1.0
|
|
731
|
+
"Tandem.Ledger/0.2.1.0": {
|
|
732
732
|
"runtime": {
|
|
733
733
|
"Tandem.Ledger.dll": {
|
|
734
|
-
"assemblyVersion": "0.1.0
|
|
735
|
-
"fileVersion": "0.1.0
|
|
734
|
+
"assemblyVersion": "0.2.1.0",
|
|
735
|
+
"fileVersion": "0.2.1.0"
|
|
736
736
|
}
|
|
737
737
|
}
|
|
738
738
|
},
|
|
739
|
-
"Tandem.OpenAICompatible/0.1.0
|
|
739
|
+
"Tandem.OpenAICompatible/0.2.1.0": {
|
|
740
740
|
"runtime": {
|
|
741
741
|
"Tandem.OpenAICompatible.dll": {
|
|
742
|
-
"assemblyVersion": "0.1.0
|
|
743
|
-
"fileVersion": "0.1.0
|
|
742
|
+
"assemblyVersion": "0.2.1.0",
|
|
743
|
+
"fileVersion": "0.2.1.0"
|
|
744
744
|
}
|
|
745
745
|
}
|
|
746
746
|
},
|
|
747
|
-
"Tandem.Terminal/0.1.0
|
|
747
|
+
"Tandem.Terminal/0.2.1.0": {
|
|
748
748
|
"runtime": {
|
|
749
749
|
"Tandem.Terminal.dll": {
|
|
750
|
-
"assemblyVersion": "0.1.0
|
|
751
|
-
"fileVersion": "0.1.0
|
|
750
|
+
"assemblyVersion": "0.2.1.0",
|
|
751
|
+
"fileVersion": "0.2.1.0"
|
|
752
752
|
}
|
|
753
753
|
}
|
|
754
754
|
}
|
|
755
755
|
}
|
|
756
756
|
},
|
|
757
757
|
"libraries": {
|
|
758
|
-
"Tandem.NodeApiSpike.Bridge/0.1
|
|
758
|
+
"Tandem.NodeApiSpike.Bridge/0.2.1": {
|
|
759
759
|
"type": "project",
|
|
760
760
|
"serviceable": false,
|
|
761
761
|
"sha512": ""
|
|
@@ -1103,52 +1103,52 @@
|
|
|
1103
1103
|
"path": "tavily/1.0.1",
|
|
1104
1104
|
"hashPath": "tavily.1.0.1.nupkg.sha512"
|
|
1105
1105
|
},
|
|
1106
|
-
"Meridian.Tandem/0.1
|
|
1106
|
+
"Meridian.Tandem/0.2.1": {
|
|
1107
1107
|
"type": "project",
|
|
1108
1108
|
"serviceable": false,
|
|
1109
1109
|
"sha512": ""
|
|
1110
1110
|
},
|
|
1111
|
-
"Meridian.Tandem.Advanced/0.1
|
|
1111
|
+
"Meridian.Tandem.Advanced/0.2.1": {
|
|
1112
1112
|
"type": "project",
|
|
1113
1113
|
"serviceable": false,
|
|
1114
1114
|
"sha512": ""
|
|
1115
1115
|
},
|
|
1116
|
-
"Meridian.Tandem.Ledger/0.1
|
|
1116
|
+
"Meridian.Tandem.Ledger/0.2.1": {
|
|
1117
1117
|
"type": "project",
|
|
1118
1118
|
"serviceable": false,
|
|
1119
1119
|
"sha512": ""
|
|
1120
1120
|
},
|
|
1121
|
-
"Meridian.Tandem.OpenAICompatible/0.1
|
|
1121
|
+
"Meridian.Tandem.OpenAICompatible/0.2.1": {
|
|
1122
1122
|
"type": "project",
|
|
1123
1123
|
"serviceable": false,
|
|
1124
1124
|
"sha512": ""
|
|
1125
1125
|
},
|
|
1126
|
-
"Meridian.Tandem.Terminal/0.1
|
|
1126
|
+
"Meridian.Tandem.Terminal/0.2.1": {
|
|
1127
1127
|
"type": "project",
|
|
1128
1128
|
"serviceable": false,
|
|
1129
1129
|
"sha512": ""
|
|
1130
1130
|
},
|
|
1131
|
-
"Tandem.Advanced/0.1.0
|
|
1131
|
+
"Tandem.Advanced/0.2.1.0": {
|
|
1132
1132
|
"type": "reference",
|
|
1133
1133
|
"serviceable": false,
|
|
1134
1134
|
"sha512": ""
|
|
1135
1135
|
},
|
|
1136
|
-
"Tandem/0.1.0
|
|
1136
|
+
"Tandem/0.2.1.0": {
|
|
1137
1137
|
"type": "reference",
|
|
1138
1138
|
"serviceable": false,
|
|
1139
1139
|
"sha512": ""
|
|
1140
1140
|
},
|
|
1141
|
-
"Tandem.Ledger/0.1.0
|
|
1141
|
+
"Tandem.Ledger/0.2.1.0": {
|
|
1142
1142
|
"type": "reference",
|
|
1143
1143
|
"serviceable": false,
|
|
1144
1144
|
"sha512": ""
|
|
1145
1145
|
},
|
|
1146
|
-
"Tandem.OpenAICompatible/0.1.0
|
|
1146
|
+
"Tandem.OpenAICompatible/0.2.1.0": {
|
|
1147
1147
|
"type": "reference",
|
|
1148
1148
|
"serviceable": false,
|
|
1149
1149
|
"sha512": ""
|
|
1150
1150
|
},
|
|
1151
|
-
"Tandem.Terminal/0.1.0
|
|
1151
|
+
"Tandem.Terminal/0.2.1.0": {
|
|
1152
1152
|
"type": "reference",
|
|
1153
1153
|
"serviceable": false,
|
|
1154
1154
|
"sha512": ""
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/runtime/Tandem.dll
CHANGED
|
Binary file
|
package/dist/runtime/loader.mjs
CHANGED
|
@@ -25,11 +25,11 @@ let runtime;
|
|
|
25
25
|
try {
|
|
26
26
|
runtime = await import(bridgeUrl.href);
|
|
27
27
|
} catch (error) {
|
|
28
|
-
throw new Error(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
);
|
|
28
|
+
throw new Error(`Tandem could not load the ${platform} bridge from ${bridgeUrl.pathname}.`, {
|
|
29
|
+
cause: error,
|
|
30
|
+
});
|
|
32
31
|
}
|
|
33
32
|
|
|
34
33
|
export const runRegisteredGraphAsync = runtime.NodePipelineBridge.runRegisteredGraphAsync;
|
|
35
|
-
export const inspectAcceptedAsync = runtime.NodePipelineBridge.inspectAcceptedAsync;
|
|
34
|
+
export const inspectAcceptedAsync = runtime.NodePipelineBridge.inspectAcceptedAsync;
|
|
35
|
+
export const runCollectionAgentAsync = runtime.NodePipelineBridge.runCollectionAgentAsync;
|
package/package.json
CHANGED