replicas-cli 0.3.609 → 0.3.612
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/index.cjs +39 -12
- 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({
|
|
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.
|
|
40773
|
+
CLI_VERSION = "0.3.612";
|
|
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) {
|
|
@@ -58975,17 +58985,34 @@ async function localControlRequestCommand(options) {
|
|
|
58975
58985
|
method: "POST",
|
|
58976
58986
|
body: { reason: options.reason, wait: options.wait !== false }
|
|
58977
58987
|
});
|
|
58988
|
+
const connectedSince = await connectedComputers();
|
|
58989
|
+
if (connectedSince.length > 0) return connected(connectedSince);
|
|
58990
|
+
if (created2.granted) {
|
|
58991
|
+
const found = options.wait === false ? [] : await waitForUser({
|
|
58992
|
+
timeoutMs: Math.min(timeoutMs, 6e4),
|
|
58993
|
+
asked: "This workspace may already use the user's computer, so they weren't asked. Waiting for it to connect.",
|
|
58994
|
+
initial: [],
|
|
58995
|
+
settled: (current) => current.length > 0,
|
|
58996
|
+
poll: connectedComputers
|
|
58997
|
+
});
|
|
58998
|
+
if (found.length > 0) return connected(found);
|
|
58999
|
+
output2({ status: "not_connected", computers: [], url: created2.url }, () => {
|
|
59000
|
+
console.log(import_chalk36.default.gray("\n This workspace may use the user's computer, but it isn't connected: the Replicas desktop app isn't open there, or isn't signed in as them. Keep working without it and tell the user. You get a message once it connects; run this command again then.\n"));
|
|
59001
|
+
});
|
|
59002
|
+
return;
|
|
59003
|
+
}
|
|
58978
59004
|
let pending = true;
|
|
58979
59005
|
if (created2.wait) {
|
|
58980
59006
|
const answer = await waitForUser({
|
|
58981
59007
|
timeoutMs,
|
|
58982
|
-
asked: "Asked the user
|
|
59008
|
+
asked: "Asked the user to let you run commands on their computer.",
|
|
58983
59009
|
initial: { pending: true, computers: [] },
|
|
58984
59010
|
settled: (current) => !current.pending || current.computers.length > 0,
|
|
58985
59011
|
poll: async (waiting) => {
|
|
58986
59012
|
const found = await connectedComputers();
|
|
58987
59013
|
if (found.length > 0) return { pending: true, computers: found };
|
|
58988
|
-
|
|
59014
|
+
const { pending: pending2 } = await orgAuthenticatedFetch(`/v1/local-control-request${waiting ? "" : "?waiting=false"}`);
|
|
59015
|
+
return { pending: pending2, computers: pending2 ? [] : await connectedComputers() };
|
|
58989
59016
|
}
|
|
58990
59017
|
});
|
|
58991
59018
|
if (answer.computers.length > 0) return connected(answer.computers);
|
|
@@ -58999,7 +59026,7 @@ async function localControlRequestCommand(options) {
|
|
|
58999
59026
|
console.log(import_chalk36.default.gray(options.wait === false ? `
|
|
59000
59027
|
Asked above the chat composer (${created2.url}). Keep working, and run this command again when you need the computer.
|
|
59001
59028
|
` : created2.wait ? `
|
|
59002
|
-
The
|
|
59029
|
+
The user hasn't answered yet, so stop waiting. The request stays open (${created2.url}). End your turn and say what you need the computer for. When the user answers, you get a message; run this command again then.
|
|
59003
59030
|
` : `
|
|
59004
59031
|
The user may not be watching Replicas. Send them this link where you are talking with them (the Slack thread, Linear issue, or pull request) and ask them to allow local control there: ${created2.url}
|
|
59005
59032
|
When they answer, you get a message; run this command again then.
|
|
@@ -59193,12 +59220,12 @@ var init_src2 = __esm({
|
|
|
59193
59220
|
program.command("events <id>").description("Stream live replica events as JSON lines until interrupted").action(run(workspaceEventsCommand));
|
|
59194
59221
|
chat = program.command("chat").description("Manage the chats in a replica");
|
|
59195
59222
|
chat.command("list <id>").description("List chats").action(run(chatListCommand));
|
|
59196
|
-
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));
|
|
59197
59224
|
chat.command("rename <id> <chatId> <name>").description("Rename a chat").action(run(chatRenameCommand));
|
|
59198
59225
|
chat.command("delete <id> <chatId>").description("Delete a chat").action(run(chatDeleteCommand));
|
|
59199
59226
|
chat.command("restore <id> <chatId>").description("Restore a deleted chat").action(run(chatRestoreCommand));
|
|
59200
59227
|
chat.command("interrupt <id> <chatId>").description("Stop the current agent turn").action(run(chatInterruptCommand));
|
|
59201
|
-
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));
|
|
59202
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));
|
|
59203
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));
|
|
59204
59231
|
chat.command("commands <id> <chatId>").description("List slash commands available in a chat").action(run(chatCommandsCommand));
|