@paradow/ledge 0.9.1 → 0.10.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/dist/cli/{attach-AZFKVVKL.js → attach-2DEXQEC2.js} +4 -4
- package/dist/cli/{bridge-XHPCIYE4.js → bridge-ZOHP53DV.js} +1 -1
- package/dist/cli/{chunk-LYTRXJAQ.js → chunk-GMKS55KF.js} +1 -1
- package/dist/cli/{chunk-65XGYBHL.js → chunk-IC5RHOX6.js} +3 -3
- package/dist/cli/{chunk-KDYAHPYN.js → chunk-JOCNCNRP.js} +2 -0
- package/dist/cli/{chunk-I4C5U6AI.js → chunk-OHKQKXYM.js} +1 -1
- package/dist/cli/{chunk-IWJAJAPK.js → chunk-TC3XJUJA.js} +1 -1
- package/dist/cli/chunk-XOPH7YDV.js +6 -0
- package/dist/cli/{daemon-NDXT3ZDF.js → daemon-RI47DJDX.js} +18 -9
- package/dist/cli/{hook-5HXY2UGM.js → hook-W46IWB7I.js} +4 -4
- package/dist/cli/index.js +8 -8
- package/dist/cli/{launch-HEJKGMYS.js → launch-S6XFRSZA.js} +4 -4
- package/dist/cli/{status-PDNC6IC2.js → status-QOXWNLLF.js} +2 -2
- package/dist/cli/{version-AQN6JNH7.js → version-SO5OMPGD.js} +1 -1
- package/dist/cli/{who-LIMQJMNI.js → who-WVYFPCII.js} +2 -2
- package/package.json +1 -1
- package/dist/cli/chunk-YXXXSRQX.js +0 -6
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
attachEnv
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-IC5RHOX6.js";
|
|
4
|
+
import "./chunk-GMKS55KF.js";
|
|
5
5
|
import {
|
|
6
6
|
realTmux
|
|
7
7
|
} from "./chunk-TO4XO2ML.js";
|
|
8
8
|
import "./chunk-YUSY3E47.js";
|
|
9
9
|
import {
|
|
10
10
|
connect
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-TC3XJUJA.js";
|
|
12
12
|
import {
|
|
13
13
|
PROTOCOL_PORT
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-JOCNCNRP.js";
|
|
15
15
|
import "./chunk-FGOFRWIB.js";
|
|
16
16
|
|
|
17
17
|
// src/cli/attach.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
exitFile,
|
|
3
3
|
spawnSession
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-GMKS55KF.js";
|
|
5
5
|
import {
|
|
6
6
|
realTmux
|
|
7
7
|
} from "./chunk-TO4XO2ML.js";
|
|
@@ -11,10 +11,10 @@ import {
|
|
|
11
11
|
import {
|
|
12
12
|
DaemonRefusedError,
|
|
13
13
|
connect
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-TC3XJUJA.js";
|
|
15
15
|
import {
|
|
16
16
|
PROTOCOL_PORT
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-JOCNCNRP.js";
|
|
18
18
|
import {
|
|
19
19
|
ensureLedgeDir
|
|
20
20
|
} from "./chunk-FGOFRWIB.js";
|
|
@@ -176,6 +176,8 @@ var SessionSchema = z.object({
|
|
|
176
176
|
repoPath: z.string().optional(),
|
|
177
177
|
branch: z.string().optional(),
|
|
178
178
|
worktree: z.boolean().optional(),
|
|
179
|
+
/** The folder the agent works in now, as its last hook reported it: `cwd` stays where it started, this follows a worktree it entered. */
|
|
180
|
+
workdir: z.string().optional(),
|
|
179
181
|
tmuxSession: z.string().nullable(),
|
|
180
182
|
state: SessionStateSchema,
|
|
181
183
|
pending: PendingSchema.optional(),
|
|
@@ -12,17 +12,17 @@ import {
|
|
|
12
12
|
pendingTool,
|
|
13
13
|
reduce,
|
|
14
14
|
repositoryId
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-OHKQKXYM.js";
|
|
16
16
|
import {
|
|
17
17
|
agentMessages,
|
|
18
18
|
claudeOpenCall,
|
|
19
19
|
claudePlan,
|
|
20
20
|
claudeToolAnswered,
|
|
21
21
|
spawnSession
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-GMKS55KF.js";
|
|
23
23
|
import {
|
|
24
24
|
LEDGE_VERSION
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-XOPH7YDV.js";
|
|
26
26
|
import {
|
|
27
27
|
SERVICE,
|
|
28
28
|
inDaemonService,
|
|
@@ -64,7 +64,7 @@ import {
|
|
|
64
64
|
proposalRows,
|
|
65
65
|
requestAuthorized,
|
|
66
66
|
selectDaemonProtocol
|
|
67
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-JOCNCNRP.js";
|
|
68
68
|
import {
|
|
69
69
|
ensureLedgeDir,
|
|
70
70
|
paths
|
|
@@ -2583,10 +2583,18 @@ async function readDocument(request, context) {
|
|
|
2583
2583
|
if (/^(?:file:|[a-zA-Z]:[\\/]|\\\\)/.test(source) || source.includes("\0")) return failure(request, "unsupported_path");
|
|
2584
2584
|
if (request.basePath && (!isAbsolute3(request.basePath) || !markdown(request.basePath))) return failure(request, "unsupported_path");
|
|
2585
2585
|
const expanded = source === "~" ? context.home : source.startsWith("~/") ? resolve6(context.home, source.slice(2)) : source;
|
|
2586
|
-
const
|
|
2587
|
-
if (!isAbsolute3(expanded) && !
|
|
2588
|
-
const
|
|
2589
|
-
if (!markdown(
|
|
2586
|
+
const bases = request.basePath ? [dirname5(request.basePath)] : [...new Set([context.workdir, context.cwd].filter((d) => !!d))];
|
|
2587
|
+
if (!isAbsolute3(expanded) && !bases.length) return failure(request, "ambiguous_path");
|
|
2588
|
+
const paths2 = isAbsolute3(expanded) ? [resolve6(expanded)] : bases.map((base) => resolve6(base, expanded));
|
|
2589
|
+
if (!markdown(paths2[0])) return failure(request, "unsupported_type");
|
|
2590
|
+
let read = failure(request, "not_found");
|
|
2591
|
+
for (const path of paths2) {
|
|
2592
|
+
read = await readAt(request, path);
|
|
2593
|
+
if (read.type === "document.content" || read.code !== "not_found") return read;
|
|
2594
|
+
}
|
|
2595
|
+
return read;
|
|
2596
|
+
}
|
|
2597
|
+
async function readAt(request, path) {
|
|
2590
2598
|
let file;
|
|
2591
2599
|
try {
|
|
2592
2600
|
file = await open2(path, constants2.O_RDONLY | constants2.O_NONBLOCK);
|
|
@@ -3163,7 +3171,7 @@ async function startServer(opts) {
|
|
|
3163
3171
|
case "document.read": {
|
|
3164
3172
|
const session = msg.sessionId ? store.get(msg.sessionId) : void 0;
|
|
3165
3173
|
if (msg.sessionId && !session) return send(ws, { type: "document.error", requestId: msg.requestId, path: msg.path, code: "session_missing" });
|
|
3166
|
-
return send(ws, await readDocument(msg, { cwd: session?.cwd, home: opts.home ?? process.env.HOME ?? "" }));
|
|
3174
|
+
return send(ws, await readDocument(msg, { cwd: session?.cwd, workdir: session?.workdir, home: opts.home ?? process.env.HOME ?? "" }));
|
|
3167
3175
|
}
|
|
3168
3176
|
case "repos.inspect":
|
|
3169
3177
|
return send(ws, { type: "repos.info", requestId: msg.requestId, repos: await inspectRepos(msg.paths, { home: opts.home }) });
|
|
@@ -3282,6 +3290,7 @@ async function startServer(opts) {
|
|
|
3282
3290
|
store.upsert(base);
|
|
3283
3291
|
store.apply(msg.id, msg.event);
|
|
3284
3292
|
} else {
|
|
3293
|
+
if (msg.cwd) store.patch(msg.id, { workdir: msg.cwd });
|
|
3285
3294
|
settleByHook(msg.id, ev);
|
|
3286
3295
|
store.apply(msg.id, msg.event);
|
|
3287
3296
|
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
QUESTION_TOOLS,
|
|
3
3
|
gitInfo
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-OHKQKXYM.js";
|
|
5
5
|
import {
|
|
6
6
|
CODEX_ENV_VAR,
|
|
7
7
|
CODEX_HOOK_VAR,
|
|
8
8
|
codexPlan
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-GMKS55KF.js";
|
|
10
10
|
import {
|
|
11
11
|
log
|
|
12
12
|
} from "./chunk-YUSY3E47.js";
|
|
13
13
|
import {
|
|
14
14
|
connect
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import "./chunk-
|
|
15
|
+
} from "./chunk-TC3XJUJA.js";
|
|
16
|
+
import "./chunk-JOCNCNRP.js";
|
|
17
17
|
import "./chunk-FGOFRWIB.js";
|
|
18
18
|
|
|
19
19
|
// src/cli/hook.ts
|
package/dist/cli/index.js
CHANGED
|
@@ -17,7 +17,7 @@ async function hookMain(args) {
|
|
|
17
17
|
try {
|
|
18
18
|
const chunks = [];
|
|
19
19
|
for await (const c of process.stdin) chunks.push(c);
|
|
20
|
-
const { runHook } = await import("./hook-
|
|
20
|
+
const { runHook } = await import("./hook-W46IWB7I.js");
|
|
21
21
|
const out = await runHook(event, Buffer.concat(chunks).toString("utf8"), { tool });
|
|
22
22
|
if (out) process.stdout.write(`${out}
|
|
23
23
|
`);
|
|
@@ -29,7 +29,7 @@ async function main(argv) {
|
|
|
29
29
|
const [cmd, ...rest] = argv;
|
|
30
30
|
switch (cmd) {
|
|
31
31
|
case "daemon": {
|
|
32
|
-
const { startDaemon } = await import("./daemon-
|
|
32
|
+
const { startDaemon } = await import("./daemon-RI47DJDX.js");
|
|
33
33
|
await startDaemon();
|
|
34
34
|
await new Promise(() => {
|
|
35
35
|
});
|
|
@@ -37,7 +37,7 @@ async function main(argv) {
|
|
|
37
37
|
}
|
|
38
38
|
case "--version":
|
|
39
39
|
case "version": {
|
|
40
|
-
const { LEDGE_VERSION } = await import("./version-
|
|
40
|
+
const { LEDGE_VERSION } = await import("./version-SO5OMPGD.js");
|
|
41
41
|
console.log(LEDGE_VERSION);
|
|
42
42
|
return 0;
|
|
43
43
|
}
|
|
@@ -53,28 +53,28 @@ async function main(argv) {
|
|
|
53
53
|
return r.ok ? 0 : 1;
|
|
54
54
|
}
|
|
55
55
|
case "status": {
|
|
56
|
-
const { printStatus } = await import("./status-
|
|
56
|
+
const { printStatus } = await import("./status-QOXWNLLF.js");
|
|
57
57
|
console.log(await printStatus());
|
|
58
58
|
return 0;
|
|
59
59
|
}
|
|
60
60
|
case "who": {
|
|
61
|
-
const { printWho } = await import("./who-
|
|
61
|
+
const { printWho } = await import("./who-WVYFPCII.js");
|
|
62
62
|
console.log(await printWho());
|
|
63
63
|
return 0;
|
|
64
64
|
}
|
|
65
65
|
case "bridge": {
|
|
66
|
-
const { bridge } = await import("./bridge-
|
|
66
|
+
const { bridge } = await import("./bridge-ZOHP53DV.js");
|
|
67
67
|
await bridge();
|
|
68
68
|
return 0;
|
|
69
69
|
}
|
|
70
70
|
case "claude":
|
|
71
71
|
case "codex":
|
|
72
72
|
case "cursor": {
|
|
73
|
-
const { launch } = await import("./launch-
|
|
73
|
+
const { launch } = await import("./launch-S6XFRSZA.js");
|
|
74
74
|
return launch(cmd, rest);
|
|
75
75
|
}
|
|
76
76
|
case "attach": {
|
|
77
|
-
const { attach } = await import("./attach-
|
|
77
|
+
const { attach } = await import("./attach-2DEXQEC2.js");
|
|
78
78
|
return attach(rest[0] ?? "");
|
|
79
79
|
}
|
|
80
80
|
default:
|
|
@@ -5,15 +5,15 @@ import {
|
|
|
5
5
|
ensureDaemon,
|
|
6
6
|
launch,
|
|
7
7
|
parseLaunchArgs
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-IC5RHOX6.js";
|
|
9
9
|
import {
|
|
10
10
|
agentEnv,
|
|
11
11
|
exitFile
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-GMKS55KF.js";
|
|
13
13
|
import "./chunk-TO4XO2ML.js";
|
|
14
14
|
import "./chunk-YUSY3E47.js";
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-TC3XJUJA.js";
|
|
16
|
+
import "./chunk-JOCNCNRP.js";
|
|
17
17
|
import "./chunk-FGOFRWIB.js";
|
|
18
18
|
export {
|
|
19
19
|
DaemonError,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paradow/ledge",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "Follow and answer your WSL agent sessions (Claude Code, Codex, Cursor Agent) from the Ledge island on Windows.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": { "ledge": "dist/cli/index.js" },
|