@kindgi/flow 0.1.4-rc.0 → 0.1.4-rc.2
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/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/pins.d.ts +6 -0
- package/dist/pins.d.ts.map +1 -1
- package/dist/pins.js +16 -4
- package/dist/pins.js.map +1 -1
- package/package.json +4 -4
- package/src/index.ts +1 -1
- package/src/pins.ts +24 -4
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export type { BackoffShape, ConvergenceMode, EdgePolicy, Expr, FanoutBranch, Fan
|
|
|
2
2
|
export { CONVERGENCE_MODES, EDGE_POLICY_PRIORITY_DEFAULT, EDGE_POLICY_PRIORITY_MAX, EDGE_POLICY_PRIORITY_MIN, END_NODE, LOOP_END_NODE, LOOP_START_NODE, OPERATORS, SENTINEL_IDS, START_NODE, SUBGRAPH_CONVERGENCE_MODES, isFanoutNode, isLeafNode, isLoopNode, isSubflowNode, } from './types.js';
|
|
3
3
|
export type { CycleError, DuplicateEdgeError, DuplicateNodeError, FlowError, InvalidEdgePolicyError, InvalidFanoutNodeError, InvalidFlowOutputError, InvalidMappingError, InvalidPredicateError, InvalidSubflowNodeError, LoopBodyCycleError, LoopBodyEdgeReferenceError, LoopBodyMissingStartError, LoopConcurrencyError, LoopMaxIterationsError, LoopOutputSchemaError, LoopVariantMismatchError, MissingStartEdgeError, ReservedIdError, SchemaValidationError, UnknownNodeReferenceError, } from './errors.js';
|
|
4
4
|
export { GRAPH_SCHEMA_URI, loadFlow } from './loader.js';
|
|
5
|
-
export { flowPinsDigest, flowRefs, withVersions } from './pins.js';
|
|
5
|
+
export { flowPinsDigest, flowRefs, overridableRefs, withVersions } from './pins.js';
|
|
6
6
|
export type { FlowPins, FlowRefs, FlowVersionOverrides } from './pins.js';
|
|
7
7
|
export { defineFlow } from './define.js';
|
|
8
8
|
export type { FlowSpec } from './define.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,YAAY,EACV,YAAY,EACZ,eAAe,EACf,UAAU,EACV,IAAI,EACJ,YAAY,EACZ,UAAU,EACV,eAAe,EACf,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,cAAc,EACd,QAAQ,EACR,cAAc,EACd,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,gBAAgB,EAChB,OAAO,EACP,OAAO,EACP,YAAY,EACZ,IAAI,EACJ,WAAW,EACX,QAAQ,EACR,WAAW,EACX,kBAAkB,EAClB,WAAW,EACX,UAAU,EACV,aAAa,GACd,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,iBAAiB,EACjB,4BAA4B,EAC5B,wBAAwB,EACxB,wBAAwB,EACxB,QAAQ,EACR,aAAa,EACb,eAAe,EACf,SAAS,EACT,YAAY,EACZ,UAAU,EACV,0BAA0B,EAC1B,YAAY,EACZ,UAAU,EACV,UAAU,EACV,aAAa,GACd,MAAM,YAAY,CAAC;AAEpB,YAAY,EACV,UAAU,EACV,kBAAkB,EAClB,kBAAkB,EAClB,SAAS,EACT,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,EACnB,qBAAqB,EACrB,uBAAuB,EACvB,kBAAkB,EAClB,0BAA0B,EAC1B,yBAAyB,EACzB,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,EACrB,wBAAwB,EACxB,qBAAqB,EACrB,eAAe,EACf,qBAAqB,EACrB,yBAAyB,GAC1B,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts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zC,YAAY,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACzF,YAAY,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACrE,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright (C) 2026 Kindgi Inc.
|
|
3
3
|
export { CONVERGENCE_MODES, EDGE_POLICY_PRIORITY_DEFAULT, EDGE_POLICY_PRIORITY_MAX, EDGE_POLICY_PRIORITY_MIN, END_NODE, LOOP_END_NODE, LOOP_START_NODE, OPERATORS, SENTINEL_IDS, START_NODE, SUBGRAPH_CONVERGENCE_MODES, isFanoutNode, isLeafNode, isLoopNode, isSubflowNode, } from './types.js';
|
|
4
4
|
export { GRAPH_SCHEMA_URI, loadFlow } from './loader.js';
|
|
5
|
-
export { flowPinsDigest, flowRefs, withVersions } from './pins.js';
|
|
5
|
+
export { flowPinsDigest, flowRefs, overridableRefs, withVersions } from './pins.js';
|
|
6
6
|
export { defineFlow } from './define.js';
|
|
7
7
|
export { evaluateExpr, MISSING_PATH, resolveMapping, resolvePath } from './evaluator.js';
|
|
8
8
|
export { getEffectivePriority, schedulerTick } from './scheduler.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,iCAAiC;AAgCjC,OAAO,EACL,iBAAiB,EACjB,4BAA4B,EAC5B,wBAAwB,EACxB,wBAAwB,EACxB,QAAQ,EACR,aAAa,EACb,eAAe,EACf,SAAS,EACT,YAAY,EACZ,UAAU,EACV,0BAA0B,EAC1B,YAAY,EACZ,UAAU,EACV,UAAU,EACV,aAAa,GACd,MAAM,YAAY,CAAC;AA0BpB,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,iCAAiC;AAgCjC,OAAO,EACL,iBAAiB,EACjB,4BAA4B,EAC5B,wBAAwB,EACxB,wBAAwB,EACxB,QAAQ,EACR,aAAa,EACb,eAAe,EACf,SAAS,EACT,YAAY,EACZ,UAAU,EACV,0BAA0B,EAC1B,YAAY,EACZ,UAAU,EACV,UAAU,EACV,aAAa,GACd,MAAM,YAAY,CAAC;AA0BpB,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAGpF,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzC,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAGzF,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC"}
|
package/dist/pins.d.ts
CHANGED
|
@@ -36,6 +36,12 @@ export interface FlowRefs {
|
|
|
36
36
|
* version, each id once, sorted.
|
|
37
37
|
*/
|
|
38
38
|
export declare function flowRefs(flow: Flow): FlowRefs;
|
|
39
|
+
/**
|
|
40
|
+
* What `withVersions` can run at other versions: every tool the flow runs
|
|
41
|
+
* and every agent, at a named version or not (an override replaces
|
|
42
|
+
* either), each id once, sorted.
|
|
43
|
+
*/
|
|
44
|
+
export declare function overridableRefs(flow: Flow): FlowRefs;
|
|
39
45
|
/** Exact versions to run a flow version with, over its pins: the shape of a comparison's override. */
|
|
40
46
|
export interface FlowVersionOverrides {
|
|
41
47
|
readonly tools?: Readonly<Record<string, string>>;
|
package/dist/pins.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pins.d.ts","sourceRoot":"","sources":["../src/pins.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,IAAI,EAA2C,MAAM,YAAY,CAAC;AAEhF;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,QAAQ;IACvB,0DAA0D;IAC1D,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACjD,uEAAuE;IACvE,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACnD;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CAGrD;AAED,0FAA0F;AAC1F,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;CACpC;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,IAAI,GAAG,QAAQ,
|
|
1
|
+
{"version":3,"file":"pins.d.ts","sourceRoot":"","sources":["../src/pins.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,IAAI,EAA2C,MAAM,YAAY,CAAC;AAEhF;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,QAAQ;IACvB,0DAA0D;IAC1D,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACjD,uEAAuE;IACvE,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACnD;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CAGrD;AAED,0FAA0F;AAC1F,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;CACpC;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,IAAI,GAAG,QAAQ,CAE7C;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,IAAI,GAAG,QAAQ,CAEpD;AAyBD,sGAAsG;AACtG,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAClD,QAAQ,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACpD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,oBAAoB,GAAG,IAAI,CAY9E"}
|
package/dist/pins.js
CHANGED
|
@@ -17,22 +17,34 @@ export function flowPinsDigest(pins) {
|
|
|
17
17
|
* version, each id once, sorted.
|
|
18
18
|
*/
|
|
19
19
|
export function flowRefs(flow) {
|
|
20
|
+
return collectedRefs(flow, false);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* What `withVersions` can run at other versions: every tool the flow runs
|
|
24
|
+
* and every agent, at a named version or not (an override replaces
|
|
25
|
+
* either), each id once, sorted.
|
|
26
|
+
*/
|
|
27
|
+
export function overridableRefs(flow) {
|
|
28
|
+
return collectedRefs(flow, true);
|
|
29
|
+
}
|
|
30
|
+
function collectedRefs(flow, namedAgents) {
|
|
20
31
|
const tools = new Set();
|
|
21
32
|
const agents = new Set();
|
|
22
|
-
collectRefs(flow.nodes, tools, agents);
|
|
33
|
+
collectRefs(flow.nodes, tools, agents, namedAgents);
|
|
23
34
|
return { tools: [...tools].sort(), agents: [...agents].sort() };
|
|
24
35
|
}
|
|
25
|
-
function collectRefs(nodes, tools, agents) {
|
|
36
|
+
function collectRefs(nodes, tools, agents, namedAgents) {
|
|
26
37
|
for (const node of nodes) {
|
|
27
38
|
if (isLoopNode(node))
|
|
28
|
-
collectRefs(node.body.nodes, tools, agents);
|
|
39
|
+
collectRefs(node.body.nodes, tools, agents, namedAgents);
|
|
29
40
|
else if (isFanoutNode(node))
|
|
30
41
|
for (const branch of node.branches)
|
|
31
42
|
tools.add(branch.handler);
|
|
32
43
|
else if (node.kind === 'tool')
|
|
33
44
|
tools.add(node.ref);
|
|
34
|
-
else if (node.kind === 'agent' && node.config?.version === undefined)
|
|
45
|
+
else if (node.kind === 'agent' && (namedAgents || node.config?.version === undefined)) {
|
|
35
46
|
agents.add(node.ref);
|
|
47
|
+
}
|
|
36
48
|
}
|
|
37
49
|
}
|
|
38
50
|
/**
|
package/dist/pins.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pins.js","sourceRoot":"","sources":["../src/pins.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,iCAAiC;AAEjC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAA4B,YAAY,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAwBhF;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,IAAc;IAC3C,MAAM,SAAS,GAAG,YAAY,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;IAC3E,OAAO,UAAU,UAAU,CAAC,QAAQ,CAAC,CAAC,MAA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
|
{
|
|
2
2
|
"name": "@kindgi/flow",
|
|
3
|
-
"version": "0.1.4-rc.
|
|
3
|
+
"version": "0.1.4-rc.2",
|
|
4
4
|
"description": "Flow model + predicate DSL for Kindgi™. Defines the task-flow shape (nodes, edges, conditional edges, data-flow mappings) executed by the kernel. Pure — no I/O, no database, no runtime. Ships types, a JSON-schema-validated loader (loadFlow / defineFlow), a predicate evaluator and mapping resolver (evaluateExpr / resolveMapping), and the scheduler tick (schedulerTick) the kernel uses to pick the nodes ready for concurrent execution.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
"type-manifest.json"
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@kindgi/schema": "0.1.4-rc.
|
|
34
|
-
"@kindgi/types": "0.1.4-rc.
|
|
33
|
+
"@kindgi/schema": "0.1.4-rc.2",
|
|
34
|
+
"@kindgi/types": "0.1.4-rc.2"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@kindgi/specs": "0.1.4-rc.
|
|
37
|
+
"@kindgi/specs": "0.1.4-rc.2",
|
|
38
38
|
"@types/node": "^22.10.5",
|
|
39
39
|
"typescript": "^5.7.3",
|
|
40
40
|
"vitest": "^2.1.8"
|
package/src/index.ts
CHANGED
|
@@ -74,7 +74,7 @@ export type {
|
|
|
74
74
|
} from './errors.js';
|
|
75
75
|
|
|
76
76
|
export { GRAPH_SCHEMA_URI, loadFlow } from './loader.js';
|
|
77
|
-
export { flowPinsDigest, flowRefs, withVersions } from './pins.js';
|
|
77
|
+
export { flowPinsDigest, flowRefs, overridableRefs, withVersions } from './pins.js';
|
|
78
78
|
export type { FlowPins, FlowRefs, FlowVersionOverrides } from './pins.js';
|
|
79
79
|
|
|
80
80
|
export { defineFlow } from './define.js';
|
package/src/pins.ts
CHANGED
|
@@ -50,18 +50,38 @@ export interface FlowRefs {
|
|
|
50
50
|
* version, each id once, sorted.
|
|
51
51
|
*/
|
|
52
52
|
export function flowRefs(flow: Flow): FlowRefs {
|
|
53
|
+
return collectedRefs(flow, false);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* What `withVersions` can run at other versions: every tool the flow runs
|
|
58
|
+
* and every agent, at a named version or not (an override replaces
|
|
59
|
+
* either), each id once, sorted.
|
|
60
|
+
*/
|
|
61
|
+
export function overridableRefs(flow: Flow): FlowRefs {
|
|
62
|
+
return collectedRefs(flow, true);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function collectedRefs(flow: Flow, namedAgents: boolean): FlowRefs {
|
|
53
66
|
const tools = new Set<string>();
|
|
54
67
|
const agents = new Set<string>();
|
|
55
|
-
collectRefs(flow.nodes, tools, agents);
|
|
68
|
+
collectRefs(flow.nodes, tools, agents, namedAgents);
|
|
56
69
|
return { tools: [...tools].sort(), agents: [...agents].sort() };
|
|
57
70
|
}
|
|
58
71
|
|
|
59
|
-
function collectRefs(
|
|
72
|
+
function collectRefs(
|
|
73
|
+
nodes: readonly FlowNode[],
|
|
74
|
+
tools: Set<string>,
|
|
75
|
+
agents: Set<string>,
|
|
76
|
+
namedAgents: boolean,
|
|
77
|
+
): void {
|
|
60
78
|
for (const node of nodes) {
|
|
61
|
-
if (isLoopNode(node)) collectRefs(node.body.nodes, tools, agents);
|
|
79
|
+
if (isLoopNode(node)) collectRefs(node.body.nodes, tools, agents, namedAgents);
|
|
62
80
|
else if (isFanoutNode(node)) for (const branch of node.branches) tools.add(branch.handler);
|
|
63
81
|
else if (node.kind === 'tool') tools.add(node.ref);
|
|
64
|
-
else if (node.kind === 'agent' && node.config?.version === undefined)
|
|
82
|
+
else if (node.kind === 'agent' && (namedAgents || node.config?.version === undefined)) {
|
|
83
|
+
agents.add(node.ref);
|
|
84
|
+
}
|
|
65
85
|
}
|
|
66
86
|
}
|
|
67
87
|
|