@ordewell/core 0.9.1 → 0.10.1
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/{IFileSystem-BjiyCQ8O.d.ts → IFileSystem-BCJBHFwB.d.ts} +1 -1
- package/dist/{IFileSystem-Cy-TAWvu.d.mts → IFileSystem-Bj6fy1cG.d.mts} +1 -1
- package/dist/{IRunner-Corods20.d.ts → IRunner-C7_SSpzG.d.ts} +228 -13
- package/dist/{IRunner-D6YfbmHn.d.mts → IRunner-hWAJC4hg.d.mts} +228 -13
- package/dist/ModeResolver-m1d8Cb-j.d.mts +35 -0
- package/dist/ModeResolver-u5ZhRC8x.d.ts +35 -0
- package/dist/{Task-1Q19y7sZ.d.mts → Task-CxwnCJLi.d.mts} +346 -127
- package/dist/{Task-1Q19y7sZ.d.ts → Task-CxwnCJLi.d.ts} +346 -127
- package/dist/{chunk-UUU46PVQ.mjs → chunk-2IIRSBEQ.mjs} +109 -142
- package/dist/chunk-2IIRSBEQ.mjs.map +1 -0
- package/dist/{chunk-OOZWSUIE.mjs → chunk-CH5IGWFS.mjs} +545 -966
- package/dist/chunk-CH5IGWFS.mjs.map +1 -0
- package/dist/chunk-DJAPDO6E.mjs +1358 -0
- package/dist/chunk-DJAPDO6E.mjs.map +1 -0
- package/dist/chunk-DNFT4SQG.mjs +97 -0
- package/dist/chunk-DNFT4SQG.mjs.map +1 -0
- package/dist/index.d.mts +3107 -3988
- package/dist/index.d.ts +3107 -3988
- package/dist/index.js +21576 -17642
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +19222 -15561
- package/dist/index.mjs.map +1 -1
- package/dist/parsing.d.mts +55 -3
- package/dist/parsing.d.ts +55 -3
- package/dist/parsing.js +311 -124
- package/dist/parsing.js.map +1 -1
- package/dist/parsing.mjs +86 -6
- package/dist/parsing.mjs.map +1 -1
- package/dist/plan-utils-B6yJdpgi.d.ts +2902 -0
- package/dist/plan-utils-CKXdD1AD.d.mts +2902 -0
- package/dist/plan-utils.d.mts +4 -5
- package/dist/plan-utils.d.ts +4 -5
- package/dist/plan-utils.js +471 -86
- package/dist/plan-utils.js.map +1 -1
- package/dist/plan-utils.mjs +68 -19
- package/dist/testing.d.mts +22 -4
- package/dist/testing.d.ts +22 -4
- package/dist/testing.js +45 -9
- package/dist/testing.js.map +1 -1
- package/dist/testing.mjs +46 -11
- package/dist/testing.mjs.map +1 -1
- package/package.json +2 -10
- package/skills/tdd/SKILL.md +0 -1
- package/dist/ModeResolver-DE-o2lRF.d.mts +0 -48
- package/dist/ModeResolver-EWlpmVAy.d.ts +0 -48
- package/dist/chunk-2M4X3VB7.mjs +0 -432
- package/dist/chunk-2M4X3VB7.mjs.map +0 -1
- package/dist/chunk-H5O74L77.mjs +0 -185
- package/dist/chunk-H5O74L77.mjs.map +0 -1
- package/dist/chunk-OOZWSUIE.mjs.map +0 -1
- package/dist/chunk-UUU46PVQ.mjs.map +0 -1
- package/dist/chunk-V3JHS7AX.mjs +0 -27
- package/dist/chunk-V3JHS7AX.mjs.map +0 -1
- package/dist/order-labels.d.mts +0 -30
- package/dist/order-labels.d.ts +0 -30
- package/dist/order-labels.js +0 -54
- package/dist/order-labels.js.map +0 -1
- package/dist/order-labels.mjs +0 -13
- package/dist/order-labels.mjs.map +0 -1
- package/dist/parsing-CZdp2p_n.d.ts +0 -154
- package/dist/parsing-GgUJoYKs.d.mts +0 -154
- package/dist/plan-utils-BmUp_Lko.d.mts +0 -1222
- package/dist/plan-utils-tWfH48YX.d.ts +0 -1222
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChildProcess } from 'child_process';
|
|
2
|
-
import { ao as UsageRecord,
|
|
2
|
+
import { ao as UsageRecord, aa as SubagentOutcome, $ as RunnerId, aj as TaskSkillSnapshot } from './Task-CxwnCJLi.mjs';
|
|
3
3
|
import { z } from 'zod/v4';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -298,6 +298,7 @@ type ApprovalMode = 'ask' | 'allow' | 'deny';
|
|
|
298
298
|
* The configured mode. `auto` follows the autonomy level (ADR-0026): Guarded
|
|
299
299
|
* asks, Full runs the allowlist alone and asks nobody, so a planner in Full
|
|
300
300
|
* never waits on a person and never acts outside its standing approvals.
|
|
301
|
+
* Web reads are the exception at both levels.
|
|
301
302
|
*/
|
|
302
303
|
type ApprovalModeSetting = ApprovalMode | 'auto';
|
|
303
304
|
declare function effectiveApprovalMode(setting: ApprovalModeSetting, autonomous: boolean, kind?: ApprovalKind): ApprovalMode;
|
|
@@ -377,9 +378,10 @@ declare class ApprovalPolicy implements IApproval {
|
|
|
377
378
|
* scoped to that one tool. `web_search` is scoped to the search provider, the
|
|
378
379
|
* party that receives every query (ADR-0027). `mcp_server` is starting an MCP
|
|
379
380
|
* server the repository declares for a planner, scoped to its definition
|
|
380
|
-
* (ADR-0028).
|
|
381
|
+
* (ADR-0028). `task_start` is the planner asking to start work through the
|
|
382
|
+
* command seam in Guarded (ADR-0029), asked afresh every time.
|
|
381
383
|
*/
|
|
382
|
-
type ApprovalKind = 'external_path' | 'shell_command' | 'url_fetch' | 'web_search' | 'mcp_tool' | 'mcp_server' | 'runner_tool';
|
|
384
|
+
type ApprovalKind = 'external_path' | 'shell_command' | 'url_fetch' | 'web_search' | 'mcp_tool' | 'mcp_server' | 'runner_tool' | 'task_start';
|
|
383
385
|
interface ApprovalRequest {
|
|
384
386
|
kind: ApprovalKind;
|
|
385
387
|
/** Credentials, data and redirects need a fresh human answer for each invocation. */
|
|
@@ -505,8 +507,8 @@ declare const submitPlanInput: z.ZodObject<{
|
|
|
505
507
|
title: z.ZodString;
|
|
506
508
|
description: z.ZodOptional<z.ZodString>;
|
|
507
509
|
type: z.ZodOptional<z.ZodEnum<{
|
|
508
|
-
ai: "ai";
|
|
509
510
|
user: "user";
|
|
511
|
+
ai: "ai";
|
|
510
512
|
}>>;
|
|
511
513
|
dependencies: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
512
514
|
prompt: z.ZodOptional<z.ZodString>;
|
|
@@ -520,7 +522,7 @@ declare const submitPlanInput: z.ZodObject<{
|
|
|
520
522
|
modelLabel: z.ZodOptional<z.ZodString>;
|
|
521
523
|
thinkingEffort: z.ZodOptional<z.ZodString>;
|
|
522
524
|
}, z.core.$loose>>;
|
|
523
|
-
|
|
525
|
+
readOnly: z.ZodOptional<z.ZodBoolean>;
|
|
524
526
|
autonomy: z.ZodOptional<z.ZodEnum<{
|
|
525
527
|
AFK: "AFK";
|
|
526
528
|
HITL: "HITL";
|
|
@@ -580,10 +582,72 @@ declare const taskQueryInput: z.ZodObject<{
|
|
|
580
582
|
catalog: z.ZodOptional<z.ZodBoolean>;
|
|
581
583
|
}, z.core.$strip>;
|
|
582
584
|
declare const taskOutputInput: z.ZodObject<{
|
|
585
|
+
attempt: z.ZodOptional<z.ZodNumber>;
|
|
586
|
+
kinds: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
587
|
+
text: "text";
|
|
588
|
+
error: "error";
|
|
589
|
+
command: "command";
|
|
590
|
+
thinking: "thinking";
|
|
591
|
+
task_skills: "task_skills";
|
|
592
|
+
turn_start: "turn_start";
|
|
593
|
+
command_output: "command_output";
|
|
594
|
+
compaction: "compaction";
|
|
595
|
+
runner_loaded: "runner_loaded";
|
|
596
|
+
turn_end: "turn_end";
|
|
597
|
+
text_delta: "text_delta";
|
|
598
|
+
thinking_delta: "thinking_delta";
|
|
599
|
+
tool_call: "tool_call";
|
|
600
|
+
tool_result: "tool_result";
|
|
601
|
+
subagent_started: "subagent_started";
|
|
602
|
+
subagent_finished: "subagent_finished";
|
|
603
|
+
usage: "usage";
|
|
604
|
+
message_queued: "message_queued";
|
|
605
|
+
message_removed: "message_removed";
|
|
606
|
+
message_undelivered: "message_undelivered";
|
|
607
|
+
message_handed_over: "message_handed_over";
|
|
608
|
+
message_delivered: "message_delivered";
|
|
609
|
+
approval_requested: "approval_requested";
|
|
610
|
+
approval_decided: "approval_decided";
|
|
611
|
+
approval_withdrawn: "approval_withdrawn";
|
|
612
|
+
runner_ended: "runner_ended";
|
|
613
|
+
}>>>;
|
|
614
|
+
task: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
615
|
+
lines: z.ZodOptional<z.ZodNumber>;
|
|
616
|
+
since: z.ZodOptional<z.ZodNumber>;
|
|
617
|
+
}, z.core.$strip>;
|
|
618
|
+
declare const taskDiffInput: z.ZodObject<{
|
|
583
619
|
task: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
620
|
+
repo: z.ZodOptional<z.ZodString>;
|
|
621
|
+
path: z.ZodOptional<z.ZodString>;
|
|
584
622
|
lines: z.ZodOptional<z.ZodNumber>;
|
|
585
623
|
since: z.ZodOptional<z.ZodNumber>;
|
|
586
624
|
}, z.core.$strip>;
|
|
625
|
+
declare const runPlanInput: z.ZodObject<{}, z.core.$strip>;
|
|
626
|
+
declare const oneTaskInput: z.ZodObject<{
|
|
627
|
+
task: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
628
|
+
}, z.core.$strip>;
|
|
629
|
+
declare const retryTaskInput: z.ZodObject<{
|
|
630
|
+
task: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
631
|
+
from: z.ZodEnum<{
|
|
632
|
+
fresh: "fresh";
|
|
633
|
+
session: "session";
|
|
634
|
+
}>;
|
|
635
|
+
message: z.ZodOptional<z.ZodString>;
|
|
636
|
+
}, z.core.$strip>;
|
|
637
|
+
declare const skipTaskInput: z.ZodObject<{
|
|
638
|
+
task: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
639
|
+
reason: z.ZodString;
|
|
640
|
+
}, z.core.$strip>;
|
|
641
|
+
declare const messageTaskInput: z.ZodObject<{
|
|
642
|
+
task: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
643
|
+
text: z.ZodString;
|
|
644
|
+
}, z.core.$strip>;
|
|
645
|
+
declare const answerApprovalInput: z.ZodObject<{
|
|
646
|
+
task: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
647
|
+
approval: z.ZodOptional<z.ZodString>;
|
|
648
|
+
answer: z.ZodString;
|
|
649
|
+
note: z.ZodOptional<z.ZodString>;
|
|
650
|
+
}, z.core.$strip>;
|
|
587
651
|
type TaskCompleteArgs = z.infer<typeof taskCompleteInput>;
|
|
588
652
|
type CheckpointArgs = z.infer<typeof checkpointInput>;
|
|
589
653
|
type ListRunnersArgs = z.infer<typeof listRunnersInput>;
|
|
@@ -596,6 +660,13 @@ type SubmitPlanArgs = z.infer<typeof submitPlanInput>;
|
|
|
596
660
|
type EditPlanArgs = z.infer<typeof editPlanInput>;
|
|
597
661
|
type TaskQueryArgs = z.infer<typeof taskQueryInput>;
|
|
598
662
|
type TaskOutputArgs = z.infer<typeof taskOutputInput>;
|
|
663
|
+
type TaskDiffArgs = z.infer<typeof taskDiffInput>;
|
|
664
|
+
type RunPlanArgs = z.infer<typeof runPlanInput>;
|
|
665
|
+
type OneTaskArgs = z.infer<typeof oneTaskInput>;
|
|
666
|
+
type RetryTaskArgs = z.infer<typeof retryTaskInput>;
|
|
667
|
+
type MessageTaskArgs = z.infer<typeof messageTaskInput>;
|
|
668
|
+
type SkipTaskArgs = z.infer<typeof skipTaskInput>;
|
|
669
|
+
type AnswerApprovalArgs = z.infer<typeof answerApprovalInput>;
|
|
599
670
|
/** What a handler answers with. `isError` marks a refusal the caller should act on. */
|
|
600
671
|
interface McpToolReply {
|
|
601
672
|
text: string;
|
|
@@ -635,6 +706,16 @@ interface PlannerToolHandler {
|
|
|
635
706
|
editPlan?: Run<EditPlanArgs>;
|
|
636
707
|
taskQuery?: Run<TaskQueryArgs>;
|
|
637
708
|
taskOutput?: Run<TaskOutputArgs>;
|
|
709
|
+
taskDiff?: Run<TaskDiffArgs>;
|
|
710
|
+
runPlan?: Run<RunPlanArgs>;
|
|
711
|
+
runTask?: Run<OneTaskArgs>;
|
|
712
|
+
stopTask?: Run<OneTaskArgs>;
|
|
713
|
+
stopRun?: Run<RunPlanArgs>;
|
|
714
|
+
retryTask?: Run<RetryTaskArgs>;
|
|
715
|
+
skipTask?: Run<SkipTaskArgs>;
|
|
716
|
+
messageTask?: Run<MessageTaskArgs>;
|
|
717
|
+
answerApproval?: Run<AnswerApprovalArgs>;
|
|
718
|
+
mergeAll?: Run<RunPlanArgs>;
|
|
638
719
|
}
|
|
639
720
|
interface McpTool<H> {
|
|
640
721
|
name: string;
|
|
@@ -651,7 +732,19 @@ interface McpTool<H> {
|
|
|
651
732
|
}
|
|
652
733
|
/** The task tool whose call settles the attempt (ADR-0022, V1). */
|
|
653
734
|
declare const TASK_COMPLETE_TOOL = "task_complete";
|
|
735
|
+
/**
|
|
736
|
+
* How a task is told to end. It rides in the runner's instructions rather than
|
|
737
|
+
* in the first message: a runner compacts its own context and rewrites that
|
|
738
|
+
* message into a summary, while its instructions are re-applied whole.
|
|
739
|
+
*/
|
|
740
|
+
declare const TASK_COMPLETION_CONTRACT: string;
|
|
654
741
|
declare const TASK_TOOLS: readonly McpTool<TaskToolHandler>[];
|
|
742
|
+
/**
|
|
743
|
+
* The planner's execution tools (ADR-0029, #91): each call goes to the
|
|
744
|
+
* session's command seam, which checks it, asks the user where consent needs
|
|
745
|
+
* one, and records it. The API planner offers the same tools as its own.
|
|
746
|
+
*/
|
|
747
|
+
declare const PLANNER_EXECUTION_TOOLS: readonly McpTool<PlannerToolHandler>[];
|
|
655
748
|
declare const PLANNER_TOOLS: readonly McpTool<PlannerToolHandler>[];
|
|
656
749
|
|
|
657
750
|
/**
|
|
@@ -756,6 +849,33 @@ interface ProjectMcpServer {
|
|
|
756
849
|
definition: Record<string, unknown>;
|
|
757
850
|
}
|
|
758
851
|
|
|
852
|
+
/**
|
|
853
|
+
* What a runner command is to the runner that offers it: a `builtin` of the
|
|
854
|
+
* harness itself (`/compact`, `/model`), a `skill`, or any other `command` —
|
|
855
|
+
* a user's or a project's custom command, an MCP prompt.
|
|
856
|
+
*/
|
|
857
|
+
type RunnerCommandKind = 'command' | 'skill' | 'builtin';
|
|
858
|
+
/**
|
|
859
|
+
* One slash command a task's runner offers, as the runner itself reported it
|
|
860
|
+
* (#66). Ordewell transports it and records it; it never interprets one.
|
|
861
|
+
*/
|
|
862
|
+
interface RunnerCommand {
|
|
863
|
+
name: string;
|
|
864
|
+
description: string;
|
|
865
|
+
/** How the runner describes its arguments (`<model>`, `[name]`); absent when it takes none it names. */
|
|
866
|
+
argumentHint?: string;
|
|
867
|
+
kind: RunnerCommandKind;
|
|
868
|
+
/** Other names the runner answers to for the same command. */
|
|
869
|
+
aliases?: string[];
|
|
870
|
+
}
|
|
871
|
+
/** An MCP server a runner loaded for a task, and the state the runner reported it in. */
|
|
872
|
+
interface RunnerMcpServer {
|
|
873
|
+
name: string;
|
|
874
|
+
status?: string;
|
|
875
|
+
}
|
|
876
|
+
/** The command `name` names, by its own name or an alias. */
|
|
877
|
+
declare function findRunnerCommand(commands: readonly RunnerCommand[], name: string): RunnerCommand | undefined;
|
|
878
|
+
|
|
759
879
|
/**
|
|
760
880
|
* The harness-planner transport contract (ADR-0009).
|
|
761
881
|
*
|
|
@@ -908,6 +1028,28 @@ type AgentEvent =
|
|
|
908
1028
|
| {
|
|
909
1029
|
type: 'error';
|
|
910
1030
|
message: string;
|
|
1031
|
+
}
|
|
1032
|
+
/**
|
|
1033
|
+
* What the runner loaded for this process from the user's and the
|
|
1034
|
+
* project's own setup (#66): its commands and skills, and its MCP servers.
|
|
1035
|
+
* Once per process, as it starts its first turn.
|
|
1036
|
+
*/
|
|
1037
|
+
| {
|
|
1038
|
+
type: 'runner_loaded';
|
|
1039
|
+
commands: RunnerCommand[];
|
|
1040
|
+
mcpServers: RunnerMcpServer[];
|
|
1041
|
+
}
|
|
1042
|
+
/** The runner compacted its own context: asked to (`manual`) or on its own (`auto`). */
|
|
1043
|
+
| {
|
|
1044
|
+
type: 'compaction';
|
|
1045
|
+
trigger: 'manual' | 'auto';
|
|
1046
|
+
preTokens?: number;
|
|
1047
|
+
postTokens?: number;
|
|
1048
|
+
}
|
|
1049
|
+
/** What a runner command that runs without the model printed, as the runner reported it. */
|
|
1050
|
+
| {
|
|
1051
|
+
type: 'command_output';
|
|
1052
|
+
text: string;
|
|
911
1053
|
};
|
|
912
1054
|
/**
|
|
913
1055
|
* What a planner's permission request is for, read from the runner's own
|
|
@@ -1052,6 +1194,13 @@ interface AgentAdapter {
|
|
|
1052
1194
|
* Absent on an adapter that gives the planner every one it starts.
|
|
1053
1195
|
*/
|
|
1054
1196
|
unusableProjectServers?(): ProjectMcpServer[];
|
|
1197
|
+
/**
|
|
1198
|
+
* Whether `abs`, already resolved on disk, is output this runner saved
|
|
1199
|
+
* outside the workspace for this session and told its planner to read back
|
|
1200
|
+
* (ADR-0032). The planner reads it as it reads the workspace. Absent on a
|
|
1201
|
+
* runner that saves none.
|
|
1202
|
+
*/
|
|
1203
|
+
savedOutput?(abs: string): boolean;
|
|
1055
1204
|
/**
|
|
1056
1205
|
* Answer an open `permission_request`. False when the id is not open — it
|
|
1057
1206
|
* was answered, cancelled, or never asked. Absent on an adapter that leaves
|
|
@@ -1076,8 +1225,11 @@ interface TaskModeAgentAdapter extends AgentAdapter {
|
|
|
1076
1225
|
* for a planner and wrong for a task, which may report completion there.
|
|
1077
1226
|
*/
|
|
1078
1227
|
onOutOfTurn?(listener: (event: AgentEvent) => void): void;
|
|
1079
|
-
/**
|
|
1080
|
-
|
|
1228
|
+
/**
|
|
1229
|
+
* Registers a listener for the process ending, for any reason. Fires at most
|
|
1230
|
+
* once. `lastWords` is how it ended, with its stderr tail.
|
|
1231
|
+
*/
|
|
1232
|
+
onProcessExit(listener: (code: number, lastWords?: string) => void): void;
|
|
1081
1233
|
/**
|
|
1082
1234
|
* Hand a message to the running turn, for the runner to show the model at
|
|
1083
1235
|
* its next step boundary (ADR-0023, D1–D2). Resolves true once the runner
|
|
@@ -1089,6 +1241,18 @@ interface TaskModeAgentAdapter extends AgentAdapter {
|
|
|
1089
1241
|
*/
|
|
1090
1242
|
steer?(id: string, text: string): Promise<boolean>;
|
|
1091
1243
|
answerPermission(id: string, decision: ApprovalDecision): boolean;
|
|
1244
|
+
/**
|
|
1245
|
+
* The slash commands the runner offers this session — its built-ins, the
|
|
1246
|
+
* user's and the project's skills and custom commands (#66) — as it
|
|
1247
|
+
* reported them. Empty until it has; absent on a runner that reports none.
|
|
1248
|
+
*/
|
|
1249
|
+
commands?(): RunnerCommand[];
|
|
1250
|
+
/**
|
|
1251
|
+
* Run the runner's own command `name` as a turn, the way {@link send} runs
|
|
1252
|
+
* a message: resolves when the turn ends. Absent on a runner whose
|
|
1253
|
+
* commands cannot be invoked over its protocol.
|
|
1254
|
+
*/
|
|
1255
|
+
invokeCommand?(name: string, args: string, onEvent: (event: AgentEvent) => void, signal?: AbortSignal): Promise<void>;
|
|
1092
1256
|
}
|
|
1093
1257
|
type SpawnFn = (command: string, args: string[], options: {
|
|
1094
1258
|
env: NodeJS.ProcessEnv;
|
|
@@ -1242,6 +1406,16 @@ interface RunnerMode {
|
|
|
1242
1406
|
autonomous?: boolean;
|
|
1243
1407
|
/** Marks this mode as the runner's conservative build mode — the resolved default when autonomous mode is OFF. */
|
|
1244
1408
|
safe?: boolean;
|
|
1409
|
+
/** Marks this mode as the runner's read-only mode — what a task the planner marks read-only runs in (ADR-0031). */
|
|
1410
|
+
readOnly?: boolean;
|
|
1411
|
+
/** The mode runs under an OS sandbox, so a host where the runner's sandbox cannot start cannot offer it. */
|
|
1412
|
+
sandboxed?: boolean;
|
|
1413
|
+
/**
|
|
1414
|
+
* Why this mode cannot be used on this host. Set by the registry from a host
|
|
1415
|
+
* probe, never by a manifest: a mode with a reason is listed, so the user is
|
|
1416
|
+
* told, but never assigned, kept or run.
|
|
1417
|
+
*/
|
|
1418
|
+
unavailable?: string;
|
|
1245
1419
|
}
|
|
1246
1420
|
interface RunnerEntry {
|
|
1247
1421
|
manifest: RunnerManifest;
|
|
@@ -1438,6 +1612,9 @@ declare function enabledRunners(cfg: IConfig): RunnerId[];
|
|
|
1438
1612
|
|
|
1439
1613
|
declare class RunnerRegistry {
|
|
1440
1614
|
private readonly runners;
|
|
1615
|
+
private readonly unavailableModes;
|
|
1616
|
+
/** Mark modes of a runner unusable on this host, by mode id and reason; an empty record clears them. */
|
|
1617
|
+
setUnavailableModes(id: string, reasons: Record<string, string>): void;
|
|
1441
1618
|
get(id: string): RunnerEntry | undefined;
|
|
1442
1619
|
getManifest(id: string): RunnerManifest | undefined;
|
|
1443
1620
|
list(): RunnerEntry[];
|
|
@@ -1447,6 +1624,11 @@ declare class RunnerRegistry {
|
|
|
1447
1624
|
|
|
1448
1625
|
/** How a structured turn ended. `failed` carries the agent's own words in the preceding `error` event. */
|
|
1449
1626
|
type StructuredTurnEnd = 'completed' | 'interrupted' | 'failed';
|
|
1627
|
+
/**
|
|
1628
|
+
* Who sent a task message that is not the user's: Ordewell itself, for the
|
|
1629
|
+
* completion reminder (ADR-0018, W1). Absent means the user.
|
|
1630
|
+
*/
|
|
1631
|
+
type TaskMessageFrom = 'ordewell';
|
|
1450
1632
|
/**
|
|
1451
1633
|
* One normalized event from a structured task (ADR-0018, O1b): the adapter's
|
|
1452
1634
|
* events, with the turn made explicit at both ends and the message queue (M1)
|
|
@@ -1458,13 +1640,17 @@ type StructuredEvent = Exclude<AgentEvent, {
|
|
|
1458
1640
|
}>
|
|
1459
1641
|
/**
|
|
1460
1642
|
* `text` is the user message the turn answers; `messageId` is set when it had
|
|
1461
|
-
* waited in the queue, `forced` when it was force sent (ADR-0023, Q2)
|
|
1643
|
+
* waited in the queue, `forced` when it was force sent (ADR-0023, Q2), `from`
|
|
1644
|
+
* when Ordewell sent it. `command` is set on a turn that runs the runner's
|
|
1645
|
+
* own command (#66); `text` is then that command as the runner read it.
|
|
1462
1646
|
*/
|
|
1463
1647
|
| {
|
|
1464
1648
|
type: 'turn_start';
|
|
1465
1649
|
text: string;
|
|
1466
1650
|
messageId?: string;
|
|
1467
1651
|
forced?: boolean;
|
|
1652
|
+
from?: TaskMessageFrom;
|
|
1653
|
+
command?: InvokedCommand;
|
|
1468
1654
|
} | {
|
|
1469
1655
|
type: 'turn_end';
|
|
1470
1656
|
reason: StructuredTurnEnd;
|
|
@@ -1472,13 +1658,15 @@ type StructuredEvent = Exclude<AgentEvent, {
|
|
|
1472
1658
|
/**
|
|
1473
1659
|
* Waiting in Ordewell's queue — again, for a message the runner was handed
|
|
1474
1660
|
* and let go of (ADR-0023, D4). `forced` puts it ahead of the rest, behind
|
|
1475
|
-
* earlier forced ones (F2); a message already listed moves there
|
|
1661
|
+
* earlier forced ones (F2); a message already listed moves there, still
|
|
1662
|
+
* handed over if it was.
|
|
1476
1663
|
*/
|
|
1477
1664
|
| {
|
|
1478
1665
|
type: 'message_queued';
|
|
1479
1666
|
messageId: string;
|
|
1480
1667
|
text: string;
|
|
1481
1668
|
forced?: boolean;
|
|
1669
|
+
from?: TaskMessageFrom;
|
|
1482
1670
|
} | {
|
|
1483
1671
|
type: 'message_removed';
|
|
1484
1672
|
messageId: string;
|
|
@@ -1486,6 +1674,7 @@ type StructuredEvent = Exclude<AgentEvent, {
|
|
|
1486
1674
|
type: 'message_undelivered';
|
|
1487
1675
|
messageId: string;
|
|
1488
1676
|
text: string;
|
|
1677
|
+
from?: TaskMessageFrom;
|
|
1489
1678
|
}
|
|
1490
1679
|
/** The runner accepted the message into its running turn; it can no longer be taken back (ADR-0023, D3). */
|
|
1491
1680
|
| {
|
|
@@ -1497,6 +1686,7 @@ type StructuredEvent = Exclude<AgentEvent, {
|
|
|
1497
1686
|
type: 'message_delivered';
|
|
1498
1687
|
messageId: string;
|
|
1499
1688
|
text: string;
|
|
1689
|
+
from?: TaskMessageFrom;
|
|
1500
1690
|
}
|
|
1501
1691
|
/** An open `permission_request` was answered, by whoever answered it (ADR-0018, A1). */
|
|
1502
1692
|
| {
|
|
@@ -1509,13 +1699,19 @@ type StructuredEvent = Exclude<AgentEvent, {
|
|
|
1509
1699
|
type: 'permission_withdrawn';
|
|
1510
1700
|
id: string;
|
|
1511
1701
|
};
|
|
1702
|
+
/** A runner command a user invoked, with its arguments as typed. */
|
|
1703
|
+
interface InvokedCommand {
|
|
1704
|
+
name: string;
|
|
1705
|
+
args?: string;
|
|
1706
|
+
}
|
|
1512
1707
|
interface QueuedTaskMessage {
|
|
1513
1708
|
id: string;
|
|
1514
1709
|
text: string;
|
|
1515
1710
|
/** The runner has it and owes a delivery, so it cannot be taken back (ADR-0023, Q1). */
|
|
1516
1711
|
handedOver?: boolean;
|
|
1517
|
-
/** Force sent: it goes
|
|
1712
|
+
/** Force sent: it goes first once the running turn is interrupted (ADR-0023, F1). Every listed message can be, handed over or not. */
|
|
1518
1713
|
forced?: boolean;
|
|
1714
|
+
from?: TaskMessageFrom;
|
|
1519
1715
|
}
|
|
1520
1716
|
interface IRunnerSession {
|
|
1521
1717
|
id: string;
|
|
@@ -1533,8 +1729,9 @@ interface IRunnerSession {
|
|
|
1533
1729
|
* Send a user message: at once when idle; while a turn runs, handed to the
|
|
1534
1730
|
* runner for its next step where it can take one, otherwise queued until
|
|
1535
1731
|
* the turn ends (ADR-0023). Returns its id, for {@link removeQueued}.
|
|
1732
|
+
* `from` marks a message Ordewell sent rather than the user.
|
|
1536
1733
|
*/
|
|
1537
|
-
sendMessage(text: string): string;
|
|
1734
|
+
sendMessage(text: string, from?: TaskMessageFrom): string;
|
|
1538
1735
|
/**
|
|
1539
1736
|
* Force send (ADR-0023, F1–F3): interrupt the running turn, as
|
|
1540
1737
|
* {@link interrupt} does, and deliver this message as the turn that
|
|
@@ -1542,7 +1739,11 @@ interface IRunnerSession {
|
|
|
1542
1739
|
* input in between. With no turn running it is {@link sendMessage}.
|
|
1543
1740
|
*/
|
|
1544
1741
|
forceSend(text: string): string;
|
|
1545
|
-
/**
|
|
1742
|
+
/**
|
|
1743
|
+
* Force send a message not yet delivered, by id — queued, or handed over,
|
|
1744
|
+
* which is not sent twice: the interrupt makes it go first (ADR-0023, F1).
|
|
1745
|
+
* False once it was delivered.
|
|
1746
|
+
*/
|
|
1546
1747
|
forceSendQueued(id: string): boolean;
|
|
1547
1748
|
/** Take a message back before the runner has it. False once it was handed over or delivered. */
|
|
1548
1749
|
removeQueued(id: string): boolean;
|
|
@@ -1556,6 +1757,20 @@ interface IRunnerSession {
|
|
|
1556
1757
|
interrupt(): Promise<void>;
|
|
1557
1758
|
/** The runner's own session id once announced — what a continue resumes (ADR-0018, K1). */
|
|
1558
1759
|
nativeSessionId(): string | null;
|
|
1760
|
+
/**
|
|
1761
|
+
* The slash commands the runner offers this task (#66): its built-ins and
|
|
1762
|
+
* the user's and the project's skills and custom commands. Empty for a
|
|
1763
|
+
* runner that reports none.
|
|
1764
|
+
*/
|
|
1765
|
+
commands(): RunnerCommand[];
|
|
1766
|
+
/**
|
|
1767
|
+
* Run the runner's own command `name` as a turn of its own: at once when
|
|
1768
|
+
* idle, otherwise queued behind the running turn — never handed into it,
|
|
1769
|
+
* where a runner reads it as text. A runner whose commands cannot be invoked
|
|
1770
|
+
* over its protocol is sent `/name args` as a message. Returns its id, as
|
|
1771
|
+
* {@link sendMessage} does.
|
|
1772
|
+
*/
|
|
1773
|
+
invokeCommand(name: string, args?: string): string;
|
|
1559
1774
|
/**
|
|
1560
1775
|
* Answer a `permission_request` this session emitted, by its event id. False
|
|
1561
1776
|
* when it is no longer open — answered, withdrawn, or never asked.
|
|
@@ -1618,4 +1833,4 @@ interface IRunner {
|
|
|
1618
1833
|
activeCount: number;
|
|
1619
1834
|
}
|
|
1620
1835
|
|
|
1621
|
-
export { type
|
|
1836
|
+
export { type OwnerOnlyFile as $, AUTO_COMMANDS as A, type IRunnerSession as B, type CatalogModel as C, DEFAULT_PLANNER_ALLOWLIST as D, type EditPlanArgs as E, type FetchAllProviderModelsOptions as F, GIT_READONLY_SUBCOMMANDS as G, type InvokedCommand as H, type IApproval as I, type ListModelsArgs as J, type ListRunnersArgs as K, LineBuffer as L, type LoadSkillArgs as M, type McpClientConfig as N, type McpCredential as O, type McpTool as P, type McpToolContext as Q, type McpToolReply as R, type MessageTaskArgs as S, ModelCatalog as T, type ModelShortcut as U, ORCHESTRATOR_SHORTCUTS as V, ORDEWELL_MCP_PATH as W, ORDEWELL_MCP_SERVER_NAME as X, type OneTaskArgs as Y, type OrchestratorOption as Z, OrdewellMcpServer as _, type AgentAdapter as a, researchToolsPath as a$, PLANNER_EXECUTION_TOOLS as a0, PLANNER_TOOLS as a1, type PlannerAllowlist as a2, type PlannerStartOptions as a3, type PlannerTokenScope as a4, type PlannerToolHandler as a5, type ProjectMcpServer as a6, type ProviderCredentialSource as a7, type ProviderModelLists as a8, type ProviderModelsResult as a9, type TaskDiffArgs as aA, type TaskMessageFrom as aB, type TaskModeAgentAdapter as aC, TaskModeUnsupportedError as aD, type TaskOutputArgs as aE, type TaskQueryArgs as aF, type TaskRunnerFlags as aG, type TaskStartOptions as aH, type TaskTokenScope as aI, type TaskToolHandler as aJ, approvalScopes as aK, classifyCommand as aL, clearResearchShellCache as aM, collectProviderCredentials as aN, commandAllowedBy as aO, effectiveApprovalMode as aP, enabledRunners as aQ, fetchAllProviderModels as aR, findRunnerCommand as aS, isGranted as aT, isRunnerApproval as aU, knownModelId as aV, mcpClientConfig as aW, ownerOnlyConfigFile as aX, parseAllowlist as aY, parseApprovalModeSetting as aZ, researchShellWarning as a_, type QueuedTaskMessage as aa, REFUSED_COMMANDS as ab, type ResearchShell as ac, type ResearchShellDeps as ad, type RetryTaskArgs as ae, type RunCommandArgs as af, type RunPlanArgs as ag, type RunnerCommand as ah, type RunnerCommandKind as ai, type RunnerEntry as aj, type RunnerFeatures as ak, type RunnerManifest as al, type RunnerMcpServer as am, type RunnerMode as an, type RunnerModelDiscovery as ao, RunnerRegistry as ap, type ShellDialect as aq, type SpawnFn as ar, type StandingDecision as as, type StructuredEvent as at, type StructuredTurnEnd as au, type SubmitPlanArgs as av, TASK_COMPLETE_TOOL as aw, TASK_COMPLETION_CONTRACT as ax, TASK_TOOLS as ay, type TaskCompleteArgs as az, type AgentAdapterFactory as b, resolveModelShortcut as b0, resolveProvider as b1, resolveResearchShell as b2, scopeAllowed as b3, sharedMcpServer as b4, toApprovalDecision as b5, toOrchestratorOptions as b6, toolAllowed as b7, type AgentEvent as c, type AgentProcessDeps as d, type AgentStartOptions as e, type AiProvider as f, type AllProviderModels as g, type AnswerApprovalArgs as h, type ApprovalAnswer as i, type ApprovalDecision as j, type ApprovalKind as k, type ApprovalMode as l, type ApprovalModeSetting as m, ApprovalPolicy as n, type ApprovalPolicyOptions as o, type ApprovalRequest as p, type ApprovalSource as q, type CheckpointAnswer as r, type CheckpointArgs as s, type CommandClassification as t, type CommandTier as u, type CommandWords as v, DENY_ALL as w, type DiscoveryCommand as x, type IConfig as y, type IRunner as z };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { $ as RunnerId } from './Task-CxwnCJLi.mjs';
|
|
2
|
+
|
|
3
|
+
interface RunnerModeInfo {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
description: string;
|
|
7
|
+
autonomous?: boolean;
|
|
8
|
+
safe?: boolean;
|
|
9
|
+
readOnly?: boolean;
|
|
10
|
+
sandboxed?: boolean;
|
|
11
|
+
/** Why this mode cannot be used on this host (a failed probe); such a mode is shown, never assigned. */
|
|
12
|
+
unavailable?: string;
|
|
13
|
+
}
|
|
14
|
+
/** The slice of RunnerRegistry this module needs — structural, so nothing here depends on the manifest layer. */
|
|
15
|
+
interface ManifestLookup {
|
|
16
|
+
getManifest(runner: RunnerId): {
|
|
17
|
+
modes?: RunnerModeInfo[];
|
|
18
|
+
} | undefined;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* A runner's modes are declared only in its manifest, never through a service,
|
|
22
|
+
* so every caller that needs them fuses registry and runner list by hand. This
|
|
23
|
+
* is that fusion, in one place: the planner prompt, the mode pickers on each
|
|
24
|
+
* surface, and the runner-change retarget all read modes the same way.
|
|
25
|
+
*
|
|
26
|
+
* A runner with no modes maps to `[]` rather than being dropped — callers
|
|
27
|
+
* distinguish "declares no modes" from "not asked about".
|
|
28
|
+
*/
|
|
29
|
+
declare function runnerModesFrom(registry: ManifestLookup, runners: RunnerId[]): Record<RunnerId, RunnerModeInfo[]>;
|
|
30
|
+
/** The user-facing name of the `autonomousMode` boolean's two states. */
|
|
31
|
+
declare function autonomyLevelLabel(autonomous: boolean): 'Full' | 'Guarded';
|
|
32
|
+
/** `full`/`guarded` name the levels; `on`/`off` and `auto` are older words for them. Null for anything else. */
|
|
33
|
+
declare function parseAutonomyLevel(arg: string | undefined): boolean | null;
|
|
34
|
+
|
|
35
|
+
export { type RunnerModeInfo as R, autonomyLevelLabel as a, parseAutonomyLevel as p, runnerModesFrom as r };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { $ as RunnerId } from './Task-CxwnCJLi.js';
|
|
2
|
+
|
|
3
|
+
interface RunnerModeInfo {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
description: string;
|
|
7
|
+
autonomous?: boolean;
|
|
8
|
+
safe?: boolean;
|
|
9
|
+
readOnly?: boolean;
|
|
10
|
+
sandboxed?: boolean;
|
|
11
|
+
/** Why this mode cannot be used on this host (a failed probe); such a mode is shown, never assigned. */
|
|
12
|
+
unavailable?: string;
|
|
13
|
+
}
|
|
14
|
+
/** The slice of RunnerRegistry this module needs — structural, so nothing here depends on the manifest layer. */
|
|
15
|
+
interface ManifestLookup {
|
|
16
|
+
getManifest(runner: RunnerId): {
|
|
17
|
+
modes?: RunnerModeInfo[];
|
|
18
|
+
} | undefined;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* A runner's modes are declared only in its manifest, never through a service,
|
|
22
|
+
* so every caller that needs them fuses registry and runner list by hand. This
|
|
23
|
+
* is that fusion, in one place: the planner prompt, the mode pickers on each
|
|
24
|
+
* surface, and the runner-change retarget all read modes the same way.
|
|
25
|
+
*
|
|
26
|
+
* A runner with no modes maps to `[]` rather than being dropped — callers
|
|
27
|
+
* distinguish "declares no modes" from "not asked about".
|
|
28
|
+
*/
|
|
29
|
+
declare function runnerModesFrom(registry: ManifestLookup, runners: RunnerId[]): Record<RunnerId, RunnerModeInfo[]>;
|
|
30
|
+
/** The user-facing name of the `autonomousMode` boolean's two states. */
|
|
31
|
+
declare function autonomyLevelLabel(autonomous: boolean): 'Full' | 'Guarded';
|
|
32
|
+
/** `full`/`guarded` name the levels; `on`/`off` and `auto` are older words for them. Null for anything else. */
|
|
33
|
+
declare function parseAutonomyLevel(arg: string | undefined): boolean | null;
|
|
34
|
+
|
|
35
|
+
export { type RunnerModeInfo as R, autonomyLevelLabel as a, parseAutonomyLevel as p, runnerModesFrom as r };
|