terminal-pilot 0.0.20 → 0.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +544 -259
- package/dist/cli.js.map +4 -4
- package/dist/commands/close-session.js.map +1 -1
- package/dist/commands/create-session.js.map +1 -1
- package/dist/commands/fill.js.map +1 -1
- package/dist/commands/get-session.js.map +1 -1
- package/dist/commands/index.js +220 -126
- package/dist/commands/index.js.map +4 -4
- package/dist/commands/install.js +187 -93
- package/dist/commands/install.js.map +4 -4
- package/dist/commands/installer.js +154 -60
- package/dist/commands/installer.js.map +4 -4
- package/dist/commands/list-sessions.js.map +1 -1
- package/dist/commands/press-key.js.map +1 -1
- package/dist/commands/read-history.js.map +1 -1
- package/dist/commands/read-screen.js.map +1 -1
- package/dist/commands/resize.js.map +1 -1
- package/dist/commands/runtime.js.map +1 -1
- package/dist/commands/screenshot.js.map +1 -1
- package/dist/commands/send-signal.js.map +1 -1
- package/dist/commands/type.js.map +1 -1
- package/dist/commands/uninstall.js +187 -93
- package/dist/commands/uninstall.js.map +4 -4
- package/dist/commands/wait-for-exit.js.map +1 -1
- package/dist/commands/wait-for.js.map +1 -1
- package/dist/testing/cli-repl.js +544 -259
- package/dist/testing/cli-repl.js.map +4 -4
- package/dist/testing/qa-cli.js +544 -259
- package/dist/testing/qa-cli.js.map +4 -4
- package/package.json +2 -1
package/dist/commands/index.js
CHANGED
|
@@ -16,19 +16,19 @@ var ToolcraftBugError = class extends Error {
|
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
// ../toolcraft/src/human-in-loop/config.ts
|
|
19
|
-
function validateHumanInLoopOnDefine(
|
|
20
|
-
const label = Array.isArray(
|
|
21
|
-
if (
|
|
22
|
-
throw new Error(`${label} '${
|
|
19
|
+
function validateHumanInLoopOnDefine(config2) {
|
|
20
|
+
const label = Array.isArray(config2.children) ? "group" : "command";
|
|
21
|
+
if (config2.confirm === true && config2.humanInLoop !== void 0 && config2.humanInLoop !== null) {
|
|
22
|
+
throw new Error(`${label} '${config2.name}': use either confirm or humanInLoop, not both`);
|
|
23
23
|
}
|
|
24
|
-
if (
|
|
24
|
+
if (config2.humanInLoop === void 0 || config2.humanInLoop === null) {
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
27
|
-
if (
|
|
28
|
-
throw new Error(`${label} '${
|
|
27
|
+
if (config2.humanInLoop.mode !== "sync" && config2.humanInLoop.mode !== "async") {
|
|
28
|
+
throw new Error(`${label} '${config2.name}': humanInLoop.mode must be "sync" or "async"`);
|
|
29
29
|
}
|
|
30
|
-
if (typeof
|
|
31
|
-
throw new Error(`${label} '${
|
|
30
|
+
if (typeof config2.humanInLoop.message !== "function") {
|
|
31
|
+
throw new Error(`${label} '${config2.name}': humanInLoop.message must be a function`);
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
function mergeHumanInLoopFromGroup(groupHumanInLoop, childHumanInLoop) {
|
|
@@ -58,12 +58,12 @@ function assertValidBranches(branches, discriminator) {
|
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
-
function OneOf(
|
|
62
|
-
assertValidBranches(
|
|
61
|
+
function OneOf(config2) {
|
|
62
|
+
assertValidBranches(config2.branches, config2.discriminator);
|
|
63
63
|
return {
|
|
64
64
|
kind: "oneOf",
|
|
65
|
-
discriminator:
|
|
66
|
-
branches:
|
|
65
|
+
discriminator: config2.discriminator,
|
|
66
|
+
branches: config2.branches
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
69
|
|
|
@@ -262,22 +262,22 @@ function cloneStringArray(values) {
|
|
|
262
262
|
function cloneStringRecord(values) {
|
|
263
263
|
return values === void 0 ? void 0 : { ...values };
|
|
264
264
|
}
|
|
265
|
-
function cloneMcpServerConfig(
|
|
266
|
-
if (
|
|
265
|
+
function cloneMcpServerConfig(config2) {
|
|
266
|
+
if (config2 === void 0) {
|
|
267
267
|
return void 0;
|
|
268
268
|
}
|
|
269
|
-
if (
|
|
269
|
+
if (config2.transport === "stdio") {
|
|
270
270
|
return {
|
|
271
271
|
transport: "stdio",
|
|
272
|
-
command:
|
|
273
|
-
args: cloneStringArray(
|
|
274
|
-
env: cloneStringRecord(
|
|
272
|
+
command: config2.command,
|
|
273
|
+
args: cloneStringArray(config2.args),
|
|
274
|
+
env: cloneStringRecord(config2.env)
|
|
275
275
|
};
|
|
276
276
|
}
|
|
277
277
|
return {
|
|
278
278
|
transport: "http",
|
|
279
|
-
url:
|
|
280
|
-
headers: cloneStringRecord(
|
|
279
|
+
url: config2.url,
|
|
280
|
+
headers: cloneStringRecord(config2.headers)
|
|
281
281
|
};
|
|
282
282
|
}
|
|
283
283
|
function cloneRenameMap(rename2) {
|
|
@@ -399,57 +399,57 @@ function resolveCommandScope(ownScope, inheritedScope) {
|
|
|
399
399
|
function resolveGroupScope(ownScope, inheritedScope) {
|
|
400
400
|
return cloneScope(ownScope ?? inheritedScope);
|
|
401
401
|
}
|
|
402
|
-
function createBaseCommand(
|
|
402
|
+
function createBaseCommand(config2) {
|
|
403
403
|
const command = {
|
|
404
404
|
kind: "command",
|
|
405
|
-
name:
|
|
406
|
-
description:
|
|
407
|
-
aliases: [...
|
|
408
|
-
positional: [...
|
|
409
|
-
params:
|
|
410
|
-
secrets: cloneSecrets(
|
|
411
|
-
scope: resolveCommandScope(
|
|
412
|
-
confirm:
|
|
413
|
-
humanInLoop:
|
|
414
|
-
requires: cloneRequires(
|
|
415
|
-
handler:
|
|
416
|
-
render:
|
|
405
|
+
name: config2.name,
|
|
406
|
+
description: config2.description,
|
|
407
|
+
aliases: [...config2.aliases ?? []],
|
|
408
|
+
positional: [...config2.positional ?? []],
|
|
409
|
+
params: config2.params,
|
|
410
|
+
secrets: cloneSecrets(config2.secrets),
|
|
411
|
+
scope: resolveCommandScope(config2.scope, void 0),
|
|
412
|
+
confirm: config2.confirm ?? false,
|
|
413
|
+
humanInLoop: config2.humanInLoop,
|
|
414
|
+
requires: cloneRequires(config2.requires),
|
|
415
|
+
handler: config2.handler,
|
|
416
|
+
render: config2.render
|
|
417
417
|
};
|
|
418
418
|
Object.defineProperty(command, commandConfigSymbol, {
|
|
419
419
|
value: {
|
|
420
|
-
scope: cloneScope(
|
|
421
|
-
humanInLoop:
|
|
422
|
-
secrets: cloneSecrets(
|
|
423
|
-
requires: cloneRequires(
|
|
420
|
+
scope: cloneScope(config2.scope),
|
|
421
|
+
humanInLoop: config2.humanInLoop,
|
|
422
|
+
secrets: cloneSecrets(config2.secrets),
|
|
423
|
+
requires: cloneRequires(config2.requires),
|
|
424
424
|
sourcePath: inferCommandSourcePath()
|
|
425
425
|
}
|
|
426
426
|
});
|
|
427
427
|
return command;
|
|
428
428
|
}
|
|
429
|
-
function createBaseGroup(
|
|
429
|
+
function createBaseGroup(config2) {
|
|
430
430
|
const group = {
|
|
431
431
|
kind: "group",
|
|
432
|
-
name:
|
|
433
|
-
description:
|
|
434
|
-
aliases: [...
|
|
435
|
-
scope: resolveGroupScope(
|
|
436
|
-
humanInLoop:
|
|
437
|
-
secrets: cloneSecrets(
|
|
438
|
-
requires: cloneRequires(
|
|
432
|
+
name: config2.name,
|
|
433
|
+
description: config2.description,
|
|
434
|
+
aliases: [...config2.aliases ?? []],
|
|
435
|
+
scope: resolveGroupScope(config2.scope, void 0),
|
|
436
|
+
humanInLoop: config2.humanInLoop,
|
|
437
|
+
secrets: cloneSecrets(config2.secrets),
|
|
438
|
+
requires: cloneRequires(config2.requires),
|
|
439
439
|
children: [],
|
|
440
440
|
default: void 0
|
|
441
441
|
};
|
|
442
442
|
Object.defineProperty(group, groupConfigSymbol, {
|
|
443
443
|
value: {
|
|
444
|
-
mcp: cloneMcpServerConfig(
|
|
445
|
-
scope: cloneScope(
|
|
446
|
-
humanInLoop:
|
|
447
|
-
secrets: cloneSecrets(
|
|
448
|
-
tools: cloneStringArray(
|
|
449
|
-
rename: cloneRenameMap(
|
|
450
|
-
requires: cloneRequires(
|
|
451
|
-
children: [...
|
|
452
|
-
default:
|
|
444
|
+
mcp: cloneMcpServerConfig(config2.mcp),
|
|
445
|
+
scope: cloneScope(config2.scope),
|
|
446
|
+
humanInLoop: config2.humanInLoop,
|
|
447
|
+
secrets: cloneSecrets(config2.secrets),
|
|
448
|
+
tools: cloneStringArray(config2.tools),
|
|
449
|
+
rename: cloneRenameMap(config2.rename),
|
|
450
|
+
requires: cloneRequires(config2.requires),
|
|
451
|
+
children: [...config2.children],
|
|
452
|
+
default: config2.default
|
|
453
453
|
}
|
|
454
454
|
});
|
|
455
455
|
return group;
|
|
@@ -552,10 +552,10 @@ function materializeNode(node, inherited) {
|
|
|
552
552
|
}
|
|
553
553
|
return materializeGroup(node, inherited);
|
|
554
554
|
}
|
|
555
|
-
function defineCommand(
|
|
556
|
-
validateHumanInLoopOnDefine(
|
|
555
|
+
function defineCommand(config2) {
|
|
556
|
+
validateHumanInLoopOnDefine(config2);
|
|
557
557
|
return materializeCommand(
|
|
558
|
-
createBaseCommand(
|
|
558
|
+
createBaseCommand(config2),
|
|
559
559
|
{
|
|
560
560
|
scope: void 0,
|
|
561
561
|
humanInLoop: void 0,
|
|
@@ -564,10 +564,10 @@ function defineCommand(config) {
|
|
|
564
564
|
}
|
|
565
565
|
);
|
|
566
566
|
}
|
|
567
|
-
function defineGroup(
|
|
568
|
-
validateRenameMap(
|
|
569
|
-
validateHumanInLoopOnDefine(
|
|
570
|
-
return materializeGroup(createBaseGroup(
|
|
567
|
+
function defineGroup(config2) {
|
|
568
|
+
validateRenameMap(config2.rename);
|
|
569
|
+
validateHumanInLoopOnDefine(config2);
|
|
570
|
+
return materializeGroup(createBaseGroup(config2), {
|
|
571
571
|
scope: void 0,
|
|
572
572
|
humanInLoop: void 0,
|
|
573
573
|
secrets: {},
|
|
@@ -2325,11 +2325,11 @@ function resolveAgentSupport(input, registry = agentSkillConfigs) {
|
|
|
2325
2325
|
if (!resolvedId) {
|
|
2326
2326
|
return { status: "unknown", input };
|
|
2327
2327
|
}
|
|
2328
|
-
const
|
|
2329
|
-
if (!
|
|
2328
|
+
const config2 = registry[resolvedId];
|
|
2329
|
+
if (!config2) {
|
|
2330
2330
|
return { status: "unsupported", input, id: resolvedId };
|
|
2331
2331
|
}
|
|
2332
|
-
return { status: "supported", input, id: resolvedId, config: { ...
|
|
2332
|
+
return { status: "supported", input, id: resolvedId, config: { ...config2 } };
|
|
2333
2333
|
}
|
|
2334
2334
|
function getAgentConfig(agentId) {
|
|
2335
2335
|
const support = resolveAgentSupport(agentId);
|
|
@@ -2430,7 +2430,7 @@ var templateMutation = {
|
|
|
2430
2430
|
// ../config-mutations/src/execution/apply-mutation.ts
|
|
2431
2431
|
import path4 from "node:path";
|
|
2432
2432
|
|
|
2433
|
-
// ../design
|
|
2433
|
+
// ../toolcraft-design/src/internal/color-support.ts
|
|
2434
2434
|
function supportsColor(env = process.env, stream = process.stdout) {
|
|
2435
2435
|
if (env.FORCE_COLOR !== void 0 && env.FORCE_COLOR !== "0") {
|
|
2436
2436
|
return true;
|
|
@@ -2444,7 +2444,7 @@ function supportsColor(env = process.env, stream = process.stdout) {
|
|
|
2444
2444
|
return typeof env.TERM === "string" && env.TERM.length > 0 && env.TERM !== "dumb";
|
|
2445
2445
|
}
|
|
2446
2446
|
|
|
2447
|
-
// ../design
|
|
2447
|
+
// ../toolcraft-design/src/components/color.ts
|
|
2448
2448
|
var reset = "\x1B[0m";
|
|
2449
2449
|
var ansiStyles = {
|
|
2450
2450
|
reset: { open: reset },
|
|
@@ -2546,41 +2546,122 @@ function createColor(styles = []) {
|
|
|
2546
2546
|
}
|
|
2547
2547
|
var color = createColor();
|
|
2548
2548
|
|
|
2549
|
-
// ../design
|
|
2550
|
-
var
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
number: (text4) => color.cyanBright(text4),
|
|
2555
|
-
intro: (text4) => color.bgMagenta.white(` Poe - ${text4} `),
|
|
2556
|
-
resolvedSymbol: color.magenta("\u25C7"),
|
|
2557
|
-
errorSymbol: color.red("\u25A0"),
|
|
2558
|
-
accent: (text4) => color.cyan(text4),
|
|
2559
|
-
muted: (text4) => color.dim(text4),
|
|
2560
|
-
success: (text4) => color.green(text4),
|
|
2561
|
-
warning: (text4) => color.yellow(text4),
|
|
2562
|
-
error: (text4) => color.red(text4),
|
|
2563
|
-
info: (text4) => color.magenta(text4),
|
|
2564
|
-
badge: (text4) => color.bgYellow.black(` ${text4} `)
|
|
2549
|
+
// ../toolcraft-design/src/tokens/brand.ts
|
|
2550
|
+
var brands = {
|
|
2551
|
+
purple: { name: "purple", primary: "#a200ff" },
|
|
2552
|
+
blue: { name: "blue", primary: "#2f6fed" },
|
|
2553
|
+
green: { name: "green", primary: "#1f9d57" }
|
|
2565
2554
|
};
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
intro: (text4) => color.bgHex("#a200ff").white(` Poe - ${text4} `),
|
|
2572
|
-
resolvedSymbol: color.hex("#a200ff")("\u25C7"),
|
|
2573
|
-
errorSymbol: color.hex("#cc0000")("\u25A0"),
|
|
2574
|
-
accent: (text4) => color.hex("#006699").bold(text4),
|
|
2575
|
-
muted: (text4) => color.hex("#666666")(text4),
|
|
2576
|
-
success: (text4) => color.hex("#008800")(text4),
|
|
2577
|
-
warning: (text4) => color.hex("#cc6600")(text4),
|
|
2578
|
-
error: (text4) => color.hex("#cc0000")(text4),
|
|
2579
|
-
info: (text4) => color.hex("#a200ff")(text4),
|
|
2580
|
-
badge: (text4) => color.bgHex("#cc6600").white(` ${text4} `)
|
|
2555
|
+
|
|
2556
|
+
// ../toolcraft-design/src/internal/theme-state.ts
|
|
2557
|
+
var defaults = {
|
|
2558
|
+
brand: "purple",
|
|
2559
|
+
label: "Poe"
|
|
2581
2560
|
};
|
|
2561
|
+
var config = { ...defaults };
|
|
2562
|
+
var revision = 0;
|
|
2563
|
+
var brandConfigured = false;
|
|
2564
|
+
function getThemeConfig() {
|
|
2565
|
+
return { ...config };
|
|
2566
|
+
}
|
|
2567
|
+
function getThemeRevision() {
|
|
2568
|
+
return revision;
|
|
2569
|
+
}
|
|
2570
|
+
function isThemeBrandConfigured() {
|
|
2571
|
+
return brandConfigured;
|
|
2572
|
+
}
|
|
2582
2573
|
|
|
2583
|
-
// ../design
|
|
2574
|
+
// ../toolcraft-design/src/tokens/colors.ts
|
|
2575
|
+
var brand = brands.purple.primary;
|
|
2576
|
+
function withStyles(palette, styles) {
|
|
2577
|
+
return Object.defineProperty(palette, "styles", {
|
|
2578
|
+
value: styles,
|
|
2579
|
+
enumerable: false
|
|
2580
|
+
});
|
|
2581
|
+
}
|
|
2582
|
+
function brandColor(activeBrand, purple) {
|
|
2583
|
+
return activeBrand.name === "purple" ? purple : color.hex(activeBrand.primary);
|
|
2584
|
+
}
|
|
2585
|
+
function brandBackground(activeBrand, purple) {
|
|
2586
|
+
return activeBrand.name === "purple" ? purple : color.bgHex(activeBrand.primary);
|
|
2587
|
+
}
|
|
2588
|
+
function createPalette(activeBrand, mode) {
|
|
2589
|
+
const isPurple = activeBrand.name === "purple";
|
|
2590
|
+
if (mode === "light") {
|
|
2591
|
+
const active2 = color.hex(activeBrand.primary);
|
|
2592
|
+
const prompt2 = isPurple ? color.hex("#006699") : active2;
|
|
2593
|
+
const number2 = isPurple ? color.hex("#0077cc") : active2;
|
|
2594
|
+
return withStyles(
|
|
2595
|
+
{
|
|
2596
|
+
header: (text4) => active2.bold(text4),
|
|
2597
|
+
divider: (text4) => color.hex("#666666")(text4),
|
|
2598
|
+
prompt: (text4) => prompt2.bold(text4),
|
|
2599
|
+
number: (text4) => number2.bold(text4),
|
|
2600
|
+
intro: (text4) => color.bgHex(activeBrand.primary).white(` ${getThemeConfig().label} - ${text4} `),
|
|
2601
|
+
get resolvedSymbol() {
|
|
2602
|
+
return active2("\u25C7");
|
|
2603
|
+
},
|
|
2604
|
+
get errorSymbol() {
|
|
2605
|
+
return color.hex("#cc0000")("\u25A0");
|
|
2606
|
+
},
|
|
2607
|
+
accent: (text4) => prompt2.bold(text4),
|
|
2608
|
+
muted: (text4) => color.hex("#666666")(text4),
|
|
2609
|
+
success: (text4) => color.hex("#008800")(text4),
|
|
2610
|
+
warning: (text4) => color.hex("#cc6600")(text4),
|
|
2611
|
+
error: (text4) => color.hex("#cc0000")(text4),
|
|
2612
|
+
info: (text4) => active2(text4),
|
|
2613
|
+
badge: (text4) => color.bgHex("#cc6600").white(` ${text4} `)
|
|
2614
|
+
},
|
|
2615
|
+
{
|
|
2616
|
+
accent: { fg: isPurple ? "#006699" : activeBrand.primary, bold: true },
|
|
2617
|
+
muted: { fg: "#666666" },
|
|
2618
|
+
success: { fg: "#008800" },
|
|
2619
|
+
warning: { fg: "#cc6600" },
|
|
2620
|
+
error: { fg: "#cc0000" },
|
|
2621
|
+
info: { fg: activeBrand.primary }
|
|
2622
|
+
}
|
|
2623
|
+
);
|
|
2624
|
+
}
|
|
2625
|
+
const active = brandColor(activeBrand, color.magenta);
|
|
2626
|
+
const activeBright = brandColor(activeBrand, color.magentaBright);
|
|
2627
|
+
const activeBackground = brandBackground(activeBrand, color.bgMagenta);
|
|
2628
|
+
const prompt = isPurple ? color.cyan : active;
|
|
2629
|
+
const number = isPurple ? color.cyanBright : active;
|
|
2630
|
+
return withStyles(
|
|
2631
|
+
{
|
|
2632
|
+
header: (text4) => activeBright.bold(text4),
|
|
2633
|
+
divider: (text4) => color.dim(text4),
|
|
2634
|
+
prompt: (text4) => prompt(text4),
|
|
2635
|
+
number: (text4) => number(text4),
|
|
2636
|
+
intro: (text4) => activeBackground.white(` ${getThemeConfig().label} - ${text4} `),
|
|
2637
|
+
get resolvedSymbol() {
|
|
2638
|
+
return active("\u25C7");
|
|
2639
|
+
},
|
|
2640
|
+
get errorSymbol() {
|
|
2641
|
+
return color.red("\u25A0");
|
|
2642
|
+
},
|
|
2643
|
+
accent: (text4) => prompt(text4),
|
|
2644
|
+
muted: (text4) => color.dim(text4),
|
|
2645
|
+
success: (text4) => color.green(text4),
|
|
2646
|
+
warning: (text4) => color.yellow(text4),
|
|
2647
|
+
error: (text4) => color.red(text4),
|
|
2648
|
+
info: (text4) => active(text4),
|
|
2649
|
+
badge: (text4) => color.bgYellow.black(` ${text4} `)
|
|
2650
|
+
},
|
|
2651
|
+
{
|
|
2652
|
+
accent: { fg: isPurple ? "cyan" : activeBrand.primary, bold: true },
|
|
2653
|
+
muted: { dim: true },
|
|
2654
|
+
success: { fg: "green" },
|
|
2655
|
+
warning: { fg: "yellow" },
|
|
2656
|
+
error: { fg: "red" },
|
|
2657
|
+
info: { fg: isPurple ? "magenta" : activeBrand.primary }
|
|
2658
|
+
}
|
|
2659
|
+
);
|
|
2660
|
+
}
|
|
2661
|
+
var dark = createPalette(brands.purple, "dark");
|
|
2662
|
+
var light = createPalette(brands.purple, "light");
|
|
2663
|
+
|
|
2664
|
+
// ../toolcraft-design/src/internal/output-format.ts
|
|
2584
2665
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
2585
2666
|
var VALID_FORMATS = /* @__PURE__ */ new Set(["terminal", "markdown", "json"]);
|
|
2586
2667
|
var formatStorage = new AsyncLocalStorage();
|
|
@@ -2598,7 +2679,7 @@ function resolveOutputFormat(env = process.env) {
|
|
|
2598
2679
|
return cached;
|
|
2599
2680
|
}
|
|
2600
2681
|
|
|
2601
|
-
// ../design
|
|
2682
|
+
// ../toolcraft-design/src/internal/theme-detect.ts
|
|
2602
2683
|
function detectThemeFromEnv(env) {
|
|
2603
2684
|
const apple = env.APPLE_INTERFACE_STYLE;
|
|
2604
2685
|
if (typeof apple === "string") {
|
|
@@ -2635,17 +2716,30 @@ function resolveThemeName(env = process.env) {
|
|
|
2635
2716
|
}
|
|
2636
2717
|
return "dark";
|
|
2637
2718
|
}
|
|
2638
|
-
var
|
|
2719
|
+
var themeCache = /* @__PURE__ */ new Map();
|
|
2720
|
+
var cachedRevision = -1;
|
|
2639
2721
|
function getTheme(env) {
|
|
2722
|
+
const themeName = resolveThemeName(env);
|
|
2723
|
+
const config2 = getThemeConfig();
|
|
2724
|
+
const requestedBrand = env?.POE_BRAND?.toLowerCase();
|
|
2725
|
+
const activeBrandName = !isThemeBrandConfigured() && requestedBrand && Object.hasOwn(brands, requestedBrand) ? requestedBrand : config2.brand;
|
|
2726
|
+
const revision2 = getThemeRevision();
|
|
2727
|
+
if (revision2 !== cachedRevision) {
|
|
2728
|
+
themeCache.clear();
|
|
2729
|
+
cachedRevision = revision2;
|
|
2730
|
+
}
|
|
2731
|
+
const cacheKey = `${activeBrandName}:${themeName}`;
|
|
2732
|
+
const cachedTheme = themeCache.get(cacheKey);
|
|
2640
2733
|
if (cachedTheme) {
|
|
2641
2734
|
return cachedTheme;
|
|
2642
2735
|
}
|
|
2643
|
-
const
|
|
2644
|
-
|
|
2645
|
-
|
|
2736
|
+
const activeBrand = brands[activeBrandName];
|
|
2737
|
+
const theme = activeBrandName === "purple" ? themeName === "light" ? light : dark : createPalette(activeBrand, themeName);
|
|
2738
|
+
themeCache.set(cacheKey, theme);
|
|
2739
|
+
return theme;
|
|
2646
2740
|
}
|
|
2647
2741
|
|
|
2648
|
-
// ../design
|
|
2742
|
+
// ../toolcraft-design/src/components/symbols.ts
|
|
2649
2743
|
var symbols = {
|
|
2650
2744
|
get info() {
|
|
2651
2745
|
const format = resolveOutputFormat();
|
|
@@ -2699,12 +2793,12 @@ var symbols = {
|
|
|
2699
2793
|
}
|
|
2700
2794
|
};
|
|
2701
2795
|
|
|
2702
|
-
// ../design
|
|
2796
|
+
// ../toolcraft-design/src/internal/strip-ansi.ts
|
|
2703
2797
|
function stripAnsi2(value) {
|
|
2704
2798
|
return value.replace(/\u001b\[[0-9;]*m/g, "");
|
|
2705
2799
|
}
|
|
2706
2800
|
|
|
2707
|
-
// ../design
|
|
2801
|
+
// ../toolcraft-design/src/prompts/primitives/log.ts
|
|
2708
2802
|
function renderMarkdownInline(value) {
|
|
2709
2803
|
return stripAnsi2(value).replaceAll("\r\n", " ").replaceAll("\n", " ").replaceAll("\r", " ");
|
|
2710
2804
|
}
|
|
@@ -2831,7 +2925,7 @@ var log = {
|
|
|
2831
2925
|
error
|
|
2832
2926
|
};
|
|
2833
2927
|
|
|
2834
|
-
// ../design
|
|
2928
|
+
// ../toolcraft-design/src/components/logger.ts
|
|
2835
2929
|
function createLogger(emitter) {
|
|
2836
2930
|
const emit = (level, message2) => {
|
|
2837
2931
|
if (emitter) {
|
|
@@ -2892,13 +2986,13 @@ function createLogger(emitter) {
|
|
|
2892
2986
|
}
|
|
2893
2987
|
var logger = createLogger();
|
|
2894
2988
|
|
|
2895
|
-
// ../design
|
|
2989
|
+
// ../toolcraft-design/src/components/help-formatter.ts
|
|
2896
2990
|
var graphemeSegmenter = new Intl.Segmenter(void 0, { granularity: "grapheme" });
|
|
2897
2991
|
|
|
2898
|
-
// ../design
|
|
2992
|
+
// ../toolcraft-design/src/components/table.ts
|
|
2899
2993
|
var graphemeSegmenter2 = new Intl.Segmenter(void 0, { granularity: "grapheme" });
|
|
2900
2994
|
|
|
2901
|
-
// ../design
|
|
2995
|
+
// ../toolcraft-design/src/components/template.ts
|
|
2902
2996
|
var MAX_PARTIAL_DEPTH = 100;
|
|
2903
2997
|
var HTML_ESCAPE = {
|
|
2904
2998
|
"&": "&",
|
|
@@ -3310,22 +3404,22 @@ function hasProperty(value, key) {
|
|
|
3310
3404
|
return Object.prototype.hasOwnProperty.call(value, key);
|
|
3311
3405
|
}
|
|
3312
3406
|
|
|
3313
|
-
// ../design
|
|
3407
|
+
// ../toolcraft-design/src/components/browser.ts
|
|
3314
3408
|
import { spawn as spawn2 } from "node:child_process";
|
|
3315
3409
|
import process2 from "node:process";
|
|
3316
3410
|
|
|
3317
|
-
// ../design
|
|
3411
|
+
// ../toolcraft-design/src/acp/writer.ts
|
|
3318
3412
|
import { AsyncLocalStorage as AsyncLocalStorage2 } from "node:async_hooks";
|
|
3319
3413
|
var storage = new AsyncLocalStorage2();
|
|
3320
3414
|
|
|
3321
|
-
// ../design
|
|
3415
|
+
// ../toolcraft-design/src/dashboard/terminal-width.ts
|
|
3322
3416
|
var graphemeSegmenter3 = new Intl.Segmenter(void 0, { granularity: "grapheme" });
|
|
3323
3417
|
|
|
3324
|
-
// ../design
|
|
3418
|
+
// ../toolcraft-design/src/dashboard/terminal.ts
|
|
3325
3419
|
import readline from "node:readline";
|
|
3326
3420
|
import { PassThrough } from "node:stream";
|
|
3327
3421
|
|
|
3328
|
-
// ../design
|
|
3422
|
+
// ../toolcraft-design/src/explorer/state.ts
|
|
3329
3423
|
var REGION_HEADER = 1 << 0;
|
|
3330
3424
|
var REGION_LIST = 1 << 1;
|
|
3331
3425
|
var REGION_DETAIL = 1 << 2;
|
|
@@ -3334,13 +3428,13 @@ var REGION_MODAL = 1 << 4;
|
|
|
3334
3428
|
var REGION_TOAST = 1 << 5;
|
|
3335
3429
|
var REGION_ALL = REGION_HEADER | REGION_LIST | REGION_DETAIL | REGION_FOOTER | REGION_MODAL | REGION_TOAST;
|
|
3336
3430
|
|
|
3337
|
-
// ../design
|
|
3431
|
+
// ../toolcraft-design/src/prompts/index.ts
|
|
3338
3432
|
import * as clack from "@clack/prompts";
|
|
3339
3433
|
|
|
3340
|
-
// ../design
|
|
3434
|
+
// ../toolcraft-design/src/prompts/primitives/cancel.ts
|
|
3341
3435
|
import { isCancel } from "@clack/prompts";
|
|
3342
3436
|
|
|
3343
|
-
// ../design
|
|
3437
|
+
// ../toolcraft-design/src/static/spinner.ts
|
|
3344
3438
|
var SPINNER_FRAMES = Object.freeze(["\u25D2", "\u25D0", "\u25D3", "\u25D1"]);
|
|
3345
3439
|
|
|
3346
3440
|
// ../config-mutations/src/formats/json.ts
|
|
@@ -4574,14 +4668,14 @@ async function installSkill(agentId, skill, options) {
|
|
|
4574
4668
|
throw new UnsupportedAgentError(agentId);
|
|
4575
4669
|
}
|
|
4576
4670
|
const scope = options.scope ?? "local";
|
|
4577
|
-
const
|
|
4671
|
+
const config2 = support.config;
|
|
4578
4672
|
if (skill.name.length === 0 || skill.name === "." || skill.name === ".." || skill.name.includes("/") || skill.name.includes("\\") || skill.name.includes("\n") || skill.name.includes("\r")) {
|
|
4579
4673
|
throw new Error(`Invalid skill name: ${skill.name}`);
|
|
4580
4674
|
}
|
|
4581
|
-
const skillDir = scope === "global" ?
|
|
4675
|
+
const skillDir = scope === "global" ? config2.globalSkillDir : toHomeRelative(config2.localSkillDir);
|
|
4582
4676
|
const skillFolderPath = `${skillDir}/${skill.name}`;
|
|
4583
4677
|
const skillFilePath = `${skillFolderPath}/SKILL.md`;
|
|
4584
|
-
const displayPath = `${scope === "global" ?
|
|
4678
|
+
const displayPath = `${scope === "global" ? config2.globalSkillDir : config2.localSkillDir}/${skill.name}/SKILL.md`;
|
|
4585
4679
|
const absoluteSkillPath = `${scope === "global" ? options.homeDir : options.cwd}/${skillFilePath.slice(2)}`;
|
|
4586
4680
|
if (await pathExists2(options.fs, absoluteSkillPath)) {
|
|
4587
4681
|
throw new Error(`Skill already exists: ${displayPath}`);
|
|
@@ -4702,17 +4796,17 @@ function resolveHomeRelativePath(targetPath, homeDir) {
|
|
|
4702
4796
|
return targetPath;
|
|
4703
4797
|
}
|
|
4704
4798
|
function getSkillFolderWithHome(agent, scope, cwd, homeDir) {
|
|
4705
|
-
const
|
|
4706
|
-
if (!
|
|
4799
|
+
const config2 = getAgentConfig(agent);
|
|
4800
|
+
if (!config2) {
|
|
4707
4801
|
throwUnsupportedAgent(agent);
|
|
4708
4802
|
}
|
|
4709
4803
|
return {
|
|
4710
4804
|
displayPath: path9.join(
|
|
4711
|
-
scope === "global" ?
|
|
4805
|
+
scope === "global" ? config2.globalSkillDir : config2.localSkillDir,
|
|
4712
4806
|
TERMINAL_PILOT_SKILL_NAME
|
|
4713
4807
|
),
|
|
4714
4808
|
fullPath: path9.join(
|
|
4715
|
-
scope === "global" ? resolveHomeRelativePath(
|
|
4809
|
+
scope === "global" ? resolveHomeRelativePath(config2.globalSkillDir, homeDir) : path9.resolve(cwd, config2.localSkillDir),
|
|
4716
4810
|
TERMINAL_PILOT_SKILL_NAME
|
|
4717
4811
|
)
|
|
4718
4812
|
};
|