lody 0.58.0-next.66 → 0.58.0-next.68

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.
@@ -80,7 +80,7 @@ let __tla = Promise.all([
80
80
  }
81
81
  })()
82
82
  ]).then(async () => {
83
- const reviewViewerVersion = "0.58.0-next.66";
83
+ const reviewViewerVersion = "0.58.0-next.68";
84
84
  const reviewViewerSha256 = "dc9c7fc1dde49bb39c5fe86392d69219b469c0cab4fd492d8b562045e7f676e4";
85
85
  const reviewViewerFileName = "standalone.html";
86
86
  const DEFAULT_CDN_BASES = [
package/dist/index.js CHANGED
@@ -4325,7 +4325,7 @@ Upgrade Node, then re-run: npx lody@latest`;
4325
4325
  }
4326
4326
  const name$2 = "lody";
4327
4327
  const name$1 = "@lody/cli-cloud";
4328
- const version$9 = "0.58.0-next.66";
4328
+ const version$9 = "0.58.0-next.68";
4329
4329
  const type$2 = "module";
4330
4330
  const scripts = {
4331
4331
  "dev": "node dev.mjs",
@@ -222226,7 +222226,7 @@ ${page}${helpTipBottom}${choiceDescription}${ansiEscapes.cursorHide}`;
222226
222226
  data = createReviewBundleSnapshot(bundle);
222227
222227
  }
222228
222228
  const { injectReviewSnapshot } = await import("./chunks/index-VoI6Ds2-.js");
222229
- const { resolveReviewViewerTemplate } = await import("./chunks/review-viewer-DvxMXqWe.js").then(async (m) => {
222229
+ const { resolveReviewViewerTemplate } = await import("./chunks/review-viewer-dRUc6p9z.js").then(async (m) => {
222230
222230
  await m.__tla;
222231
222231
  return m;
222232
222232
  });
@@ -240755,6 +240755,8 @@ ${result.stdout ?? ""}`;
240755
240755
  const SESSION_CREATE_MANY_TOOL_NAME = "lody_session_create_many";
240756
240756
  const SESSION_CHAT_MANY_TOOL_NAME = "lody_session_chat_many";
240757
240757
  const SESSION_ARCHIVE_TOOL_NAME = "lody_session_archive";
240758
+ const SESSION_RENAME_TOOL_NAME = "lody_session_rename";
240759
+ const SESSION_RENAME_MANY_TOOL_NAME = "lody_session_rename_many";
240758
240760
  const OPERATION_GET_TOOL_NAME = "lody_operation_get";
240759
240761
  const OPERATION_CANCEL_TOOL_NAME = "lody_operation_cancel";
240760
240762
  const TASK_LIST_TOOL_NAME = "lody_task_list";
@@ -240779,6 +240781,7 @@ ${result.stdout ?? ""}`;
240779
240781
  const DEFAULT_MCP_SESSION_HISTORY_LIMIT = 10;
240780
240782
  const MAX_MCP_SESSION_HISTORY_LIMIT = 50;
240781
240783
  const MAX_MCP_SESSION_HISTORY_BYTES = 128 * 1024;
240784
+ const MAX_MCP_SESSION_TITLE_CHARS = 200;
240782
240785
  const MAX_MCP_TASK_BODY_BYTES = 64 * 1024;
240783
240786
  const MAX_MCP_TASK_LINKS = 50;
240784
240787
  const MAX_MCP_TASK_EDIT_CHARS = 64e3;
@@ -240909,7 +240912,7 @@ ${result.stdout ?? ""}`;
240909
240912
  resume: boolean().optional().describe("Set to true to resume an accepted Operation without resending its input."),
240910
240913
  wait: literal$1(true).optional().describe("Wait for the assistant reply using the temporary legacy adapter."),
240911
240914
  timeoutSeconds: number$4().int().positive().max(MAX_MCP_SESSION_WAIT_TIMEOUT_SECONDS).optional().describe("Legacy wait timeout in seconds, up to one hour."),
240912
- useCurrentSessionAsParent: boolean().optional().describe("Create a child of the current Session; cannot be combined with workContext."),
240915
+ useCurrentSessionAsParent: boolean().optional().describe("Create a child of the current Session that reuses the exact same workspace directory; cannot be combined with workContext."),
240913
240916
  workContext: SessionWorkContextInputSchema.optional().describe("Execution context for an independent Session; cannot be combined with useCurrentSessionAsParent=true.")
240914
240917
  }).strict().superRefine((value, ctx) => {
240915
240918
  const result = SessionCreateRuntimeInputSchema.safeParse(value);
@@ -241031,7 +241034,7 @@ ${result.stdout ?? ""}`;
241031
241034
  ]);
241032
241035
  const SessionCreateBatchPublishedItemSchema = object$1({
241033
241036
  ...SessionCreateBatchItemShape,
241034
- useCurrentSessionAsParent: boolean().optional().describe("Create a child of the current Session; cannot be combined with workContext."),
241037
+ useCurrentSessionAsParent: boolean().optional().describe("Create a child of the current Session that reuses the exact same workspace directory; cannot be combined with workContext."),
241035
241038
  workContext: SessionWorkContextInputSchema.optional().describe("Execution context for an independent Session; cannot be combined with useCurrentSessionAsParent=true.")
241036
241039
  }).strict();
241037
241040
  const SessionCreateManyToolInputSchema = object$1({
@@ -241063,6 +241066,18 @@ ${result.stdout ?? ""}`;
241063
241066
  const SessionArchiveToolInputSchema = object$1({
241064
241067
  sessionId: string$1().trim().min(1)
241065
241068
  }).strict();
241069
+ const SessionTitleToolInputSchema = string$1().trim().min(1).max(MAX_MCP_SESSION_TITLE_CHARS).describe(`New session title, up to ${MAX_MCP_SESSION_TITLE_CHARS} characters.`);
241070
+ const SessionRenameToolInputSchema = object$1({
241071
+ sessionId: string$1().trim().min(1).optional().describe("Target session id, or current. Defaults to current."),
241072
+ title: SessionTitleToolInputSchema
241073
+ }).strict();
241074
+ const SessionRenameManyItemSchema = object$1({
241075
+ sessionId: string$1().trim().min(1).describe("Target session id, or current."),
241076
+ title: SessionTitleToolInputSchema
241077
+ }).strict();
241078
+ const SessionRenameManyToolInputSchema = object$1({
241079
+ items: array$2(SessionRenameManyItemSchema).min(1).max(MAX_MCP_COMMAND_BATCH_SIZE).refine((items2) => new Set(items2.map((item) => item.sessionId)).size === items2.length, "sessionId values must be unique")
241080
+ }).strict();
241066
241081
  const SessionStatusManyToolInputSchema = object$1({
241067
241082
  sessionIds: array$2(string$1().trim().min(1)).max(1e3).refine((items2) => new Set(items2).size === items2.length, "sessionIds must be unique")
241068
241083
  }).strict();
@@ -241177,30 +241192,22 @@ ${result.stdout ?? ""}`;
241177
241192
  } : {}
241178
241193
  });
241179
241194
  const jsonTextResult = (value, isError2 = false) => textResult(JSON.stringify(value, null, 2), isError2);
241180
- const mcpErrorResult = (error2) => {
241195
+ const normalizeMcpError = (error2) => {
241181
241196
  if (error2 instanceof LodyOperationStoreError) {
241182
- return jsonTextResult({
241183
- ok: false,
241184
- error: error2.toLodyError()
241185
- }, true);
241197
+ return error2.toLodyError();
241186
241198
  }
241187
241199
  if (error2 instanceof LocalDaemonAvailabilityError) {
241188
- return jsonTextResult({
241189
- ok: false,
241190
- error: error2.toLodyError()
241191
- }, true);
241200
+ return error2.toLodyError();
241192
241201
  }
241193
241202
  if (error2 instanceof WorkspaceSyncUnavailableError) {
241194
- return jsonTextResult({
241195
- ok: false,
241196
- error: error2.toLodyError()
241197
- }, true);
241203
+ return error2.toLodyError();
241198
241204
  }
241199
- return jsonTextResult({
241200
- ok: false,
241201
- error: makeLodyError("INTERNAL_ERROR", formatMcpErrorMessage(error2), false)
241202
- }, true);
241205
+ return makeLodyError("INTERNAL_ERROR", formatMcpErrorMessage(error2), false);
241203
241206
  };
241207
+ const mcpErrorResult = (error2) => jsonTextResult({
241208
+ ok: false,
241209
+ error: normalizeMcpError(error2)
241210
+ }, true);
241204
241211
  const postSessionControl = async (request2, localControlSocketPath, timeoutMs = SESSION_CONTROL_TIMEOUT_MS) => {
241205
241212
  const responses = await runPromise(makeLocalControlClientAuto({
241206
241213
  socketPath: localControlSocketPath
@@ -242534,6 +242541,60 @@ ${prompt2}` : prompt2;
242534
242541
  }, worker));
242535
242542
  return output;
242536
242543
  };
242544
+ const resolveSessionRenameItems = (items2, ctx) => {
242545
+ assertBatchSize(items2.length, MAX_MCP_COMMAND_BATCH_SIZE);
242546
+ const resolved = items2.map((item) => ({
242547
+ sessionId: resolveMcpSessionId(item.sessionId, ctx),
242548
+ title: item.title
242549
+ }));
242550
+ if (new Set(resolved.map((item) => item.sessionId)).size !== resolved.length) {
242551
+ throw new LodyOperationStoreError("DUPLICATE_SESSION", "A session may appear only once in a rename batch.", false);
242552
+ }
242553
+ return resolved;
242554
+ };
242555
+ const applySessionRenameItems = async (items2, rename2) => await mapWithConcurrency(items2, 5, async (item) => {
242556
+ try {
242557
+ await rename2(item);
242558
+ return {
242559
+ sessionId: item.sessionId,
242560
+ ok: true,
242561
+ title: item.title
242562
+ };
242563
+ } catch (error2) {
242564
+ return {
242565
+ sessionId: item.sessionId,
242566
+ ok: false,
242567
+ error: normalizeMcpError(error2)
242568
+ };
242569
+ }
242570
+ });
242571
+ const persistSessionRenameItems = async (manager, items2, syncReason) => {
242572
+ const results = await applySessionRenameItems(items2, async (item) => {
242573
+ const session2 = await readCurrentSessionMeta(manager, item.sessionId);
242574
+ if (!session2) {
242575
+ throw new LodyOperationStoreError("SESSION_NOT_FOUND", `Session not found: ${item.sessionId}`, false);
242576
+ }
242577
+ await manager.repo.upsertDocMeta(getSessionRoomId(item.sessionId), {
242578
+ title: item.title,
242579
+ titleSource: "user"
242580
+ });
242581
+ });
242582
+ if (results.some((item) => item.ok)) {
242583
+ await ensureWorkspaceMetaSynced(manager, syncReason);
242584
+ }
242585
+ return results;
242586
+ };
242587
+ const renameSessionItems = async (input2) => {
242588
+ const ctx = getSessionContext();
242589
+ const resolved = resolveSessionRenameItems(input2.items, ctx);
242590
+ const auth = getAuthContextOrThrow$1("mcp");
242591
+ const workspace = await resolveWorkspaceOrThrow$1(auth, getMcpWorkspaceId(ctx));
242592
+ return await withWorkspaceManager$1(auth, workspace, "mcp", async (manager) => {
242593
+ const reason = `mcp.session_rename_many:${ctx.sessionId}`;
242594
+ await syncWorkspaceMetaForRead(manager, reason);
242595
+ return await persistSessionRenameItems(manager, resolved, reason);
242596
+ });
242597
+ };
242537
242598
  const buildOperationTargetCancelArgs = (workspaceId, item) => [
242538
242599
  "session",
242539
242600
  "cancel",
@@ -243514,6 +243575,41 @@ ${lines2.join("\n")}` : ""}${suffix}`);
243514
243575
  return mcpErrorResult(error2);
243515
243576
  }
243516
243577
  });
243578
+ server.registerTool(SESSION_RENAME_TOOL_NAME, {
243579
+ title: "Rename a Lody session",
243580
+ description: "Set the title of one Session. Omit sessionId (or pass current) to rename the current Session. The durable rename is treated as a user-directed title and is not replaced by later automatic title generation.",
243581
+ inputSchema: SessionRenameToolInputSchema
243582
+ }, async (args2) => {
243583
+ try {
243584
+ const [item] = await renameSessionItems({
243585
+ items: [
243586
+ {
243587
+ sessionId: args2.sessionId ?? "current",
243588
+ title: args2.title
243589
+ }
243590
+ ]
243591
+ });
243592
+ if (!item) {
243593
+ throw new Error("Session rename returned no result.");
243594
+ }
243595
+ return jsonTextResult(item, item.ok === false);
243596
+ } catch (error2) {
243597
+ return mcpErrorResult(error2);
243598
+ }
243599
+ });
243600
+ server.registerTool(SESSION_RENAME_MANY_TOOL_NAME, {
243601
+ title: "Rename multiple Lody sessions",
243602
+ description: "Set titles for 1-20 Sessions. Session ids must be unique. Results preserve input order and failures are isolated per item; successful renames remain applied when another item fails.",
243603
+ inputSchema: SessionRenameManyToolInputSchema
243604
+ }, async (args2) => {
243605
+ try {
243606
+ return jsonTextResult({
243607
+ items: await renameSessionItems(args2)
243608
+ });
243609
+ } catch (error2) {
243610
+ return mcpErrorResult(error2);
243611
+ }
243612
+ });
243517
243613
  server.registerTool(SESSION_ARCHIVE_TOOL_NAME, {
243518
243614
  title: "Archive a Lody session",
243519
243615
  description: "Idempotently archive a Session. Archiving a parent cascades to child Sessions; pending Operation Deliveries remain pending until a human restores the Session.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lody",
3
- "version": "0.58.0-next.66",
3
+ "version": "0.58.0-next.68",
4
4
  "description": "Lody Agent CLI tool for managing remote command execution",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",