@agimon-ai/doompi-task 0.0.1-alpha.2 → 0.0.1-alpha.21
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.md +39 -12
- package/dist/adapters/pi/extension.cjs +3 -0
- package/dist/adapters/pi/extension.cjs.map +1 -0
- package/dist/adapters/pi/extension.d.cts +12 -0
- package/dist/adapters/pi/extension.d.cts.map +1 -0
- package/dist/adapters/pi/extension.d.mts +12 -0
- package/dist/adapters/pi/extension.d.mts.map +1 -0
- package/dist/adapters/pi/extension.mjs +3 -0
- package/dist/adapters/pi/extension.mjs.map +1 -0
- package/dist/adapters/store/paths.cjs +2 -0
- package/dist/adapters/store/paths.cjs.map +1 -0
- package/dist/adapters/store/paths.d.cts +26 -0
- package/dist/adapters/store/paths.d.cts.map +1 -0
- package/dist/adapters/store/paths.d.mts +26 -0
- package/dist/adapters/store/paths.d.mts.map +1 -0
- package/dist/adapters/store/paths.mjs +2 -0
- package/dist/adapters/store/paths.mjs.map +1 -0
- package/dist/adapters/store/taskStore.cjs +2 -0
- package/dist/adapters/store/taskStore.cjs.map +1 -0
- package/dist/adapters/store/taskStore.d.cts +87 -0
- package/dist/adapters/store/taskStore.d.cts.map +1 -0
- package/dist/adapters/store/taskStore.d.mts +87 -0
- package/dist/adapters/store/taskStore.d.mts.map +1 -0
- package/dist/adapters/store/taskStore.mjs +2 -0
- package/dist/adapters/store/taskStore.mjs.map +1 -0
- package/dist/adapters/telemetry/logSinkTelemetry.cjs +2 -0
- package/dist/adapters/telemetry/logSinkTelemetry.cjs.map +1 -0
- package/dist/adapters/telemetry/logSinkTelemetry.d.cts +52 -0
- package/dist/adapters/telemetry/logSinkTelemetry.d.cts.map +1 -0
- package/dist/adapters/telemetry/logSinkTelemetry.d.mts +52 -0
- package/dist/adapters/telemetry/logSinkTelemetry.d.mts.map +1 -0
- package/dist/adapters/telemetry/logSinkTelemetry.mjs +2 -0
- package/dist/adapters/telemetry/logSinkTelemetry.mjs.map +1 -0
- package/dist/commands/index.cjs +2 -0
- package/dist/commands/index.cjs.map +1 -0
- package/dist/commands/index.d.cts +15 -0
- package/dist/commands/index.d.cts.map +1 -0
- package/dist/commands/index.d.mts +15 -0
- package/dist/commands/index.d.mts.map +1 -0
- package/dist/commands/index.mjs +2 -0
- package/dist/commands/index.mjs.map +1 -0
- package/dist/commands/task/promptGuidelines.cjs +2 -0
- package/dist/commands/task/promptGuidelines.cjs.map +1 -0
- package/dist/commands/task/promptGuidelines.d.cts +5 -0
- package/dist/commands/task/promptGuidelines.d.cts.map +1 -0
- package/dist/commands/task/promptGuidelines.d.mts +5 -0
- package/dist/commands/task/promptGuidelines.d.mts.map +1 -0
- package/dist/commands/task/promptGuidelines.mjs +2 -0
- package/dist/commands/task/promptGuidelines.mjs.map +1 -0
- package/dist/commands/task/responseEnvelope.cjs +7 -0
- package/dist/commands/task/responseEnvelope.cjs.map +1 -0
- package/dist/commands/task/responseEnvelope.d.cts +51 -0
- package/dist/commands/task/responseEnvelope.d.cts.map +1 -0
- package/dist/commands/task/responseEnvelope.d.mts +51 -0
- package/dist/commands/task/responseEnvelope.d.mts.map +1 -0
- package/dist/commands/task/responseEnvelope.mjs +7 -0
- package/dist/commands/task/responseEnvelope.mjs.map +1 -0
- package/dist/commands/task/taskTool.cjs +3 -0
- package/dist/commands/task/taskTool.cjs.map +1 -0
- package/dist/commands/task/taskTool.d.cts +19 -0
- package/dist/commands/task/taskTool.d.cts.map +1 -0
- package/dist/commands/task/taskTool.d.mts +19 -0
- package/dist/commands/task/taskTool.d.mts.map +1 -0
- package/dist/commands/task/taskTool.mjs +3 -0
- package/dist/commands/task/taskTool.mjs.map +1 -0
- package/dist/commands.cjs +1 -2
- package/dist/commands.d.cts +2 -14
- package/dist/commands.d.mts +2 -14
- package/dist/commands.mjs +1 -2
- package/dist/config.cjs +1 -2
- package/dist/config.d.cts +2 -38
- package/dist/config.d.mts +2 -38
- package/dist/config.mjs +1 -2
- package/dist/delegation/manager.cjs +1 -6
- package/dist/delegation/manager.d.cts +2 -189
- package/dist/delegation/manager.d.mts +2 -189
- package/dist/delegation/manager.mjs +1 -6
- package/dist/extension.cjs +1 -3
- package/dist/extension.d.cts +2 -12
- package/dist/extension.d.mts +2 -12
- package/dist/extension.mjs +1 -3
- package/dist/extensions/doom.cjs +1 -1
- package/dist/extensions/doom.cjs.map +1 -1
- package/dist/extensions/doom.mjs +1 -1
- package/dist/extensions/doom.mjs.map +1 -1
- package/dist/extensions/pi.cjs +1 -1
- package/dist/extensions/pi.cjs.map +1 -1
- package/dist/extensions/pi.d.cts +1 -1
- package/dist/extensions/pi.d.mts +1 -1
- package/dist/extensions/pi.mjs +1 -1
- package/dist/extensions/pi.mjs.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +15 -14
- package/dist/index.d.mts +15 -14
- package/dist/index.mjs +1 -1
- package/dist/logSinkTelemetry.cjs +1 -2
- package/dist/logSinkTelemetry.d.cts +2 -51
- package/dist/logSinkTelemetry.d.mts +2 -51
- package/dist/logSinkTelemetry.mjs +1 -2
- package/dist/schemas/task.cjs +2 -0
- package/dist/schemas/task.cjs.map +1 -0
- package/dist/schemas/task.d.cts +103 -0
- package/dist/schemas/task.d.cts.map +1 -0
- package/dist/schemas/task.d.mts +103 -0
- package/dist/schemas/task.d.mts.map +1 -0
- package/dist/schemas/task.mjs +2 -0
- package/dist/schemas/task.mjs.map +1 -0
- package/dist/services/delegation/manager.cjs +6 -0
- package/dist/services/delegation/manager.cjs.map +1 -0
- package/dist/services/delegation/manager.d.cts +188 -0
- package/dist/services/delegation/manager.d.cts.map +1 -0
- package/dist/services/delegation/manager.d.mts +188 -0
- package/dist/services/delegation/manager.d.mts.map +1 -0
- package/dist/services/delegation/manager.mjs +6 -0
- package/dist/services/delegation/manager.mjs.map +1 -0
- package/dist/services/narration/taskNarration.cjs +2 -0
- package/dist/services/narration/taskNarration.cjs.map +1 -0
- package/dist/services/narration/taskNarration.mjs +2 -0
- package/dist/services/narration/taskNarration.mjs.map +1 -0
- package/dist/services/store/invariants.cjs +2 -0
- package/dist/services/store/invariants.cjs.map +1 -0
- package/dist/services/store/invariants.d.cts +14 -0
- package/dist/services/store/invariants.d.cts.map +1 -0
- package/dist/services/store/invariants.d.mts +14 -0
- package/dist/services/store/invariants.d.mts.map +1 -0
- package/dist/services/store/invariants.mjs +2 -0
- package/dist/services/store/invariants.mjs.map +1 -0
- package/dist/services/store/paths.cjs +1 -0
- package/dist/services/store/paths.mjs +1 -0
- package/dist/services/store/processLiveness.cjs +2 -0
- package/dist/services/store/processLiveness.cjs.map +1 -0
- package/dist/services/store/processLiveness.d.cts +12 -0
- package/dist/services/store/processLiveness.d.cts.map +1 -0
- package/dist/services/store/processLiveness.d.mts +12 -0
- package/dist/services/store/processLiveness.d.mts.map +1 -0
- package/dist/services/store/processLiveness.mjs +2 -0
- package/dist/services/store/processLiveness.mjs.map +1 -0
- package/dist/services/store/reconcile.cjs +2 -0
- package/dist/services/store/reconcile.cjs.map +1 -0
- package/dist/services/store/reconcile.d.cts +34 -0
- package/dist/services/store/reconcile.d.cts.map +1 -0
- package/dist/services/store/reconcile.d.mts +34 -0
- package/dist/services/store/reconcile.d.mts.map +1 -0
- package/dist/services/store/reconcile.mjs +2 -0
- package/dist/services/store/reconcile.mjs.map +1 -0
- package/dist/services/store/reducer.cjs +3 -0
- package/dist/services/store/reducer.cjs.map +1 -0
- package/dist/services/store/reducer.d.cts +72 -0
- package/dist/services/store/reducer.d.cts.map +1 -0
- package/dist/services/store/reducer.d.mts +72 -0
- package/dist/services/store/reducer.d.mts.map +1 -0
- package/dist/services/store/reducer.mjs +3 -0
- package/dist/services/store/reducer.mjs.map +1 -0
- package/dist/services/store/taskGraph.cjs +2 -0
- package/dist/services/store/taskGraph.cjs.map +1 -0
- package/dist/services/store/taskGraph.d.cts +25 -0
- package/dist/services/store/taskGraph.d.cts.map +1 -0
- package/dist/services/store/taskGraph.d.mts +25 -0
- package/dist/services/store/taskGraph.d.mts.map +1 -0
- package/dist/services/store/taskGraph.mjs +2 -0
- package/dist/services/store/taskGraph.mjs.map +1 -0
- package/dist/services/store/taskStore.cjs +1 -0
- package/dist/services/store/taskStore.d.cts +2 -0
- package/dist/services/store/taskStore.d.mts +2 -0
- package/dist/services/store/taskStore.mjs +1 -0
- package/dist/services/store/types.cjs +2 -0
- package/dist/services/store/types.cjs.map +1 -0
- package/dist/services/store/types.d.cts +177 -0
- package/dist/services/store/types.d.cts.map +1 -0
- package/dist/services/store/types.d.mts +177 -0
- package/dist/services/store/types.d.mts.map +1 -0
- package/dist/services/store/types.mjs +2 -0
- package/dist/services/store/types.mjs.map +1 -0
- package/dist/store/invariants.cjs +1 -2
- package/dist/store/invariants.d.cts +2 -14
- package/dist/store/invariants.d.mts +2 -14
- package/dist/store/invariants.mjs +1 -2
- package/dist/store/paths.cjs +1 -2
- package/dist/store/paths.d.cts +2 -23
- package/dist/store/paths.d.mts +2 -23
- package/dist/store/paths.mjs +1 -2
- package/dist/store/processLiveness.cjs +1 -2
- package/dist/store/processLiveness.d.cts +2 -12
- package/dist/store/processLiveness.d.mts +2 -12
- package/dist/store/processLiveness.mjs +1 -2
- package/dist/store/reconcile.cjs +1 -2
- package/dist/store/reconcile.d.cts +2 -34
- package/dist/store/reconcile.d.mts +2 -34
- package/dist/store/reconcile.mjs +1 -2
- package/dist/store/reducer.cjs +1 -3
- package/dist/store/reducer.d.cts +2 -72
- package/dist/store/reducer.d.mts +2 -72
- package/dist/store/reducer.mjs +1 -3
- package/dist/store/taskGraph.cjs +1 -2
- package/dist/store/taskGraph.d.cts +2 -25
- package/dist/store/taskGraph.d.mts +2 -25
- package/dist/store/taskGraph.mjs +1 -2
- package/dist/store/taskStore.cjs +1 -2
- package/dist/store/taskStore.d.cts +3 -77
- package/dist/store/taskStore.d.mts +3 -77
- package/dist/store/taskStore.mjs +1 -2
- package/dist/store/types.cjs +1 -2
- package/dist/store/types.d.cts +2 -165
- package/dist/store/types.d.mts +2 -165
- package/dist/store/types.mjs +1 -2
- package/dist/tool/promptGuidelines.cjs +1 -2
- package/dist/tool/promptGuidelines.d.cts +2 -5
- package/dist/tool/promptGuidelines.d.mts +2 -5
- package/dist/tool/promptGuidelines.mjs +1 -2
- package/dist/tool/responseEnvelope.cjs +1 -6
- package/dist/tool/responseEnvelope.d.cts +2 -39
- package/dist/tool/responseEnvelope.d.mts +2 -39
- package/dist/tool/responseEnvelope.mjs +1 -6
- package/dist/tool/schema.cjs +1 -2
- package/dist/tool/schema.d.cts +2 -86
- package/dist/tool/schema.d.mts +2 -86
- package/dist/tool/schema.mjs +1 -2
- package/dist/tool/taskTool.cjs +1 -3
- package/dist/tool/taskTool.d.cts +3 -17
- package/dist/tool/taskTool.d.mts +3 -17
- package/dist/tool/taskTool.mjs +1 -3
- package/dist/tui/format.cjs +3 -3
- package/dist/tui/format.cjs.map +1 -1
- package/dist/tui/format.d.cts +5 -5
- package/dist/tui/format.d.cts.map +1 -1
- package/dist/tui/format.d.mts +5 -5
- package/dist/tui/format.d.mts.map +1 -1
- package/dist/tui/format.mjs +3 -3
- package/dist/tui/format.mjs.map +1 -1
- package/dist/tui/selectors.cjs +1 -1
- package/dist/tui/selectors.cjs.map +1 -1
- package/dist/tui/selectors.d.cts +8 -1
- package/dist/tui/selectors.d.cts.map +1 -1
- package/dist/tui/selectors.d.mts +8 -1
- package/dist/tui/selectors.d.mts.map +1 -1
- package/dist/tui/selectors.mjs +1 -1
- package/dist/tui/selectors.mjs.map +1 -1
- package/dist/tui/taskOverlay.cjs +1 -1
- package/dist/tui/taskOverlay.cjs.map +1 -1
- package/dist/tui/taskOverlay.d.cts +2 -2
- package/dist/tui/taskOverlay.d.cts.map +1 -1
- package/dist/tui/taskOverlay.d.mts +2 -2
- package/dist/tui/taskOverlay.d.mts.map +1 -1
- package/dist/tui/taskOverlay.mjs +1 -1
- package/dist/tui/taskOverlay.mjs.map +1 -1
- package/dist/tui/taskSpace.cjs +3 -3
- package/dist/tui/taskSpace.cjs.map +1 -1
- package/dist/tui/taskSpace.d.cts +2 -1
- package/dist/tui/taskSpace.d.cts.map +1 -1
- package/dist/tui/taskSpace.d.mts +2 -1
- package/dist/tui/taskSpace.d.mts.map +1 -1
- package/dist/tui/taskSpace.mjs +3 -3
- package/dist/tui/taskSpace.mjs.map +1 -1
- package/dist/types/config.cjs +2 -0
- package/dist/types/config.cjs.map +1 -0
- package/dist/types/config.d.cts +43 -0
- package/dist/types/config.d.cts.map +1 -0
- package/dist/types/config.d.mts +43 -0
- package/dist/types/config.d.mts.map +1 -0
- package/dist/types/config.mjs +2 -0
- package/dist/types/config.mjs.map +1 -0
- package/package.json +16 -9
- package/dist/commands.cjs.map +0 -1
- package/dist/commands.d.cts.map +0 -1
- package/dist/commands.d.mts.map +0 -1
- package/dist/commands.mjs.map +0 -1
- package/dist/config.cjs.map +0 -1
- package/dist/config.d.cts.map +0 -1
- package/dist/config.d.mts.map +0 -1
- package/dist/config.mjs.map +0 -1
- package/dist/delegation/manager.cjs.map +0 -1
- package/dist/delegation/manager.d.cts.map +0 -1
- package/dist/delegation/manager.d.mts.map +0 -1
- package/dist/delegation/manager.mjs.map +0 -1
- package/dist/extension.cjs.map +0 -1
- package/dist/extension.d.cts.map +0 -1
- package/dist/extension.d.mts.map +0 -1
- package/dist/extension.mjs.map +0 -1
- package/dist/logSinkTelemetry.cjs.map +0 -1
- package/dist/logSinkTelemetry.d.cts.map +0 -1
- package/dist/logSinkTelemetry.d.mts.map +0 -1
- package/dist/logSinkTelemetry.mjs.map +0 -1
- package/dist/store/invariants.cjs.map +0 -1
- package/dist/store/invariants.d.cts.map +0 -1
- package/dist/store/invariants.d.mts.map +0 -1
- package/dist/store/invariants.mjs.map +0 -1
- package/dist/store/paths.cjs.map +0 -1
- package/dist/store/paths.d.cts.map +0 -1
- package/dist/store/paths.d.mts.map +0 -1
- package/dist/store/paths.mjs.map +0 -1
- package/dist/store/processLiveness.cjs.map +0 -1
- package/dist/store/processLiveness.d.cts.map +0 -1
- package/dist/store/processLiveness.d.mts.map +0 -1
- package/dist/store/processLiveness.mjs.map +0 -1
- package/dist/store/reconcile.cjs.map +0 -1
- package/dist/store/reconcile.d.cts.map +0 -1
- package/dist/store/reconcile.d.mts.map +0 -1
- package/dist/store/reconcile.mjs.map +0 -1
- package/dist/store/reducer.cjs.map +0 -1
- package/dist/store/reducer.d.cts.map +0 -1
- package/dist/store/reducer.d.mts.map +0 -1
- package/dist/store/reducer.mjs.map +0 -1
- package/dist/store/taskGraph.cjs.map +0 -1
- package/dist/store/taskGraph.d.cts.map +0 -1
- package/dist/store/taskGraph.d.mts.map +0 -1
- package/dist/store/taskGraph.mjs.map +0 -1
- package/dist/store/taskStore.cjs.map +0 -1
- package/dist/store/taskStore.d.cts.map +0 -1
- package/dist/store/taskStore.d.mts.map +0 -1
- package/dist/store/taskStore.mjs.map +0 -1
- package/dist/store/types.cjs.map +0 -1
- package/dist/store/types.d.cts.map +0 -1
- package/dist/store/types.d.mts.map +0 -1
- package/dist/store/types.mjs.map +0 -1
- package/dist/tool/promptGuidelines.cjs.map +0 -1
- package/dist/tool/promptGuidelines.d.cts.map +0 -1
- package/dist/tool/promptGuidelines.d.mts.map +0 -1
- package/dist/tool/promptGuidelines.mjs.map +0 -1
- package/dist/tool/responseEnvelope.cjs.map +0 -1
- package/dist/tool/responseEnvelope.d.cts.map +0 -1
- package/dist/tool/responseEnvelope.d.mts.map +0 -1
- package/dist/tool/responseEnvelope.mjs.map +0 -1
- package/dist/tool/schema.cjs.map +0 -1
- package/dist/tool/schema.d.cts.map +0 -1
- package/dist/tool/schema.d.mts.map +0 -1
- package/dist/tool/schema.mjs.map +0 -1
- package/dist/tool/taskTool.cjs.map +0 -1
- package/dist/tool/taskTool.d.cts.map +0 -1
- package/dist/tool/taskTool.d.mts.map +0 -1
- package/dist/tool/taskTool.mjs.map +0 -1
package/dist/store/types.d.cts
CHANGED
|
@@ -1,165 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
type TaskStatus = 'pending' | 'in_progress' | 'completed' | 'failed' | 'deleted';
|
|
4
|
-
declare const DELETED_STATUS: TaskStatus;
|
|
5
|
-
type TaskAction = 'upsert' | 'list' | 'get' | 'delete' | 'clear' | 'assign' | 'cancel';
|
|
6
|
-
type DelegationState = 'requested' | 'running' | 'completed' | 'failed' | 'cancelled';
|
|
7
|
-
/** Terminal result of a delegated subagent run, copied off the delegation response. */
|
|
8
|
-
interface DelegationResult {
|
|
9
|
-
status: string;
|
|
10
|
-
output?: string;
|
|
11
|
-
outputPath?: string;
|
|
12
|
-
sessionFile?: string;
|
|
13
|
-
error?: string;
|
|
14
|
-
durationMs?: number;
|
|
15
|
-
toolCount?: number;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Delegation bookkeeping attached to a task that was handed to a subagent.
|
|
19
|
-
*
|
|
20
|
-
* `pid` is the harness process that owns the run: it is the only way to tell an
|
|
21
|
-
* genuinely-running delegation from one orphaned by a harness crash, since the
|
|
22
|
-
* child dies with its parent but the file survives.
|
|
23
|
-
*/
|
|
24
|
-
interface TaskDelegation {
|
|
25
|
-
requestId: string;
|
|
26
|
-
agent: string;
|
|
27
|
-
state: DelegationState;
|
|
28
|
-
sessionId?: string;
|
|
29
|
-
pid?: number;
|
|
30
|
-
runId?: string;
|
|
31
|
-
model?: string;
|
|
32
|
-
startedAt?: string;
|
|
33
|
-
endedAt?: string;
|
|
34
|
-
result?: DelegationResult;
|
|
35
|
-
}
|
|
36
|
-
interface Task {
|
|
37
|
-
id: number;
|
|
38
|
-
subject: string;
|
|
39
|
-
description?: string;
|
|
40
|
-
activeForm?: string;
|
|
41
|
-
status: TaskStatus;
|
|
42
|
-
blockedBy?: number[];
|
|
43
|
-
owner?: string;
|
|
44
|
-
metadata?: Record<string, unknown>;
|
|
45
|
-
createdAt?: string;
|
|
46
|
-
updatedAt?: string;
|
|
47
|
-
delegation?: TaskDelegation;
|
|
48
|
-
}
|
|
49
|
-
declare const STORE_SCHEMA_VERSION = 1;
|
|
50
|
-
/** The complete on-disk document. `rev` increments on every committed write. */
|
|
51
|
-
interface TaskDocument {
|
|
52
|
-
version: number;
|
|
53
|
-
rev: number;
|
|
54
|
-
nextId: number;
|
|
55
|
-
tasks: Task[];
|
|
56
|
-
}
|
|
57
|
-
declare function emptyDocument(): TaskDocument;
|
|
58
|
-
/**
|
|
59
|
-
* A dependency target inside an upsert item: an existing task id, or the `ref`
|
|
60
|
-
* of a task created earlier in the same call.
|
|
61
|
-
*
|
|
62
|
-
* Refs must start with a letter (see `REF_PATTERN`), so a ref is structurally
|
|
63
|
-
* unconfusable with a stringified id and the discrimination is just `typeof`.
|
|
64
|
-
*/
|
|
65
|
-
type DepToken = number | string;
|
|
66
|
-
/**
|
|
67
|
-
* One entry of an `upsert` call. No `id` creates a task; an `id` updates one.
|
|
68
|
-
*
|
|
69
|
-
* `blockedBy` (absolute set) is create-only and `addBlockedBy`/`removeBlockedBy`
|
|
70
|
-
* (additive merge) are update-only, matching the split the two former actions
|
|
71
|
-
* had. A field used against the wrong kind fails that item rather than being
|
|
72
|
-
* silently ignored.
|
|
73
|
-
*/
|
|
74
|
-
interface TaskItemMutation {
|
|
75
|
-
id?: number;
|
|
76
|
-
ref?: string;
|
|
77
|
-
subject?: string;
|
|
78
|
-
description?: string;
|
|
79
|
-
activeForm?: string;
|
|
80
|
-
status?: TaskStatus;
|
|
81
|
-
blockedBy?: DepToken[];
|
|
82
|
-
addBlockedBy?: DepToken[];
|
|
83
|
-
removeBlockedBy?: DepToken[];
|
|
84
|
-
owner?: string;
|
|
85
|
-
metadata?: Record<string, unknown>;
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* What one upsert item did. `index` is its position in the request array, so a
|
|
89
|
-
* model reading a partial result can tell which entries still need resending.
|
|
90
|
-
*
|
|
91
|
-
* `message` is unprefixed: the `item[N] failed:` framing belongs to the
|
|
92
|
-
* formatter, because the Task Space overlay shows this text on its own.
|
|
93
|
-
*/
|
|
94
|
-
type UpsertItemOutcome = {
|
|
95
|
-
index: number;
|
|
96
|
-
kind: 'created';
|
|
97
|
-
id: number;
|
|
98
|
-
subject: string;
|
|
99
|
-
status: TaskStatus;
|
|
100
|
-
ref?: string;
|
|
101
|
-
blockedBy?: number[];
|
|
102
|
-
} | {
|
|
103
|
-
index: number;
|
|
104
|
-
kind: 'updated';
|
|
105
|
-
id: number;
|
|
106
|
-
fromStatus: TaskStatus;
|
|
107
|
-
toStatus: TaskStatus;
|
|
108
|
-
} | {
|
|
109
|
-
index: number;
|
|
110
|
-
kind: 'unchanged';
|
|
111
|
-
id: number;
|
|
112
|
-
status: TaskStatus;
|
|
113
|
-
} | {
|
|
114
|
-
index: number;
|
|
115
|
-
kind: 'failed';
|
|
116
|
-
message: string;
|
|
117
|
-
id?: number;
|
|
118
|
-
ref?: string;
|
|
119
|
-
};
|
|
120
|
-
/** Which tasks an upsert touched, so renderResult names them instead of guessing. */
|
|
121
|
-
interface UpsertSummary {
|
|
122
|
-
/** Ids of applied entries, in request order. A failed entry contributes nothing. */
|
|
123
|
-
applied: number[];
|
|
124
|
-
failed: number;
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
127
|
-
* Open-shape input bag the reducer accepts. The index signature lets the
|
|
128
|
-
* runtime pass a TypeBox `Static<typeof TaskParamsSchema>` through without
|
|
129
|
-
* casting each field.
|
|
130
|
-
*
|
|
131
|
-
* Per-task fields live on `tasks[]`, not here: a top-level `subject` or
|
|
132
|
-
* `status` would be ambiguous once one call can carry many tasks.
|
|
133
|
-
*/
|
|
134
|
-
interface TaskMutationParams {
|
|
135
|
-
[key: string]: unknown;
|
|
136
|
-
tasks?: TaskItemMutation[];
|
|
137
|
-
/** `list` filter only. To set a status, upsert the task by id. */
|
|
138
|
-
status?: TaskStatus;
|
|
139
|
-
/** `get`, `delete`, `assign` and `cancel` only. */
|
|
140
|
-
id?: number;
|
|
141
|
-
includeDeleted?: boolean;
|
|
142
|
-
agent?: string;
|
|
143
|
-
inlineAgent?: InlineAgent;
|
|
144
|
-
instructions?: string;
|
|
145
|
-
/** `assign` only: the context pack the parent hands to the child. */
|
|
146
|
-
relevantFiles?: string[];
|
|
147
|
-
priorFindings?: string;
|
|
148
|
-
model?: string;
|
|
149
|
-
context?: 'fresh' | 'fork';
|
|
150
|
-
}
|
|
151
|
-
/** Snapshot returned under a tool result's `details` for renderResult. */
|
|
152
|
-
interface TaskDetails {
|
|
153
|
-
action: TaskAction;
|
|
154
|
-
params: Record<string, unknown>;
|
|
155
|
-
tasks: Task[];
|
|
156
|
-
nextId: number;
|
|
157
|
-
rev: number;
|
|
158
|
-
error?: string;
|
|
159
|
-
upsert?: UpsertSummary;
|
|
160
|
-
}
|
|
161
|
-
/** A delegation is "live" while the owning run may still produce a response. */
|
|
162
|
-
declare function isDelegationActive(task: Task): boolean;
|
|
163
|
-
//#endregion
|
|
164
|
-
export { DELETED_STATUS, DelegationResult, DelegationState, DepToken, STORE_SCHEMA_VERSION, Task, TaskAction, TaskDelegation, TaskDetails, TaskDocument, TaskItemMutation, TaskMutationParams, TaskStatus, UpsertItemOutcome, UpsertSummary, emptyDocument, isDelegationActive };
|
|
165
|
-
//# sourceMappingURL=types.d.cts.map
|
|
1
|
+
import { AssignmentSummary, DELETED_STATUS, DelegationResult, DelegationState, DepToken, STORE_SCHEMA_VERSION, Task, TaskAction, TaskAssignment, TaskDelegation, TaskDetails, TaskDocument, TaskItemMutation, TaskMutationParams, TaskStatus, UpsertItemOutcome, UpsertSummary, emptyDocument, isDelegationActive } from "../services/store/types.cjs";
|
|
2
|
+
export { AssignmentSummary, DELETED_STATUS, DelegationResult, DelegationState, DepToken, STORE_SCHEMA_VERSION, Task, TaskAction, TaskAssignment, TaskDelegation, TaskDetails, TaskDocument, TaskItemMutation, TaskMutationParams, TaskStatus, UpsertItemOutcome, UpsertSummary, emptyDocument, isDelegationActive };
|
package/dist/store/types.d.mts
CHANGED
|
@@ -1,165 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
type TaskStatus = 'pending' | 'in_progress' | 'completed' | 'failed' | 'deleted';
|
|
4
|
-
declare const DELETED_STATUS: TaskStatus;
|
|
5
|
-
type TaskAction = 'upsert' | 'list' | 'get' | 'delete' | 'clear' | 'assign' | 'cancel';
|
|
6
|
-
type DelegationState = 'requested' | 'running' | 'completed' | 'failed' | 'cancelled';
|
|
7
|
-
/** Terminal result of a delegated subagent run, copied off the delegation response. */
|
|
8
|
-
interface DelegationResult {
|
|
9
|
-
status: string;
|
|
10
|
-
output?: string;
|
|
11
|
-
outputPath?: string;
|
|
12
|
-
sessionFile?: string;
|
|
13
|
-
error?: string;
|
|
14
|
-
durationMs?: number;
|
|
15
|
-
toolCount?: number;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Delegation bookkeeping attached to a task that was handed to a subagent.
|
|
19
|
-
*
|
|
20
|
-
* `pid` is the harness process that owns the run: it is the only way to tell an
|
|
21
|
-
* genuinely-running delegation from one orphaned by a harness crash, since the
|
|
22
|
-
* child dies with its parent but the file survives.
|
|
23
|
-
*/
|
|
24
|
-
interface TaskDelegation {
|
|
25
|
-
requestId: string;
|
|
26
|
-
agent: string;
|
|
27
|
-
state: DelegationState;
|
|
28
|
-
sessionId?: string;
|
|
29
|
-
pid?: number;
|
|
30
|
-
runId?: string;
|
|
31
|
-
model?: string;
|
|
32
|
-
startedAt?: string;
|
|
33
|
-
endedAt?: string;
|
|
34
|
-
result?: DelegationResult;
|
|
35
|
-
}
|
|
36
|
-
interface Task {
|
|
37
|
-
id: number;
|
|
38
|
-
subject: string;
|
|
39
|
-
description?: string;
|
|
40
|
-
activeForm?: string;
|
|
41
|
-
status: TaskStatus;
|
|
42
|
-
blockedBy?: number[];
|
|
43
|
-
owner?: string;
|
|
44
|
-
metadata?: Record<string, unknown>;
|
|
45
|
-
createdAt?: string;
|
|
46
|
-
updatedAt?: string;
|
|
47
|
-
delegation?: TaskDelegation;
|
|
48
|
-
}
|
|
49
|
-
declare const STORE_SCHEMA_VERSION = 1;
|
|
50
|
-
/** The complete on-disk document. `rev` increments on every committed write. */
|
|
51
|
-
interface TaskDocument {
|
|
52
|
-
version: number;
|
|
53
|
-
rev: number;
|
|
54
|
-
nextId: number;
|
|
55
|
-
tasks: Task[];
|
|
56
|
-
}
|
|
57
|
-
declare function emptyDocument(): TaskDocument;
|
|
58
|
-
/**
|
|
59
|
-
* A dependency target inside an upsert item: an existing task id, or the `ref`
|
|
60
|
-
* of a task created earlier in the same call.
|
|
61
|
-
*
|
|
62
|
-
* Refs must start with a letter (see `REF_PATTERN`), so a ref is structurally
|
|
63
|
-
* unconfusable with a stringified id and the discrimination is just `typeof`.
|
|
64
|
-
*/
|
|
65
|
-
type DepToken = number | string;
|
|
66
|
-
/**
|
|
67
|
-
* One entry of an `upsert` call. No `id` creates a task; an `id` updates one.
|
|
68
|
-
*
|
|
69
|
-
* `blockedBy` (absolute set) is create-only and `addBlockedBy`/`removeBlockedBy`
|
|
70
|
-
* (additive merge) are update-only, matching the split the two former actions
|
|
71
|
-
* had. A field used against the wrong kind fails that item rather than being
|
|
72
|
-
* silently ignored.
|
|
73
|
-
*/
|
|
74
|
-
interface TaskItemMutation {
|
|
75
|
-
id?: number;
|
|
76
|
-
ref?: string;
|
|
77
|
-
subject?: string;
|
|
78
|
-
description?: string;
|
|
79
|
-
activeForm?: string;
|
|
80
|
-
status?: TaskStatus;
|
|
81
|
-
blockedBy?: DepToken[];
|
|
82
|
-
addBlockedBy?: DepToken[];
|
|
83
|
-
removeBlockedBy?: DepToken[];
|
|
84
|
-
owner?: string;
|
|
85
|
-
metadata?: Record<string, unknown>;
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* What one upsert item did. `index` is its position in the request array, so a
|
|
89
|
-
* model reading a partial result can tell which entries still need resending.
|
|
90
|
-
*
|
|
91
|
-
* `message` is unprefixed: the `item[N] failed:` framing belongs to the
|
|
92
|
-
* formatter, because the Task Space overlay shows this text on its own.
|
|
93
|
-
*/
|
|
94
|
-
type UpsertItemOutcome = {
|
|
95
|
-
index: number;
|
|
96
|
-
kind: 'created';
|
|
97
|
-
id: number;
|
|
98
|
-
subject: string;
|
|
99
|
-
status: TaskStatus;
|
|
100
|
-
ref?: string;
|
|
101
|
-
blockedBy?: number[];
|
|
102
|
-
} | {
|
|
103
|
-
index: number;
|
|
104
|
-
kind: 'updated';
|
|
105
|
-
id: number;
|
|
106
|
-
fromStatus: TaskStatus;
|
|
107
|
-
toStatus: TaskStatus;
|
|
108
|
-
} | {
|
|
109
|
-
index: number;
|
|
110
|
-
kind: 'unchanged';
|
|
111
|
-
id: number;
|
|
112
|
-
status: TaskStatus;
|
|
113
|
-
} | {
|
|
114
|
-
index: number;
|
|
115
|
-
kind: 'failed';
|
|
116
|
-
message: string;
|
|
117
|
-
id?: number;
|
|
118
|
-
ref?: string;
|
|
119
|
-
};
|
|
120
|
-
/** Which tasks an upsert touched, so renderResult names them instead of guessing. */
|
|
121
|
-
interface UpsertSummary {
|
|
122
|
-
/** Ids of applied entries, in request order. A failed entry contributes nothing. */
|
|
123
|
-
applied: number[];
|
|
124
|
-
failed: number;
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
127
|
-
* Open-shape input bag the reducer accepts. The index signature lets the
|
|
128
|
-
* runtime pass a TypeBox `Static<typeof TaskParamsSchema>` through without
|
|
129
|
-
* casting each field.
|
|
130
|
-
*
|
|
131
|
-
* Per-task fields live on `tasks[]`, not here: a top-level `subject` or
|
|
132
|
-
* `status` would be ambiguous once one call can carry many tasks.
|
|
133
|
-
*/
|
|
134
|
-
interface TaskMutationParams {
|
|
135
|
-
[key: string]: unknown;
|
|
136
|
-
tasks?: TaskItemMutation[];
|
|
137
|
-
/** `list` filter only. To set a status, upsert the task by id. */
|
|
138
|
-
status?: TaskStatus;
|
|
139
|
-
/** `get`, `delete`, `assign` and `cancel` only. */
|
|
140
|
-
id?: number;
|
|
141
|
-
includeDeleted?: boolean;
|
|
142
|
-
agent?: string;
|
|
143
|
-
inlineAgent?: InlineAgent;
|
|
144
|
-
instructions?: string;
|
|
145
|
-
/** `assign` only: the context pack the parent hands to the child. */
|
|
146
|
-
relevantFiles?: string[];
|
|
147
|
-
priorFindings?: string;
|
|
148
|
-
model?: string;
|
|
149
|
-
context?: 'fresh' | 'fork';
|
|
150
|
-
}
|
|
151
|
-
/** Snapshot returned under a tool result's `details` for renderResult. */
|
|
152
|
-
interface TaskDetails {
|
|
153
|
-
action: TaskAction;
|
|
154
|
-
params: Record<string, unknown>;
|
|
155
|
-
tasks: Task[];
|
|
156
|
-
nextId: number;
|
|
157
|
-
rev: number;
|
|
158
|
-
error?: string;
|
|
159
|
-
upsert?: UpsertSummary;
|
|
160
|
-
}
|
|
161
|
-
/** A delegation is "live" while the owning run may still produce a response. */
|
|
162
|
-
declare function isDelegationActive(task: Task): boolean;
|
|
163
|
-
//#endregion
|
|
164
|
-
export { DELETED_STATUS, DelegationResult, DelegationState, DepToken, STORE_SCHEMA_VERSION, Task, TaskAction, TaskDelegation, TaskDetails, TaskDocument, TaskItemMutation, TaskMutationParams, TaskStatus, UpsertItemOutcome, UpsertSummary, emptyDocument, isDelegationActive };
|
|
165
|
-
//# sourceMappingURL=types.d.mts.map
|
|
1
|
+
import { AssignmentSummary, DELETED_STATUS, DelegationResult, DelegationState, DepToken, STORE_SCHEMA_VERSION, Task, TaskAction, TaskAssignment, TaskDelegation, TaskDetails, TaskDocument, TaskItemMutation, TaskMutationParams, TaskStatus, UpsertItemOutcome, UpsertSummary, emptyDocument, isDelegationActive } from "../services/store/types.mjs";
|
|
2
|
+
export { AssignmentSummary, DELETED_STATUS, DelegationResult, DelegationState, DepToken, STORE_SCHEMA_VERSION, Task, TaskAction, TaskAssignment, TaskDelegation, TaskDetails, TaskDocument, TaskItemMutation, TaskMutationParams, TaskStatus, UpsertItemOutcome, UpsertSummary, emptyDocument, isDelegationActive };
|
package/dist/store/types.mjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
//# sourceMappingURL=types.mjs.map
|
|
1
|
+
import{DELETED_STATUS as e,STORE_SCHEMA_VERSION as t,emptyDocument as n,isDelegationActive as r}from"../services/store/types.mjs";export{e as DELETED_STATUS,t as STORE_SCHEMA_VERSION,n as emptyDocument,r as isDelegationActive};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=
|
|
2
|
-
//# sourceMappingURL=promptGuidelines.cjs.map
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../commands/task/promptGuidelines.cjs");exports.DEFAULT_PROMPT_GUIDELINES=e.DEFAULT_PROMPT_GUIDELINES;
|
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
//#endregion
|
|
4
|
-
export { DEFAULT_PROMPT_GUIDELINES };
|
|
5
|
-
//# sourceMappingURL=promptGuidelines.d.cts.map
|
|
1
|
+
import { DEFAULT_PROMPT_GUIDELINES } from "../commands/task/promptGuidelines.cjs";
|
|
2
|
+
export { DEFAULT_PROMPT_GUIDELINES };
|
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
//#endregion
|
|
4
|
-
export { DEFAULT_PROMPT_GUIDELINES };
|
|
5
|
-
//# sourceMappingURL=promptGuidelines.d.mts.map
|
|
1
|
+
import { DEFAULT_PROMPT_GUIDELINES } from "../commands/task/promptGuidelines.mjs";
|
|
2
|
+
export { DEFAULT_PROMPT_GUIDELINES };
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
//# sourceMappingURL=promptGuidelines.mjs.map
|
|
1
|
+
import{DEFAULT_PROMPT_GUIDELINES as e}from"../commands/task/promptGuidelines.mjs";export{e as DEFAULT_PROMPT_GUIDELINES};
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../
|
|
2
|
-
`)}function s(e){switch(e.kind){case`created`:{let t=e.ref?` (ref "${e.ref}")`:``,n=e.blockedBy?.length?` — blocked by ${e.blockedBy.map(e=>`#${e}`).join(`, `)}`:``;return`Created #${e.id}${t}: ${e.subject} (${e.status})${n}`}case`updated`:{let t=e.fromStatus===e.toStatus?``:` (${e.fromStatus} -> ${e.toStatus})`;return`Updated #${e.id}${t}`}case`unchanged`:return`No change: #${e.id} already matches the requested values (status: ${e.status})`;case`failed`:return`Failed${e.id===void 0?``:` #${e.id}`}: ${e.message}`}}function c(e){return e.items.length===1?e.items[0].kind===`failed`?e.items[0].message:`no entry was applied`:[`no entry was applied.`,...e.items.map(e=>`- [${e.index}] ${s(e)}`),r].join(`
|
|
3
|
-
`)}function l(r,a){switch(r.kind){case`upsert`:{let i=r.items.length===1?[s(r.items[0])]:[`Upsert applied ${r.applied}/${r.items.length} entries${r.failed>0?`; ${r.failed} failed`:``}.`,...r.items.map(e=>`- [${e.index}] ${s(e)}`),...r.failed>0?[``,n]:[]];return r.applied>0&&e.isTaskListComplete(a.tasks)&&i.push(t),i.join(`
|
|
4
|
-
`)}case`delete`:return`Deleted #${r.id}: ${r.subject}`;case`clear`:return`Closed task list (cleared ${r.count} tasks)`;case`list`:{let e=a.tasks;return r.includeDeleted||(e=e.filter(e=>e.status!==`deleted`)),r.statusFilter&&(e=e.filter(e=>e.status===r.statusFilter)),e.length===0?`No tasks`:e.map(i).join(`
|
|
5
|
-
`)}case`get`:return o(r.task,a);case`error`:return`Error: ${r.message}`}}function u(e,t,n,r){return{content:[{type:`text`,text:l(r,n)}],details:{action:e,params:t,tasks:n.tasks,nextId:n.nextId,rev:n.rev,...r.kind===`error`?{error:r.message}:{},...r.kind===`upsert`?{upsert:{applied:r.items.flatMap(e=>e.kind===`failed`?[]:[e.id]),failed:r.failed}}:{}}}}function d(e,t,n,r,i){return{content:[{type:`text`,text:i?`Error: ${i}`:r}],details:{action:e,params:t,tasks:n.tasks,nextId:n.nextId,rev:n.rev,...i?{error:i}:{}}}}exports.MSG_ALL_COMPLETE_CLEAR=t,exports.MSG_UPSERT_NONE_APPLIED=r,exports.MSG_UPSERT_PARTIAL=n,exports.buildTextResult=d,exports.buildToolResult=u,exports.formatContent=l,exports.formatUpsertFailureText=c;
|
|
6
|
-
//# sourceMappingURL=responseEnvelope.cjs.map
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../commands/task/responseEnvelope.cjs");exports.MSG_ALL_COMPLETE_CLEAR=e.MSG_ALL_COMPLETE_CLEAR,exports.MSG_ASSIGN_PARTIAL=e.MSG_ASSIGN_PARTIAL,exports.MSG_UPSERT_NONE_APPLIED=e.MSG_UPSERT_NONE_APPLIED,exports.MSG_UPSERT_PARTIAL=e.MSG_UPSERT_PARTIAL,exports.buildAssignmentResult=e.buildAssignmentResult,exports.buildTextResult=e.buildTextResult,exports.buildToolResult=e.buildToolResult,exports.formatAssignmentResults=e.formatAssignmentResults,exports.formatContent=e.formatContent,exports.formatUpsertFailureText=e.formatUpsertFailureText;
|
|
@@ -1,39 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
//#region src/tool/responseEnvelope.d.ts
|
|
4
|
-
declare const MSG_ALL_COMPLETE_CLEAR = "All tasks are completed. Review the full task list once more, then close it with task {\"action\":\"clear\"}.";
|
|
5
|
-
/**
|
|
6
|
-
* Steering for a mixed batch. Unlike a batch of spawned subagents, a failed
|
|
7
|
-
* entry here had no side effect at all, so retrying the failures is the safe
|
|
8
|
-
* move and the model must be told so or it will do nothing. The hazard is the
|
|
9
|
-
* other half: resending an applied create would make a second task.
|
|
10
|
-
*/
|
|
11
|
-
declare const MSG_UPSERT_PARTIAL = "The applied entries are committed. Resend only the failed entries, corrected — a failed entry changed nothing, so a corrected retry is safe. Do not resend an entry that already applied: an entry without an id creates a second task.";
|
|
12
|
-
declare const MSG_UPSERT_NONE_APPLIED = "No task changed, so the whole call can be resent once corrected.";
|
|
13
|
-
/**
|
|
14
|
-
* The thrown message when an upsert applied nothing. Kept separate from
|
|
15
|
-
* `formatContent` because the caller wraps it in the actionable Options block
|
|
16
|
-
* rather than returning it as a successful result.
|
|
17
|
-
*/
|
|
18
|
-
declare function formatUpsertFailureText(op: Extract<Op, {
|
|
19
|
-
kind: 'upsert';
|
|
20
|
-
}>): string;
|
|
21
|
-
/**
|
|
22
|
-
* Pure formatter: `(op, document) -> string`. The switch is closed over `Op`,
|
|
23
|
-
* so a new reducer variant fails to compile until it is handled here.
|
|
24
|
-
*/
|
|
25
|
-
declare function formatContent(op: Op, document: TaskDocument): string;
|
|
26
|
-
interface ToolResult {
|
|
27
|
-
content: Array<{
|
|
28
|
-
type: 'text';
|
|
29
|
-
text: string;
|
|
30
|
-
}>;
|
|
31
|
-
details: TaskDetails;
|
|
32
|
-
}
|
|
33
|
-
/** Build the LLM-facing envelope. `details` carries the post-mutation snapshot. */
|
|
34
|
-
declare function buildToolResult(action: TaskAction, params: TaskMutationParams, document: TaskDocument, op: Op): ToolResult;
|
|
35
|
-
/** Envelope for delegation actions, which do not flow through the reducer. */
|
|
36
|
-
declare function buildTextResult(action: TaskAction, params: TaskMutationParams, document: TaskDocument, text: string, error?: string): ToolResult;
|
|
37
|
-
//#endregion
|
|
38
|
-
export { MSG_ALL_COMPLETE_CLEAR, MSG_UPSERT_NONE_APPLIED, MSG_UPSERT_PARTIAL, ToolResult, buildTextResult, buildToolResult, formatContent, formatUpsertFailureText };
|
|
39
|
-
//# sourceMappingURL=responseEnvelope.d.cts.map
|
|
1
|
+
import { AssignmentItemResult, MSG_ALL_COMPLETE_CLEAR, MSG_ASSIGN_PARTIAL, MSG_UPSERT_NONE_APPLIED, MSG_UPSERT_PARTIAL, ToolResult, buildAssignmentResult, buildTextResult, buildToolResult, formatAssignmentResults, formatContent, formatUpsertFailureText } from "../commands/task/responseEnvelope.cjs";
|
|
2
|
+
export { AssignmentItemResult, MSG_ALL_COMPLETE_CLEAR, MSG_ASSIGN_PARTIAL, MSG_UPSERT_NONE_APPLIED, MSG_UPSERT_PARTIAL, ToolResult, buildAssignmentResult, buildTextResult, buildToolResult, formatAssignmentResults, formatContent, formatUpsertFailureText };
|
|
@@ -1,39 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
//#region src/tool/responseEnvelope.d.ts
|
|
4
|
-
declare const MSG_ALL_COMPLETE_CLEAR = "All tasks are completed. Review the full task list once more, then close it with task {\"action\":\"clear\"}.";
|
|
5
|
-
/**
|
|
6
|
-
* Steering for a mixed batch. Unlike a batch of spawned subagents, a failed
|
|
7
|
-
* entry here had no side effect at all, so retrying the failures is the safe
|
|
8
|
-
* move and the model must be told so or it will do nothing. The hazard is the
|
|
9
|
-
* other half: resending an applied create would make a second task.
|
|
10
|
-
*/
|
|
11
|
-
declare const MSG_UPSERT_PARTIAL = "The applied entries are committed. Resend only the failed entries, corrected — a failed entry changed nothing, so a corrected retry is safe. Do not resend an entry that already applied: an entry without an id creates a second task.";
|
|
12
|
-
declare const MSG_UPSERT_NONE_APPLIED = "No task changed, so the whole call can be resent once corrected.";
|
|
13
|
-
/**
|
|
14
|
-
* The thrown message when an upsert applied nothing. Kept separate from
|
|
15
|
-
* `formatContent` because the caller wraps it in the actionable Options block
|
|
16
|
-
* rather than returning it as a successful result.
|
|
17
|
-
*/
|
|
18
|
-
declare function formatUpsertFailureText(op: Extract<Op, {
|
|
19
|
-
kind: 'upsert';
|
|
20
|
-
}>): string;
|
|
21
|
-
/**
|
|
22
|
-
* Pure formatter: `(op, document) -> string`. The switch is closed over `Op`,
|
|
23
|
-
* so a new reducer variant fails to compile until it is handled here.
|
|
24
|
-
*/
|
|
25
|
-
declare function formatContent(op: Op, document: TaskDocument): string;
|
|
26
|
-
interface ToolResult {
|
|
27
|
-
content: Array<{
|
|
28
|
-
type: 'text';
|
|
29
|
-
text: string;
|
|
30
|
-
}>;
|
|
31
|
-
details: TaskDetails;
|
|
32
|
-
}
|
|
33
|
-
/** Build the LLM-facing envelope. `details` carries the post-mutation snapshot. */
|
|
34
|
-
declare function buildToolResult(action: TaskAction, params: TaskMutationParams, document: TaskDocument, op: Op): ToolResult;
|
|
35
|
-
/** Envelope for delegation actions, which do not flow through the reducer. */
|
|
36
|
-
declare function buildTextResult(action: TaskAction, params: TaskMutationParams, document: TaskDocument, text: string, error?: string): ToolResult;
|
|
37
|
-
//#endregion
|
|
38
|
-
export { MSG_ALL_COMPLETE_CLEAR, MSG_UPSERT_NONE_APPLIED, MSG_UPSERT_PARTIAL, ToolResult, buildTextResult, buildToolResult, formatContent, formatUpsertFailureText };
|
|
39
|
-
//# sourceMappingURL=responseEnvelope.d.mts.map
|
|
1
|
+
import { AssignmentItemResult, MSG_ALL_COMPLETE_CLEAR, MSG_ASSIGN_PARTIAL, MSG_UPSERT_NONE_APPLIED, MSG_UPSERT_PARTIAL, ToolResult, buildAssignmentResult, buildTextResult, buildToolResult, formatAssignmentResults, formatContent, formatUpsertFailureText } from "../commands/task/responseEnvelope.mjs";
|
|
2
|
+
export { AssignmentItemResult, MSG_ALL_COMPLETE_CLEAR, MSG_ASSIGN_PARTIAL, MSG_UPSERT_NONE_APPLIED, MSG_UPSERT_PARTIAL, ToolResult, buildAssignmentResult, buildTextResult, buildToolResult, formatAssignmentResults, formatContent, formatUpsertFailureText };
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
import{
|
|
2
|
-
`)}function c(e){switch(e.kind){case`created`:{let t=e.ref?` (ref "${e.ref}")`:``,n=e.blockedBy?.length?` — blocked by ${e.blockedBy.map(e=>`#${e}`).join(`, `)}`:``;return`Created #${e.id}${t}: ${e.subject} (${e.status})${n}`}case`updated`:{let t=e.fromStatus===e.toStatus?``:` (${e.fromStatus} -> ${e.toStatus})`;return`Updated #${e.id}${t}`}case`unchanged`:return`No change: #${e.id} already matches the requested values (status: ${e.status})`;case`failed`:return`Failed${e.id===void 0?``:` #${e.id}`}: ${e.message}`}}function l(e){return e.items.length===1?e.items[0].kind===`failed`?e.items[0].message:`no entry was applied`:[`no entry was applied.`,...e.items.map(e=>`- [${e.index}] ${c(e)}`),i].join(`
|
|
3
|
-
`)}function u(e,i){switch(e.kind){case`upsert`:{let a=e.items.length===1?[c(e.items[0])]:[`Upsert applied ${e.applied}/${e.items.length} entries${e.failed>0?`; ${e.failed} failed`:``}.`,...e.items.map(e=>`- [${e.index}] ${c(e)}`),...e.failed>0?[``,r]:[]];return e.applied>0&&t(i.tasks)&&a.push(n),a.join(`
|
|
4
|
-
`)}case`delete`:return`Deleted #${e.id}: ${e.subject}`;case`clear`:return`Closed task list (cleared ${e.count} tasks)`;case`list`:{let t=i.tasks;return e.includeDeleted||(t=t.filter(e=>e.status!==`deleted`)),e.statusFilter&&(t=t.filter(t=>t.status===e.statusFilter)),t.length===0?`No tasks`:t.map(a).join(`
|
|
5
|
-
`)}case`get`:return s(e.task,i);case`error`:return`Error: ${e.message}`}}function d(e,t,n,r){return{content:[{type:`text`,text:u(r,n)}],details:{action:e,params:t,tasks:n.tasks,nextId:n.nextId,rev:n.rev,...r.kind===`error`?{error:r.message}:{},...r.kind===`upsert`?{upsert:{applied:r.items.flatMap(e=>e.kind===`failed`?[]:[e.id]),failed:r.failed}}:{}}}}function f(e,t,n,r,i){return{content:[{type:`text`,text:i?`Error: ${i}`:r}],details:{action:e,params:t,tasks:n.tasks,nextId:n.nextId,rev:n.rev,...i?{error:i}:{}}}}export{n as MSG_ALL_COMPLETE_CLEAR,i as MSG_UPSERT_NONE_APPLIED,r as MSG_UPSERT_PARTIAL,f as buildTextResult,d as buildToolResult,u as formatContent,l as formatUpsertFailureText};
|
|
6
|
-
//# sourceMappingURL=responseEnvelope.mjs.map
|
|
1
|
+
import{MSG_ALL_COMPLETE_CLEAR as e,MSG_ASSIGN_PARTIAL as t,MSG_UPSERT_NONE_APPLIED as n,MSG_UPSERT_PARTIAL as r,buildAssignmentResult as i,buildTextResult as a,buildToolResult as o,formatAssignmentResults as s,formatContent as c,formatUpsertFailureText as l}from"../commands/task/responseEnvelope.mjs";export{e as MSG_ALL_COMPLETE_CLEAR,t as MSG_ASSIGN_PARTIAL,n as MSG_UPSERT_NONE_APPLIED,r as MSG_UPSERT_PARTIAL,i as buildAssignmentResult,a as buildTextResult,o as buildToolResult,s as formatAssignmentResults,c as formatContent,l as formatUpsertFailureText};
|
package/dist/tool/schema.cjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`})
|
|
2
|
-
//# sourceMappingURL=schema.cjs.map
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../schemas/task.cjs");exports.COMMAND_NAME=e.COMMAND_NAME,exports.ERR_REQUIRES_INTERACTIVE=e.ERR_REQUIRES_INTERACTIVE,exports.MSG_NO_TASKS=e.MSG_NO_TASKS,exports.MSG_UPSERT_FIELD_MISPLACED=e.MSG_UPSERT_FIELD_MISPLACED,exports.TASK_ACTIONS=e.TASK_ACTIONS,exports.TASK_ACTION_FIELDS=e.TASK_ACTION_FIELDS,exports.TASK_CONTEXTS=e.TASK_CONTEXTS,exports.TASK_STATUSES=e.TASK_STATUSES,exports.TOOL_LABEL=e.TOOL_LABEL,exports.TOOL_NAME=e.TOOL_NAME,exports.TaskAssignmentSchema=e.TaskAssignmentSchema,exports.TaskItemSchema=e.TaskItemSchema,exports.TaskParamsSchema=e.TaskParamsSchema,exports.taskActionAcceptsField=e.taskActionAcceptsField;
|
package/dist/tool/schema.d.cts
CHANGED
|
@@ -1,86 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
//#region src/tool/schema.d.ts
|
|
4
|
-
declare const TASK_ACTIONS: readonly ["upsert", "list", "get", "delete", "clear", "assign", "cancel"];
|
|
5
|
-
declare const TASK_STATUSES: readonly ["pending", "in_progress", "completed", "failed", "deleted"];
|
|
6
|
-
declare const TASK_CONTEXTS: readonly ["fresh", "fork"];
|
|
7
|
-
declare const TOOL_NAME = "task";
|
|
8
|
-
declare const TOOL_LABEL = "Task";
|
|
9
|
-
declare const COMMAND_NAME = "tasks";
|
|
10
|
-
declare const ERR_REQUIRES_INTERACTIVE = "/tasks requires interactive mode";
|
|
11
|
-
declare const MSG_NO_TASKS = "No tasks yet. Ask the agent to add some!";
|
|
12
|
-
/**
|
|
13
|
-
* Which top-level fields each action accepts.
|
|
14
|
-
*
|
|
15
|
-
* The params object is flat and shared across every action, so the schema alone
|
|
16
|
-
* cannot express "upsert has no top-level id". That gap matters: a call like
|
|
17
|
-
* `{"action":"upsert","id":3,"tasks":[{"status":"completed"}]}` would otherwise
|
|
18
|
-
* silently create a duplicate task, because the entry itself carries no id.
|
|
19
|
-
*/
|
|
20
|
-
declare const TASK_ACTION_FIELDS: {
|
|
21
|
-
readonly upsert: readonly ["action", "tasks"];
|
|
22
|
-
readonly list: readonly ["action", "status", "includeDeleted"];
|
|
23
|
-
readonly get: readonly ["action", "id"];
|
|
24
|
-
readonly delete: readonly ["action", "id"];
|
|
25
|
-
readonly clear: readonly ["action"];
|
|
26
|
-
readonly assign: readonly ["action", "id", "agent", "inlineAgent", "instructions", "relevantFiles", "priorFindings", "model", "context"];
|
|
27
|
-
readonly cancel: readonly ["action", "id"];
|
|
28
|
-
};
|
|
29
|
-
declare function taskActionAcceptsField(action: TaskAction, field: string): boolean;
|
|
30
|
-
/** Correction hint appended when a per-task field lands at the top level. */
|
|
31
|
-
declare const MSG_UPSERT_FIELD_MISPLACED = "Per-task fields belong inside each tasks[] entry, not at the top level: {\"action\":\"upsert\",\"tasks\":[{\"id\":3,\"status\":\"completed\"}]}.";
|
|
32
|
-
/**
|
|
33
|
-
* One entry of an upsert. `additionalProperties: false` is load-bearing: pi
|
|
34
|
-
* validates tool arguments against this schema before `execute` runs, so a
|
|
35
|
-
* stray `{"action":"update"}` inside an entry is rejected at the boundary.
|
|
36
|
-
*/
|
|
37
|
-
declare const TaskItemSchema: Type.TObject<{
|
|
38
|
-
id: Type.TOptional<Type.TInteger>;
|
|
39
|
-
ref: Type.TOptional<Type.TString>;
|
|
40
|
-
subject: Type.TOptional<Type.TString>;
|
|
41
|
-
description: Type.TOptional<Type.TString>;
|
|
42
|
-
activeForm: Type.TOptional<Type.TString>;
|
|
43
|
-
status: Type.TOptional<Type.TString>;
|
|
44
|
-
blockedBy: Type.TOptional<Type.TArray<Type.TUnion<[Type.TInteger, Type.TString]>>>;
|
|
45
|
-
addBlockedBy: Type.TOptional<Type.TArray<Type.TUnion<[Type.TInteger, Type.TString]>>>;
|
|
46
|
-
removeBlockedBy: Type.TOptional<Type.TArray<Type.TUnion<[Type.TInteger, Type.TString]>>>;
|
|
47
|
-
owner: Type.TOptional<Type.TString>;
|
|
48
|
-
metadata: Type.TOptional<Type.TRecord<"^.*$", Type.TUnknown>>;
|
|
49
|
-
}>;
|
|
50
|
-
/**
|
|
51
|
-
* Tool parameters. Every `description` doubles as LLM-facing prompt copy, so
|
|
52
|
-
* wording changes here change model behaviour.
|
|
53
|
-
*/
|
|
54
|
-
declare const TaskParamsSchema: Type.TObject<{
|
|
55
|
-
action: Type.TString;
|
|
56
|
-
tasks: Type.TOptional<Type.TArray<Type.TObject<{
|
|
57
|
-
id: Type.TOptional<Type.TInteger>;
|
|
58
|
-
ref: Type.TOptional<Type.TString>;
|
|
59
|
-
subject: Type.TOptional<Type.TString>;
|
|
60
|
-
description: Type.TOptional<Type.TString>;
|
|
61
|
-
activeForm: Type.TOptional<Type.TString>;
|
|
62
|
-
status: Type.TOptional<Type.TString>;
|
|
63
|
-
blockedBy: Type.TOptional<Type.TArray<Type.TUnion<[Type.TInteger, Type.TString]>>>;
|
|
64
|
-
addBlockedBy: Type.TOptional<Type.TArray<Type.TUnion<[Type.TInteger, Type.TString]>>>;
|
|
65
|
-
removeBlockedBy: Type.TOptional<Type.TArray<Type.TUnion<[Type.TInteger, Type.TString]>>>;
|
|
66
|
-
owner: Type.TOptional<Type.TString>;
|
|
67
|
-
metadata: Type.TOptional<Type.TRecord<"^.*$", Type.TUnknown>>;
|
|
68
|
-
}>>>;
|
|
69
|
-
id: Type.TOptional<Type.TInteger>;
|
|
70
|
-
status: Type.TOptional<Type.TString>;
|
|
71
|
-
includeDeleted: Type.TOptional<Type.TBoolean>;
|
|
72
|
-
agent: Type.TOptional<Type.TString>;
|
|
73
|
-
inlineAgent: Type.TOptional<Type.TObject<{
|
|
74
|
-
systemPrompt: Type.TString;
|
|
75
|
-
}>>;
|
|
76
|
-
instructions: Type.TOptional<Type.TString>;
|
|
77
|
-
relevantFiles: Type.TOptional<Type.TArray<Type.TString>>;
|
|
78
|
-
priorFindings: Type.TOptional<Type.TString>;
|
|
79
|
-
model: Type.TOptional<Type.TString>;
|
|
80
|
-
context: Type.TOptional<Type.TString>;
|
|
81
|
-
}>;
|
|
82
|
-
type TaskItemParams = Static<typeof TaskItemSchema>;
|
|
83
|
-
type TaskParams = Static<typeof TaskParamsSchema>;
|
|
84
|
-
//#endregion
|
|
85
|
-
export { COMMAND_NAME, ERR_REQUIRES_INTERACTIVE, MSG_NO_TASKS, MSG_UPSERT_FIELD_MISPLACED, TASK_ACTIONS, TASK_ACTION_FIELDS, TASK_CONTEXTS, TASK_STATUSES, TOOL_LABEL, TOOL_NAME, TaskItemParams, TaskItemSchema, TaskParams, TaskParamsSchema, taskActionAcceptsField };
|
|
86
|
-
//# sourceMappingURL=schema.d.cts.map
|
|
1
|
+
import { COMMAND_NAME, ERR_REQUIRES_INTERACTIVE, MSG_NO_TASKS, MSG_UPSERT_FIELD_MISPLACED, TASK_ACTIONS, TASK_ACTION_FIELDS, TASK_CONTEXTS, TASK_STATUSES, TOOL_LABEL, TOOL_NAME, TaskAssignmentParams, TaskAssignmentSchema, TaskItemParams, TaskItemSchema, TaskParams, TaskParamsSchema, taskActionAcceptsField } from "../schemas/task.cjs";
|
|
2
|
+
export { COMMAND_NAME, ERR_REQUIRES_INTERACTIVE, MSG_NO_TASKS, MSG_UPSERT_FIELD_MISPLACED, TASK_ACTIONS, TASK_ACTION_FIELDS, TASK_CONTEXTS, TASK_STATUSES, TOOL_LABEL, TOOL_NAME, TaskAssignmentParams, TaskAssignmentSchema, TaskItemParams, TaskItemSchema, TaskParams, TaskParamsSchema, taskActionAcceptsField };
|