@fish-under-sea/dsh-client-ui-task-board-fish 2.2.2 → 2.3.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/README.en.md +4 -4
- package/package.json +5 -4
- package/README.i18n.yaml +0 -6
- package/README.md +0 -31
- package/README.zh.md +0 -31
- package/lib/client.js +0 -15861
- package/lib/client.js.map +0 -1
- package/lib/index.js +0 -12653
- package/lib/types/client/CardDefaultPresetField.d.ts +0 -35
- package/lib/types/client/PluginSettingsCard.d.ts +0 -255
- package/lib/types/client/RangeBubble.d.ts +0 -46
- package/lib/types/client/SegmentGroup.d.ts +0 -28
- package/lib/types/client/TaskBoardSettingsCard.d.ts +0 -155
- package/lib/types/client/apply-guard.d.ts +0 -25
- package/lib/types/client/board/AttachmentField.d.ts +0 -70
- package/lib/types/client/board/ClampedMarkdown.d.ts +0 -3
- package/lib/types/client/board/ConfirmDialog.d.ts +0 -15
- package/lib/types/client/board/EditTaskModal.d.ts +0 -17
- package/lib/types/client/board/ExecutionLog.d.ts +0 -24
- package/lib/types/client/board/LinkSubtaskModal.d.ts +0 -14
- package/lib/types/client/board/NewTaskModal.d.ts +0 -26
- package/lib/types/client/board/ReasoningEffortField.d.ts +0 -25
- package/lib/types/client/board/TagManagerModal.d.ts +0 -26
- package/lib/types/client/board/TaskBoard.d.ts +0 -26
- package/lib/types/client/board/TaskCard.d.ts +0 -36
- package/lib/types/client/board/TaskDetail.d.ts +0 -9
- package/lib/types/client/board/TaskForm.d.ts +0 -76
- package/lib/types/client/board/VerificationReport.d.ts +0 -10
- package/lib/types/client/board/card-view.d.ts +0 -113
- package/lib/types/client/board/icons.d.ts +0 -32
- package/lib/types/client/board/model-options.d.ts +0 -87
- package/lib/types/client/board/overlay.d.ts +0 -69
- package/lib/types/client/board/parse-model-pref.d.ts +0 -4
- package/lib/types/client/board/preset-label.d.ts +0 -43
- package/lib/types/client/board/preset-roster.d.ts +0 -45
- package/lib/types/client/board/source-group.d.ts +0 -27
- package/lib/types/client/board/status-key.d.ts +0 -19
- package/lib/types/client/board/task-markdown.d.ts +0 -19
- package/lib/types/client/body-mutations.d.ts +0 -45
- package/lib/types/client/host-api.d.ts +0 -88
- package/lib/types/client/index.d.ts +0 -128
- package/lib/types/client/locales.d.ts +0 -521
- package/lib/types/client/main-session.d.ts +0 -32
- package/lib/types/client/native-panel.d.ts +0 -48
- package/lib/types/client/pending-verify.d.ts +0 -47
- package/lib/types/client/plugin-card-seat.d.ts +0 -110
- package/lib/types/client/schedule-presets.d.ts +0 -10
- package/lib/types/client/schedule-zone.d.ts +0 -97
- package/lib/types/client/seats.d.ts +0 -18
- package/lib/types/client/service.d.ts +0 -35
- package/lib/types/client/settings-entry-form.d.ts +0 -49
- package/lib/types/client/settings-form.d.ts +0 -235
- package/lib/types/core/attachment.d.ts +0 -132
- package/lib/types/core/card-defaults.d.ts +0 -78
- package/lib/types/core/controller.d.ts +0 -422
- package/lib/types/core/degraded-reason.d.ts +0 -46
- package/lib/types/core/execution-summary.d.ts +0 -52
- package/lib/types/core/extension.d.ts +0 -399
- package/lib/types/core/freeze-snapshot.d.ts +0 -71
- package/lib/types/core/handover.d.ts +0 -70
- package/lib/types/core/issue-form.d.ts +0 -16
- package/lib/types/core/launch-width.d.ts +0 -31
- package/lib/types/core/package-name.d.ts +0 -9
- package/lib/types/core/poll-cadence.d.ts +0 -31
- package/lib/types/core/reasoning-effort.d.ts +0 -57
- package/lib/types/core/schedule.d.ts +0 -124
- package/lib/types/core/session-reuse.d.ts +0 -30
- package/lib/types/core/spend-budget.d.ts +0 -28
- package/lib/types/core/store.d.ts +0 -64
- package/lib/types/core/subtask.d.ts +0 -204
- package/lib/types/core/tasks.d.ts +0 -685
- package/lib/types/core/use-cases/task-archive.d.ts +0 -20
- package/lib/types/core/use-cases/task-create.d.ts +0 -32
- package/lib/types/core/use-cases/task-delete.d.ts +0 -27
- package/lib/types/core/use-cases/task-parent.d.ts +0 -21
- package/lib/types/core/use-cases/task-schedule.d.ts +0 -96
- package/lib/types/core/use-cases/task-tag.d.ts +0 -84
- package/lib/types/core/use-cases/task-update.d.ts +0 -77
- package/lib/types/core/verification-budget.d.ts +0 -52
- package/lib/types/core/verification.d.ts +0 -753
- package/lib/types/core/wire-projection.d.ts +0 -35
- package/lib/types/core/workspace-target.d.ts +0 -61
- package/lib/types/dsh-home.d.ts +0 -16
- package/lib/types/host/agent-tools.d.ts +0 -27
- package/lib/types/host/attachments.d.ts +0 -250
- package/lib/types/host/extension-registry.d.ts +0 -151
- package/lib/types/host/launch-admission.d.ts +0 -71
- package/lib/types/host/llm-dispatch.d.ts +0 -63
- package/lib/types/host/verification-gate.d.ts +0 -95
- package/lib/types/host/verification-runner.d.ts +0 -139
- package/lib/types/host/workspace-evidence.d.ts +0 -53
- package/lib/types/host-ai.d.ts +0 -51
- package/lib/types/host-ledger.d.ts +0 -452
- package/lib/types/host-routes.d.ts +0 -99
- package/lib/types/host-runner.d.ts +0 -401
- package/lib/types/host-service.d.ts +0 -517
- package/lib/types/host-spend.d.ts +0 -52
- package/lib/types/http.d.ts +0 -59
- package/lib/types/index.d.ts +0 -441
- package/lib/types/loopback.d.ts +0 -64
- package/lib/types/mount-once.d.ts +0 -55
- package/lib/types/power-inhibitor.d.ts +0 -73
- package/lib/types/protocol.d.ts +0 -253
- package/lib/types/tool-surface.d.ts +0 -72
|
@@ -1,401 +0,0 @@
|
|
|
1
|
-
import { Context } from '@deepseek-ai/cordis';
|
|
2
|
-
import type { InvokeRemoteRequest, TypertGateway } from '@deepseek-ai/dsh-api-gateway';
|
|
3
|
-
import type { SessionSummary } from '@deepseek-ai/dsh-api-session-controller/types';
|
|
4
|
-
import type { CommandResult } from '@deepseek-ai/dsh-commands/types';
|
|
5
|
-
import type { Workspace } from '@deepseek-ai/dsh-workspace/types';
|
|
6
|
-
import type { ModelCatalogView } from './core/verification.ts';
|
|
7
|
-
import type { ExecutionSummary, TaskRecord } from './core/tasks.ts';
|
|
8
|
-
import { type ExecutionFilePart, type ModelInfoResolver, type TaskBoardAttachmentStore } from './host/attachments.ts';
|
|
9
|
-
/**
|
|
10
|
-
* Host services needed to validate a task's workspace before creating a
|
|
11
|
-
* session, and to resolve the workspace an unpinned card runs in.
|
|
12
|
-
*/
|
|
13
|
-
export interface TaskBoardWorkspaceRegistry {
|
|
14
|
-
list(): readonly Workspace[];
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* The peer every gateway request names: derived from the public
|
|
18
|
-
* `InvokeRemoteRequest` type so this package needs no direct dependency on
|
|
19
|
-
* `@deepseek-ai/dsh-typert-protocol` for the shape.
|
|
20
|
-
*/
|
|
21
|
-
export type GatewayPeer = InvokeRemoteRequest['peer'];
|
|
22
|
-
interface GatewayRequest {
|
|
23
|
-
namespace: string;
|
|
24
|
-
method: string;
|
|
25
|
-
args: Record<string, unknown>;
|
|
26
|
-
peer: GatewayPeer;
|
|
27
|
-
signal?: AbortSignal;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Mint the in-process owner peer this plugin's Host calls speak for.
|
|
31
|
-
*
|
|
32
|
-
* The 0.2.1 gateway made `peer` mandatory on every request, and the
|
|
33
|
-
* authorization layer reads only `peer.principal`: a principal of
|
|
34
|
-
* `{ kind: 'owner' }` is how host-local code states that the call IS the local
|
|
35
|
-
* user driving their own Host, so the gateway answers it directly instead of
|
|
36
|
-
* running a remote-access decision (only non-owner principals are judged).
|
|
37
|
-
* That is exactly the task board's position — it creates, renames, prompts,
|
|
38
|
-
* and reads sessions as the Host itself, which before 0.2.1 was the implicit
|
|
39
|
-
* privilege of every in-process caller. The board claims owner explicitly, and
|
|
40
|
-
* only ever inside its own Host process: no wire field can set a principal,
|
|
41
|
-
* and this plugin never forwards a browser-supplied one.
|
|
42
|
-
*
|
|
43
|
-
* `interactions` stays `'none'`: the board only invokes methods and opens the
|
|
44
|
-
* short `session/follow` stream. The gateway's interactions check gates
|
|
45
|
-
* exactly the forwarded-event endpoints (opening an event stream, answering a
|
|
46
|
-
* waterfall), which this caller never touches; an `'answer'` peer would
|
|
47
|
-
* additionally receive forwarded Host events, a capability the board neither
|
|
48
|
-
* needs nor wants.
|
|
49
|
-
*
|
|
50
|
-
* The peer's signal aborts once `ctx` disposes, so streams opened for it end
|
|
51
|
-
* with the plugin fiber, and `dispose()` is idempotent with racing calls
|
|
52
|
-
* sharing one completion. The id carries no credential — the protocol fixes
|
|
53
|
-
* `principal` as the only identity persisted in a session log — so a fresh
|
|
54
|
-
* unique id per mount is sufficient.
|
|
55
|
-
*/
|
|
56
|
-
export declare function createOwnerPeer(ctx: Context): GatewayPeer;
|
|
57
|
-
interface SessionGateway {
|
|
58
|
-
invoke(request: GatewayRequest): Promise<unknown>;
|
|
59
|
-
stream?(request: GatewayRequest): Promise<AsyncIterable<unknown>>;
|
|
60
|
-
}
|
|
61
|
-
/** One session-list row consumed by task-board reconciliation. */
|
|
62
|
-
export type { SessionSummary };
|
|
63
|
-
type ExecutionSessionId = SessionSummary['sessionId'];
|
|
64
|
-
export interface SessionCommandDispatcher {
|
|
65
|
-
execute(sessionId: ExecutionSessionId, line: string, signal: AbortSignal): Promise<CommandResult | undefined>;
|
|
66
|
-
}
|
|
67
|
-
export type ExecutionInspection =
|
|
68
|
-
/**
|
|
69
|
-
* No verdict yet. `unreadable` separates "the work may still be in progress"
|
|
70
|
-
* from "this session's history could not be read at all": a reader failure is
|
|
71
|
-
* not progress, and the caller decides how long to keep waiting before it
|
|
72
|
-
* reports the execution as undeterminable instead of holding a card open
|
|
73
|
-
* forever.
|
|
74
|
-
*/
|
|
75
|
-
{
|
|
76
|
-
outcome: 'pending';
|
|
77
|
-
unreadable?: true;
|
|
78
|
-
reason?: string;
|
|
79
|
-
} | {
|
|
80
|
-
outcome: 'succeeded';
|
|
81
|
-
summary?: ExecutionSummary;
|
|
82
|
-
} | {
|
|
83
|
-
outcome: 'failed';
|
|
84
|
-
error: string;
|
|
85
|
-
summary?: ExecutionSummary;
|
|
86
|
-
} | {
|
|
87
|
-
outcome: 'cancelled';
|
|
88
|
-
error: string;
|
|
89
|
-
summary?: ExecutionSummary;
|
|
90
|
-
};
|
|
91
|
-
/** A post-create launch failure that still identifies the session to the ledger. */
|
|
92
|
-
export declare class SessionLaunchError extends Error {
|
|
93
|
-
readonly sessionId: string;
|
|
94
|
-
constructor(sessionId: string, cause: unknown);
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* Compose the execution prompt (issue #6): a continuation card (one carrying
|
|
98
|
-
* a frozen snapshot) has its instruction mandatorily wrapped in a source
|
|
99
|
-
* declaration (freeze instant, source session, unreviewed-content warning)
|
|
100
|
-
* templated by the board, so the picking-up agent stays wary of stored
|
|
101
|
-
* prompt-instruction injection in card text (adversarial scenario c). The
|
|
102
|
-
* wrap composes with the T4 handover preamble: the reference preamble comes
|
|
103
|
-
* first, the provenance wrap then encloses the instruction. Plain tasks (no
|
|
104
|
-
* freeze) keep the bare handover preamble + prompt.
|
|
105
|
-
*/
|
|
106
|
-
/** One unfinished subtask the launched card's own agent has to dispatch. */
|
|
107
|
-
export interface PromptDescendant {
|
|
108
|
-
/** Task id of the subtask card. */
|
|
109
|
-
id: string;
|
|
110
|
-
/** Subtask title. */
|
|
111
|
-
title: string;
|
|
112
|
-
/** Its column, so the run can tell a fresh card from one already failed before. */
|
|
113
|
-
status: string;
|
|
114
|
-
}
|
|
115
|
-
/** Execution-shape context appended to the launched task's prompt. */
|
|
116
|
-
export interface PromptContext {
|
|
117
|
-
/**
|
|
118
|
-
* The card's outstanding descendants. Present exactly when this run is an
|
|
119
|
-
* autonomous dispatch: the Host opens no session for them, so this session
|
|
120
|
-
* reads them and dispatches subagents itself.
|
|
121
|
-
*/
|
|
122
|
-
descendants?: readonly PromptDescendant[];
|
|
123
|
-
/**
|
|
124
|
-
* Scheduled-run provenance: the instant the rule actually fired, its kind,
|
|
125
|
-
* and the IANA zone its wall clock was read in. Present only for a
|
|
126
|
-
* timer-triggered run, so the model can resolve an unqualified date in the
|
|
127
|
-
* run's own terms instead of guessing from the Host clock (issue #1722).
|
|
128
|
-
*/
|
|
129
|
-
schedule?: {
|
|
130
|
-
triggeredAt: number;
|
|
131
|
-
timeZone: string;
|
|
132
|
-
mode: 'cron' | 'once';
|
|
133
|
-
cron?: string;
|
|
134
|
-
};
|
|
135
|
-
/**
|
|
136
|
-
* Rework provenance: the instructions a reviewer sent the previous run back
|
|
137
|
-
* with. Present exactly when this execution continues the card's own session
|
|
138
|
-
* to redo work, so the agent reads why it is being asked again instead of
|
|
139
|
-
* seeing the card body a second time with no explanation.
|
|
140
|
-
*/
|
|
141
|
-
rework?: {
|
|
142
|
-
instructions: string;
|
|
143
|
-
};
|
|
144
|
-
/**
|
|
145
|
-
* The card's attached files, resolved to readable host paths for THIS
|
|
146
|
-
* execution. Present exactly when the card carries files: the section is a
|
|
147
|
-
* preamble of its own, separate from the handover references, so the two
|
|
148
|
-
* kinds of reference stay distinguishable to the reading agent.
|
|
149
|
-
*/
|
|
150
|
-
files?: readonly ExecutionFilePart[];
|
|
151
|
-
}
|
|
152
|
-
/**
|
|
153
|
-
* Build the execution prompt for one task.
|
|
154
|
-
* @param task - the task being launched.
|
|
155
|
-
* @param context - the run's other members, for the execution-shape section.
|
|
156
|
-
* @returns the prompt text.
|
|
157
|
-
*/
|
|
158
|
-
export declare function promptText(task: TaskRecord, context?: PromptContext): string;
|
|
159
|
-
/**
|
|
160
|
-
* Build the objective the built-in `/goal` command receives. A prompt whose
|
|
161
|
-
* text would be read as a goal operation is prefixed with a neutral label: the
|
|
162
|
-
* instruction stays intact, and the command arms an objective instead of
|
|
163
|
-
* clearing, pausing, or editing an unrelated goal (or refusing for a missing
|
|
164
|
-
* one).
|
|
165
|
-
* @param prompt - the composed execution prompt.
|
|
166
|
-
* @returns the objective text for `/goal <objective>`.
|
|
167
|
-
*/
|
|
168
|
-
export declare function goalObjective(prompt: string): string;
|
|
169
|
-
/**
|
|
170
|
-
* The optional runtime faces an execution needs beyond the session gateway:
|
|
171
|
-
* the official attachment storage and the model-info reader the image
|
|
172
|
-
* preflight uses. Both are read live, so a deployment that mounts them after
|
|
173
|
-
* the board still gains the capability.
|
|
174
|
-
*/
|
|
175
|
-
export interface TaskBoardRuntimeFaces {
|
|
176
|
-
/** The official attachment storage, or undefined when the deployment has none. */
|
|
177
|
-
attachments?: () => TaskBoardAttachmentStore | undefined;
|
|
178
|
-
/** The model-info reader, or undefined when the deployment serves no model information. */
|
|
179
|
-
llm?: () => ModelInfoResolver | undefined;
|
|
180
|
-
/**
|
|
181
|
-
* Whether this deployment runs the legacy Agent Teams runtime, read live
|
|
182
|
-
* from the agent tool registry. Absent, or answering false, means the
|
|
183
|
-
* deployment is not PROVEN legacy: the dispatcher preset is then forced as
|
|
184
|
-
* before. Only a positive answer refuses the run, so a deployment whose
|
|
185
|
-
* registry cannot be read keeps its current behaviour instead of losing the
|
|
186
|
-
* ability to dispatch a subtask tree.
|
|
187
|
-
*/
|
|
188
|
-
legacyAgentTeams?: () => boolean;
|
|
189
|
-
}
|
|
190
|
-
export declare class HostExecutionRunner {
|
|
191
|
-
private readonly gateway;
|
|
192
|
-
private readonly commands?;
|
|
193
|
-
private readonly workspaceRegistry?;
|
|
194
|
-
private readonly faces;
|
|
195
|
-
/**
|
|
196
|
-
* Newest event sequence per session whose COMPLETE history walk (reaching
|
|
197
|
-
* the execution boundary) found no matching execution end. A later walk may
|
|
198
|
-
* trust everything at or below it and examine only newer records.
|
|
199
|
-
*/
|
|
200
|
-
private readonly scanMemos;
|
|
201
|
-
private readonly unavailableAttempts;
|
|
202
|
-
private readonly unavailableBackoffMs;
|
|
203
|
-
/**
|
|
204
|
-
* The peer every request speaks for. Production passes the peer bound to the
|
|
205
|
-
* plugin fiber; a bare runner (unit tests around fake gateways) gets one
|
|
206
|
-
* bound to a fresh root context instead.
|
|
207
|
-
*/
|
|
208
|
-
private readonly ownerPeer;
|
|
209
|
-
private unsupportedSessionListWarned;
|
|
210
|
-
constructor(gateway: SessionGateway | TypertGateway, commands?: SessionCommandDispatcher | undefined, workspaceRegistry?: TaskBoardWorkspaceRegistry | undefined, unavailableRetry?: {
|
|
211
|
-
attempts?: number;
|
|
212
|
-
backoffMs?: number;
|
|
213
|
-
}, ownerPeer?: GatewayPeer, faces?: TaskBoardRuntimeFaces);
|
|
214
|
-
private invoke;
|
|
215
|
-
private stream;
|
|
216
|
-
/**
|
|
217
|
-
* The workspace an unpinned run lands in: the deployment's most recently used
|
|
218
|
-
* one. Undefined when the deployment serves no workspace registry or has
|
|
219
|
-
* registered none yet; the launch then keeps the "let the Host decide" shape,
|
|
220
|
-
* which is the only remaining path to the Host's own working directory.
|
|
221
|
-
* @returns the workspace id to create the session in, when one is known.
|
|
222
|
-
*/
|
|
223
|
-
private recentWorkspaceId;
|
|
224
|
-
/**
|
|
225
|
-
* Launch one execution. Without `options.reuseSessionId` a fresh session is
|
|
226
|
-
* created, renamed, pinned, and prompted (the historical contract). With it,
|
|
227
|
-
* the run continues in that existing session (issue #1419): the conversation
|
|
228
|
-
* keeps its title and history, the pinned permission/model are re-asserted so
|
|
229
|
-
* the task's execution contract still holds, and the prompt is queued.
|
|
230
|
-
* @param task - the task to run.
|
|
231
|
-
* @param options - optional session to continue in.
|
|
232
|
-
* @returns the session id the execution runs in.
|
|
233
|
-
*/
|
|
234
|
-
launch(task: TaskRecord, options?: {
|
|
235
|
-
reuseSessionId?: string;
|
|
236
|
-
promptContext?: PromptContext;
|
|
237
|
-
/**
|
|
238
|
-
* Agent preset this execution is FORCED under, overriding the card's own
|
|
239
|
-
* `mode` pin (and a handover bundle's): the caller decides it from the run's
|
|
240
|
-
* shape (a card with unfinished subtasks runs as the autonomous dispatcher),
|
|
241
|
-
* and the override is never written into the card. A preset the deployment
|
|
242
|
-
* does not register fails the launch before any session exists.
|
|
243
|
-
*/
|
|
244
|
-
agentPreset?: string;
|
|
245
|
-
onSession?: (sessionId: string) => void;
|
|
246
|
-
onGoalArmed?: (armed: boolean) => void;
|
|
247
|
-
/**
|
|
248
|
-
* GLOBAL native /goal switch, resolved by the caller ONCE per execution and
|
|
249
|
-
* carried here so the decision is frozen for this launch.
|
|
250
|
-
*
|
|
251
|
-
* Frozen deliberately: a settings edit made while the run is in flight must
|
|
252
|
-
* not arm, disarm or otherwise change the goal/acceptance contract of a run
|
|
253
|
-
* already running. Absent means off — the default for every deployment that
|
|
254
|
-
* never touched the switch, including cards written before the option
|
|
255
|
-
* existed. A plain single turn is what an off switch produces; the task-level
|
|
256
|
-
* `goalRun` still applies on top of it (both must ASK for a goal).
|
|
257
|
-
*/
|
|
258
|
-
goalEnabled?: boolean;
|
|
259
|
-
/**
|
|
260
|
-
* The host model catalog, read ONCE per execution by the caller. The card's
|
|
261
|
-
* pinned reasoning effort is sent only when this catalog declares it for the
|
|
262
|
-
* route the execution runs at, so one snapshot decides both the acceptance
|
|
263
|
-
* contract and the effort this run freezes. Absent means "no capability
|
|
264
|
-
* evidence": an effort is then not sent at all.
|
|
265
|
-
*/
|
|
266
|
-
catalog?: ModelCatalogView;
|
|
267
|
-
}): Promise<string>;
|
|
268
|
-
/**
|
|
269
|
-
* Queue one follow-up user message into an existing execution session.
|
|
270
|
-
*
|
|
271
|
-
* This is the same `session/prompt` call a launch makes, with none of the
|
|
272
|
-
* launch pins: a follow-up continues a conversation the board already
|
|
273
|
-
* composed, so it must not re-assert the permission, rename the session, or
|
|
274
|
-
* switch the model. The message is queued behind whatever that session is
|
|
275
|
-
* doing, which is what lets a caller reach a run that is still working.
|
|
276
|
-
* @param sessionId - the session the card's execution recorded.
|
|
277
|
-
* @param text - the message to deliver, already validated by the caller.
|
|
278
|
-
*/
|
|
279
|
-
followUp(sessionId: string, text: string): Promise<void>;
|
|
280
|
-
/**
|
|
281
|
-
* Fail closed when a reused session records a different Agent preset than
|
|
282
|
-
* the one this task pins.
|
|
283
|
-
*
|
|
284
|
-
* The fresh branch asserts the pin by passing `agentPreset` to
|
|
285
|
-
* `session/create`; the reuse branch must not call that method (it would
|
|
286
|
-
* create or re-adopt the very session the board only meant to continue), so
|
|
287
|
-
* the recorded value is read through `session/projections` — the documented
|
|
288
|
-
* read that resolves no Agent — and compared here (issue #1708). A session
|
|
289
|
-
* whose preset cannot be read is not treated as a match: silently continuing
|
|
290
|
-
* under an unknown composition is the failure this guards.
|
|
291
|
-
* @param sessionId - the session this execution continues in.
|
|
292
|
-
* @param pinned - the preset id the task pins, when it pins one.
|
|
293
|
-
*/
|
|
294
|
-
private assertReusedPreset;
|
|
295
|
-
/**
|
|
296
|
-
* Split a `provider/model` pin. A pin without a provider keeps only the model
|
|
297
|
-
* id: the provider is the one the host catalog declares for it, resolved at
|
|
298
|
-
* launch because the session wire contract requires a provider.
|
|
299
|
-
*/
|
|
300
|
-
private static pinnedRoute;
|
|
301
|
-
/**
|
|
302
|
-
* The route a card that pins no model actually runs at: the session's own
|
|
303
|
-
* recorded selection (the durable fold the GUI reads; `next` is the pending
|
|
304
|
-
* user choice, `lastUsed` what the last request consumed), or — for a session
|
|
305
|
-
* that has selected none yet, which is exactly a session that would start at
|
|
306
|
-
* the deployment default — the host default from the catalog.
|
|
307
|
-
*
|
|
308
|
-
* A route that cannot be READ is undefined and the effort is not sent:
|
|
309
|
-
* falling back to the host default there would silently switch the model of a
|
|
310
|
-
* session this run only meant to continue.
|
|
311
|
-
*/
|
|
312
|
-
private sessionRoute;
|
|
313
|
-
/**
|
|
314
|
-
* Re-assert the pinned execution contract on a session and queue the task
|
|
315
|
-
* prompt. Shared by the fresh-session and reuse paths so both apply exactly
|
|
316
|
-
* the same permission/model/effort pins before the prompt. A session that
|
|
317
|
-
* refuses a selection carrying a catalog-confirmed effort throws here, so the
|
|
318
|
-
* prompt is never queued behind a run at the wrong level.
|
|
319
|
-
*/
|
|
320
|
-
private pinAndPrompt;
|
|
321
|
-
/**
|
|
322
|
-
* Resolve a card's attachments for one execution.
|
|
323
|
-
*
|
|
324
|
-
* A card without attachments resolves to nothing, even in a deployment that
|
|
325
|
-
* serves no attachment storage at all. A card WITH attachments cannot run
|
|
326
|
-
* without the storage: the run fails with a readable reason instead of
|
|
327
|
-
* silently dropping the attachment and running the card as if it carried
|
|
328
|
-
* none.
|
|
329
|
-
*/
|
|
330
|
-
private resolveAttachments;
|
|
331
|
-
/**
|
|
332
|
-
* Read the host's model catalog: the default route an unconfigured session
|
|
333
|
-
* starts at, and each provider's models with the reasoning metadata its
|
|
334
|
-
* adapter exposes. The acceptance settings card and the frozen contract both
|
|
335
|
-
* resolve against it, so "inherit host" means the host's own configuration
|
|
336
|
-
* rather than a session's or a card's pinned model.
|
|
337
|
-
* @returns the raw catalog value, or undefined when this cohort serves none.
|
|
338
|
-
*/
|
|
339
|
-
modelCatalog(): Promise<unknown>;
|
|
340
|
-
/**
|
|
341
|
-
* Arm dsh's built-in goal on the session. The task prompt is queued FIRST, so
|
|
342
|
-
* the session's first turn carries the instruction verbatim; `/goal
|
|
343
|
-
* <objective>` then turns the same text into a persistent objective, and
|
|
344
|
-
* dsh's goal-round driver keeps starting continuation rounds until the agent
|
|
345
|
-
* marks it complete (see {@link goalVerdict} for how the run settles).
|
|
346
|
-
*
|
|
347
|
-
* Two switches gate the arming, and BOTH must ask for it:
|
|
348
|
-
* - the GLOBAL native-/goal switch (`goalEnabled`, default OFF), frozen when
|
|
349
|
-
* this execution started; and
|
|
350
|
-
* - the task's own `goalRun` (absent means off, only an explicit true opts
|
|
351
|
-
* the card into a goal run).
|
|
352
|
-
*
|
|
353
|
-
* A refusal (no command dispatcher, no `/goal` command in this cohort, an
|
|
354
|
-
* objective the command rejects) is reported and the run continues as a plain
|
|
355
|
-
* turn: the task was asked to run, and a missing goal mode must not lose the
|
|
356
|
-
* work.
|
|
357
|
-
* @param sessionId - the session to arm in.
|
|
358
|
-
* @param task - the task being run.
|
|
359
|
-
* @param context - the run's prompt context.
|
|
360
|
-
* @param goalEnabled - the GLOBAL switch, frozen for this execution.
|
|
361
|
-
* @returns whether `/goal` was really armed.
|
|
362
|
-
*/
|
|
363
|
-
private armGoal;
|
|
364
|
-
/**
|
|
365
|
-
* The verdict an armed dsh goal imposes on an otherwise completed turn.
|
|
366
|
-
*
|
|
367
|
-
* A goal run is one session working many automatic continuation rounds:
|
|
368
|
-
* dsh's goal-round driver queues the next round whenever the agent goes
|
|
369
|
-
* idle, so the first completed `turn/end` is not the execution's result.
|
|
370
|
-
* Settling there would leave the card in `done` while the session keeps
|
|
371
|
-
* working, and a scheduled task would fire a second, concurrent session.
|
|
372
|
-
* The session projection is the authority: an `active` goal keeps the
|
|
373
|
-
* execution pending, a `blocked` goal fails it with the recorded reason, and
|
|
374
|
-
* any other phase (complete, paused, or no goal at all) leaves the turn
|
|
375
|
-
* verdict in place.
|
|
376
|
-
*
|
|
377
|
-
* An unreadable projection falls back to that turn verdict: a cohort whose
|
|
378
|
-
* gateway withdrew `session/projections` must not hang every execution.
|
|
379
|
-
*/
|
|
380
|
-
private goalVerdict;
|
|
381
|
-
listRunning(): Promise<{
|
|
382
|
-
known: true;
|
|
383
|
-
count: number;
|
|
384
|
-
items: SessionSummary[];
|
|
385
|
-
} | {
|
|
386
|
-
known: false;
|
|
387
|
-
}>;
|
|
388
|
-
/**
|
|
389
|
-
* Resolve an execution outcome from the session list and bounded history pages.
|
|
390
|
-
* @param sessionId - the session the execution runs in.
|
|
391
|
-
* @param startedAt - instant the execution opened; earlier events are not its own.
|
|
392
|
-
* @param sessions - roster from the caller's own poll, when it already has one.
|
|
393
|
-
* @param options.whileRunning - read the first completed turn even while the
|
|
394
|
-
* roster reports the session as running. A durable Agent Teams teammate
|
|
395
|
-
* stays alive after its turn ends, so `running` never clears for it and the
|
|
396
|
-
* turn it completed is the only verdict it will ever expose.
|
|
397
|
-
*/
|
|
398
|
-
inspect(sessionId: string, startedAt?: number, sessions?: readonly SessionSummary[], options?: {
|
|
399
|
-
whileRunning?: boolean;
|
|
400
|
-
}): Promise<ExecutionInspection>;
|
|
401
|
-
}
|