@ordewell/core 0.4.9 → 0.4.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ITerminalRunner-CbE6gKLI.d.ts → ITerminalRunner-BTaKZ659.d.mts} +2 -2
- package/dist/{ITerminalRunner-1NAv8wCC.d.mts → ITerminalRunner-DVwORcV9.d.ts} +2 -2
- package/dist/ModeResolver-CCKYqdZC.d.mts +44 -0
- package/dist/ModeResolver-CzZd-i6T.d.ts +44 -0
- package/dist/{Task-1NwmUImI.d.mts → Task-cGrfYRXK.d.mts} +8 -1
- package/dist/{Task-1NwmUImI.d.ts → Task-cGrfYRXK.d.ts} +8 -1
- package/dist/chunk-DNNZGH3I.mjs +862 -0
- package/dist/chunk-DNNZGH3I.mjs.map +1 -0
- package/dist/chunk-HPNUFBIT.mjs +19 -0
- package/dist/chunk-HPNUFBIT.mjs.map +1 -0
- package/dist/{chunk-SRGQBGI5.mjs → chunk-N6HTBUKG.mjs} +13 -1
- package/dist/{chunk-SRGQBGI5.mjs.map → chunk-N6HTBUKG.mjs.map} +1 -1
- package/dist/{chunk-YXAIQKVE.mjs → chunk-UEJ3SZQ7.mjs} +2 -2
- package/dist/index.d.mts +284 -80
- package/dist/index.d.ts +284 -80
- package/dist/index.js +1670 -820
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1067 -597
- package/dist/index.mjs.map +1 -1
- package/dist/order-labels.d.mts +17 -0
- package/dist/order-labels.d.ts +17 -0
- package/dist/order-labels.js +44 -0
- package/dist/order-labels.js.map +1 -0
- package/dist/order-labels.mjs +9 -0
- package/dist/order-labels.mjs.map +1 -0
- package/dist/{parsing-RjN9JbyG.d.ts → parsing-BT-dvFcu.d.mts} +5 -43
- package/dist/{parsing-xpozY5ac.d.mts → parsing-D87zKtTe.d.ts} +5 -43
- package/dist/parsing.d.mts +3 -2
- package/dist/parsing.d.ts +3 -2
- package/dist/parsing.js.map +1 -1
- package/dist/parsing.mjs +3 -2
- package/dist/{plan-utils-nfHKSbd3.d.mts → plan-utils-BHLbBym3.d.mts} +27 -5
- package/dist/{plan-utils-Cgc0cCH1.d.ts → plan-utils-akoB6YCL.d.ts} +27 -5
- package/dist/plan-utils.d.mts +3 -2
- package/dist/plan-utils.d.ts +3 -2
- package/dist/plan-utils.js +1 -9
- package/dist/plan-utils.js.map +1 -1
- package/dist/plan-utils.mjs +3 -2
- package/dist/testing.d.mts +2 -2
- package/dist/testing.d.ts +2 -2
- package/package.json +12 -2
- package/skills/grilling/SKILL.md +31 -0
- package/skills/to-spec/SKILL.md +64 -0
- package/dist/chunk-4KIWPW4K.mjs +0 -510
- package/dist/chunk-4KIWPW4K.mjs.map +0 -1
- /package/dist/{chunk-YXAIQKVE.mjs.map → chunk-UEJ3SZQ7.mjs.map} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import { h as RunnerId, c as PlanStatus, L as LegacyPlanState,
|
|
2
|
-
export { D as DiscoveredMode, M as Message, P as PlanModificationWarnings, f as ResearchStepOutcome, S as StreamEvent, i as StreamStepEvent, j as StreamThinkingEvent, k as TaskMode, l as TaskModelAssignment, m as TaskOutputSummary, o as TaskStatus, p as TaskType, q as ThinkingBlock, U as UserPromptEntry,
|
|
3
|
-
import { n as IFileSystem, I as IApproval, R as ReadFileOpts, T as ToolOutcome, k as GrepOptions, j as GlobOptions, i as FindSymbolOptions, f as ApprovalRequest, m as IConfig, A as AiProvider, z as ProviderModelLists, c as ApprovalMode, q as ITerminalSession, p as ITerminalRunner, K as RunnerRegistry, s as OrchestratorOption, b as ApprovalKind, g as ApprovalSource, H as RunnerInvocation, o as IPluginStore, J as RunnerPluginManifest, E as ResolveContext } from './ITerminalRunner-
|
|
4
|
-
export { a as AllProviderModels, d as ApprovalPolicy, e as ApprovalPolicyOptions, C as CatalogModel, D as DENY_ALL, h as DiscoveryCommand, F as FetchAllProviderModelsOptions, G as GREP_DEFAULT_HEAD_LIMIT, l as GrepOutputMode, M as ModelCatalog, r as ModelShortcut, O as ORCHESTRATOR_SHORTCUTS, P as PluginCloneFn, t as PluginEntry, u as PluginFeatures, v as PluginMode, w as PluginModelDiscovery, x as PluginRunnerDef, y as ProviderCredentialSource, B as ProviderModelsResult, S as SEARCH_EXCLUSIONS, L as collectProviderCredentials, N as enabledRunners, Q as fetchAllProviderModels, U as isReservedRunnerName, V as knownModelId, W as resolveModelShortcut, X as resolveProvider, Y as toOrchestratorOptions } from './ITerminalRunner-
|
|
5
|
-
import { R as RunnerModeInfo
|
|
6
|
-
export { M as ManifestLookup,
|
|
7
|
-
import { T as TaskOp } from './plan-utils-
|
|
8
|
-
export { A as ApplyTaskOpsResult, a as TaskRef, b as applyTaskOps, c as canMergeTasks, d as canSetDependencies, e as canSplitTask, f as classifyOutcome, g as dependencyCandidates, h as dependentsOf, p as parseTaskOpsJson, s as summarizeToolCall, t as textHasTaskOps } from './plan-utils-
|
|
1
|
+
import { h as RunnerId, c as PlanStatus, L as LegacyPlanState, a as DiscoveredModel, T as Task, d as ResearchProgress, R as ResearchLogEntry, C as ConversationMessage, n as TaskSnapshot, Q as QueuedMessage, A as ActiveTaskSession, g as ResearchToolType, v as Verdict, e as ResearchStep, b as PlanState } from './Task-cGrfYRXK.js';
|
|
2
|
+
export { D as DiscoveredMode, M as Message, P as PlanModificationWarnings, f as ResearchStepOutcome, S as StreamEvent, i as StreamStepEvent, j as StreamThinkingEvent, k as TaskMode, l as TaskModelAssignment, m as TaskOutputSummary, o as TaskStatus, p as TaskType, q as TaskWithParent, r as ThinkingBlock, U as UserPromptEntry, s as UserStep, V as ValidationCheck, t as ValidationContext, u as ValidationResult, w as VerificationCheck, x as addTaskToPlan, y as createEmptyPlan, z as createTask, B as emptyWarnings, E as flattenTasks, F as flattenTasksWithParents, G as migrateLegacyPlan, H as migratePlanState, I as migrateTask, J as removeTaskFromPlan, K as renumberTasks, N as updateTaskInPlan, O as validateModifiedPlan, W as warningsText } from './Task-cGrfYRXK.js';
|
|
3
|
+
import { n as IFileSystem, I as IApproval, R as ReadFileOpts, T as ToolOutcome, k as GrepOptions, j as GlobOptions, i as FindSymbolOptions, f as ApprovalRequest, m as IConfig, A as AiProvider, z as ProviderModelLists, c as ApprovalMode, q as ITerminalSession, p as ITerminalRunner, K as RunnerRegistry, s as OrchestratorOption, b as ApprovalKind, g as ApprovalSource, H as RunnerInvocation, o as IPluginStore, J as RunnerPluginManifest, E as ResolveContext } from './ITerminalRunner-DVwORcV9.js';
|
|
4
|
+
export { a as AllProviderModels, d as ApprovalPolicy, e as ApprovalPolicyOptions, C as CatalogModel, D as DENY_ALL, h as DiscoveryCommand, F as FetchAllProviderModelsOptions, G as GREP_DEFAULT_HEAD_LIMIT, l as GrepOutputMode, M as ModelCatalog, r as ModelShortcut, O as ORCHESTRATOR_SHORTCUTS, P as PluginCloneFn, t as PluginEntry, u as PluginFeatures, v as PluginMode, w as PluginModelDiscovery, x as PluginRunnerDef, y as ProviderCredentialSource, B as ProviderModelsResult, S as SEARCH_EXCLUSIONS, L as collectProviderCredentials, N as enabledRunners, Q as fetchAllProviderModels, U as isReservedRunnerName, V as knownModelId, W as resolveModelShortcut, X as resolveProvider, Y as toOrchestratorOptions } from './ITerminalRunner-DVwORcV9.js';
|
|
5
|
+
import { R as RunnerModeInfo } from './ModeResolver-CzZd-i6T.js';
|
|
6
|
+
export { M as ManifestLookup, b as buildModeGuide, f as filteredBuildModes, r as resolveDefaultMode, a as resolveTaskMode, c as runnerModesFrom } from './ModeResolver-CzZd-i6T.js';
|
|
7
|
+
import { T as TaskOp } from './plan-utils-akoB6YCL.js';
|
|
8
|
+
export { A as ApplyTaskOpsResult, a as TaskRef, b as applyTaskOps, c as canMergeTasks, d as canSetDependencies, e as canSplitTask, f as classifyOutcome, g as dependencyCandidates, h as dependentsOf, p as parseTaskOpsJson, s as summarizeToolCall, t as textHasTaskOps } from './plan-utils-akoB6YCL.js';
|
|
9
9
|
import { ChildProcess } from 'child_process';
|
|
10
10
|
import { EventEmitter } from 'events';
|
|
11
|
+
import { b as PlanParseError } from './parsing-D87zKtTe.js';
|
|
12
|
+
export { P as PLAN_ENVELOPE_KEY, a as PartialPlanTask, T as TASK_OPS_ENVELOPE_KEY, c as TASK_QUERY_ENVELOPE_KEY, d as checkDepsResolve, e as checkImmutableLog, f as checkInProgress, g as checkNoCycles, h as checkUniqueIds, i as escapeControlCharsInStrings, j as extractJsonObject, k as extractObjectWithBalance, l as extractObjectsWithKey, m as looksLikePlanAttempt, p as parsePartialPlan, n as parsePlanJson, s as stripModelNoise, o as stripTrailingCommas, v as validatePlanModification } from './parsing-D87zKtTe.js';
|
|
13
|
+
export { resolveOrderLabel, taskOrderLabel } from './order-labels.js';
|
|
11
14
|
|
|
12
15
|
interface SessionMeta {
|
|
13
16
|
id: string;
|
|
@@ -557,24 +560,12 @@ declare class ConsoleLogger implements ILogger {
|
|
|
557
560
|
declare const defaultLogger: ILogger;
|
|
558
561
|
|
|
559
562
|
interface UserSettings {
|
|
560
|
-
grillMe: {
|
|
561
|
-
enabled: boolean;
|
|
562
|
-
};
|
|
563
563
|
tdd: {
|
|
564
564
|
enabled: boolean;
|
|
565
565
|
};
|
|
566
|
-
prd: {
|
|
567
|
-
enabled: boolean;
|
|
568
|
-
};
|
|
569
|
-
review: {
|
|
570
|
-
enabled: boolean;
|
|
571
|
-
};
|
|
572
566
|
verification: {
|
|
573
567
|
enabled: boolean;
|
|
574
568
|
};
|
|
575
|
-
researchSubagents: {
|
|
576
|
-
enabled: boolean;
|
|
577
|
-
};
|
|
578
569
|
modelAllowlist?: Record<string, string[]>;
|
|
579
570
|
/** Last model (and its thinking effort) the user chose for each planner backend, keyed by AiProvider id. */
|
|
580
571
|
plannerModels?: Record<string, {
|
|
@@ -592,10 +583,10 @@ interface UserSettings {
|
|
|
592
583
|
* Ordewell processes on one machine can hold *different* settings at the same
|
|
593
584
|
* time. Without it the file is a single shared mutable global: the benchmark
|
|
594
585
|
* harness runs parallel lanes that each pin the mode toggles, and because
|
|
595
|
-
* `getAll()` re-reads whenever the mtime moves, a lane needing
|
|
596
|
-
* `
|
|
597
|
-
*
|
|
598
|
-
*
|
|
586
|
+
* `getAll()` re-reads whenever the mtime moves, a lane needing a toggle
|
|
587
|
+
* `true` would silently plan with `false` the moment another lane pinned its
|
|
588
|
+
* own — turning an A/B of that toggle into a comparison of one condition
|
|
589
|
+
* against itself.
|
|
599
590
|
*/
|
|
600
591
|
declare function getSettingsPath(): string;
|
|
601
592
|
declare class SettingsService {
|
|
@@ -605,18 +596,10 @@ declare class SettingsService {
|
|
|
605
596
|
constructor(filePath?: string);
|
|
606
597
|
getAll(): UserSettings;
|
|
607
598
|
private fileMtimeMs;
|
|
608
|
-
getGrillMe(): boolean;
|
|
609
599
|
getTdd(): boolean;
|
|
610
|
-
getPrd(): boolean;
|
|
611
|
-
setGrillMe(enabled: boolean): void;
|
|
612
600
|
setTdd(enabled: boolean): void;
|
|
613
|
-
setPrd(enabled: boolean): void;
|
|
614
|
-
getReview(): boolean;
|
|
615
|
-
setReview(enabled: boolean): void;
|
|
616
601
|
getVerification(): boolean;
|
|
617
602
|
setVerification(enabled: boolean): void;
|
|
618
|
-
getResearchSubagents(): boolean;
|
|
619
|
-
setResearchSubagents(enabled: boolean): void;
|
|
620
603
|
getModelAllowlist(runner: string): string[] | undefined;
|
|
621
604
|
setModelAllowlist(runner: string, ids: string[] | undefined): void;
|
|
622
605
|
getPlannerModel(provider: string): {
|
|
@@ -635,12 +618,8 @@ declare class SettingsService {
|
|
|
635
618
|
|
|
636
619
|
/** How the same toggle is named once a host has read it off disk. */
|
|
637
620
|
interface PlannerRuntimeToggles {
|
|
638
|
-
grillMeEnabled: boolean;
|
|
639
621
|
tddEnabled: boolean;
|
|
640
|
-
prdEnabled: boolean;
|
|
641
|
-
reviewEnabled: boolean;
|
|
642
622
|
verificationEnabled: boolean;
|
|
643
|
-
researchSubagentsEnabled: boolean;
|
|
644
623
|
}
|
|
645
624
|
/**
|
|
646
625
|
* The planner-facing mode set for one operation. Replaces the boolean tail that
|
|
@@ -649,13 +628,68 @@ interface PlannerRuntimeToggles {
|
|
|
649
628
|
*/
|
|
650
629
|
interface PlannerModes {
|
|
651
630
|
autonomousDefault: boolean;
|
|
652
|
-
grillMe: boolean;
|
|
653
|
-
prd: boolean;
|
|
654
|
-
review: boolean;
|
|
655
631
|
verification: boolean;
|
|
656
|
-
researchSubagents: boolean;
|
|
657
632
|
}
|
|
658
633
|
|
|
634
|
+
/**
|
|
635
|
+
* The planner's read channel: a `{"taskQuery":{...}}` reply asking Ordewell to
|
|
636
|
+
* show it what the per-turn plan block deliberately leaves out.
|
|
637
|
+
*
|
|
638
|
+
* The plan block carries only short fields, so a planner asked to "add a line
|
|
639
|
+
* to task 3's prompt" would be rewriting text it has never read. Inlining every
|
|
640
|
+
* body on every turn was rejected — a twenty-task plan re-sends thousands of
|
|
641
|
+
* tokens per message — so the planner asks instead, and pays for the detail
|
|
642
|
+
* only on the turns it uses it.
|
|
643
|
+
*
|
|
644
|
+
* This module owns the wire shape and the rendering of the answer; the loop,
|
|
645
|
+
* the budgets and the injection live in the Session, and the classification
|
|
646
|
+
* lives in PlanRepair alongside the plan and task-ops envelopes.
|
|
647
|
+
*/
|
|
648
|
+
/** The long fields a query may ask for. Everything else is already in the plan block. */
|
|
649
|
+
declare const TASK_QUERY_FIELDS: readonly ["description", "prompt", "userSteps", "verdict", "outputSummary", "userStoriesCovered"];
|
|
650
|
+
type TaskQueryField = typeof TASK_QUERY_FIELDS[number];
|
|
651
|
+
interface TaskQuery {
|
|
652
|
+
/** Task references to read in full — an id, "#order", a bare order, or a title. */
|
|
653
|
+
tasks: string[];
|
|
654
|
+
/** Narrows what comes back. Omitted means every field in {@link TASK_QUERY_FIELDS}. */
|
|
655
|
+
fields?: TaskQueryField[];
|
|
656
|
+
/** Also return the full runner/model catalog with labels, variants and mode descriptions. */
|
|
657
|
+
catalog: boolean;
|
|
658
|
+
}
|
|
659
|
+
declare function textHasTaskQuery(text: string): boolean;
|
|
660
|
+
/** Parse a `{"taskQuery":...}` reply. Throws PlanParseError when the JSON is unusable. */
|
|
661
|
+
declare function parseTaskQueryJson(text: string): TaskQuery;
|
|
662
|
+
/** Stable identity of a query, so a turn can recognise the planner asking the same thing twice. */
|
|
663
|
+
declare function taskQuerySignature(query: TaskQuery): string;
|
|
664
|
+
/** What a full-catalog read is answered from. Models arrive already allowlist-filtered. */
|
|
665
|
+
interface TaskQueryCatalog {
|
|
666
|
+
runners: RunnerId[];
|
|
667
|
+
models: Partial<Record<RunnerId, DiscoveredModel[]>>;
|
|
668
|
+
modes: Record<RunnerId, RunnerModeInfo[]>;
|
|
669
|
+
autonomousDefault: boolean;
|
|
670
|
+
}
|
|
671
|
+
/**
|
|
672
|
+
* Appended when the planner has spent its read budget, or asked the identical
|
|
673
|
+
* question twice. The detail still comes back — refusing it would leave the
|
|
674
|
+
* planner editing text it has not read, which is the whole failure this
|
|
675
|
+
* channel exists to prevent — but the turn is told to land.
|
|
676
|
+
*/
|
|
677
|
+
declare const TASK_QUERY_ANSWER_OR_OPS: string;
|
|
678
|
+
/**
|
|
679
|
+
* The protocol as the planner is taught it, owned here beside the parser so the
|
|
680
|
+
* two cannot drift. Both planner backends get these lines verbatim (ADR-0009):
|
|
681
|
+
* a harness planner has no tool loop to reach, so the envelope is the channel.
|
|
682
|
+
*/
|
|
683
|
+
declare const TASK_QUERY_PROTOCOL: string[];
|
|
684
|
+
/** The one-line reminder the per-turn plan block carries, so the protocol has a single owner. */
|
|
685
|
+
declare const TASK_QUERY_REMINDER = "- To READ a task in full (prompt, user steps, verdict, output, user stories) or the whole model/mode catalog before editing, reply with ONLY {\"taskQuery\":{\"tasks\":[\"<id or #order>\"],\"catalog\":true}} \u2014 it changes nothing, and you then reply again with your ops.";
|
|
686
|
+
/**
|
|
687
|
+
* Render the injected answer to one read. Never persisted — it is context for
|
|
688
|
+
* the planner's next reply and nothing else — so it is built fresh from live
|
|
689
|
+
* state on every query rather than cached.
|
|
690
|
+
*/
|
|
691
|
+
declare function renderTaskQueryAnswer(query: TaskQuery, tasks: Task[], catalog: TaskQueryCatalog): string;
|
|
692
|
+
|
|
659
693
|
declare abstract class AbstractTerminalSession implements ITerminalSession {
|
|
660
694
|
id: string;
|
|
661
695
|
taskId: string;
|
|
@@ -928,6 +962,17 @@ type AgentEvent =
|
|
|
928
962
|
name: string;
|
|
929
963
|
detail: string;
|
|
930
964
|
}
|
|
965
|
+
/**
|
|
966
|
+
* The agent delegated work to a subagent it left running in the background,
|
|
967
|
+
* and may end its turn before that work reports. Ordewell's conversation is
|
|
968
|
+
* request/response: a turn that ends hands control back to the user, and
|
|
969
|
+
* anything the agent says afterwards arrives with no turn open and is lost.
|
|
970
|
+
* Naming the launch is what lets the service ask for the results in time.
|
|
971
|
+
*/
|
|
972
|
+
| {
|
|
973
|
+
type: 'background_agent';
|
|
974
|
+
id: string;
|
|
975
|
+
}
|
|
931
976
|
/** The agent finished its turn and is waiting for the next user message. */
|
|
932
977
|
| {
|
|
933
978
|
type: 'turn_end';
|
|
@@ -1056,8 +1101,8 @@ declare class CliAgentAiService implements IAiService {
|
|
|
1056
1101
|
/**
|
|
1057
1102
|
* Drive one user message to a settled planner turn. Same shape as the API
|
|
1058
1103
|
* backend's conversation loop minus the tool rounds — those belong to the
|
|
1059
|
-
* agent now — and with the same
|
|
1060
|
-
*
|
|
1104
|
+
* agent now — and with the same two policies layered on top: the
|
|
1105
|
+
* empty-reply nudge, and a bounded corrective re-emit for botched JSON.
|
|
1061
1106
|
*/
|
|
1062
1107
|
private runConversation;
|
|
1063
1108
|
/**
|
|
@@ -1110,12 +1155,7 @@ interface ConversationRequest {
|
|
|
1110
1155
|
fetcher?: IWebFetcher;
|
|
1111
1156
|
runnerModes?: Record<RunnerId, RunnerModeInfo[]>;
|
|
1112
1157
|
autonomousDefault?: boolean;
|
|
1113
|
-
grillMeEnabled?: boolean;
|
|
1114
|
-
prdEnabled?: boolean;
|
|
1115
|
-
reviewEnabled?: boolean;
|
|
1116
1158
|
verificationEnabled?: boolean;
|
|
1117
|
-
/** Declare the spawn_research_agent tool to the planner (issue #34, default off). */
|
|
1118
|
-
researchSubagentsEnabled?: boolean;
|
|
1119
1159
|
signal?: AbortSignal;
|
|
1120
1160
|
/**
|
|
1121
1161
|
* Persisted dialogue to seed a resumed conversation (session reload). The
|
|
@@ -1132,9 +1172,11 @@ interface ConversationRequest {
|
|
|
1132
1172
|
}
|
|
1133
1173
|
/**
|
|
1134
1174
|
* One planner turn's outcome. The planner talks to the user (`message`),
|
|
1135
|
-
* commits a full plan (`plan`, a `{tasks:[...]}` JSON object),
|
|
1136
|
-
*
|
|
1137
|
-
*
|
|
1175
|
+
* commits a full plan (`plan`, a `{tasks:[...]}` JSON object), emits targeted
|
|
1176
|
+
* task edits (`task_ops`, a `{taskOps:[...]}` JSON object), or asks to read
|
|
1177
|
+
* task bodies and the full catalog before editing (`task_query`, a
|
|
1178
|
+
* `{taskQuery:{...}}` JSON object). The Session validates and applies task ops
|
|
1179
|
+
* atomically and answers queries out of its own state; the AI service only
|
|
1138
1180
|
* parses them.
|
|
1139
1181
|
*/
|
|
1140
1182
|
type ConversationTurn = {
|
|
@@ -1151,6 +1193,11 @@ type ConversationTurn = {
|
|
|
1151
1193
|
ops: TaskOp[];
|
|
1152
1194
|
text: string;
|
|
1153
1195
|
researchLog: ResearchLogEntry[];
|
|
1196
|
+
} | {
|
|
1197
|
+
kind: 'task_query';
|
|
1198
|
+
query: TaskQuery;
|
|
1199
|
+
text: string;
|
|
1200
|
+
researchLog: ResearchLogEntry[];
|
|
1154
1201
|
};
|
|
1155
1202
|
interface IAiService {
|
|
1156
1203
|
/**
|
|
@@ -1255,12 +1302,6 @@ interface ConversationTurnContext {
|
|
|
1255
1302
|
runnerModes?: Record<RunnerId, RunnerModeInfo[]>;
|
|
1256
1303
|
autonomousDefault?: boolean;
|
|
1257
1304
|
fetcher?: IWebFetcher;
|
|
1258
|
-
/** PRD toggle: a plan must not commit before a PRD block has appeared. */
|
|
1259
|
-
prdEnabled?: boolean;
|
|
1260
|
-
/** Set once any turn carries an ORDEWELL_PRD block; gates the missing-PRD nudge. */
|
|
1261
|
-
prdCaptured?: boolean;
|
|
1262
|
-
/** The missing-PRD corrective nudge is sent at most once per conversation. */
|
|
1263
|
-
prdNudgeSent?: boolean;
|
|
1264
1305
|
}
|
|
1265
1306
|
declare abstract class BaseAiService {
|
|
1266
1307
|
protected config: IConfig;
|
|
@@ -1269,8 +1310,6 @@ declare abstract class BaseAiService {
|
|
|
1269
1310
|
setProgress: (fn: (p: ResearchProgress) => void) => void;
|
|
1270
1311
|
} | null;
|
|
1271
1312
|
protected activeAbort: AbortController | null;
|
|
1272
|
-
/** researchSubagents toggle (issue #34): set per operation from the live settings snapshot; off means bit-for-bit sequential behavior. */
|
|
1273
|
-
protected researchSubagentsEnabled: boolean;
|
|
1274
1313
|
constructor(config: IConfig);
|
|
1275
1314
|
abstract reset(): void;
|
|
1276
1315
|
abstract ensureInit(): void;
|
|
@@ -1546,6 +1585,8 @@ declare class TaskOrchestrator {
|
|
|
1546
1585
|
private observers;
|
|
1547
1586
|
private tddEnabled;
|
|
1548
1587
|
constructor(config: IConfig, notifications: INotification, terminalRunner: ITerminalRunner, store?: PlanStore);
|
|
1588
|
+
/** Advisory silence timestamp for a task's live runner, or null if not idle. */
|
|
1589
|
+
getIdleSince(taskId: string): string | null;
|
|
1549
1590
|
get storeInstance(): PlanStore;
|
|
1550
1591
|
setWorkspaceRoot(fn: () => string): void;
|
|
1551
1592
|
setRegistry(registry: RunnerRegistry): void;
|
|
@@ -1993,12 +2034,19 @@ declare abstract class StdioAgentAdapter implements AgentAdapter {
|
|
|
1993
2034
|
/** Set for the duration of a turn. Outside one, events are buffered rather than dropped. */
|
|
1994
2035
|
private turnEmit;
|
|
1995
2036
|
/**
|
|
1996
|
-
* Events the agent produced
|
|
1997
|
-
* that arrive during the handshake. Dropping them hid the one
|
|
1998
|
-
* that explains a planner which cannot read the workspace, so they
|
|
1999
|
-
* until a turn exists to show them in.
|
|
2037
|
+
* Events the agent produced before its first turn — in practice the startup
|
|
2038
|
+
* warnings that arrive during the handshake. Dropping them hid the one
|
|
2039
|
+
* diagnostic that explains a planner which cannot read the workspace, so they
|
|
2040
|
+
* are held until a turn exists to show them in.
|
|
2041
|
+
*
|
|
2042
|
+
* Only before the *first* turn. Once one has run, anything arriving outside a
|
|
2043
|
+
* turn is that closed turn's straggling work — a backgrounded subagent
|
|
2044
|
+
* finishing, a late read — and replaying it into the next turn presents it as
|
|
2045
|
+
* research done for the user's new message.
|
|
2000
2046
|
*/
|
|
2001
2047
|
private betweenTurns;
|
|
2048
|
+
/** Set once a turn has ended: after that, out-of-turn events are stale, not startup. */
|
|
2049
|
+
private hadTurn;
|
|
2002
2050
|
private disposed;
|
|
2003
2051
|
/** Resolves when the process ends, so a handshake can lose the race instead of waiting out its timeout. */
|
|
2004
2052
|
protected processEnded: Promise<void>;
|
|
@@ -2041,6 +2089,8 @@ declare abstract class StdioAgentAdapter implements AgentAdapter {
|
|
|
2041
2089
|
*/
|
|
2042
2090
|
declare class ClaudeCodeAdapter extends StdioAgentAdapter {
|
|
2043
2091
|
readonly agentId = "claude-code";
|
|
2092
|
+
/** Whether this turn has already emitted reply text — see {@link handleLine}. */
|
|
2093
|
+
private turnHasText;
|
|
2044
2094
|
protected spawnSpec(opts: AgentStartOptions): SpawnSpec;
|
|
2045
2095
|
protected turnPayload(message: string): string;
|
|
2046
2096
|
protected handleLine(line: string, emit: (event: AgentEvent) => void): void;
|
|
@@ -2127,6 +2177,8 @@ declare class OpenCodeAdapter implements AgentAdapter {
|
|
|
2127
2177
|
private exited;
|
|
2128
2178
|
private disposed;
|
|
2129
2179
|
private opts;
|
|
2180
|
+
/** Whether this turn has already emitted reply text — see {@link emitPart}. */
|
|
2181
|
+
private turnHasText;
|
|
2130
2182
|
constructor(deps: AgentProcessDeps);
|
|
2131
2183
|
start(opts: AgentStartOptions): Promise<void>;
|
|
2132
2184
|
send(message: string, onEvent: (event: AgentEvent) => void, signal?: AbortSignal): Promise<void>;
|
|
@@ -2174,6 +2226,39 @@ declare function mapAgentTool(name: string): MappedTool;
|
|
|
2174
2226
|
*/
|
|
2175
2227
|
declare function normalizeAgentArgs(tool: ResearchToolType, args: Record<string, unknown>): Record<string, unknown>;
|
|
2176
2228
|
|
|
2229
|
+
declare const BUILTIN_SKILL_NAMES: readonly ["grilling", "to-spec"];
|
|
2230
|
+
interface SkillMetadata {
|
|
2231
|
+
name: string;
|
|
2232
|
+
description: string;
|
|
2233
|
+
disableModelInvocation?: boolean;
|
|
2234
|
+
}
|
|
2235
|
+
interface SkillInfo {
|
|
2236
|
+
name: string;
|
|
2237
|
+
description: string;
|
|
2238
|
+
metadata: SkillMetadata;
|
|
2239
|
+
/** Full content of SKILL.md with frontmatter stripped */
|
|
2240
|
+
content: string;
|
|
2241
|
+
/** Absolute path to the SKILL.md file */
|
|
2242
|
+
path: string;
|
|
2243
|
+
/** Whether this came from global (~/.ordewell/skills/) or local (.ordewell/skills/) */
|
|
2244
|
+
source: 'global' | 'local';
|
|
2245
|
+
}
|
|
2246
|
+
declare class SkillsService {
|
|
2247
|
+
private workspaceRoot?;
|
|
2248
|
+
constructor(workspaceRoot?: string | undefined);
|
|
2249
|
+
private localDir;
|
|
2250
|
+
private globalDir;
|
|
2251
|
+
private seed;
|
|
2252
|
+
seedBuiltinSkill(name: string): boolean;
|
|
2253
|
+
/** Removes a retired built-in's seed from the global dir, but only if it's untouched by the user. */
|
|
2254
|
+
private isUnmodifiedRetiredSeed;
|
|
2255
|
+
private pruneRetired;
|
|
2256
|
+
findSkill(name: string): SkillInfo | undefined;
|
|
2257
|
+
listSkills(): SkillInfo[];
|
|
2258
|
+
getSkillContent(name: string): string | undefined;
|
|
2259
|
+
}
|
|
2260
|
+
declare function createSkillsService(workspaceRoot?: string): SkillsService;
|
|
2261
|
+
|
|
2177
2262
|
type SerializedTaskStatus = {
|
|
2178
2263
|
id: string;
|
|
2179
2264
|
status: string;
|
|
@@ -2182,6 +2267,8 @@ type SerializedTaskStatus = {
|
|
|
2182
2267
|
reason: string;
|
|
2183
2268
|
checks: Verdict['checks'];
|
|
2184
2269
|
} | null;
|
|
2270
|
+
/** Advisory silence timestamp from VerdictEngine — not part of task status semantics. */
|
|
2271
|
+
idleSince?: string | null;
|
|
2185
2272
|
};
|
|
2186
2273
|
type SerializedTask = {
|
|
2187
2274
|
id: string;
|
|
@@ -2296,7 +2383,7 @@ type SessionMessage = {
|
|
|
2296
2383
|
};
|
|
2297
2384
|
type SessionBroadcaster = (msg: SessionMessage) => void;
|
|
2298
2385
|
declare function serializeTask(t: Task): SerializedTask;
|
|
2299
|
-
declare function serializeTaskStatus(t: Task): SerializedTaskStatus;
|
|
2386
|
+
declare function serializeTaskStatus(t: Task, idleSince?: string | null): SerializedTaskStatus;
|
|
2300
2387
|
declare function serializePlan(plan: LegacyPlanState): SerializedPlan;
|
|
2301
2388
|
declare function executionSummary(tasks: Task[]): {
|
|
2302
2389
|
total: number;
|
|
@@ -2327,11 +2414,7 @@ type SessionPlanner = Pick<Planner, 'generate' | 'modify' | 'modifyDuringExecuti
|
|
|
2327
2414
|
/** Runtime prefs read live — may toggle between operations. */
|
|
2328
2415
|
interface SessionRuntimeSettings {
|
|
2329
2416
|
tddEnabled: boolean;
|
|
2330
|
-
grillMeEnabled: boolean;
|
|
2331
|
-
prdEnabled?: boolean;
|
|
2332
|
-
reviewEnabled?: boolean;
|
|
2333
2417
|
verificationEnabled?: boolean;
|
|
2334
|
-
researchSubagentsEnabled?: boolean;
|
|
2335
2418
|
modelAllowlist?: Record<string, string[]>;
|
|
2336
2419
|
}
|
|
2337
2420
|
/**
|
|
@@ -2342,11 +2425,19 @@ interface SessionRuntimeSettings {
|
|
|
2342
2425
|
* is not a toggle.
|
|
2343
2426
|
*/
|
|
2344
2427
|
declare function sessionRuntimeSettings(settings: UserSettings): SessionRuntimeSettings;
|
|
2428
|
+
/**
|
|
2429
|
+
* Resolve a `/skill-name` invocation to the skill's markdown content. Pure and
|
|
2430
|
+
* exported so surfaces and verification can drive substitution without a full
|
|
2431
|
+
* Session. Plain text passes through unchanged; an unknown skill becomes a
|
|
2432
|
+
* notice naming what IS available instead of a bare slash token that a runner
|
|
2433
|
+
* would mis-resolve in its own skills directory.
|
|
2434
|
+
*/
|
|
2435
|
+
declare function resolveSkillInvocation(text: string, skillsService: Pick<SkillsService, 'findSkill' | 'listSkills'>): string;
|
|
2345
2436
|
/**
|
|
2346
2437
|
* Everything a delivery surface constructs to host a session. Structural config
|
|
2347
2438
|
* (enabledRunners, orchestratorModel, providerModelLists) is snapshotted inside
|
|
2348
2439
|
* `config` at construction and never re-read from the environment. Runtime
|
|
2349
|
-
* settings (tdd,
|
|
2440
|
+
* settings (tdd, verification) are read live via the `settings` callback so a toggle
|
|
2350
2441
|
* between generate and execute takes effect.
|
|
2351
2442
|
*/
|
|
2352
2443
|
interface SessionDeps {
|
|
@@ -2362,7 +2453,7 @@ interface SessionDeps {
|
|
|
2362
2453
|
broadcast: SessionBroadcaster;
|
|
2363
2454
|
/** Shared across sessions — sole producer of model catalogs and routing lists. */
|
|
2364
2455
|
modelResolver: ModelResolver;
|
|
2365
|
-
/** Live runtime settings (tdd,
|
|
2456
|
+
/** Live runtime settings (tdd, verification). Read at each operation that needs them. */
|
|
2366
2457
|
settings: () => SessionRuntimeSettings;
|
|
2367
2458
|
/**
|
|
2368
2459
|
* Host-assigned session id. When set, every persist writes under this id so
|
|
@@ -2378,6 +2469,11 @@ interface SessionDeps {
|
|
|
2378
2469
|
aiService?: IAiService;
|
|
2379
2470
|
/** Plan-generation seam. Defaults to a Planner over the session's aiService. */
|
|
2380
2471
|
planner?: SessionPlanner;
|
|
2472
|
+
/**
|
|
2473
|
+
* Skill lookup for /skill-name interception. Defaults to a SkillsService
|
|
2474
|
+
* over the session's workspace root.
|
|
2475
|
+
*/
|
|
2476
|
+
skillsService?: SkillsService;
|
|
2381
2477
|
}
|
|
2382
2478
|
/**
|
|
2383
2479
|
* The per-session execution stack — deepened from a wiring bag into the
|
|
@@ -2419,6 +2515,7 @@ declare class Session {
|
|
|
2419
2515
|
private unsubObserver;
|
|
2420
2516
|
private readonly hostSessionId?;
|
|
2421
2517
|
private currentSessionId;
|
|
2518
|
+
private readonly skillsService;
|
|
2422
2519
|
constructor(deps: SessionDeps);
|
|
2423
2520
|
/**
|
|
2424
2521
|
* The planner transport for the provider configured *right now* (ADR-0009).
|
|
@@ -2475,6 +2572,15 @@ declare class Session {
|
|
|
2475
2572
|
*/
|
|
2476
2573
|
reset(): void;
|
|
2477
2574
|
private runnerModesFor;
|
|
2575
|
+
/**
|
|
2576
|
+
* The catalog a model/task-mode edit is checked against — the same
|
|
2577
|
+
* discovered models and manifest modes the per-turn catalog block shows the
|
|
2578
|
+
* planner, so a refusal here can never name something invalid that the
|
|
2579
|
+
* planner was never told about. `modelsCache` is read live, not filtered by
|
|
2580
|
+
* the allowlist here — {@link checkModelAndModeValidity} narrows by
|
|
2581
|
+
* allowlist itself, the same way `coerceAssignments` does.
|
|
2582
|
+
*/
|
|
2583
|
+
private editCatalog;
|
|
2478
2584
|
get planState(): LegacyPlanState | null;
|
|
2479
2585
|
/**
|
|
2480
2586
|
* The live plan in the shape a saved session is read back as. The disk
|
|
@@ -2513,10 +2619,30 @@ declare class Session {
|
|
|
2513
2619
|
*/
|
|
2514
2620
|
startPlanning(goal: string, runners: RunnerId[], options?: GeneratePlanOptions): Promise<LegacyPlanState>;
|
|
2515
2621
|
/**
|
|
2516
|
-
* Every subsequent user reply in the planning conversation —
|
|
2517
|
-
* answers,
|
|
2622
|
+
* Every subsequent user reply in the planning conversation — clarifying
|
|
2623
|
+
* answers, outline confirm. One branch, no phase ladder.
|
|
2518
2624
|
*/
|
|
2519
2625
|
continueConversation(userMessage: string, options?: GeneratePlanOptions): Promise<LegacyPlanState>;
|
|
2626
|
+
/**
|
|
2627
|
+
* Answer every read the planner emits until it says something else.
|
|
2628
|
+
*
|
|
2629
|
+
* The channel is a text envelope rather than a registered tool because the
|
|
2630
|
+
* protocol has to be identical on both planner backends (ADR-0009): Ordewell
|
|
2631
|
+
* owns a tool loop only in the API case, and a harness planner running as a
|
|
2632
|
+
* coding-agent subprocess can only be reached this way.
|
|
2633
|
+
*
|
|
2634
|
+
* Draining here — outside {@link repairLoop} — is what keeps reads free of
|
|
2635
|
+
* the repair budget. A planner that looks a task up and *then* fumbles its
|
|
2636
|
+
* ops JSON still gets its two corrective retries; charging it for the read
|
|
2637
|
+
* would cost it the chance to fix the edit.
|
|
2638
|
+
*/
|
|
2639
|
+
private drainTaskQueries;
|
|
2640
|
+
/**
|
|
2641
|
+
* Render one read out of live state. Never persisted to the transcript: the
|
|
2642
|
+
* detail is context for the planner's next reply, and re-sending it on every
|
|
2643
|
+
* later turn is exactly the cost this channel exists to avoid.
|
|
2644
|
+
*/
|
|
2645
|
+
private taskQueryAnswer;
|
|
2520
2646
|
/**
|
|
2521
2647
|
* Drive a planner turn to a persisted, broadcast outcome. Task edits apply
|
|
2522
2648
|
* atomically; validation failures are fed back to the model for up to 2
|
|
@@ -2525,6 +2651,24 @@ declare class Session {
|
|
|
2525
2651
|
* path, not two.
|
|
2526
2652
|
*/
|
|
2527
2653
|
private settleTurn;
|
|
2654
|
+
/**
|
|
2655
|
+
* The catalog the planner may actually draw from — model ids and task-mode
|
|
2656
|
+
* ids, per selected runner — emitted on EVERY turn, before any plan exists
|
|
2657
|
+
* or after. The system prompt shows this once at conversation start; a long
|
|
2658
|
+
* clarifying conversation outlives that single showing and the planner
|
|
2659
|
+
* starts misquoting it, so this re-states it per turn instead.
|
|
2660
|
+
*
|
|
2661
|
+
* Built from the allowlist-filtered view (`filterModelsForPrompt`), the same
|
|
2662
|
+
* one the system prompt used — a restricted allowlist stays a hard bound on
|
|
2663
|
+
* every turn, not just the first. `this.modelsCache` itself is never
|
|
2664
|
+
* filtered: `coerceAssignments` needs the full discovered catalog alongside
|
|
2665
|
+
* the allowlist to resolve labels and clamp effort to real variants.
|
|
2666
|
+
*
|
|
2667
|
+
* Reads `this.plan.runners` live, so a runner admitted mid-session by a
|
|
2668
|
+
* retarget (`admitRunner`) is filtered and shown like every other — there is
|
|
2669
|
+
* no separate "originally selected" list to fall stale.
|
|
2670
|
+
*/
|
|
2671
|
+
private catalogBlock;
|
|
2528
2672
|
/**
|
|
2529
2673
|
* The "you are here" block for post-plan chat: current tasks with stable
|
|
2530
2674
|
* references, plus the task-ops protocol. Injected per turn (never
|
|
@@ -2545,6 +2689,15 @@ declare class Session {
|
|
|
2545
2689
|
private resumeConversation;
|
|
2546
2690
|
/** Whether the planner conversation is live (started and not yet committed to a plan). */
|
|
2547
2691
|
get isConversationActive(): boolean;
|
|
2692
|
+
/**
|
|
2693
|
+
* Intercept a skill invocation (/skill-name) and substitute the skill's
|
|
2694
|
+
* markdown content BEFORE the message reaches the planner. Prevents runners
|
|
2695
|
+
* (Claude Code, OpenCode) from trying to resolve the skill in their own
|
|
2696
|
+
* directory instead of .ordewell/skills/. An unknown skill is surfaced to
|
|
2697
|
+
* the planner as a notice naming what IS available, rather than passing a
|
|
2698
|
+
* bare /unknown through to be mis-resolved.
|
|
2699
|
+
*/
|
|
2700
|
+
private resolveSkillInvocation;
|
|
2548
2701
|
/** Append one dialogue entry to the persisted transcript. Callers persist via the mutatePlan ritual. */
|
|
2549
2702
|
private appendTranscript;
|
|
2550
2703
|
/** Commit a settled (non-task_ops) turn. Both branches run the mutatePlan ritual. */
|
|
@@ -2594,10 +2747,14 @@ declare class Session {
|
|
|
2594
2747
|
*/
|
|
2595
2748
|
private editPlan;
|
|
2596
2749
|
/**
|
|
2597
|
-
* Patch one task's fields. A hand-set dependency list
|
|
2598
|
-
*
|
|
2599
|
-
*
|
|
2600
|
-
*
|
|
2750
|
+
* Patch one task's fields. A hand-set dependency list, or a type flip
|
|
2751
|
+
* between AI and MAN, are the patches that can leave a task incoherent
|
|
2752
|
+
* (unschedulable, or carrying fields that mean nothing for its new type),
|
|
2753
|
+
* so both go through the same {@link validateTaskEdit} guard the planner's
|
|
2754
|
+
* task-ops applier uses (as the 'direct' actor, which skips the lock rule)
|
|
2755
|
+
* rather than a second copy of the rules — and throws, so the surface can
|
|
2756
|
+
* say why. Gated on the task existing so an edit to an unknown id still
|
|
2757
|
+
* falls through to the no-op `store.update` below instead of throwing.
|
|
2601
2758
|
*/
|
|
2602
2759
|
updateTask(taskId: string, changes: Partial<Task>): Promise<LegacyPlanState | null>;
|
|
2603
2760
|
/**
|
|
@@ -2689,8 +2846,27 @@ declare class Session {
|
|
|
2689
2846
|
get aiServiceInstance(): IAiService;
|
|
2690
2847
|
}
|
|
2691
2848
|
|
|
2849
|
+
/**
|
|
2850
|
+
* Where Ordewell keeps machine-global data (settings, daemon tokens, caches,
|
|
2851
|
+
* user plugins). A single home for everything not tied to a project directory,
|
|
2852
|
+
* so per-project state in `.ordewell/` and global state never collide.
|
|
2853
|
+
*/
|
|
2854
|
+
declare function globalDataDir(): string;
|
|
2855
|
+
/**
|
|
2856
|
+
* One-time lift of a pre-`.ordewell` install's files into the new location.
|
|
2857
|
+
* Each file/dir is checked independently — old exists, new doesn't — rather
|
|
2858
|
+
* than gating the whole thing on "new dir doesn't exist yet". A machine that
|
|
2859
|
+
* migrated `settings.json` under an earlier release already has `globalDataDir()`
|
|
2860
|
+
* on disk, which would otherwise permanently skip lifting anything added to
|
|
2861
|
+
* this list later (`.env` did exactly that: real API keys stranded in the old
|
|
2862
|
+
* dir because the settings.json move had already made the new dir exist).
|
|
2863
|
+
*/
|
|
2864
|
+
declare function migrateOldConfigDir(): void;
|
|
2865
|
+
|
|
2692
2866
|
type VerdictListener = (taskId: string, verdict: Verdict, output: string) => void;
|
|
2693
2867
|
type CheckpointListener = (taskId: string, summary: string) => void;
|
|
2868
|
+
/** Fires on every idleSince transition (null→timestamp on silence, timestamp→null on resume/teardown). */
|
|
2869
|
+
type IdleListener = (taskId: string, idleSince: string | null) => void;
|
|
2694
2870
|
declare class VerdictEngine {
|
|
2695
2871
|
private markerSeen;
|
|
2696
2872
|
private buffers;
|
|
@@ -2698,6 +2874,7 @@ declare class VerdictEngine {
|
|
|
2698
2874
|
private pausedSessions;
|
|
2699
2875
|
private listeners;
|
|
2700
2876
|
private checkpointListeners;
|
|
2877
|
+
private idleListeners;
|
|
2701
2878
|
/**
|
|
2702
2879
|
* Per-task generation counter. Incremented on every watch() and clear().
|
|
2703
2880
|
* Stale callbacks (from a prior session whose generation doesn't match
|
|
@@ -2705,8 +2882,17 @@ declare class VerdictEngine {
|
|
|
2705
2882
|
* wrong session.
|
|
2706
2883
|
*/
|
|
2707
2884
|
private generations;
|
|
2885
|
+
private idleTimers;
|
|
2886
|
+
private idleSince;
|
|
2708
2887
|
onVerdict(listener: VerdictListener): void;
|
|
2709
2888
|
onCheckpoint(listener: CheckpointListener): void;
|
|
2889
|
+
onIdleChange(listener: IdleListener): void;
|
|
2890
|
+
/** Advisory silence timestamp for a task, or null if it isn't idle. */
|
|
2891
|
+
getIdleSince(taskId: string): string | null;
|
|
2892
|
+
/** Restart the silence timer on fresh output; broadcasts the null transition if it was idle. */
|
|
2893
|
+
private touchIdle;
|
|
2894
|
+
/** Tear down idle tracking for a task; broadcasts the null transition if it was idle. */
|
|
2895
|
+
private clearIdle;
|
|
2710
2896
|
approveCheckpoint(taskId: string): void;
|
|
2711
2897
|
rejectCheckpoint(taskId: string, reason: string): void;
|
|
2712
2898
|
/**
|
|
@@ -2793,7 +2979,7 @@ declare function runnerAssignment(catalog: RunnerCatalog, current?: Pick<Task, '
|
|
|
2793
2979
|
*/
|
|
2794
2980
|
declare function retargetTaskRunner(task: Task, runner: RunnerId, catalog: RunnerCatalog): Partial<Task>;
|
|
2795
2981
|
|
|
2796
|
-
declare function buildResearchToolsPrompt(
|
|
2982
|
+
declare function buildResearchToolsPrompt(): string;
|
|
2797
2983
|
/**
|
|
2798
2984
|
* System prompt for one read-only research subagent (issue #34). The digest
|
|
2799
2985
|
* contract matters: the reply goes back to the planner as a tool result, so it
|
|
@@ -2801,7 +2987,7 @@ declare function buildResearchToolsPrompt(subagentsEnabled?: boolean): string;
|
|
|
2801
2987
|
* never a task plan.
|
|
2802
2988
|
*/
|
|
2803
2989
|
declare function buildSubagentSystemPrompt(): string;
|
|
2804
|
-
declare function buildConversationSystemPrompt(goal: string, context: string, modelsByRunner: Partial<Record<RunnerId, DiscoveredModel[]>>, runners: RunnerId[], runnerModes?: Record<RunnerId, RunnerModeInfo[]>, autonomousDefault?: boolean,
|
|
2990
|
+
declare function buildConversationSystemPrompt(goal: string, context: string, modelsByRunner: Partial<Record<RunnerId, DiscoveredModel[]>>, runners: RunnerId[], runnerModes?: Record<RunnerId, RunnerModeInfo[]>, autonomousDefault?: boolean, verificationEnabled?: boolean,
|
|
2805
2991
|
/** Harness planner (ADR-0009): the agent owns its own tools and research budget. */
|
|
2806
2992
|
harnessMode?: boolean): string;
|
|
2807
2993
|
declare const CORE_PLANNER_PROMPT: string;
|
|
@@ -2839,7 +3025,7 @@ declare function buildSplitPrompt(taskId: string, tasks: Task[]): string;
|
|
|
2839
3025
|
* driver (it also runs the tool rounds) but delegates classification here.
|
|
2840
3026
|
* - The corrective prompt texts live here, once.
|
|
2841
3027
|
*
|
|
2842
|
-
* Policies stay at the call sites (
|
|
3028
|
+
* Policies stay at the call sites (ops validation, abort guards) —
|
|
2843
3029
|
* they are inputs to the loop, not part of it.
|
|
2844
3030
|
*/
|
|
2845
3031
|
type RepairVerdict<T> = {
|
|
@@ -2885,6 +3071,8 @@ declare function reEmitPlanPrompt(detail: string): string;
|
|
|
2885
3071
|
declare function truncatedPlanReEmitPrompt(historyCompacted: boolean): string;
|
|
2886
3072
|
/** A task-ops attempt was botched (unparseable JSON): re-emit the ops object. */
|
|
2887
3073
|
declare function reEmitTaskOpsPrompt(detail: string): string;
|
|
3074
|
+
/** A read attempt was botched (unparseable or unknown selector): re-emit the query object. */
|
|
3075
|
+
declare function reEmitTaskQueryPrompt(detail: string): string;
|
|
2888
3076
|
/** Task ops parsed but failed semantic validation (cycles, unknown refs, locked tasks). */
|
|
2889
3077
|
declare function taskOpsRejectedPrompt(errors: string[]): string;
|
|
2890
3078
|
/** A modified plan failed validation during execution: full re-prompt feedback block. */
|
|
@@ -2896,6 +3084,11 @@ type PlannerReplyClassification = {
|
|
|
2896
3084
|
kind: 'task_ops';
|
|
2897
3085
|
ops: TaskOp[];
|
|
2898
3086
|
}
|
|
3087
|
+
/** A read: show me these tasks in full (and/or the whole catalog) before I edit anything. */
|
|
3088
|
+
| {
|
|
3089
|
+
kind: 'task_query';
|
|
3090
|
+
query: TaskQuery;
|
|
3091
|
+
}
|
|
2899
3092
|
/** Clearly attempted a plan (tasks-keyed object, or JSON cut off mid-stream) and botched it — worth a corrective retry. */
|
|
2900
3093
|
| {
|
|
2901
3094
|
kind: 'broken_plan';
|
|
@@ -2905,6 +3098,11 @@ type PlannerReplyClassification = {
|
|
|
2905
3098
|
| {
|
|
2906
3099
|
kind: 'broken_task_ops';
|
|
2907
3100
|
error: PlanParseError;
|
|
3101
|
+
}
|
|
3102
|
+
/** Clearly attempted a read and botched it — worth a corrective retry. */
|
|
3103
|
+
| {
|
|
3104
|
+
kind: 'broken_task_query';
|
|
3105
|
+
error: PlanParseError;
|
|
2908
3106
|
} | {
|
|
2909
3107
|
kind: 'prose';
|
|
2910
3108
|
};
|
|
@@ -2957,7 +3155,13 @@ declare function summarizeOutput(reviewReason: string | undefined, output: strin
|
|
|
2957
3155
|
declare function collectDirectDependencyOutputs(task: Task, allTasks: Task[]): PriorOutput[];
|
|
2958
3156
|
declare function renderPriorOutputs(outputs: PriorOutput[]): string;
|
|
2959
3157
|
declare function augmentPromptWithPriorOutputs(task: Task, allTasks: Task[]): string;
|
|
2960
|
-
|
|
3158
|
+
/**
|
|
3159
|
+
* Numbered task list for the model's context. `planTasks` is the nested task
|
|
3160
|
+
* tree; subtasks render indented under their parent with the same dotted
|
|
3161
|
+
* `taskOrderLabel` the other surfaces use, so an `N.M` the model echoes back
|
|
3162
|
+
* matches what `resolveTaskId` accepts.
|
|
3163
|
+
*/
|
|
3164
|
+
declare function renderPlanMap(planTasks: Task[], currentTaskId: string, opts?: {
|
|
2961
3165
|
maxEntries?: number;
|
|
2962
3166
|
}): string;
|
|
2963
3167
|
interface ComposeOptions {
|
|
@@ -3492,4 +3696,4 @@ declare class PlannerModelMemory {
|
|
|
3492
3696
|
recall(provider: string, catalog: PlannerModelCandidate[]): PlannerModelRecall;
|
|
3493
3697
|
}
|
|
3494
3698
|
|
|
3495
|
-
export { ALLOWED_PLUGIN_HOSTS, ALL_PROVIDERS, AUTO_COMMANDS, AbstractRunner, AbstractTerminalSession, ActiveTaskSession, type AgentAdapter, type AgentAdapterFactory, type AgentEvent, type AgentProcessDeps, type AgentStartOptions, AiProvider, ApprovalKind, ApprovalMode, ApprovalRequest, ApprovalSource, BaseAiService, BaseConfig, BaseFileSystem, CLAUDE_CODE_MANIFEST, CLI_PROVIDERS, CMD_EXE_MAX_COMMAND_LINE, CORE_PLANNER_PROMPT, type CappedRows, type CheckpointListener, ClaudeCodeAdapter, CliAgentAiService, type CliAgentAiServiceDeps, CodexAdapter, type CommandClassification, CommandLineTooLongError, type CommandTier, type ComposeOptions, ConsoleLogger, ContextCollector, ConversationMessage, type ConversationRequest, type ConversationTurn, DAEMON_SUBPROTOCOL, DAEMON_TOKEN_SUBPROTOCOL_PREFIX, DiscoveredModel, EmbeddedNewlineError, type EnvAdmission, EnvConfig, type ExecFileFn, type ExecImpl, ExecutableNotFoundError, FindSymbolOptions, FsPluginStore, GIT_READONLY_SUBCOMMANDS, GeminiService, GlobOptions, type GrepInvocation, GrepOptions, type HasBinFn, HeadlessRunner, type HeadlessRunnerDeps, HeadlessSession, type IAiService, IApproval, IConfig, IFileSystem, type ILogger, type INotification, IPluginStore, ITerminalRunner, ITerminalSession, JSON_REPAIR_INSTRUCTION, type KillTreeDeps, type LaunchDeps, type LaunchPlan, LegacyPlanState, LineBuffer, type MappedTool, ModelResolver, type ModelResolverDeps, type ModifyPlanRequest, type NotificationAction, OPENCODE_MANIFEST, ORDEWELL_SETTABLE_ENV, OpenAiService, OpenCodeAdapter, type OrchestratorObserver, OrchestratorOption, PLUGIN_NAME_PATTERN, PROVIDER_CREDENTIAL_ENV, PROVIDER_DETECT_PRIORITY, PROVIDER_LABEL, PROVIDER_PRIORITY, PROVIDER_SHORT_LABEL, type PendingApproval, PendingApprovals, type PendingApprovalsOptions, PlanEditError, PlanParseError, type PlanRequest, PlanState, PlanStatus, PlanStore, Planner, type PlannerModelCandidate, type PlannerModelChoice, PlannerModelMemory, type PlannerModelRecall, type PlannerModelStore, type PlannerReplyClassification, type PlannerRuntimeToggles, type PluginSource, type PrdBlock, type PreparedLaunch, type PriorOutput, type ProbeFn, ProviderModelLists, type ProviderRegistration, QueuedMessage, REFUSED_COMMANDS, ReadFileOpts, type RepairLoopOpts, type RepairVerdict, type ResearchChat, ResearchLogEntry, ResearchProgress, type ResearchShell, type ResearchShellDeps, ResearchStep, ResearchToolType, type ResearchTurn, ResolveContext, type RunnerCatalog, RunnerId, RunnerInstallation, RunnerInvocation, type RunnerMode, RunnerModeInfo, RunnerPluginManifest, RunnerRegistry, type RunnerSpawnOptions, SETTINGS_ENV_ALLOWLIST, SETTINGS_ENV_REFUSED, STATE_DIR, STOPPED_TOOL_RESULT, SYMBOL_LANGUAGES, type SerializedPlan, type SerializedTask, type SerializedTaskStatus, Session, type SessionBroadcaster, type SessionData, type SessionDeps, type SessionMessage, type SessionMeta, type SessionPlanner, type SessionRuntimeSettings, SettingsService, type ShellDialect, type SpawnSpec, StdioAgentAdapter, TRUNCATED_PLAN_REPAIR_INSTRUCTION, Task, TaskOp, TaskOrchestrator, TaskSnapshot, TmuxRunner, type TmuxRunnerDeps, type TokenCarriers, type ToolCall, ToolOutcome, type ToolResult, type UserSettings, Verdict, VerdictEngine, type VerdictListener, WINDOWS_MAX_COMMAND_LINE, type WorkspaceCheckDeps, WorkspaceNotAProjectError, WorkspaceNotFoundError, type WorkspaceProjectCheckDeps, admitSettingsEnv, applyHeadLimit, assertInstallablePluginUrl, assertPlainPluginName, assertWorkspaceExists, assertWorkspaceIsProject, augmentPromptWithPriorOutputs, augmentedPath, bearerHeaderValue, buildConversationSystemPrompt, buildFallbackGrepArgs, buildGlobArgs, buildGrepArgs, buildMergePrompt, buildModifyDuringExecutionPrompt, buildModifyPlanPrompt, buildPlanWithResults, buildResearchPrompt, buildResearchToolsPrompt, buildRunnerInvocation, buildShellInvocation, buildSplitPrompt, buildSubagentSystemPrompt, clampThinkingEffort, classifyCommand, classifyPlannerReply, classifyPluginSource, clearAugmentedPathCache, clearDaemonToken, clearResearchShellCache, clearState, clipboardCopyCommand, coerceAssignments, collectDirectDependencyOutputs, composeAugmentedPrompt, configuredProviders, createAiService, daemonTokenPath, defaultLogger, definitionPattern, deleteSession, discoverGeminiModels, effectiveAllowlist, ensureDir, ensureStateDirIgnored, executionLogBlock, executionSummary, extractPrdBlock, extractPresentedToken, filterFallbackByAnchoredInclude, filterModelsForPrompt, formatSearchOutput, generatePlanWithRepair, getLatestSession, getProviderMeta, getSettingsPath, getStateDir, grantScopeFor, hasTmux, includeGlobFor, isCliProvider, isExecutableResolved, isOpenAiProvider, isPlainPluginName, isValidManifest, killTree, languageForId, listSessions, loadSession, loadSessionPlanState, loadState, mapAgentTool, mintDaemonToken, mintSessionId, modelContextBlock, modifyValidationFeedback, normalizeAgentArgs, normalizeGeminiModel, pendingEditRulesBlock, planDirectLaunch, planShellLaunch, posixShellQuote, prefixModelId, providerForRunner, reEmitPlanPrompt, reEmitTaskOpsPrompt, readDaemonToken, referencePattern, renderPlanMap, renderPriorOutputs, repairLoop, researchShellWarning, researchToolsPath, resolveArgs, resolvePluginInstallDir, resolveProviderFromPrefix, resolveResearchShell, resolveWithin, retargetTaskRunner, runnerAssignment, runnerForProvider, sanitizeSlug, savePrdMarkdown, saveSession, saveState, serializePlan, serializeTask, serializeTaskStatus, sessionRuntimeSettings, stateExists, stripAnsi, stripModelPrefix, summarizeOutput, taskOpsRejectedPrompt, tmuxSessionName, tmuxSocketName, tmuxWindowName, tokenSubprotocols, tokensMatch, truncatedPlanReEmitPrompt, wellKnownBinDirs, windowsCommandLine, withPath, wrapWithPty };
|
|
3699
|
+
export { ALLOWED_PLUGIN_HOSTS, ALL_PROVIDERS, AUTO_COMMANDS, AbstractRunner, AbstractTerminalSession, ActiveTaskSession, type AgentAdapter, type AgentAdapterFactory, type AgentEvent, type AgentProcessDeps, type AgentStartOptions, AiProvider, ApprovalKind, ApprovalMode, ApprovalRequest, ApprovalSource, BUILTIN_SKILL_NAMES, BaseAiService, BaseConfig, BaseFileSystem, CLAUDE_CODE_MANIFEST, CLI_PROVIDERS, CMD_EXE_MAX_COMMAND_LINE, CORE_PLANNER_PROMPT, type CappedRows, type CheckpointListener, ClaudeCodeAdapter, CliAgentAiService, type CliAgentAiServiceDeps, CodexAdapter, type CommandClassification, CommandLineTooLongError, type CommandTier, type ComposeOptions, ConsoleLogger, ContextCollector, ConversationMessage, type ConversationRequest, type ConversationTurn, DAEMON_SUBPROTOCOL, DAEMON_TOKEN_SUBPROTOCOL_PREFIX, DiscoveredModel, EmbeddedNewlineError, type EnvAdmission, EnvConfig, type ExecFileFn, type ExecImpl, ExecutableNotFoundError, FindSymbolOptions, FsPluginStore, GIT_READONLY_SUBCOMMANDS, GeminiService, GlobOptions, type GrepInvocation, GrepOptions, type HasBinFn, HeadlessRunner, type HeadlessRunnerDeps, HeadlessSession, type IAiService, IApproval, IConfig, IFileSystem, type ILogger, type INotification, IPluginStore, ITerminalRunner, ITerminalSession, JSON_REPAIR_INSTRUCTION, type KillTreeDeps, type LaunchDeps, type LaunchPlan, LegacyPlanState, LineBuffer, type MappedTool, ModelResolver, type ModelResolverDeps, type ModifyPlanRequest, type NotificationAction, OPENCODE_MANIFEST, ORDEWELL_SETTABLE_ENV, OpenAiService, OpenCodeAdapter, type OrchestratorObserver, OrchestratorOption, PLUGIN_NAME_PATTERN, PROVIDER_CREDENTIAL_ENV, PROVIDER_DETECT_PRIORITY, PROVIDER_LABEL, PROVIDER_PRIORITY, PROVIDER_SHORT_LABEL, type PendingApproval, PendingApprovals, type PendingApprovalsOptions, PlanEditError, PlanParseError, type PlanRequest, PlanState, PlanStatus, PlanStore, Planner, type PlannerModelCandidate, type PlannerModelChoice, PlannerModelMemory, type PlannerModelRecall, type PlannerModelStore, type PlannerReplyClassification, type PlannerRuntimeToggles, type PluginSource, type PrdBlock, type PreparedLaunch, type PriorOutput, type ProbeFn, ProviderModelLists, type ProviderRegistration, QueuedMessage, REFUSED_COMMANDS, ReadFileOpts, type RepairLoopOpts, type RepairVerdict, type ResearchChat, ResearchLogEntry, ResearchProgress, type ResearchShell, type ResearchShellDeps, ResearchStep, ResearchToolType, type ResearchTurn, ResolveContext, type RunnerCatalog, RunnerId, RunnerInstallation, RunnerInvocation, type RunnerMode, RunnerModeInfo, RunnerPluginManifest, RunnerRegistry, type RunnerSpawnOptions, SETTINGS_ENV_ALLOWLIST, SETTINGS_ENV_REFUSED, STATE_DIR, STOPPED_TOOL_RESULT, SYMBOL_LANGUAGES, type SerializedPlan, type SerializedTask, type SerializedTaskStatus, Session, type SessionBroadcaster, type SessionData, type SessionDeps, type SessionMessage, type SessionMeta, type SessionPlanner, type SessionRuntimeSettings, SettingsService, type ShellDialect, type SkillInfo, type SkillMetadata, SkillsService, type SpawnSpec, StdioAgentAdapter, TASK_QUERY_ANSWER_OR_OPS, TASK_QUERY_FIELDS, TASK_QUERY_PROTOCOL, TASK_QUERY_REMINDER, TRUNCATED_PLAN_REPAIR_INSTRUCTION, Task, TaskOp, TaskOrchestrator, type TaskQuery, type TaskQueryCatalog, type TaskQueryField, TaskSnapshot, TmuxRunner, type TmuxRunnerDeps, type TokenCarriers, type ToolCall, ToolOutcome, type ToolResult, type UserSettings, Verdict, VerdictEngine, type VerdictListener, WINDOWS_MAX_COMMAND_LINE, type WorkspaceCheckDeps, WorkspaceNotAProjectError, WorkspaceNotFoundError, type WorkspaceProjectCheckDeps, admitSettingsEnv, applyHeadLimit, assertInstallablePluginUrl, assertPlainPluginName, assertWorkspaceExists, assertWorkspaceIsProject, augmentPromptWithPriorOutputs, augmentedPath, bearerHeaderValue, buildConversationSystemPrompt, buildFallbackGrepArgs, buildGlobArgs, buildGrepArgs, buildMergePrompt, buildModifyDuringExecutionPrompt, buildModifyPlanPrompt, buildPlanWithResults, buildResearchPrompt, buildResearchToolsPrompt, buildRunnerInvocation, buildShellInvocation, buildSplitPrompt, buildSubagentSystemPrompt, clampThinkingEffort, classifyCommand, classifyPlannerReply, classifyPluginSource, clearAugmentedPathCache, clearDaemonToken, clearResearchShellCache, clearState, clipboardCopyCommand, coerceAssignments, collectDirectDependencyOutputs, composeAugmentedPrompt, configuredProviders, createAiService, createSkillsService, daemonTokenPath, defaultLogger, definitionPattern, deleteSession, discoverGeminiModels, effectiveAllowlist, ensureDir, ensureStateDirIgnored, executionLogBlock, executionSummary, extractPrdBlock, extractPresentedToken, filterFallbackByAnchoredInclude, filterModelsForPrompt, formatSearchOutput, generatePlanWithRepair, getLatestSession, getProviderMeta, getSettingsPath, getStateDir, globalDataDir, grantScopeFor, hasTmux, includeGlobFor, isCliProvider, isExecutableResolved, isOpenAiProvider, isPlainPluginName, isValidManifest, killTree, languageForId, listSessions, loadSession, loadSessionPlanState, loadState, mapAgentTool, migrateOldConfigDir, mintDaemonToken, mintSessionId, modelContextBlock, modifyValidationFeedback, normalizeAgentArgs, normalizeGeminiModel, parseTaskQueryJson, pendingEditRulesBlock, planDirectLaunch, planShellLaunch, posixShellQuote, prefixModelId, providerForRunner, reEmitPlanPrompt, reEmitTaskOpsPrompt, reEmitTaskQueryPrompt, readDaemonToken, referencePattern, renderPlanMap, renderPriorOutputs, renderTaskQueryAnswer, repairLoop, researchShellWarning, researchToolsPath, resolveArgs, resolvePluginInstallDir, resolveProviderFromPrefix, resolveResearchShell, resolveSkillInvocation, resolveWithin, retargetTaskRunner, runnerAssignment, runnerForProvider, sanitizeSlug, savePrdMarkdown, saveSession, saveState, serializePlan, serializeTask, serializeTaskStatus, sessionRuntimeSettings, stateExists, stripAnsi, stripModelPrefix, summarizeOutput, taskOpsRejectedPrompt, taskQuerySignature, textHasTaskQuery, tmuxSessionName, tmuxSocketName, tmuxWindowName, tokenSubprotocols, tokensMatch, truncatedPlanReEmitPrompt, wellKnownBinDirs, windowsCommandLine, withPath, wrapWithPty };
|