llmist 5.1.0 → 6.0.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/dist/{chunk-YJKUWFIC.js → chunk-EIE5VRSI.js} +60 -6
- package/dist/chunk-EIE5VRSI.js.map +1 -0
- package/dist/{chunk-F5QK5YVI.js → chunk-F62X5W2G.js} +2 -2
- package/dist/cli.cjs +119 -13
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +62 -10
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +59 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +2 -2
- package/dist/testing/index.cjs +59 -5
- package/dist/testing/index.cjs.map +1 -1
- package/dist/testing/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-YJKUWFIC.js.map +0 -1
- /package/dist/{chunk-F5QK5YVI.js.map → chunk-F62X5W2G.js.map} +0 -0
|
@@ -3923,6 +3923,8 @@ var init_stream_processor = __esm({
|
|
|
3923
3923
|
completedResults = /* @__PURE__ */ new Map();
|
|
3924
3924
|
/** Invocation IDs of gadgets that have failed (error or skipped due to dependency) */
|
|
3925
3925
|
failedInvocations = /* @__PURE__ */ new Set();
|
|
3926
|
+
/** Promises for independent gadgets currently executing (fire-and-forget) */
|
|
3927
|
+
inFlightExecutions = /* @__PURE__ */ new Map();
|
|
3926
3928
|
constructor(options) {
|
|
3927
3929
|
this.iteration = options.iteration;
|
|
3928
3930
|
this.registry = options.registry;
|
|
@@ -4031,6 +4033,16 @@ var init_stream_processor = __esm({
|
|
|
4031
4033
|
}
|
|
4032
4034
|
}
|
|
4033
4035
|
}
|
|
4036
|
+
const inFlightResults = await this.collectInFlightResults();
|
|
4037
|
+
for (const evt of inFlightResults) {
|
|
4038
|
+
yield evt;
|
|
4039
|
+
if (evt.type === "gadget_result") {
|
|
4040
|
+
didExecuteGadgets = true;
|
|
4041
|
+
if (evt.result.breaksLoop) {
|
|
4042
|
+
shouldBreakLoop = true;
|
|
4043
|
+
}
|
|
4044
|
+
}
|
|
4045
|
+
}
|
|
4034
4046
|
for await (const evt of this.processPendingGadgetsGenerator()) {
|
|
4035
4047
|
yield evt;
|
|
4036
4048
|
if (evt.type === "gadget_result") {
|
|
@@ -4216,12 +4228,24 @@ var init_stream_processor = __esm({
|
|
|
4216
4228
|
this.gadgetsAwaitingDependencies.set(call.invocationId, call);
|
|
4217
4229
|
return;
|
|
4218
4230
|
}
|
|
4231
|
+
for await (const evt of this.executeGadgetGenerator(call)) {
|
|
4232
|
+
yield evt;
|
|
4233
|
+
}
|
|
4234
|
+
for await (const evt of this.processPendingGadgetsGenerator()) {
|
|
4235
|
+
yield evt;
|
|
4236
|
+
}
|
|
4237
|
+
return;
|
|
4219
4238
|
}
|
|
4220
|
-
|
|
4221
|
-
|
|
4222
|
-
|
|
4223
|
-
|
|
4224
|
-
|
|
4239
|
+
if (this.stopOnGadgetError) {
|
|
4240
|
+
for await (const evt of this.executeGadgetGenerator(call)) {
|
|
4241
|
+
yield evt;
|
|
4242
|
+
}
|
|
4243
|
+
for await (const evt of this.processPendingGadgetsGenerator()) {
|
|
4244
|
+
yield evt;
|
|
4245
|
+
}
|
|
4246
|
+
} else {
|
|
4247
|
+
const executionPromise = this.executeGadgetAndCollect(call);
|
|
4248
|
+
this.inFlightExecutions.set(call.invocationId, executionPromise);
|
|
4225
4249
|
}
|
|
4226
4250
|
}
|
|
4227
4251
|
/**
|
|
@@ -4533,6 +4557,36 @@ var init_stream_processor = __esm({
|
|
|
4533
4557
|
}
|
|
4534
4558
|
}
|
|
4535
4559
|
}
|
|
4560
|
+
/**
|
|
4561
|
+
* Execute a gadget and collect all events into an array (non-blocking).
|
|
4562
|
+
* Used for fire-and-forget parallel execution of independent gadgets.
|
|
4563
|
+
*/
|
|
4564
|
+
async executeGadgetAndCollect(call) {
|
|
4565
|
+
const events = [];
|
|
4566
|
+
for await (const evt of this.executeGadgetGenerator(call)) {
|
|
4567
|
+
events.push(evt);
|
|
4568
|
+
}
|
|
4569
|
+
return events;
|
|
4570
|
+
}
|
|
4571
|
+
/**
|
|
4572
|
+
* Collect results from all fire-and-forget (in-flight) gadget executions.
|
|
4573
|
+
* Called at stream end to await parallel independent gadgets.
|
|
4574
|
+
* Clears the inFlightExecutions map after collection.
|
|
4575
|
+
* @returns Array of all events from completed gadgets
|
|
4576
|
+
*/
|
|
4577
|
+
async collectInFlightResults() {
|
|
4578
|
+
if (this.inFlightExecutions.size === 0) {
|
|
4579
|
+
return [];
|
|
4580
|
+
}
|
|
4581
|
+
this.logger.debug("Collecting in-flight gadget results", {
|
|
4582
|
+
count: this.inFlightExecutions.size,
|
|
4583
|
+
invocationIds: Array.from(this.inFlightExecutions.keys())
|
|
4584
|
+
});
|
|
4585
|
+
const promises = Array.from(this.inFlightExecutions.values());
|
|
4586
|
+
const results = await Promise.all(promises);
|
|
4587
|
+
this.inFlightExecutions.clear();
|
|
4588
|
+
return results.flat();
|
|
4589
|
+
}
|
|
4536
4590
|
/**
|
|
4537
4591
|
* Handle a gadget that cannot execute because a dependency failed.
|
|
4538
4592
|
* Calls the onDependencySkipped controller to allow customization.
|
|
@@ -11718,4 +11772,4 @@ export {
|
|
|
11718
11772
|
createEmptyStream,
|
|
11719
11773
|
createErrorStream
|
|
11720
11774
|
};
|
|
11721
|
-
//# sourceMappingURL=chunk-
|
|
11775
|
+
//# sourceMappingURL=chunk-EIE5VRSI.js.map
|