@detergent-software/atk 9.1.0-dev.3 → 9.1.0-dev.5
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/CHANGELOG.md +17 -0
- package/build/command-manifest.json +20 -0
- package/build/commands/deprecate.d.ts.map +1 -1
- package/build/commands/deprecate.js +2 -12
- package/build/commands/deprecate.js.map +1 -1
- package/build/commands/init.d.ts +3 -1
- package/build/commands/init.d.ts.map +1 -1
- package/build/commands/init.js +41 -4
- package/build/commands/init.js.map +1 -1
- package/build/commands/promote.d.ts +2 -1
- package/build/commands/promote.d.ts.map +1 -1
- package/build/commands/promote.js +35 -16
- package/build/commands/promote.js.map +1 -1
- package/build/commands/unpublish.d.ts +2 -1
- package/build/commands/unpublish.d.ts.map +1 -1
- package/build/commands/unpublish.js +35 -16
- package/build/commands/unpublish.js.map +1 -1
- package/build/hooks/useInitState.d.ts +2 -0
- package/build/hooks/useInitState.d.ts.map +1 -1
- package/build/hooks/useInitState.js +56 -14
- package/build/hooks/useInitState.js.map +1 -1
- package/build/lib/init.d.ts +4 -0
- package/build/lib/init.d.ts.map +1 -1
- package/build/lib/init.js +4 -1
- package/build/lib/init.js.map +1 -1
- package/build/lib/output.d.ts +13 -0
- package/build/lib/output.d.ts.map +1 -1
- package/build/lib/output.js +13 -3
- package/build/lib/output.js.map +1 -1
- package/build/lib/registry-change-json.d.ts +32 -0
- package/build/lib/registry-change-json.d.ts.map +1 -0
- package/build/lib/registry-change-json.js +32 -0
- package/build/lib/registry-change-json.js.map +1 -0
- package/build/lib/tool-resolver.d.ts +1 -1
- package/build/lib/tool-resolver.d.ts.map +1 -1
- package/build/lib/tool-resolver.js +18 -11
- package/build/lib/tool-resolver.js.map +1 -1
- package/package.json +1 -1
package/build/lib/output.d.ts
CHANGED
|
@@ -5,6 +5,19 @@ export interface NonInteractiveState {
|
|
|
5
5
|
}
|
|
6
6
|
/** Minimum width of the {@link renderJson} Box; wider when the JSON has longer lines. */
|
|
7
7
|
export declare const MIN_JSON_WIDTH = 9999;
|
|
8
|
+
/** The `--json` error payload for a command state that keeps its error as `error*` fields. */
|
|
9
|
+
export declare function errorStateJson(state: {
|
|
10
|
+
errorCode?: string;
|
|
11
|
+
errorCommand?: string;
|
|
12
|
+
errorHint?: string;
|
|
13
|
+
errorMessage: string;
|
|
14
|
+
}): {
|
|
15
|
+
message: string;
|
|
16
|
+
outcome: string;
|
|
17
|
+
hint?: string | undefined;
|
|
18
|
+
command?: string | undefined;
|
|
19
|
+
code?: string | undefined;
|
|
20
|
+
};
|
|
8
21
|
/**
|
|
9
22
|
* Renders an arbitrary value as pretty-printed JSON wrapped in a Box wide
|
|
10
23
|
* enough that Ink never soft-wraps a line (a wrap inside a string literal
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../src/lib/output.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAW1C,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,OAAO,CAAC;CACf;AAMD,yFAAyF;AACzF,eAAO,MAAM,cAAc,OAAO,CAAC;AAEnC;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,YAAY,CAQvD;
|
|
1
|
+
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../src/lib/output.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAW1C,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,OAAO,CAAC;CACf;AAMD,yFAAyF;AACzF,eAAO,MAAM,cAAc,OAAO,CAAC;AAEnC,8FAA8F;AAC9F,wBAAgB,cAAc,CAAC,KAAK,EAAE;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;CACtB;;;;;;EAQA;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,YAAY,CAQvD;AAMD;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,OAAO,GAAG,mBAAmB,CAMxE"}
|
package/build/lib/output.js
CHANGED
|
@@ -7,6 +7,16 @@ import { getNotices, toJsonNotice } from './notices.js';
|
|
|
7
7
|
// ---------------------------------------------------------------------------
|
|
8
8
|
/** Minimum width of the {@link renderJson} Box; wider when the JSON has longer lines. */
|
|
9
9
|
export const MIN_JSON_WIDTH = 9999;
|
|
10
|
+
/** The `--json` error payload for a command state that keeps its error as `error*` fields. */
|
|
11
|
+
export function errorStateJson(state) {
|
|
12
|
+
return {
|
|
13
|
+
...(state.errorCode ? { code: state.errorCode } : {}),
|
|
14
|
+
...(state.errorCommand ? { command: state.errorCommand } : {}),
|
|
15
|
+
...(state.errorHint ? { hint: state.errorHint } : {}),
|
|
16
|
+
message: state.errorMessage,
|
|
17
|
+
outcome: 'error',
|
|
18
|
+
};
|
|
19
|
+
}
|
|
10
20
|
/**
|
|
11
21
|
* Renders an arbitrary value as pretty-printed JSON wrapped in a Box wide
|
|
12
22
|
* enough that Ink never soft-wraps a line (a wrap inside a string literal
|
|
@@ -23,6 +33,9 @@ export function renderJson(value) {
|
|
|
23
33
|
const longest = text.split('\n').reduce((max, line) => Math.max(max, line.length), 0);
|
|
24
34
|
return (_jsx(Box, { width: Math.max(MIN_JSON_WIDTH, longest * 2 + 1), children: _jsx(Text, { children: text }) }));
|
|
25
35
|
}
|
|
36
|
+
// ---------------------------------------------------------------------------
|
|
37
|
+
// Render helpers
|
|
38
|
+
// ---------------------------------------------------------------------------
|
|
26
39
|
/**
|
|
27
40
|
* Returns the JSON / TTY decision shared across every command.
|
|
28
41
|
*
|
|
@@ -40,9 +53,6 @@ export function useNonInteractive(jsonFlag) {
|
|
|
40
53
|
json: jsonFlag || !isRawModeSupported,
|
|
41
54
|
};
|
|
42
55
|
}
|
|
43
|
-
// ---------------------------------------------------------------------------
|
|
44
|
-
// Render helpers
|
|
45
|
-
// ---------------------------------------------------------------------------
|
|
46
56
|
function withNotices(value) {
|
|
47
57
|
const notices = getNotices();
|
|
48
58
|
const plainObject = typeof value === 'object' && value !== null && Object.getPrototypeOf(value) === Object.prototype;
|
package/build/lib/output.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output.js","sourceRoot":"","sources":["../../src/lib/output.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAC1C,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAWxD,8EAA8E;AAC9E,OAAO;AACP,8EAA8E;AAE9E,yFAAyF;AACzF,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,CAAC;AAEnC;;;;;;;;;;GAUG;AACH,MAAM,UAAU,UAAU,CAAC,KAAc;IACvC,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,MAAM,CAAC;IACnE,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;IACtF,OAAO,CACL,KAAC,GAAG,IAAC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,cAAc,EAAE,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC,YACnD,KAAC,IAAI,cAAE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+
import type { RegistryChangePlan, RegistryChangeReceipt } from './atk-api/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* The `--json` shapes `unpublish`, `promote` and `deprecate` share: `opened` is the same for all
|
|
4
|
+
* three; `dry-run` is the unpublish/promote plan (deprecate's plan has its own).
|
|
5
|
+
*/
|
|
6
|
+
export declare function registryChangeOpenedJson(name: string, org: string | undefined, result: RegistryChangeReceipt): {
|
|
7
|
+
outcome: string;
|
|
8
|
+
prNumber: number;
|
|
9
|
+
prUrl: string;
|
|
10
|
+
warnings: readonly string[];
|
|
11
|
+
org?: string | undefined;
|
|
12
|
+
branchName: string;
|
|
13
|
+
name: string;
|
|
14
|
+
};
|
|
15
|
+
/** The plan without its PR body, which is for the registry's reviewers. */
|
|
16
|
+
export declare function registryChangePlanJson(plan: RegistryChangePlan): {
|
|
17
|
+
outcome: string;
|
|
18
|
+
prTitle: string;
|
|
19
|
+
versions: readonly string[];
|
|
20
|
+
warnings: readonly string[];
|
|
21
|
+
org?: string | undefined;
|
|
22
|
+
branchName: string;
|
|
23
|
+
changes: readonly {
|
|
24
|
+
readonly from: string;
|
|
25
|
+
readonly to?: string;
|
|
26
|
+
}[];
|
|
27
|
+
kind: "bundle" | "asset";
|
|
28
|
+
name: string;
|
|
29
|
+
assetType?: "skill" | "agent" | "rule" | "hook" | "memory-template" | "mcp-config" | undefined;
|
|
30
|
+
action: "promote" | "unpublish";
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=registry-change-json.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry-change-json.d.ts","sourceRoot":"","sources":["../../src/lib/registry-change-json.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAEpF;;;GAGG;AAEH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,SAAS,EAAE,MAAM,EAAE,qBAAqB;;;;;;;;EAU5G;AAED,2EAA2E;AAC3E,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,kBAAkB;;;;;;;;;;;;;;;EAc9D"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `--json` shapes `unpublish`, `promote` and `deprecate` share: `opened` is the same for all
|
|
3
|
+
* three; `dry-run` is the unpublish/promote plan (deprecate's plan has its own).
|
|
4
|
+
*/
|
|
5
|
+
export function registryChangeOpenedJson(name, org, result) {
|
|
6
|
+
return {
|
|
7
|
+
branchName: result.branchName,
|
|
8
|
+
name,
|
|
9
|
+
...(org ? { org } : {}),
|
|
10
|
+
outcome: 'opened',
|
|
11
|
+
prNumber: result.prNumber,
|
|
12
|
+
prUrl: result.prUrl,
|
|
13
|
+
warnings: result.warnings,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
/** The plan without its PR body, which is for the registry's reviewers. */
|
|
17
|
+
export function registryChangePlanJson(plan) {
|
|
18
|
+
return {
|
|
19
|
+
action: plan.action,
|
|
20
|
+
...(plan.assetType ? { assetType: plan.assetType } : {}),
|
|
21
|
+
branchName: plan.branchName,
|
|
22
|
+
changes: plan.changes,
|
|
23
|
+
kind: plan.kind,
|
|
24
|
+
name: plan.name,
|
|
25
|
+
...(plan.org ? { org: plan.org } : {}),
|
|
26
|
+
outcome: 'dry-run',
|
|
27
|
+
prTitle: plan.prTitle,
|
|
28
|
+
versions: plan.versions,
|
|
29
|
+
warnings: plan.warnings,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=registry-change-json.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry-change-json.js","sourceRoot":"","sources":["../../src/lib/registry-change-json.ts"],"names":[],"mappings":"AAEA;;;GAGG;AAEH,MAAM,UAAU,wBAAwB,CAAC,IAAY,EAAE,GAAuB,EAAE,MAA6B;IAC3G,OAAO;QACL,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,IAAI;QACJ,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACvB,OAAO,EAAE,QAAQ;QACjB,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,QAAQ,EAAE,MAAM,CAAC,QAAQ;KAC1B,CAAC;AACJ,CAAC;AAED,2EAA2E;AAC3E,MAAM,UAAU,sBAAsB,CAAC,IAAwB;IAC7D,OAAO;QACL,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACxD,UAAU,EAAE,IAAI,CAAC,UAAU;QAC3B,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACtC,OAAO,EAAE,SAAS;QAClB,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ;KACxB,CAAC;AACJ,CAAC"}
|
|
@@ -26,7 +26,7 @@ export declare function resolveTool(toolOption?: string, projectDir?: string): P
|
|
|
26
26
|
* Resolve targeted tool names without loading adapter JSON.
|
|
27
27
|
*
|
|
28
28
|
* Resolution order:
|
|
29
|
-
* 1. Explicit `--tool` CLI flag → returns `[toolOption]
|
|
29
|
+
* 1. Explicit `--tool` CLI flag → returns `[toolOption]`, lowercased, immediately
|
|
30
30
|
* 2. The scope config's `tools` array (the project's `.atkrc.json`, or the user scope's config
|
|
31
31
|
* when `projectDir` is the user root) → returns the array as-is
|
|
32
32
|
* 3. Error directing user to run `atk setup`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-resolver.d.ts","sourceRoot":"","sources":["../../src/lib/tool-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAGpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAIjD,4FAA4F;AAC5F,wBAAsB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAM5E;AAED;;;;GAIG;AACH,wBAAsB,mBAAmB,CACvC,UAAU,CAAC,EAAE,MAAM,EACnB,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,KAAK,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"tool-resolver.d.ts","sourceRoot":"","sources":["../../src/lib/tool-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAGpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAIjD,4FAA4F;AAC5F,wBAAsB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAM5E;AAED;;;;GAIG;AACH,wBAAsB,mBAAmB,CACvC,UAAU,CAAC,EAAE,MAAM,EACnB,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,KAAK,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,CAYpD;AAED;;;;;;GAMG;AACH,wBAAsB,WAAW,CAC/B,UAAU,CAAC,EAAE,MAAM,EACnB,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAG7C;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,gBAAgB,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAelG;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,YAAY,CAChC,UAAU,CAAC,EAAE,MAAM,EACnB,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,KAAK,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,CA2BpD"}
|
|
@@ -17,15 +17,16 @@ export async function noToolsError(root) {
|
|
|
17
17
|
*/
|
|
18
18
|
export async function resolvePlacingTools(toolOption, projectDir) {
|
|
19
19
|
const resolvedDir = projectDir ?? findProjectRoot();
|
|
20
|
-
|
|
20
|
+
const tool = toolId(toolOption);
|
|
21
|
+
if (tool) {
|
|
21
22
|
// An unknown tool gets the adapter's own error, not advice to set it up.
|
|
22
|
-
await loadAdapter(
|
|
23
|
+
await loadAdapter(tool, resolvedDir);
|
|
23
24
|
const configured = (await loadScopeConfig(resolvedDir))?.tools ?? [];
|
|
24
|
-
if (configured.length > 0 && !configured.includes(
|
|
25
|
-
throw await unconfiguredToolError(
|
|
25
|
+
if (configured.length > 0 && !configured.includes(tool)) {
|
|
26
|
+
throw await unconfiguredToolError(tool, configured, resolvedDir);
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
|
-
return resolveTools(
|
|
29
|
+
return resolveTools(tool, resolvedDir);
|
|
29
30
|
}
|
|
30
31
|
/**
|
|
31
32
|
* Resolve a single tool to target, returning both the resolved tool name and its adapter config.
|
|
@@ -42,7 +43,7 @@ export async function resolveTool(toolOption, projectDir) {
|
|
|
42
43
|
* Resolve targeted tool names without loading adapter JSON.
|
|
43
44
|
*
|
|
44
45
|
* Resolution order:
|
|
45
|
-
* 1. Explicit `--tool` CLI flag → returns `[toolOption]
|
|
46
|
+
* 1. Explicit `--tool` CLI flag → returns `[toolOption]`, lowercased, immediately
|
|
46
47
|
* 2. The scope config's `tools` array (the project's `.atkrc.json`, or the user scope's config
|
|
47
48
|
* when `projectDir` is the user root) → returns the array as-is
|
|
48
49
|
* 3. Error directing user to run `atk setup`
|
|
@@ -51,8 +52,9 @@ export async function resolveTool(toolOption, projectDir) {
|
|
|
51
52
|
* need the tool name strings and do not need the full adapter definitions.
|
|
52
53
|
*/
|
|
53
54
|
export async function resolveToolNames(toolOption, projectDir) {
|
|
54
|
-
|
|
55
|
-
|
|
55
|
+
const tool = toolId(toolOption);
|
|
56
|
+
if (tool) {
|
|
57
|
+
return [tool];
|
|
56
58
|
}
|
|
57
59
|
const resolvedDir = projectDir ?? findProjectRoot();
|
|
58
60
|
const projectConfig = await loadScopeConfig(resolvedDir);
|
|
@@ -79,9 +81,10 @@ export async function resolveTools(toolOption, projectDir) {
|
|
|
79
81
|
// At the user root, each adapter places with its user placements.
|
|
80
82
|
const scope = (await isUserRoot(resolvedDir)) ? 'user' : 'project';
|
|
81
83
|
// When --tool flag is provided, return only that single tool
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
84
|
+
const tool = toolId(toolOption);
|
|
85
|
+
if (tool) {
|
|
86
|
+
const adapter = adapterForScope(await loadAdapter(tool, resolvedDir), scope, resolvedDir);
|
|
87
|
+
return [{ adapter, tool }];
|
|
85
88
|
}
|
|
86
89
|
// Read all tools from the scope config
|
|
87
90
|
const projectConfig = await loadScopeConfig(resolvedDir);
|
|
@@ -96,6 +99,10 @@ export async function resolveTools(toolOption, projectDir) {
|
|
|
96
99
|
}
|
|
97
100
|
return results;
|
|
98
101
|
}
|
|
102
|
+
/** The tool id in `--tool`, lowercased (tool ids are), so every OS loads the same adapter file. */
|
|
103
|
+
function toolId(toolOption) {
|
|
104
|
+
return toolOption?.toLowerCase();
|
|
105
|
+
}
|
|
99
106
|
/** The refusal of a `--tool` that the scope at `root`, set up for `configured`, doesn't have. */
|
|
100
107
|
async function unconfiguredToolError(tool, configured, root) {
|
|
101
108
|
const { command, user } = await setupGuidance(root);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-resolver.js","sourceRoot":"","sources":["../../src/lib/tool-resolver.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAExE,4FAA4F;AAC5F,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,IAAY;IAC7C,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,MAAM,aAAa,CAAC,IAAI,CAAC,CAAC;IACpD,OAAO,IAAI,kBAAkB,CAAC,8BAA8B,OAAO,mCAAmC,EAAE;QACtG,OAAO;QACP,IAAI;KACL,CAAC,CAAC;AACL,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,UAAmB,EACnB,UAAmB;IAEnB,MAAM,WAAW,GAAG,UAAU,IAAI,eAAe,EAAE,CAAC;IACpD,IAAI,UAAU,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"tool-resolver.js","sourceRoot":"","sources":["../../src/lib/tool-resolver.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAExE,4FAA4F;AAC5F,MAAM,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