@cydm/pie 2.7.6 → 2.7.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/builtin/extensions/ask-user/index.js +3 -3
- package/dist/builtin/extensions/plan-mode/index.js +6 -4
- package/dist/builtin/extensions/subagent/index.js +11 -5
- package/dist/builtin/extensions/todo/index.js +3 -3
- package/dist/builtin/skills/chrome-devtools-axi/SKILL.md +2 -2
- package/dist/builtin/skills/computer-use-axi/SKILL.md +1 -1
- package/dist/builtin/skills/tui-use/SKILL.md +1 -1
- package/dist/chunks/{chunk-ZF5FHTES.js → chunk-2FEDB5GR.js} +22 -0
- package/dist/chunks/{chunk-GAUIKMBA.js → chunk-E6F4BTNN.js} +325 -56
- package/dist/chunks/{chunk-YWWLRZSG.js → chunk-P22SYVGO.js} +291 -44
- package/dist/chunks/{chunk-5YWEUFLM.js → chunk-W5B3OXHQ.js} +1 -1
- package/dist/chunks/{src-6WK5KYWQ.js → src-C2CBPEUY.js} +2 -2
- package/dist/chunks/{test-stream-7EH7BGY6.js → test-stream-LDVUVSUP.js} +10 -1
- package/dist/cli.js +494 -325
- package/package.json +6 -5
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
createAskUserCapability
|
|
4
|
-
} from "../../../chunks/chunk-
|
|
5
|
-
import "../../../chunks/chunk-
|
|
6
|
-
import "../../../chunks/chunk-
|
|
4
|
+
} from "../../../chunks/chunk-P22SYVGO.js";
|
|
5
|
+
import "../../../chunks/chunk-W5B3OXHQ.js";
|
|
6
|
+
import "../../../chunks/chunk-2FEDB5GR.js";
|
|
7
7
|
import "../../../chunks/chunk-XXGYUYXI.js";
|
|
8
8
|
import "../../../chunks/chunk-LZQXQOPJ.js";
|
|
9
9
|
|
|
@@ -4,12 +4,13 @@ import {
|
|
|
4
4
|
createExecutionStateFromPlan,
|
|
5
5
|
createPlanCapability,
|
|
6
6
|
extractPlanTodoItems,
|
|
7
|
+
getToolCapabilityMetadata,
|
|
7
8
|
isPlanModeSafeCommand,
|
|
8
9
|
markCompletedPlanSteps,
|
|
9
10
|
restoreExecutionState
|
|
10
|
-
} from "../../../chunks/chunk-
|
|
11
|
-
import "../../../chunks/chunk-
|
|
12
|
-
import "../../../chunks/chunk-
|
|
11
|
+
} from "../../../chunks/chunk-P22SYVGO.js";
|
|
12
|
+
import "../../../chunks/chunk-W5B3OXHQ.js";
|
|
13
|
+
import "../../../chunks/chunk-2FEDB5GR.js";
|
|
13
14
|
import {
|
|
14
15
|
Type
|
|
15
16
|
} from "../../../chunks/chunk-XXGYUYXI.js";
|
|
@@ -258,7 +259,8 @@ Update the plan accordingly and call plan_submit again with the revised steps. D
|
|
|
258
259
|
}
|
|
259
260
|
});
|
|
260
261
|
ctx.on("tool:call", async (event) => {
|
|
261
|
-
if (!planModeEnabled
|
|
262
|
+
if (!planModeEnabled) return;
|
|
263
|
+
if (getToolCapabilityMetadata({ name: event.toolName })?.executesShell !== true) return;
|
|
262
264
|
const command = typeof event.args === "object" && event.args !== null ? event.args.command : void 0;
|
|
263
265
|
if (typeof command === "string" && !isPlanModeSafeCommand(command)) {
|
|
264
266
|
ctx.ui.notify(
|
|
@@ -4,14 +4,14 @@ import {
|
|
|
4
4
|
formatTransportLifecycle,
|
|
5
5
|
getConfigDir,
|
|
6
6
|
logTransportLifecycle
|
|
7
|
-
} from "../../../chunks/chunk-
|
|
7
|
+
} from "../../../chunks/chunk-E6F4BTNN.js";
|
|
8
8
|
import {
|
|
9
9
|
SUBAGENT_SESSION_RECORD_VERSION,
|
|
10
10
|
createSharedFileSystemTools,
|
|
11
11
|
createSubagentCapability
|
|
12
|
-
} from "../../../chunks/chunk-
|
|
13
|
-
import "../../../chunks/chunk-
|
|
14
|
-
import "../../../chunks/chunk-
|
|
12
|
+
} from "../../../chunks/chunk-P22SYVGO.js";
|
|
13
|
+
import "../../../chunks/chunk-W5B3OXHQ.js";
|
|
14
|
+
import "../../../chunks/chunk-2FEDB5GR.js";
|
|
15
15
|
import "../../../chunks/chunk-XXGYUYXI.js";
|
|
16
16
|
import "../../../chunks/chunk-LZQXQOPJ.js";
|
|
17
17
|
|
|
@@ -206,7 +206,13 @@ function createSubagentSessionStore(sessionsDir, log, deps) {
|
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
208
|
try {
|
|
209
|
-
|
|
209
|
+
let stat;
|
|
210
|
+
try {
|
|
211
|
+
stat = fs.statSync(lockPath);
|
|
212
|
+
} catch (statError) {
|
|
213
|
+
if (statError.code === "ENOENT") continue;
|
|
214
|
+
throw new Error(`Subagent session "${id}" is busy (session lease is unreadable).`);
|
|
215
|
+
}
|
|
210
216
|
let lockContent;
|
|
211
217
|
try {
|
|
212
218
|
lockContent = fs.readFileSync(lockPath, "utf8");
|
|
@@ -8,9 +8,9 @@ import {
|
|
|
8
8
|
executeManageTodoList,
|
|
9
9
|
executionStateToTodos,
|
|
10
10
|
restoreExecutionState
|
|
11
|
-
} from "../../../chunks/chunk-
|
|
12
|
-
import "../../../chunks/chunk-
|
|
13
|
-
import "../../../chunks/chunk-
|
|
11
|
+
} from "../../../chunks/chunk-P22SYVGO.js";
|
|
12
|
+
import "../../../chunks/chunk-W5B3OXHQ.js";
|
|
13
|
+
import "../../../chunks/chunk-2FEDB5GR.js";
|
|
14
14
|
import "../../../chunks/chunk-XXGYUYXI.js";
|
|
15
15
|
import "../../../chunks/chunk-LZQXQOPJ.js";
|
|
16
16
|
|
|
@@ -21,7 +21,7 @@ snapshot. Keep the named session on every command.
|
|
|
21
21
|
|
|
22
22
|
Agent-ergonomic interface for controlling a real Chrome browser session (Chrome DevTools Protocol). Prefer this over other browser automation approaches. Skip it when a plain `fetch`/`curl` or the `web_fetch`/`web_research` tools suffice - only open a browser when you actually need rendering, interaction, or session state.
|
|
23
23
|
|
|
24
|
-
Use Pie's packaged wrapper. Resolve `chrome-devtools-axi-cli.js` against this skill's `baseDir` and run it with `
|
|
24
|
+
Use Pie's packaged wrapper. Resolve `chrome-devtools-axi-cli.js` against this skill's `baseDir` and run it with the `shell` tool:
|
|
25
25
|
|
|
26
26
|
```bash
|
|
27
27
|
node <baseDir>/chrome-devtools-axi-cli.js <command> [args] [flags]
|
|
@@ -29,7 +29,7 @@ node <baseDir>/chrome-devtools-axi-cli.js <command> [args] [flags]
|
|
|
29
29
|
|
|
30
30
|
No manual dependency install is required when this skill is shipped with Pie.
|
|
31
31
|
|
|
32
|
-
`
|
|
32
|
+
`shell` is the Pie tool name, not a requirement to launch a Unix shell.
|
|
33
33
|
On Windows use `shell:auto` or PowerShell; do not force `bash.exe`/WSL.
|
|
34
34
|
Set environment variables with PowerShell syntax, such as
|
|
35
35
|
`$env:CHROME_DEVTOOLS_AXI_SESSION='my-task'`, in each command that needs them.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: computer-use-axi
|
|
3
|
-
description: "Drive desktop apps and managed CDP browser pages through the computer-use-axi CLI run via
|
|
3
|
+
description: "Drive desktop apps and managed CDP browser pages through the computer-use-axi CLI run via the shell tool: list UI roots, capture bounded outlines, search/expand/inspect element refs, perform checked actions with postconditions, and wait for conditions. Use whenever a task needs real UI interaction - clicking through a native app, reading a screen, driving a desktop window, or acting on a browser page state. Read this before the first UI-control task or after any command usage error."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# computer-use-axi
|
|
@@ -16,7 +16,7 @@ Do not install a global CLI or fetch a different version. Pie provides the PTY
|
|
|
16
16
|
runtime and dependencies. First use requires no network access after Pie is
|
|
17
17
|
installed. Run the wrapper with `--help` or `<command> --help` for exact flags.
|
|
18
18
|
|
|
19
|
-
Use ordinary `
|
|
19
|
+
Use the ordinary `shell` tool for non-interactive commands.
|
|
20
20
|
|
|
21
21
|
## Core Loop
|
|
22
22
|
|
|
@@ -4067,6 +4067,9 @@ function convertMessages(model, context, compat) {
|
|
|
4067
4067
|
return params;
|
|
4068
4068
|
}
|
|
4069
4069
|
function convertCheckedContent(item, model) {
|
|
4070
|
+
if (item.type === "hostContext") {
|
|
4071
|
+
throw new Error(`Unprojected hostContext block reached openai-compat conversion (${item.kind}); the request path must project host envelopes to text first.`);
|
|
4072
|
+
}
|
|
4070
4073
|
const modality = item.type === "fileRef" ? item.modality : item.type;
|
|
4071
4074
|
if (modality === "image" || modality === "video" || modality === "audio") {
|
|
4072
4075
|
if (!model.input.includes(modality)) return [{ type: "text", text: `[${modality} attachment omitted: current model does not support this modality. Re-read with a compatible model.]` }];
|
|
@@ -4091,6 +4094,9 @@ function audioFormat(mimeType) {
|
|
|
4091
4094
|
return format;
|
|
4092
4095
|
}
|
|
4093
4096
|
function convertUserContentItem(item) {
|
|
4097
|
+
if (item.type === "hostContext") {
|
|
4098
|
+
throw new Error(`Unprojected hostContext block reached openai-compat conversion (${item.kind}); the request path must project host envelopes to text first.`);
|
|
4099
|
+
}
|
|
4094
4100
|
if (item.type === "text") return [{ type: "text", text: item.text }];
|
|
4095
4101
|
if (item.type === "image") return [{ type: "image_url", image_url: { url: `data:${item.mimeType};base64,${item.data}` } }];
|
|
4096
4102
|
if (item.type === "video") {
|
|
@@ -4501,6 +4507,7 @@ var streamOpenAICompletions = (model, context, options) => {
|
|
|
4501
4507
|
}
|
|
4502
4508
|
if (chunk.usage) {
|
|
4503
4509
|
usageSnapshot = mergeOpenAIUsage(usageSnapshot, chunk.usage);
|
|
4510
|
+
output.usageReported = [usageSnapshot.promptTokens, usageSnapshot.completionTokens].every((value) => typeof value === "number" && Number.isFinite(value) && value >= 0);
|
|
4504
4511
|
const normalizedUsage = normalizeOpenAIUsage(usageSnapshot);
|
|
4505
4512
|
output.usage = {
|
|
4506
4513
|
input: normalizedUsage.input,
|
|
@@ -4841,6 +4848,10 @@ function mapStopReason(reason) {
|
|
|
4841
4848
|
}
|
|
4842
4849
|
}
|
|
4843
4850
|
function convertContentBlocks(content) {
|
|
4851
|
+
const hostBlock = content.find((block) => block.type === "hostContext");
|
|
4852
|
+
if (hostBlock) {
|
|
4853
|
+
throw new Error(`Unprojected hostContext block reached anthropic conversion (${hostBlock.kind}); the request path must project host envelopes to text first.`);
|
|
4854
|
+
}
|
|
4844
4855
|
const supportedBlocks = content.map((block) => block.type === "text" || block.type === "image" ? block : { type: "text", text: `[${block.type} attachment omitted: unsupported by this provider. Re-read with a compatible model.]` });
|
|
4845
4856
|
const hasImages = supportedBlocks.some((c) => c.type === "image");
|
|
4846
4857
|
if (!hasImages) {
|
|
@@ -4867,6 +4878,10 @@ function convertContentBlocks(content) {
|
|
|
4867
4878
|
return blocks;
|
|
4868
4879
|
}
|
|
4869
4880
|
function convertUserContentBlocks(content) {
|
|
4881
|
+
const hostBlock = content.find((block) => block.type === "hostContext");
|
|
4882
|
+
if (hostBlock) {
|
|
4883
|
+
throw new Error(`Unprojected hostContext block reached anthropic user-message conversion (${hostBlock.kind}); the request path must project host envelopes to text first.`);
|
|
4884
|
+
}
|
|
4870
4885
|
const blocks = [];
|
|
4871
4886
|
for (const item of content) {
|
|
4872
4887
|
if (item.type === "text") {
|
|
@@ -5078,9 +5093,12 @@ var streamAnthropic = (model, context, options) => {
|
|
|
5078
5093
|
const anthropicStream = client.messages.stream({ ...params, stream: true }, { signal: options?.signal });
|
|
5079
5094
|
stream.push({ type: "start", partial: output });
|
|
5080
5095
|
const blocks = output.content;
|
|
5096
|
+
let hasReportedInputUsage = false;
|
|
5081
5097
|
for await (const event of anthropicStream) {
|
|
5082
5098
|
if (event.type === "message_start") {
|
|
5083
5099
|
applyAnthropicUsageUpdate(model, output.usage, event.message.usage);
|
|
5100
|
+
hasReportedInputUsage = typeof event.message.usage.input_tokens === "number" && Number.isFinite(event.message.usage.input_tokens) && event.message.usage.input_tokens >= 0;
|
|
5101
|
+
output.usageReported = false;
|
|
5084
5102
|
} else if (event.type === "content_block_start") {
|
|
5085
5103
|
if (event.content_block.type === "text") {
|
|
5086
5104
|
const block = { type: "text", text: "", index: event.index };
|
|
@@ -5185,6 +5203,7 @@ var streamAnthropic = (model, context, options) => {
|
|
|
5185
5203
|
output.stopReason = mapStopReason(event.delta.stop_reason);
|
|
5186
5204
|
}
|
|
5187
5205
|
applyAnthropicUsageUpdate(model, output.usage, event.usage);
|
|
5206
|
+
if (hasReportedInputUsage && typeof event.usage.output_tokens === "number" && Number.isFinite(event.usage.output_tokens) && event.usage.output_tokens >= 0) output.usageReported = true;
|
|
5188
5207
|
}
|
|
5189
5208
|
}
|
|
5190
5209
|
if (options?.signal?.aborted) {
|
|
@@ -5318,6 +5337,9 @@ function encodeUserMessage(content, model) {
|
|
|
5318
5337
|
return { role: "user", type: "message", content: parts };
|
|
5319
5338
|
}
|
|
5320
5339
|
function encodeUserContentBlock(block, model) {
|
|
5340
|
+
if (block.type === "hostContext") {
|
|
5341
|
+
throw new ResponsesProtocolError(`Unprojected hostContext block reached Responses conversion (${block.kind}); the request path must project host envelopes to text first.`);
|
|
5342
|
+
}
|
|
5321
5343
|
const modality = block.type === "fileRef" ? block.modality : block.type;
|
|
5322
5344
|
if (modality !== "text" && !model.input.includes(modality)) {
|
|
5323
5345
|
throw new ResponsesProtocolError(`Current model does not support ${modality} input.`);
|