llmist 10.1.1 → 10.2.1
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.cjs +65 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +65 -14
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -7913,19 +7913,16 @@ var init_typed_gadget = __esm({
|
|
|
7913
7913
|
|
|
7914
7914
|
// src/gadgets/executor.ts
|
|
7915
7915
|
function getHostExportsInternal() {
|
|
7916
|
-
|
|
7917
|
-
|
|
7918
|
-
|
|
7919
|
-
|
|
7920
|
-
|
|
7921
|
-
|
|
7922
|
-
|
|
7923
|
-
|
|
7924
|
-
};
|
|
7925
|
-
}
|
|
7926
|
-
return cachedHostExports;
|
|
7916
|
+
return {
|
|
7917
|
+
AgentBuilder,
|
|
7918
|
+
Gadget,
|
|
7919
|
+
createGadget,
|
|
7920
|
+
ExecutionTree,
|
|
7921
|
+
LLMist,
|
|
7922
|
+
z: import_zod2.z
|
|
7923
|
+
};
|
|
7927
7924
|
}
|
|
7928
|
-
var import_fast_deep_equal, import_zod2,
|
|
7925
|
+
var import_fast_deep_equal, import_zod2, GadgetExecutor;
|
|
7929
7926
|
var init_executor = __esm({
|
|
7930
7927
|
"src/gadgets/executor.ts"() {
|
|
7931
7928
|
"use strict";
|
|
@@ -10782,13 +10779,67 @@ var init_builder = __esm({
|
|
|
10782
10779
|
};
|
|
10783
10780
|
}
|
|
10784
10781
|
if (ctx.onSubagentEvent && ctx.invocationId) {
|
|
10782
|
+
const invocationId = ctx.invocationId;
|
|
10785
10783
|
this.subagentEventCallback = (event) => {
|
|
10786
10784
|
ctx.onSubagentEvent({
|
|
10787
10785
|
...event,
|
|
10788
|
-
gadgetInvocationId:
|
|
10789
|
-
depth
|
|
10786
|
+
gadgetInvocationId: invocationId,
|
|
10787
|
+
// Add depths: parent's depth + event's depth (for recursive nesting)
|
|
10788
|
+
depth: depth + (event.depth ?? 0)
|
|
10790
10789
|
});
|
|
10791
10790
|
};
|
|
10791
|
+
const existingHooks = this.hooks ?? {};
|
|
10792
|
+
this.hooks = {
|
|
10793
|
+
...existingHooks,
|
|
10794
|
+
observers: {
|
|
10795
|
+
...existingHooks.observers,
|
|
10796
|
+
onLLMCallStart: async (info) => {
|
|
10797
|
+
await existingHooks.observers?.onLLMCallStart?.(info);
|
|
10798
|
+
ctx.onSubagentEvent({
|
|
10799
|
+
type: "llm_call_start",
|
|
10800
|
+
event: {
|
|
10801
|
+
iteration: info.iteration,
|
|
10802
|
+
model: info.options.model
|
|
10803
|
+
},
|
|
10804
|
+
gadgetInvocationId: invocationId,
|
|
10805
|
+
depth,
|
|
10806
|
+
iteration: info.iteration
|
|
10807
|
+
});
|
|
10808
|
+
},
|
|
10809
|
+
onGadgetExecutionStart: async (gadgetCtx) => {
|
|
10810
|
+
await existingHooks.observers?.onGadgetExecutionStart?.(gadgetCtx);
|
|
10811
|
+
ctx.onSubagentEvent({
|
|
10812
|
+
type: "gadget_call",
|
|
10813
|
+
event: {
|
|
10814
|
+
type: "gadget_call",
|
|
10815
|
+
call: {
|
|
10816
|
+
gadgetName: gadgetCtx.gadgetName,
|
|
10817
|
+
invocationId: gadgetCtx.invocationId,
|
|
10818
|
+
parametersRaw: JSON.stringify(gadgetCtx.parameters),
|
|
10819
|
+
parameters: gadgetCtx.parameters,
|
|
10820
|
+
dependencies: []
|
|
10821
|
+
}
|
|
10822
|
+
},
|
|
10823
|
+
gadgetInvocationId: invocationId,
|
|
10824
|
+
depth
|
|
10825
|
+
});
|
|
10826
|
+
},
|
|
10827
|
+
onLLMCallComplete: async (info) => {
|
|
10828
|
+
await existingHooks.observers?.onLLMCallComplete?.(info);
|
|
10829
|
+
ctx.onSubagentEvent({
|
|
10830
|
+
type: "llm_call_end",
|
|
10831
|
+
event: {
|
|
10832
|
+
iteration: info.iteration,
|
|
10833
|
+
model: info.options.model,
|
|
10834
|
+
finishReason: info.finishReason ?? void 0,
|
|
10835
|
+
usage: info.usage
|
|
10836
|
+
},
|
|
10837
|
+
gadgetInvocationId: invocationId,
|
|
10838
|
+
depth
|
|
10839
|
+
});
|
|
10840
|
+
}
|
|
10841
|
+
}
|
|
10842
|
+
};
|
|
10792
10843
|
}
|
|
10793
10844
|
if (ctx.signal && !this.signal) {
|
|
10794
10845
|
this.signal = ctx.signal;
|