@sema-agent/core 1.451.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/observer.js +3 -0
- 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 +40 -813
- 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/ask-question.js +5 -5
- package/dist/core/background-agent-store.d.ts +2 -0
- package/dist/core/background-agent-store.js +5 -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 +19 -1
- package/dist/core/exec-output-tail.js +44 -5
- 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-session.d.ts +1 -0
- package/dist/core/lsp-session.js +24 -6
- package/dist/core/lsp.d.ts +11 -1
- package/dist/core/lsp.js +63 -6
- package/dist/core/mailbox-store.d.ts +3 -2
- package/dist/core/mailbox-store.js +19 -4
- 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 +29 -208
- 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-reconcile.js +5 -2
- 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-notification.d.ts +1 -0
- 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 +54 -213
- package/dist/core/task-registry.js +190 -1766
- 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 +3 -3
- package/dist/core/tools.d.ts +7 -3
- package/dist/core/tools.js +3 -8
- package/dist/core/trace.d.ts +2 -2
- package/dist/core/types.d.ts +1 -29
- package/dist/core/workflow-journal-store.d.ts +2 -0
- package/dist/core/workflow-journal-store.js +14 -0
- 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 +14 -0
- package/dist/engine/execution-env/node-execution-env.js +184 -44
- 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 +4 -2
- package/dist/engine/lsp/node-lsp-manager.js +22 -5
- package/dist/engine/lsp/stdio-lsp-transport.d.ts +1 -1
- package/dist/engine/lsp/stdio-lsp-transport.js +19 -8
- package/dist/index.d.ts +18 -16
- package/dist/index.js +15 -13
- 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 +2 -1
- package/dist/orchestration/run-workflow-tool.js +29 -6
- package/dist/orchestration/workflow-types.d.ts +193 -0
- package/dist/orchestration/workflow-types.js +54 -0
- package/dist/orchestration/workflow.d.ts +3 -184
- package/dist/orchestration/workflow.js +87 -64
- 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/cc/mailbox-store.js +6 -1
- package/dist/stores/file/background-agent-store.d.ts +2 -15
- package/dist/stores/file/background-agent-store.js +33 -102
- 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/mailbox-store.d.ts +1 -1
- package/dist/stores/file/mailbox-store.js +9 -7
- 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/encoding.d.ts +5 -0
- package/dist/tools/fs/encoding.js +6 -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 -2026
- package/dist/tools/fs/notebook.d.ts +43 -0
- package/dist/tools/fs/notebook.js +141 -0
- 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 +3 -3
- package/dist/tools/fs/safety.d.ts +1 -1
- package/dist/tools/fs/search.d.ts +1 -1
- package/dist/tools/fs/search.js +141 -12
- package/dist/tools/gitea-issue.js +4 -2
- package/dist/tools/monitor.d.ts +1 -1
- package/dist/tools/monitor.js +12 -8
- package/dist/tools/scheduler-tools.d.ts +1 -1
- package/dist/tools/scheduler-tools.js +16 -16
- package/dist/tools/task-list.js +34 -12
- package/dist/tools/web.d.ts +4 -2
- package/dist/tools/web.js +106 -20
- package/dist/tools/worktree.d.ts +1 -1
- package/dist/tools/worktree.js +14 -14
- package/package.json +1 -1
- package/dist/core/dynamic-recall.d.ts +0 -32
- package/dist/core/dynamic-recall.js +0 -76
|
@@ -1,113 +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
|
-
details?: unknown;
|
|
31
|
-
}
|
|
32
|
-
export interface SemaTaskHandle {
|
|
33
|
-
id: string;
|
|
34
|
-
type: SemaTaskType;
|
|
35
|
-
status: SemaTaskStatus;
|
|
36
|
-
description?: string;
|
|
37
|
-
owner?: string;
|
|
38
|
-
scope?: string;
|
|
39
|
-
toolUseId?: string;
|
|
40
|
-
createdAt: number;
|
|
41
|
-
updatedAt: number;
|
|
42
|
-
outputFile?: string;
|
|
43
|
-
outputOffset?: number;
|
|
44
|
-
}
|
|
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 };
|
|
45
13
|
export interface TaskKind {
|
|
46
14
|
type: SemaTaskType;
|
|
47
15
|
effect: ToolEffect;
|
|
48
16
|
}
|
|
49
|
-
export interface TaskAccess {
|
|
50
|
-
owner?: string;
|
|
51
|
-
scope?: string;
|
|
52
|
-
sessionId?: string;
|
|
53
|
-
}
|
|
54
|
-
interface DurableAgentLane {
|
|
55
|
-
store: BackgroundAgentStore;
|
|
56
|
-
record: BackgroundAgentRecord;
|
|
57
|
-
chain: Promise<void>;
|
|
58
|
-
written: boolean;
|
|
59
|
-
poisoned: boolean;
|
|
60
|
-
flushFailed: boolean;
|
|
61
|
-
redrives?: number;
|
|
62
|
-
}
|
|
63
|
-
interface BackgroundAgentTaskHandle extends SemaTaskHandle {
|
|
64
|
-
type: "background_agent";
|
|
65
|
-
abort: AbortController;
|
|
66
|
-
sessionId?: string;
|
|
67
|
-
durable?: DurableAgentLane;
|
|
68
|
-
notify?: (notification: import("./task-notification.js").TaskNotificationPayload, opts?: {
|
|
69
|
-
priority?: import("./task-notification.js").SystemInjectionPriority;
|
|
70
|
-
}) => void | "queued" | "parked" | "dropped_duplicate" | Promise<"queued" | "parked" | "dropped_duplicate">;
|
|
71
|
-
retainedContinuation?: boolean;
|
|
72
|
-
reviveCycle?: number;
|
|
73
|
-
cycleSeq?: number;
|
|
74
|
-
parkedCheckpointToken?: string;
|
|
75
|
-
resolveParkedStop?: () => Promise<boolean>;
|
|
76
|
-
inFlightDirect?: Set<(r: {
|
|
77
|
-
ok: true;
|
|
78
|
-
disposition: "queued" | "parked";
|
|
79
|
-
} | {
|
|
80
|
-
ok: false;
|
|
81
|
-
reason: "not_found" | "not_running" | "no_channel";
|
|
82
|
-
}) => void>;
|
|
83
|
-
channelState?: "attaching" | "attached";
|
|
84
|
-
preAttachQueue?: Array<[
|
|
85
|
-
import("./task-notification.js").TaskNotificationPayload,
|
|
86
|
-
{
|
|
87
|
-
priority?: import("./task-notification.js").SystemInjectionPriority;
|
|
88
|
-
} | undefined,
|
|
89
|
-
(((r: {
|
|
90
|
-
ok: true;
|
|
91
|
-
disposition: "queued" | "parked";
|
|
92
|
-
} | {
|
|
93
|
-
ok: false;
|
|
94
|
-
reason: "not_found" | "not_running" | "no_channel";
|
|
95
|
-
}) => void) | undefined)?
|
|
96
|
-
]>;
|
|
97
|
-
name?: string;
|
|
98
|
-
sessionScoped?: true;
|
|
99
|
-
result?: string;
|
|
100
|
-
resultFull?: string;
|
|
101
|
-
error?: string;
|
|
102
|
-
resultIsPartial?: boolean;
|
|
103
|
-
stopSource?: StopSource;
|
|
104
|
-
stoppedBy?: StopSource;
|
|
105
|
-
}
|
|
106
|
-
export interface MonitorTimers {
|
|
107
|
-
setInterval: (fn: () => unknown, ms: number) => unknown;
|
|
108
|
-
clearInterval: (handle: unknown) => void;
|
|
109
|
-
now: () => number;
|
|
110
|
-
}
|
|
111
17
|
export interface RegisterBackgroundBashInput extends TaskAccess {
|
|
112
18
|
shellId: BackgroundShellId;
|
|
113
19
|
env: ExecutionEnv & BackgroundShellCapability;
|
|
@@ -119,55 +25,6 @@ export interface RegisterBackgroundBashInput extends TaskAccess {
|
|
|
119
25
|
onTerminal?: (notification: TaskNotificationPayload) => void;
|
|
120
26
|
outputFile?: string;
|
|
121
27
|
}
|
|
122
|
-
export interface RegisterMonitorInput extends TaskAccess {
|
|
123
|
-
shellId: BackgroundShellId;
|
|
124
|
-
env: ExecutionEnv & BackgroundShellCapability;
|
|
125
|
-
description?: string;
|
|
126
|
-
toolUseId?: string;
|
|
127
|
-
persistent?: boolean;
|
|
128
|
-
sessionScoped?: true;
|
|
129
|
-
timeoutMs?: number;
|
|
130
|
-
onEvent?: (n: TaskNotificationPayload) => void;
|
|
131
|
-
timers?: MonitorTimers;
|
|
132
|
-
batchWindowMs?: number;
|
|
133
|
-
maxBatchesPerMinute?: number;
|
|
134
|
-
now?: number;
|
|
135
|
-
}
|
|
136
|
-
export interface RegisterBackgroundAgentInput extends TaskAccess {
|
|
137
|
-
initialStatus?: "parked";
|
|
138
|
-
parkedCheckpointToken?: string;
|
|
139
|
-
resolveParkedStop?: () => Promise<boolean>;
|
|
140
|
-
deliveryChannel?: "attaching";
|
|
141
|
-
retainedContinuation?: boolean;
|
|
142
|
-
description?: string;
|
|
143
|
-
name?: string;
|
|
144
|
-
agentType?: string;
|
|
145
|
-
parentTaskId?: string;
|
|
146
|
-
parentSessionId?: string;
|
|
147
|
-
rootSessionId?: string;
|
|
148
|
-
model?: string;
|
|
149
|
-
teamName?: string;
|
|
150
|
-
toolUseId?: string;
|
|
151
|
-
abort: AbortController;
|
|
152
|
-
now?: number;
|
|
153
|
-
sessionScoped?: true;
|
|
154
|
-
id?: string;
|
|
155
|
-
store?: BackgroundAgentStore;
|
|
156
|
-
durableSeed?: {
|
|
157
|
-
record: BackgroundAgentRecord;
|
|
158
|
-
rev: number;
|
|
159
|
-
};
|
|
160
|
-
}
|
|
161
|
-
export interface RegisterWorkflowInput extends TaskAccess {
|
|
162
|
-
runId: string;
|
|
163
|
-
handle: WorkflowHandle<unknown>;
|
|
164
|
-
store?: WorkflowRunStore;
|
|
165
|
-
description?: string;
|
|
166
|
-
toolUseId?: string;
|
|
167
|
-
now?: number;
|
|
168
|
-
originatingSessionId?: string;
|
|
169
|
-
onServedTerminal?: () => void;
|
|
170
|
-
}
|
|
171
28
|
export interface TaskPollOptions {
|
|
172
29
|
workflowStore?: WorkflowRunStore;
|
|
173
30
|
agentStore?: BackgroundAgentStore;
|
|
@@ -185,17 +42,8 @@ export interface TaskToolOptions extends TaskAccess {
|
|
|
185
42
|
workflowStore?: WorkflowRunStore;
|
|
186
43
|
agentStore?: BackgroundAgentStore;
|
|
187
44
|
deadlineMs?: () => number | undefined;
|
|
45
|
+
notificationWired?: boolean;
|
|
188
46
|
}
|
|
189
|
-
export declare const DURABLE_AGENT_HEARTBEAT_MS = 60000;
|
|
190
|
-
export declare const DURABLE_AGENT_HANDLE_RE: RegExp;
|
|
191
|
-
export declare const BG_AGENT_REAP_STOP_ERROR = "stopped (parent task ended or TaskStop)";
|
|
192
|
-
export declare const MONITOR_BATCH_WINDOW_MS = 200;
|
|
193
|
-
export declare const MONITOR_DEFAULT_TIMEOUT_MS = 300000;
|
|
194
|
-
export declare const MONITOR_MAX_TIMEOUT_MS = 3600000;
|
|
195
|
-
export declare const MONITOR_MAX_BATCHES_PER_MINUTE = 50;
|
|
196
|
-
export declare function clipTaskOutput(s: string, fullOutputPath?: string): string;
|
|
197
|
-
export declare function normalizeAgentName(s: string): string;
|
|
198
|
-
export declare function canAccessWorkflowRun(run: Pick<WorkflowRun, "scope" | "sourceTaskId" | "originatingSessionId">, access: TaskAccess): boolean;
|
|
199
47
|
export interface AccessibleTaskRow {
|
|
200
48
|
task_id: string;
|
|
201
49
|
type: SemaTaskHandle["type"];
|
|
@@ -216,12 +64,7 @@ export declare class TaskRegistry {
|
|
|
216
64
|
private sessionReapHooks;
|
|
217
65
|
private bgQuiescenceWatchers;
|
|
218
66
|
private legacyToTaskId;
|
|
219
|
-
readonly
|
|
220
|
-
private reapingHandles;
|
|
221
|
-
private claimingHandles;
|
|
222
|
-
private durableHeartbeatTimer;
|
|
223
|
-
private ensureDurableHeartbeat;
|
|
224
|
-
private durableAgentWrite;
|
|
67
|
+
private readonly core;
|
|
225
68
|
durableAgentArmed(id: string): boolean;
|
|
226
69
|
durableAgentRowProbe(id: string): (() => Promise<boolean>) | undefined;
|
|
227
70
|
beginDurableClaim(id: string): boolean;
|
|
@@ -247,16 +90,7 @@ export declare class TaskRegistry {
|
|
|
247
90
|
}>;
|
|
248
91
|
releaseDurableTranscriptAnchor(id: string): void;
|
|
249
92
|
bindBackgroundAgentSession(id: string, sessionId: string): void;
|
|
250
|
-
mintTaskId(type: SemaTaskType): string;
|
|
251
|
-
registerBackgroundBash(input: RegisterBackgroundBashInput): string;
|
|
252
|
-
isBackgroundOutputFile(canonicalPath: string, access: TaskAccess, env: unknown): boolean;
|
|
253
93
|
registerBackgroundAgent(input: RegisterBackgroundAgentInput): string;
|
|
254
|
-
getAccessibleTask(taskId: string, access: TaskAccess): AccessibleTaskRow | undefined;
|
|
255
|
-
markStopSource(id: string, source: StopSource): void;
|
|
256
|
-
markStopSourceForEnvSweep(env: unknown, source: StopSource, except?: readonly string[]): string[];
|
|
257
|
-
markStopSourceByShellId(shellId: string, source: StopSource, env?: unknown): void;
|
|
258
|
-
clearPendingStopSourceByShellId(shellId: string, source: StopSource, env?: unknown): void;
|
|
259
|
-
getStopAttribution(id: string): StopSource | undefined;
|
|
260
94
|
parkBackgroundAgent(id: string, park: {
|
|
261
95
|
checkpointToken: string;
|
|
262
96
|
seq?: number;
|
|
@@ -301,40 +135,10 @@ export declare class TaskRegistry {
|
|
|
301
135
|
skipSessionScoped?: boolean;
|
|
302
136
|
sessionScopedOnly?: boolean;
|
|
303
137
|
}): number;
|
|
304
|
-
markStopSourceForOwner(access: TaskAccess, source: StopSource, opts?: {
|
|
305
|
-
skipSessionScoped?: boolean;
|
|
306
|
-
}): number;
|
|
307
|
-
settleKilledForOwner(access: TaskAccess, opts?: {
|
|
308
|
-
source?: StopSource;
|
|
309
|
-
skipSessionScoped?: boolean;
|
|
310
|
-
envDying?: boolean;
|
|
311
|
-
retainProcesses?: boolean;
|
|
312
|
-
}): Promise<number>;
|
|
313
|
-
reapSessionBackground(sessionId: string, scope?: string): number;
|
|
314
|
-
reapAllSessionBackground(): number;
|
|
315
|
-
onSessionReap(hook: (sessionId: string, scope?: string) => void): () => void;
|
|
316
|
-
countRunningBackgroundForOwner(owner: string): number;
|
|
317
|
-
private static readonly BG_QUIESCENCE_WATCHERS_MAX;
|
|
318
|
-
onBackgroundQuiescence(owner: string, cb: (reason: "quiescent" | "evicted") => void): () => void;
|
|
319
|
-
private pokeBgQuiescence;
|
|
320
|
-
private notifyTerminalOnce;
|
|
321
|
-
private startBashWatcher;
|
|
322
|
-
sessionResidentShellIds(sessionId: string, env: unknown): BackgroundShellId[];
|
|
323
|
-
timeoutResidentShellIds(env: unknown): BackgroundShellId[];
|
|
324
|
-
retainedShellIds(env: unknown): BackgroundShellId[];
|
|
325
|
-
registerMonitor(input: RegisterMonitorInput): string;
|
|
326
|
-
private startMonitorWatcher;
|
|
327
|
-
registerWorkflow(input: RegisterWorkflowInput): string;
|
|
328
|
-
pollTask(id: string, access: TaskAccess, opts?: TaskPollOptions): Promise<{
|
|
329
|
-
content: string;
|
|
330
|
-
details: UnifiedTaskOutput;
|
|
331
|
-
}>;
|
|
332
138
|
private serveDurableAgentRow;
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
}>;
|
|
337
|
-
resolveBackgroundAgentByName(name: string, access: TaskAccess): {
|
|
139
|
+
resolveBackgroundAgentByName(name: string, access: TaskAccess, opts?: {
|
|
140
|
+
preferRunning?: boolean;
|
|
141
|
+
}): {
|
|
338
142
|
status: "found";
|
|
339
143
|
handle: BackgroundAgentTaskHandle;
|
|
340
144
|
} | {
|
|
@@ -370,6 +174,47 @@ export declare class TaskRegistry {
|
|
|
370
174
|
reason: "not_found" | "not_running" | "no_channel";
|
|
371
175
|
}>;
|
|
372
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>;
|
|
373
218
|
deliverConfirmTimeoutMs: number;
|
|
374
219
|
private lastGcAt;
|
|
375
220
|
list(access: TaskAccess, opts?: {
|
|
@@ -389,16 +234,12 @@ export declare class TaskRegistry {
|
|
|
389
234
|
clearBackgroundForOwner(access: TaskAccess): number;
|
|
390
235
|
private resolveInternal;
|
|
391
236
|
private pollBackgroundBash;
|
|
392
|
-
private fireServedTerminal;
|
|
393
237
|
private pollWorkflow;
|
|
394
238
|
private stopBackgroundBash;
|
|
395
239
|
private pollMonitor;
|
|
396
240
|
private stopMonitor;
|
|
397
|
-
private pollBackgroundAgent;
|
|
398
|
-
private stopBackgroundAgent;
|
|
399
241
|
private stopWorkflow;
|
|
400
242
|
}
|
|
401
243
|
export declare const defaultTaskRegistry: TaskRegistry;
|
|
402
244
|
export declare function createTaskOutputTool(opts: TaskToolOptions): AgentTool;
|
|
403
245
|
export declare function createTaskStopTool(opts: TaskToolOptions): AgentTool;
|
|
404
|
-
export {};
|