@sema-agent/core 1.452.0 → 2.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/agents/agent-transcript-tool.d.ts +15 -0
- package/dist/agents/agent-transcript-tool.js +122 -0
- package/dist/agents/cascade.js +5 -8
- package/dist/agents/repair-loop.d.ts +1 -1
- package/dist/agents/repair-loop.js +1 -1
- package/dist/agents/retain-ledger.d.ts +60 -0
- package/dist/agents/retain-ledger.js +225 -0
- package/dist/agents/roster-store.d.ts +1 -0
- package/dist/agents/roster-store.js +9 -0
- package/dist/agents/send-message-tool.d.ts +41 -0
- package/dist/agents/send-message-tool.js +469 -0
- package/dist/agents/subagent.d.ts +33 -108
- package/dist/agents/subagent.js +22 -834
- package/dist/agents/teacher.d.ts +0 -1
- package/dist/agents/teacher.js +0 -9
- package/dist/bin/sema-tb.js +3 -3
- package/dist/brain/anthropic.js +15 -40
- package/dist/brain/openai.js +15 -40
- package/dist/brain/reasoning.d.ts +1 -1
- package/dist/brain/stream-engine.js +2 -2
- package/dist/brain/stream-shared.d.ts +17 -0
- package/dist/brain/stream-shared.js +50 -0
- package/dist/brain/timeout.d.ts +1 -1
- package/dist/brain/timeout.js +1 -1
- package/dist/config/catalog.js +1 -3
- package/dist/config/defaults.d.ts +6 -0
- package/dist/config/defaults.js +6 -0
- package/dist/core/ask-question.d.ts +1 -1
- package/dist/core/background-shell.d.ts +1 -1
- package/dist/core/checkpoint-store.d.ts +0 -1
- package/dist/core/exec-gate.d.ts +1 -1
- package/dist/core/exec-output-tail.d.ts +1 -0
- package/dist/core/exec-output-tail.js +6 -0
- package/dist/core/file-snapshot-store.d.ts +1 -1
- package/dist/core/fs-write-gate-policy.d.ts +1 -1
- package/dist/core/git-worktree-env.d.ts +1 -1
- package/dist/core/hooks.d.ts +1 -1
- package/dist/core/image-downsample.d.ts +44 -0
- package/dist/core/image-downsample.js +97 -0
- package/dist/core/lsp.d.ts +1 -1
- package/dist/core/mcp.d.ts +3 -45
- package/dist/core/mcp.js +2 -97
- package/dist/core/media-byte-cap.d.ts +1 -1
- package/dist/core/memory-recall.d.ts +0 -12
- package/dist/core/memory-recall.js +0 -222
- package/dist/core/memory.d.ts +0 -6
- package/dist/core/memory.js +0 -88
- package/dist/core/message-utils.d.ts +1 -1
- package/dist/core/oracle-isolation.d.ts +1 -1
- package/dist/core/remote-env.d.ts +1 -1
- package/dist/core/roles.d.ts +1 -1
- package/dist/core/runner/active-skill-scope.d.ts +1 -1
- package/dist/core/runner/assemble-result.d.ts +0 -2
- package/dist/core/runner/memory-consolidation.d.ts +1 -1
- package/dist/core/runner/prepare-memory.d.ts +16 -0
- package/dist/core/runner/prepare-memory.js +191 -0
- package/dist/core/runner/prepare-task.d.ts +4 -28
- package/dist/core/runner/prepare-task.js +19 -207
- package/dist/core/runner/prompt-suggestions.d.ts +1 -1
- package/dist/core/runner/runtask.d.ts +2 -3
- package/dist/core/runner/runtask.js +337 -529
- package/dist/core/runner/session-rule-policy.d.ts +1 -1
- package/dist/core/runner/synthetic-tools.d.ts +5 -5
- package/dist/core/runner/synthetic-tools.js +4 -4
- package/dist/core/runner/tool-disclosure.d.ts +3 -3
- package/dist/core/runner/tool-disclosure.js +2 -2
- package/dist/core/runner/tool-output-projection.d.ts +6 -0
- package/dist/core/runner/tool-output-projection.js +81 -0
- package/dist/core/runtime.d.ts +1 -1
- package/dist/core/scheduler.d.ts +1 -1
- package/dist/core/sensitive-path-policy.d.ts +1 -1
- package/dist/core/session-reconcile.d.ts +1 -1
- package/dist/core/session-store.d.ts +2 -1
- package/dist/core/session-store.js +2 -1
- package/dist/core/session.d.ts +0 -1
- package/dist/core/task-registry-agent.d.ts +115 -0
- package/dist/core/task-registry-agent.js +1163 -0
- package/dist/core/task-registry-monitor.d.ts +13 -0
- package/dist/core/task-registry-monitor.js +347 -0
- package/dist/core/task-registry-shared.d.ts +294 -0
- package/dist/core/task-registry-shared.js +271 -0
- package/dist/core/task-registry-workflow.d.ts +5 -0
- package/dist/core/task-registry-workflow.js +143 -0
- package/dist/core/task-registry.d.ts +51 -216
- package/dist/core/task-registry.js +127 -1940
- package/dist/core/task-tool-shape.d.ts +32 -0
- package/dist/core/task-tool-shape.js +83 -0
- package/dist/core/tool-policy.d.ts +1 -2
- package/dist/core/tool-result-budget.d.ts +1 -1
- package/dist/core/tool-result-store.d.ts +2 -2
- package/dist/core/tool-result-store.js +1 -1
- package/dist/core/tools.d.ts +2 -3
- package/dist/core/tools.js +0 -8
- package/dist/core/trace.d.ts +2 -2
- package/dist/core/types.d.ts +0 -29
- package/dist/core/workflow-run-store-contract.d.ts +1 -1
- package/dist/core/workflow-run-store-contract.js +19 -19
- package/dist/engine/execution-env/node-execution-env.d.ts +13 -0
- package/dist/engine/execution-env/node-execution-env.js +55 -25
- package/dist/engine/lsp/frame-decoder.d.ts +1 -1
- package/dist/engine/lsp/frame-decoder.js +1 -1
- package/dist/engine/lsp/node-lsp-manager.d.ts +1 -1
- package/dist/engine/lsp/stdio-lsp-transport.js +2 -2
- package/dist/index.d.ts +16 -14
- package/dist/index.js +13 -11
- package/dist/internal/harness-types.d.ts +7 -0
- package/dist/internal/harness-types.js +1 -0
- package/dist/internal/harness.d.ts +1 -7
- package/dist/internal/harness.js +1 -0
- package/dist/orchestration/goal.js +2 -2
- package/dist/orchestration/run-workflow-tool.d.ts +1 -1
- package/dist/orchestration/workflow-types.d.ts +193 -0
- package/dist/orchestration/workflow-types.js +54 -0
- package/dist/orchestration/workflow.d.ts +3 -193
- package/dist/orchestration/workflow.js +7 -59
- package/dist/prompt-assembly/assemble.d.ts +3 -3
- package/dist/prompt-assembly/assemble.js +0 -16
- package/dist/prompt-assembly/explain.d.ts +1 -1
- package/dist/prompt-assembly/tool-catalog.d.ts +1 -1
- package/dist/prompts/default.d.ts +1 -6
- package/dist/prompts/default.js +3 -11
- package/dist/scenarios/env.d.ts +1 -1
- package/dist/scenarios/full-body.d.ts +0 -3
- package/dist/scenarios/full-body.js +0 -2
- package/dist/stores/file/background-agent-store.d.ts +2 -15
- package/dist/stores/file/background-agent-store.js +30 -100
- package/dist/stores/file/checkpoint-store.d.ts +1 -14
- package/dist/stores/file/checkpoint-store.js +47 -119
- package/dist/stores/file/file-snapshot-store.d.ts +1 -1
- package/dist/stores/file/shared-ledger.d.ts +35 -0
- package/dist/stores/file/shared-ledger.js +94 -0
- package/dist/stores/file/workflow-run-store.d.ts +1 -14
- package/dist/stores/file/workflow-run-store.js +24 -93
- package/dist/tools/fs/bash-readonly-classifier.d.ts +8 -0
- package/dist/tools/fs/bash-readonly-classifier.js +166 -0
- package/dist/tools/fs/fs-bash.d.ts +31 -0
- package/dist/tools/fs/fs-bash.js +672 -0
- package/dist/tools/fs/fs-pdf.d.ts +22 -0
- package/dist/tools/fs/fs-pdf.js +236 -0
- package/dist/tools/fs/fs-read.d.ts +8 -0
- package/dist/tools/fs/fs-read.js +286 -0
- package/dist/tools/fs/fs-search-tools.d.ts +5 -0
- package/dist/tools/fs/fs-search-tools.js +173 -0
- package/dist/tools/fs/fs-shared.d.ts +55 -0
- package/dist/tools/fs/fs-shared.js +144 -0
- package/dist/tools/fs/fs-write.d.ts +8 -0
- package/dist/tools/fs/fs-write.js +423 -0
- package/dist/tools/fs/index.d.ts +12 -65
- package/dist/tools/fs/index.js +26 -2090
- package/dist/tools/fs/pdf.d.ts +1 -1
- package/dist/tools/fs/repo-map.d.ts +3 -3
- package/dist/tools/fs/repo-map.js +1 -1
- package/dist/tools/fs/safety.d.ts +1 -1
- package/dist/tools/fs/search.d.ts +1 -1
- package/dist/tools/monitor.d.ts +1 -1
- package/dist/tools/scheduler-tools.d.ts +1 -1
- package/dist/tools/web.d.ts +2 -2
- package/dist/tools/web.js +1 -1
- package/dist/tools/worktree.d.ts +1 -1
- package/package.json +1 -1
- package/dist/core/dynamic-recall.d.ts +0 -32
- package/dist/core/dynamic-recall.js +0 -76
|
@@ -1,120 +1,19 @@
|
|
|
1
1
|
import type { AgentTool, ExecutionEnv } from "../internal/harness.js";
|
|
2
2
|
import type { ToolEffect } from "./types.js";
|
|
3
3
|
import { type BackgroundShellCapability, type BackgroundShellId } from "./background-shell.js";
|
|
4
|
-
import {
|
|
5
|
-
import { type
|
|
6
|
-
import type { WorkflowHandle, WorkflowRun } from "../orchestration/workflow.js";
|
|
4
|
+
import type { WorkflowRunStore } from "./workflow-run-store.js";
|
|
5
|
+
import { type BackgroundAgentStore } from "./background-agent-store.js";
|
|
7
6
|
import type { TaskNotificationPayload } from "./task-notification.js";
|
|
8
|
-
|
|
9
|
-
export
|
|
10
|
-
export type
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
token: string;
|
|
15
|
-
claimId: string;
|
|
16
|
-
reservedRev: number;
|
|
17
|
-
row: import("./background-agent-store.js").BackgroundAgentRecord;
|
|
18
|
-
}
|
|
19
|
-
export type TaskRetrievalStatus = "success" | "not_ready" | "timeout";
|
|
20
|
-
export interface UnifiedTaskOutput {
|
|
21
|
-
task_id: string;
|
|
22
|
-
type?: SemaTaskType | "unknown";
|
|
23
|
-
status?: SemaTaskStatus | string;
|
|
24
|
-
retrieval_status: TaskRetrievalStatus;
|
|
25
|
-
content?: string;
|
|
26
|
-
error?: string;
|
|
27
|
-
stoppedBy?: StopSource;
|
|
28
|
-
seq?: number;
|
|
29
|
-
partial_result?: boolean;
|
|
30
|
-
completionId?: string;
|
|
31
|
-
details?: unknown;
|
|
32
|
-
}
|
|
33
|
-
type UnifiedTaskResult = {
|
|
34
|
-
content: string;
|
|
35
|
-
details: UnifiedTaskOutput;
|
|
36
|
-
isError?: boolean;
|
|
37
|
-
};
|
|
38
|
-
export interface SemaTaskHandle {
|
|
39
|
-
id: string;
|
|
40
|
-
type: SemaTaskType;
|
|
41
|
-
status: SemaTaskStatus;
|
|
42
|
-
description?: string;
|
|
43
|
-
owner?: string;
|
|
44
|
-
scope?: string;
|
|
45
|
-
toolUseId?: string;
|
|
46
|
-
createdAt: number;
|
|
47
|
-
updatedAt: number;
|
|
48
|
-
outputFile?: string;
|
|
49
|
-
outputOffset?: number;
|
|
50
|
-
completionId?: string;
|
|
51
|
-
}
|
|
7
|
+
import { type SemaTaskType, type StopSource, type SemaTaskStatus, type TaskRetrievalStatus, type UnifiedTaskOutput, type UnifiedTaskResult, type SemaTaskHandle, type TaskAccess, type BackgroundAgentTaskHandle, type MonitorTimers, type RegisterMonitorInput, type RegisterWorkflowInput, canAccessWorkflowRun, clipTaskOutput, MONITOR_BATCH_WINDOW_MS, MONITOR_DEFAULT_TIMEOUT_MS, MONITOR_MAX_TIMEOUT_MS, MONITOR_MAX_BATCHES_PER_MINUTE } from "./task-registry-shared.js";
|
|
8
|
+
export { normalizeAgentName, DURABLE_AGENT_HEARTBEAT_MS, DURABLE_AGENT_HANDLE_RE, BG_AGENT_REAP_STOP_ERROR } from "./task-registry-shared.js";
|
|
9
|
+
export type { ParkedClaimTicket, RegisterBackgroundAgentInput } from "./task-registry-shared.js";
|
|
10
|
+
import type { RegisterBackgroundAgentInput, ParkedClaimTicket } from "./task-registry-shared.js";
|
|
11
|
+
export type { SemaTaskType, StopSource, SemaTaskStatus, TaskRetrievalStatus, UnifiedTaskOutput, SemaTaskHandle, TaskAccess, MonitorTimers, RegisterMonitorInput, RegisterWorkflowInput, };
|
|
12
|
+
export { canAccessWorkflowRun, clipTaskOutput, MONITOR_BATCH_WINDOW_MS, MONITOR_DEFAULT_TIMEOUT_MS, MONITOR_MAX_TIMEOUT_MS, MONITOR_MAX_BATCHES_PER_MINUTE };
|
|
52
13
|
export interface TaskKind {
|
|
53
14
|
type: SemaTaskType;
|
|
54
15
|
effect: ToolEffect;
|
|
55
16
|
}
|
|
56
|
-
export interface TaskAccess {
|
|
57
|
-
owner?: string;
|
|
58
|
-
scope?: string;
|
|
59
|
-
sessionId?: string;
|
|
60
|
-
}
|
|
61
|
-
interface DurableAgentLane {
|
|
62
|
-
store: BackgroundAgentStore;
|
|
63
|
-
record: BackgroundAgentRecord;
|
|
64
|
-
chain: Promise<void>;
|
|
65
|
-
written: boolean;
|
|
66
|
-
poisoned: boolean;
|
|
67
|
-
flushFailed: boolean;
|
|
68
|
-
redrives?: number;
|
|
69
|
-
}
|
|
70
|
-
interface BackgroundAgentTaskHandle extends SemaTaskHandle {
|
|
71
|
-
type: "background_agent";
|
|
72
|
-
abort: AbortController;
|
|
73
|
-
sessionId?: string;
|
|
74
|
-
durable?: DurableAgentLane;
|
|
75
|
-
notify?: (notification: import("./task-notification.js").TaskNotificationPayload, opts?: {
|
|
76
|
-
priority?: import("./task-notification.js").SystemInjectionPriority;
|
|
77
|
-
}) => void | "queued" | "parked" | "dropped_duplicate" | Promise<"queued" | "parked" | "dropped_duplicate">;
|
|
78
|
-
retainedContinuation?: boolean;
|
|
79
|
-
reviveCycle?: number;
|
|
80
|
-
cycleSeq?: number;
|
|
81
|
-
parkedCheckpointToken?: string;
|
|
82
|
-
resolveParkedStop?: () => Promise<boolean>;
|
|
83
|
-
inFlightDirect?: Set<(r: {
|
|
84
|
-
ok: true;
|
|
85
|
-
disposition: "queued" | "parked";
|
|
86
|
-
} | {
|
|
87
|
-
ok: false;
|
|
88
|
-
reason: "not_found" | "not_running" | "no_channel";
|
|
89
|
-
}) => void>;
|
|
90
|
-
channelState?: "attaching" | "attached";
|
|
91
|
-
preAttachQueue?: Array<[
|
|
92
|
-
import("./task-notification.js").TaskNotificationPayload,
|
|
93
|
-
{
|
|
94
|
-
priority?: import("./task-notification.js").SystemInjectionPriority;
|
|
95
|
-
} | undefined,
|
|
96
|
-
(((r: {
|
|
97
|
-
ok: true;
|
|
98
|
-
disposition: "queued" | "parked";
|
|
99
|
-
} | {
|
|
100
|
-
ok: false;
|
|
101
|
-
reason: "not_found" | "not_running" | "no_channel";
|
|
102
|
-
}) => void) | undefined)?
|
|
103
|
-
]>;
|
|
104
|
-
name?: string;
|
|
105
|
-
sessionScoped?: true;
|
|
106
|
-
result?: string;
|
|
107
|
-
resultFull?: string;
|
|
108
|
-
error?: string;
|
|
109
|
-
resultIsPartial?: boolean;
|
|
110
|
-
stopSource?: StopSource;
|
|
111
|
-
stoppedBy?: StopSource;
|
|
112
|
-
}
|
|
113
|
-
export interface MonitorTimers {
|
|
114
|
-
setInterval: (fn: () => unknown, ms: number) => unknown;
|
|
115
|
-
clearInterval: (handle: unknown) => void;
|
|
116
|
-
now: () => number;
|
|
117
|
-
}
|
|
118
17
|
export interface RegisterBackgroundBashInput extends TaskAccess {
|
|
119
18
|
shellId: BackgroundShellId;
|
|
120
19
|
env: ExecutionEnv & BackgroundShellCapability;
|
|
@@ -126,55 +25,6 @@ export interface RegisterBackgroundBashInput extends TaskAccess {
|
|
|
126
25
|
onTerminal?: (notification: TaskNotificationPayload) => void;
|
|
127
26
|
outputFile?: string;
|
|
128
27
|
}
|
|
129
|
-
export interface RegisterMonitorInput extends TaskAccess {
|
|
130
|
-
shellId: BackgroundShellId;
|
|
131
|
-
env: ExecutionEnv & BackgroundShellCapability;
|
|
132
|
-
description?: string;
|
|
133
|
-
toolUseId?: string;
|
|
134
|
-
persistent?: boolean;
|
|
135
|
-
sessionScoped?: true;
|
|
136
|
-
timeoutMs?: number;
|
|
137
|
-
onEvent?: (n: TaskNotificationPayload) => void;
|
|
138
|
-
timers?: MonitorTimers;
|
|
139
|
-
batchWindowMs?: number;
|
|
140
|
-
maxBatchesPerMinute?: number;
|
|
141
|
-
now?: number;
|
|
142
|
-
}
|
|
143
|
-
export interface RegisterBackgroundAgentInput extends TaskAccess {
|
|
144
|
-
initialStatus?: "parked";
|
|
145
|
-
parkedCheckpointToken?: string;
|
|
146
|
-
resolveParkedStop?: () => Promise<boolean>;
|
|
147
|
-
deliveryChannel?: "attaching";
|
|
148
|
-
retainedContinuation?: boolean;
|
|
149
|
-
description?: string;
|
|
150
|
-
name?: string;
|
|
151
|
-
agentType?: string;
|
|
152
|
-
parentTaskId?: string;
|
|
153
|
-
parentSessionId?: string;
|
|
154
|
-
rootSessionId?: string;
|
|
155
|
-
model?: string;
|
|
156
|
-
teamName?: string;
|
|
157
|
-
toolUseId?: string;
|
|
158
|
-
abort: AbortController;
|
|
159
|
-
now?: number;
|
|
160
|
-
sessionScoped?: true;
|
|
161
|
-
id?: string;
|
|
162
|
-
store?: BackgroundAgentStore;
|
|
163
|
-
durableSeed?: {
|
|
164
|
-
record: BackgroundAgentRecord;
|
|
165
|
-
rev: number;
|
|
166
|
-
};
|
|
167
|
-
}
|
|
168
|
-
export interface RegisterWorkflowInput extends TaskAccess {
|
|
169
|
-
runId: string;
|
|
170
|
-
handle: WorkflowHandle<unknown>;
|
|
171
|
-
store?: WorkflowRunStore;
|
|
172
|
-
description?: string;
|
|
173
|
-
toolUseId?: string;
|
|
174
|
-
now?: number;
|
|
175
|
-
originatingSessionId?: string;
|
|
176
|
-
onServedTerminal?: () => void;
|
|
177
|
-
}
|
|
178
28
|
export interface TaskPollOptions {
|
|
179
29
|
workflowStore?: WorkflowRunStore;
|
|
180
30
|
agentStore?: BackgroundAgentStore;
|
|
@@ -192,17 +42,8 @@ export interface TaskToolOptions extends TaskAccess {
|
|
|
192
42
|
workflowStore?: WorkflowRunStore;
|
|
193
43
|
agentStore?: BackgroundAgentStore;
|
|
194
44
|
deadlineMs?: () => number | undefined;
|
|
45
|
+
notificationWired?: boolean;
|
|
195
46
|
}
|
|
196
|
-
export declare const DURABLE_AGENT_HEARTBEAT_MS = 60000;
|
|
197
|
-
export declare const DURABLE_AGENT_HANDLE_RE: RegExp;
|
|
198
|
-
export declare const BG_AGENT_REAP_STOP_ERROR = "stopped (parent task ended or TaskStop)";
|
|
199
|
-
export declare const MONITOR_BATCH_WINDOW_MS = 200;
|
|
200
|
-
export declare const MONITOR_DEFAULT_TIMEOUT_MS = 300000;
|
|
201
|
-
export declare const MONITOR_MAX_TIMEOUT_MS = 3600000;
|
|
202
|
-
export declare const MONITOR_MAX_BATCHES_PER_MINUTE = 50;
|
|
203
|
-
export declare function clipTaskOutput(s: string, fullOutputPath?: string): string;
|
|
204
|
-
export declare function normalizeAgentName(s: string): string;
|
|
205
|
-
export declare function canAccessWorkflowRun(run: Pick<WorkflowRun, "scope" | "sourceTaskId" | "originatingSessionId">, access: TaskAccess): boolean;
|
|
206
47
|
export interface AccessibleTaskRow {
|
|
207
48
|
task_id: string;
|
|
208
49
|
type: SemaTaskHandle["type"];
|
|
@@ -223,12 +64,7 @@ export declare class TaskRegistry {
|
|
|
223
64
|
private sessionReapHooks;
|
|
224
65
|
private bgQuiescenceWatchers;
|
|
225
66
|
private legacyToTaskId;
|
|
226
|
-
readonly
|
|
227
|
-
private reapingHandles;
|
|
228
|
-
private claimingHandles;
|
|
229
|
-
private durableHeartbeatTimer;
|
|
230
|
-
private ensureDurableHeartbeat;
|
|
231
|
-
private durableAgentWrite;
|
|
67
|
+
private readonly core;
|
|
232
68
|
durableAgentArmed(id: string): boolean;
|
|
233
69
|
durableAgentRowProbe(id: string): (() => Promise<boolean>) | undefined;
|
|
234
70
|
beginDurableClaim(id: string): boolean;
|
|
@@ -254,17 +90,7 @@ export declare class TaskRegistry {
|
|
|
254
90
|
}>;
|
|
255
91
|
releaseDurableTranscriptAnchor(id: string): void;
|
|
256
92
|
bindBackgroundAgentSession(id: string, sessionId: string): void;
|
|
257
|
-
mintTaskId(type: SemaTaskType): string;
|
|
258
|
-
registerBackgroundBash(input: RegisterBackgroundBashInput): string;
|
|
259
|
-
isBackgroundOutputFile(canonicalPath: string, access: TaskAccess, env: unknown): boolean;
|
|
260
93
|
registerBackgroundAgent(input: RegisterBackgroundAgentInput): string;
|
|
261
|
-
getAccessibleTask(taskId: string, access: TaskAccess): AccessibleTaskRow | undefined;
|
|
262
|
-
markStopSource(id: string, source: StopSource): void;
|
|
263
|
-
markStopSourceForEnvSweep(env: unknown, source: StopSource, except?: readonly string[]): string[];
|
|
264
|
-
markStopSourceByShellId(shellId: string, source: StopSource, env?: unknown): void;
|
|
265
|
-
clearPendingStopSourceByShellId(shellId: string, source: StopSource, env?: unknown): void;
|
|
266
|
-
getStopAttribution(id: string): StopSource | undefined;
|
|
267
|
-
getCompletionId(id: string): string | undefined;
|
|
268
94
|
parkBackgroundAgent(id: string, park: {
|
|
269
95
|
checkpointToken: string;
|
|
270
96
|
seq?: number;
|
|
@@ -309,35 +135,7 @@ export declare class TaskRegistry {
|
|
|
309
135
|
skipSessionScoped?: boolean;
|
|
310
136
|
sessionScopedOnly?: boolean;
|
|
311
137
|
}): number;
|
|
312
|
-
markStopSourceForOwner(access: TaskAccess, source: StopSource, opts?: {
|
|
313
|
-
skipSessionScoped?: boolean;
|
|
314
|
-
}): number;
|
|
315
|
-
settleKilledForOwner(access: TaskAccess, opts?: {
|
|
316
|
-
source?: StopSource;
|
|
317
|
-
skipSessionScoped?: boolean;
|
|
318
|
-
envDying?: boolean;
|
|
319
|
-
retainProcesses?: boolean;
|
|
320
|
-
}): Promise<number>;
|
|
321
|
-
reapSessionBackground(sessionId: string, scope?: string): number;
|
|
322
|
-
reapAllSessionBackground(): number;
|
|
323
|
-
onSessionReap(hook: (sessionId: string, scope?: string) => void): () => void;
|
|
324
|
-
countRunningBackgroundForOwner(owner: string): number;
|
|
325
|
-
private static readonly BG_QUIESCENCE_WATCHERS_MAX;
|
|
326
|
-
onBackgroundQuiescence(owner: string, cb: (reason: "quiescent" | "evicted") => void): () => void;
|
|
327
|
-
private pokeBgQuiescence;
|
|
328
|
-
private notifyTerminalOnce;
|
|
329
|
-
private startBashWatcher;
|
|
330
|
-
sessionResidentShellIds(sessionId: string, env: unknown): BackgroundShellId[];
|
|
331
|
-
timeoutResidentShellIds(env: unknown): BackgroundShellId[];
|
|
332
|
-
retainedShellIds(env: unknown): BackgroundShellId[];
|
|
333
|
-
registerMonitor(input: RegisterMonitorInput): string;
|
|
334
|
-
private absorbMonitorPoll;
|
|
335
|
-
private emitMonitorEvent;
|
|
336
|
-
private startMonitorWatcher;
|
|
337
|
-
registerWorkflow(input: RegisterWorkflowInput): string;
|
|
338
|
-
pollTask(id: string, access: TaskAccess, opts?: TaskPollOptions): Promise<UnifiedTaskResult>;
|
|
339
138
|
private serveDurableAgentRow;
|
|
340
|
-
stopTask(id: string, access: TaskAccess, opts?: TaskStopOptions): Promise<UnifiedTaskResult>;
|
|
341
139
|
resolveBackgroundAgentByName(name: string, access: TaskAccess, opts?: {
|
|
342
140
|
preferRunning?: boolean;
|
|
343
141
|
}): {
|
|
@@ -376,6 +174,47 @@ export declare class TaskRegistry {
|
|
|
376
174
|
reason: "not_found" | "not_running" | "no_channel";
|
|
377
175
|
}>;
|
|
378
176
|
runningBackgroundAgentLabels(access: TaskAccess): string[];
|
|
177
|
+
private pollBackgroundAgent;
|
|
178
|
+
private stopBackgroundAgent;
|
|
179
|
+
readonly writerId: string;
|
|
180
|
+
private reapingHandles;
|
|
181
|
+
private claimingHandles;
|
|
182
|
+
private durableHeartbeatTimer;
|
|
183
|
+
mintTaskId(type: SemaTaskType): string;
|
|
184
|
+
registerBackgroundBash(input: RegisterBackgroundBashInput): string;
|
|
185
|
+
isBackgroundOutputFile(canonicalPath: string, access: TaskAccess, env: unknown): boolean;
|
|
186
|
+
getAccessibleTask(taskId: string, access: TaskAccess): AccessibleTaskRow | undefined;
|
|
187
|
+
markStopSource(id: string, source: StopSource): void;
|
|
188
|
+
markStopSourceForEnvSweep(env: unknown, source: StopSource, except?: readonly string[]): string[];
|
|
189
|
+
markStopSourceByShellId(shellId: string, source: StopSource, env?: unknown): void;
|
|
190
|
+
clearPendingStopSourceByShellId(shellId: string, source: StopSource, env?: unknown): void;
|
|
191
|
+
getStopAttribution(id: string): StopSource | undefined;
|
|
192
|
+
getCompletionId(id: string): string | undefined;
|
|
193
|
+
markStopSourceForOwner(access: TaskAccess, source: StopSource, opts?: {
|
|
194
|
+
skipSessionScoped?: boolean;
|
|
195
|
+
}): number;
|
|
196
|
+
settleKilledForOwner(access: TaskAccess, opts?: {
|
|
197
|
+
source?: StopSource;
|
|
198
|
+
skipSessionScoped?: boolean;
|
|
199
|
+
envDying?: boolean;
|
|
200
|
+
retainProcesses?: boolean;
|
|
201
|
+
}): Promise<number>;
|
|
202
|
+
reapSessionBackground(sessionId: string, scope?: string): number;
|
|
203
|
+
reapAllSessionBackground(): number;
|
|
204
|
+
onSessionReap(hook: (sessionId: string, scope?: string) => void): () => void;
|
|
205
|
+
countRunningBackgroundForOwner(owner: string): number;
|
|
206
|
+
private static readonly BG_QUIESCENCE_WATCHERS_MAX;
|
|
207
|
+
onBackgroundQuiescence(owner: string, cb: (reason: "quiescent" | "evicted") => void): () => void;
|
|
208
|
+
private pokeBgQuiescence;
|
|
209
|
+
private notifyTerminalOnce;
|
|
210
|
+
private startBashWatcher;
|
|
211
|
+
sessionResidentShellIds(sessionId: string, env: unknown): BackgroundShellId[];
|
|
212
|
+
timeoutResidentShellIds(env: unknown): BackgroundShellId[];
|
|
213
|
+
retainedShellIds(env: unknown): BackgroundShellId[];
|
|
214
|
+
registerMonitor(input: RegisterMonitorInput): string;
|
|
215
|
+
registerWorkflow(input: RegisterWorkflowInput): string;
|
|
216
|
+
pollTask(id: string, access: TaskAccess, opts?: TaskPollOptions): Promise<UnifiedTaskResult>;
|
|
217
|
+
stopTask(id: string, access: TaskAccess, opts?: TaskStopOptions): Promise<UnifiedTaskResult>;
|
|
379
218
|
deliverConfirmTimeoutMs: number;
|
|
380
219
|
private lastGcAt;
|
|
381
220
|
list(access: TaskAccess, opts?: {
|
|
@@ -395,16 +234,12 @@ export declare class TaskRegistry {
|
|
|
395
234
|
clearBackgroundForOwner(access: TaskAccess): number;
|
|
396
235
|
private resolveInternal;
|
|
397
236
|
private pollBackgroundBash;
|
|
398
|
-
private fireServedTerminal;
|
|
399
237
|
private pollWorkflow;
|
|
400
238
|
private stopBackgroundBash;
|
|
401
239
|
private pollMonitor;
|
|
402
240
|
private stopMonitor;
|
|
403
|
-
private pollBackgroundAgent;
|
|
404
|
-
private stopBackgroundAgent;
|
|
405
241
|
private stopWorkflow;
|
|
406
242
|
}
|
|
407
243
|
export declare const defaultTaskRegistry: TaskRegistry;
|
|
408
244
|
export declare function createTaskOutputTool(opts: TaskToolOptions): AgentTool;
|
|
409
245
|
export declare function createTaskStopTool(opts: TaskToolOptions): AgentTool;
|
|
410
|
-
export {};
|