@sema-agent/core 1.402.0 → 1.404.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/agents/subagent.d.ts.map +1 -1
- package/dist/agents/subagent.js +12 -2
- package/dist/agents/subagent.js.map +1 -1
- package/dist/core/auto-compaction.d.ts.map +1 -1
- package/dist/core/auto-compaction.js +1 -1
- package/dist/core/auto-compaction.js.map +1 -1
- package/dist/core/runner/prepare-task.d.ts +2 -2
- package/dist/core/runner/prepare-task.d.ts.map +1 -1
- package/dist/core/runner/prepare-task.js +4 -2
- package/dist/core/runner/prepare-task.js.map +1 -1
- package/dist/core/runner/runtask.d.ts +1 -1
- package/dist/core/runner/runtask.d.ts.map +1 -1
- package/dist/core/runner/runtask.js +7 -6
- package/dist/core/runner/runtask.js.map +1 -1
- package/dist/core/session-store.d.ts.map +1 -1
- package/dist/core/session-store.js.map +1 -1
- package/dist/core/session.d.ts +4 -4
- package/dist/core/session.d.ts.map +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/session.js.map +1 -1
- package/dist/core/task-registry.d.ts.map +1 -1
- package/dist/core/task-registry.js +4 -3
- package/dist/core/task-registry.js.map +1 -1
- package/dist/engine/harness/agent-harness.d.ts.map +1 -1
- package/dist/engine/harness/agent-harness.js.map +1 -1
- package/dist/engine/harness/types.d.ts +7 -6
- package/dist/engine/harness/types.d.ts.map +1 -1
- package/dist/engine/session/memory-repo.d.ts +4 -4
- package/dist/engine/session/memory-repo.d.ts.map +1 -1
- package/dist/engine/session/memory-repo.js.map +1 -1
- package/dist/engine/session/repo-utils.d.ts +1 -1
- package/dist/engine/session/repo-utils.d.ts.map +1 -1
- package/dist/engine/session/repo-utils.js +2 -2
- package/dist/engine/session/repo-utils.js.map +1 -1
- package/dist/engine/session/session.d.ts +2 -2
- package/dist/engine/session/session.d.ts.map +1 -1
- package/dist/engine/session/session.js +1 -1
- package/dist/engine/session/session.js.map +1 -1
- 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/internal/harness.d.ts +2 -2
- package/dist/internal/harness.d.ts.map +1 -1
- package/dist/internal/harness.js +1 -1
- package/dist/internal/harness.js.map +1 -1
- package/dist/orchestration/run-workflow-tool.d.ts +1 -0
- package/dist/orchestration/run-workflow-tool.d.ts.map +1 -1
- package/dist/orchestration/run-workflow-tool.js +1 -0
- package/dist/orchestration/run-workflow-tool.js.map +1 -1
- package/dist/stores/file/session-store.d.ts +1 -2
- package/dist/stores/file/session-store.d.ts.map +1 -1
- package/dist/stores/file/session-store.js +5 -5
- package/dist/stores/file/session-store.js.map +1 -1
- package/dist/stores/pg.d.ts +1 -2
- package/dist/stores/pg.d.ts.map +1 -1
- package/dist/stores/pg.js +4 -4
- package/dist/stores/pg.js.map +1 -1
- package/package.json +1 -1
|
@@ -45,7 +45,7 @@ export declare class Runner {
|
|
|
45
45
|
private suggestNextPrompts;
|
|
46
46
|
private snapshotTurn;
|
|
47
47
|
runTask(spec: TaskSpec, internals?: RunInternals): Promise<TaskResult>;
|
|
48
|
-
resume(token: CheckpointToken, outcome: ResumeOutcome, taskConfig: ResumeTaskConfig): Promise<TaskResult>;
|
|
48
|
+
resume(token: CheckpointToken, outcome: ResumeOutcome, taskConfig: ResumeTaskConfig, internals?: RunInternals): Promise<TaskResult>;
|
|
49
49
|
resumeStream(token: CheckpointToken, outcome: ResumeOutcome, taskConfig: ResumeTaskConfig, internals?: RunInternals): Promise<TaskStream>;
|
|
50
50
|
private applyResumeDecision;
|
|
51
51
|
private resolvePendingCall;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtask.d.ts","sourceRoot":"","sources":["../../../src/core/runner/runtask.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAoB,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EASL,KAAK,UAAU,EAEf,KAAK,eAAe,EACpB,KAAK,YAAY,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AC,CAAA;KAAE,CAmDzF;YAGa,kBAAkB;IAwBhC,SAAS,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,eAAe,CAAC;IAYxD,aAAa,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE,SAAS,EAAE,SAAS,CAAC,EAAE,YAAY,GAAG,UAAU;YAshBzE,SAAS;YAqhIT,iBAAiB;YAsGjB,kBAAkB;YAsElB,YAAY;IA0EpB,OAAO,CAAC,IAAI,EAAE,QAAQ,EAAE,SAAS,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,UAAU,CAAC;IAmDtE,MAAM,CACV,KAAK,EAAE,eAAe,EACtB,OAAO,EAAE,aAAa,EACtB,UAAU,EAAE,gBAAgB,EAI5B,SAAS,CAAC,EAAE,YAAY,GACvB,OAAO,CAAC,UAAU,CAAC;IAyBhB,YAAY,CAChB,KAAK,EAAE,eAAe,EACtB,OAAO,EAAE,aAAa,EACtB,UAAU,EAAE,gBAAgB,EAoB5B,SAAS,CAAC,EAAE,YAAY,GACvB,OAAO,CAAC,UAAU,CAAC;YAsYR,mBAAmB;YA4GnB,kBAAkB;IAuIhC,OAAO,CAAC,sBAAsB;YA6BhB,kBAAkB;IAkDhC,OAAO,CAAC,qBAAqB;IAwD7B,OAAO,CAAC,qBAAqB;YAKf,MAAM;YA0HN,gBAAgB;CAc/B;AAGD,wBAAgB,OAAO,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAE7E;AA0DD,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -2575,7 +2575,7 @@ export class Runner {
|
|
|
2575
2575
|
try {
|
|
2576
2576
|
const report = await reconcileInterruptedSession(prepared.session, prepared.toolEffects, undefined, startedToolCallIds);
|
|
2577
2577
|
for (const orphan of report.recovered) {
|
|
2578
|
-
queue.push({ type: "tool_end", toolCallId: orphan.toolCallId, toolName: orphan.toolName, isError: true, ...ident() });
|
|
2578
|
+
queue.push({ type: "tool_end", toolCallId: orphan.toolCallId, toolName: orphan.toolName, ...(toolLabels.has(orphan.toolName) ? { label: toolLabels.get(orphan.toolName) } : {}), isError: true, ...ident() });
|
|
2579
2579
|
emitCommitted(orphan.entryId, "toolResult", orphan.toolCallId);
|
|
2580
2580
|
}
|
|
2581
2581
|
}
|
|
@@ -3069,8 +3069,8 @@ export class Runner {
|
|
|
3069
3069
|
}
|
|
3070
3070
|
return stream.result();
|
|
3071
3071
|
}
|
|
3072
|
-
async resume(token, outcome, taskConfig) {
|
|
3073
|
-
const stream = await this.resumeStream(token, outcome, taskConfig);
|
|
3072
|
+
async resume(token, outcome, taskConfig, internals) {
|
|
3073
|
+
const stream = await this.resumeStream(token, outcome, taskConfig, internals);
|
|
3074
3074
|
for await (const _ of stream) {
|
|
3075
3075
|
void _;
|
|
3076
3076
|
}
|
|
@@ -3266,7 +3266,7 @@ export class Runner {
|
|
|
3266
3266
|
}
|
|
3267
3267
|
else if (!completed.has(id)) {
|
|
3268
3268
|
const name = names.get(id) ?? "unknown";
|
|
3269
|
-
emit({ type: "tool_end", toolCallId: id, toolName: name, isError: true });
|
|
3269
|
+
emit({ type: "tool_end", toolCallId: id, toolName: name, ...((() => { const l = prepared.tools.find((t) => t.name === name)?.label; return l !== undefined && l !== name ? { label: l } : {}; })()), isError: true });
|
|
3270
3270
|
const eid = await prepared.session.appendMessage(toolResultMsg(id, name, formatHookFeedback(DEFERRED_REISSUE), true));
|
|
3271
3271
|
emitCommitted(eid, "toolResult", id);
|
|
3272
3272
|
}
|
|
@@ -3278,8 +3278,9 @@ export class Runner {
|
|
|
3278
3278
|
if (pendingAction.kind !== "tool_approval" || outcome.gate !== "policy_ask")
|
|
3279
3279
|
return;
|
|
3280
3280
|
const resolvedArgs = pendingAction.toolName === ASK_USER_QUESTION_TOOL_NAME ? pendingAction.args : (outcome.updatedInput ?? pendingAction.args);
|
|
3281
|
-
|
|
3282
|
-
|
|
3281
|
+
const pendingLabel = (() => { const l = prepared.tools.find((t) => t.name === pendingAction.toolName)?.label; return l !== undefined && l !== pendingAction.toolName ? { label: l } : {}; })();
|
|
3282
|
+
emit({ type: "tool_start", toolCallId: pendingAction.toolCallId, toolName: pendingAction.toolName, ...pendingLabel, args: resolvedArgs });
|
|
3283
|
+
const emitEnd = (isError) => emit({ type: "tool_end", toolCallId: pendingAction.toolCallId, toolName: pendingAction.toolName, ...pendingLabel, isError });
|
|
3283
3284
|
if (outcome.decision === "deny") {
|
|
3284
3285
|
emitEnd(true);
|
|
3285
3286
|
const reason = outcome.reason ? delimitUntrusted("reviewer note", outcome.reason) : `The pending tool call "${pendingAction.toolName}" was denied by an approver.`;
|