terminal-pilot 0.0.20 → 0.0.22

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 (58) hide show
  1. package/dist/cli.js +1011 -452
  2. package/dist/cli.js.map +4 -4
  3. package/dist/commands/close-session.js +6 -4
  4. package/dist/commands/close-session.js.map +3 -3
  5. package/dist/commands/create-session.js +6 -4
  6. package/dist/commands/create-session.js.map +3 -3
  7. package/dist/commands/fill.js +6 -4
  8. package/dist/commands/fill.js.map +3 -3
  9. package/dist/commands/get-session.js +6 -4
  10. package/dist/commands/get-session.js.map +3 -3
  11. package/dist/commands/index.js +299 -159
  12. package/dist/commands/index.js.map +4 -4
  13. package/dist/commands/install.js +251 -113
  14. package/dist/commands/install.js.map +4 -4
  15. package/dist/commands/installer.js +190 -62
  16. package/dist/commands/installer.js.map +4 -4
  17. package/dist/commands/list-sessions.js +6 -4
  18. package/dist/commands/list-sessions.js.map +3 -3
  19. package/dist/commands/press-key.js +6 -4
  20. package/dist/commands/press-key.js.map +3 -3
  21. package/dist/commands/read-history.js +6 -4
  22. package/dist/commands/read-history.js.map +3 -3
  23. package/dist/commands/read-screen.js +6 -4
  24. package/dist/commands/read-screen.js.map +3 -3
  25. package/dist/commands/resize.js +6 -4
  26. package/dist/commands/resize.js.map +3 -3
  27. package/dist/commands/runtime.js +6 -4
  28. package/dist/commands/runtime.js.map +3 -3
  29. package/dist/commands/screenshot.js +17 -8
  30. package/dist/commands/screenshot.js.map +3 -3
  31. package/dist/commands/send-signal.js +6 -4
  32. package/dist/commands/send-signal.js.map +3 -3
  33. package/dist/commands/type.js +6 -4
  34. package/dist/commands/type.js.map +3 -3
  35. package/dist/commands/uninstall.js +226 -98
  36. package/dist/commands/uninstall.js.map +4 -4
  37. package/dist/commands/wait-for-exit.js +6 -4
  38. package/dist/commands/wait-for-exit.js.map +3 -3
  39. package/dist/commands/wait-for.js +6 -4
  40. package/dist/commands/wait-for.js.map +3 -3
  41. package/dist/errors.d.ts +1 -0
  42. package/dist/errors.js +8 -0
  43. package/dist/errors.js.map +7 -0
  44. package/dist/index.js +8 -4
  45. package/dist/index.js.map +3 -3
  46. package/dist/terminal-pilot.js +6 -4
  47. package/dist/terminal-pilot.js.map +3 -3
  48. package/dist/terminal-session.js +6 -4
  49. package/dist/terminal-session.js.map +3 -3
  50. package/dist/testing/cli-repl.js +1011 -452
  51. package/dist/testing/cli-repl.js.map +4 -4
  52. package/dist/testing/qa-cli.js +1011 -452
  53. package/dist/testing/qa-cli.js.map +4 -4
  54. package/node_modules/@poe-code/agent-skill-config/dist/apply.js +4 -1
  55. package/node_modules/@poe-code/agent-skill-config/dist/bridge-active-skills.js +1 -1
  56. package/node_modules/@poe-code/agent-skill-config/dist/git-exclude.js +17 -9
  57. package/node_modules/@poe-code/agent-skill-config/dist/templates.js +4 -1
  58. package/package.json +2 -1
@@ -1,5 +1,5 @@
1
1
  // src/commands/uninstall.ts
2
- import { randomUUID as randomUUID2 } from "node:crypto";
2
+ import { randomUUID as randomUUID4 } from "node:crypto";
3
3
 
4
4
  // ../toolcraft/src/index.ts
5
5
  import { fileURLToPath as fileURLToPath2 } from "node:url";
@@ -13,19 +13,19 @@ var UserError = class extends Error {
13
13
  };
14
14
 
15
15
  // ../toolcraft/src/human-in-loop/config.ts
16
- function validateHumanInLoopOnDefine(config) {
17
- const label = Array.isArray(config.children) ? "group" : "command";
18
- if (config.confirm === true && config.humanInLoop !== void 0 && config.humanInLoop !== null) {
19
- throw new Error(`${label} '${config.name}': use either confirm or humanInLoop, not both`);
16
+ function validateHumanInLoopOnDefine(config2) {
17
+ const label = Array.isArray(config2.children) ? "group" : "command";
18
+ if (config2.confirm === true && config2.humanInLoop !== void 0 && config2.humanInLoop !== null) {
19
+ throw new Error(`${label} '${config2.name}': use either confirm or humanInLoop, not both`);
20
20
  }
21
- if (config.humanInLoop === void 0 || config.humanInLoop === null) {
21
+ if (config2.humanInLoop === void 0 || config2.humanInLoop === null) {
22
22
  return;
23
23
  }
24
- if (config.humanInLoop.mode !== "sync" && config.humanInLoop.mode !== "async") {
25
- throw new Error(`${label} '${config.name}': humanInLoop.mode must be "sync" or "async"`);
24
+ if (config2.humanInLoop.mode !== "sync" && config2.humanInLoop.mode !== "async") {
25
+ throw new Error(`${label} '${config2.name}': humanInLoop.mode must be "sync" or "async"`);
26
26
  }
27
- if (typeof config.humanInLoop.message !== "function") {
28
- throw new Error(`${label} '${config.name}': humanInLoop.message must be a function`);
27
+ if (typeof config2.humanInLoop.message !== "function") {
28
+ throw new Error(`${label} '${config2.name}': humanInLoop.message must be a function`);
29
29
  }
30
30
  }
31
31
  function mergeHumanInLoopFromGroup(groupHumanInLoop, childHumanInLoop) {
@@ -55,12 +55,12 @@ function assertValidBranches(branches, discriminator) {
55
55
  }
56
56
  }
57
57
  }
58
- function OneOf(config) {
59
- assertValidBranches(config.branches, config.discriminator);
58
+ function OneOf(config2) {
59
+ assertValidBranches(config2.branches, config2.discriminator);
60
60
  return {
61
61
  kind: "oneOf",
62
- discriminator: config.discriminator,
63
- branches: config.branches
62
+ discriminator: config2.discriminator,
63
+ branches: config2.branches
64
64
  };
65
65
  }
66
66
 
@@ -340,28 +340,28 @@ function mergeSecrets(parent, child) {
340
340
  function resolveCommandScope(ownScope, inheritedScope) {
341
341
  return cloneScope(ownScope ?? inheritedScope) ?? ["cli", "sdk"];
342
342
  }
343
- function createBaseCommand(config) {
343
+ function createBaseCommand(config2) {
344
344
  const command = {
345
345
  kind: "command",
346
- name: config.name,
347
- description: config.description,
348
- aliases: [...config.aliases ?? []],
349
- positional: [...config.positional ?? []],
350
- params: config.params,
351
- secrets: cloneSecrets(config.secrets),
352
- scope: resolveCommandScope(config.scope, void 0),
353
- confirm: config.confirm ?? false,
354
- humanInLoop: config.humanInLoop,
355
- requires: cloneRequires(config.requires),
356
- handler: config.handler,
357
- render: config.render
346
+ name: config2.name,
347
+ description: config2.description,
348
+ aliases: [...config2.aliases ?? []],
349
+ positional: [...config2.positional ?? []],
350
+ params: config2.params,
351
+ secrets: cloneSecrets(config2.secrets),
352
+ scope: resolveCommandScope(config2.scope, void 0),
353
+ confirm: config2.confirm ?? false,
354
+ humanInLoop: config2.humanInLoop,
355
+ requires: cloneRequires(config2.requires),
356
+ handler: config2.handler,
357
+ render: config2.render
358
358
  };
359
359
  Object.defineProperty(command, commandConfigSymbol, {
360
360
  value: {
361
- scope: cloneScope(config.scope),
362
- humanInLoop: config.humanInLoop,
363
- secrets: cloneSecrets(config.secrets),
364
- requires: cloneRequires(config.requires),
361
+ scope: cloneScope(config2.scope),
362
+ humanInLoop: config2.humanInLoop,
363
+ secrets: cloneSecrets(config2.secrets),
364
+ requires: cloneRequires(config2.requires),
365
365
  sourcePath: inferCommandSourcePath()
366
366
  }
367
367
  });
@@ -401,10 +401,10 @@ function materializeCommand(command, inherited) {
401
401
  });
402
402
  return materialized;
403
403
  }
404
- function defineCommand(config) {
405
- validateHumanInLoopOnDefine(config);
404
+ function defineCommand(config2) {
405
+ validateHumanInLoopOnDefine(config2);
406
406
  return materializeCommand(
407
- createBaseCommand(config),
407
+ createBaseCommand(config2),
408
408
  {
409
409
  scope: void 0,
410
410
  humanInLoop: void 0,
@@ -414,6 +414,11 @@ function defineCommand(config) {
414
414
  );
415
415
  }
416
416
 
417
+ // src/errors.ts
418
+ function hasOwnErrorCode(error2, code) {
419
+ return error2 instanceof Error && Object.prototype.hasOwnProperty.call(error2, "code") && error2.code === code;
420
+ }
421
+
417
422
  // src/commands/installer.ts
418
423
  import os2 from "node:os";
419
424
  import path9 from "node:path";
@@ -433,6 +438,11 @@ var claudeCodeAgent = {
433
438
  aliases: ["claude"],
434
439
  binaryName: "claude",
435
440
  apiShapes: ["anthropic-messages"],
441
+ otelCapture: {
442
+ env: {
443
+ CLAUDE_CODE_ENABLE_TELEMETRY: "1"
444
+ }
445
+ },
436
446
  configPath: "~/.claude/settings.json",
437
447
  branding: {
438
448
  colors: {
@@ -465,6 +475,16 @@ var codexAgent = {
465
475
  summary: "Configure Codex to use Poe as the model provider.",
466
476
  binaryName: "codex",
467
477
  apiShapes: ["openai-responses"],
478
+ otelCapture: {
479
+ args: (endpoint, content) => [
480
+ "-c",
481
+ `otel.trace_exporter={"otlp-http"={endpoint=${JSON.stringify(`${endpoint}/v1/traces`)},protocol="json"}}`,
482
+ "-c",
483
+ `otel.exporter={"otlp-http"={endpoint=${JSON.stringify(`${endpoint}/v1/logs`)},protocol="json"}}`,
484
+ "-c",
485
+ `otel.log_user_prompt=${content}`
486
+ ]
487
+ },
468
488
  configPath: "~/.codex/config.toml",
469
489
  branding: {
470
490
  colors: {
@@ -500,6 +520,11 @@ var openCodeAgent = {
500
520
  summary: "Configure OpenCode CLI to use the Poe API.",
501
521
  binaryName: "opencode",
502
522
  apiShapes: ["openai-chat-completions"],
523
+ otelCapture: {
524
+ env: {
525
+ OPENCODE_CONFIG_CONTENT: '{"experimental":{"openTelemetry":true}}'
526
+ }
527
+ },
503
528
  configPath: "~/.config/opencode/config.json",
504
529
  branding: {
505
530
  colors: {
@@ -535,6 +560,7 @@ var gooseAgent = {
535
560
  summary: "Block's open-source AI agent with ACP support.",
536
561
  binaryName: "goose",
537
562
  apiShapes: ["openai-chat-completions"],
563
+ otelCapture: {},
538
564
  configPath: "~/.config/goose/config.yaml",
539
565
  branding: {
540
566
  colors: {
@@ -568,6 +594,12 @@ function freezeAgent(agent) {
568
594
  if (agent.apiShapes !== void 0) {
569
595
  Object.freeze(agent.apiShapes);
570
596
  }
597
+ if (agent.otelCapture?.env !== void 0) {
598
+ Object.freeze(agent.otelCapture.env);
599
+ }
600
+ if (agent.otelCapture !== void 0) {
601
+ Object.freeze(agent.otelCapture);
602
+ }
571
603
  Object.freeze(agent.branding.colors);
572
604
  Object.freeze(agent.branding);
573
605
  return Object.freeze(agent);
@@ -628,11 +660,11 @@ function resolveAgentSupport(input, registry = agentSkillConfigs) {
628
660
  if (!resolvedId) {
629
661
  return { status: "unknown", input };
630
662
  }
631
- const config = registry[resolvedId];
632
- if (!config) {
663
+ const config2 = registry[resolvedId];
664
+ if (!config2) {
633
665
  return { status: "unsupported", input, id: resolvedId };
634
666
  }
635
- return { status: "supported", input, id: resolvedId, config: { ...config } };
667
+ return { status: "supported", input, id: resolvedId, config: { ...config2 } };
636
668
  }
637
669
  function getAgentConfig(agentId) {
638
670
  const support = resolveAgentSupport(agentId);
@@ -640,9 +672,10 @@ function getAgentConfig(agentId) {
640
672
  }
641
673
 
642
674
  // ../config-mutations/src/execution/apply-mutation.ts
675
+ import { randomUUID } from "node:crypto";
643
676
  import path4 from "node:path";
644
677
 
645
- // ../design-system/src/internal/color-support.ts
678
+ // ../toolcraft-design/src/internal/color-support.ts
646
679
  function supportsColor(env = process.env, stream = process.stdout) {
647
680
  if (env.FORCE_COLOR !== void 0 && env.FORCE_COLOR !== "0") {
648
681
  return true;
@@ -656,7 +689,7 @@ function supportsColor(env = process.env, stream = process.stdout) {
656
689
  return typeof env.TERM === "string" && env.TERM.length > 0 && env.TERM !== "dumb";
657
690
  }
658
691
 
659
- // ../design-system/src/components/color.ts
692
+ // ../toolcraft-design/src/components/color.ts
660
693
  var reset = "\x1B[0m";
661
694
  var ansiStyles = {
662
695
  reset: { open: reset },
@@ -758,41 +791,122 @@ function createColor(styles = []) {
758
791
  }
759
792
  var color = createColor();
760
793
 
761
- // ../design-system/src/tokens/colors.ts
762
- var dark = {
763
- header: (text4) => color.magentaBright.bold(text4),
764
- divider: (text4) => color.dim(text4),
765
- prompt: (text4) => color.cyan(text4),
766
- number: (text4) => color.cyanBright(text4),
767
- intro: (text4) => color.bgMagenta.white(` Poe - ${text4} `),
768
- resolvedSymbol: color.magenta("\u25C7"),
769
- errorSymbol: color.red("\u25A0"),
770
- accent: (text4) => color.cyan(text4),
771
- muted: (text4) => color.dim(text4),
772
- success: (text4) => color.green(text4),
773
- warning: (text4) => color.yellow(text4),
774
- error: (text4) => color.red(text4),
775
- info: (text4) => color.magenta(text4),
776
- badge: (text4) => color.bgYellow.black(` ${text4} `)
794
+ // ../toolcraft-design/src/tokens/brand.ts
795
+ var brands = {
796
+ purple: { name: "purple", primary: "#a200ff" },
797
+ blue: { name: "blue", primary: "#2f6fed" },
798
+ green: { name: "green", primary: "#1f9d57" }
777
799
  };
778
- var light = {
779
- header: (text4) => color.hex("#a200ff").bold(text4),
780
- divider: (text4) => color.hex("#666666")(text4),
781
- prompt: (text4) => color.hex("#006699").bold(text4),
782
- number: (text4) => color.hex("#0077cc").bold(text4),
783
- intro: (text4) => color.bgHex("#a200ff").white(` Poe - ${text4} `),
784
- resolvedSymbol: color.hex("#a200ff")("\u25C7"),
785
- errorSymbol: color.hex("#cc0000")("\u25A0"),
786
- accent: (text4) => color.hex("#006699").bold(text4),
787
- muted: (text4) => color.hex("#666666")(text4),
788
- success: (text4) => color.hex("#008800")(text4),
789
- warning: (text4) => color.hex("#cc6600")(text4),
790
- error: (text4) => color.hex("#cc0000")(text4),
791
- info: (text4) => color.hex("#a200ff")(text4),
792
- badge: (text4) => color.bgHex("#cc6600").white(` ${text4} `)
800
+
801
+ // ../toolcraft-design/src/internal/theme-state.ts
802
+ var defaults = {
803
+ brand: "purple",
804
+ label: "Poe"
793
805
  };
806
+ var config = { ...defaults };
807
+ var revision = 0;
808
+ var brandConfigured = false;
809
+ function getThemeConfig() {
810
+ return { ...config };
811
+ }
812
+ function getThemeRevision() {
813
+ return revision;
814
+ }
815
+ function isThemeBrandConfigured() {
816
+ return brandConfigured;
817
+ }
794
818
 
795
- // ../design-system/src/internal/output-format.ts
819
+ // ../toolcraft-design/src/tokens/colors.ts
820
+ var brand = brands.purple.primary;
821
+ function withStyles(palette, styles) {
822
+ return Object.defineProperty(palette, "styles", {
823
+ value: styles,
824
+ enumerable: false
825
+ });
826
+ }
827
+ function brandColor(activeBrand, purple) {
828
+ return activeBrand.name === "purple" ? purple : color.hex(activeBrand.primary);
829
+ }
830
+ function brandBackground(activeBrand, purple) {
831
+ return activeBrand.name === "purple" ? purple : color.bgHex(activeBrand.primary);
832
+ }
833
+ function createPalette(activeBrand, mode) {
834
+ const isPurple = activeBrand.name === "purple";
835
+ if (mode === "light") {
836
+ const active2 = color.hex(activeBrand.primary);
837
+ const prompt2 = isPurple ? color.hex("#006699") : active2;
838
+ const number2 = isPurple ? color.hex("#0077cc") : active2;
839
+ return withStyles(
840
+ {
841
+ header: (text4) => active2.bold(text4),
842
+ divider: (text4) => color.hex("#666666")(text4),
843
+ prompt: (text4) => prompt2.bold(text4),
844
+ number: (text4) => number2.bold(text4),
845
+ intro: (text4) => color.bgHex(activeBrand.primary).white(` ${getThemeConfig().label} - ${text4} `),
846
+ get resolvedSymbol() {
847
+ return active2("\u25C7");
848
+ },
849
+ get errorSymbol() {
850
+ return color.hex("#cc0000")("\u25A0");
851
+ },
852
+ accent: (text4) => prompt2.bold(text4),
853
+ muted: (text4) => color.hex("#666666")(text4),
854
+ success: (text4) => color.hex("#008800")(text4),
855
+ warning: (text4) => color.hex("#cc6600")(text4),
856
+ error: (text4) => color.hex("#cc0000")(text4),
857
+ info: (text4) => active2(text4),
858
+ badge: (text4) => color.bgHex("#cc6600").white(` ${text4} `)
859
+ },
860
+ {
861
+ accent: { fg: isPurple ? "#006699" : activeBrand.primary, bold: true },
862
+ muted: { fg: "#666666" },
863
+ success: { fg: "#008800" },
864
+ warning: { fg: "#cc6600" },
865
+ error: { fg: "#cc0000" },
866
+ info: { fg: activeBrand.primary }
867
+ }
868
+ );
869
+ }
870
+ const active = brandColor(activeBrand, color.magenta);
871
+ const activeBright = brandColor(activeBrand, color.magentaBright);
872
+ const activeBackground = brandBackground(activeBrand, color.bgMagenta);
873
+ const prompt = isPurple ? color.cyan : active;
874
+ const number = isPurple ? color.cyanBright : active;
875
+ return withStyles(
876
+ {
877
+ header: (text4) => activeBright.bold(text4),
878
+ divider: (text4) => color.dim(text4),
879
+ prompt: (text4) => prompt(text4),
880
+ number: (text4) => number(text4),
881
+ intro: (text4) => activeBackground.white(` ${getThemeConfig().label} - ${text4} `),
882
+ get resolvedSymbol() {
883
+ return active("\u25C7");
884
+ },
885
+ get errorSymbol() {
886
+ return color.red("\u25A0");
887
+ },
888
+ accent: (text4) => prompt(text4),
889
+ muted: (text4) => color.dim(text4),
890
+ success: (text4) => color.green(text4),
891
+ warning: (text4) => color.yellow(text4),
892
+ error: (text4) => color.red(text4),
893
+ info: (text4) => active(text4),
894
+ badge: (text4) => color.bgYellow.black(` ${text4} `)
895
+ },
896
+ {
897
+ accent: { fg: isPurple ? "cyan" : activeBrand.primary, bold: true },
898
+ muted: { dim: true },
899
+ success: { fg: "green" },
900
+ warning: { fg: "yellow" },
901
+ error: { fg: "red" },
902
+ info: { fg: isPurple ? "magenta" : activeBrand.primary }
903
+ }
904
+ );
905
+ }
906
+ var dark = createPalette(brands.purple, "dark");
907
+ var light = createPalette(brands.purple, "light");
908
+
909
+ // ../toolcraft-design/src/internal/output-format.ts
796
910
  import { AsyncLocalStorage } from "node:async_hooks";
797
911
  var VALID_FORMATS = /* @__PURE__ */ new Set(["terminal", "markdown", "json"]);
798
912
  var formatStorage = new AsyncLocalStorage();
@@ -810,7 +924,7 @@ function resolveOutputFormat(env = process.env) {
810
924
  return cached;
811
925
  }
812
926
 
813
- // ../design-system/src/internal/theme-detect.ts
927
+ // ../toolcraft-design/src/internal/theme-detect.ts
814
928
  function detectThemeFromEnv(env) {
815
929
  const apple = env.APPLE_INTERFACE_STYLE;
816
930
  if (typeof apple === "string") {
@@ -847,17 +961,30 @@ function resolveThemeName(env = process.env) {
847
961
  }
848
962
  return "dark";
849
963
  }
850
- var cachedTheme;
964
+ var themeCache = /* @__PURE__ */ new Map();
965
+ var cachedRevision = -1;
851
966
  function getTheme(env) {
967
+ const themeName = resolveThemeName(env);
968
+ const config2 = getThemeConfig();
969
+ const requestedBrand = env?.POE_BRAND?.toLowerCase();
970
+ const activeBrandName = !isThemeBrandConfigured() && requestedBrand && Object.hasOwn(brands, requestedBrand) ? requestedBrand : config2.brand;
971
+ const revision2 = getThemeRevision();
972
+ if (revision2 !== cachedRevision) {
973
+ themeCache.clear();
974
+ cachedRevision = revision2;
975
+ }
976
+ const cacheKey = `${activeBrandName}:${themeName}`;
977
+ const cachedTheme = themeCache.get(cacheKey);
852
978
  if (cachedTheme) {
853
979
  return cachedTheme;
854
980
  }
855
- const themeName = resolveThemeName(env);
856
- cachedTheme = themeName === "light" ? light : dark;
857
- return cachedTheme;
981
+ const activeBrand = brands[activeBrandName];
982
+ const theme = activeBrandName === "purple" ? themeName === "light" ? light : dark : createPalette(activeBrand, themeName);
983
+ themeCache.set(cacheKey, theme);
984
+ return theme;
858
985
  }
859
986
 
860
- // ../design-system/src/components/symbols.ts
987
+ // ../toolcraft-design/src/components/symbols.ts
861
988
  var symbols = {
862
989
  get info() {
863
990
  const format = resolveOutputFormat();
@@ -911,12 +1038,12 @@ var symbols = {
911
1038
  }
912
1039
  };
913
1040
 
914
- // ../design-system/src/internal/strip-ansi.ts
1041
+ // ../toolcraft-design/src/internal/strip-ansi.ts
915
1042
  function stripAnsi(value) {
916
1043
  return value.replace(/\u001b\[[0-9;]*m/g, "");
917
1044
  }
918
1045
 
919
- // ../design-system/src/prompts/primitives/log.ts
1046
+ // ../toolcraft-design/src/prompts/primitives/log.ts
920
1047
  function renderMarkdownInline(value) {
921
1048
  return stripAnsi(value).replaceAll("\r\n", " ").replaceAll("\n", " ").replaceAll("\r", " ");
922
1049
  }
@@ -1043,7 +1170,7 @@ var log = {
1043
1170
  error
1044
1171
  };
1045
1172
 
1046
- // ../design-system/src/components/logger.ts
1173
+ // ../toolcraft-design/src/components/logger.ts
1047
1174
  function createLogger(emitter) {
1048
1175
  const emit = (level, message2) => {
1049
1176
  if (emitter) {
@@ -1104,28 +1231,28 @@ function createLogger(emitter) {
1104
1231
  }
1105
1232
  var logger = createLogger();
1106
1233
 
1107
- // ../design-system/src/components/help-formatter.ts
1234
+ // ../toolcraft-design/src/components/help-formatter.ts
1108
1235
  var graphemeSegmenter = new Intl.Segmenter(void 0, { granularity: "grapheme" });
1109
1236
 
1110
- // ../design-system/src/components/table.ts
1237
+ // ../toolcraft-design/src/components/table.ts
1111
1238
  var graphemeSegmenter2 = new Intl.Segmenter(void 0, { granularity: "grapheme" });
1112
1239
 
1113
- // ../design-system/src/components/browser.ts
1240
+ // ../toolcraft-design/src/components/browser.ts
1114
1241
  import { spawn } from "node:child_process";
1115
1242
  import process2 from "node:process";
1116
1243
 
1117
- // ../design-system/src/acp/writer.ts
1244
+ // ../toolcraft-design/src/acp/writer.ts
1118
1245
  import { AsyncLocalStorage as AsyncLocalStorage2 } from "node:async_hooks";
1119
1246
  var storage = new AsyncLocalStorage2();
1120
1247
 
1121
- // ../design-system/src/dashboard/terminal-width.ts
1248
+ // ../toolcraft-design/src/dashboard/terminal-width.ts
1122
1249
  var graphemeSegmenter3 = new Intl.Segmenter(void 0, { granularity: "grapheme" });
1123
1250
 
1124
- // ../design-system/src/dashboard/terminal.ts
1251
+ // ../toolcraft-design/src/dashboard/terminal.ts
1125
1252
  import readline from "node:readline";
1126
1253
  import { PassThrough } from "node:stream";
1127
1254
 
1128
- // ../design-system/src/explorer/state.ts
1255
+ // ../toolcraft-design/src/explorer/state.ts
1129
1256
  var REGION_HEADER = 1 << 0;
1130
1257
  var REGION_LIST = 1 << 1;
1131
1258
  var REGION_DETAIL = 1 << 2;
@@ -1134,13 +1261,13 @@ var REGION_MODAL = 1 << 4;
1134
1261
  var REGION_TOAST = 1 << 5;
1135
1262
  var REGION_ALL = REGION_HEADER | REGION_LIST | REGION_DETAIL | REGION_FOOTER | REGION_MODAL | REGION_TOAST;
1136
1263
 
1137
- // ../design-system/src/prompts/index.ts
1264
+ // ../toolcraft-design/src/prompts/index.ts
1138
1265
  import * as clack from "@clack/prompts";
1139
1266
 
1140
- // ../design-system/src/prompts/primitives/cancel.ts
1267
+ // ../toolcraft-design/src/prompts/primitives/cancel.ts
1141
1268
  import { isCancel } from "@clack/prompts";
1142
1269
 
1143
- // ../design-system/src/static/spinner.ts
1270
+ // ../toolcraft-design/src/static/spinner.ts
1144
1271
  var SPINNER_FRAMES = Object.freeze(["\u25D2", "\u25D0", "\u25D3", "\u25D1"]);
1145
1272
 
1146
1273
  // ../config-mutations/src/formats/json.ts
@@ -1166,12 +1293,13 @@ import path6 from "node:path";
1166
1293
 
1167
1294
  // ../agent-skill-config/src/git-exclude.ts
1168
1295
  import { execFileSync } from "node:child_process";
1296
+ import { randomUUID as randomUUID2 } from "node:crypto";
1169
1297
  import * as fs from "node:fs";
1170
1298
  import path7 from "node:path";
1171
1299
 
1172
1300
  // ../agent-skill-config/src/bridge-active-skills.ts
1173
1301
  import * as fs2 from "node:fs";
1174
- import { createHash, randomUUID } from "node:crypto";
1302
+ import { createHash, randomUUID as randomUUID3 } from "node:crypto";
1175
1303
  import path8 from "node:path";
1176
1304
 
1177
1305
  // src/commands/installer.ts
@@ -1179,7 +1307,7 @@ var DEFAULT_INSTALL_AGENT = "claude-code";
1179
1307
  var TERMINAL_PILOT_SKILL_NAME = "terminal-pilot";
1180
1308
  var installableAgents = supportedAgents;
1181
1309
  function isNotFoundError(error2) {
1182
- return typeof error2 === "object" && error2 !== null && "code" in error2 && error2.code === "ENOENT";
1310
+ return hasOwnErrorCode(error2, "ENOENT");
1183
1311
  }
1184
1312
  function resolveInstallerServices(installer) {
1185
1313
  return {
@@ -1209,17 +1337,17 @@ function resolveHomeRelativePath(targetPath, homeDir) {
1209
1337
  return targetPath;
1210
1338
  }
1211
1339
  function getSkillFolderWithHome(agent, scope, cwd, homeDir) {
1212
- const config = getAgentConfig(agent);
1213
- if (!config) {
1340
+ const config2 = getAgentConfig(agent);
1341
+ if (!config2) {
1214
1342
  throwUnsupportedAgent(agent);
1215
1343
  }
1216
1344
  return {
1217
1345
  displayPath: path9.join(
1218
- scope === "global" ? config.globalSkillDir : config.localSkillDir,
1346
+ scope === "global" ? config2.globalSkillDir : config2.localSkillDir,
1219
1347
  TERMINAL_PILOT_SKILL_NAME
1220
1348
  ),
1221
1349
  fullPath: path9.join(
1222
- scope === "global" ? resolveHomeRelativePath(config.globalSkillDir, homeDir) : path9.resolve(cwd, config.localSkillDir),
1350
+ scope === "global" ? resolveHomeRelativePath(config2.globalSkillDir, homeDir) : path9.resolve(cwd, config2.localSkillDir),
1223
1351
  TERMINAL_PILOT_SKILL_NAME
1224
1352
  )
1225
1353
  };
@@ -1277,7 +1405,7 @@ var uninstall = defineCommand({
1277
1405
  if (!await folderExists(services.fs, skill.fullPath)) {
1278
1406
  continue;
1279
1407
  }
1280
- const stagingPath = `${skill.fullPath}.removing-${randomUUID2()}`;
1408
+ const stagingPath = `${skill.fullPath}.removing-${randomUUID4()}`;
1281
1409
  await services.fs.rename(skill.fullPath, stagingPath);
1282
1410
  staged.push({ ...skill, stagingPath });
1283
1411
  }
@@ -1303,7 +1431,7 @@ async function folderExists(fs3, folderPath) {
1303
1431
  await fs3.stat(folderPath);
1304
1432
  return true;
1305
1433
  } catch (error2) {
1306
- if (typeof error2 === "object" && error2 !== null && "code" in error2 && error2.code === "ENOENT") {
1434
+ if (hasOwnErrorCode(error2, "ENOENT")) {
1307
1435
  return false;
1308
1436
  }
1309
1437
  throw error2;