replicas-cli 0.3.611 → 0.3.613

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.
Files changed (2) hide show
  1. package/dist/index.cjs +19 -9
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -22879,7 +22879,7 @@ function codexTurnFromEvent(event) {
22879
22879
  const { turnId, status, error: error62 } = event.payload;
22880
22880
  return typeof turnId === "string" && typeof status === "string" ? { turnId, status, ...typeof error62 === "string" ? { error: error62 } : {} } : null;
22881
22881
  }
22882
- var MERGED_MESSAGE_SEPARATOR, engineStatusSnapshotSchema, updateChatDisplayNameRequestSchema, createChatFields, createChatRequestSchema, createHarnessChatRequestSchema, spawnSubagentRequestSchema, messageSubagentRequestSchema, waitSubagentRequestSchema, subagentResponseSchema, integrationErrorNotificationTargetSchema, sendChatMessageRequestSchema, CODEX_ITEM_FIELD_CHECKS, sendChatMessageResponseSchema, interruptChatRequestSchema, turnStoppedSchema, engineInterruptChatRequestSchema, respondToolInputRequestSchema;
22882
+ var MERGED_MESSAGE_SEPARATOR, engineStatusSnapshotSchema, updateChatDisplayNameRequestSchema, MANAGER_CHAT_CONTEXTS, createChatFields, createChatRequestSchema, createHarnessChatRequestSchema, spawnSubagentRequestSchema, messageSubagentRequestSchema, waitSubagentRequestSchema, subagentResponseSchema, integrationErrorNotificationTargetSchema, sendChatMessageRequestSchema, CODEX_ITEM_FIELD_CHECKS, sendChatMessageResponseSchema, interruptChatRequestSchema, turnStoppedSchema, engineInterruptChatRequestSchema, respondToolInputRequestSchema;
22883
22883
  var init_v1 = __esm({
22884
22884
  "../shared/src/engine/v1.ts"() {
22885
22885
  "use strict";
@@ -22906,6 +22906,7 @@ var init_v1 = __esm({
22906
22906
  updateChatDisplayNameRequestSchema = external_exports.object({
22907
22907
  displayName: external_exports.string().trim().min(1).max(100)
22908
22908
  });
22909
+ MANAGER_CHAT_CONTEXTS = ["carry_over", "fresh"];
22909
22910
  createChatFields = external_exports.object({
22910
22911
  id: external_exports.string().uuid().optional(),
22911
22912
  createdAt: external_exports.string().datetime().optional(),
@@ -22916,12 +22917,14 @@ var init_v1 = __esm({
22916
22917
  pullRequestNotesPath: external_exports.string().min(1).optional(),
22917
22918
  kind: external_exports.enum(CHAT_KINDS).optional(),
22918
22919
  sideChat: external_exports.boolean().optional(),
22919
- clientRequestId: external_exports.string().min(1).max(128).optional()
22920
+ clientRequestId: external_exports.string().min(1).max(128).optional(),
22921
+ context: external_exports.enum(MANAGER_CHAT_CONTEXTS).optional(),
22922
+ model: external_exports.string().min(1).optional()
22920
22923
  });
22921
22924
  createChatRequestSchema = createChatFields.refine((request) => !request.sideChat || request.forkSourceChatId !== void 0 && request.parentChatId === request.forkSourceChatId, {
22922
22925
  message: "A side chat must fork its parent chat"
22923
22926
  });
22924
- createHarnessChatRequestSchema = createChatFields.pick({ id: true, title: true, parentChatId: true, forkSourceChatId: true, sideChat: true }).extend({ provider: external_exports.literal(AGENT.REPLICAS) }).refine(
22927
+ createHarnessChatRequestSchema = createChatFields.pick({ id: true, title: true, parentChatId: true, forkSourceChatId: true, sideChat: true, context: true }).extend({ provider: external_exports.literal(AGENT.REPLICAS) }).refine(
22925
22928
  (request) => !request.parentChatId && !request.forkSourceChatId && !request.sideChat || request.sideChat === true && request.parentChatId !== void 0 && request.forkSourceChatId === request.parentChatId,
22926
22929
  { message: "A Replicas side chat must fork its parent chat." }
22927
22930
  );
@@ -27805,7 +27808,12 @@ var init_replicas_mcp = __esm({
27805
27808
  });
27806
27809
  chatPath = { id: external_exports.string().describe("Workspace ID"), chat_id: external_exports.string().describe("Chat ID") };
27807
27810
  ({ provider, model, thinkingLevel, title: title2, message } = forkChatRequestSchema.shape);
27808
- createChatToolInputSchema = external_exports.object({ id: chatPath.id, provider, title: createChatRequestSchema.shape.title });
27811
+ createChatToolInputSchema = external_exports.object({
27812
+ id: chatPath.id,
27813
+ provider,
27814
+ title: createChatRequestSchema.shape.title,
27815
+ context: createChatRequestSchema.shape.context.describe("Managers only. A Manager has one chat, so a new chat replaces it. carry_over (default) hands the new agent what the old chat knew and tells it to take over; fresh starts empty.")
27816
+ });
27809
27817
  forkChatToolInputSchema = external_exports.object({ ...chatPath, provider, model, thinking_level: thinkingLevel, title: title2, message });
27810
27818
  renameChatToolInputSchema = external_exports.object({ ...chatPath, display_name: updateChatDisplayNameRequestSchema.shape.displayName });
27811
27819
  runCommandToolInputSchema = external_exports.object({ id: chatPath.id, ...workspaceExecRequestSchema.shape });
@@ -40275,12 +40283,14 @@ var init_keyboard_shortcuts = __esm({
40275
40283
  });
40276
40284
 
40277
40285
  // ../shared/src/manager-prompts-common.ts
40278
- var managerEventChatNote;
40286
+ var MANAGER_NOTES_PATH, MANAGER_TAKEOVER_NOTE, managerEventChatNote;
40279
40287
  var init_manager_prompts_common = __esm({
40280
40288
  "../shared/src/manager-prompts-common.ts"() {
40281
40289
  "use strict";
40282
40290
  init_replicas_mcp();
40283
40291
  init_prompts();
40292
+ MANAGER_NOTES_PATH = "~/.replicas/canvas/mothership-notes.md";
40293
+ MANAGER_TAKEOVER_NOTE = `The user started this chat to replace this Manager's previous chat, which Replicas deleted, so you are now its only chat and take over as its orchestrator. Its ships, issues, Slack threads, Linear sessions and automations report here now. Read your notes in \`${MANAGER_NOTES_PATH}\`, list your issues with \`replicas issue list\` and your live ships with \`${REPLICAS_MCP_TOOLS.listSubagents}\`. Then answer the user's message above, if there is one, or carry on whatever the previous chat left unfinished; if nothing is pending, say in a sentence or two what you know and wait.`;
40284
40294
  managerEventChatNote = (then) => `If a message the user typed in this turn is still unanswered, your final reply answers it and they see it. Otherwise they don't see text you write in this turn: if it brings something they asked for, or a blocker that needs them, send it with ${REPLICAS_MCP_TOOLS.sendToChat}; then ${then}end with a one-line note.`;
40285
40295
  }
40286
40296
  });
@@ -40760,7 +40770,7 @@ var CLI_VERSION;
40760
40770
  var init_cli_version = __esm({
40761
40771
  "../shared/src/cli-version.ts"() {
40762
40772
  "use strict";
40763
- CLI_VERSION = "0.3.611";
40773
+ CLI_VERSION = "0.3.613";
40764
40774
  }
40765
40775
  });
40766
40776
 
@@ -55943,7 +55953,7 @@ async function chatListCommand(id) {
55943
55953
  async function chatCreateCommand(id, options) {
55944
55954
  const provider2 = parseReplicaAgent(options.agent);
55945
55955
  if (!provider2) throw new Error("--agent is required");
55946
- const body2 = { provider: provider2, title: options.title };
55956
+ const body2 = { provider: provider2, title: options.title, context: options.fresh ? "fresh" : void 0 };
55947
55957
  output2(await orgAuthenticatedFetch(`/v1/replica/${id}/chats`, { method: "POST", body: body2 }), ({ chat: chat2 }) => console.log(chat2.id));
55948
55958
  }
55949
55959
  async function chatRenameCommand(id, chatId, name) {
@@ -59210,12 +59220,12 @@ var init_src2 = __esm({
59210
59220
  program.command("events <id>").description("Stream live replica events as JSON lines until interrupted").action(run(workspaceEventsCommand));
59211
59221
  chat = program.command("chat").description("Manage the chats in a replica");
59212
59222
  chat.command("list <id>").description("List chats").action(run(chatListCommand));
59213
- chat.command("create <id>").description("Create a chat and print its ID").requiredOption("-a, --agent <agent>", "Coding agent (claude, codex, cursor)").option("-t, --title <title>", "Chat title").action(run(chatCreateCommand));
59223
+ chat.command("create <id>").description("Create a chat and print its ID. A Manager has one chat: creating one deletes the Manager's current chat and carries its context over unless --fresh").requiredOption("-a, --agent <agent>", "Coding agent (claude, codex, cursor)").option("-t, --title <title>", "Chat title").option("--fresh", "Manager only: start without the deleted chat's context").action(run(chatCreateCommand));
59214
59224
  chat.command("rename <id> <chatId> <name>").description("Rename a chat").action(run(chatRenameCommand));
59215
59225
  chat.command("delete <id> <chatId>").description("Delete a chat").action(run(chatDeleteCommand));
59216
59226
  chat.command("restore <id> <chatId>").description("Restore a deleted chat").action(run(chatRestoreCommand));
59217
59227
  chat.command("interrupt <id> <chatId>").description("Stop the current agent turn").action(run(chatInterruptCommand));
59218
- chat.command("fork <id> <chatId>").description("Fork a chat into a new chat and print its ID").requiredOption("-a, --agent <agent>", "Coding agent for the fork").option("-t, --title <title>", "Title for the fork").option("-m, --message <message>", "First message to send in the fork").option("--model <model>", "Model for the fork").action(run(chatForkCommand));
59228
+ chat.command("fork <id> <chatId>").description("Fork a chat into a new chat and print its ID. On a Manager the fork replaces the Manager's chat, deleting the old one").requiredOption("-a, --agent <agent>", "Coding agent for the fork").option("-t, --title <title>", "Title for the fork").option("-m, --message <message>", "First message to send in the fork").option("--model <model>", "Model for the fork").action(run(chatForkCommand));
59219
59229
  chat.command("goal <id> <chatId>").description("Set, pause, resume, or clear the goal of a Codex chat").option("-o, --objective <objective>", "New goal objective").option("--pause", "Pause the goal").option("--resume", "Resume the goal").option("--clear", "Clear the goal").action(run(chatGoalCommand));
59220
59230
  chat.command("answer <id> <chatId> <requestId> <selectionId>").description("Answer a pending agent question or approval (IDs are listed under pending questions in replicas read)").action(run(chatAnswerCommand));
59221
59231
  chat.command("commands <id> <chatId>").description("List slash commands available in a chat").action(run(chatCommandsCommand));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-cli",
3
- "version": "0.3.611",
3
+ "version": "0.3.613",
4
4
  "description": "CLI for managing Replicas workspaces - SSH into cloud dev environments with automatic port forwarding",
5
5
  "main": "dist/index.cjs",
6
6
  "bin": {