@cydm/pie 1.0.51 → 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.
- package/README.md +32 -15
- package/dist/builtin/extensions/ask-user/index.js +4 -3
- package/dist/builtin/extensions/ask-user/package.json +8 -7
- package/dist/builtin/extensions/changelog/package.json +9 -9
- package/dist/builtin/extensions/computer-use/index.js +5466 -0
- package/dist/builtin/extensions/computer-use/package.json +11 -0
- package/dist/builtin/extensions/computer-use/prebuilt/linux/arm64/linux-bridge +0 -0
- package/dist/builtin/extensions/computer-use/prebuilt/linux/x64/linux-bridge +0 -0
- package/dist/builtin/extensions/computer-use/prebuilt/macos/arm64/pie-computer-use +0 -0
- package/dist/builtin/extensions/computer-use/prebuilt/macos/universal/pie-computer-use.app/Contents/Info.plist +24 -0
- package/dist/builtin/extensions/computer-use/prebuilt/macos/universal/pie-computer-use.app/Contents/MacOS/pie-computer-use +0 -0
- package/dist/builtin/extensions/computer-use/prebuilt/macos/universal/pie-computer-use.app/Contents/_CodeSignature/CodeResources +115 -0
- package/dist/builtin/extensions/computer-use/prebuilt/macos/x64/pie-computer-use +0 -0
- package/dist/builtin/extensions/computer-use/prebuilt/windows/windows-bridge.exe +0 -0
- package/dist/builtin/extensions/computer-use/scripts/build-native.mjs +277 -0
- package/dist/builtin/extensions/computer-use/scripts/helper-path.mjs +48 -0
- package/dist/builtin/extensions/computer-use/scripts/setup-helper.mjs +549 -0
- package/dist/builtin/extensions/document-attachments/package.json +9 -9
- package/dist/builtin/extensions/init/package.json +9 -9
- package/dist/builtin/extensions/mcp-adapter/index.js +25250 -0
- package/dist/builtin/extensions/mcp-adapter/package.json +11 -0
- package/dist/builtin/extensions/plan-mode/index.js +4 -3
- package/dist/builtin/extensions/plan-mode/package.json +9 -9
- package/dist/builtin/extensions/subagent/index.js +6 -4
- package/dist/builtin/extensions/subagent/package.json +16 -12
- package/dist/builtin/extensions/todo/index.js +4 -3
- package/dist/builtin/extensions/todo/package.json +9 -9
- package/dist/builtin/skills/chrome-devtools-axi/CHANGELOG.md +5 -0
- package/dist/builtin/skills/chrome-devtools-axi/README.md +17 -0
- package/dist/builtin/skills/chrome-devtools-axi/SKILL.md +31 -0
- package/dist/builtin/skills/chrome-devtools-axi/chrome-devtools-axi-cli.js +77 -0
- package/dist/builtin/skills/chrome-devtools-axi/package.json +12 -0
- package/dist/builtin/skills/tui-use/README.md +7 -0
- package/dist/builtin/skills/tui-use/SKILL.md +58 -0
- package/dist/chunks/chunk-5353DEEC.js +130 -0
- package/dist/chunks/{chunk-KDPAGHYY.js → chunk-G2POWIA5.js} +129 -194
- package/dist/chunks/{chunk-S2J3SZZX.js → chunk-IM43UYVV.js} +827 -3385
- package/dist/chunks/{chunk-A644H2XX.js → chunk-PMPD56N2.js} +159 -72
- package/dist/chunks/{chunk-B3SMW2XW.js → chunk-QJH6YN2W.js} +1 -1
- package/dist/chunks/chunk-XXGYUYXI.js +2718 -0
- package/dist/chunks/{src-UKCIAX6F.js → src-QSP2OPHU.js} +3 -2
- package/dist/chunks/{test-stream-NCBFPM2I.js → test-stream-CVGWFLSX.js} +2 -1
- package/dist/chunks/webapi-MBCKO7ZV.js +2481 -0
- package/dist/cli.js +149 -68
- package/package.json +5 -4
- package/dist/builtin/skills/browser-tools/CHANGELOG.md +0 -5
- package/dist/builtin/skills/browser-tools/README.md +0 -17
- package/dist/builtin/skills/browser-tools/SKILL.md +0 -43
- package/dist/builtin/skills/browser-tools/package.json +0 -12
- 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
|
-
|
|
25
|
-
|
|
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-
|
|
77
|
-
import "./chunks/chunk-
|
|
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-
|
|
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
|
|
46524
|
+
function resolveDoctorChromeDevtoolsAxiCli() {
|
|
46520
46525
|
try {
|
|
46521
|
-
|
|
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
|
|
46527
|
-
const cliPath =
|
|
46532
|
+
function checkChromeDevtoolsAxiCli() {
|
|
46533
|
+
const cliPath = resolveDoctorChromeDevtoolsAxiCli();
|
|
46528
46534
|
if (!cliPath) {
|
|
46529
46535
|
return {
|
|
46530
|
-
id: "
|
|
46531
|
-
label: "
|
|
46536
|
+
id: "chrome_devtools_axi",
|
|
46537
|
+
label: "chrome-devtools-axi CLI",
|
|
46532
46538
|
status: "fail",
|
|
46533
|
-
message: "
|
|
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: "
|
|
46540
|
-
label: "
|
|
46545
|
+
id: "chrome_devtools_axi",
|
|
46546
|
+
label: "chrome-devtools-axi CLI",
|
|
46541
46547
|
status: ok ? "pass" : "fail",
|
|
46542
|
-
message: ok ? `
|
|
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
|
|
46547
|
-
|
|
46548
|
-
|
|
46549
|
-
const
|
|
46550
|
-
|
|
46551
|
-
|
|
46552
|
-
|
|
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
|
+
};
|
|
46575
|
+
}
|
|
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
|
+
};
|
|
46553
46586
|
}
|
|
46554
|
-
if (
|
|
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: "
|
|
46557
|
-
label: "
|
|
46558
|
-
status: "pass",
|
|
46559
|
-
message: `
|
|
46560
|
-
details: {
|
|
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: "
|
|
46566
|
-
label: "
|
|
46599
|
+
id: "computer_use_helper",
|
|
46600
|
+
label: "computer-use helper",
|
|
46567
46601
|
status: "warn",
|
|
46568
|
-
message: `
|
|
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
|
|
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(
|
|
46795
|
-
checks.push(
|
|
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
|
|
@@ -61730,6 +61773,7 @@ async function understandReadFile(deps, request) {
|
|
|
61730
61773
|
getAgentModel: deps.getAgentModel,
|
|
61731
61774
|
getSessionId: deps.getSessionId,
|
|
61732
61775
|
resolveToolModel: deps.resolveToolModel,
|
|
61776
|
+
resolveToolModelCandidates: deps.resolveToolModelCandidates,
|
|
61733
61777
|
prepareFileContent: (params) => prepareFileContent(deps.configDir, params)
|
|
61734
61778
|
})(request);
|
|
61735
61779
|
}
|
|
@@ -61868,7 +61912,8 @@ function createCliFileSystemTools(cwd, options) {
|
|
|
61868
61912
|
cwd,
|
|
61869
61913
|
getAgentModel: fileOptions.getAgentModel ?? (() => void 0),
|
|
61870
61914
|
getSessionId: fileOptions.getSessionId ?? (() => void 0),
|
|
61871
|
-
resolveToolModel: fileOptions.resolveToolModel
|
|
61915
|
+
resolveToolModel: fileOptions.resolveToolModel,
|
|
61916
|
+
resolveToolModelCandidates: fileOptions.resolveToolModelCandidates
|
|
61872
61917
|
}, request) : fileOptions.understandFile
|
|
61873
61918
|
};
|
|
61874
61919
|
const tools = createSharedFileSystemTools(cwd, sharedOptions).map(
|
|
@@ -62459,8 +62504,10 @@ function normalizeSessionTitle(raw) {
|
|
|
62459
62504
|
import * as path23 from "node:path";
|
|
62460
62505
|
var ExtensionSelectorComponent = class extends Container {
|
|
62461
62506
|
selectList;
|
|
62462
|
-
|
|
62507
|
+
shortcuts;
|
|
62508
|
+
constructor(title, options, onSelect, onCancel, shortcuts) {
|
|
62463
62509
|
super();
|
|
62510
|
+
this.shortcuts = shortcuts;
|
|
62464
62511
|
this.addChild(new Text(theme.bold(theme.fg("accent", title)), 0, 0));
|
|
62465
62512
|
this.addChild(new Spacer(1));
|
|
62466
62513
|
const items = options.map((option) => ({ value: option, label: option }));
|
|
@@ -62469,13 +62516,27 @@ var ExtensionSelectorComponent = class extends Container {
|
|
|
62469
62516
|
this.selectList.onCancel = onCancel;
|
|
62470
62517
|
this.addChild(this.selectList);
|
|
62471
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");
|
|
62472
62524
|
this.addChild(new Text(
|
|
62473
|
-
theme.fg("dim", "
|
|
62525
|
+
theme.fg("dim", ` ${hintParts.join(" \xB7 ")}`),
|
|
62474
62526
|
0,
|
|
62475
62527
|
0
|
|
62476
62528
|
));
|
|
62477
62529
|
}
|
|
62478
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
|
+
}
|
|
62479
62540
|
this.selectList.handleInput(data);
|
|
62480
62541
|
}
|
|
62481
62542
|
getSelectList() {
|
|
@@ -65389,7 +65450,7 @@ function handleSkillsListCommand(host) {
|
|
|
65389
65450
|
}
|
|
65390
65451
|
host.chatContainer.addChild(new Spacer(1));
|
|
65391
65452
|
host.chatContainer.addChild(new Text(theme.fg("dim", "Usage: /skills/skill:<name> <your request>"), 1, 0));
|
|
65392
|
-
host.chatContainer.addChild(new Text(theme.fg("dim", "Example: /skills/skill:
|
|
65453
|
+
host.chatContainer.addChild(new Text(theme.fg("dim", "Example: /skills/skill:chrome-devtools-axi navigate to google.com"), 1, 0));
|
|
65393
65454
|
host.ui.requestRender();
|
|
65394
65455
|
}
|
|
65395
65456
|
function handleSkillCommand(host, name) {
|
|
@@ -70418,6 +70479,14 @@ async function prepareAgentTurn(host, context) {
|
|
|
70418
70479
|
};
|
|
70419
70480
|
}
|
|
70420
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
|
+
};
|
|
70421
70490
|
return new AgentSessionController({
|
|
70422
70491
|
agent: host.agent,
|
|
70423
70492
|
sessionManager: host.sessionManager,
|
|
@@ -70485,6 +70554,7 @@ function createInteractiveAgentSessionController(host) {
|
|
|
70485
70554
|
}
|
|
70486
70555
|
},
|
|
70487
70556
|
onEvent: (event) => {
|
|
70557
|
+
stopRetryElapsedTicker();
|
|
70488
70558
|
host.sessionTrace.noteRuntimeEvent(event.type, event);
|
|
70489
70559
|
if (event.type === "session_synced") {
|
|
70490
70560
|
host.lastSyncedMessageCount = event.totalMessages;
|
|
@@ -70515,7 +70585,13 @@ function createInteractiveAgentSessionController(host) {
|
|
|
70515
70585
|
}
|
|
70516
70586
|
} else if (event.type === "turn_retry_started") {
|
|
70517
70587
|
host.setControllerBusy(true);
|
|
70588
|
+
retryElapsedStartedAt = Date.now();
|
|
70518
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?.();
|
|
70519
70595
|
} else if (event.type === "turn_retry_succeeded") {
|
|
70520
70596
|
const outcome = host.executionState.resumePausedTodo();
|
|
70521
70597
|
if (outcome.changed) {
|
|
@@ -71061,7 +71137,9 @@ function installInteractiveInteractionHandler(host) {
|
|
|
71061
71137
|
optionCount: request.options.length
|
|
71062
71138
|
});
|
|
71063
71139
|
const { value: selection, timedOut } = await waitForUser(
|
|
71064
|
-
() => showExtensionSelector2(host, request.prompt, request.options
|
|
71140
|
+
() => showExtensionSelector2(host, request.prompt, request.options, {
|
|
71141
|
+
shortcuts: { left: request.leftShortcut, right: request.rightShortcut }
|
|
71142
|
+
})
|
|
71065
71143
|
);
|
|
71066
71144
|
host.logDebug("interaction:select_one:end", {
|
|
71067
71145
|
id: request.id,
|
|
@@ -71154,7 +71232,8 @@ function showExtensionSelector2(host, title, options, opts) {
|
|
|
71154
71232
|
opts?.signal?.removeEventListener("abort", onAbort);
|
|
71155
71233
|
host.restoreEditor();
|
|
71156
71234
|
resolve7(void 0);
|
|
71157
|
-
}
|
|
71235
|
+
},
|
|
71236
|
+
opts?.shortcuts
|
|
71158
71237
|
);
|
|
71159
71238
|
host.editorContainer.clear();
|
|
71160
71239
|
host.editorContainer.addChild(selector);
|
|
@@ -71834,8 +71913,9 @@ var InteractiveMode = class {
|
|
|
71834
71913
|
}
|
|
71835
71914
|
rebuildSkillAwareTools(sourceTools) {
|
|
71836
71915
|
const preservedTools = sourceTools.filter(
|
|
71837
|
-
(tool) => !CLI_FILESYSTEM_TOOL_NAMES.includes(tool.name)
|
|
71916
|
+
(tool) => !CLI_FILESYSTEM_TOOL_NAMES.includes(tool.name) && tool.name !== "bash"
|
|
71838
71917
|
);
|
|
71918
|
+
const bashTool = createBashTool(this.options.cwd, { isYoloMode: () => this.yoloMode });
|
|
71839
71919
|
const fileSystemToolOptions = (allowlistedDirs) => ({
|
|
71840
71920
|
...buildCliFileAccessOptions({
|
|
71841
71921
|
cwd: this.options.cwd,
|
|
@@ -71863,11 +71943,11 @@ var InteractiveMode = class {
|
|
|
71863
71943
|
});
|
|
71864
71944
|
return {
|
|
71865
71945
|
currentTools: createPolicyEnforcedTools(
|
|
71866
|
-
[...currentFsTools, ...preservedTools],
|
|
71946
|
+
[...currentFsTools, bashTool, ...preservedTools],
|
|
71867
71947
|
{ getContext: getPolicyContext }
|
|
71868
71948
|
),
|
|
71869
71949
|
originalTools: createPolicyEnforcedTools(
|
|
71870
|
-
[...normalFsTools, ...preservedTools],
|
|
71950
|
+
[...normalFsTools, bashTool, ...preservedTools],
|
|
71871
71951
|
{ getContext: getPolicyContext }
|
|
71872
71952
|
)
|
|
71873
71953
|
};
|
|
@@ -71990,7 +72070,7 @@ var InteractiveMode = class {
|
|
|
71990
72070
|
async init() {
|
|
71991
72071
|
const activeSession = this.sessionManager.getActiveSession();
|
|
71992
72072
|
this.thinkingLevel = resolveInitialThinkingLevel({ session: activeSession, settingsManager: this.options.settingsManager });
|
|
71993
|
-
const { Agent } = await import("./chunks/src-
|
|
72073
|
+
const { Agent } = await import("./chunks/src-QSP2OPHU.js");
|
|
71994
72074
|
this.agent = new Agent({
|
|
71995
72075
|
initialState: {
|
|
71996
72076
|
systemPrompt: this.buildSystemPrompt(),
|
|
@@ -72571,6 +72651,7 @@ async function composeCliRuntime(params) {
|
|
|
72571
72651
|
getAgentModel: getCurrentModel,
|
|
72572
72652
|
getSessionId: () => sessionManager.getActiveSessionId() || void 0,
|
|
72573
72653
|
resolveToolModel: (purpose) => modelRegistry.resolveToolModel(purpose, getCurrentModel()),
|
|
72654
|
+
resolveToolModelCandidates: (purpose) => modelRegistry.resolveToolModelCandidates(purpose, getCurrentModel()),
|
|
72574
72655
|
getPolicyContext: () => ({ mode: "normal", confirmationPolicy: "allow" })
|
|
72575
72656
|
};
|
|
72576
72657
|
const rawTools = [
|
|
@@ -72803,7 +72884,7 @@ async function runPrintMode(params) {
|
|
|
72803
72884
|
`);
|
|
72804
72885
|
console.log("Assistant: ");
|
|
72805
72886
|
}
|
|
72806
|
-
const { Agent: AgentClass } = await import("./chunks/src-
|
|
72887
|
+
const { Agent: AgentClass } = await import("./chunks/src-QSP2OPHU.js");
|
|
72807
72888
|
let agent;
|
|
72808
72889
|
const printModeExtensions = await loadPrintModeExtensions({
|
|
72809
72890
|
cwd: runtime.cwd,
|
|
@@ -73648,7 +73729,7 @@ async function runJsonEventsMode(params) {
|
|
|
73648
73729
|
return;
|
|
73649
73730
|
}
|
|
73650
73731
|
const parent = agent;
|
|
73651
|
-
const { Agent: AgentClass } = await import("./chunks/src-
|
|
73732
|
+
const { Agent: AgentClass } = await import("./chunks/src-QSP2OPHU.js");
|
|
73652
73733
|
const sideAgent = new AgentClass({
|
|
73653
73734
|
initialState: {
|
|
73654
73735
|
systemPrompt: parent.state.systemPrompt,
|
|
@@ -73974,7 +74055,7 @@ async function runJsonEventsMode(params) {
|
|
|
73974
74055
|
if (runtime.initialModel.unconfigured || controller) {
|
|
73975
74056
|
return;
|
|
73976
74057
|
}
|
|
73977
|
-
const { Agent: AgentClass } = await import("./chunks/src-
|
|
74058
|
+
const { Agent: AgentClass } = await import("./chunks/src-QSP2OPHU.js");
|
|
73978
74059
|
const jsonModeExtensions = await loadJsonModeExtensions({ runtime, getAgent: () => agent });
|
|
73979
74060
|
const tools = [...runtime.tools, ...jsonModeExtensions.extensionTools];
|
|
73980
74061
|
const restoredApiKey = runtime.modelRegistry.getApiKey(runtime.model);
|
|
@@ -74563,7 +74644,7 @@ async function runWithJsonEventsConsoleIsolation(fn) {
|
|
|
74563
74644
|
}
|
|
74564
74645
|
async function createCliTestStreamFnFromEnv() {
|
|
74565
74646
|
if (!process.env.PIE_TEST_MOCK_STREAM_SEQUENCE) return void 0;
|
|
74566
|
-
return (await import("./chunks/test-stream-
|
|
74647
|
+
return (await import("./chunks/test-stream-CVGWFLSX.js")).createTestStreamFnFromSequenceEnv();
|
|
74567
74648
|
}
|
|
74568
74649
|
function resolveJsonEventsDetailFlag() {
|
|
74569
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
|
|
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
|
-
"@
|
|
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,17 +0,0 @@
|
|
|
1
|
-
# Browser Tools
|
|
2
|
-
|
|
3
|
-
Pie's browser-tools skill is backed by Microsoft Playwright CLI through `playwright-cli.js`.
|
|
4
|
-
|
|
5
|
-
Use:
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
node playwright-cli.js --help
|
|
9
|
-
node playwright-cli.js open https://example.com
|
|
10
|
-
node playwright-cli.js snapshot
|
|
11
|
-
node playwright-cli.js screenshot
|
|
12
|
-
node playwright-cli.js console
|
|
13
|
-
node playwright-cli.js requests
|
|
14
|
-
node playwright-cli.js close
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
Dependencies are provided by `@cydm/pie`; do not run `npm install` inside this skill directory.
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: browser-tools
|
|
3
|
-
description: Interactive browser automation via Microsoft Playwright CLI. Use when you need to open pages, inspect DOM snapshots, click/type, capture screenshots, inspect console/request output, or test frontend flows in a real browser.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Browser Tools
|
|
7
|
-
|
|
8
|
-
Use Pie's packaged Microsoft Playwright CLI wrapper. Scripts live next to this skill; resolve `playwright-cli.js` against this skill's `baseDir` and use the resulting ordinary path with `bash`.
|
|
9
|
-
|
|
10
|
-
No manual dependency install is required when this skill is shipped with Pie.
|
|
11
|
-
|
|
12
|
-
## Common Commands
|
|
13
|
-
|
|
14
|
-
```bash
|
|
15
|
-
node <baseDir>/playwright-cli.js open https://example.com
|
|
16
|
-
node <baseDir>/playwright-cli.js goto https://example.com
|
|
17
|
-
node <baseDir>/playwright-cli.js snapshot
|
|
18
|
-
node <baseDir>/playwright-cli.js click "Submit"
|
|
19
|
-
node <baseDir>/playwright-cli.js type "hello"
|
|
20
|
-
node <baseDir>/playwright-cli.js screenshot
|
|
21
|
-
node <baseDir>/playwright-cli.js console
|
|
22
|
-
node <baseDir>/playwright-cli.js requests
|
|
23
|
-
node <baseDir>/playwright-cli.js close
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
Use `node <baseDir>/playwright-cli.js --help` for the full command list.
|
|
27
|
-
|
|
28
|
-
## Workflow
|
|
29
|
-
|
|
30
|
-
Start with `open` or `goto`, then use `snapshot` before interacting. Prefer snapshot, console, and request output for diagnosis; use screenshots when visual layout matters. Use named sessions with `-s=<session>` when you need to keep multiple browser flows separate.
|
|
31
|
-
|
|
32
|
-
If the browser is not installed, run:
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
node <baseDir>/playwright-cli.js install-browser chromium
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
If a session gets stuck, use:
|
|
39
|
-
|
|
40
|
-
```bash
|
|
41
|
-
node <baseDir>/playwright-cli.js close
|
|
42
|
-
node <baseDir>/playwright-cli.js kill-all
|
|
43
|
-
```
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "browser-tools",
|
|
3
|
-
"version": "2.0.0",
|
|
4
|
-
"type": "module",
|
|
5
|
-
"description": "Microsoft Playwright CLI wrapper for collaborative site exploration",
|
|
6
|
-
"author": "",
|
|
7
|
-
"license": "MIT",
|
|
8
|
-
"private": true,
|
|
9
|
-
"pie": {
|
|
10
|
-
"dependenciesProvidedBy": "@cydm/pie"
|
|
11
|
-
}
|
|
12
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import { spawnSync } from "node:child_process";
|
|
4
|
-
import fs from "node:fs";
|
|
5
|
-
import { createRequire } from "node:module";
|
|
6
|
-
import path from "node:path";
|
|
7
|
-
import { fileURLToPath } from "node:url";
|
|
8
|
-
|
|
9
|
-
const require = createRequire(import.meta.url);
|
|
10
|
-
|
|
11
|
-
export function resolvePlaywrightCli() {
|
|
12
|
-
return require.resolve("@playwright/cli/playwright-cli.js");
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export function runPlaywrightCli(args = process.argv.slice(2), options = {}) {
|
|
16
|
-
const bin = resolvePlaywrightCli();
|
|
17
|
-
return spawnSync(process.execPath, [bin, ...args], {
|
|
18
|
-
stdio: "inherit",
|
|
19
|
-
shell: false,
|
|
20
|
-
...options,
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
function normalizeDirectEntryPath(candidate) {
|
|
25
|
-
const resolved = path.resolve(candidate);
|
|
26
|
-
const real = fs.realpathSync.native(resolved);
|
|
27
|
-
const normalized = path.normalize(real);
|
|
28
|
-
return process.platform === "win32" ? normalized.toLowerCase() : normalized;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export function isDirectEntry(moduleUrl = import.meta.url, argvPath = process.argv[1]) {
|
|
32
|
-
if (!argvPath) return false;
|
|
33
|
-
try {
|
|
34
|
-
const modulePath = normalizeDirectEntryPath(fileURLToPath(moduleUrl));
|
|
35
|
-
const entryPath = normalizeDirectEntryPath(argvPath);
|
|
36
|
-
return modulePath === entryPath;
|
|
37
|
-
} catch {
|
|
38
|
-
return false;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
if (isDirectEntry()) {
|
|
43
|
-
const result = runPlaywrightCli();
|
|
44
|
-
process.exitCode = result.status ?? 1;
|
|
45
|
-
}
|