replicas-cli 0.3.590 → 0.3.592

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 +116 -28
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -24774,7 +24774,82 @@ function parseIssueContractResponse(schema, value, report) {
24774
24774
  if (!parsed.success) for (const issue3 of parsed.error.issues) report.problems.add(`${issue3.path.join(".")} ${issue3.code}`);
24775
24775
  return parsed.data;
24776
24776
  }
24777
- var ISSUE_STATUSES, ISSUE_PRIORITIES, ISSUE_ACTOR_TYPES, ISSUE_SUBSCRIBER_ROLES, ISSUE_RELATION_TYPES, ISSUE_PULL_REQUEST_STATES, normalizeIssueStatus, issueStatusSchema, issuePrioritySchema, issueSubscriberRoleSchema, issueRelationTypeSchema, issuePullRequestStateSchema, ISSUE_STATUS_LABELS, ISSUE_PRIORITY_LABELS, unknownValues, knownOrRaw, createIssueContractReport, knownIssueActorSchema, issueActorSchema, ISSUE_KEY_RE, timestamp, nullableTimestamp, issueSchema, issueSubscriberSchema, issueRelationSchema, issuePullRequestSchema, issueCommentSchema, change, nullableId, issueEventDataSchemas, issueEventBase, v, issueEventVariants, created, laterVariants, issueEventSchema, clientMutationId, title, description, body, createIssueRequestSchema, updateIssueRequestSchema, issueActorRequestSchema, createIssueCommentRequestSchema, updateIssueCommentRequestSchema, createIssueRelationRequestSchema, linkIssuePullRequestRequestSchema, updateIssuePullRequestRequestSchema, issueMutationRequestSchema, updateIssueSettingsRequestSchema, listIssuesQuerySchema, issueDetailResponseSchema, listIssuesResponseSchema, issueDirectoryUserSchema, issueDirectoryWorkspaceSchema, issuesBootstrapResponseSchema, issuesDeltaQuerySchema, issuesDeltaResponseSchema, issueInboxQuerySchema, markIssueInboxReadRequestSchema, ISSUE_COMMANDS;
24777
+ function describeIssueEvent(event, name, identifierOf, quote) {
24778
+ const withText = (line, lead, text3) => quote && text3 ? `${line}${lead}
24779
+ ${quote(text3)}` : line;
24780
+ switch (event.type) {
24781
+ case "created":
24782
+ return withText(`created it (${event.data.issue.status}, priority ${event.data.issue.priority})`, ":", event.data.issue.description);
24783
+ case "title_changed":
24784
+ return `renamed it: "${event.data.from}" \u2192 "${event.data.to}"`;
24785
+ case "description_changed":
24786
+ return quote ? `edited the description. Now:
24787
+ ${quote(event.data.to)}` : "edited the description";
24788
+ case "status_changed":
24789
+ return withText(`changed the status: ${event.data.from} \u2192 ${event.data.to}`, "", event.data.reason);
24790
+ case "priority_changed":
24791
+ return `changed the priority: ${event.data.from} \u2192 ${event.data.to}`;
24792
+ case "parent_changed":
24793
+ return event.data.to ? `made it a sub-issue of ${identifierOf(event.data.to)}` : "made it a top-level issue";
24794
+ case "manager_changed":
24795
+ return event.data.to ? `moved it to Manager ${name({ type: "workspace", id: event.data.to })}` : "removed it from its Manager";
24796
+ case "assignee_added":
24797
+ return `assigned ${name(event.data.subscriber.subscriber)}`;
24798
+ case "assignee_removed":
24799
+ return `unassigned ${name(event.data.subscriber.subscriber)}`;
24800
+ case "relation_added":
24801
+ return event.data.relation.type === "blocks" ? `marked that ${identifierOf(event.data.relation.issue_id)} blocks ${identifierOf(event.data.relation.related_issue_id)}` : `marked ${identifierOf(event.data.relation.issue_id)} a duplicate of ${identifierOf(event.data.relation.related_issue_id)}`;
24802
+ case "relation_removed":
24803
+ return `removed the ${event.data.relation.type === "blocks" ? "blocking" : "duplicate"} link between ${identifierOf(event.data.relation.issue_id)} and ${identifierOf(event.data.relation.related_issue_id)}`;
24804
+ case "pr_linked":
24805
+ return `linked a pull request: ${event.data.pull_request.url}${event.data.pull_request.title ? ` (${event.data.pull_request.title})` : ""}`;
24806
+ case "pr_unlinked":
24807
+ return `unlinked a pull request: ${event.data.pull_request.url}`;
24808
+ case "pr_state_changed":
24809
+ return event.data.from === event.data.pull_request.state ? `pull request ${event.data.pull_request.url}: ${event.data.pull_request.approved ? "approved" : "no longer approved"}` : `pull request ${event.data.pull_request.url}: ${event.data.from} \u2192 ${event.data.pull_request.state}`;
24810
+ case "comment_added":
24811
+ return withText("commented", ":", event.data.comment.body);
24812
+ case "comment_edited":
24813
+ return withText("edited a comment", ". Now:", event.data.comment.body);
24814
+ case "comment_deleted":
24815
+ return "deleted a comment";
24816
+ case "archived":
24817
+ return "archived it";
24818
+ case "restored":
24819
+ return "restored it";
24820
+ case "subscriber_added":
24821
+ case "subscriber_removed":
24822
+ case "sort_order_changed":
24823
+ return null;
24824
+ }
24825
+ }
24826
+ function issueActorHandle(actor, directory) {
24827
+ return actor.type === "system" ? "system" : actor.type === "workspace" ? `workspace:${actor.id}` : directory[`${actor.type}:${actor.id}`]?.handle ?? null;
24828
+ }
24829
+ function formatIssueActor(actor, directory) {
24830
+ if (actor.type === "system") return "Replicas";
24831
+ const known = directory[`${actor.type}:${actor.id}`];
24832
+ return known ? `${known.name} (${known.handle})` : actor.type === "workspace" ? `An agent (workspace:${actor.id})` : "Someone";
24833
+ }
24834
+ function renderIssueMentions(markdown, directory) {
24835
+ return markdown.replace(ISSUE_MENTION_LINK, (_link, label, type, id) => {
24836
+ const known = directory[`${type.toLowerCase()}:${id.toLowerCase()}`];
24837
+ return known ? `@${known.name} (${known.handle})` : `@${label}`;
24838
+ });
24839
+ }
24840
+ function mapIssueActors(value, map2) {
24841
+ if (typeof value === "string") return map2.text(value);
24842
+ if (Array.isArray(value)) return value.map((item) => mapIssueActors(item, map2));
24843
+ if (!isRecord(value)) return value;
24844
+ if (Object.keys(value).length === 2 && typeof value.id === "string" && ISSUE_ACTOR_TYPES.some((type) => type === value.type)) return map2.actor({ type: String(value.type), id: value.id });
24845
+ const manager = (id) => typeof id === "string" ? map2.actor({ type: "workspace", id }) : id;
24846
+ return Object.fromEntries(Object.entries(value).map(([key, inner]) => {
24847
+ if (key === "manager_id") return [key, manager(inner)];
24848
+ if (key === "data" && value.type === "manager_changed" && isRecord(inner)) return [key, { ...inner, from: manager(inner.from), to: manager(inner.to) }];
24849
+ return [key, mapIssueActors(inner, map2)];
24850
+ }));
24851
+ }
24852
+ var ISSUE_STATUSES, ISSUE_PRIORITIES, ISSUE_ACTOR_TYPES, ISSUE_SUBSCRIBER_ROLES, ISSUE_RELATION_TYPES, ISSUE_PULL_REQUEST_STATES, normalizeIssueStatus, issueStatusSchema, issuePrioritySchema, issueSubscriberRoleSchema, issueRelationTypeSchema, issuePullRequestStateSchema, ISSUE_STATUS_LABELS, ISSUE_PRIORITY_LABELS, unknownValues, knownOrRaw, createIssueContractReport, knownIssueActorSchema, issueActorSchema, ISSUE_KEY_RE, ISSUE_MENTION_LINK, timestamp, nullableTimestamp, issueSchema, issueSubscriberSchema, issueRelationSchema, issuePullRequestSchema, issueCommentSchema, change, nullableId, issueEventDataSchemas, issueEventBase, v, issueEventVariants, created, laterVariants, issueEventSchema, issueActorDirectorySchema, clientMutationId, title, description, body, createIssueRequestSchema, updateIssueRequestSchema, issueActorRequestSchema, createIssueCommentRequestSchema, updateIssueCommentRequestSchema, createIssueRelationRequestSchema, linkIssuePullRequestRequestSchema, updateIssuePullRequestRequestSchema, issueMutationRequestSchema, updateIssueSettingsRequestSchema, listIssuesQuerySchema, issueDetailResponseSchema, listIssuesResponseSchema, issueDirectoryUserSchema, issueDirectoryWorkspaceSchema, issuesBootstrapResponseSchema, issuesDeltaQuerySchema, issuesDeltaResponseSchema, issueInboxQuerySchema, markIssueInboxReadRequestSchema, ISSUE_COMMANDS;
24778
24853
  var init_issues = __esm({
24779
24854
  "../shared/src/routes/issues.ts"() {
24780
24855
  "use strict";
@@ -24810,6 +24885,7 @@ var init_issues = __esm({
24810
24885
  });
24811
24886
  issueActorSchema = knownIssueActorSchema.extend({ type: knownOrRaw(knownIssueActorSchema.shape.type) });
24812
24887
  ISSUE_KEY_RE = /^[A-Z][A-Z0-9]{0,9}$/;
24888
+ ISSUE_MENTION_LINK = /\[@([^\]]*)\]\(mention:\/\/(user|workspace)\/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\)/gi;
24813
24889
  timestamp = external_exports.string();
24814
24890
  nullableTimestamp = timestamp.nullable();
24815
24891
  issueSchema = external_exports.object({
@@ -24908,6 +24984,7 @@ var init_issues = __esm({
24908
24984
  issueEventVariants = { created: v("created"), title_changed: v("title_changed"), description_changed: v("description_changed"), status_changed: v("status_changed"), priority_changed: v("priority_changed"), parent_changed: v("parent_changed"), manager_changed: v("manager_changed"), sort_order_changed: v("sort_order_changed"), assignee_added: v("assignee_added"), assignee_removed: v("assignee_removed"), subscriber_added: v("subscriber_added"), subscriber_removed: v("subscriber_removed"), relation_added: v("relation_added"), relation_removed: v("relation_removed"), pr_linked: v("pr_linked"), pr_unlinked: v("pr_unlinked"), pr_state_changed: v("pr_state_changed"), comment_added: v("comment_added"), comment_edited: v("comment_edited"), comment_deleted: v("comment_deleted"), archived: v("archived"), restored: v("restored") };
24909
24985
  ({ created, ...laterVariants } = issueEventVariants);
24910
24986
  issueEventSchema = external_exports.discriminatedUnion("type", [created, ...Object.values(laterVariants)]);
24987
+ issueActorDirectorySchema = external_exports.record(external_exports.string(), external_exports.object({ name: external_exports.string(), handle: external_exports.string() }));
24911
24988
  clientMutationId = external_exports.string().min(1).max(128).optional();
24912
24989
  title = external_exports.string().trim().min(1).max(500);
24913
24990
  description = external_exports.string().max(1e5);
@@ -25066,7 +25143,7 @@ Use this when:
25066
25143
 
25067
25144
  Issues are how people and agents in this organization track work. Each has an identifier like \`REP-42\`, a title, a markdown description, a status, a priority, assignees (people and workspaces), subscribers, comments, linked pull requests, and an activity log. Pass the identifier everywhere an issue is asked for.
25068
25145
 
25069
- The CLI acts as this workspace. Add \`--json\` to any command for machine-readable output.
25146
+ The CLI acts as this workspace. Add \`--json\` to any command for machine-readable output. Every command shows a person as \`Name (user:<email>)\` and an agent as \`Name (workspace:<id>)\` (only the handle in \`--json\`); pass the handle back to any command.
25070
25147
 
25071
25148
  \`\`\`bash
25072
25149
  replicas issue view REP-42 # description, comments, activity, pull requests
@@ -28040,7 +28117,7 @@ var init_tag_blocks = __esm({
28040
28117
  // ../shared/src/issue-events.ts
28041
28118
  function parseChange(line, quote) {
28042
28119
  const match = line.match(CHANGE_LINE);
28043
- const rest = (match ? match[3] + match[4] : line).replaceAll(" (agent)", "").replace(/(?:\. Now)?:$/, "");
28120
+ const rest = (match ? match[3] + match[4] : line).replace(ACTOR_HANDLE, "").replace(/(?:\. Now)?:$/, "");
28044
28121
  const [, field2, from, to] = rest.match(TRANSITION) ?? [];
28045
28122
  const transition = transitionSchema.safeParse({ field: field2, from, to }).data;
28046
28123
  const labels = !transition ? [] : transition.field === "status" ? [ISSUE_STATUS_LABELS[transition.from], ISSUE_STATUS_LABELS[transition.to]] : [ISSUE_PRIORITY_LABELS[transition.from], ISSUE_PRIORITY_LABELS[transition.to]];
@@ -28056,7 +28133,7 @@ function extractIssueEvents(text3) {
28056
28133
  const changes = detail.split("\n\n").flatMap((paragraph) => {
28057
28134
  const [line, ...quoted] = paragraph.split("\n");
28058
28135
  if (!line.trim() || line.startsWith(">")) return [];
28059
- return [parseChange(line, quoted.map((quote) => quote.replace(/^>\s?/, "")).join("\n").trim())];
28136
+ return [parseChange(line, quoted.map((quote) => quote.replace(/^>\s?/, "").replace(ACTOR_HANDLE, "")).join("\n").trim())];
28060
28137
  });
28061
28138
  return [{
28062
28139
  id: `${attributes.issue}:${attributes.sync_id ?? ""}`,
@@ -28064,13 +28141,13 @@ function extractIssueEvents(text3) {
28064
28141
  kind: "issue",
28065
28142
  agentId: attributes.issue,
28066
28143
  agentName: attributes.issue,
28067
- summary: changes.map(issueChangeSentence).join(" \xB7 "),
28144
+ summary: changes.map(issueChangeSentence).join(" \xB7 ").replace(ISSUE_MENTION_LINK, "@$1"),
28068
28145
  ...detail ? { detail } : {},
28069
28146
  issue: { title: attributes.title ?? "", url: attributes.url ?? "", changes }
28070
28147
  }];
28071
28148
  });
28072
28149
  }
28073
- var ISSUE_EVENT_TAG, transitionSchema, issueEventChangeSchema, CHANGE_LINE, TRANSITION, issueChangeSentence;
28150
+ var ISSUE_EVENT_TAG, transitionSchema, issueEventChangeSchema, ACTOR_HANDLE, CHANGE_LINE, TRANSITION, issueChangeSentence;
28074
28151
  var init_issue_events = __esm({
28075
28152
  "../shared/src/issue-events.ts"() {
28076
28153
  "use strict";
@@ -28083,7 +28160,8 @@ var init_issue_events = __esm({
28083
28160
  external_exports.object({ field: external_exports.literal("priority"), from: issuePrioritySchema, to: issuePrioritySchema })
28084
28161
  ]);
28085
28162
  issueEventChangeSchema = external_exports.object({ actor: external_exports.string(), agent: external_exports.boolean(), text: external_exports.string(), quote: external_exports.string().optional(), transition: transitionSchema.optional() });
28086
- CHANGE_LINE = /^(.+?)( \(agent\))? (created it|renamed it|edited |changed the |made it|moved it|removed |assigned |unassigned |marked |linked |unlinked |pull request |commented|deleted a comment|archived it|restored it)(.*)$/;
28163
+ ACTOR_HANDLE = / \((?:agent|user:[^\s)]+|workspace:[^\s)]+)\)/g;
28164
+ CHANGE_LINE = /^(.+?)(?:( \((?:agent|workspace:[^\s)]+)\))| \(user:[^\s)]+\))? (created it|renamed it|edited |changed the |made it|moved it|removed |assigned |unassigned |marked |linked |unlinked |pull request |commented|deleted a comment|archived it|restored it)(.*)$/;
28087
28165
  TRANSITION = /^changed the (status|priority): (\w+) → (\w+)$/;
28088
28166
  issueChangeSentence = (change2) => [change2.actor, change2.text].filter(Boolean).join(" ");
28089
28167
  }
@@ -40649,7 +40727,7 @@ var CLI_VERSION;
40649
40727
  var init_cli_version = __esm({
40650
40728
  "../shared/src/cli-version.ts"() {
40651
40729
  "use strict";
40652
- CLI_VERSION = "0.3.590";
40730
+ CLI_VERSION = "0.3.592";
40653
40731
  }
40654
40732
  });
40655
40733
 
@@ -57331,7 +57409,7 @@ var init_media_gif = __esm({
57331
57409
  });
57332
57410
 
57333
57411
  // src/commands/issue.ts
57334
- async function callIssueTool(name, args, schema) {
57412
+ async function callIssueTool(name, args, schema, printHuman) {
57335
57413
  if (!isAgentMode() && !getApiKey()) throw new Error("replicas issue needs an API key: run `replicas login --api-key`, or use it inside a workspace.");
57336
57414
  let response;
57337
57415
  try {
@@ -57340,11 +57418,13 @@ async function callIssueTool(name, args, schema) {
57340
57418
  if (error62 instanceof ApiError && error62.status === 404 && error62.message === "Not found") throw new Error("Issues are not enabled for this organization");
57341
57419
  throw error62;
57342
57420
  }
57421
+ const { actors: directory, ...body2 } = isRecord(response) ? response : {};
57343
57422
  const report = createIssueContractReport();
57344
- const parsed = parseIssueContractResponse(schema, response, report);
57423
+ const parsed = parseIssueContractResponse(schema, isRecord(response) ? body2 : response, report);
57345
57424
  if (parsed === void 0) throw new Error(`Unexpected response from the server: ${[...report.problems].join("; ")}`);
57346
57425
  if (report.dropped) console.error(import_chalk29.default.yellow(`Skipped ${report.dropped} record(s) this CLI can't read: ${[...report.problems].filter((problem) => !problem.includes("unknown_value")).join("; ")}`));
57347
- return parsed;
57426
+ const actors = issueActorDirectorySchema.catch({}).parse(directory);
57427
+ output2(mapIssueActors(parsed, { actor: (who) => issueActorHandle(who, actors), text: (text3) => renderIssueMentions(text3, actors) }), () => printHuman(parsed, actors));
57348
57428
  }
57349
57429
  async function uploadAttachments(files) {
57350
57430
  if (!files?.length) return void 0;
@@ -57360,7 +57440,7 @@ function printIssueLine(issue3) {
57360
57440
  console.log(`${import_chalk29.default.cyan(issue3.identifier.padEnd(9))} ${issue3.status.padEnd(11)} ${issue3.priority === "none" ? "" : import_chalk29.default.yellow(`${issue3.priority} `)}${issue3.title}`);
57361
57441
  }
57362
57442
  async function issueCreateCommand(title3, options) {
57363
- output2(await callIssueTool(ISSUE_COMMANDS.create, {
57443
+ await callIssueTool(ISSUE_COMMANDS.create, {
57364
57444
  title: title3,
57365
57445
  description: readText(options.description, options.descriptionFile, "description"),
57366
57446
  status: options.status,
@@ -57369,10 +57449,10 @@ async function issueCreateCommand(title3, options) {
57369
57449
  assignees: options.assign,
57370
57450
  manager_id: options.manager,
57371
57451
  media_ids: await uploadAttachments(options.attach)
57372
- }, mutationSchema), printMutation);
57452
+ }, mutationSchema, printMutation);
57373
57453
  }
57374
57454
  async function issueUpdateCommand(issue3, options) {
57375
- output2(await callIssueTool(ISSUE_COMMANDS.update, {
57455
+ await callIssueTool(ISSUE_COMMANDS.update, {
57376
57456
  issue: issue3,
57377
57457
  title: options.title,
57378
57458
  description: readText(options.description, options.descriptionFile, "description"),
@@ -57380,28 +57460,36 @@ async function issueUpdateCommand(issue3, options) {
57380
57460
  priority: options.priority,
57381
57461
  parent: options.parent === "none" ? null : options.parent,
57382
57462
  media_ids: await uploadAttachments(options.attach)
57383
- }, mutationSchema), printMutation);
57463
+ }, mutationSchema, printMutation);
57384
57464
  }
57385
57465
  async function issueViewCommand(issue3) {
57386
- output2(await callIssueTool(ISSUE_COMMANDS.get, { issue: issue3 }, issueDetailResponseSchema), (detail) => {
57466
+ await callIssueTool(ISSUE_COMMANDS.get, { issue: issue3 }, issueDetailResponseSchema, (detail, actors) => {
57467
+ const name = (actor) => formatIssueActor(actor, actors);
57387
57468
  console.log(`${import_chalk29.default.bold.cyan(detail.issue.identifier)} ${import_chalk29.default.bold(detail.issue.title)}`);
57388
57469
  console.log(import_chalk29.default.dim(`${detail.issue.status} \xB7 priority ${detail.issue.priority}`));
57389
57470
  const assignees = detail.subscribers.filter((subscriber) => subscriber.role === "assignee");
57390
- if (assignees.length) console.log(import_chalk29.default.dim(`Assignees: ${assignees.map((a) => `${a.subscriber.type}:${a.subscriber.id}`).join(", ")}`));
57471
+ if (assignees.length) console.log(import_chalk29.default.dim(`Assignees: ${assignees.map((a) => name(a.subscriber)).join(", ")}`));
57391
57472
  if (detail.issue.description) console.log(`
57392
- ${detail.issue.description}`);
57473
+ ${renderIssueMentions(detail.issue.description, actors)}`);
57393
57474
  for (const pr2 of detail.pull_requests) console.log(`
57394
57475
  ${import_chalk29.default.magenta("PR")} ${pr2.url} (${pr2.state})`);
57395
57476
  for (const sub of detail.sub_issues) printIssueLine(sub);
57396
57477
  for (const comment of detail.comments) {
57397
57478
  console.log(`
57398
- ${import_chalk29.default.dim(`\u2014 ${comment.author.type}:${comment.author.id}, ${comment.created_at}`)}
57399
- ${comment.body}`);
57479
+ ${import_chalk29.default.dim(`\u2014 ${name(comment.author)}, ${comment.created_at}`)}
57480
+ ${renderIssueMentions(comment.body, actors)}`);
57400
57481
  }
57482
+ const activity = detail.events.flatMap((event) => {
57483
+ const change2 = describeIssueEvent(event, name, (id) => [detail.issue, ...detail.sub_issues].find((related) => related.id === id)?.identifier ?? id);
57484
+ return change2 ? [`${import_chalk29.default.dim(event.created_at)} ${name(event.actor)} ${change2}`] : [];
57485
+ });
57486
+ if (activity.length) console.log(`
57487
+ ${import_chalk29.default.bold("Activity")}
57488
+ ${activity.join("\n")}`);
57401
57489
  });
57402
57490
  }
57403
57491
  async function issueListCommand(options) {
57404
- output2(await callIssueTool(ISSUE_COMMANDS.list, {
57492
+ await callIssueTool(ISSUE_COMMANDS.list, {
57405
57493
  query: options.query,
57406
57494
  status: csv(options.status),
57407
57495
  priority: csv(options.priority),
@@ -57410,7 +57498,7 @@ async function issueListCommand(options) {
57410
57498
  parent: options.parent,
57411
57499
  include_archived: options.archived,
57412
57500
  limit: options.limit ? Number(options.limit) : void 0
57413
- }, listIssuesResponseSchema), ({ issues, next_cursor }) => {
57501
+ }, listIssuesResponseSchema, ({ issues, next_cursor }) => {
57414
57502
  if (issues.length === 0) console.log(import_chalk29.default.dim("No issues"));
57415
57503
  issues.forEach(printIssueLine);
57416
57504
  if (next_cursor !== null) console.log(import_chalk29.default.dim("More issues exist; narrow the filters or raise --limit."));
@@ -57420,21 +57508,21 @@ async function issueCommentCommand(issue3, body2, options) {
57420
57508
  const text3 = readText(body2, options.file, "file") ?? "";
57421
57509
  const media_ids = await uploadAttachments(options.attach);
57422
57510
  if (!text3.trim() && !media_ids) throw new Error("Pass the comment text, --file, or --attach");
57423
- output2(await callIssueTool(ISSUE_COMMANDS.comment, { issue: issue3, body: text3, media_ids }, noData), () => console.log(`${import_chalk29.default.green("\u2713")} Commented on ${issue3}`));
57511
+ await callIssueTool(ISSUE_COMMANDS.comment, { issue: issue3, body: text3, media_ids }, noData, () => console.log(`${import_chalk29.default.green("\u2713")} Commented on ${issue3}`));
57424
57512
  }
57425
57513
  function issueActorCommand(tool, done) {
57426
57514
  return async (issue3, who) => {
57427
- output2(await callIssueTool(tool, { issue: issue3, who }, noData), () => console.log(`${import_chalk29.default.green("\u2713")} ${done} ${who ?? "you"} ${tool.startsWith("un") ? "from" : "to"} ${issue3}`));
57515
+ await callIssueTool(tool, { issue: issue3, who }, external_exports.looseObject({ subscriber: external_exports.looseObject({ subscriber: issueActorSchema }) }), ({ subscriber }, actors) => console.log(`${import_chalk29.default.green("\u2713")} ${done} ${formatIssueActor(subscriber.subscriber, actors)} ${tool.startsWith("un") ? "from" : "to"} ${issue3}`));
57428
57516
  };
57429
57517
  }
57430
57518
  async function issueLinkPrCommand(issue3, url2) {
57431
- output2(await callIssueTool(ISSUE_COMMANDS.linkPr, { issue: issue3, url: url2 }, noData), () => console.log(`${import_chalk29.default.green("\u2713")} Linked ${url2} to ${issue3}`));
57519
+ await callIssueTool(ISSUE_COMMANDS.linkPr, { issue: issue3, url: url2 }, noData, () => console.log(`${import_chalk29.default.green("\u2713")} Linked ${url2} to ${issue3}`));
57432
57520
  }
57433
57521
  async function issueUnlinkPrCommand(issue3, url2) {
57434
- output2(await callIssueTool(ISSUE_COMMANDS.unlinkPr, { issue: issue3, url: url2 }, noData), () => console.log(`${import_chalk29.default.green("\u2713")} Unlinked ${url2} from ${issue3}`));
57522
+ await callIssueTool(ISSUE_COMMANDS.unlinkPr, { issue: issue3, url: url2 }, noData, () => console.log(`${import_chalk29.default.green("\u2713")} Unlinked ${url2} from ${issue3}`));
57435
57523
  }
57436
57524
  async function issueRelateCommand(issue3, type, related) {
57437
- output2(await callIssueTool(ISSUE_COMMANDS.relate, { issue: issue3, type, related_issue: related }, noData), () => console.log(`${import_chalk29.default.green("\u2713")} ${issue3} ${type.replace("_", " ")} ${related}`));
57525
+ await callIssueTool(ISSUE_COMMANDS.relate, { issue: issue3, type, related_issue: related }, noData, () => console.log(`${import_chalk29.default.green("\u2713")} ${issue3} ${type.replace("_", " ")} ${related}`));
57438
57526
  }
57439
57527
  var import_node_fs2, import_node_path2, import_chalk29, mutationSchema, noData, csv, printMutation;
57440
57528
  var init_issue = __esm({
@@ -59039,7 +59127,7 @@ var init_src2 = __esm({
59039
59127
  issue2 = program.command("issue", { hidden: !isAgentMode() }).description("File, update, and follow Replicas Issues (REP-42). Each command takes an identifier like REP-42 or an issue ID");
59040
59128
  issue2.command("create <title>").description("File an issue").option("-d, --description <markdown>", "What is wrong or wanted, with the evidence").option("--description-file <path>", "Read the description from a file (- for stdin)").option("-s, --status <status>", `${ISSUE_STATUSES.join(", ")} (default: backlog)`).option("-p, --priority <priority>", ISSUE_PRIORITIES.join(", ")).option("--parent <issue>", "Make it a sub-issue of this issue").option("-a, --assign <who>", "Assignee: user:<email>, workspace:<id> or me (repeatable)", collect, []).option("--manager <workspace>", "Manager whose issues it joins, as workspace:<id> (default: yours, inside a Manager or its ship); 'none' for none").option("--attach <file>", "Upload and embed a screenshot or recording (repeatable)", collect, []).action(run(issueCreateCommand));
59041
59129
  issue2.command("update <issue>").description("Change the title, description, status, priority or parent").option("-t, --title <title>", "New title").option("-d, --description <markdown>", "Replace the whole description").option("--description-file <path>", "Replace the description from a file (- for stdin)").option("-s, --status <status>", ISSUE_STATUSES.join(", ")).option("-p, --priority <priority>", ISSUE_PRIORITIES.join(", ")).option("--parent <issue>", "New parent issue, or 'none'").option("--attach <file>", "Upload and embed at the end of the description (repeatable)", collect, []).action(run(issueUpdateCommand));
59042
- issue2.command("view <issue>").description("Show an issue with its comments, pull requests and sub-issues").action(run(issueViewCommand));
59130
+ issue2.command("view <issue>").description("Show an issue with its comments, activity, pull requests and sub-issues").action(run(issueViewCommand));
59043
59131
  issue2.command("list").description("List issues, newest first").option("-q, --query <text>", "Search titles and descriptions").option("-s, --status <statuses>", "Comma-separated statuses").option("-p, --priority <priorities>", "Comma-separated priorities").option("--mine", "Assigned to you (this workspace inside one)").option("--assignee <actor>", "user:<email>, workspace:<id> or me; comma-separate to match any").option("--manager <workspace>", "A Manager's issues, as workspace:<id>").option("--parent <issue>", "Sub-issues of this issue; 'none' for top-level only").option("--archived", "Include archived issues").option("-l, --limit <n>", "Page size (default 50, max 200)").action(run(issueListCommand));
59044
59132
  issue2.command("search <query>").description("Search issues by text or identifier").action(run((query) => issueListCommand({ query })));
59045
59133
  issue2.command("comment <issue> [body]").description("Comment on an issue. @Name or @email mentions a person or workspace").option("-f, --file <path>", "Read the comment from a file (- for stdin)").option("--attach <file>", "Upload and embed a screenshot or recording (repeatable)", collect, []).action(run(issueCommentCommand));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-cli",
3
- "version": "0.3.590",
3
+ "version": "0.3.592",
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": {