@cydm/pie 4.5.0 → 4.5.1
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 +24 -0
- package/dist/builtin/extensions/cron/index.js +1 -1
- package/dist/builtin/extensions/im-forward/index.js +6 -6
- package/dist/builtin/extensions/memory/index.js +2 -2
- package/dist/builtin/extensions/pie-ipc/README.md +1 -1
- package/dist/builtin/extensions/pie-ipc/index.js +4 -4
- package/dist/builtin/extensions/pie-proc/index.js +1 -1
- package/dist/builtin/extensions/plan-mode/index.js +4 -4
- package/dist/chunks/{chunk-X6LBWHK3.js → chunk-7RJXKN7N.js} +1 -1
- package/dist/chunks/{manager-cli-2ATPC47M.js → manager-cli-T26F3FUW.js} +268 -142
- package/dist/chunks/{manager-upgrade-5CPKTRJ7.js → manager-upgrade-YVHK3XZE.js} +32 -12
- package/dist/cli.js +17 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -196,8 +196,32 @@ If you want an agent that feels lightweight but still has serious capability, th
|
|
|
196
196
|
|
|
197
197
|
The CLI should consume shared capability and framework contracts; it should not redefine shared runtime or extension semantics locally.
|
|
198
198
|
|
|
199
|
+
## Windows manager service
|
|
200
|
+
|
|
201
|
+
`pie manager start` (or bare `pie manager`) starts an already-installed Windows
|
|
202
|
+
scheduled task without uninstalling it or creating a separate manual resident.
|
|
203
|
+
The message confirms the start request, not model/IM readiness; use
|
|
204
|
+
`pie manager tail` to inspect startup output.
|
|
205
|
+
|
|
206
|
+
`pie manager --install-service` builds a small GUI-subsystem launcher using the
|
|
207
|
+
Windows .NET Framework v4 compiler. The task and its Node resident create no
|
|
208
|
+
console window. A private Windows Job Object keeps descendants tied to the
|
|
209
|
+
launcher: stopping the task also ends its descendant processes. stdout/stderr
|
|
210
|
+
append to `~/.pie/manager/log.jsonl`; native launch failures go to
|
|
211
|
+
`service-launcher.log` beside it. No extra package is downloaded.
|
|
212
|
+
|
|
213
|
+
Existing scheduled tasks retain their old action until reinstalled. After
|
|
214
|
+
updating Pie, stop the manager and run `pie manager --install-service`, then
|
|
215
|
+
`pie manager start`, to adopt the windowless launcher. The service runs as the
|
|
216
|
+
same Windows user/profile that installed it. The generated launcher captures
|
|
217
|
+
the Node/CLI paths and configuration roots; reinstall after changing those paths.
|
|
218
|
+
|
|
199
219
|
## Interactive Experience
|
|
200
220
|
|
|
221
|
+
Product-owned UI labels, errors, and operational hints default to English.
|
|
222
|
+
User-authored content, multilingual input recognition, and explicitly selected
|
|
223
|
+
localizations are preserved rather than translated.
|
|
224
|
+
|
|
201
225
|
Run:
|
|
202
226
|
|
|
203
227
|
```bash
|
|
@@ -1530,7 +1530,7 @@ WARNING: change applied but the audit log could not be written (${String(e)})`;
|
|
|
1530
1530
|
} catch {
|
|
1531
1531
|
}
|
|
1532
1532
|
const safeStartupError = typeof startupError === "string" ? startupError.replace(/[\u0000-\u001f\u007f]/g, " ").slice(0, 160) : void 0;
|
|
1533
|
-
const why = unsafe ? "cron
|
|
1533
|
+
const why = unsafe ? "cron state is unsafe (unsafe.lock); inspect /tools/cron before recovering manually." : duplicates ? "Duplicate owners for this session (possibly leftover processes); retrying will not help. Inspect /tools/cron." : worker ? "A cron worker is running a task for this session; input will resume when the task finishes." : safeStartupError ? `cron startup failed: ${safeStartupError}` : "cron session ownership is not ready; try again shortly.";
|
|
1534
1534
|
ctx.ui.notify("cron: session ownership is uncertain or duplicated; input blocked. Close the duplicate/worker and inspect /tools/cron.", "warning");
|
|
1535
1535
|
return { action: "reject", reason: why };
|
|
1536
1536
|
});
|
|
@@ -819,7 +819,7 @@ function summarizeFailureReason(reason) {
|
|
|
819
819
|
return { summary: "network problem", persistent: false };
|
|
820
820
|
return { summary: "provider exited", persistent: false };
|
|
821
821
|
}
|
|
822
|
-
var IM_INPUT_FALLBACK_CAPTION = "
|
|
822
|
+
var IM_INPUT_FALLBACK_CAPTION = "Please review these images and respond.";
|
|
823
823
|
function hashText(input) {
|
|
824
824
|
let hash = 0;
|
|
825
825
|
for (let i = 0; i < input.length; i++) {
|
|
@@ -1351,7 +1351,7 @@ ${pending.caption || IM_INPUT_FALLBACK_CAPTION}` : pending.caption).trim();
|
|
|
1351
1351
|
const attribution = resolveOutboundAttribution(sessionId);
|
|
1352
1352
|
const deliverTf = /* @__PURE__ */ new Map();
|
|
1353
1353
|
if (!outboundRoleAllows(attribution, deliverTf)) return;
|
|
1354
|
-
const recoveryHint = `Your input is still in the session \u2014 reply "
|
|
1354
|
+
const recoveryHint = `Your input is still in the session \u2014 reply "redo the last one" to answer from it again without resending the original request.`;
|
|
1355
1355
|
void forwardMessage(
|
|
1356
1356
|
`\u26A0\uFE0F Task failed: ${reason} (retries exhausted)
|
|
1357
1357
|
${recoveryHint}`,
|
|
@@ -2733,7 +2733,7 @@ async function probeCardActionSubscription(ctx, cwd, binaryOverride, profile) {
|
|
|
2733
2733
|
done();
|
|
2734
2734
|
}, 3500);
|
|
2735
2735
|
timer.unref?.();
|
|
2736
|
-
const child = spawn5(binary, ["event", "consume", "card.action.trigger", "--as", "bot", ...profile ? ["--profile", profile] : []], { cwd, stdio: ["ignore", "pipe", "pipe"] });
|
|
2736
|
+
const child = spawn5(binary, ["event", "consume", "card.action.trigger", "--as", "bot", ...profile ? ["--profile", profile] : []], { cwd, stdio: ["ignore", "pipe", "pipe"], windowsHide: true });
|
|
2737
2737
|
child.on("error", () => done());
|
|
2738
2738
|
child.on("close", () => done());
|
|
2739
2739
|
let out = "";
|
|
@@ -2744,8 +2744,8 @@ async function probeCardActionSubscription(ctx, cwd, binaryOverride, profile) {
|
|
|
2744
2744
|
const unsubscribed = /requires callbacks not subscribed/i.test(out);
|
|
2745
2745
|
if (unsubscribed) {
|
|
2746
2746
|
const launcher = /https:\/\/open\.feishu\.cn\/page\/launcher\?[^\s"]+/.exec(out)?.[0];
|
|
2747
|
-
ctx.ui.notify(
|
|
2748
|
-
|
|
2747
|
+
ctx.ui.notify(`Panel buttons require a one-time subscription to card.action.trigger. Without it, the panel still works through text commands.${launcher ? `
|
|
2748
|
+
Open this link and scan the QR code to subscribe: ${launcher}` : "\nIn the developer console, open Events & Callbacks and subscribe to card.action.trigger."}`, "info");
|
|
2749
2749
|
}
|
|
2750
2750
|
});
|
|
2751
2751
|
});
|
|
@@ -2753,7 +2753,7 @@ async function probeCardActionSubscription(ctx, cwd, binaryOverride, profile) {
|
|
|
2753
2753
|
async function settingsProbeBinary() {
|
|
2754
2754
|
try {
|
|
2755
2755
|
const { spawnSync } = await import("node:child_process");
|
|
2756
|
-
const which = spawnSync(process.platform === "win32" ? "where" : "which", ["lark-cli"], { encoding: "utf8", timeout: 3e3 });
|
|
2756
|
+
const which = spawnSync(process.platform === "win32" ? "where" : "which", ["lark-cli"], { encoding: "utf8", timeout: 3e3, windowsHide: true });
|
|
2757
2757
|
const path12 = which.stdout?.split(/\r?\n/)[0]?.trim();
|
|
2758
2758
|
return path12 || void 0;
|
|
2759
2759
|
} catch {
|
|
@@ -213,7 +213,7 @@ ${injectionMemo.text}` };
|
|
|
213
213
|
const snapshotConsumedIn = (snapshot, output) => materialConsumedIn(snapshot.text, snapshot.quotes, output);
|
|
214
214
|
ctx.registerTool({
|
|
215
215
|
name: "memory_save",
|
|
216
|
-
description: 'Explicitly save a durable memory. HIGHEST-PRIORITY RULE: when the user explicitly asks to remember something (e.g. "\u8BB0\u4F4F\u2026", "from now on\u2026", "always\u2026"), you MUST call this tool \u2014 never claim you will remember without a successful call. Supersedes conflicting entries of the same kind automatically. After success, confirm briefly (e.g. "\
|
|
216
|
+
description: 'Explicitly save a durable memory. HIGHEST-PRIORITY RULE: when the user explicitly asks to remember something (e.g. "\u8BB0\u4F4F\u2026", "from now on\u2026", "always\u2026"), you MUST call this tool \u2014 never claim you will remember without a successful call. Supersedes conflicting entries of the same kind automatically. After success, confirm briefly (e.g. "Remembered: \u2026"). If this tool is unavailable, say the request only holds for the current session.',
|
|
217
217
|
parameters: Type.Object({
|
|
218
218
|
kind: Type.Union([
|
|
219
219
|
Type.Literal("preference"),
|
|
@@ -322,7 +322,7 @@ function buildInjectionSectionWithIds(store, budget, projectKey) {
|
|
|
322
322
|
fit = cut > 0 ? fit.slice(0, cut) : fit.slice(0, Math.floor(fit.length / 2));
|
|
323
323
|
}
|
|
324
324
|
soulText = fit.length > 0 ? `${fit}
|
|
325
|
-
\u2026
|
|
325
|
+
\u2026 (Persona truncated: SOUL.md exceeds its budget; shorten ~/.pie/memory/SOUL.md.)` : void 0;
|
|
326
326
|
soulBudgetTokens = fit.length > 0 ? estimateTokens(fit) : 0;
|
|
327
327
|
}
|
|
328
328
|
}
|
|
@@ -16,6 +16,6 @@ Absent `allowPeers` defaults to `["*"]`, trusting authenticated local clients; a
|
|
|
16
16
|
|
|
17
17
|
Use `/tools/ipc peers`, `/tools/ipc status <peer>`, `/tools/ipc send <peer> <text>`, `/tools/ipc result <peer> [requestId]`, `/tools/ipc poll`, `/tools/ipc name`, `/tools/ipc mute [off]`, and `/tools/ipc allow <id|*>`. Only explicit `/tools/ipc poll` submits command output to the model; other commands notify the user. Changes from commands are ephemeral.
|
|
18
18
|
|
|
19
|
-
Tools: `ipc_list_peers`, `ipc_status`, `ipc_send_notify`, `ipc_result`, `ipc_poll`. Every send exposes a requestId. `ipc_send_notify` — the name is the contract: sending subscribes to completion by DEFAULT (returns after the receipt ack; the peer pushes one `[ipc-done]` message with outcome + bounded answer when its turn settles). On interactive AND embedded resident hosts it is injected (single wake — both are editorInjection hosts); on one-shot headless clients it lands in the pollable inbox with an informational `[ipc-done-check]` hint. A local fallback timer (`fallbackMs`) wakes a result check if no push arrives. Explicit `notify:false` opts out to fire-and-forget (no wake, receipt unconfirmed). Non-waiting requests can be polled with `ipc_result` through accepted/running/done or failed; omitting requestId lists recent results. Reads do not consume results. Results are session-scoped, bounded, retained in memory only, and unknown after eviction/restart. A receipt is not a result: waited results use the original authenticated socket after input consumption and execution settlement. Queued/muted input never receives unrelated turn output. Delivery is bounded, best-effort, not durable; uncertain busy followups are never automatically duplicated. Restart every peer after protocol changes; there is no compatibility layer. Windows uses native HANDLE-based
|
|
19
|
+
Tools: `ipc_list_peers`, `ipc_status`, `ipc_send_notify`, `ipc_result`, `ipc_poll`. Every send exposes a requestId. `ipc_send_notify` — the name is the contract: sending subscribes to completion by DEFAULT (returns after the receipt ack; the peer pushes one `[ipc-done]` message with outcome + bounded answer when its turn settles). On interactive AND embedded resident hosts it is injected (single wake — both are editorInjection hosts); on one-shot headless clients it lands in the pollable inbox with an informational `[ipc-done-check]` hint. A local fallback timer (`fallbackMs`) wakes a result check if no push arrives. Explicit `notify:false` opts out to fire-and-forget (no wake, receipt unconfirmed). Non-waiting requests can be polled with `ipc_result` through accepted/running/done or failed; omitting requestId lists recent results. Reads do not consume results. Results are session-scoped, bounded, retained in memory only, and unknown after eviction/restart. A receipt is not a result: waited results use the original authenticated socket after input consumption and execution settlement. Queued/muted input never receives unrelated turn output. Delivery is bounded, best-effort, not durable; uncertain busy followups are never automatically duplicated. Restart every peer after protocol changes; there is no compatibility layer. Windows uses native HANDLE-based owner checks and private discovery-directory/file ACL checks, with atomic protected directory and temporary-file creation. Ancestor write grants (including sandbox grants on the profile) no longer disable IPC: availability takes precedence over defending against hostile concurrent ancestor mutation. Owner/type checks, observed reparse rejection, and per-operation no-delete handles remain, but these are not a guarantee against path redirection races. Unsafe discovery-directory/file ACLs still fail closed without repair; no user/system ACLs are rewritten and there is no presence-only fallback. Same-user isolation, hostile ancestor mutation, and the stale-advertisement/first-send unencrypted endpoint-identity limitation remain outside this guarantee; see the complete contract below.
|
|
20
20
|
|
|
21
21
|
See [the complete contract](../../../../../docs/pie-ipc.md) for configuration, HMAC/permissions, snapshot freshness, limits, recovery limitations, and reproducible tests including a checked-in two-process factory dogfood driver.
|
|
@@ -125,9 +125,10 @@ function initialize() {
|
|
|
125
125
|
if (!directory && (b.readUInt32LE(40) !== 1 || b.readUInt32LE(32) !== 0)) fail();
|
|
126
126
|
const owner = [null], dacl = [null], sd = [null];
|
|
127
127
|
try {
|
|
128
|
-
if (security(h, 1, 5, owner, null, dacl, null, sd) !== 0 || !owner[0] || !dacl[0]) fail();
|
|
128
|
+
if (security(h, 1, privateObject ? 5 : 1, owner, null, privateObject ? dacl : null, null, sd) !== 0 || !owner[0] || privateObject && !dacl[0]) fail();
|
|
129
129
|
const ownerSid = sid(owner[0]);
|
|
130
130
|
if (!trusted.has(ownerSid) && !(!privateObject && systemAncestor && ownerSid === installer)) fail();
|
|
131
|
+
if (!privateObject) return b.readUInt32LE(36);
|
|
131
132
|
const header = Buffer.from(k.decode(dacl[0], "uint8", 8));
|
|
132
133
|
const count = header.readUInt16LE(4);
|
|
133
134
|
for (let i = 0; i < count; i++) {
|
|
@@ -139,8 +140,7 @@ function initialize() {
|
|
|
139
140
|
if (head[0] !== 0 || head.readUInt16LE(2) < 12) fail();
|
|
140
141
|
const principal = sid(k.address(a[0]) + 8n);
|
|
141
142
|
const mask = head.readUInt32LE(4);
|
|
142
|
-
|
|
143
|
-
if (!trusted.has(principal) && (privateObject ? mask !== 0 : !!(mask & dangerousAncestorRights))) fail();
|
|
143
|
+
if (!trusted.has(principal) && mask !== 0) fail();
|
|
144
144
|
}
|
|
145
145
|
} finally {
|
|
146
146
|
if (sd[0]) free(sd[0]);
|
|
@@ -1770,7 +1770,7 @@ function pieIpcExtension(ctx) {
|
|
|
1770
1770
|
try {
|
|
1771
1771
|
discoveryDir = ipcDiscoveryDir(configDir);
|
|
1772
1772
|
} catch {
|
|
1773
|
-
ctx.log("pie-ipc: disabled:
|
|
1773
|
+
ctx.log("pie-ipc: disabled: discovery path validation failed");
|
|
1774
1774
|
return;
|
|
1775
1775
|
}
|
|
1776
1776
|
const { config, problems } = loadConfig(ctx, configDir);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
readProcessCommandLine
|
|
4
|
-
} from "../../../chunks/chunk-
|
|
4
|
+
} from "../../../chunks/chunk-7RJXKN7N.js";
|
|
5
5
|
import {
|
|
6
6
|
liveSessionHolder
|
|
7
7
|
} from "../../../chunks/chunk-CGSFBWOM.js";
|
|
@@ -234,7 +234,7 @@ Rules: execute one step, verify it (run its verify criterion when practical), th
|
|
|
234
234
|
ctx.setSessionMetadata(SESSION_METADATA_KEY, planModeEnabled);
|
|
235
235
|
applyPlanModeState(planModeEnabled, true);
|
|
236
236
|
ctx.ui.notify(
|
|
237
|
-
planModeEnabled ? `Plan mode enabled \u2014 discussion first (grilling); say "
|
|
237
|
+
planModeEnabled ? `Plan mode enabled \u2014 discussion first (grilling); say "give me the plan" or /tools/plan/submit when you want the plan itself.` : "Plan mode disabled. Full access restored."
|
|
238
238
|
);
|
|
239
239
|
updateStatus();
|
|
240
240
|
}
|
|
@@ -353,9 +353,9 @@ Update the plan accordingly and call plan_submit again with the revised steps. D
|
|
|
353
353
|
return;
|
|
354
354
|
}
|
|
355
355
|
const context = (args ?? "").trim();
|
|
356
|
-
return context ?
|
|
356
|
+
return context ? `Give me the plan. Additional context from the user: ${context}
|
|
357
357
|
|
|
358
|
-
Produce the MVP-ladder plan now (each step: title, optional detail, verify criterion, file scope) and call plan_submit with it.` : "
|
|
358
|
+
Produce the MVP-ladder plan now (each step: title, optional detail, verify criterion, file scope) and call plan_submit with it.` : "Give me the plan. Produce the MVP-ladder plan now (each step: title, optional detail, verify criterion, file scope) and call plan_submit with it.";
|
|
359
359
|
}
|
|
360
360
|
});
|
|
361
361
|
ctx.registerCommand({
|
|
@@ -381,7 +381,7 @@ ${completedLines}
|
|
|
381
381
|
Remaining steps as previously approved:
|
|
382
382
|
${remainingItems.map((item) => `- ${item.text}${item.detail ? ` \u2014 ${item.detail}` : ""}${item.verify ? ` (verify: ${item.verify})` : ""}${item.files?.length ? ` [files: ${item.files.join(", ")}]` : ""}`).join("\n") || "- (none)"}
|
|
383
383
|
|
|
384
|
-
Discuss the revision with the user (read-only; Plan mode is back on). When the user asks for the revised plan (e.g.
|
|
384
|
+
Discuss the revision with the user (read-only; Plan mode is back on). When the user asks for the revised plan (e.g. "give me the plan" or /tools/plan/submit), call plan_submit with the REVISED REMAINING steps only.`;
|
|
385
385
|
}
|
|
386
386
|
});
|
|
387
387
|
ctx.registerShortcut("ctrl+alt+p", {
|
|
@@ -13,7 +13,7 @@ function probeWindows(pid, exec) {
|
|
|
13
13
|
for (const spec of windowsProbeSpecs(pid)) {
|
|
14
14
|
let out;
|
|
15
15
|
try {
|
|
16
|
-
out = exec(spec.file, spec.args, { encoding: "utf8", timeout: 3e3, stdio: ["ignore", "pipe", "pipe"] });
|
|
16
|
+
out = exec(spec.file, spec.args, { encoding: "utf8", timeout: 3e3, stdio: ["ignore", "pipe", "pipe"], windowsHide: true });
|
|
17
17
|
} catch (error) {
|
|
18
18
|
const code = error.code;
|
|
19
19
|
if (code === "ENOENT") continue;
|