@fish-under-sea/dsh-client-ui-task-board-fish 2.2.3 → 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 +1 -1
- 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,63 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* One-shot model dispatch for the board's Host half.
|
|
3
|
-
*
|
|
4
|
-
* The board makes two one-shot model calls: the goal-acceptance judge
|
|
5
|
-
* (`verification-runner.ts`) and the "parse pasted text" action
|
|
6
|
-
* (`host-ai.ts`). Both call the official `llm` service, and both must call it
|
|
7
|
-
* the way the official agent loop does.
|
|
8
|
-
*
|
|
9
|
-
* The runtime exposes two entry points with the same name shape. The public
|
|
10
|
-
* `stream(options)` is a single-argument convenience method, and it is an
|
|
11
|
-
* ordinary instance property — any plugin may overwrite it. The registration
|
|
12
|
-
* bound path `prepareCall(config)` returns a one-shot handle whose
|
|
13
|
-
* `stream(request)` reaches the adapter through the runtime's internal
|
|
14
|
-
* dispatch instead, and `ctx.on('llm/stream')` remains the supported seam every
|
|
15
|
-
* extension is expected to register on.
|
|
16
|
-
*
|
|
17
|
-
* A third-party provider plugin that patched `llm.stream` with the waterfall
|
|
18
|
-
* listener signature `(options, next)` broke every caller that used the public
|
|
19
|
-
* method: `llm.stream(options)` invoked the listener with `next === undefined`,
|
|
20
|
-
* so the guard's `for await (const chunk of next())` raised
|
|
21
|
-
* `TypeError: next(...) is not a function or its return value is not async
|
|
22
|
-
* iterable`. The agent loop was unaffected because it already dispatches
|
|
23
|
-
* through `prepareCall(...).stream(...)`; the board's two one-shot calls were
|
|
24
|
-
* not, and each completed acceptance was recorded as an anomaly
|
|
25
|
-
* ("验收异常(裁判请求失败)") after two judge attempts.
|
|
26
|
-
*
|
|
27
|
-
* Dispatching through the prepared call fixes that at the owner: the board no
|
|
28
|
-
* longer depends on a mutable instance property that a plugin may legitimately
|
|
29
|
-
* replace, and a plugin that registers on `llm/stream` is still invoked. The
|
|
30
|
-
* public method remains the fallback for a runtime that exposes no
|
|
31
|
-
* `prepareCall` at all, so an older or proxied service keeps working.
|
|
32
|
-
*/
|
|
33
|
-
import { type GenerateOptions, type LlmRuntime, type StreamChunk } from '@deepseek-ai/dsh-llm';
|
|
34
|
-
/** The request fields the board adds around a call config. */
|
|
35
|
-
export type OneShotRequest = Pick<GenerateOptions, 'messages' | 'signal'> & Pick<GenerateOptions, 'system'>;
|
|
36
|
-
/**
|
|
37
|
-
* The call config as this board's own domain types carry it.
|
|
38
|
-
*
|
|
39
|
-
* `VerificationRoute.reasoningEffort` and the parse route are plain strings (the
|
|
40
|
-
* catalog publishes effort ids as strings), while the SDK brands them
|
|
41
|
-
* nominally; the single crossing is branded here so no caller repeats the
|
|
42
|
-
* assertion.
|
|
43
|
-
*/
|
|
44
|
-
export interface OneShotCallConfig {
|
|
45
|
-
provider: string;
|
|
46
|
-
model: string;
|
|
47
|
-
reasoningEffort?: string;
|
|
48
|
-
temperature?: number;
|
|
49
|
-
maxTokens?: number;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Open one one-shot model stream on the registration-bound dispatch path.
|
|
53
|
-
*
|
|
54
|
-
* The call-config fields must travel inside `config` (not the request): the
|
|
55
|
-
* prepared handle refuses a request whose config fields differ from the ones it
|
|
56
|
-
* resolved, so the request carries only messages, signal, and the optional
|
|
57
|
-
* one-shot system prompt.
|
|
58
|
-
* @param llm - the Host's llm service.
|
|
59
|
-
* @param config - provider/model route plus the caller's sampling controls.
|
|
60
|
-
* @param request - the assembled messages and cancellation for this call.
|
|
61
|
-
* @returns the chunk stream, including any registered `llm/stream` listener.
|
|
62
|
-
*/
|
|
63
|
-
export declare function openOneShotStream(llm: LlmRuntime, config: OneShotCallConfig, request: OneShotRequest): Promise<AsyncIterable<StreamChunk>>;
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Goal acceptance gate: the board's evaluator-backed certification of a goal
|
|
3
|
-
* completion claim.
|
|
4
|
-
*
|
|
5
|
-
* The gate sits on the official tool pre-execute lifecycle and intercepts the
|
|
6
|
-
* one call that ends a goal run — `update_goal` with `action: 'complete'`
|
|
7
|
-
* — BEFORE it takes effect. This is why the board does not ask the agent to
|
|
8
|
-
* verify itself: the tool call that finishes the goal is refused until a
|
|
9
|
-
* matching acceptance pass record exists, so no prompt wording and no
|
|
10
|
-
* self-report can route around it.
|
|
11
|
-
*
|
|
12
|
-
* Semantics owned here:
|
|
13
|
-
* - one acceptance cycle per EXECUTION, spent at most twice: the first failure
|
|
14
|
-
* returns its findings to the fixing agent, the second ends the cycle;
|
|
15
|
-
* - a repeated completion call during a repair, a new automatic goal round, a
|
|
16
|
-
* plugin reload and a Host restart all reuse the same cycle rather than
|
|
17
|
-
* resetting it (the budget is persisted on the execution record);
|
|
18
|
-
* - an anomaly (timeout, authentication, unparseable answer, an unusable judge
|
|
19
|
-
* route) is recorded separately from a quality verdict and is never treated
|
|
20
|
-
* as one;
|
|
21
|
-
* - exhausting the anomaly budget does NOT judge the card: an environment that
|
|
22
|
-
* cannot answer is not the work failing, so the cycle is held open with no
|
|
23
|
-
* judge call until a user clears the recorded anomalies (issue #1828);
|
|
24
|
-
* - an attempt the time budget ends before any verdict is recorded as its own
|
|
25
|
-
* stage and charged to no budget at all (issue #1828);
|
|
26
|
-
* - an INVALID acceptance (a veto whose required evidence is missing,
|
|
27
|
-
* unlocatable, or aimed at the empty-work baseline) is recorded in its own
|
|
28
|
-
* stage, spends its OWN bounded budget, and never consumes a quality attempt
|
|
29
|
-
* or fails the card; when that budget is spent the cycle is held for a human
|
|
30
|
-
* exactly like a spent anomaly budget;
|
|
31
|
-
* - concurrent completion calls for one execution share one acceptance.
|
|
32
|
-
|
|
33
|
-
* The validity check itself is program-level (`assessAcceptanceValidity` in
|
|
34
|
-
* `core/verification.ts`), applied after the judge answers and BEFORE any
|
|
35
|
-
* quality verdict is written: a stronger prompt alone could not enforce it.
|
|
36
|
-
*/
|
|
37
|
-
import type { PreToolDecision } from '@deepseek-ai/dsh-tools';
|
|
38
|
-
import type { LlmRuntime } from '@deepseek-ai/dsh-llm';
|
|
39
|
-
import { type WorkspaceChangeSource } from './workspace-evidence.ts';
|
|
40
|
-
import type { HostTaskLedger } from '../host-ledger.ts';
|
|
41
|
-
/** The subset of the official goal service this gate drives. */
|
|
42
|
-
export interface GoalFace {
|
|
43
|
-
get(agent: unknown): {
|
|
44
|
-
id: string;
|
|
45
|
-
revision: number;
|
|
46
|
-
objective: string;
|
|
47
|
-
} | undefined;
|
|
48
|
-
block(agent: unknown, ref: {
|
|
49
|
-
id: string;
|
|
50
|
-
revision: number;
|
|
51
|
-
}, reason: {
|
|
52
|
-
code: string;
|
|
53
|
-
message: string;
|
|
54
|
-
}): unknown;
|
|
55
|
-
}
|
|
56
|
-
/** Everything the gate needs from its owner. */
|
|
57
|
-
export interface GoalVerificationGateDeps {
|
|
58
|
-
ledger: HostTaskLedger;
|
|
59
|
-
/** Resolve the optional model runtime lazily (it may activate later). */
|
|
60
|
-
llm?: () => LlmRuntime | undefined;
|
|
61
|
-
/** Resolve the optional goal service lazily. */
|
|
62
|
-
goals?: () => GoalFace | undefined;
|
|
63
|
-
/**
|
|
64
|
-
* Resolve the optional host change service lazily. Absent (or a deployment
|
|
65
|
-
* that serves none) simply means the judge sees the trajectory alone.
|
|
66
|
-
*/
|
|
67
|
-
workspaceChanges?: () => WorkspaceChangeSource | undefined;
|
|
68
|
-
/**
|
|
69
|
-
* Ceiling of one judge request, read per acceptance (a row setting). Absent
|
|
70
|
-
* keeps the default, so a programmatic mount still judges.
|
|
71
|
-
*/
|
|
72
|
-
callTimeoutMs?: () => number;
|
|
73
|
-
/**
|
|
74
|
-
* Total ceiling of one acceptance attempt, read per acceptance (a row
|
|
75
|
-
* setting). Absent keeps the default.
|
|
76
|
-
*/
|
|
77
|
-
budgetMs?: () => number;
|
|
78
|
-
logger: {
|
|
79
|
-
warn(message: string, ...rest: unknown[]): void;
|
|
80
|
-
};
|
|
81
|
-
now?: () => number;
|
|
82
|
-
}
|
|
83
|
-
/** The shape of one tool pre-execution the gate inspects. */
|
|
84
|
-
export interface GateExecution {
|
|
85
|
-
name: string;
|
|
86
|
-
arguments: unknown;
|
|
87
|
-
agent?: unknown;
|
|
88
|
-
signal: AbortSignal;
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Create the goal acceptance gate.
|
|
92
|
-
* @param deps - the ledger, the model runtime, the goal service and the settings.
|
|
93
|
-
* @returns the `tools/pre-execute` listener body (without the waterfall next()).
|
|
94
|
-
*/
|
|
95
|
-
export declare function createGoalVerificationGate(deps: GoalVerificationGateDeps): (exec: GateExecution) => Promise<PreToolDecision | undefined>;
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Goal acceptance runner: evidence assembly and the judge calls of one
|
|
3
|
-
* acceptance attempt.
|
|
4
|
-
*
|
|
5
|
-
* Lives in the host half because it needs the live session event log and the
|
|
6
|
-
* official `llm` service; every rule it applies (criteria, scale, tags,
|
|
7
|
-
* thresholds, budgets, caps) comes from `../core/verification.ts`, which mirrors
|
|
8
|
-
* the installed dsh-llm-verifier 0.8.4 default final acceptance.
|
|
9
|
-
*/
|
|
10
|
-
import { type LlmRuntime } from '@deepseek-ai/dsh-llm';
|
|
11
|
-
import { type VerificationAttempt, type VerificationRoute, type VerificationUsage } from '../core/verification.ts';
|
|
12
|
-
/** Largest trace handed to the judge, mirroring the verifier's default cap. */
|
|
13
|
-
export declare const VERIFICATION_MAX_TRACE_CHARS = 80000;
|
|
14
|
-
/** Largest single trace entry; one huge tool result must not eat the budget. */
|
|
15
|
-
export declare const VERIFICATION_MAX_ENTRY_CHARS = 4000;
|
|
16
|
-
/** Largest per-finding text kept from one judge answer. */
|
|
17
|
-
export declare const VERIFICATION_MAX_FINDING_CHARS = 400;
|
|
18
|
-
/** Largest verbatim citation kept from one finding. */
|
|
19
|
-
export declare const VERIFICATION_MAX_QUOTE_CHARS = 600;
|
|
20
|
-
/** Largest requirement/observation/gap statement kept from one finding. */
|
|
21
|
-
export declare const VERIFICATION_MAX_PROBLEM_CHARS = 400;
|
|
22
|
-
/** Structured findings kept per judge answer and per acceptance. */
|
|
23
|
-
export declare const VERIFICATION_MAX_FINDINGS_PER_CALL = 3;
|
|
24
|
-
export declare const VERIFICATION_MAX_FINDINGS = 12;
|
|
25
|
-
/**
|
|
26
|
-
* Default ceiling of ONE judge request. The effective ceiling is a row setting
|
|
27
|
-
* (`goalVerificationCallTimeoutSeconds`), read live by the gate, because 120s was
|
|
28
|
-
* tight for a reasoning model reading an 80,000 character trace with a 16,384
|
|
29
|
-
* token output cap: every timeout it produced was charged as an acceptance
|
|
30
|
-
* anomaly against a budget that then failed the card.
|
|
31
|
-
*/
|
|
32
|
-
export declare const VERIFICATION_CALL_TIMEOUT_MS = 150000;
|
|
33
|
-
export declare const VERIFICATION_MAX_TOKENS = 16384;
|
|
34
|
-
export declare const VERIFICATION_TEMPERATURE = 0.2;
|
|
35
|
-
export declare const VERIFICATION_REQUEST_ATTEMPTS = 3;
|
|
36
|
-
/** Redaction patterns, mirrored from the verifier's defaults. */
|
|
37
|
-
export declare const VERIFICATION_REDACT_PATTERNS: readonly string[];
|
|
38
|
-
/** Why one acceptance could not produce a verdict. */
|
|
39
|
-
export type VerificationErrorKind = 'route-unavailable' | 'timeout' | 'auth' | 'parse' | 'request' | 'aborted' | 'budget';
|
|
40
|
-
/**
|
|
41
|
-
* The time one acceptance attempt may still spend.
|
|
42
|
-
*
|
|
43
|
-
* `deadline` is the instant the whole attempt runs out; `callTimeoutMs` is the
|
|
44
|
-
* ceiling of a single judge call. The pair is what ties the retry budget to the
|
|
45
|
-
* acceptance budget: a call is not started unless its own ceiling still fits
|
|
46
|
-
* inside what is left, because starting one the outer budget will abort anyway
|
|
47
|
-
* only burns wall time and turns a slow machine into an anomaly.
|
|
48
|
-
*/
|
|
49
|
-
export interface AcceptanceBudget {
|
|
50
|
-
/** Absolute instant (ms epoch) the acceptance attempt runs out at. */
|
|
51
|
-
deadline: number;
|
|
52
|
-
/** Ceiling of one judge call in milliseconds. */
|
|
53
|
-
callTimeoutMs: number;
|
|
54
|
-
/** Clock the caller runs on, injected so tests drive it deterministically. */
|
|
55
|
-
now: () => number;
|
|
56
|
-
}
|
|
57
|
-
/** An acceptance anomaly: never a quality verdict, always recorded as one. */
|
|
58
|
-
export declare class VerificationError extends Error {
|
|
59
|
-
readonly kind: VerificationErrorKind;
|
|
60
|
-
readonly usage: VerificationUsage;
|
|
61
|
-
constructor(kind: VerificationErrorKind, message: string, usage?: VerificationUsage, options?: {
|
|
62
|
-
cause?: unknown;
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
/** Fresh zeroed usage counters. */
|
|
66
|
-
export declare function emptyUsage(): VerificationUsage;
|
|
67
|
-
/** Structural view of one session event, as the host log carries it. */
|
|
68
|
-
interface RawEvent {
|
|
69
|
-
type?: unknown;
|
|
70
|
-
seq?: unknown;
|
|
71
|
-
time?: unknown;
|
|
72
|
-
data?: unknown;
|
|
73
|
-
}
|
|
74
|
-
/** Read one session's events across the shapes the SDK cohort exposes. */
|
|
75
|
-
export declare function sessionEvents(session: unknown): readonly RawEvent[];
|
|
76
|
-
/** Evidence assembled for one acceptance attempt. */
|
|
77
|
-
export interface AcceptanceEvidence {
|
|
78
|
-
problem: string;
|
|
79
|
-
trace: string;
|
|
80
|
-
entries: number;
|
|
81
|
-
fromSeq?: number;
|
|
82
|
-
toSeq?: number;
|
|
83
|
-
omittedCharacters: number;
|
|
84
|
-
hash: string;
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Assemble the evidence one acceptance judges.
|
|
88
|
-
*
|
|
89
|
-
* The window starts at the execution's own `startedAt`, never at the session's
|
|
90
|
-
* first event: a reused session carries the history of earlier executions, and
|
|
91
|
-
* those runs must not be judged as this one's work. Only observed output is
|
|
92
|
-
* rendered — tool calls with their arguments and their results, assistant
|
|
93
|
-
* prose, goal round markers and team messages — and the result is redacted and
|
|
94
|
-
* capped before it ever reaches a judge.
|
|
95
|
-
* @param session - the live session of the execution.
|
|
96
|
-
* @param problem - the execution's composed prompt, shown as the task statement.
|
|
97
|
-
* @param startedAt - the instant the execution opened (ms epoch).
|
|
98
|
-
* @returns the bounded, redacted evidence.
|
|
99
|
-
*/
|
|
100
|
-
/**
|
|
101
|
-
* The session events inside one execution's own window.
|
|
102
|
-
*
|
|
103
|
-
* A reused session carries the history of earlier executions; only the events
|
|
104
|
-
* at or after this execution's start belong to the work being judged.
|
|
105
|
-
* @param session - the live session.
|
|
106
|
-
* @param startedAt - the execution's start instant (ms epoch).
|
|
107
|
-
* @returns the events of this execution, oldest first.
|
|
108
|
-
*/
|
|
109
|
-
export declare function evidenceEvents(session: unknown, startedAt: number): readonly RawEvent[];
|
|
110
|
-
export declare function collectEvidence(session: unknown, problem: string, startedAt: number): AcceptanceEvidence;
|
|
111
|
-
/** The verdict of one acceptance attempt. */
|
|
112
|
-
export interface AcceptanceResult {
|
|
113
|
-
attempt: VerificationAttempt;
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* Run one acceptance: every criterion is judged twice, the odd round with the
|
|
117
|
-
* A/B slots swapped, and the per-round scores are mapped back and averaged per
|
|
118
|
-
* criterion.
|
|
119
|
-
* @param input - the judge route, evidence, threshold, time budget and cancellation.
|
|
120
|
-
* @returns the recorded attempt (quality verdict, anomaly, or budget stop).
|
|
121
|
-
*/
|
|
122
|
-
export declare function runAcceptance(input: {
|
|
123
|
-
llm: LlmRuntime;
|
|
124
|
-
route: VerificationRoute;
|
|
125
|
-
evidence: AcceptanceEvidence;
|
|
126
|
-
threshold: number;
|
|
127
|
-
index: number;
|
|
128
|
-
signal: AbortSignal;
|
|
129
|
-
/** Instant (ms epoch) the attempt runs out at; defaults to now plus the default budget. */
|
|
130
|
-
deadline?: number;
|
|
131
|
-
/** Ceiling of one judge call; defaults to {@link VERIFICATION_CALL_TIMEOUT_MS}. */
|
|
132
|
-
callTimeoutMs?: number;
|
|
133
|
-
/** Host-observed workspace changes, rendered as the prompt's reference context. */
|
|
134
|
-
context?: string;
|
|
135
|
-
/** How many changed files that context shows. */
|
|
136
|
-
workspaceFiles?: number;
|
|
137
|
-
now?: () => number;
|
|
138
|
-
}): Promise<AcceptanceResult>;
|
|
139
|
-
export {};
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/** The subset of the host change service this module drives. */
|
|
2
|
-
export interface WorkspaceChangeSource {
|
|
3
|
-
summary(sessionId: string, seq: number): unknown;
|
|
4
|
-
diff(sessionId: string, seq: number, index: number, signal: AbortSignal): Promise<unknown>;
|
|
5
|
-
}
|
|
6
|
-
/** One session event, as the host log carries it. */
|
|
7
|
-
interface RawEvent {
|
|
8
|
-
type?: unknown;
|
|
9
|
-
seq?: unknown;
|
|
10
|
-
}
|
|
11
|
-
/** How many changed files one evidence block renders. */
|
|
12
|
-
export declare const MAX_WORKSPACE_FILES = 8;
|
|
13
|
-
/** Character ceiling for the whole rendered block. */
|
|
14
|
-
export declare const WORKSPACE_EVIDENCE_MAX_CHARS = 24000;
|
|
15
|
-
/** Character ceiling for one file's rendered comparison. */
|
|
16
|
-
export declare const WORKSPACE_EVIDENCE_MAX_FILE_CHARS = 6000;
|
|
17
|
-
/**
|
|
18
|
-
* Resolve the optional host change service from a context-like object.
|
|
19
|
-
* @param ctx - anything exposing @@get(name)@@.
|
|
20
|
-
* @returns the service, or undefined when this deployment serves none.
|
|
21
|
-
*/
|
|
22
|
-
export declare function probeWorkspaceChanges(ctx: {
|
|
23
|
-
get(name: string): unknown;
|
|
24
|
-
}): WorkspaceChangeSource | undefined;
|
|
25
|
-
/** The sequence of the newest change event inside the reviewed window. */
|
|
26
|
-
export declare function latestChangeEvent(events: readonly RawEvent[]): {
|
|
27
|
-
seq: number;
|
|
28
|
-
turn?: number;
|
|
29
|
-
} | undefined;
|
|
30
|
-
/**
|
|
31
|
-
* Render the host's own record of what the reviewed window changed.
|
|
32
|
-
*
|
|
33
|
-
* Bounded twice — at most {@link MAX_WORKSPACE_FILES} files, and a shared
|
|
34
|
-
* character budget split across them — so one enormous generated file cannot
|
|
35
|
-
* crowd out every other change. Every failure degrades to less evidence (or an
|
|
36
|
-
* empty block) instead of an error, because the acceptance being prepared must
|
|
37
|
-
* still reach a verdict.
|
|
38
|
-
* @param events - session events already bounded to the execution's window.
|
|
39
|
-
* @param sessionId - the session whose changes these are.
|
|
40
|
-
* @param source - the probed host service.
|
|
41
|
-
* @param options - budget, cancellation and the diagnostic sink.
|
|
42
|
-
* @returns the rendered block plus how many files it shows.
|
|
43
|
-
*/
|
|
44
|
-
export declare function renderWorkspaceEvidence(events: readonly RawEvent[], sessionId: string, source: WorkspaceChangeSource, options: {
|
|
45
|
-
signal: AbortSignal;
|
|
46
|
-
warn?: (message: string) => void;
|
|
47
|
-
maxChars?: number;
|
|
48
|
-
}): Promise<{
|
|
49
|
-
text: string;
|
|
50
|
-
files: number;
|
|
51
|
-
hash: string;
|
|
52
|
-
}>;
|
|
53
|
-
export {};
|
package/lib/types/host-ai.d.ts
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* One-shot model parse behind the board's "parse pasted text" action
|
|
3
|
-
* (issue #1540).
|
|
4
|
-
*
|
|
5
|
-
* The browser half never talks to a model: it posts the pasted text and the
|
|
6
|
-
* route the user picked to the Host, which calls the injected `llm` service
|
|
7
|
-
* once and answers with the three draft fields the new-task form accepts. The
|
|
8
|
-
* reply is untrusted text, so extraction is defensive: code fences are
|
|
9
|
-
* stripped, the first JSON object wins, and an unusable reply falls back to
|
|
10
|
-
* the user's own words instead of an empty form.
|
|
11
|
-
*/
|
|
12
|
-
import { type LlmRuntime } from '@deepseek-ai/dsh-llm';
|
|
13
|
-
import type { TaskBoardParseDraft, TaskBoardParseRequest } from './protocol.ts';
|
|
14
|
-
/** How long one parse may take before the Host gives up on the model. */
|
|
15
|
-
export declare const TASK_PARSE_TIMEOUT_MS = 45000;
|
|
16
|
-
/** Largest pasted text one parse accepts (bytes). */
|
|
17
|
-
export declare const TASK_PARSE_MAX_INPUT: number;
|
|
18
|
-
export type TaskParseFailureCode = 'no-model' | 'model-error' | 'parse-failed' | 'timeout';
|
|
19
|
-
/** Typed parse failure; the route maps the code onto a status and a body. */
|
|
20
|
-
export declare class TaskParseError extends Error {
|
|
21
|
-
readonly code: TaskParseFailureCode;
|
|
22
|
-
constructor(code: TaskParseFailureCode, message: string);
|
|
23
|
-
}
|
|
24
|
-
/** Split a qualified `provider/model` route the same way the runner does. */
|
|
25
|
-
export declare function splitModelRoute(qualified: string | undefined): {
|
|
26
|
-
provider: string;
|
|
27
|
-
model: string;
|
|
28
|
-
} | undefined;
|
|
29
|
-
/**
|
|
30
|
-
* Read the draft out of a model reply. Fences and surrounding prose are
|
|
31
|
-
* tolerated; anything unusable returns undefined so the caller can decide
|
|
32
|
-
* between a typed failure and a fallback.
|
|
33
|
-
* @param reply - raw model text.
|
|
34
|
-
*/
|
|
35
|
-
export declare function extractTaskParseReply(reply: string): Partial<TaskBoardParseDraft> | undefined;
|
|
36
|
-
/**
|
|
37
|
-
* Fill the three form fields, falling back to the pasted text so a weak model
|
|
38
|
-
* reply never loses what the user actually wrote.
|
|
39
|
-
* @param reply - raw model text.
|
|
40
|
-
* @param source - the text the user pasted.
|
|
41
|
-
*/
|
|
42
|
-
export declare function draftFromReply(reply: string, source: string): TaskBoardParseDraft;
|
|
43
|
-
/**
|
|
44
|
-
* Parse one pasted text through the injected `llm` service.
|
|
45
|
-
* @param llm - the Host's llm service.
|
|
46
|
-
* @param request - pasted text plus the qualified model route.
|
|
47
|
-
* @param signal - caller cancellation (client disconnect); combined with the timeout.
|
|
48
|
-
* @returns the draft fields.
|
|
49
|
-
* @throws TaskParseError with a code the route maps onto a status.
|
|
50
|
-
*/
|
|
51
|
-
export declare function parseTaskDraft(llm: LlmRuntime, request: TaskBoardParseRequest, signal?: AbortSignal): Promise<TaskBoardParseDraft>;
|