terminal-pilot 0.0.19 → 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.
Files changed (52) hide show
  1. package/dist/cli.js +1076 -496
  2. package/dist/cli.js.map +4 -4
  3. package/dist/commands/close-session.js.map +1 -1
  4. package/dist/commands/create-session.js.map +1 -1
  5. package/dist/commands/fill.js.map +1 -1
  6. package/dist/commands/get-session.js.map +1 -1
  7. package/dist/commands/index.js +481 -163
  8. package/dist/commands/index.js.map +4 -4
  9. package/dist/commands/install.js +448 -130
  10. package/dist/commands/install.js.map +4 -4
  11. package/dist/commands/installer.js +154 -60
  12. package/dist/commands/installer.js.map +4 -4
  13. package/dist/commands/list-sessions.js.map +1 -1
  14. package/dist/commands/press-key.js.map +1 -1
  15. package/dist/commands/read-history.js.map +1 -1
  16. package/dist/commands/read-screen.js.map +1 -1
  17. package/dist/commands/resize.js.map +1 -1
  18. package/dist/commands/runtime.js.map +1 -1
  19. package/dist/commands/screenshot.js.map +1 -1
  20. package/dist/commands/send-signal.js.map +1 -1
  21. package/dist/commands/type.js.map +1 -1
  22. package/dist/commands/uninstall.js +187 -93
  23. package/dist/commands/uninstall.js.map +4 -4
  24. package/dist/commands/wait-for-exit.js.map +1 -1
  25. package/dist/commands/wait-for.js.map +1 -1
  26. package/dist/testing/cli-repl.js +1072 -492
  27. package/dist/testing/cli-repl.js.map +4 -4
  28. package/dist/testing/qa-cli.js +1082 -502
  29. package/dist/testing/qa-cli.js.map +4 -4
  30. package/node_modules/@poe-code/agent-skill-config/README.md +103 -0
  31. package/node_modules/@poe-code/agent-skill-config/dist/apply.d.ts +25 -0
  32. package/node_modules/@poe-code/agent-skill-config/dist/apply.js +159 -0
  33. package/node_modules/@poe-code/agent-skill-config/dist/bridge-active-skills.d.ts +23 -0
  34. package/node_modules/@poe-code/agent-skill-config/dist/bridge-active-skills.js +341 -0
  35. package/node_modules/@poe-code/agent-skill-config/dist/configs.d.ts +16 -0
  36. package/node_modules/@poe-code/agent-skill-config/dist/configs.js +70 -0
  37. package/node_modules/@poe-code/agent-skill-config/dist/exports.compile-check.d.ts +1 -0
  38. package/node_modules/@poe-code/agent-skill-config/dist/exports.compile-check.js +1 -0
  39. package/node_modules/@poe-code/agent-skill-config/dist/git-exclude.d.ts +8 -0
  40. package/node_modules/@poe-code/agent-skill-config/dist/git-exclude.js +159 -0
  41. package/node_modules/@poe-code/agent-skill-config/dist/index.d.ts +11 -0
  42. package/node_modules/@poe-code/agent-skill-config/dist/index.js +6 -0
  43. package/node_modules/@poe-code/agent-skill-config/dist/resolve-skill-reference.d.ts +22 -0
  44. package/node_modules/@poe-code/agent-skill-config/dist/resolve-skill-reference.js +87 -0
  45. package/node_modules/@poe-code/agent-skill-config/dist/templates/poe-generate.md +47 -0
  46. package/node_modules/@poe-code/agent-skill-config/dist/templates/terminal-pilot.md +45 -0
  47. package/node_modules/@poe-code/agent-skill-config/dist/templates.d.ts +3 -0
  48. package/node_modules/@poe-code/agent-skill-config/dist/templates.js +63 -0
  49. package/node_modules/@poe-code/agent-skill-config/dist/types.d.ts +16 -0
  50. package/node_modules/@poe-code/agent-skill-config/dist/types.js +1 -0
  51. package/node_modules/@poe-code/agent-skill-config/package.json +24 -0
  52. package/package.json +4 -2
@@ -228,11 +228,11 @@ function resolveAgentSupport(input, registry = agentSkillConfigs) {
228
228
  if (!resolvedId) {
229
229
  return { status: "unknown", input };
230
230
  }
231
- const config = registry[resolvedId];
232
- if (!config) {
231
+ const config2 = registry[resolvedId];
232
+ if (!config2) {
233
233
  return { status: "unsupported", input, id: resolvedId };
234
234
  }
235
- return { status: "supported", input, id: resolvedId, config: { ...config } };
235
+ return { status: "supported", input, id: resolvedId, config: { ...config2 } };
236
236
  }
237
237
  function getAgentConfig(agentId) {
238
238
  const support = resolveAgentSupport(agentId);
@@ -242,7 +242,7 @@ function getAgentConfig(agentId) {
242
242
  // ../config-mutations/src/execution/apply-mutation.ts
243
243
  import path4 from "node:path";
244
244
 
245
- // ../design-system/src/internal/color-support.ts
245
+ // ../toolcraft-design/src/internal/color-support.ts
246
246
  function supportsColor(env = process.env, stream = process.stdout) {
247
247
  if (env.FORCE_COLOR !== void 0 && env.FORCE_COLOR !== "0") {
248
248
  return true;
@@ -256,7 +256,7 @@ function supportsColor(env = process.env, stream = process.stdout) {
256
256
  return typeof env.TERM === "string" && env.TERM.length > 0 && env.TERM !== "dumb";
257
257
  }
258
258
 
259
- // ../design-system/src/components/color.ts
259
+ // ../toolcraft-design/src/components/color.ts
260
260
  var reset = "\x1B[0m";
261
261
  var ansiStyles = {
262
262
  reset: { open: reset },
@@ -358,41 +358,122 @@ function createColor(styles = []) {
358
358
  }
359
359
  var color = createColor();
360
360
 
361
- // ../design-system/src/tokens/colors.ts
362
- var dark = {
363
- header: (text4) => color.magentaBright.bold(text4),
364
- divider: (text4) => color.dim(text4),
365
- prompt: (text4) => color.cyan(text4),
366
- number: (text4) => color.cyanBright(text4),
367
- intro: (text4) => color.bgMagenta.white(` Poe - ${text4} `),
368
- resolvedSymbol: color.magenta("\u25C7"),
369
- errorSymbol: color.red("\u25A0"),
370
- accent: (text4) => color.cyan(text4),
371
- muted: (text4) => color.dim(text4),
372
- success: (text4) => color.green(text4),
373
- warning: (text4) => color.yellow(text4),
374
- error: (text4) => color.red(text4),
375
- info: (text4) => color.magenta(text4),
376
- badge: (text4) => color.bgYellow.black(` ${text4} `)
361
+ // ../toolcraft-design/src/tokens/brand.ts
362
+ var brands = {
363
+ purple: { name: "purple", primary: "#a200ff" },
364
+ blue: { name: "blue", primary: "#2f6fed" },
365
+ green: { name: "green", primary: "#1f9d57" }
377
366
  };
378
- var light = {
379
- header: (text4) => color.hex("#a200ff").bold(text4),
380
- divider: (text4) => color.hex("#666666")(text4),
381
- prompt: (text4) => color.hex("#006699").bold(text4),
382
- number: (text4) => color.hex("#0077cc").bold(text4),
383
- intro: (text4) => color.bgHex("#a200ff").white(` Poe - ${text4} `),
384
- resolvedSymbol: color.hex("#a200ff")("\u25C7"),
385
- errorSymbol: color.hex("#cc0000")("\u25A0"),
386
- accent: (text4) => color.hex("#006699").bold(text4),
387
- muted: (text4) => color.hex("#666666")(text4),
388
- success: (text4) => color.hex("#008800")(text4),
389
- warning: (text4) => color.hex("#cc6600")(text4),
390
- error: (text4) => color.hex("#cc0000")(text4),
391
- info: (text4) => color.hex("#a200ff")(text4),
392
- badge: (text4) => color.bgHex("#cc6600").white(` ${text4} `)
367
+
368
+ // ../toolcraft-design/src/internal/theme-state.ts
369
+ var defaults = {
370
+ brand: "purple",
371
+ label: "Poe"
393
372
  };
373
+ var config = { ...defaults };
374
+ var revision = 0;
375
+ var brandConfigured = false;
376
+ function getThemeConfig() {
377
+ return { ...config };
378
+ }
379
+ function getThemeRevision() {
380
+ return revision;
381
+ }
382
+ function isThemeBrandConfigured() {
383
+ return brandConfigured;
384
+ }
385
+
386
+ // ../toolcraft-design/src/tokens/colors.ts
387
+ var brand = brands.purple.primary;
388
+ function withStyles(palette, styles) {
389
+ return Object.defineProperty(palette, "styles", {
390
+ value: styles,
391
+ enumerable: false
392
+ });
393
+ }
394
+ function brandColor(activeBrand, purple) {
395
+ return activeBrand.name === "purple" ? purple : color.hex(activeBrand.primary);
396
+ }
397
+ function brandBackground(activeBrand, purple) {
398
+ return activeBrand.name === "purple" ? purple : color.bgHex(activeBrand.primary);
399
+ }
400
+ function createPalette(activeBrand, mode) {
401
+ const isPurple = activeBrand.name === "purple";
402
+ if (mode === "light") {
403
+ const active2 = color.hex(activeBrand.primary);
404
+ const prompt2 = isPurple ? color.hex("#006699") : active2;
405
+ const number2 = isPurple ? color.hex("#0077cc") : active2;
406
+ return withStyles(
407
+ {
408
+ header: (text4) => active2.bold(text4),
409
+ divider: (text4) => color.hex("#666666")(text4),
410
+ prompt: (text4) => prompt2.bold(text4),
411
+ number: (text4) => number2.bold(text4),
412
+ intro: (text4) => color.bgHex(activeBrand.primary).white(` ${getThemeConfig().label} - ${text4} `),
413
+ get resolvedSymbol() {
414
+ return active2("\u25C7");
415
+ },
416
+ get errorSymbol() {
417
+ return color.hex("#cc0000")("\u25A0");
418
+ },
419
+ accent: (text4) => prompt2.bold(text4),
420
+ muted: (text4) => color.hex("#666666")(text4),
421
+ success: (text4) => color.hex("#008800")(text4),
422
+ warning: (text4) => color.hex("#cc6600")(text4),
423
+ error: (text4) => color.hex("#cc0000")(text4),
424
+ info: (text4) => active2(text4),
425
+ badge: (text4) => color.bgHex("#cc6600").white(` ${text4} `)
426
+ },
427
+ {
428
+ accent: { fg: isPurple ? "#006699" : activeBrand.primary, bold: true },
429
+ muted: { fg: "#666666" },
430
+ success: { fg: "#008800" },
431
+ warning: { fg: "#cc6600" },
432
+ error: { fg: "#cc0000" },
433
+ info: { fg: activeBrand.primary }
434
+ }
435
+ );
436
+ }
437
+ const active = brandColor(activeBrand, color.magenta);
438
+ const activeBright = brandColor(activeBrand, color.magentaBright);
439
+ const activeBackground = brandBackground(activeBrand, color.bgMagenta);
440
+ const prompt = isPurple ? color.cyan : active;
441
+ const number = isPurple ? color.cyanBright : active;
442
+ return withStyles(
443
+ {
444
+ header: (text4) => activeBright.bold(text4),
445
+ divider: (text4) => color.dim(text4),
446
+ prompt: (text4) => prompt(text4),
447
+ number: (text4) => number(text4),
448
+ intro: (text4) => activeBackground.white(` ${getThemeConfig().label} - ${text4} `),
449
+ get resolvedSymbol() {
450
+ return active("\u25C7");
451
+ },
452
+ get errorSymbol() {
453
+ return color.red("\u25A0");
454
+ },
455
+ accent: (text4) => prompt(text4),
456
+ muted: (text4) => color.dim(text4),
457
+ success: (text4) => color.green(text4),
458
+ warning: (text4) => color.yellow(text4),
459
+ error: (text4) => color.red(text4),
460
+ info: (text4) => active(text4),
461
+ badge: (text4) => color.bgYellow.black(` ${text4} `)
462
+ },
463
+ {
464
+ accent: { fg: isPurple ? "cyan" : activeBrand.primary, bold: true },
465
+ muted: { dim: true },
466
+ success: { fg: "green" },
467
+ warning: { fg: "yellow" },
468
+ error: { fg: "red" },
469
+ info: { fg: isPurple ? "magenta" : activeBrand.primary }
470
+ }
471
+ );
472
+ }
473
+ var dark = createPalette(brands.purple, "dark");
474
+ var light = createPalette(brands.purple, "light");
394
475
 
395
- // ../design-system/src/internal/output-format.ts
476
+ // ../toolcraft-design/src/internal/output-format.ts
396
477
  import { AsyncLocalStorage } from "node:async_hooks";
397
478
  var VALID_FORMATS = /* @__PURE__ */ new Set(["terminal", "markdown", "json"]);
398
479
  var formatStorage = new AsyncLocalStorage();
@@ -410,7 +491,7 @@ function resolveOutputFormat(env = process.env) {
410
491
  return cached;
411
492
  }
412
493
 
413
- // ../design-system/src/internal/theme-detect.ts
494
+ // ../toolcraft-design/src/internal/theme-detect.ts
414
495
  function detectThemeFromEnv(env) {
415
496
  const apple = env.APPLE_INTERFACE_STYLE;
416
497
  if (typeof apple === "string") {
@@ -447,17 +528,30 @@ function resolveThemeName(env = process.env) {
447
528
  }
448
529
  return "dark";
449
530
  }
450
- var cachedTheme;
531
+ var themeCache = /* @__PURE__ */ new Map();
532
+ var cachedRevision = -1;
451
533
  function getTheme(env) {
534
+ const themeName = resolveThemeName(env);
535
+ const config2 = getThemeConfig();
536
+ const requestedBrand = env?.POE_BRAND?.toLowerCase();
537
+ const activeBrandName = !isThemeBrandConfigured() && requestedBrand && Object.hasOwn(brands, requestedBrand) ? requestedBrand : config2.brand;
538
+ const revision2 = getThemeRevision();
539
+ if (revision2 !== cachedRevision) {
540
+ themeCache.clear();
541
+ cachedRevision = revision2;
542
+ }
543
+ const cacheKey = `${activeBrandName}:${themeName}`;
544
+ const cachedTheme = themeCache.get(cacheKey);
452
545
  if (cachedTheme) {
453
546
  return cachedTheme;
454
547
  }
455
- const themeName = resolveThemeName(env);
456
- cachedTheme = themeName === "light" ? light : dark;
457
- return cachedTheme;
548
+ const activeBrand = brands[activeBrandName];
549
+ const theme = activeBrandName === "purple" ? themeName === "light" ? light : dark : createPalette(activeBrand, themeName);
550
+ themeCache.set(cacheKey, theme);
551
+ return theme;
458
552
  }
459
553
 
460
- // ../design-system/src/components/symbols.ts
554
+ // ../toolcraft-design/src/components/symbols.ts
461
555
  var symbols = {
462
556
  get info() {
463
557
  const format = resolveOutputFormat();
@@ -511,12 +605,12 @@ var symbols = {
511
605
  }
512
606
  };
513
607
 
514
- // ../design-system/src/internal/strip-ansi.ts
608
+ // ../toolcraft-design/src/internal/strip-ansi.ts
515
609
  function stripAnsi(value) {
516
610
  return value.replace(/\u001b\[[0-9;]*m/g, "");
517
611
  }
518
612
 
519
- // ../design-system/src/prompts/primitives/log.ts
613
+ // ../toolcraft-design/src/prompts/primitives/log.ts
520
614
  function renderMarkdownInline(value) {
521
615
  return stripAnsi(value).replaceAll("\r\n", " ").replaceAll("\n", " ").replaceAll("\r", " ");
522
616
  }
@@ -643,7 +737,7 @@ var log = {
643
737
  error
644
738
  };
645
739
 
646
- // ../design-system/src/components/logger.ts
740
+ // ../toolcraft-design/src/components/logger.ts
647
741
  function createLogger(emitter) {
648
742
  const emit = (level, message2) => {
649
743
  if (emitter) {
@@ -704,28 +798,28 @@ function createLogger(emitter) {
704
798
  }
705
799
  var logger = createLogger();
706
800
 
707
- // ../design-system/src/components/help-formatter.ts
801
+ // ../toolcraft-design/src/components/help-formatter.ts
708
802
  var graphemeSegmenter = new Intl.Segmenter(void 0, { granularity: "grapheme" });
709
803
 
710
- // ../design-system/src/components/table.ts
804
+ // ../toolcraft-design/src/components/table.ts
711
805
  var graphemeSegmenter2 = new Intl.Segmenter(void 0, { granularity: "grapheme" });
712
806
 
713
- // ../design-system/src/components/browser.ts
807
+ // ../toolcraft-design/src/components/browser.ts
714
808
  import { spawn } from "node:child_process";
715
809
  import process2 from "node:process";
716
810
 
717
- // ../design-system/src/acp/writer.ts
811
+ // ../toolcraft-design/src/acp/writer.ts
718
812
  import { AsyncLocalStorage as AsyncLocalStorage2 } from "node:async_hooks";
719
813
  var storage = new AsyncLocalStorage2();
720
814
 
721
- // ../design-system/src/dashboard/terminal-width.ts
815
+ // ../toolcraft-design/src/dashboard/terminal-width.ts
722
816
  var graphemeSegmenter3 = new Intl.Segmenter(void 0, { granularity: "grapheme" });
723
817
 
724
- // ../design-system/src/dashboard/terminal.ts
818
+ // ../toolcraft-design/src/dashboard/terminal.ts
725
819
  import readline from "node:readline";
726
820
  import { PassThrough } from "node:stream";
727
821
 
728
- // ../design-system/src/explorer/state.ts
822
+ // ../toolcraft-design/src/explorer/state.ts
729
823
  var REGION_HEADER = 1 << 0;
730
824
  var REGION_LIST = 1 << 1;
731
825
  var REGION_DETAIL = 1 << 2;
@@ -734,13 +828,13 @@ var REGION_MODAL = 1 << 4;
734
828
  var REGION_TOAST = 1 << 5;
735
829
  var REGION_ALL = REGION_HEADER | REGION_LIST | REGION_DETAIL | REGION_FOOTER | REGION_MODAL | REGION_TOAST;
736
830
 
737
- // ../design-system/src/prompts/index.ts
831
+ // ../toolcraft-design/src/prompts/index.ts
738
832
  import * as clack from "@clack/prompts";
739
833
 
740
- // ../design-system/src/prompts/primitives/cancel.ts
834
+ // ../toolcraft-design/src/prompts/primitives/cancel.ts
741
835
  import { isCancel } from "@clack/prompts";
742
836
 
743
- // ../design-system/src/static/spinner.ts
837
+ // ../toolcraft-design/src/static/spinner.ts
744
838
  var SPINNER_FRAMES = Object.freeze(["\u25D2", "\u25D0", "\u25D3", "\u25D1"]);
745
839
 
746
840
  // ../config-mutations/src/formats/json.ts
@@ -844,17 +938,17 @@ function resolveHomeRelativePath(targetPath, homeDir) {
844
938
  return targetPath;
845
939
  }
846
940
  function getSkillFolderWithHome(agent, scope, cwd, homeDir) {
847
- const config = getAgentConfig(agent);
848
- if (!config) {
941
+ const config2 = getAgentConfig(agent);
942
+ if (!config2) {
849
943
  throwUnsupportedAgent(agent);
850
944
  }
851
945
  return {
852
946
  displayPath: path9.join(
853
- scope === "global" ? config.globalSkillDir : config.localSkillDir,
947
+ scope === "global" ? config2.globalSkillDir : config2.localSkillDir,
854
948
  TERMINAL_PILOT_SKILL_NAME
855
949
  ),
856
950
  fullPath: path9.join(
857
- scope === "global" ? resolveHomeRelativePath(config.globalSkillDir, homeDir) : path9.resolve(cwd, config.localSkillDir),
951
+ scope === "global" ? resolveHomeRelativePath(config2.globalSkillDir, homeDir) : path9.resolve(cwd, config2.localSkillDir),
858
952
  TERMINAL_PILOT_SKILL_NAME
859
953
  )
860
954
  };