@ordewell/core 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/dist/{IFileSystem-D96mT-bm.d.ts → IFileSystem-DpaaFdit.d.ts} +1 -1
- package/dist/{IFileSystem-DXJCRw5x.d.mts → IFileSystem-_m7HdoxJ.d.mts} +1 -1
- package/dist/{IRunner-CGCihlGQ.d.ts → IRunner-BiQio8gJ.d.ts} +161 -27
- package/dist/{IRunner-XVUddYVX.d.mts → IRunner-CxiymkP_.d.mts} +161 -27
- package/dist/{chunk-BLLIBCCS.mjs → chunk-QUARDKVT.mjs} +6 -3
- package/dist/chunk-QUARDKVT.mjs.map +1 -0
- package/dist/index.d.mts +33 -9
- package/dist/index.d.ts +33 -9
- package/dist/index.js +725 -112
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +712 -109
- package/dist/index.mjs.map +1 -1
- package/dist/{plan-utils-Cv48fe7r.d.ts → plan-utils-6rUr7ZOx.d.ts} +1 -1
- package/dist/{plan-utils-BMayhGBj.d.mts → plan-utils-P3PIEwNa.d.mts} +1 -1
- package/dist/plan-utils.d.mts +2 -2
- package/dist/plan-utils.d.ts +2 -2
- package/dist/plan-utils.js +5 -2
- package/dist/plan-utils.js.map +1 -1
- package/dist/plan-utils.mjs +1 -1
- package/dist/testing.d.mts +2 -2
- package/dist/testing.d.ts +2 -2
- package/dist/testing.js +2 -0
- package/dist/testing.js.map +1 -1
- package/dist/testing.mjs +2 -0
- package/dist/testing.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-BLLIBCCS.mjs.map +0 -1
|
@@ -2,6 +2,78 @@ import { ChildProcess } from 'child_process';
|
|
|
2
2
|
import { ao as UsageRecord, a8 as SubagentOutcome, W as RunnerId, ag as TaskSkillSnapshot } from './Task-1Q19y7sZ.mjs';
|
|
3
3
|
import { z } from 'zod/v4';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* The planner's standing approvals (ADR-0026): what runs without asking
|
|
7
|
+
* anyone, under every approval mode.
|
|
8
|
+
*
|
|
9
|
+
* One entry is one of:
|
|
10
|
+
*
|
|
11
|
+
* - a **command rule**, `gh issue list` or `gcloud * * list`: the binary,
|
|
12
|
+
* then words matched against the command's leading arguments, the ones
|
|
13
|
+
* before its first flag. A command whose leading words match the rule's
|
|
14
|
+
* runs, whatever arguments follow — but the rule must spell out at least
|
|
15
|
+
* the words the command's approval scope holds (ADR-0008, T1), so
|
|
16
|
+
* `az group` never covers `az group delete`, and a one-word read takes a
|
|
17
|
+
* `*` for its argument (`kubectl get *`). `*` stands for one word, and
|
|
18
|
+
* inside a word for any run of characters (`describe-*`). An entry equal
|
|
19
|
+
* to a scope also matches that scope, as pre-approved scopes always did.
|
|
20
|
+
* - an **MCP tool rule**, `mcp:find-*`: a glob over the tool's own name,
|
|
21
|
+
* without the server, case-insensitive.
|
|
22
|
+
* - a **scope pattern**, anything starting with `/`, `~`, `http://`,
|
|
23
|
+
* `https://`, `mcp__` or a drive letter: matched against an approval's
|
|
24
|
+
* scope as ADR-0008 always matched pre-approved entries, `*` matching any
|
|
25
|
+
* run of characters.
|
|
26
|
+
*
|
|
27
|
+
* A leading `!` excludes instead, and an exclusion wins over every rule. A
|
|
28
|
+
* command exclusion's words are looked for anywhere among the arguments, in
|
|
29
|
+
* order, flags included and case ignored, so `!kubectl *secret*` and
|
|
30
|
+
* `!* --endpoint*` hold wherever the word appears; a lone short flag (`-s`)
|
|
31
|
+
* also holds inside a bundle (`-As`, `-shost`). `*` as its binary covers
|
|
32
|
+
* every command.
|
|
33
|
+
*/
|
|
34
|
+
/** The words a command rule is matched against: a lexed segment's binary and arguments. */
|
|
35
|
+
interface CommandWords {
|
|
36
|
+
binary: string;
|
|
37
|
+
args: readonly string[];
|
|
38
|
+
/** How many leading arguments the command's approval scope holds; a rule must cover at least that many. */
|
|
39
|
+
scopeWords?: number;
|
|
40
|
+
}
|
|
41
|
+
interface RuleWord {
|
|
42
|
+
matches: (word: string) => boolean;
|
|
43
|
+
wildcard: boolean;
|
|
44
|
+
}
|
|
45
|
+
interface CommandRule {
|
|
46
|
+
text: string;
|
|
47
|
+
binary: string;
|
|
48
|
+
words: RuleWord[];
|
|
49
|
+
}
|
|
50
|
+
interface PlannerAllowlist {
|
|
51
|
+
commands: CommandRule[];
|
|
52
|
+
commandExclusions: CommandRule[];
|
|
53
|
+
tools: RegExp[];
|
|
54
|
+
toolExclusions: RegExp[];
|
|
55
|
+
scopes: RegExp[];
|
|
56
|
+
scopeExclusions: RegExp[];
|
|
57
|
+
}
|
|
58
|
+
declare function parseAllowlist(entries: readonly string[]): PlannerAllowlist;
|
|
59
|
+
/** The rule that lets this command run unasked, or undefined when none does or an exclusion holds. */
|
|
60
|
+
declare function commandAllowedBy(list: PlannerAllowlist, command: CommandWords): string | undefined;
|
|
61
|
+
/** Whether an MCP tool, by its own name without the server, runs unasked. */
|
|
62
|
+
declare function toolAllowed(list: PlannerAllowlist, tool: string): boolean;
|
|
63
|
+
/** Whether an approval scope — a directory, an origin, a tool's full name — is pre-approved. */
|
|
64
|
+
declare function scopeAllowed(list: PlannerAllowlist, scope: string): boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Read-only command families that are safe to run unasked: they read, never
|
|
67
|
+
* write a file or change a resource, and need no argument that runs code.
|
|
68
|
+
* Absent on purpose: commands that run the repository's own code (test
|
|
69
|
+
* runners, builds, package scripts, a package manager the repository pins or
|
|
70
|
+
* extends — on an untrusted repository someone else wrote that code), commands
|
|
71
|
+
* a repository's own config can point at another endpoint with the user's
|
|
72
|
+
* credentials (`.npmrc`, `.sentryclirc`, a Terraform or Pulumi backend), and
|
|
73
|
+
* commands whose usual output is a secret.
|
|
74
|
+
*/
|
|
75
|
+
declare const DEFAULT_PLANNER_ALLOWLIST: readonly string[];
|
|
76
|
+
|
|
5
77
|
/**
|
|
6
78
|
* The planner's single approval seam. Every capability that reaches beyond the
|
|
7
79
|
* default read-only, in-workspace envelope — a path outside the workspace root,
|
|
@@ -17,9 +89,11 @@ import { z } from 'zod/v4';
|
|
|
17
89
|
/**
|
|
18
90
|
* `runner_tool` is a task runner's own tool request (ADR-0018, A1): it waits
|
|
19
91
|
* for an answer as long as it takes, and never passes through the planner's
|
|
20
|
-
* policy — the runner's mode already decided it needed asking.
|
|
92
|
+
* policy — the runner's mode already decided it needed asking. `mcp_tool` is
|
|
93
|
+
* a harness planner reaching for an MCP tool the user configured (ADR-0026),
|
|
94
|
+
* scoped to that one tool.
|
|
21
95
|
*/
|
|
22
|
-
type ApprovalKind = 'external_path' | 'shell_command' | 'url_fetch' | 'runner_tool';
|
|
96
|
+
type ApprovalKind = 'external_path' | 'shell_command' | 'url_fetch' | 'mcp_tool' | 'runner_tool';
|
|
23
97
|
interface ApprovalRequest {
|
|
24
98
|
kind: ApprovalKind;
|
|
25
99
|
/** The concrete thing being asked about: an absolute path, a command line, a URL. */
|
|
@@ -41,6 +115,14 @@ interface ApprovalRequest {
|
|
|
41
115
|
taskId?: string;
|
|
42
116
|
/** "Allow for this task" can be offered: the runner proposed its own session-scoped grant. */
|
|
43
117
|
allowForTask?: boolean;
|
|
118
|
+
/**
|
|
119
|
+
* The allowlist rule the command classifier found covering every part of a
|
|
120
|
+
* `shell_command` that asks (ADR-0026). It settles `scope`, never the
|
|
121
|
+
* outside directories in `scopes`.
|
|
122
|
+
*/
|
|
123
|
+
allowedBy?: string;
|
|
124
|
+
/** For `mcp_tool`: the tool's own name, without its server, which allowlist tool rules match. */
|
|
125
|
+
tool?: string;
|
|
44
126
|
}
|
|
45
127
|
/**
|
|
46
128
|
* An answer, from whoever gives it — a person on any surface, or later the
|
|
@@ -63,6 +145,8 @@ declare function approvalScopes(request: ApprovalRequest): string[];
|
|
|
63
145
|
declare function isRunnerApproval(request: ApprovalRequest): boolean;
|
|
64
146
|
interface IApproval {
|
|
65
147
|
request(req: ApprovalRequest): Promise<boolean>;
|
|
148
|
+
/** The standing approvals a command is classified against, when this approval has any (ADR-0026). */
|
|
149
|
+
allowlist?(): PlannerAllowlist;
|
|
66
150
|
}
|
|
67
151
|
/** Denies everything. The safe default when a surface wires no approval channel. */
|
|
68
152
|
declare const DENY_ALL: IApproval;
|
|
@@ -92,6 +176,9 @@ declare const listRunnersInput: z.ZodObject<{}, z.core.$strip>;
|
|
|
92
176
|
declare const listModelsInput: z.ZodObject<{
|
|
93
177
|
runner: z.ZodString;
|
|
94
178
|
}, z.core.$strip>;
|
|
179
|
+
declare const runCommandInput: z.ZodObject<{
|
|
180
|
+
command: z.ZodString;
|
|
181
|
+
}, z.core.$strip>;
|
|
95
182
|
declare const loadSkillInput: z.ZodObject<{
|
|
96
183
|
name: z.ZodString;
|
|
97
184
|
}, z.core.$strip>;
|
|
@@ -186,6 +273,7 @@ type CheckpointArgs = z.infer<typeof checkpointInput>;
|
|
|
186
273
|
type ListRunnersArgs = z.infer<typeof listRunnersInput>;
|
|
187
274
|
type ListModelsArgs = z.infer<typeof listModelsInput>;
|
|
188
275
|
type LoadSkillArgs = z.infer<typeof loadSkillInput>;
|
|
276
|
+
type RunCommandArgs = z.infer<typeof runCommandInput>;
|
|
189
277
|
type SubmitPlanArgs = z.infer<typeof submitPlanInput>;
|
|
190
278
|
type EditPlanArgs = z.infer<typeof editPlanInput>;
|
|
191
279
|
type TaskQueryArgs = z.infer<typeof taskQueryInput>;
|
|
@@ -220,6 +308,7 @@ interface TaskToolHandler {
|
|
|
220
308
|
}
|
|
221
309
|
interface PlannerToolHandler {
|
|
222
310
|
loadSkill?: Run<LoadSkillArgs>;
|
|
311
|
+
runCommand?: Run<RunCommandArgs>;
|
|
223
312
|
listRunners?: Run<ListRunnersArgs>;
|
|
224
313
|
listModels?: Run<ListModelsArgs>;
|
|
225
314
|
submitPlan?: Run<SubmitPlanArgs>;
|
|
@@ -400,15 +489,17 @@ type AgentEvent =
|
|
|
400
489
|
digest: string;
|
|
401
490
|
}
|
|
402
491
|
/**
|
|
403
|
-
* The agent asked to do something its mode does not cover.
|
|
404
|
-
*
|
|
405
|
-
*
|
|
406
|
-
*
|
|
492
|
+
* The agent asked to do something its mode does not cover. Without
|
|
493
|
+
* `decided` the request stays open until {@link AgentAdapter.answerPermission}:
|
|
494
|
+
* a task's for a person (ADR-0018, A1), a planner's for the planner's
|
|
495
|
+
* envelope (ADR-0026). An adapter that cannot hold a planner's request open
|
|
496
|
+
* denies it itself and says so in `decided`, so the turn does not hang.
|
|
407
497
|
*
|
|
408
498
|
* `input` and `suggestions` are the raw request; `suggestions` are the
|
|
409
499
|
* agent's own session-scoped grants, what "Allow for this task" answers with.
|
|
410
|
-
* `decided` marks a request
|
|
411
|
-
*
|
|
500
|
+
* `decided` marks a request already answered — by the adapter, as the
|
|
501
|
+
* manifest says the task's mode does, or as a denial — so it is shown, never asked.
|
|
502
|
+
* `ask` is what a planner's open request is for, in the envelope's terms.
|
|
412
503
|
*/
|
|
413
504
|
| {
|
|
414
505
|
type: 'permission_request';
|
|
@@ -419,6 +510,7 @@ type AgentEvent =
|
|
|
419
510
|
suggestions?: unknown[];
|
|
420
511
|
toolUseId?: string;
|
|
421
512
|
decided?: ApprovalDecision;
|
|
513
|
+
ask?: PlannerAsk;
|
|
422
514
|
}
|
|
423
515
|
/** The agent withdrew an open request — an interrupt cancels the call it was for. It takes no answer now. */
|
|
424
516
|
| {
|
|
@@ -468,6 +560,28 @@ type AgentEvent =
|
|
|
468
560
|
type: 'error';
|
|
469
561
|
message: string;
|
|
470
562
|
};
|
|
563
|
+
/**
|
|
564
|
+
* What a planner's permission request is for, read from the runner's own
|
|
565
|
+
* request by its adapter, so one envelope decides it whichever runner asked
|
|
566
|
+
* (ADR-0026). `other` is anything the envelope never grants a planner.
|
|
567
|
+
*/
|
|
568
|
+
type PlannerAsk =
|
|
569
|
+
/** `scope` is the tool's full name as the runner reports it; `tool` its own name, without the server. */
|
|
570
|
+
{
|
|
571
|
+
kind: 'mcp';
|
|
572
|
+
scope: string;
|
|
573
|
+
tool: string;
|
|
574
|
+
server?: string;
|
|
575
|
+
} | {
|
|
576
|
+
kind: 'fetch';
|
|
577
|
+
url: string;
|
|
578
|
+
} | {
|
|
579
|
+
kind: 'path';
|
|
580
|
+
path: string;
|
|
581
|
+
directory: boolean;
|
|
582
|
+
} | {
|
|
583
|
+
kind: 'other';
|
|
584
|
+
};
|
|
471
585
|
interface AgentStartCommon {
|
|
472
586
|
/** Workspace root. The agent works from here and, in read-only mode, cannot leave it. */
|
|
473
587
|
cwd: string;
|
|
@@ -556,6 +670,12 @@ interface AgentAdapter {
|
|
|
556
670
|
* adapter that cannot inject the server at all, which cannot run tasks.
|
|
557
671
|
*/
|
|
558
672
|
mcpAttached?(): Promise<boolean>;
|
|
673
|
+
/**
|
|
674
|
+
* Answer an open `permission_request`. False when the id is not open — it
|
|
675
|
+
* was answered, cancelled, or never asked. Absent on an adapter that leaves
|
|
676
|
+
* no planner request open.
|
|
677
|
+
*/
|
|
678
|
+
answerPermission?(id: string, decision: ApprovalDecision): boolean;
|
|
559
679
|
}
|
|
560
680
|
/** What an adapter adds to run a task rather than a planner (ADR-0018). */
|
|
561
681
|
interface TaskModeAgentAdapter extends AgentAdapter {
|
|
@@ -586,10 +706,6 @@ interface TaskModeAgentAdapter extends AgentAdapter {
|
|
|
586
706
|
* mid-turn.
|
|
587
707
|
*/
|
|
588
708
|
steer?(id: string, text: string): Promise<boolean>;
|
|
589
|
-
/**
|
|
590
|
-
* Answer an open `permission_request`. False when the id is not open — it
|
|
591
|
-
* was answered, cancelled, or never asked.
|
|
592
|
-
*/
|
|
593
709
|
answerPermission(id: string, decision: ApprovalDecision): boolean;
|
|
594
710
|
}
|
|
595
711
|
type SpawnFn = (command: string, args: string[], options: {
|
|
@@ -755,23 +871,35 @@ interface RunnerEntry {
|
|
|
755
871
|
*
|
|
756
872
|
* Grants are keyed on {@link ApprovalRequest.scope}, never on the concrete
|
|
757
873
|
* subject: approving a read of `/tmp/foo/a.log` grants `/tmp/foo/*`, and
|
|
758
|
-
* approving `az group list` grants `az group`. Without that, a planner
|
|
759
|
-
* real research would prompt on every single call and the feature would
|
|
760
|
-
* unusable.
|
|
874
|
+
* approving `az group list` grants `az group list`. Without that, a planner
|
|
875
|
+
* doing real research would prompt on every single call and the feature would
|
|
876
|
+
* be unusable.
|
|
761
877
|
*
|
|
762
878
|
* `mode` is the policy floor:
|
|
763
879
|
* ask consult the human channel; no channel means deny (headless, web)
|
|
764
880
|
* allow grant everything the tier system did not already refuse
|
|
765
|
-
* deny grant nothing beyond `preApproved`
|
|
881
|
+
* deny grant nothing beyond `preApproved` — the allowlist-only mode
|
|
766
882
|
*
|
|
767
883
|
* Note the ordering: `preApproved` is honored under every mode including
|
|
768
884
|
* `deny`, because it is an explicit operator decision rather than a default.
|
|
885
|
+
* Its entries are allowlist rules (see `plannerAllowlist.ts`), and both it and
|
|
886
|
+
* `mode` may be read afresh on every request, so a settings change applies to
|
|
887
|
+
* the next call.
|
|
769
888
|
*/
|
|
770
889
|
type ApprovalMode = 'ask' | 'allow' | 'deny';
|
|
890
|
+
/**
|
|
891
|
+
* The configured mode. `auto` follows the autonomy level (ADR-0026): Guarded
|
|
892
|
+
* asks, Full runs the allowlist alone and asks nobody, so a planner in Full
|
|
893
|
+
* never waits on a person and never acts outside its standing approvals.
|
|
894
|
+
*/
|
|
895
|
+
type ApprovalModeSetting = ApprovalMode | 'auto';
|
|
896
|
+
declare function effectiveApprovalMode(setting: ApprovalModeSetting, autonomous: boolean): ApprovalMode;
|
|
897
|
+
/** A configured mode as written: `allowlist` is the user-facing name of `deny`, and anything unknown is `auto`. */
|
|
898
|
+
declare function parseApprovalModeSetting(raw: string | undefined): ApprovalModeSetting;
|
|
771
899
|
interface ApprovalPolicyOptions {
|
|
772
|
-
mode?: ApprovalMode;
|
|
773
|
-
/**
|
|
774
|
-
preApproved?: string[];
|
|
900
|
+
mode?: ApprovalMode | (() => ApprovalMode);
|
|
901
|
+
/** Allowlist entries granted up front from config (ADR-0026). */
|
|
902
|
+
preApproved?: readonly string[] | (() => readonly string[]);
|
|
775
903
|
/** The human channel. Absent means there is nobody to ask. */
|
|
776
904
|
ask?: (req: ApprovalRequest) => Promise<boolean>;
|
|
777
905
|
/** Called whenever a decision is reached, for surfacing in a UI or a log. */
|
|
@@ -779,8 +907,9 @@ interface ApprovalPolicyOptions {
|
|
|
779
907
|
}
|
|
780
908
|
type ApprovalSource = 'pre-approved' | 'remembered' | 'mode' | 'asked' | 'no-channel';
|
|
781
909
|
declare class ApprovalPolicy implements IApproval {
|
|
782
|
-
private readonly
|
|
783
|
-
private readonly
|
|
910
|
+
private readonly modeOf;
|
|
911
|
+
private readonly entriesOf;
|
|
912
|
+
private parsed;
|
|
784
913
|
private readonly asker?;
|
|
785
914
|
private readonly onDecision?;
|
|
786
915
|
private readonly granted;
|
|
@@ -790,6 +919,8 @@ declare class ApprovalPolicy implements IApproval {
|
|
|
790
919
|
private generation;
|
|
791
920
|
constructor(opts?: ApprovalPolicyOptions);
|
|
792
921
|
request(req: ApprovalRequest): Promise<boolean>;
|
|
922
|
+
/** The standing approvals, parsed from the entries in force now. */
|
|
923
|
+
allowlist(): PlannerAllowlist;
|
|
793
924
|
/** Scopes the user has granted this session — for display and for persistence. */
|
|
794
925
|
grantedScopes(): string[];
|
|
795
926
|
/** Drop every session-scoped decision. Called on session reset. */
|
|
@@ -961,13 +1092,16 @@ interface IConfig {
|
|
|
961
1092
|
conflictRepairAttempts: number;
|
|
962
1093
|
/**
|
|
963
1094
|
* What to do when planner research reaches outside its default envelope — an
|
|
964
|
-
* out-of-workspace path,
|
|
965
|
-
* set. `ask` prompts the user (and denies where no surface can
|
|
966
|
-
* headless runs); `allow` and `deny` skip the prompt
|
|
1095
|
+
* out-of-workspace path, a shell command beyond the auto-allowed read-only
|
|
1096
|
+
* set, an MCP tool. `ask` prompts the user (and denies where no surface can
|
|
1097
|
+
* prompt, such as headless runs); `allow` and `deny` skip the prompt
|
|
1098
|
+
* entirely; `auto` follows {@link autonomousMode} (ADR-0026).
|
|
967
1099
|
*/
|
|
968
|
-
approvalMode:
|
|
969
|
-
/**
|
|
1100
|
+
approvalMode: ApprovalModeSetting;
|
|
1101
|
+
/** Allowlist entries granted up front, beside the defaults (ADR-0026, `plannerAllowlist.ts`). */
|
|
970
1102
|
approvalPreApproved: string[];
|
|
1103
|
+
/** Whether the built-in allowlist of read-only command families and MCP tools applies. */
|
|
1104
|
+
approvalDefaults: boolean;
|
|
971
1105
|
/** Get the base URL for an OpenAI-compatible provider. */
|
|
972
1106
|
getProviderBaseUrl(provider: AiProvider): string;
|
|
973
1107
|
/** Get the API key for a provider. */
|
|
@@ -1162,4 +1296,4 @@ interface IRunner {
|
|
|
1162
1296
|
activeCount: number;
|
|
1163
1297
|
}
|
|
1164
1298
|
|
|
1165
|
-
export { type
|
|
1299
|
+
export { type ProviderModelsResult as $, type AgentAdapter as A, type McpCredential as B, type CatalogModel as C, DEFAULT_PLANNER_ALLOWLIST as D, type EditPlanArgs as E, type FetchAllProviderModelsOptions as F, type McpTool as G, type McpToolContext as H, type IApproval as I, type McpToolReply as J, ModelCatalog as K, LineBuffer as L, type McpClientConfig as M, type ModelShortcut as N, ORCHESTRATOR_SHORTCUTS as O, ORDEWELL_MCP_PATH as P, ORDEWELL_MCP_SERVER_NAME as Q, type OrchestratorOption as R, OrdewellMcpServer as S, type OwnerOnlyFile as T, PLANNER_TOOLS as U, type PlannerAllowlist as V, type PlannerStartOptions as W, type PlannerTokenScope as X, type PlannerToolHandler as Y, type ProviderCredentialSource as Z, type ProviderModelLists as _, type AgentAdapterFactory as a, type QueuedTaskMessage as a0, type RunCommandArgs as a1, type RunnerEntry as a2, type RunnerFeatures as a3, type RunnerManifest as a4, type RunnerMode as a5, type RunnerModelDiscovery as a6, RunnerRegistry as a7, type SpawnFn as a8, type StructuredEvent as a9, resolveModelShortcut as aA, resolveProvider as aB, scopeAllowed as aC, sharedMcpServer as aD, toApprovalDecision as aE, toOrchestratorOptions as aF, toolAllowed as aG, type StructuredTurnEnd as aa, type SubmitPlanArgs as ab, TASK_COMPLETE_TOOL as ac, TASK_TOOLS as ad, type TaskCompleteArgs as ae, type TaskModeAgentAdapter as af, TaskModeUnsupportedError as ag, type TaskOutputArgs as ah, type TaskQueryArgs as ai, type TaskRunnerFlags as aj, type TaskStartOptions as ak, type TaskTokenScope as al, type TaskToolHandler as am, approvalScopes as an, collectProviderCredentials as ao, commandAllowedBy as ap, effectiveApprovalMode as aq, enabledRunners as ar, fetchAllProviderModels as as, isGranted as at, isRunnerApproval as au, knownModelId as av, mcpClientConfig as aw, ownerOnlyConfigFile as ax, parseAllowlist as ay, parseApprovalModeSetting as az, type AgentEvent as b, type AgentProcessDeps as c, type AgentStartOptions as d, type AiProvider as e, type AllProviderModels as f, type ApprovalAnswer as g, type ApprovalDecision as h, type ApprovalKind as i, type ApprovalMode as j, type ApprovalModeSetting as k, ApprovalPolicy as l, type ApprovalPolicyOptions as m, type ApprovalRequest as n, type ApprovalSource as o, type CheckpointAnswer as p, type CheckpointArgs as q, type CommandWords as r, DENY_ALL as s, type DiscoveryCommand as t, type IConfig as u, type IRunner as v, type IRunnerSession as w, type ListModelsArgs as x, type ListRunnersArgs as y, type LoadSkillArgs as z };
|
|
@@ -86,14 +86,17 @@ var KNOWN_TOOLS = {
|
|
|
86
86
|
local_shell: "bash",
|
|
87
87
|
// OpenCode
|
|
88
88
|
list: "list_dir",
|
|
89
|
-
fetch: "fetch"
|
|
89
|
+
fetch: "fetch",
|
|
90
|
+
// Ordewell's own research shell (ADR-0026), under every runner's name for it
|
|
91
|
+
runcommand: "bash"
|
|
90
92
|
};
|
|
93
|
+
var ORDEWELL_TOOL_PREFIX = /^(mcp__ordewell__|ordewell_)/i;
|
|
91
94
|
var FILE_EDIT_TOOLS = /* @__PURE__ */ new Set(["edit", "write", "multiedit", "notebookedit", "applypatch", "patch", "add", "update", "delete", "filechange"]);
|
|
92
95
|
function isFileEditTool(name) {
|
|
93
96
|
return FILE_EDIT_TOOLS.has(name.trim().toLowerCase().replace(/[_-]/g, ""));
|
|
94
97
|
}
|
|
95
98
|
function mapAgentTool(name) {
|
|
96
|
-
const normalized = name.trim().toLowerCase().replace(/[_-]/g, "");
|
|
99
|
+
const normalized = name.trim().replace(ORDEWELL_TOOL_PREFIX, "").toLowerCase().replace(/[_-]/g, "");
|
|
97
100
|
const direct = KNOWN_TOOLS[normalized] ?? KNOWN_TOOLS[name.trim().toLowerCase()];
|
|
98
101
|
if (direct) {
|
|
99
102
|
return { tool: direct, toolLabel: name };
|
|
@@ -2248,4 +2251,4 @@ export {
|
|
|
2248
2251
|
pastGateConfirmation,
|
|
2249
2252
|
newTaskFields
|
|
2250
2253
|
};
|
|
2251
|
-
//# sourceMappingURL=chunk-
|
|
2254
|
+
//# sourceMappingURL=chunk-QUARDKVT.mjs.map
|