@cydm/pie 2.7.17 → 2.7.19
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
CHANGED
|
@@ -215,8 +215,8 @@ Main key bindings:
|
|
|
215
215
|
- `Ctrl+D` exit when the editor is empty; forward-delete otherwise
|
|
216
216
|
- `Ctrl+V` / `Alt+V` / `Cmd+V` paste an image from the clipboard when the main chat editor owns focus (terminal clipboard first, OS helper fallback). Plan refinement, extension input/editor/custom UI, visible overlays, and the mention picker retain their own paste keys.
|
|
217
217
|
- `Ctrl+O` expand or collapse tool output
|
|
218
|
-
- `
|
|
219
|
-
- `
|
|
218
|
+
- `Ctrl+X` toggle YOLO mode (`Alt+O` is an optional alias where the terminal delivers Alt)
|
|
219
|
+
- `Ctrl+R` set up or toggle IM forwarding (`Alt+I` is an optional alias where the terminal delivers Alt)
|
|
220
220
|
- `/` open the slash command menu
|
|
221
221
|
|
|
222
222
|
OS clipboard images are staged in per-read private temporary directories (0700 directories and exclusively reserved 0600 files on POSIX), including subprocess output, and removed after staging or on failure. Windows uses the user's temporary directory and inherited OS access controls. Terminal OSC 5522 frames and CSI 5522 support replies are incrementally framed, size-bounded, and never flushed as keyboard input while recognized: the default inter-chunk deadline is 1s, with a 10s absolute frame deadline. Failed frames discard their tails through the terminator or until 1s of idle recovery. An ambiguous lone Escape keeps its normal keyboard timeout unless a clipboard request is active; even then it is eventually delivered as Escape. After idle recovery, arbitrarily late bare payload bytes cannot be distinguished from new typing.
|
|
@@ -365,10 +365,14 @@ function createRuntime(ctx, cfg, connection, liveEnabled, persistEnabled) {
|
|
|
365
365
|
ctx.ui.notify("IM forwarding disabled", "info");
|
|
366
366
|
}
|
|
367
367
|
}
|
|
368
|
-
ctx.registerShortcut("
|
|
368
|
+
ctx.registerShortcut("ctrl+r", {
|
|
369
369
|
description: "Toggle IM forwarding",
|
|
370
370
|
handler: toggleForwarding
|
|
371
371
|
});
|
|
372
|
+
ctx.registerShortcut("alt+i", {
|
|
373
|
+
description: "Toggle IM forwarding (terminal Alt alias)",
|
|
374
|
+
handler: toggleForwarding
|
|
375
|
+
});
|
|
372
376
|
let currentSessionId = null;
|
|
373
377
|
const pendingInputs = [];
|
|
374
378
|
const replyAnchor = /* @__PURE__ */ new Map();
|
|
@@ -2079,13 +2083,13 @@ function initializeImForward(ctx, providers = implementedProviders) {
|
|
|
2079
2083
|
try {
|
|
2080
2084
|
const settings = provider.resolve(config.settings);
|
|
2081
2085
|
if (!settings) {
|
|
2082
|
-
ctx.ui.notify(`IM forwarding: ${provider.label} target/settings are incomplete. Use
|
|
2086
|
+
ctx.ui.notify(`IM forwarding: ${provider.label} target/settings are incomplete. Use Ctrl+R or /im-forward setup.`, "warning");
|
|
2083
2087
|
ctx.ui.setStatus?.("im-forward", "[IM!]");
|
|
2084
2088
|
return;
|
|
2085
2089
|
}
|
|
2086
2090
|
const connection = provider.connect(settings, ctx.cwd);
|
|
2087
2091
|
if (!connection) {
|
|
2088
|
-
ctx.ui.notify(`IM forwarding: ${provider.label} connection could not be prepared. Use
|
|
2092
|
+
ctx.ui.notify(`IM forwarding: ${provider.label} connection could not be prepared. Use Ctrl+R or /im-forward setup to check provider dependencies and configuration.`, "warning");
|
|
2089
2093
|
ctx.ui.setStatus?.("im-forward", "[IM!]");
|
|
2090
2094
|
return;
|
|
2091
2095
|
}
|
|
@@ -2184,7 +2188,7 @@ function initializeImForward(ctx, providers = implementedProviders) {
|
|
|
2184
2188
|
}
|
|
2185
2189
|
function showStatus(commandCtx) {
|
|
2186
2190
|
if (status) status(commandCtx);
|
|
2187
|
-
else commandCtx.ui.notify("IM forwarding is not configured or unavailable. Use
|
|
2191
|
+
else commandCtx.ui.notify("IM forwarding is not configured or unavailable. Use Ctrl+R or /im-forward setup.", "info");
|
|
2188
2192
|
}
|
|
2189
2193
|
async function clearConfiguration(commandCtx) {
|
|
2190
2194
|
setupAbort?.abort();
|
|
@@ -2204,7 +2208,8 @@ This does not remove the app credentials lark-cli itself stores; re-running setu
|
|
|
2204
2208
|
commandCtx.ui.notify(error.message || "IM forwarding configuration could not be cleared.", "error");
|
|
2205
2209
|
}
|
|
2206
2210
|
}
|
|
2207
|
-
ctx.registerShortcut("
|
|
2211
|
+
ctx.registerShortcut("ctrl+r", { description: "Set up or toggle IM forwarding", handler: () => toggleNow(ctx) });
|
|
2212
|
+
ctx.registerShortcut("alt+i", { description: "Set up or toggle IM forwarding (terminal Alt alias)", handler: () => toggleNow(ctx) });
|
|
2208
2213
|
ctx.registerCommand({ path: ["im-forward", "status"], description: "Show IM forwarding status", handler: async (commandCtx) => {
|
|
2209
2214
|
if (!disposed) showStatus(commandCtx);
|
|
2210
2215
|
} });
|
|
@@ -2214,7 +2219,7 @@ This does not remove the app credentials lark-cli itself stores; re-running setu
|
|
|
2214
2219
|
ctx.registerCommand({ path: ["im-forward", "setup"], description: "Run the IM forwarding setup wizard", handler: async () => {
|
|
2215
2220
|
if (!disposed) await setup();
|
|
2216
2221
|
} });
|
|
2217
|
-
ctx.registerCommand({ path: ["im-forward", "toggle"], description: "Toggle IM forwarding on/off (same as
|
|
2222
|
+
ctx.registerCommand({ path: ["im-forward", "toggle"], description: "Toggle IM forwarding on/off (same as Ctrl+R)", handler: async (commandCtx) => {
|
|
2218
2223
|
if (!disposed) await toggleNow(commandCtx);
|
|
2219
2224
|
} });
|
|
2220
2225
|
ctx.registerCommand({ path: ["im-forward", "clear"], description: "Remove IM forwarding configuration (with confirmation)", handler: async (commandCtx) => {
|
|
@@ -297,13 +297,15 @@ function resolveIpcConfig(configLayers) {
|
|
|
297
297
|
invalidConfig = true;
|
|
298
298
|
}
|
|
299
299
|
if (invalidConfig || merged.enabled === false) return { config: null, problems };
|
|
300
|
-
const config = { enabled: true };
|
|
300
|
+
const config = { enabled: true, allowPeers: ["*"], autoInject: true };
|
|
301
301
|
if (typeof merged.displayName === "string" && merged.displayName.trim()) {
|
|
302
302
|
config.displayName = merged.displayName.replace(/[\u0000-\u001f\u007f]/g, " ").trim().slice(0, 60);
|
|
303
303
|
}
|
|
304
304
|
if (Array.isArray(merged.allowPeers)) {
|
|
305
|
-
|
|
306
|
-
|
|
305
|
+
config.allowPeers = merged.allowPeers.filter((id) => typeof id === "string" && (id === "*" || isValidInstanceId(id))).slice(0, 1e3);
|
|
306
|
+
} else if (merged.allowPeers !== void 0) {
|
|
307
|
+
config.allowPeers = [];
|
|
308
|
+
problems.push("pie-ipc: allowPeers must be an array");
|
|
307
309
|
}
|
|
308
310
|
if (merged.autoInject !== void 0) config.autoInject = merged.autoInject === true;
|
|
309
311
|
if (typeof merged.maxBodyChars === "number" && Number.isFinite(merged.maxBodyChars)) {
|
|
@@ -1528,7 +1530,7 @@ var Runtime = class {
|
|
|
1528
1530
|
this.config = config;
|
|
1529
1531
|
this.discoveryDir = discoveryDir;
|
|
1530
1532
|
this.displayName = config.displayName ?? peerLabel(this.instanceId);
|
|
1531
|
-
this.allowPolicy = new AllowPolicy(config.allowPeers ? [...config.allowPeers] : []);
|
|
1533
|
+
this.allowPolicy = new AllowPolicy(config.allowPeers ? [...config.allowPeers] : ["*"]);
|
|
1532
1534
|
this.projection = new StatusProjection({ getMessages: () => ctx.getMessages() });
|
|
1533
1535
|
}
|
|
1534
1536
|
ctx;
|
|
@@ -1975,17 +1977,28 @@ ${message.text}`).join("\n---\n");
|
|
|
1975
1977
|
}
|
|
1976
1978
|
};
|
|
1977
1979
|
function loadConfig(ctx, configDir) {
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1980
|
+
try {
|
|
1981
|
+
const layers = [
|
|
1982
|
+
{ file: path4.join(configDir, "ipc.json"), content: safeRead(path4.join(configDir, "ipc.json")) },
|
|
1983
|
+
{ file: path4.join(ctx.cwd, ".pie", "ipc.json"), content: safeRead(path4.join(ctx.cwd, ".pie", "ipc.json")) }
|
|
1984
|
+
];
|
|
1985
|
+
return resolveIpcConfig(layers);
|
|
1986
|
+
} catch (error) {
|
|
1987
|
+
return { config: null, problems: [`configuration read failed: ${error instanceof Error ? error.message : String(error)}`] };
|
|
1988
|
+
}
|
|
1983
1989
|
}
|
|
1984
1990
|
function safeRead(file) {
|
|
1985
1991
|
try {
|
|
1986
1992
|
return fs3.readFileSync(file, "utf8");
|
|
1987
|
-
} catch {
|
|
1988
|
-
|
|
1993
|
+
} catch (error) {
|
|
1994
|
+
if (error.code === "ENOENT") {
|
|
1995
|
+
try {
|
|
1996
|
+
fs3.lstatSync(file);
|
|
1997
|
+
} catch (statError) {
|
|
1998
|
+
if (statError.code === "ENOENT") return void 0;
|
|
1999
|
+
}
|
|
2000
|
+
}
|
|
2001
|
+
throw error;
|
|
1989
2002
|
}
|
|
1990
2003
|
}
|
|
1991
2004
|
function pieIpcExtension(ctx) {
|
|
@@ -2023,7 +2036,7 @@ function pieIpcExtension(ctx) {
|
|
|
2023
2036
|
getMessages: () => ctx.getMessages(),
|
|
2024
2037
|
log: (message) => ctx.log(message)
|
|
2025
2038
|
},
|
|
2026
|
-
{ autoInject: config.autoInject ??
|
|
2039
|
+
{ autoInject: config.autoInject ?? true, allowPolicy: runtime.allowPolicy, onConsumed: (id) => runtime.markConsumed(id) }
|
|
2027
2040
|
);
|
|
2028
2041
|
void runtime.startServer().catch((error) => {
|
|
2029
2042
|
ctx.log(`pie-ipc: server start failed: ${error instanceof Error ? error.message : String(error)}`);
|
package/dist/cli.js
CHANGED
|
@@ -58512,7 +58512,7 @@ function matchesKey(data, keyId) {
|
|
|
58512
58512
|
if (ctrl && alt && !shift && !_kittyProtocolActive && rawCtrl) {
|
|
58513
58513
|
return data === `\x1B${rawCtrl}`;
|
|
58514
58514
|
}
|
|
58515
|
-
if (alt && !ctrl && !shift &&
|
|
58515
|
+
if (alt && !ctrl && !shift && key >= "a" && key <= "z") {
|
|
58516
58516
|
if (data === `\x1B${key}`) return true;
|
|
58517
58517
|
}
|
|
58518
58518
|
if (ctrl && !shift && !alt) {
|
|
@@ -65402,7 +65402,7 @@ var DEFAULT_APP_KEYBINDINGS = {
|
|
|
65402
65402
|
selectModel: "ctrl+l",
|
|
65403
65403
|
expandTools: "ctrl+o",
|
|
65404
65404
|
toggleThinking: "ctrl+t",
|
|
65405
|
-
toggleYolo: "alt+o",
|
|
65405
|
+
toggleYolo: ["ctrl+x", "alt+o"],
|
|
65406
65406
|
toggleSessionNamedFilter: "ctrl+n",
|
|
65407
65407
|
externalEditor: "ctrl+g",
|
|
65408
65408
|
steer: "alt+enter",
|