@cydm/pie 1.0.50 → 2.1.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.
Files changed (51) hide show
  1. package/README.md +32 -15
  2. package/dist/builtin/extensions/ask-user/index.js +4 -3
  3. package/dist/builtin/extensions/ask-user/package.json +8 -7
  4. package/dist/builtin/extensions/changelog/package.json +9 -9
  5. package/dist/builtin/extensions/computer-use/index.js +5466 -0
  6. package/dist/builtin/extensions/computer-use/package.json +11 -0
  7. package/dist/builtin/extensions/computer-use/prebuilt/linux/arm64/linux-bridge +0 -0
  8. package/dist/builtin/extensions/computer-use/prebuilt/linux/x64/linux-bridge +0 -0
  9. package/dist/builtin/extensions/computer-use/prebuilt/macos/arm64/pie-computer-use +0 -0
  10. package/dist/builtin/extensions/computer-use/prebuilt/macos/universal/pie-computer-use.app/Contents/Info.plist +24 -0
  11. package/dist/builtin/extensions/computer-use/prebuilt/macos/universal/pie-computer-use.app/Contents/MacOS/pie-computer-use +0 -0
  12. package/dist/builtin/extensions/computer-use/prebuilt/macos/universal/pie-computer-use.app/Contents/_CodeSignature/CodeResources +115 -0
  13. package/dist/builtin/extensions/computer-use/prebuilt/macos/x64/pie-computer-use +0 -0
  14. package/dist/builtin/extensions/computer-use/prebuilt/windows/windows-bridge.exe +0 -0
  15. package/dist/builtin/extensions/computer-use/scripts/build-native.mjs +277 -0
  16. package/dist/builtin/extensions/computer-use/scripts/helper-path.mjs +48 -0
  17. package/dist/builtin/extensions/computer-use/scripts/setup-helper.mjs +549 -0
  18. package/dist/builtin/extensions/document-attachments/index.js +51 -0
  19. package/dist/builtin/extensions/document-attachments/package.json +9 -9
  20. package/dist/builtin/extensions/init/package.json +9 -9
  21. package/dist/builtin/extensions/mcp-adapter/index.js +25250 -0
  22. package/dist/builtin/extensions/mcp-adapter/package.json +11 -0
  23. package/dist/builtin/extensions/plan-mode/index.js +4 -3
  24. package/dist/builtin/extensions/plan-mode/package.json +9 -9
  25. package/dist/builtin/extensions/subagent/index.js +17 -20
  26. package/dist/builtin/extensions/subagent/package.json +16 -12
  27. package/dist/builtin/extensions/todo/index.js +4 -3
  28. package/dist/builtin/extensions/todo/package.json +9 -9
  29. package/dist/builtin/skills/chrome-devtools-axi/CHANGELOG.md +5 -0
  30. package/dist/builtin/skills/chrome-devtools-axi/README.md +17 -0
  31. package/dist/builtin/skills/chrome-devtools-axi/SKILL.md +31 -0
  32. package/dist/builtin/skills/chrome-devtools-axi/chrome-devtools-axi-cli.js +77 -0
  33. package/dist/builtin/skills/chrome-devtools-axi/package.json +12 -0
  34. package/dist/builtin/skills/tui-use/README.md +7 -0
  35. package/dist/builtin/skills/tui-use/SKILL.md +58 -0
  36. package/dist/chunks/chunk-5353DEEC.js +130 -0
  37. package/dist/chunks/{chunk-XBWFDIAU.js → chunk-G2POWIA5.js} +129 -194
  38. package/dist/chunks/{chunk-K6ZOCJ4V.js → chunk-IM43UYVV.js} +861 -3376
  39. package/dist/chunks/{chunk-DZS34ACX.js → chunk-PMPD56N2.js} +243 -87
  40. package/dist/chunks/{chunk-FKAO25XH.js → chunk-QJH6YN2W.js} +1 -1
  41. package/dist/chunks/chunk-XXGYUYXI.js +2718 -0
  42. package/dist/chunks/{src-HYZFAW4V.js → src-QSP2OPHU.js} +3 -2
  43. package/dist/chunks/{test-stream-5T7E7C25.js → test-stream-CVGWFLSX.js} +2 -1
  44. package/dist/chunks/webapi-MBCKO7ZV.js +2481 -0
  45. package/dist/cli.js +186 -78
  46. package/package.json +5 -4
  47. package/dist/builtin/skills/browser-tools/CHANGELOG.md +0 -5
  48. package/dist/builtin/skills/browser-tools/README.md +0 -17
  49. package/dist/builtin/skills/browser-tools/SKILL.md +0 -43
  50. package/dist/builtin/skills/browser-tools/package.json +0 -12
  51. package/dist/builtin/skills/browser-tools/playwright-cli.js +0 -45
package/dist/cli.js CHANGED
@@ -1,14 +1,15 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
3
3
  import {
4
- resolveCliProjectRoot
5
- } from "./chunks/chunk-WLFOBECN.js";
6
- import {
7
- VERSION,
8
4
  cleanupBashOutputArtifacts,
5
+ createBashTool,
9
6
  createCliHostCapabilities,
10
7
  createCliWebResearchHealthStore,
11
8
  formatSize,
9
+ truncateHeadTail
10
+ } from "./chunks/chunk-G2POWIA5.js";
11
+ import {
12
+ VERSION,
12
13
  getAgentDir,
13
14
  getBuiltinDir,
14
15
  getConfigDir,
@@ -20,9 +21,11 @@ import {
20
21
  getSessionsDir,
21
22
  getSettingsPath,
22
23
  getThemesDir,
23
- migrateConfigFromAgentDir,
24
- truncateHeadTail
25
- } from "./chunks/chunk-XBWFDIAU.js";
24
+ migrateConfigFromAgentDir
25
+ } from "./chunks/chunk-5353DEEC.js";
26
+ import {
27
+ resolveCliProjectRoot
28
+ } from "./chunks/chunk-WLFOBECN.js";
26
29
  import {
27
30
  AGENTS_CONTEXT_FILE_NAME,
28
31
  AgentSessionController,
@@ -73,8 +76,8 @@ import {
73
76
  setExtensionEnabledInSettings,
74
77
  shouldPreserveExecutionStateForUserText,
75
78
  supersedeExecutionState
76
- } from "./chunks/chunk-DZS34ACX.js";
77
- import "./chunks/chunk-FKAO25XH.js";
79
+ } from "./chunks/chunk-PMPD56N2.js";
80
+ import "./chunks/chunk-QJH6YN2W.js";
78
81
  import {
79
82
  Deref,
80
83
  EMPTY_ASSISTANT_CONTENT_ERROR,
@@ -82,24 +85,12 @@ import {
82
85
  ExtendsUndefinedCheck,
83
86
  HasTransform,
84
87
  Hash,
85
- IsArray,
86
- IsBigInt,
87
- IsNumber,
88
- IsSchema,
89
- IsString,
90
- KeyOfPattern,
91
- Kind,
92
88
  MODEL_CLASS_FALLBACK_ORDER,
93
- Never,
94
89
  OPENAI_COMPAT_PROTOCOL_ERROR_CODE,
95
- Ref,
96
90
  TransformDecode,
97
91
  TransformDecodeCheckError,
98
92
  TransformEncode,
99
93
  TransformEncodeCheckError,
100
- Type,
101
- TypeBoxError,
102
- TypeSystemPolicy,
103
94
  completeSimple,
104
95
  createLogger,
105
96
  format_exports,
@@ -110,7 +101,21 @@ import {
110
101
  setLogger,
111
102
  sortToolModelCandidatesByCapability,
112
103
  type_exports
113
- } from "./chunks/chunk-K6ZOCJ4V.js";
104
+ } from "./chunks/chunk-IM43UYVV.js";
105
+ import {
106
+ IsArray,
107
+ IsBigInt,
108
+ IsNumber,
109
+ IsSchema2 as IsSchema,
110
+ IsString,
111
+ KeyOfPattern,
112
+ Kind,
113
+ Never,
114
+ Ref,
115
+ Type,
116
+ TypeBoxError,
117
+ TypeSystemPolicy
118
+ } from "./chunks/chunk-XXGYUYXI.js";
114
119
  import {
115
120
  __commonJS,
116
121
  __require,
@@ -46516,57 +46521,85 @@ function findDoctorChromeExecutable() {
46516
46521
  }
46517
46522
  return os.platform() === "win32" ? findOnPath(["chrome.exe", "msedge.exe"]) : findOnPath(["google-chrome", "google-chrome-stable", "chromium", "chromium-browser", "microsoft-edge"]);
46518
46523
  }
46519
- function resolveDoctorPlaywrightCli() {
46524
+ function resolveDoctorChromeDevtoolsAxiCli() {
46520
46525
  try {
46521
- return require2.resolve("@playwright/cli/playwright-cli.js");
46526
+ const packageJson = require2.resolve("chrome-devtools-axi/package.json");
46527
+ return path5.join(path5.dirname(packageJson), "dist", "bin", "chrome-devtools-axi.js");
46522
46528
  } catch {
46523
46529
  return void 0;
46524
46530
  }
46525
46531
  }
46526
- function checkPlaywrightCli() {
46527
- const cliPath = resolveDoctorPlaywrightCli();
46532
+ function checkChromeDevtoolsAxiCli() {
46533
+ const cliPath = resolveDoctorChromeDevtoolsAxiCli();
46528
46534
  if (!cliPath) {
46529
46535
  return {
46530
- id: "playwright_cli",
46531
- label: "Playwright CLI",
46536
+ id: "chrome_devtools_axi",
46537
+ label: "chrome-devtools-axi CLI",
46532
46538
  status: "fail",
46533
- message: "Microsoft Playwright CLI is not resolvable from Pie's runtime dependencies."
46539
+ message: "chrome-devtools-axi is not resolvable from Pie's runtime dependencies."
46534
46540
  };
46535
46541
  }
46536
46542
  const result = spawnSync(process.execPath, [cliPath, "--version"], { encoding: "utf8", shell: false });
46537
46543
  const ok = (result.status ?? 1) === 0;
46538
46544
  return {
46539
- id: "playwright_cli",
46540
- label: "Playwright CLI",
46545
+ id: "chrome_devtools_axi",
46546
+ label: "chrome-devtools-axi CLI",
46541
46547
  status: ok ? "pass" : "fail",
46542
- message: ok ? `Playwright CLI is available: ${(result.stdout || result.stderr).trim() || cliPath}` : `Playwright CLI failed: ${result.stderr || result.error?.message || "unknown error"}`,
46548
+ message: ok ? `chrome-devtools-axi is available: ${(result.stdout || result.stderr).trim() || cliPath}` : `chrome-devtools-axi failed: ${result.stderr || result.error?.message || "unknown error"}`,
46543
46549
  details: { cliPath }
46544
46550
  };
46545
46551
  }
46546
- function checkPlaywrightBrowser() {
46547
- let executablePath;
46548
- try {
46549
- const playwright = require2("playwright");
46550
- executablePath = playwright.chromium?.executablePath?.();
46551
- } catch {
46552
- executablePath = void 0;
46552
+ function checkComputerUse() {
46553
+ if (process.platform === "darwin") {
46554
+ const envAppPath = process.env.PIE_COMPUTER_USE_HELPER_APP_PATH?.trim();
46555
+ const systemAppPath = path5.join("/Applications", "pie-computer-use.app");
46556
+ const systemAppUsable = fs5.existsSync(systemAppPath) && canWriteDirectory(path5.dirname(systemAppPath)).ok;
46557
+ const appPath = envAppPath || (systemAppUsable ? systemAppPath : path5.join(getConfigDir(), "computer-use", "pie-computer-use.app"));
46558
+ const executable = path5.join(appPath, "Contents", "MacOS", "pie-computer-use");
46559
+ if (isExecutable(executable)) {
46560
+ return {
46561
+ id: "computer_use_helper",
46562
+ label: "computer-use helper",
46563
+ status: "pass",
46564
+ message: `computer-use helper app is installed: ${appPath}. It also needs Accessibility and Screen Recording grants in System Settings \u2192 Privacy & Security.`,
46565
+ details: { appPath }
46566
+ };
46567
+ }
46568
+ return {
46569
+ id: "computer_use_helper",
46570
+ label: "computer-use helper",
46571
+ status: "warn",
46572
+ message: `computer-use helper app is not installed yet; it installs on first tool use to ${appPath}. Afterwards grant Accessibility and Screen Recording to pie-computer-use.app in System Settings \u2192 Privacy & Security.`,
46573
+ details: { appPath }
46574
+ };
46553
46575
  }
46554
- if (executablePath && fs5.existsSync(executablePath)) {
46576
+ if (process.platform === "linux") {
46577
+ const helperPath = process.env.PIE_COMPUTER_USE_LINUX_HELPER_PATH ?? path5.join(getConfigDir(), "helpers", "computer-use", "linux-bridge");
46578
+ const installed = isExecutable(helperPath);
46579
+ return {
46580
+ id: "computer_use_helper",
46581
+ label: "computer-use helper",
46582
+ status: installed ? "pass" : "warn",
46583
+ message: installed ? `computer-use helper is installed: ${helperPath}. Requires an AT-SPI2 bus (desktop session).` : `computer-use helper is not installed yet; it installs on first tool use to ${helperPath}. Requires an AT-SPI2 bus (desktop session).`,
46584
+ details: { helperPath }
46585
+ };
46586
+ }
46587
+ if (process.platform === "win32") {
46588
+ const helperPath = process.env.PIE_COMPUTER_USE_WINDOWS_HELPER_PATH ?? path5.join(getConfigDir(), "helpers", "computer-use", "windows-bridge.exe");
46589
+ const installed = fs5.existsSync(helperPath);
46555
46590
  return {
46556
- id: "playwright_browser",
46557
- label: "Playwright browser",
46558
- status: "pass",
46559
- message: `Chromium browser is installed for Playwright: ${executablePath}`,
46560
- details: { executablePath }
46591
+ id: "computer_use_helper",
46592
+ label: "computer-use helper",
46593
+ status: installed ? "pass" : "warn",
46594
+ message: installed ? `computer-use helper is installed: ${helperPath}. Requires an interactive desktop session.` : `computer-use helper is not installed yet; it installs on first tool use to ${helperPath}. Requires an interactive desktop session.`,
46595
+ details: { helperPath }
46561
46596
  };
46562
46597
  }
46563
- const skillWrapper = path5.join(getBuiltinDir(), "skills", "browser-tools", "playwright-cli.js");
46564
46598
  return {
46565
- id: "playwright_browser",
46566
- label: "Playwright browser",
46599
+ id: "computer_use_helper",
46600
+ label: "computer-use helper",
46567
46601
  status: "warn",
46568
- message: `Playwright Chromium is not installed. Run: node ${skillWrapper} install-browser chromium`,
46569
- details: { expectedExecutablePath: executablePath, skillWrapper }
46602
+ message: `computer-use is not supported on ${process.platform} (macOS, Windows, and Linux only).`
46570
46603
  };
46571
46604
  }
46572
46605
  function isRecord(value) {
@@ -46789,10 +46822,10 @@ async function runDoctor() {
46789
46822
  id: "chrome_executable",
46790
46823
  label: "Chrome executable",
46791
46824
  status: chromePath ? "pass" : "warn",
46792
- message: chromePath ? `Found browser executable: ${chromePath}` : "Could not find Chrome/Chromium/Edge. This is optional when Playwright-managed Chromium is installed."
46825
+ message: chromePath ? `Found browser executable: ${chromePath}` : "Could not find Chrome/Chromium/Edge. This is optional; chrome-devtools-axi can also attach to a running Chrome via CHROME_DEVTOOLS_AXI_BROWSER_URL."
46793
46826
  });
46794
- checks.push(checkPlaywrightCli());
46795
- checks.push(checkPlaywrightBrowser());
46827
+ checks.push(checkChromeDevtoolsAxiCli());
46828
+ checks.push(checkComputerUse());
46796
46829
  checks.push(checkUnityRegistry());
46797
46830
  checks.push(checkPieUnityRpcSkill());
46798
46831
  const runtimeLog = getRuntimeLogPath();
@@ -46824,6 +46857,7 @@ var MODE_RULES = {
46824
46857
  "~/.pie is allowlisted for Pie configuration and session support.",
46825
46858
  "Shell commands run from the workspace and return structured output, timeout, and truncation details.",
46826
46859
  "web_research is read-only, uses provider-native web/search/fetch capabilities, and does not grant bash/curl web scraping permission.",
46860
+ "computer-use observe tools only read the screen; act_ui synthesizes real desktop input and requires a first-use confirmation each session.",
46827
46861
  "Protected paths from extensions can block reads/writes even when tools are present."
46828
46862
  ],
46829
46863
  plan: [
@@ -46832,7 +46866,8 @@ var MODE_RULES = {
46832
46866
  ],
46833
46867
  yolo: [
46834
46868
  "/settings/yolo relaxes filesystem sandbox directory restrictions.",
46835
- "It does not make destructive shell commands safe; use it only in trusted workspaces."
46869
+ "It does not make destructive shell commands safe; use it only in trusted workspaces.",
46870
+ "It also bypasses the computer-use act_ui first-use confirmation."
46836
46871
  ],
46837
46872
  subagents: [
46838
46873
  "Subagents inherit the parent tool set, then runtime policy removes write and high-risk tools.",
@@ -51762,6 +51797,14 @@ var SelectList = class {
51762
51797
  const item = this.filteredItems[this.selectedIndex];
51763
51798
  return item || null;
51764
51799
  }
51800
+ /** True when the cursor sits on the first page (← cannot page further). */
51801
+ atFirstPage() {
51802
+ return this.selectedIndex < this.maxVisible;
51803
+ }
51804
+ /** True when the cursor sits on the last page (→ cannot page further). */
51805
+ atLastPage() {
51806
+ return this.selectedIndex >= this.filteredItems.length - this.maxVisible;
51807
+ }
51765
51808
  };
51766
51809
 
51767
51810
  // ../../packages/tui/src/components/editor.ts
@@ -60809,6 +60852,10 @@ var FileManager = class {
60809
60852
  getPlatformName() {
60810
60853
  return this.platform;
60811
60854
  }
60855
+ /** Whether the active platform has a registered upload adapter. */
60856
+ hasAdapter() {
60857
+ return this.sessionManager.getAdapter(this.platform) !== void 0;
60858
+ }
60812
60859
  getPlatformDisplayName() {
60813
60860
  return getProviderDisplayName(this.platform);
60814
60861
  }
@@ -61726,6 +61773,7 @@ async function understandReadFile(deps, request) {
61726
61773
  getAgentModel: deps.getAgentModel,
61727
61774
  getSessionId: deps.getSessionId,
61728
61775
  resolveToolModel: deps.resolveToolModel,
61776
+ resolveToolModelCandidates: deps.resolveToolModelCandidates,
61729
61777
  prepareFileContent: (params) => prepareFileContent(deps.configDir, params)
61730
61778
  })(request);
61731
61779
  }
@@ -61864,7 +61912,8 @@ function createCliFileSystemTools(cwd, options) {
61864
61912
  cwd,
61865
61913
  getAgentModel: fileOptions.getAgentModel ?? (() => void 0),
61866
61914
  getSessionId: fileOptions.getSessionId ?? (() => void 0),
61867
- resolveToolModel: fileOptions.resolveToolModel
61915
+ resolveToolModel: fileOptions.resolveToolModel,
61916
+ resolveToolModelCandidates: fileOptions.resolveToolModelCandidates
61868
61917
  }, request) : fileOptions.understandFile
61869
61918
  };
61870
61919
  const tools = createSharedFileSystemTools(cwd, sharedOptions).map(
@@ -62455,8 +62504,10 @@ function normalizeSessionTitle(raw) {
62455
62504
  import * as path23 from "node:path";
62456
62505
  var ExtensionSelectorComponent = class extends Container {
62457
62506
  selectList;
62458
- constructor(title, options, onSelect, onCancel) {
62507
+ shortcuts;
62508
+ constructor(title, options, onSelect, onCancel, shortcuts) {
62459
62509
  super();
62510
+ this.shortcuts = shortcuts;
62460
62511
  this.addChild(new Text(theme.bold(theme.fg("accent", title)), 0, 0));
62461
62512
  this.addChild(new Spacer(1));
62462
62513
  const items = options.map((option) => ({ value: option, label: option }));
@@ -62465,13 +62516,27 @@ var ExtensionSelectorComponent = class extends Container {
62465
62516
  this.selectList.onCancel = onCancel;
62466
62517
  this.addChild(this.selectList);
62467
62518
  this.addChild(new Spacer(1));
62519
+ const hintParts = ["\u2191\u2193 to navigate"];
62520
+ if (shortcuts?.left) hintParts.push("\u2190 back");
62521
+ if (shortcuts?.right) hintParts.push("\u2192 review");
62522
+ if (!shortcuts?.left && !shortcuts?.right) hintParts.splice(1, 0, "\u2190\u2192 to page");
62523
+ hintParts.push("Enter to select", "Esc to cancel");
62468
62524
  this.addChild(new Text(
62469
- theme.fg("dim", " \u2191\u2193 to navigate \xB7 \u2190\u2192 to page \xB7 Enter to select \xB7 Esc to cancel"),
62525
+ theme.fg("dim", ` ${hintParts.join(" \xB7 ")}`),
62470
62526
  0,
62471
62527
  0
62472
62528
  ));
62473
62529
  }
62474
62530
  handleInput(data) {
62531
+ const kb = getEditorKeybindings();
62532
+ if (this.shortcuts?.left && kb.matches(data, "cursorLeft") && this.selectList.atFirstPage()) {
62533
+ this.selectList.onSelect?.({ value: this.shortcuts.left, label: this.shortcuts.left });
62534
+ return;
62535
+ }
62536
+ if (this.shortcuts?.right && kb.matches(data, "cursorRight") && this.selectList.atLastPage()) {
62537
+ this.selectList.onSelect?.({ value: this.shortcuts.right, label: this.shortcuts.right });
62538
+ return;
62539
+ }
62475
62540
  this.selectList.handleInput(data);
62476
62541
  }
62477
62542
  getSelectList() {
@@ -62674,7 +62739,7 @@ function handleExtensionsCommand(host, args) {
62674
62739
 
62675
62740
  // src/slash-commands.ts
62676
62741
  var BUILTIN_SLASH_COMMANDS = [
62677
- { name: "sessions", description: "Pick a saved session to switch to" },
62742
+ { name: "sessions", description: "Manage sessions: resume, new, tree, fork, compact, info" },
62678
62743
  { name: "sessions/compact", description: "Summarize history and add a compact checkpoint to the session" },
62679
62744
  { name: "sessions/new", description: "Start a new session" },
62680
62745
  { name: "sessions/resume", description: "Resume a different session" },
@@ -63111,10 +63176,12 @@ var SessionSelectorComponent = class extends Container {
63111
63176
  }
63112
63177
  createItem(session) {
63113
63178
  const cwdTag = formatSessionCwdTag(session.cwd, this.options.currentCwd, this.options.homeDir);
63179
+ const unknownTag = cwdTag === void 0 && this.options.currentCwd && !(typeof session.cwd === "string" && session.cwd.length > 0) ? "unknown path" : void 0;
63180
+ const tag = cwdTag ?? unknownTag;
63114
63181
  return {
63115
63182
  value: session.id,
63116
63183
  label: session.name || `Session ${session.id.slice(0, 8)}`,
63117
- description: cwdTag ? `${cwdTag} \xB7 ${session.messageCount} messages \xB7 ${formatDate(session.updatedAt)}` : `${session.messageCount} messages \xB7 ${formatDate(session.updatedAt)}`
63184
+ description: tag ? `${tag} \xB7 ${session.messageCount} messages \xB7 ${formatDate(session.updatedAt)}` : `${session.messageCount} messages \xB7 ${formatDate(session.updatedAt)}`
63118
63185
  };
63119
63186
  }
63120
63187
  clearRefreshTimer() {
@@ -64843,6 +64910,7 @@ async function loadSession2(host, sessionId) {
64843
64910
  }
64844
64911
  setControllerBusy(host, false);
64845
64912
  setWaitingForUser(host, false);
64913
+ await host.initializeFileManager();
64846
64914
  const activeSession = host.sessionManager.getActiveSession();
64847
64915
  if (activeSession) {
64848
64916
  host.agent.sessionId = activeSession.id;
@@ -65382,7 +65450,7 @@ function handleSkillsListCommand(host) {
65382
65450
  }
65383
65451
  host.chatContainer.addChild(new Spacer(1));
65384
65452
  host.chatContainer.addChild(new Text(theme.fg("dim", "Usage: /skills/skill:<name> <your request>"), 1, 0));
65385
- host.chatContainer.addChild(new Text(theme.fg("dim", "Example: /skills/skill:browser-tools navigate to google.com"), 1, 0));
65453
+ host.chatContainer.addChild(new Text(theme.fg("dim", "Example: /skills/skill:chrome-devtools-axi navigate to google.com"), 1, 0));
65386
65454
  host.ui.requestRender();
65387
65455
  }
65388
65456
  function handleSkillCommand(host, name) {
@@ -66175,7 +66243,10 @@ async function handleClearCommand(host) {
66175
66243
  if (activeSession) {
66176
66244
  host.agent.sessionId = activeSession.id;
66177
66245
  activeSession.metadata.executionState = host.executionState.createMetadata();
66246
+ activeSession.metadata.cwd = host.options.cwd;
66247
+ activeSession.isDirty = true;
66178
66248
  }
66249
+ await host.initializeFileManager();
66179
66250
  host.syncAgentFromActiveSession();
66180
66251
  host.syncSessionModelMetadata();
66181
66252
  host.planModeEnabled = false;
@@ -66328,8 +66399,7 @@ function createExtensionContextForCommands(host) {
66328
66399
  }
66329
66400
  function registerBuiltinCommands(host) {
66330
66401
  commandTree.register(["sessions"], {
66331
- description: "Pick a saved session to switch to (tree/fork/new below)",
66332
- handler: () => host.handleResumeCommand()
66402
+ description: "Manage sessions: resume, new, tree, fork, compact, info"
66333
66403
  });
66334
66404
  commandTree.register(["sessions", "compact"], {
66335
66405
  description: "Summarize history and replace it with a compact checkpoint",
@@ -68321,7 +68391,11 @@ var MentionHandler = class {
68321
68391
  this.pushPendingStatus(pendingStatusKey, `Preparing ${option.name}...`);
68322
68392
  }
68323
68393
  const mimeType = FileCache.getMimeType(option.path);
68324
- const shouldStageLocally = !mimeType.startsWith("image/") && !mimeType.startsWith("video/");
68394
+ const isMedia = mimeType.startsWith("image/") || mimeType.startsWith("video/");
68395
+ const shouldStageLocally = !isMedia || !this.fileManager.hasAdapter();
68396
+ if (isMedia && shouldStageLocally) {
68397
+ this.pushPendingStatus(pendingStatusKey, `Staging ${option.name} locally (no upload API for this provider)...`);
68398
+ }
68325
68399
  const onProgress = (progress, stage) => {
68326
68400
  this.pushPendingStatus(
68327
68401
  pendingStatusKey,
@@ -68729,7 +68803,7 @@ var MentionHandler = class {
68729
68803
  async function initializeFileManager(host) {
68730
68804
  const sessionId = host.sessionManager.getActiveSession()?.id;
68731
68805
  if (!sessionId) return;
68732
- const platform2 = host.options.model?.filePlatform || "unknown";
68806
+ const platform2 = host.options.model?.filePlatform || host.options.model?.attachmentPlatform || "unknown";
68733
68807
  host.fileManager = new FileManager({
68734
68808
  sessionId,
68735
68809
  platform: platform2,
@@ -68737,7 +68811,7 @@ async function initializeFileManager(host) {
68737
68811
  baseDir: path28.join(host.options.configDir, "files"),
68738
68812
  sessionsDir: path28.join(host.options.configDir, "sessions")
68739
68813
  });
68740
- switch (getFileManagerAdapterKind(host.options.model?.filePlatform)) {
68814
+ switch (getFileManagerAdapterKind(platform2)) {
68741
68815
  case "kimi":
68742
68816
  if (host.options.model?.baseUrl) {
68743
68817
  host.fileManager.registerAdapter(new KimiFileAdapter(host.options.apiKey, host.options.model.baseUrl));
@@ -68746,6 +68820,13 @@ async function initializeFileManager(host) {
68746
68820
  case "gemini":
68747
68821
  host.fileManager.registerAdapter(new GeminiFileAdapter(host.options.apiKey));
68748
68822
  break;
68823
+ case "openai-compatible-files":
68824
+ if (host.options.model?.baseUrl) {
68825
+ host.fileManager.registerAdapter(
68826
+ new OpenAICompatibleFilesAdapter(host.options.apiKey, host.options.model.baseUrl, host.options.model.headers)
68827
+ );
68828
+ }
68829
+ break;
68749
68830
  default:
68750
68831
  break;
68751
68832
  }
@@ -70398,6 +70479,14 @@ async function prepareAgentTurn(host, context) {
70398
70479
  };
70399
70480
  }
70400
70481
  function createInteractiveAgentSessionController(host) {
70482
+ let retryElapsedTicker;
70483
+ let retryElapsedStartedAt = 0;
70484
+ const stopRetryElapsedTicker = () => {
70485
+ if (retryElapsedTicker !== void 0) {
70486
+ clearInterval(retryElapsedTicker);
70487
+ retryElapsedTicker = void 0;
70488
+ }
70489
+ };
70401
70490
  return new AgentSessionController({
70402
70491
  agent: host.agent,
70403
70492
  sessionManager: host.sessionManager,
@@ -70465,6 +70554,7 @@ function createInteractiveAgentSessionController(host) {
70465
70554
  }
70466
70555
  },
70467
70556
  onEvent: (event) => {
70557
+ stopRetryElapsedTicker();
70468
70558
  host.sessionTrace.noteRuntimeEvent(event.type, event);
70469
70559
  if (event.type === "session_synced") {
70470
70560
  host.lastSyncedMessageCount = event.totalMessages;
@@ -70495,7 +70585,13 @@ function createInteractiveAgentSessionController(host) {
70495
70585
  }
70496
70586
  } else if (event.type === "turn_retry_started") {
70497
70587
  host.setControllerBusy(true);
70588
+ retryElapsedStartedAt = Date.now();
70498
70589
  host.showStatus(`Retrying request (attempt ${event.attempt}/${event.maxRetries})...`);
70590
+ retryElapsedTicker = setInterval(() => {
70591
+ const elapsedSeconds = Math.floor((Date.now() - retryElapsedStartedAt) / 1e3);
70592
+ host.showStatus(`Retrying request (attempt ${event.attempt}/${event.maxRetries})... ${elapsedSeconds}s`);
70593
+ }, 1e3);
70594
+ retryElapsedTicker.unref?.();
70499
70595
  } else if (event.type === "turn_retry_succeeded") {
70500
70596
  const outcome = host.executionState.resumePausedTodo();
70501
70597
  if (outcome.changed) {
@@ -71041,7 +71137,9 @@ function installInteractiveInteractionHandler(host) {
71041
71137
  optionCount: request.options.length
71042
71138
  });
71043
71139
  const { value: selection, timedOut } = await waitForUser(
71044
- () => showExtensionSelector2(host, request.prompt, request.options)
71140
+ () => showExtensionSelector2(host, request.prompt, request.options, {
71141
+ shortcuts: { left: request.leftShortcut, right: request.rightShortcut }
71142
+ })
71045
71143
  );
71046
71144
  host.logDebug("interaction:select_one:end", {
71047
71145
  id: request.id,
@@ -71134,7 +71232,8 @@ function showExtensionSelector2(host, title, options, opts) {
71134
71232
  opts?.signal?.removeEventListener("abort", onAbort);
71135
71233
  host.restoreEditor();
71136
71234
  resolve7(void 0);
71137
- }
71235
+ },
71236
+ opts?.shortcuts
71138
71237
  );
71139
71238
  host.editorContainer.clear();
71140
71239
  host.editorContainer.addChild(selector);
@@ -71814,8 +71913,9 @@ var InteractiveMode = class {
71814
71913
  }
71815
71914
  rebuildSkillAwareTools(sourceTools) {
71816
71915
  const preservedTools = sourceTools.filter(
71817
- (tool) => !CLI_FILESYSTEM_TOOL_NAMES.includes(tool.name)
71916
+ (tool) => !CLI_FILESYSTEM_TOOL_NAMES.includes(tool.name) && tool.name !== "bash"
71818
71917
  );
71918
+ const bashTool = createBashTool(this.options.cwd, { isYoloMode: () => this.yoloMode });
71819
71919
  const fileSystemToolOptions = (allowlistedDirs) => ({
71820
71920
  ...buildCliFileAccessOptions({
71821
71921
  cwd: this.options.cwd,
@@ -71843,11 +71943,11 @@ var InteractiveMode = class {
71843
71943
  });
71844
71944
  return {
71845
71945
  currentTools: createPolicyEnforcedTools(
71846
- [...currentFsTools, ...preservedTools],
71946
+ [...currentFsTools, bashTool, ...preservedTools],
71847
71947
  { getContext: getPolicyContext }
71848
71948
  ),
71849
71949
  originalTools: createPolicyEnforcedTools(
71850
- [...normalFsTools, ...preservedTools],
71950
+ [...normalFsTools, bashTool, ...preservedTools],
71851
71951
  { getContext: getPolicyContext }
71852
71952
  )
71853
71953
  };
@@ -71970,7 +72070,7 @@ var InteractiveMode = class {
71970
72070
  async init() {
71971
72071
  const activeSession = this.sessionManager.getActiveSession();
71972
72072
  this.thinkingLevel = resolveInitialThinkingLevel({ session: activeSession, settingsManager: this.options.settingsManager });
71973
- const { Agent } = await import("./chunks/src-HYZFAW4V.js");
72073
+ const { Agent } = await import("./chunks/src-QSP2OPHU.js");
71974
72074
  this.agent = new Agent({
71975
72075
  initialState: {
71976
72076
  systemPrompt: this.buildSystemPrompt(),
@@ -72471,6 +72571,7 @@ async function composeCliRuntime(params) {
72471
72571
  });
72472
72572
  const cwd = params.cwd ?? process.cwd();
72473
72573
  const sessionManager = createSessionManager({ sessionsDir: paths.sessionsDir });
72574
+ let createdNewSession = false;
72474
72575
  if (params.explicitSessionId) {
72475
72576
  const sessionFileExists = params.requireExistingSession ? await sessionManager.hasSession(params.explicitSessionId) : false;
72476
72577
  const loaded = await sessionManager.loadSession(params.explicitSessionId, {
@@ -72484,6 +72585,7 @@ async function composeCliRuntime(params) {
72484
72585
  );
72485
72586
  }
72486
72587
  await sessionManager.createSession(void 0, void 0, params.explicitSessionId);
72588
+ createdNewSession = true;
72487
72589
  } else {
72488
72590
  const restored = restoreSessionModelState({
72489
72591
  activeSession: sessionManager.getActiveSession(),
@@ -72503,10 +72605,11 @@ async function composeCliRuntime(params) {
72503
72605
  }
72504
72606
  } else {
72505
72607
  await sessionManager.createSession();
72608
+ createdNewSession = true;
72506
72609
  }
72507
72610
  const activeSession = sessionManager.getActiveSession();
72508
72611
  syncSessionModelMetadata(sessionManager, model, resolveInitialThinkingLevel({ session: activeSession, settingsManager }));
72509
- if (activeSession && activeSession.metadata.cwd !== cwd) {
72612
+ if (activeSession && createdNewSession) {
72510
72613
  activeSession.metadata.cwd = cwd;
72511
72614
  await sessionManager.save();
72512
72615
  }
@@ -72548,6 +72651,7 @@ async function composeCliRuntime(params) {
72548
72651
  getAgentModel: getCurrentModel,
72549
72652
  getSessionId: () => sessionManager.getActiveSessionId() || void 0,
72550
72653
  resolveToolModel: (purpose) => modelRegistry.resolveToolModel(purpose, getCurrentModel()),
72654
+ resolveToolModelCandidates: (purpose) => modelRegistry.resolveToolModelCandidates(purpose, getCurrentModel()),
72551
72655
  getPolicyContext: () => ({ mode: "normal", confirmationPolicy: "allow" })
72552
72656
  };
72553
72657
  const rawTools = [
@@ -72780,7 +72884,7 @@ async function runPrintMode(params) {
72780
72884
  `);
72781
72885
  console.log("Assistant: ");
72782
72886
  }
72783
- const { Agent: AgentClass } = await import("./chunks/src-HYZFAW4V.js");
72887
+ const { Agent: AgentClass } = await import("./chunks/src-QSP2OPHU.js");
72784
72888
  let agent;
72785
72889
  const printModeExtensions = await loadPrintModeExtensions({
72786
72890
  cwd: runtime.cwd,
@@ -73339,8 +73443,12 @@ async function runJsonEventsMode(params) {
73339
73443
  }
73340
73444
  }
73341
73445
  metadata.name = typeof existing?.name === "string" ? existing.name : `Session ${sessionId.slice(0, 8)}`;
73342
- if (cwd || existing?.cwd || runtime?.cwd) {
73343
- metadata.cwd = cwd ?? existing?.cwd ?? runtime?.cwd;
73446
+ if (existing) {
73447
+ if (existing.cwd) {
73448
+ metadata.cwd = cwd ?? existing.cwd;
73449
+ }
73450
+ } else if (cwd || runtime?.cwd) {
73451
+ metadata.cwd = cwd ?? runtime?.cwd;
73344
73452
  }
73345
73453
  metadata.activeEntryId = activeEntryId;
73346
73454
  metadata.rootEntryId = existing?.rootEntryId ?? rootEntryId;
@@ -73621,7 +73729,7 @@ async function runJsonEventsMode(params) {
73621
73729
  return;
73622
73730
  }
73623
73731
  const parent = agent;
73624
- const { Agent: AgentClass } = await import("./chunks/src-HYZFAW4V.js");
73732
+ const { Agent: AgentClass } = await import("./chunks/src-QSP2OPHU.js");
73625
73733
  const sideAgent = new AgentClass({
73626
73734
  initialState: {
73627
73735
  systemPrompt: parent.state.systemPrompt,
@@ -73947,7 +74055,7 @@ async function runJsonEventsMode(params) {
73947
74055
  if (runtime.initialModel.unconfigured || controller) {
73948
74056
  return;
73949
74057
  }
73950
- const { Agent: AgentClass } = await import("./chunks/src-HYZFAW4V.js");
74058
+ const { Agent: AgentClass } = await import("./chunks/src-QSP2OPHU.js");
73951
74059
  const jsonModeExtensions = await loadJsonModeExtensions({ runtime, getAgent: () => agent });
73952
74060
  const tools = [...runtime.tools, ...jsonModeExtensions.extensionTools];
73953
74061
  const restoredApiKey = runtime.modelRegistry.getApiKey(runtime.model);
@@ -74536,7 +74644,7 @@ async function runWithJsonEventsConsoleIsolation(fn) {
74536
74644
  }
74537
74645
  async function createCliTestStreamFnFromEnv() {
74538
74646
  if (!process.env.PIE_TEST_MOCK_STREAM_SEQUENCE) return void 0;
74539
- return (await import("./chunks/test-stream-5T7E7C25.js")).createTestStreamFnFromSequenceEnv();
74647
+ return (await import("./chunks/test-stream-CVGWFLSX.js")).createTestStreamFnFromSequenceEnv();
74540
74648
  }
74541
74649
  function resolveJsonEventsDetailFlag() {
74542
74650
  for (let index = 0; index < process.argv.length; index += 1) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cydm/pie",
3
- "version": "1.0.50",
3
+ "version": "2.1.0",
4
4
  "description": "Pie AI Agent CLI",
5
5
  "type": "module",
6
6
  "bin": {
@@ -18,7 +18,7 @@
18
18
  "test": "npm run test:offline",
19
19
  "pretest:offline": "npm run build --workspace @pie/agent-framework && npm run build --workspace @pie/shared-headless-capabilities && npm run build",
20
20
  "posttest:offline": "node --test --import tsx test/remote-model-catalog.test.ts",
21
- "test:offline": "node --test --import tsx test/builtin-extensions.test.ts test/core-services.test.ts test/cli.test.ts test/cli-auto-compaction.test.ts test/execution-state-manager.test.ts test/queued-steer-execution-state.test.ts test/architecture-boundaries.test.ts test/attachment-resolver.test.ts test/kimi-attachment-provider.test.ts test/document-attachment-extension.test.ts test/auto-compact-overflow.test.ts test/hierarchical-command-system.test.ts test/extensions-enablement.test.ts test/skill-tool-enablement.test.ts test/message-queue-unit.test.ts test/evals-harness.test.ts test/session-trace.test.ts test/runtime-mode-context.test.ts test/tool-policy.test.ts test/retry-policy.test.ts test/yolo-command.test.ts test/footer-lifecycle.test.ts test/files-utils.test.ts test/source-size-guard.test.ts test/runtime-logger.test.ts test/release-readiness.test.ts test/package-artifacts.test.ts test/code-intel-typescript-provider.test.ts test/init-extension-contract.test.ts test/skills-runtime.test.ts test/skills-agents-discovery.test.ts test/skills-symlink.test.ts test/model-overrides.test.ts test/auth-storage.test.ts test/extension-register-provider.test.ts test/extension-reload.test.ts test/extension-terminal-input.test.ts test/extension-session-before-events.test.ts test/extension-widgets.test.ts test/extension-render-hint.test.ts test/extension-oauth-restore.test.ts test/cross-host-parity.test.ts test/tool-name-rendering.test.ts test/session-selector.test.ts test/terminal-title.test.ts test/interactive-controller-title.test.ts test/todo-title.terminal.test.ts test/plan-mode-extension.test.ts test/tools-registry.test.ts test/system-prompt-contract.test.ts test/direct-bash.test.ts test/terminal-bell.test.ts test/calm-mode.test.ts test/project-root.test.ts test/guard-advisory-context.test.ts test/clear-command-usage.test.ts test/daily-agent-smoke.terminal.test.ts test/slash-menu-toggles.terminal.test.ts test/cli-args.test.ts test/extensions-configured-paths.test.ts test/extensions-loader-path.test.ts test/file-picker.test.ts test/interrupt-recovery.test.ts test/mention-insert-regression.test.ts test/mention-picker-navigation.test.ts test/pie-unity-rpc-skill.test.ts test/skill-creator-scripts.test.ts",
21
+ "test:offline": "node --test --import tsx test/builtin-extensions.test.ts test/core-services.test.ts test/cli.test.ts test/cli-auto-compaction.test.ts test/execution-state-manager.test.ts test/queued-steer-execution-state.test.ts test/architecture-boundaries.test.ts test/attachment-resolver.test.ts test/kimi-attachment-provider.test.ts test/document-attachment-extension.test.ts test/auto-compact-overflow.test.ts test/hierarchical-command-system.test.ts test/mcp-adapter.test.ts test/extensions-enablement.test.ts test/extension-selector-shortcuts.test.ts test/skill-tool-enablement.test.ts test/message-queue-unit.test.ts test/evals-harness.test.ts test/session-trace.test.ts test/runtime-mode-context.test.ts test/tool-policy.test.ts test/retry-policy.test.ts test/yolo-command.test.ts test/footer-lifecycle.test.ts test/files-utils.test.ts test/source-size-guard.test.ts test/runtime-logger.test.ts test/release-readiness.test.ts test/package-artifacts.test.ts test/code-intel-typescript-provider.test.ts test/init-extension-contract.test.ts test/skills-runtime.test.ts test/skills-agents-discovery.test.ts test/skills-symlink.test.ts test/model-overrides.test.ts test/auth-storage.test.ts test/extension-register-provider.test.ts test/extension-reload.test.ts test/extension-terminal-input.test.ts test/extension-session-before-events.test.ts test/extension-widgets.test.ts test/extension-render-hint.test.ts test/extension-oauth-restore.test.ts test/cross-host-parity.test.ts test/tool-name-rendering.test.ts test/session-selector.test.ts test/terminal-title.test.ts test/interactive-controller-title.test.ts test/todo-title.terminal.test.ts test/plan-mode-extension.test.ts test/rendered-page-reader.test.ts test/tools-registry.test.ts test/system-prompt-contract.test.ts test/bash-yolo.test.ts test/direct-bash.test.ts test/terminal-bell.test.ts test/calm-mode.test.ts test/project-root.test.ts test/guard-advisory-context.test.ts test/clear-command-usage.test.ts test/daily-agent-smoke.terminal.test.ts test/slash-menu-toggles.terminal.test.ts test/cli-args.test.ts test/extensions-configured-paths.test.ts test/extensions-loader-path.test.ts test/file-picker.test.ts test/interrupt-recovery.test.ts test/mention-insert-regression.test.ts test/mention-picker-navigation.test.ts test/pie-unity-rpc-skill.test.ts test/skill-creator-scripts.test.ts",
22
22
  "test:all": "npm run test:offline && npm run test:terminal:vitest",
23
23
  "test:terminal:vitest": "vitest run test/mention-file-select.terminal.test.ts test/tool-partial-display.terminal.test.ts test/footer-plan-mode.test.ts test/viewport-position-final.test.ts test/resume-header.terminal.test.ts --no-file-parallelism",
24
24
  "test:todo-tui": "PIE_REAL_TODO_TUI=1 node --test --import tsx test/todo-closure.terminal.test.ts",
@@ -35,7 +35,6 @@
35
35
  "test:daily-gate:full:repeat": "PIE_REAL_DAILY_TUI=1 PIE_DAILY_REPEAT_MODE=full node --test --import tsx test/daily-agent-smoke.terminal.test.ts",
36
36
  "test:kimi-smoke": "node scripts/kimi-attachment-smoke.mjs",
37
37
  "test:integration": "node --test --import tsx test/cli.test.ts test/compact-e2e.test.ts test/human-simulation.test.ts test/interactive-integration.test.ts test/pie-cli.terminal.test.ts",
38
- "test:fixes": "tsx test-fixes.ts",
39
38
  "eval": "tsx evals/runner.ts",
40
39
  "eval:task": "tsx evals/runner.ts --layer=task",
41
40
  "eval:dev": "tsx evals/runner.ts --layer=task --dataset=dev",
@@ -67,8 +66,10 @@
67
66
  },
68
67
  "dependencies": {
69
68
  "@anthropic-ai/sdk": "0.50.4",
70
- "@playwright/cli": "0.1.17",
69
+ "@modelcontextprotocol/client": "2.2.0",
71
70
  "@sinclair/typebox": "^0.34.49",
71
+ "chrome-devtools-axi": "0.1.35",
72
+ "chrome-devtools-mcp": "1.10.1",
72
73
  "cli-highlight": "^2.1.11",
73
74
  "diff": "8.0.3",
74
75
  "jszip": "^3.10.1",
@@ -1,5 +0,0 @@
1
- # Changelog
2
-
3
- ## 2.0.0
4
-
5
- - Replaced Pie's custom Chrome DevTools Protocol scripts with the packaged Microsoft Playwright CLI wrapper.