@darkhorseprojects/circuitry 0.2.26 → 0.2.28

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/graph.d.ts CHANGED
@@ -181,9 +181,9 @@ export type CircuitryGraph = {
181
181
  nodes?: CircuitryNode[];
182
182
  /** Internal normalized execution edges. Authored graph files must not set this. */
183
183
  edges?: CircuitryEdge[];
184
- /** Rejected legacy field. */
184
+ /** Forbidden in authored v0.2 graph files. */
185
185
  agents?: never;
186
- /** Rejected legacy field. */
186
+ /** Forbidden in authored v0.2 graph files. */
187
187
  inputs?: never;
188
188
  runtime?: CircuitryRuntime;
189
189
  validation?: CircuitryGraphValidation;
package/dist/index.js CHANGED
@@ -163,16 +163,16 @@ var validateCircuitryGraphInternal = (graph, standard = {}, options) => {
163
163
  addError("missing_resources", "Circuitry v0.2 graphs must use a resources: section", ["resources"]);
164
164
  }
165
165
  if (graphObject.agents && Object.keys(graphObject.agents).length > 0) {
166
- addError("legacy_agents", "Circuitry v0.2 graphs must not use legacy agents: section", ["agents"]);
166
+ addError("forbidden_agents", "Circuitry v0.2 graph files must not use top-level agents:; use resources:", ["agents"]);
167
167
  }
168
168
  if (graphObject.inputs && Object.keys(graphObject.inputs).length > 0) {
169
- addError("legacy_inputs", "Circuitry v0.2 graphs must not use legacy inputs: section", ["inputs"]);
169
+ addError("forbidden_inputs", "Circuitry v0.2 graph files must not use top-level inputs:; use resources:", ["inputs"]);
170
170
  }
171
171
  if (graphObject.nodes && graphObject.nodes.length > 0) {
172
- addError("legacy_nodes", "Circuitry v0.2 graph files must not use nodes:; use resources:", ["nodes"]);
172
+ addError("forbidden_nodes", "Circuitry v0.2 graph files must not use top-level nodes:; use resources:", ["nodes"]);
173
173
  }
174
174
  if (graphObject.edges && graphObject.edges.length > 0) {
175
- addError("legacy_edges", "Circuitry v0.2 graph files must not use edges:; use resource inputs:", ["edges"]);
175
+ addError("forbidden_edges", "Circuitry v0.2 graph files must not use top-level edges:; use resource inputs:", ["edges"]);
176
176
  }
177
177
  }
178
178
  const normalized = normalizeCircuitryGraph(graphObject);
@@ -627,15 +627,15 @@ var runCircuitryGraphExecution = async ({
627
627
  const ready = [];
628
628
  for (const nodeId of nodeIds) {
629
629
  const node = executionGraph.nodes.get(nodeId);
630
- if (node.completed) {
631
- completed.add(nodeId);
632
- if (node.output) {
633
- outputs.set(nodeId, node.output);
634
- }
635
- continue;
636
- }
630
+ if (!node.completed) continue;
631
+ completed.add(nodeId);
632
+ outputs.set(nodeId, node.output || "");
633
+ }
634
+ for (const nodeId of nodeIds) {
635
+ if (completed.has(nodeId)) continue;
636
+ const node = executionGraph.nodes.get(nodeId);
637
637
  const count = node.inputNodeIds.filter(
638
- (sourceId) => executionGraph.nodes.has(sourceId)
638
+ (sourceId) => executionGraph.nodes.has(sourceId) && !completed.has(sourceId)
639
639
  ).length;
640
640
  remainingDependencies.set(nodeId, count);
641
641
  if (count === 0) {
package/dist/node.js CHANGED
@@ -144,16 +144,16 @@ var validateCircuitryGraphInternal = (graph, standard = {}, options) => {
144
144
  addError("missing_resources", "Circuitry v0.2 graphs must use a resources: section", ["resources"]);
145
145
  }
146
146
  if (graphObject.agents && Object.keys(graphObject.agents).length > 0) {
147
- addError("legacy_agents", "Circuitry v0.2 graphs must not use legacy agents: section", ["agents"]);
147
+ addError("forbidden_agents", "Circuitry v0.2 graph files must not use top-level agents:; use resources:", ["agents"]);
148
148
  }
149
149
  if (graphObject.inputs && Object.keys(graphObject.inputs).length > 0) {
150
- addError("legacy_inputs", "Circuitry v0.2 graphs must not use legacy inputs: section", ["inputs"]);
150
+ addError("forbidden_inputs", "Circuitry v0.2 graph files must not use top-level inputs:; use resources:", ["inputs"]);
151
151
  }
152
152
  if (graphObject.nodes && graphObject.nodes.length > 0) {
153
- addError("legacy_nodes", "Circuitry v0.2 graph files must not use nodes:; use resources:", ["nodes"]);
153
+ addError("forbidden_nodes", "Circuitry v0.2 graph files must not use top-level nodes:; use resources:", ["nodes"]);
154
154
  }
155
155
  if (graphObject.edges && graphObject.edges.length > 0) {
156
- addError("legacy_edges", "Circuitry v0.2 graph files must not use edges:; use resource inputs:", ["edges"]);
156
+ addError("forbidden_edges", "Circuitry v0.2 graph files must not use top-level edges:; use resource inputs:", ["edges"]);
157
157
  }
158
158
  }
159
159
  const normalized = normalizeCircuitryGraph(graphObject);
@@ -549,15 +549,15 @@ var runCircuitryGraphExecution = async ({
549
549
  const ready = [];
550
550
  for (const nodeId of nodeIds) {
551
551
  const node = executionGraph.nodes.get(nodeId);
552
- if (node.completed) {
553
- completed.add(nodeId);
554
- if (node.output) {
555
- outputs.set(nodeId, node.output);
556
- }
557
- continue;
558
- }
552
+ if (!node.completed) continue;
553
+ completed.add(nodeId);
554
+ outputs.set(nodeId, node.output || "");
555
+ }
556
+ for (const nodeId of nodeIds) {
557
+ if (completed.has(nodeId)) continue;
558
+ const node = executionGraph.nodes.get(nodeId);
559
559
  const count = node.inputNodeIds.filter(
560
- (sourceId) => executionGraph.nodes.has(sourceId)
560
+ (sourceId) => executionGraph.nodes.has(sourceId) && !completed.has(sourceId)
561
561
  ).length;
562
562
  remainingDependencies.set(nodeId, count);
563
563
  if (count === 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@darkhorseprojects/circuitry",
3
- "version": "0.2.26",
3
+ "version": "0.2.28",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",