effect-agent 0.1.0-beta.157 → 0.1.0-beta.158
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/{AgentRuntime-GQACxY_m.mjs → AgentRuntime-D4eoBpIW.mjs} +12 -6
- package/dist/{AgentRuntime-GQACxY_m.mjs.map → AgentRuntime-D4eoBpIW.mjs.map} +1 -1
- package/dist/{DurableAgentRuntime-BAQvZK1e.mjs → DurableAgentRuntime-eImXoGqD.mjs} +50 -11
- package/dist/DurableAgentRuntime-eImXoGqD.mjs.map +1 -0
- package/dist/{Subagent-JjcidJ7q.mjs → Subagent-211Oz2IN.mjs} +2 -2
- package/dist/{Subagent-JjcidJ7q.mjs.map → Subagent-211Oz2IN.mjs.map} +1 -1
- package/dist/capabilities/Subagent.mjs +1 -1
- package/dist/durable/DurableAgentRuntime.mjs +1 -1
- package/dist/durable/MessageDelivery.d.mts +20 -6
- package/dist/durable/MessageDelivery.mjs +49 -17
- package/dist/durable/MessageDelivery.mjs.map +1 -1
- package/dist/durable/MessageDeliveryStoreConformance.d.mts +40 -40
- package/dist/engine/AgentRuntime.mjs +1 -1
- package/dist/index.mjs +3 -3
- package/package.json +1 -1
- package/src/durable/DurableAgentRuntime.ts +79 -9
- package/src/durable/MessageDelivery.ts +64 -20
- package/src/engine/internal/agent-runtime.ts +23 -15
- package/dist/DurableAgentRuntime-BAQvZK1e.mjs.map +0 -1
|
@@ -3663,11 +3663,17 @@ const durationLimitError = (policy) => AgentPolicyError.make({
|
|
|
3663
3663
|
limit: "duration",
|
|
3664
3664
|
message: `Agent exceeded its ${Duration.format(policy.maxDuration)} duration limit`
|
|
3665
3665
|
});
|
|
3666
|
-
const enforceDurationDeadline = (execution, durationDeadlineMillis, durationLimit) =>
|
|
3667
|
-
const
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3666
|
+
const enforceDurationDeadline = (execution, durationDeadlineMillis, durationLimit) => {
|
|
3667
|
+
const beforeDeadline = Effect.fnUntraced(function* (effect) {
|
|
3668
|
+
const remaining = durationDeadlineMillis - (yield* Clock.currentTimeMillis);
|
|
3669
|
+
if (remaining <= 0) return yield* Effect.fail(durationLimit);
|
|
3670
|
+
return yield* effect.pipe(Effect.timeoutOrElse({
|
|
3671
|
+
duration: remaining,
|
|
3672
|
+
orElse: () => Effect.fail(durationLimit)
|
|
3673
|
+
}));
|
|
3674
|
+
});
|
|
3675
|
+
return Stream.fromPull(beforeDeadline(Stream.toPull(execution)).pipe(Effect.map(beforeDeadline))).pipe(Stream.scoped);
|
|
3676
|
+
};
|
|
3671
3677
|
const guardBudgetStream = (stream, budget) => budget === void 0 ? stream : Stream.transformPull(stream, (pull) => Effect.succeed(budget.guard(pull)));
|
|
3672
3678
|
function streamWithCompletion(agentValue, input, runOptions = {}, onCompleted, onUsage) {
|
|
3673
3679
|
const agent = { definition: "definition" in agentValue ? agentValue.definition : agentValue };
|
|
@@ -4801,4 +4807,4 @@ var AgentRuntime_exports = /* @__PURE__ */ __exportAll({
|
|
|
4801
4807
|
//#endregion
|
|
4802
4808
|
export { stream as _, SubagentDurability as a, withTerminalDefectEvent as b, decodeFinalOutput as c, projectCompletionOutput as d, renderInputPrompt as f, startUnknown as g, start as h, AgentSpawner as i, encodeRunDisposition as l, runUnknown as m, AgentChildPending as n, SubagentDurabilityError as o, run as p, AgentResultSchema as r, ToolCallWaiting as s, AgentRuntime_exports as t, projectCompletionFromToolOutput as u, streamUnknown as v, streamWithUsageAccountingUnknown as y };
|
|
4803
4809
|
|
|
4804
|
-
//# sourceMappingURL=AgentRuntime-
|
|
4810
|
+
//# sourceMappingURL=AgentRuntime-D4eoBpIW.mjs.map
|