@paradow/ledge 0.27.0 → 0.28.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/{action-7SJJTIEA.js → action-NQRSZEC5.js} +4 -4
- package/dist/cli/{attach-V7UPHVB2.js → attach-KXOSFUHO.js} +8 -8
- package/dist/cli/{bridge-JK3PMG7T.js → bridge-XCTXVWKH.js} +1 -1
- package/dist/cli/{chunk-RA3OIXEQ.js → chunk-3CF4FQWG.js} +2 -2
- package/dist/cli/{chunk-7OGFH6KJ.js → chunk-3NQNWGDX.js} +2 -2
- package/dist/cli/{chunk-TOSPL5H2.js → chunk-CIQAFCX3.js} +3 -3
- package/dist/cli/{chunk-IGAGJVRZ.js → chunk-CR3LGTZQ.js} +3 -3
- package/dist/cli/{chunk-UPKJO3BZ.js → chunk-JHFKBKSO.js} +1 -1
- package/dist/cli/{chunk-2N7PSP7C.js → chunk-JLUHY5AB.js} +3 -3
- package/dist/cli/{chunk-ADAGKOFO.js → chunk-LG3XFIPV.js} +1 -1
- package/dist/cli/{chunk-CVHX7GUB.js → chunk-OYDTU6AP.js} +302 -46
- package/dist/cli/{chunk-YLN3VOGV.js → chunk-QSRB3F5Y.js} +2 -2
- package/dist/cli/{chunk-ISNHG5SJ.js → chunk-RYZ6FHYT.js} +5 -5
- package/dist/cli/chunk-UME2F7VM.js +6 -0
- package/dist/cli/{chunk-37G5F75H.js → chunk-VKRFHDRK.js} +124 -9
- package/dist/cli/{chunk-7GIUG73R.js → chunk-VMGACWNP.js} +1 -1
- package/dist/cli/{chunk-7JRQCKBP.js → chunk-ZI47U5CQ.js} +2 -2
- package/dist/cli/{daemon-YUPB5NUG.js → daemon-ZUHJKLSL.js} +7 -7
- package/dist/cli/{decide-HFI2WQXI.js → decide-OSSTI3FE.js} +3 -3
- package/dist/cli/{handover-GKORMXZ2.js → handover-2G7OEWIG.js} +4 -4
- package/dist/cli/{hook-TJJEFV54.js → hook-XY4E5H7O.js} +9 -9
- package/dist/cli/index.js +16 -16
- package/dist/cli/{launch-QKQZZSIM.js → launch-7WOARLZM.js} +8 -8
- package/dist/cli/{send-RI7JOO5K.js → send-RUHGKLMA.js} +4 -4
- package/dist/cli/{status-RQRS26S2.js → status-4Z2VJFID.js} +2 -2
- package/dist/cli/{task-U2XHBUKW.js → task-2GESYTOL.js} +4 -4
- package/dist/cli/{team-NFC4XEIA.js → team-MTSKNMAE.js} +6 -6
- package/dist/cli/{tui-UWR7SDYF.js → tui-4IRYQXYU.js} +8 -8
- package/dist/cli/{version-YYNMMWKJ.js → version-L2Y7MRH6.js} +1 -1
- package/dist/cli/{who-WW6IL4KD.js → who-PSKHASMK.js} +3 -3
- package/package.json +1 -1
- package/dist/cli/chunk-HMTOPOJG.js +0 -6
|
@@ -6,11 +6,11 @@ import {
|
|
|
6
6
|
quoteScalar,
|
|
7
7
|
readSmall,
|
|
8
8
|
scalarValue
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-JHFKBKSO.js";
|
|
10
10
|
import {
|
|
11
11
|
SeatsSchema,
|
|
12
12
|
TeamNameSchema
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-VKRFHDRK.js";
|
|
14
14
|
import {
|
|
15
15
|
log
|
|
16
16
|
} from "./chunk-6IYPRUQG.js";
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
EFFORT_ARGS,
|
|
3
3
|
MODEL_ARGS
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-OYDTU6AP.js";
|
|
5
5
|
import {
|
|
6
6
|
findRole
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-JHFKBKSO.js";
|
|
8
8
|
import {
|
|
9
9
|
exitFile,
|
|
10
10
|
spawnSession
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-LG3XFIPV.js";
|
|
12
12
|
import {
|
|
13
13
|
DaemonRefusedError,
|
|
14
14
|
connect
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-VMGACWNP.js";
|
|
16
16
|
import {
|
|
17
17
|
PROTOCOL_PORT,
|
|
18
18
|
autonomyArgs
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-VKRFHDRK.js";
|
|
20
20
|
import {
|
|
21
21
|
realTmux
|
|
22
22
|
} from "./chunk-NLL2EQJ2.js";
|
|
@@ -203,6 +203,8 @@ var ModelsListingSchema = z3.object({
|
|
|
203
203
|
models: z3.array(ModelChoiceSchema),
|
|
204
204
|
error: z3.string().optional()
|
|
205
205
|
});
|
|
206
|
+
var ModelRefusalSchema = z3.enum(["not_launched", "ended", "no_conversation", "not_running", "effort_in_model", "restart_failed", "refused"]);
|
|
207
|
+
var SessionModelAcceptedSchema = z3.object({ type: z3.literal("session.model.accepted"), id: z3.string(), when: z3.enum(["now", "turn", "none"]) });
|
|
206
208
|
|
|
207
209
|
// ../protocol/src/projects.ts
|
|
208
210
|
import { z as z6 } from "zod";
|
|
@@ -412,7 +414,8 @@ var DefinitionsListingSchema = z7.object({
|
|
|
412
414
|
}))
|
|
413
415
|
});
|
|
414
416
|
var DefinitionResultSchema = z7.object({ type: z7.literal("definition.result"), rid: z7.string(), id: z7.string().optional(), hash: DefinitionHashSchema.optional(), code: DefinitionCodeSchema.optional(), reason: z7.string().optional() });
|
|
415
|
-
var
|
|
417
|
+
var SeatModelOutcomeSchema = z7.object({ role: z7.string(), session: z7.string(), when: z7.enum(["now", "turn"]).optional(), code: ModelRefusalSchema.optional() });
|
|
418
|
+
var TeamChangedSchema = z7.object({ type: z7.literal("team.changed"), rid: z7.string(), team: TeamSchema.optional(), reason: z7.string().optional(), models: z7.array(SeatModelOutcomeSchema).max(16).optional() });
|
|
416
419
|
var TeamsMessageSchema = z7.object({ type: z7.literal("teams"), teams: z7.array(TeamSchema) });
|
|
417
420
|
var TeamUpdatedSchema = z7.object({ type: z7.literal("team.updated"), team: TeamSchema });
|
|
418
421
|
var TeamLaunchedSchema = z7.object({ type: z7.literal("team.launched"), rid: z7.string(), team: TeamSchema });
|
|
@@ -514,12 +517,12 @@ var TaskBlockSchema = z9.object({
|
|
|
514
517
|
var BLOCK = /```ledge-(session|relay|project|close|team|task|action)[ \t]*\n?([\s\S]*?)(?:```|$)/g;
|
|
515
518
|
function extractProposal(answer) {
|
|
516
519
|
const found = [];
|
|
517
|
-
const
|
|
520
|
+
const text2 = answer.replace(BLOCK, (_m, kind, body) => {
|
|
518
521
|
found.push({ kind, raw: body.trim() });
|
|
519
522
|
return "";
|
|
520
523
|
});
|
|
521
524
|
const last = found.at(-1);
|
|
522
|
-
return last ? { text:
|
|
525
|
+
return last ? { text: text2.replace(/\n{3,}/g, "\n\n").trim(), kind: last.kind, raw: last.raw, blocks: found } : { text: answer, kind: null, raw: null, blocks: [] };
|
|
523
526
|
}
|
|
524
527
|
function parseRelayBlock(raw) {
|
|
525
528
|
try {
|
|
@@ -1343,6 +1346,7 @@ var DaemonInfoSchema = z21.object({
|
|
|
1343
1346
|
});
|
|
1344
1347
|
var UpdateFailureSchema = z21.enum(["git-install", "no-systemd", "sessions-at-risk", "npm-failed", "busy"]);
|
|
1345
1348
|
var ServerMessageSchema = z21.discriminatedUnion("type", [
|
|
1349
|
+
SessionModelAcceptedSchema,
|
|
1346
1350
|
z21.object({ type: z21.literal("chat.routed"), qid: z21.string(), result: RouteResultSchema }),
|
|
1347
1351
|
DocumentContentSchema,
|
|
1348
1352
|
DocumentErrorSchema,
|
|
@@ -1717,8 +1721,8 @@ function pickName(taken, preferred) {
|
|
|
1717
1721
|
|
|
1718
1722
|
// ../protocol/src/topic.ts
|
|
1719
1723
|
var TOPIC_MAX = 80;
|
|
1720
|
-
function cleanTopic(
|
|
1721
|
-
const line =
|
|
1724
|
+
function cleanTopic(text2) {
|
|
1725
|
+
const line = text2.split(/\r?\n/).map((l) => l.trim()).find((l) => l.length > 0) ?? "";
|
|
1722
1726
|
const flat = line.replace(/\s+/g, " ");
|
|
1723
1727
|
return flat.length > TOPIC_MAX ? `${flat.slice(0, TOPIC_MAX - 1).trimEnd()}\u2026` : flat;
|
|
1724
1728
|
}
|
|
@@ -1903,13 +1907,28 @@ var THREAD_ITEMS_MAX = 200;
|
|
|
1903
1907
|
var THREAD_BUDGET = 524288;
|
|
1904
1908
|
var THREAD_TEXT_MAX = 8192;
|
|
1905
1909
|
var TOOL_TEXT_MAX = 2048;
|
|
1910
|
+
var CHECKLIST_TASKS_MAX = 50;
|
|
1911
|
+
var CHECKLIST_TEXT_MAX = 200;
|
|
1912
|
+
var ChecklistStatusSchema = z26.enum(["pending", "in_progress", "completed"]);
|
|
1913
|
+
var PhoneChecklistSchema = z26.object({
|
|
1914
|
+
tasks: z26.array(z26.object({ text: z26.string().max(CHECKLIST_TEXT_MAX), status: ChecklistStatusSchema })).max(CHECKLIST_TASKS_MAX),
|
|
1915
|
+
done: z26.number().int().nonnegative(),
|
|
1916
|
+
total: z26.number().int().nonnegative(),
|
|
1917
|
+
cut: z26.literal(true).optional()
|
|
1918
|
+
});
|
|
1919
|
+
var PhoneChecklistSummarySchema = z26.object({
|
|
1920
|
+
done: z26.number().int().nonnegative(),
|
|
1921
|
+
total: z26.number().int().nonnegative(),
|
|
1922
|
+
current: z26.string().max(CHECKLIST_TEXT_MAX).optional(),
|
|
1923
|
+
cut: z26.literal(true).optional()
|
|
1924
|
+
});
|
|
1906
1925
|
var PENDING_BODY_MAX = 65536;
|
|
1907
1926
|
var SNAPSHOT_BODY_MAX = 2048;
|
|
1908
1927
|
var RiskSchema = z26.enum(["low", "high"]);
|
|
1909
1928
|
var RiskReasonSchema = z26.enum(["question", "read_only_command", "edit_inside_folder", "pushes", "destroys", "deploys", "publishes", "pipes_to_shell", "network", "writes_outside_folder", "sensitive_path", "unsafe_flag", "shell_syntax", "script", "plan", "unknown"]);
|
|
1910
1929
|
var OperationIdSchema = z26.string().uuid();
|
|
1911
1930
|
var OperationStatusSchema = z26.enum(["received", "applied", "rejected", "failed"]);
|
|
1912
|
-
var OperationReasonSchema = z26.enum([...RefusalCodeSchema.options, "untypable", "confirm_required", "conflict", "assertion_invalid", "assertion_expired", "changed", "exists", "unknown_project", "seat_failed"]);
|
|
1931
|
+
var OperationReasonSchema = z26.enum([...RefusalCodeSchema.options, "untypable", "confirm_required", "conflict", "assertion_invalid", "assertion_expired", "changed", "exists", "unknown_project", "seat_failed", "scheduled", ...ModelRefusalSchema.options]);
|
|
1913
1932
|
var CapabilitiesSchema = z26.object({
|
|
1914
1933
|
/** A question can be answered in free text. */
|
|
1915
1934
|
freeTextAnswer: z26.boolean(),
|
|
@@ -1921,7 +1940,8 @@ var CapabilitiesSchema = z26.object({
|
|
|
1921
1940
|
var UNTYPABLE = /[\u0000-\u001f\u007f-\u009f\u200b\u200e\u200f\u2028-\u202e\u2066-\u2069\ufeff]/;
|
|
1922
1941
|
var CapabilitiesByToolSchema = z26.object({ claude: CapabilitiesSchema, codex: CapabilitiesSchema, cursor: CapabilitiesSchema, omp: CapabilitiesSchema });
|
|
1923
1942
|
var PhonePendingSchema = PendingSchema.extend({ key: z26.string().max(64), risk: RiskSchema, riskReason: RiskReasonSchema, cut: z26.literal(true).optional() });
|
|
1924
|
-
var
|
|
1943
|
+
var SwitchableSessionSchema = SessionSchema.extend({ canSwitch: z26.literal(true).optional() });
|
|
1944
|
+
var PhoneSessionSchema = SwitchableSessionSchema.pick({
|
|
1925
1945
|
id: true,
|
|
1926
1946
|
name: true,
|
|
1927
1947
|
tool: true,
|
|
@@ -1936,6 +1956,11 @@ var PhoneSessionSchema = SessionSchema.pick({
|
|
|
1936
1956
|
lastReply: true,
|
|
1937
1957
|
startedAt: true,
|
|
1938
1958
|
lastActivityAt: true,
|
|
1959
|
+
/** Its model, effort and the change waiting for its next free moment: the phone shows them and offers to change them. */
|
|
1960
|
+
model: true,
|
|
1961
|
+
effort: true,
|
|
1962
|
+
modelNext: true,
|
|
1963
|
+
canSwitch: true,
|
|
1939
1964
|
/** Its role and its live team (ledge home spec §2.4): the agents screen groups a project's sessions by table. */
|
|
1940
1965
|
role: true,
|
|
1941
1966
|
roleLabel: true,
|
|
@@ -1943,7 +1968,13 @@ var PhoneSessionSchema = SessionSchema.pick({
|
|
|
1943
1968
|
/** Its context and its relief (context handover spec §3.2): the phone shows the gauge; the relief is started from the PC. */
|
|
1944
1969
|
context: true,
|
|
1945
1970
|
relieves: true
|
|
1946
|
-
}).extend({
|
|
1971
|
+
}).extend({
|
|
1972
|
+
pending: PhonePendingSchema.optional(),
|
|
1973
|
+
unread: z26.boolean(),
|
|
1974
|
+
handover: z26.object({ state: HandoverStateSchema, toName: z26.string().max(80).optional() }).strict().optional(),
|
|
1975
|
+
/** Absent: the agent has no checklist. */
|
|
1976
|
+
checklist: PhoneChecklistSummarySchema.optional()
|
|
1977
|
+
});
|
|
1947
1978
|
var B64U2 = z26.string().regex(/^[A-Za-z0-9_-]*$/);
|
|
1948
1979
|
var CredentialSchema = z26.object({
|
|
1949
1980
|
id: B64U2.max(1366),
|
|
@@ -2134,6 +2165,10 @@ var PhoneClientMessageSchema = z26.discriminatedUnion("type", [
|
|
|
2134
2165
|
expect: PhoneExpectSchema
|
|
2135
2166
|
}),
|
|
2136
2167
|
z26.object({ type: z26.literal("session.interrupt"), op: OperationIdSchema, id: sessionId }),
|
|
2168
|
+
/** Changes a live session's model and effort, `null` for the agent's own default; answered by `operation.result` and, when refused, `session.model.failed`. */
|
|
2169
|
+
z26.object({ type: z26.literal("session.model"), op: OperationIdSchema, id: sessionId, model: ModelIdSchema.nullable(), effort: EffortSchema.nullable() }),
|
|
2170
|
+
/** The models an agent offers on the PC. */
|
|
2171
|
+
z26.object({ type: z26.literal("models.list"), tool: ToolSchema }),
|
|
2137
2172
|
/** The phone drops its passkey from the daemon. */
|
|
2138
2173
|
z26.object({ type: z26.literal("device.forget"), op: OperationIdSchema }),
|
|
2139
2174
|
/** The phone's push subscription, with the VAPID key it was made with (so a key change is seen). */
|
|
@@ -2195,12 +2230,25 @@ var PhoneClientMessageSchema = z26.discriminatedUnion("type", [
|
|
|
2195
2230
|
const issue = "scope" in m ? scopeIssue(m) : null;
|
|
2196
2231
|
if (issue) ctx.addIssue({ code: z26.ZodIssueCode.custom, message: issue, path: ["project"] });
|
|
2197
2232
|
});
|
|
2233
|
+
var PhoneModelChoiceSchema = z26.object({
|
|
2234
|
+
id: ModelChoiceSchema.shape.id.max(120),
|
|
2235
|
+
label: z26.string().max(80),
|
|
2236
|
+
description: z26.string().max(200).optional(),
|
|
2237
|
+
efforts: z26.array(EffortSchema).max(8).optional(),
|
|
2238
|
+
defaultEffort: EffortSchema.optional(),
|
|
2239
|
+
isDefault: z26.boolean().optional()
|
|
2240
|
+
}).strict();
|
|
2241
|
+
var PhoneSeatModelSchema = z26.object({ role: z26.string().max(40), session: sessionId, status: z26.enum(["applied", "scheduled", "refused"]), reason: ModelRefusalSchema.optional() });
|
|
2198
2242
|
var PhoneServerMessageSchema = z26.discriminatedUnion("type", [
|
|
2199
2243
|
z26.object({ type: z26.literal("snapshot"), protocol: z26.literal(PHONE_PROTOCOL), sessions: z26.array(PhoneSessionSchema), capabilities: CapabilitiesByToolSchema, daemon: z26.object({
|
|
2200
2244
|
version: z26.string(),
|
|
2201
2245
|
name: z26.string().max(40),
|
|
2202
2246
|
boot: z26.string().uuid().optional(),
|
|
2203
2247
|
teams: z26.literal(true).optional(),
|
|
2248
|
+
/** The daemon takes `session.model`. */
|
|
2249
|
+
models: z26.literal(true).optional(),
|
|
2250
|
+
/** The daemon sends `session.checklist` and a session's `checklist` summary. */
|
|
2251
|
+
checklist: z26.literal(true).optional(),
|
|
2204
2252
|
/** `update`: the daemon can install a version and restart (npm, systemd); `restart`: it can restart (systemd). */
|
|
2205
2253
|
update: z26.literal(true).optional(),
|
|
2206
2254
|
restart: z26.literal(true).optional()
|
|
@@ -2217,13 +2265,19 @@ var PhoneServerMessageSchema = z26.discriminatedUnion("type", [
|
|
|
2217
2265
|
}),
|
|
2218
2266
|
z26.object({ type: z26.literal("session.updated"), session: PhoneSessionSchema }),
|
|
2219
2267
|
z26.object({ type: z26.literal("session.removed"), id: z26.string() }),
|
|
2268
|
+
/** A session's checklist, sent to the phone that watches it; `null`: it has none (any more). */
|
|
2269
|
+
z26.object({ type: z26.literal("session.checklist"), id: z26.string(), checklist: PhoneChecklistSchema.nullable() }),
|
|
2220
2270
|
/** `pending.cut` is set when even this body was shortened. */
|
|
2221
2271
|
z26.object({ type: z26.literal("session.pending"), id: z26.string(), pending: PhonePendingSchema }),
|
|
2222
2272
|
z26.object({ type: z26.literal("session.preview"), id: z26.string(), lines: z26.array(z26.string()) }),
|
|
2223
2273
|
/** `cut`: the ids of the items shortened; `more`: older items were left out. */
|
|
2224
2274
|
z26.object({ type: z26.literal("session.thread"), id: z26.string(), items: z26.array(ThreadItemSchema), cut: z26.array(z26.string()), more: z26.boolean() }),
|
|
2225
2275
|
z26.object({ type: z26.literal("session.thread.item"), id: z26.string(), item: ThreadItemSchema, cut: z26.literal(true).optional() }),
|
|
2226
|
-
z26.object({ type: z26.literal("operation.result"), op: OperationIdSchema, status: OperationStatusSchema, reason: OperationReasonSchema.optional() }),
|
|
2276
|
+
z26.object({ type: z26.literal("operation.result"), op: OperationIdSchema, status: OperationStatusSchema, reason: OperationReasonSchema.optional(), models: z26.array(PhoneSeatModelSchema).max(16).optional() }),
|
|
2277
|
+
/** The models an agent offers; `error`: it could not be asked, `models` is then what Ledge knows without it. */
|
|
2278
|
+
z26.object({ type: z26.literal("models.listing"), tool: ToolSchema, models: z26.array(PhoneModelChoiceSchema).max(40), error: z26.literal(true).optional() }),
|
|
2279
|
+
/** A model change that was accepted and then failed (the agent could not restart). */
|
|
2280
|
+
z26.object({ type: z26.literal("session.model.failed"), id: z26.string(), reason: ModelRefusalSchema }),
|
|
2227
2281
|
z26.object({ type: z26.literal("chat.history"), turns: z26.array(PhoneChatTurnSchema).max(50) }),
|
|
2228
2282
|
z26.object({ type: z26.literal("chat.step"), qid: OperationIdSchema, step: PhoneChatStepSchema }),
|
|
2229
2283
|
/** The whole text so far, not an increment. */
|
|
@@ -2256,6 +2310,60 @@ async function teamsDigest(m) {
|
|
|
2256
2310
|
return Array.from(bytes, (b) => b.toString(16).padStart(2, "0")).join("");
|
|
2257
2311
|
}
|
|
2258
2312
|
|
|
2313
|
+
// ../protocol/src/todos.ts
|
|
2314
|
+
var TODO_TOOLS = /* @__PURE__ */ new Set(["TodoWrite", "update_plan", "todo"]);
|
|
2315
|
+
var STATUSES = /* @__PURE__ */ new Set(["pending", "in_progress", "completed"]);
|
|
2316
|
+
var statusOf = (s) => typeof s === "string" && STATUSES.has(s) ? s : "pending";
|
|
2317
|
+
var text = (s) => typeof s === "string" && s.trim() !== "" ? s : null;
|
|
2318
|
+
var record = (v) => v && typeof v === "object" ? v : {};
|
|
2319
|
+
function omp(input) {
|
|
2320
|
+
if (!Array.isArray(input.phases)) return void 0;
|
|
2321
|
+
const phases = input.phases.map(record);
|
|
2322
|
+
const out = [];
|
|
2323
|
+
for (const ph of phases) {
|
|
2324
|
+
for (const raw of Array.isArray(ph.tasks) ? ph.tasks : []) {
|
|
2325
|
+
const e = record(raw);
|
|
2326
|
+
const said = text(e.content);
|
|
2327
|
+
if (said === null) continue;
|
|
2328
|
+
const blocked = e.status === "blocked";
|
|
2329
|
+
const name = phases.length > 1 ? text(ph.name) : null;
|
|
2330
|
+
out.push({ text: `${name ? `${name} \xB7 ` : ""}${said}${blocked && text(e.blocker) ? ` (blocked: ${e.blocker})` : ""}`, status: blocked ? "pending" : statusOf(e.status) });
|
|
2331
|
+
}
|
|
2332
|
+
}
|
|
2333
|
+
return out;
|
|
2334
|
+
}
|
|
2335
|
+
function listOf(t) {
|
|
2336
|
+
if (!TODO_TOOLS.has(t.tool) || t.input === void 0) return void 0;
|
|
2337
|
+
let input;
|
|
2338
|
+
try {
|
|
2339
|
+
input = record(JSON.parse(t.input));
|
|
2340
|
+
} catch {
|
|
2341
|
+
return void 0;
|
|
2342
|
+
}
|
|
2343
|
+
if (t.tool === "todo") return omp(input);
|
|
2344
|
+
const claude = t.tool === "TodoWrite";
|
|
2345
|
+
const list = claude ? input.todos : input.plan;
|
|
2346
|
+
if (!Array.isArray(list)) return void 0;
|
|
2347
|
+
const out = [];
|
|
2348
|
+
for (const raw of list) {
|
|
2349
|
+
const e = record(raw);
|
|
2350
|
+
const status = statusOf(e.status);
|
|
2351
|
+
const said = claude ? status === "in_progress" ? text(e.activeForm) ?? text(e.content) : text(e.content) : text(e.step);
|
|
2352
|
+
if (said !== null) out.push({ text: said, status });
|
|
2353
|
+
}
|
|
2354
|
+
return out;
|
|
2355
|
+
}
|
|
2356
|
+
function latestTodos(items, helperId) {
|
|
2357
|
+
for (let i = items.length - 1; i >= 0; i--) {
|
|
2358
|
+
const it = items[i];
|
|
2359
|
+
if (it.kind !== "tool" || it.helperId !== helperId || !TODO_TOOLS.has(it.tool)) continue;
|
|
2360
|
+
const list = listOf(it);
|
|
2361
|
+
if (list) return list.length > 0 ? list : null;
|
|
2362
|
+
}
|
|
2363
|
+
return null;
|
|
2364
|
+
}
|
|
2365
|
+
var doneCount = (todos) => todos.filter((x) => x.status === "completed").length;
|
|
2366
|
+
|
|
2259
2367
|
// src/auth.ts
|
|
2260
2368
|
import { createHash, createHmac, randomBytes, timingSafeEqual } from "crypto";
|
|
2261
2369
|
import { chmod, link, mkdir, readFile, unlink, writeFile } from "fs/promises";
|
|
@@ -2400,6 +2508,7 @@ export {
|
|
|
2400
2508
|
isArchived,
|
|
2401
2509
|
ModelIdSchema,
|
|
2402
2510
|
EffortSchema,
|
|
2511
|
+
ModelRefusalSchema,
|
|
2403
2512
|
extractProposal,
|
|
2404
2513
|
parseRelayBlock,
|
|
2405
2514
|
parseCloseBlock,
|
|
@@ -2480,6 +2589,8 @@ export {
|
|
|
2480
2589
|
THREAD_BUDGET,
|
|
2481
2590
|
THREAD_TEXT_MAX,
|
|
2482
2591
|
TOOL_TEXT_MAX,
|
|
2592
|
+
CHECKLIST_TASKS_MAX,
|
|
2593
|
+
CHECKLIST_TEXT_MAX,
|
|
2483
2594
|
PENDING_BODY_MAX,
|
|
2484
2595
|
SNAPSHOT_BODY_MAX,
|
|
2485
2596
|
OperationIdSchema,
|
|
@@ -2487,8 +2598,12 @@ export {
|
|
|
2487
2598
|
CHAT_HISTORY_BUDGET,
|
|
2488
2599
|
pcSubject,
|
|
2489
2600
|
PhoneClientMessageSchema,
|
|
2601
|
+
PhoneModelChoiceSchema,
|
|
2490
2602
|
teamsPurpose,
|
|
2491
2603
|
teamsDigest,
|
|
2604
|
+
TODO_TOOLS,
|
|
2605
|
+
latestTodos,
|
|
2606
|
+
doneCount,
|
|
2492
2607
|
tokenEquals,
|
|
2493
2608
|
hostAllowed,
|
|
2494
2609
|
requestAuthorized,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ledgeTitleRest
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-LG3XFIPV.js";
|
|
4
4
|
import {
|
|
5
5
|
cleanTopic,
|
|
6
6
|
isArchived,
|
|
7
7
|
sessionTitle
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-VKRFHDRK.js";
|
|
9
9
|
|
|
10
10
|
// src/daemon/seat.ts
|
|
11
11
|
function teammates(team, sessions) {
|
|
@@ -9,9 +9,9 @@ import {
|
|
|
9
9
|
startServer,
|
|
10
10
|
tasksJournal,
|
|
11
11
|
teamsJournal
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-OYDTU6AP.js";
|
|
13
13
|
import "./chunk-OLLQBK6N.js";
|
|
14
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-QSRB3F5Y.js";
|
|
15
15
|
import {
|
|
16
16
|
QUESTION_TOOLS,
|
|
17
17
|
crossSession,
|
|
@@ -26,11 +26,11 @@ import {
|
|
|
26
26
|
readPeers,
|
|
27
27
|
reduce,
|
|
28
28
|
stripNote
|
|
29
|
-
} from "./chunk-
|
|
30
|
-
import "./chunk-
|
|
29
|
+
} from "./chunk-ZI47U5CQ.js";
|
|
30
|
+
import "./chunk-JHFKBKSO.js";
|
|
31
31
|
import {
|
|
32
32
|
agentMessages
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-LG3XFIPV.js";
|
|
34
34
|
import {
|
|
35
35
|
DEFAULT_RELAY_URL,
|
|
36
36
|
DevicePollResponseSchema,
|
|
@@ -44,10 +44,10 @@ import {
|
|
|
44
44
|
SealedFrameSchema,
|
|
45
45
|
SessionSchema,
|
|
46
46
|
backendOf
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-VKRFHDRK.js";
|
|
48
48
|
import {
|
|
49
49
|
LEDGE_VERSION
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-UME2F7VM.js";
|
|
51
51
|
import {
|
|
52
52
|
SERVICE,
|
|
53
53
|
inDaemonService,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CODEX_HOOK_VAR
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-LG3XFIPV.js";
|
|
4
4
|
import {
|
|
5
5
|
connect
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-VMGACWNP.js";
|
|
7
7
|
import {
|
|
8
8
|
LEDGE_GIVER,
|
|
9
9
|
TASK_TEXT_MAX
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-VKRFHDRK.js";
|
|
11
11
|
import "./chunk-HOOHS3MX.js";
|
|
12
12
|
import "./chunk-U67V476Y.js";
|
|
13
13
|
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
handoverArgs,
|
|
4
4
|
handoverOnClient,
|
|
5
5
|
runHandover
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-JLUHY5AB.js";
|
|
7
|
+
import "./chunk-LG3XFIPV.js";
|
|
8
|
+
import "./chunk-VMGACWNP.js";
|
|
9
|
+
import "./chunk-VKRFHDRK.js";
|
|
10
10
|
import "./chunk-HOOHS3MX.js";
|
|
11
11
|
import "./chunk-U67V476Y.js";
|
|
12
12
|
export {
|
|
@@ -8,36 +8,36 @@ import {
|
|
|
8
8
|
seatContext,
|
|
9
9
|
takeImages,
|
|
10
10
|
teammates
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-ZI47U5CQ.js";
|
|
12
12
|
import {
|
|
13
13
|
findRole
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-JHFKBKSO.js";
|
|
15
15
|
import {
|
|
16
16
|
parseLedgeCommand,
|
|
17
17
|
readOnClient,
|
|
18
18
|
sendOnClient
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-3CF4FQWG.js";
|
|
20
20
|
import {
|
|
21
21
|
taskOnClient
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-CIQAFCX3.js";
|
|
23
23
|
import {
|
|
24
24
|
handoverOnClient
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-JLUHY5AB.js";
|
|
26
26
|
import {
|
|
27
27
|
CODEX_ENV_VAR,
|
|
28
28
|
CODEX_HOOK_VAR,
|
|
29
29
|
codexPlan
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-LG3XFIPV.js";
|
|
31
31
|
import {
|
|
32
32
|
formatWho
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-3NQNWGDX.js";
|
|
34
34
|
import {
|
|
35
35
|
connect,
|
|
36
36
|
sendMessageAndAwaitAck
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-VMGACWNP.js";
|
|
38
38
|
import {
|
|
39
39
|
taskClosed
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-VKRFHDRK.js";
|
|
41
41
|
import {
|
|
42
42
|
log
|
|
43
43
|
} from "./chunk-6IYPRUQG.js";
|
package/dist/cli/index.js
CHANGED
|
@@ -25,7 +25,7 @@ async function hookMain(args) {
|
|
|
25
25
|
try {
|
|
26
26
|
const chunks = [];
|
|
27
27
|
for await (const c of process.stdin) chunks.push(c);
|
|
28
|
-
const { runHook } = await import("./hook-
|
|
28
|
+
const { runHook } = await import("./hook-XY4E5H7O.js");
|
|
29
29
|
const out = await runHook(event, Buffer.concat(chunks).toString("utf8"), { tool });
|
|
30
30
|
if (out) process.stdout.write(`${out}
|
|
31
31
|
`);
|
|
@@ -37,7 +37,7 @@ async function main(argv) {
|
|
|
37
37
|
const [cmd, ...rest] = argv;
|
|
38
38
|
switch (cmd) {
|
|
39
39
|
case "daemon": {
|
|
40
|
-
const { startDaemon } = await import("./daemon-
|
|
40
|
+
const { startDaemon } = await import("./daemon-ZUHJKLSL.js");
|
|
41
41
|
await startDaemon();
|
|
42
42
|
await new Promise(() => {
|
|
43
43
|
});
|
|
@@ -45,7 +45,7 @@ async function main(argv) {
|
|
|
45
45
|
}
|
|
46
46
|
case "--version":
|
|
47
47
|
case "version": {
|
|
48
|
-
const { LEDGE_VERSION } = await import("./version-
|
|
48
|
+
const { LEDGE_VERSION } = await import("./version-L2Y7MRH6.js");
|
|
49
49
|
console.log(LEDGE_VERSION);
|
|
50
50
|
return 0;
|
|
51
51
|
}
|
|
@@ -66,74 +66,74 @@ async function main(argv) {
|
|
|
66
66
|
return r.ok ? 0 : 1;
|
|
67
67
|
}
|
|
68
68
|
case "status": {
|
|
69
|
-
const { printStatus } = await import("./status-
|
|
69
|
+
const { printStatus } = await import("./status-4Z2VJFID.js");
|
|
70
70
|
console.log(await printStatus());
|
|
71
71
|
return 0;
|
|
72
72
|
}
|
|
73
73
|
case "who": {
|
|
74
|
-
const { printWho } = await import("./who-
|
|
74
|
+
const { printWho } = await import("./who-PSKHASMK.js");
|
|
75
75
|
console.log(await printWho());
|
|
76
76
|
return 0;
|
|
77
77
|
}
|
|
78
78
|
case "send": {
|
|
79
|
-
const { sendMessage } = await import("./send-
|
|
79
|
+
const { sendMessage } = await import("./send-RUHGKLMA.js");
|
|
80
80
|
const r = await sendMessage(rest);
|
|
81
81
|
console.log(r.line);
|
|
82
82
|
return r.code;
|
|
83
83
|
}
|
|
84
84
|
case "read": {
|
|
85
|
-
const { readMessage } = await import("./send-
|
|
85
|
+
const { readMessage } = await import("./send-RUHGKLMA.js");
|
|
86
86
|
const r = await readMessage(rest);
|
|
87
87
|
console.log(r.line);
|
|
88
88
|
return r.code;
|
|
89
89
|
}
|
|
90
90
|
case "task": {
|
|
91
|
-
const { runTask } = await import("./task-
|
|
91
|
+
const { runTask } = await import("./task-2GESYTOL.js");
|
|
92
92
|
const r = await runTask(rest);
|
|
93
93
|
console.log(r.line);
|
|
94
94
|
return r.code;
|
|
95
95
|
}
|
|
96
96
|
case "decide": {
|
|
97
|
-
const { runDecide } = await import("./decide-
|
|
97
|
+
const { runDecide } = await import("./decide-OSSTI3FE.js");
|
|
98
98
|
const r = await runDecide(rest);
|
|
99
99
|
console.log(r.line);
|
|
100
100
|
return r.code;
|
|
101
101
|
}
|
|
102
102
|
case "handover": {
|
|
103
|
-
const { runHandover } = await import("./handover-
|
|
103
|
+
const { runHandover } = await import("./handover-2G7OEWIG.js");
|
|
104
104
|
const r = await runHandover(rest);
|
|
105
105
|
console.log(r.line);
|
|
106
106
|
return r.code;
|
|
107
107
|
}
|
|
108
108
|
case "close": {
|
|
109
|
-
const { runClose } = await import("./action-
|
|
109
|
+
const { runClose } = await import("./action-NQRSZEC5.js");
|
|
110
110
|
const r = await runClose(rest);
|
|
111
111
|
console.log(r.line);
|
|
112
112
|
return r.code;
|
|
113
113
|
}
|
|
114
114
|
case "team": {
|
|
115
|
-
const { runTeam } = await import("./team-
|
|
115
|
+
const { runTeam } = await import("./team-MTSKNMAE.js");
|
|
116
116
|
const r = await runTeam(rest);
|
|
117
117
|
console.log(r.line);
|
|
118
118
|
return r.code;
|
|
119
119
|
}
|
|
120
120
|
case "tui": {
|
|
121
|
-
const { runTui } = await import("./tui-
|
|
121
|
+
const { runTui } = await import("./tui-4IRYQXYU.js");
|
|
122
122
|
return runTui(rest);
|
|
123
123
|
}
|
|
124
124
|
case "bridge": {
|
|
125
|
-
const { bridge } = await import("./bridge-
|
|
125
|
+
const { bridge } = await import("./bridge-XCTXVWKH.js");
|
|
126
126
|
await bridge();
|
|
127
127
|
return 0;
|
|
128
128
|
}
|
|
129
129
|
case "claude":
|
|
130
130
|
case "codex":
|
|
131
131
|
case "cursor": {
|
|
132
|
-
const { launch } = await import("./launch-
|
|
132
|
+
const { launch } = await import("./launch-7WOARLZM.js");
|
|
133
133
|
return launch(cmd, rest);
|
|
134
134
|
}
|
|
135
135
|
case "attach": {
|
|
136
|
-
const { attach } = await import("./attach-
|
|
136
|
+
const { attach } = await import("./attach-KXOSFUHO.js");
|
|
137
137
|
return attach(rest.find((a) => !a.startsWith("--")) ?? "", { readOnly: rest.includes("--read-only") });
|
|
138
138
|
}
|
|
139
139
|
default:
|
|
@@ -6,18 +6,18 @@ import {
|
|
|
6
6
|
launch,
|
|
7
7
|
parseLaunchArgs,
|
|
8
8
|
roleArgs
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-RYZ6FHYT.js";
|
|
10
|
+
import "./chunk-OYDTU6AP.js";
|
|
11
11
|
import "./chunk-OLLQBK6N.js";
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-QSRB3F5Y.js";
|
|
13
|
+
import "./chunk-ZI47U5CQ.js";
|
|
14
|
+
import "./chunk-JHFKBKSO.js";
|
|
15
15
|
import {
|
|
16
16
|
agentEnv,
|
|
17
17
|
exitFile
|
|
18
|
-
} from "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
18
|
+
} from "./chunk-LG3XFIPV.js";
|
|
19
|
+
import "./chunk-VMGACWNP.js";
|
|
20
|
+
import "./chunk-VKRFHDRK.js";
|
|
21
21
|
import "./chunk-NLL2EQJ2.js";
|
|
22
22
|
import "./chunk-6IYPRUQG.js";
|
|
23
23
|
import "./chunk-HOOHS3MX.js";
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
readOnClient,
|
|
5
5
|
sendMessage,
|
|
6
6
|
sendOnClient
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-3CF4FQWG.js";
|
|
8
|
+
import "./chunk-LG3XFIPV.js";
|
|
9
|
+
import "./chunk-VMGACWNP.js";
|
|
10
|
+
import "./chunk-VKRFHDRK.js";
|
|
11
11
|
import "./chunk-HOOHS3MX.js";
|
|
12
12
|
import "./chunk-U67V476Y.js";
|
|
13
13
|
export {
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
runTask,
|
|
5
5
|
taskArgs,
|
|
6
6
|
taskOnClient
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-CIQAFCX3.js";
|
|
8
|
+
import "./chunk-LG3XFIPV.js";
|
|
9
|
+
import "./chunk-VMGACWNP.js";
|
|
10
|
+
import "./chunk-VKRFHDRK.js";
|
|
11
11
|
import "./chunk-HOOHS3MX.js";
|
|
12
12
|
import "./chunk-U67V476Y.js";
|
|
13
13
|
export {
|