replicas-cli 0.3.369 → 0.3.371

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 +40 -19
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -339,6 +339,18 @@ var init_async = __esm({
339
339
  }
340
340
  });
341
341
 
342
+ // ../shared/src/state-machine.ts
343
+ function defineStateMachine(states, transitions) {
344
+ return {
345
+ sourcesOf: (to) => states.filter((state) => transitions[state].includes(to))
346
+ };
347
+ }
348
+ var init_state_machine = __esm({
349
+ "../shared/src/state-machine.ts"() {
350
+ "use strict";
351
+ }
352
+ });
353
+
342
354
  // ../shared/src/http-range.ts
343
355
  var init_http_range = __esm({
344
356
  "../shared/src/http-range.ts"() {
@@ -21369,12 +21381,20 @@ var init_workspace_credentials = __esm({
21369
21381
  });
21370
21382
 
21371
21383
  // ../shared/src/routes/pull-requests.ts
21372
- var PULL_REQUEST_MERGE_METHODS, DEPLOY_START_WINDOW_MS, mergePullRequestRequestSchema;
21384
+ var PULL_REQUEST_STATUSES, PULL_REQUEST_STATUS_MACHINE, PULL_REQUEST_MERGE_METHODS, DEPLOY_START_WINDOW_MS, mergePullRequestRequestSchema;
21373
21385
  var init_pull_requests = __esm({
21374
21386
  "../shared/src/routes/pull-requests.ts"() {
21375
21387
  "use strict";
21376
21388
  init_zod();
21389
+ init_state_machine();
21377
21390
  init_urls();
21391
+ PULL_REQUEST_STATUSES = ["open", "draft", "closed", "merged"];
21392
+ PULL_REQUEST_STATUS_MACHINE = defineStateMachine(PULL_REQUEST_STATUSES, {
21393
+ open: ["draft", "closed", "merged"],
21394
+ draft: ["open", "closed", "merged"],
21395
+ closed: ["open", "draft", "merged"],
21396
+ merged: []
21397
+ });
21378
21398
  PULL_REQUEST_MERGE_METHODS = ["merge", "squash", "rebase"];
21379
21399
  DEPLOY_START_WINDOW_MS = 30 * 6e4;
21380
21400
  mergePullRequestRequestSchema = external_exports.object({
@@ -22801,18 +22821,6 @@ var init_trigger_schemas = __esm({
22801
22821
  }
22802
22822
  });
22803
22823
 
22804
- // ../shared/src/state-machine.ts
22805
- function defineStateMachine(states, transitions) {
22806
- return {
22807
- sourcesOf: (to) => states.filter((state) => transitions[state].includes(to))
22808
- };
22809
- }
22810
- var init_state_machine = __esm({
22811
- "../shared/src/state-machine.ts"() {
22812
- "use strict";
22813
- }
22814
- });
22815
-
22816
22824
  // ../shared/src/automations/types.ts
22817
22825
  function toAutomationLifecyclePolicy(policy) {
22818
22826
  if (!policy) return "default";
@@ -26358,7 +26366,8 @@ var init_prompts = __esm({
26358
26366
  MOTHERSHIP_INSTRUCTIONS_TAG = "multitask_instructions";
26359
26367
  MOTHERSHIP_EVENT_CHAT_NOTE = `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 update the board if its order, notes or overview changed, and end with a one-line note.`;
26360
26368
  BOARD_ANSWER_NOTE = "The user answered on the board.";
26361
- BOARD_RULES = `- The board in the Ships pane beside this chat is the user's one view of the work. Each task is a ticket: spawning a ship creates its ticket, with the \`title\` and \`task\` you pass. The ship writes its ticket's summary, screenshots, recordings and questions, and Replicas files tickets under Needs you, Ready to review, Working or Done from the ship and its pull requests. Never restate what a ticket or pull request already shows.
26369
+ BOARD_RULES = `- The board in the Ships pane beside this chat is the user's one view of the work. Each task the user asks for is one ticket, with only that task's pull requests. Spawning a ship creates its ticket from the \`title\` and \`task\` you pass. A ship works on one ticket at a time: when you give an existing ship a new, separate task with \`${REPLICAS_MCP_TOOLS.messageSubagent}\`, pass \`title\` so the task gets its own ticket. Pull requests are filed under the ticket their ship was on when it opened them; move one with \`pull_requests\` in \`${REPLICAS_MCP_TOOLS.updateBoard}\` only when that's wrong. Replicas files tickets under Needs you, Ready to review, Working or Done from the ship and the ticket's pull requests. Never restate what a ticket or pull request already shows.
26370
+ - A title says what the task is about, such as "Slack replies in Mothership channels get dropped", never a ship, branch or pull request name. Each ticket also has an issue summary (what was wrong or asked, with its evidence) and a fix summary (what was done, with pull requests as #number). Replicas writes all three from the task, the ship's reports and its pull requests, and ships add to them with \`${REPLICAS_MCP_TOOLS.updateTicket}\`. Correct one with \`${REPLICAS_MCP_TOOLS.updateBoard}\` only when it's wrong.
26362
26371
  - You keep the board organized with \`${REPLICAS_MCP_TOOLS.updateBoard}\`: the order of tickets, most important first; one short note per ticket when it adds something the ticket doesn't say, such as "Merge after #12" or "Waiting on REP-40"; and one overview line at the top on where the work as a whole stands. Archive tickets the user no longer needs. When a ship continues another ship's task, pass that ticket's id as \`ticket\` to \`${REPLICAS_MCP_TOOLS.spawnSubagent}\` instead of making a new one.
26363
26372
  - Ask the user only for decisions you truly can't make. Make routine calls yourself, such as retries, small scope choices or test cleanup. For a question of your own, create a ticket with it; the user's answer comes to you here, marked "${BOARD_ANSWER_NOTE}". Answers to a ship's questions go straight to that ship.
26364
26373
  - A ship with open pull requests is not done when it sends \`finished\`: Replicas fixes their CI failures and review comments automatically, then sends \`ready\` or \`needs_attention\`. On \`needs_attention\`, direct the ship, or ask the user only if you can't decide.
@@ -34565,16 +34574,18 @@ var init_workspace_target = __esm({
34565
34574
  });
34566
34575
 
34567
34576
  // ../shared/src/mothership-board.ts
34568
- var MOTHERSHIP_TICKET_LIMITS, L, tooLong, text3, clearable, httpsUrl, linearIdentifier, mediaSchema, questionSchema, mothershipTicketTitleSchema, mothershipTicketTaskSchema, mothershipTicketMediaSchema, mothershipTicketQuestionsSchema, updateMothershipTicketRequestSchema, updateMothershipBoardRequestSchema, answerMothershipTicketRequestSchema, mothershipTicketAnswerRefSchema, LINEAR_ISSUE_SUMMARIES_MAX, linearIssueSummariesRequestSchema;
34577
+ var MOTHERSHIP_TICKET_LIMITS, L, tooLong, text3, clearable, httpsUrl, markdown, linearIdentifier, mediaSchema, questionSchema, mothershipTicketTitleSchema, mothershipTicketTaskSchema, mothershipTicketMediaSchema, mothershipTicketQuestionsSchema, issueSchema, fixSchema, updateMothershipTicketRequestSchema, updateMothershipBoardRequestSchema, answerMothershipTicketRequestSchema, mothershipTicketAnswerRefSchema, LINEAR_ISSUE_SUMMARIES_MAX, linearIssueSummariesRequestSchema;
34569
34578
  var init_mothership_board = __esm({
34570
34579
  "../shared/src/mothership-board.ts"() {
34571
34580
  "use strict";
34572
34581
  init_zod();
34573
34582
  init_mothership();
34583
+ init_mothership_events();
34574
34584
  MOTHERSHIP_TICKET_LIMITS = {
34575
34585
  title: 80,
34576
34586
  task: 1e3,
34577
- summary: 600,
34587
+ issue: 1e3,
34588
+ fix: 800,
34578
34589
  note: 100,
34579
34590
  overview: 160,
34580
34591
  question: 300,
@@ -34591,6 +34602,7 @@ var init_mothership_board = __esm({
34591
34602
  text3 = (max) => external_exports.string().trim().min(1).max(max, tooLong(max));
34592
34603
  clearable = (schema) => external_exports.union([schema, external_exports.literal("")]).optional();
34593
34604
  httpsUrl = external_exports.url({ protocol: /^https$/, error: "Must be an https URL" });
34605
+ markdown = "Markdown: **bold**, *italics*, `code`, [links](https://...) and line breaks.";
34594
34606
  linearIdentifier = external_exports.string().regex(/^[A-Za-z][A-Za-z0-9]{0,9}-\d{1,7}$/, "Use a Linear identifier such as REP-123");
34595
34607
  mediaSchema = external_exports.object({
34596
34608
  url: httpsUrl.describe("The URL `replicas media upload` printed."),
@@ -34601,12 +34613,16 @@ var init_mothership_board = __esm({
34601
34613
  question: text3(L.question).describe("One question, with the context needed to answer it."),
34602
34614
  options: external_exports.array(text3(L.option)).max(L.options).optional().describe("Up to three answers to pick from, recommended first. The user can always write their own.")
34603
34615
  });
34604
- mothershipTicketTitleSchema = text3(L.title);
34616
+ mothershipTicketTitleSchema = text3(L.title).describe(`What the task is about, in a few plain words, such as "Slack replies in Mothership channels get dropped" or "Add CSV export to Analytics". Never a ship, branch or pull request name. At most ${L.title} characters.`);
34605
34617
  mothershipTicketTaskSchema = text3(L.task);
34606
34618
  mothershipTicketMediaSchema = external_exports.array(mediaSchema);
34607
34619
  mothershipTicketQuestionsSchema = external_exports.array(questionSchema.extend({ id: external_exports.string() }));
34620
+ issueSchema = clearable(text3(L.issue)).describe(`What was wrong or what was asked, in a few plain sentences a busy reader understands: the problem, not the fix. Carry the evidence: Slack and Linear threads as links, customer quotes in quotation marks, and screenshots in \`media\`. ${markdown} At most ${L.issue} characters.`);
34621
+ fixSchema = clearable(text3(L.fix)).describe(`What was done or is being done about it, with pull requests as #number. Keep it current as the work goes on, and say how it ended once the pull requests land. ${markdown} At most ${L.fix} characters.`);
34608
34622
  updateMothershipTicketRequestSchema = external_exports.object({
34609
- summary: text3(L.summary).optional().describe(`What you did and what came of it, in two to four plain sentences a busy reader understands, with pull requests as #number. Markdown: **bold**, *italics*, \`code\` and [links](https://...). At most ${L.summary} characters.`),
34623
+ title: mothershipTicketTitleSchema.optional(),
34624
+ issue: issueSchema,
34625
+ fix: fixSchema,
34610
34626
  media: external_exports.array(mediaSchema).max(L.media).optional().describe(`Screenshots and recordings that show the result, uploaded with \`replicas media upload\`, at most ${L.media}. Replaces the ticket's media.`),
34611
34627
  questions: external_exports.array(questionSchema).max(L.questions).optional().describe(`Questions only the user can answer, at most ${L.questions}. Replaces the open ones; pass [] once they are answered. Their answer comes back to you in this chat.`),
34612
34628
  blocked: clearable(text3(L.blocked)).describe('Why you cannot go on without the user, such as missing access. "" once unblocked.')
@@ -34616,6 +34632,9 @@ var init_mothership_board = __esm({
34616
34632
  tickets: external_exports.array(external_exports.object({
34617
34633
  id: external_exports.uuid(),
34618
34634
  title: mothershipTicketTitleSchema.optional(),
34635
+ issue: issueSchema,
34636
+ fix: fixSchema,
34637
+ pull_requests: external_exports.array(httpsUrl).max(20).optional().describe("Pull request URLs that came out of this ticket's task. They move here from any other ticket. Each pull request is filed under the ticket its ship was working on when it opened it, so pass this only to correct that."),
34619
34638
  note: clearable(text3(L.note)).describe(`Your one short comment on the ticket, shown under its row, replacing the last. "" removes it. At most ${L.note} characters.`),
34620
34639
  linear: clearable(linearIdentifier).describe('The Linear issue this ticket is for, such as REP-123. "" removes it.'),
34621
34640
  archived: external_exports.boolean().optional().describe("Take it off the board.")
@@ -34624,6 +34643,7 @@ var init_mothership_board = __esm({
34624
34643
  create: external_exports.array(external_exports.object({
34625
34644
  title: mothershipTicketTitleSchema,
34626
34645
  task: mothershipTicketTaskSchema.optional(),
34646
+ issue: text3(L.issue).optional(),
34627
34647
  questions: external_exports.array(questionSchema).max(L.questions).optional(),
34628
34648
  note: text3(L.note).optional()
34629
34649
  })).max(5).optional().describe("Tickets with no ship, for your own questions to the user or work no ship does. Their answers come to you.")
@@ -37714,7 +37734,7 @@ var CLI_VERSION;
37714
37734
  var init_cli_version = __esm({
37715
37735
  "../shared/src/cli-version.ts"() {
37716
37736
  "use strict";
37717
- CLI_VERSION = "0.3.369";
37737
+ CLI_VERSION = "0.3.371";
37718
37738
  }
37719
37739
  });
37720
37740
 
@@ -48872,6 +48892,7 @@ var init_src = __esm({
48872
48892
  init_json();
48873
48893
  init_api_request();
48874
48894
  init_async();
48895
+ init_state_machine();
48875
48896
  init_http_range();
48876
48897
  init_result();
48877
48898
  init_access();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-cli",
3
- "version": "0.3.369",
3
+ "version": "0.3.371",
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": {