replicas-cli 0.3.505 → 0.3.507
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 +383 -303
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -232,6 +232,7 @@ var init_urls = __esm({
|
|
|
232
232
|
environment: "/environment",
|
|
233
233
|
analytics: "/analytics",
|
|
234
234
|
review: "/review",
|
|
235
|
+
issues: "/issues",
|
|
235
236
|
dashboard: DASHBOARD_PATH,
|
|
236
237
|
agents: `${DASHBOARD_PATH}/agents`,
|
|
237
238
|
integrations: `${DASHBOARD_PATH}/integrations`,
|
|
@@ -24568,7 +24569,7 @@ var init_issues = __esm({
|
|
|
24568
24569
|
"../shared/src/default-skills/replicas-agent/abilities/issues.ts"() {
|
|
24569
24570
|
"use strict";
|
|
24570
24571
|
SECTION7 = `### Issues
|
|
24571
|
-
Track work in Replicas Issues (\`REP-42\`), the shared to-do list of the people and agents in this organization, with \`replicas issue
|
|
24572
|
+
Track work in Replicas Issues (\`REP-42\`), the shared to-do list of the people and agents in this organization, with \`replicas issue\`.
|
|
24572
24573
|
|
|
24573
24574
|
**Reference:** \`references/ISSUES.md\`
|
|
24574
24575
|
|
|
@@ -24581,7 +24582,7 @@ Use this when:
|
|
|
24581
24582
|
|
|
24582
24583
|
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.
|
|
24583
24584
|
|
|
24584
|
-
|
|
24585
|
+
The CLI acts as this workspace. Add \`--json\` to any command for machine-readable output.
|
|
24585
24586
|
|
|
24586
24587
|
\`\`\`bash
|
|
24587
24588
|
replicas issue view REP-42 # description, comments, activity, pull requests
|
|
@@ -24594,6 +24595,7 @@ replicas issue update REP-42 --title "..." --description-file /tmp/desc.md
|
|
|
24594
24595
|
replicas issue comment REP-42 "Ready for review: https://github.com/acme/app/pull/12"
|
|
24595
24596
|
replicas issue comment REP-42 "Before and after" --attach /tmp/after.png
|
|
24596
24597
|
replicas issue assign REP-42 alice@acme.com # a member's email, user ID, or a workspace ID; \`me\` is this workspace
|
|
24598
|
+
replicas issue unassign REP-42 alice@acme.com # they stay subscribed
|
|
24597
24599
|
replicas issue subscribe REP-42 | unsubscribe REP-42
|
|
24598
24600
|
replicas issue link-pr REP-42 https://github.com/acme/app/pull/12
|
|
24599
24601
|
replicas issue relate REP-42 blocks REP-43 | duplicate_of REP-40
|
|
@@ -24620,7 +24622,7 @@ Read the event and act only when it asks something of you: a person's question o
|
|
|
24620
24622
|
|
|
24621
24623
|
**Keep the description current**, the way a good PM does: when the scope or the plan changes, edit it rather than burying the change in comment 14. Comments are for progress, questions, and decisions.
|
|
24622
24624
|
|
|
24623
|
-
**Ask a person** by assigning them and commenting with exactly what you need decided; mention them as \`@email\` in the comment. Their reply arrives as an \`<issue_event>\`.
|
|
24625
|
+
**Ask a person** by assigning them and commenting with exactly what you need decided; mention them as \`@email\` in the comment. Their reply arrives as an \`<issue_event>\`. Once they've answered, unassign them so the issue only shows as theirs while it needs them; they stay subscribed.
|
|
24624
24626
|
|
|
24625
24627
|
**Split big work:** create sub-issues with \`--parent REP-42\`, one per pull request or separable piece, and link blockers with \`relate\`.
|
|
24626
24628
|
|
|
@@ -27108,7 +27110,7 @@ var init_environment_config_source = __esm({
|
|
|
27108
27110
|
});
|
|
27109
27111
|
|
|
27110
27112
|
// ../shared/src/replicas-mcp.ts
|
|
27111
|
-
var
|
|
27113
|
+
var REPLICAS_MCP_TOOLS, automationToolInputSchema, credentialUserIdDescription, automationBackgroundSchema, automationCreateToolInputSchema, automationUpdateToolInputSchema, chatPath, provider, model, thinkingLevel, title, message, createChatToolInputSchema, forkChatToolInputSchema, renameChatToolInputSchema, runCommandToolInputSchema, environmentMcpPath, createEnvironmentMcpToolInputSchema, updateEnvironmentMcpToolInputSchema, createEnvironmentDeviceToolInputSchema, previewEnvironmentConfigSourceToolInputSchema, applyEnvironmentConfigSourceToolInputSchema;
|
|
27112
27114
|
var init_replicas_mcp = __esm({
|
|
27113
27115
|
"../shared/src/replicas-mcp.ts"() {
|
|
27114
27116
|
"use strict";
|
|
@@ -27123,7 +27125,6 @@ var init_replicas_mcp = __esm({
|
|
|
27123
27125
|
init_environment_config_source();
|
|
27124
27126
|
init_workspaces();
|
|
27125
27127
|
init_sandbox();
|
|
27126
|
-
REPLICAS_MCP_PATH = "/v1/mcp";
|
|
27127
27128
|
REPLICAS_MCP_TOOLS = {
|
|
27128
27129
|
listEnvironments: "list_environments",
|
|
27129
27130
|
createAutomation: "create_automation",
|
|
@@ -27184,19 +27185,6 @@ var init_replicas_mcp = __esm({
|
|
|
27184
27185
|
deleteChat: "delete_chat",
|
|
27185
27186
|
listRepositories: "list_repositories"
|
|
27186
27187
|
};
|
|
27187
|
-
ISSUE_MCP_TOOLS = {
|
|
27188
|
-
create: "create_issue",
|
|
27189
|
-
update: "update_issue",
|
|
27190
|
-
get: "get_issue",
|
|
27191
|
-
list: "list_issues",
|
|
27192
|
-
comment: "comment_on_issue",
|
|
27193
|
-
assign: "assign_issue",
|
|
27194
|
-
unassign: "unassign_issue",
|
|
27195
|
-
subscribe: "subscribe_issue",
|
|
27196
|
-
unsubscribe: "unsubscribe_issue",
|
|
27197
|
-
linkPr: "link_issue_pr",
|
|
27198
|
-
relate: "relate_issues"
|
|
27199
|
-
};
|
|
27200
27188
|
automationToolInputSchema = external_exports.object({
|
|
27201
27189
|
name: external_exports.string().describe("Short automation name."),
|
|
27202
27190
|
prompt: external_exports.string().describe("Prompt each automation run starts with."),
|
|
@@ -27451,7 +27439,7 @@ function stripAgentInstructionBlocks(text4) {
|
|
|
27451
27439
|
else spans(prose, text4.length);
|
|
27452
27440
|
return stripInstructionBlocksOutside(text4, quoted);
|
|
27453
27441
|
}
|
|
27454
|
-
var REPLICAS_INSTRUCTIONS_TAG, fenceMarker, INSTRUCTIONS_OPEN, INSTRUCTIONS_CLOSE, MANAGER_EVENT_CHAT_NOTE, BOARD_ANSWER_NOTE, BOARD_RULES, MANAGER_TICKET_MESSAGE_NOTE, MANAGER_TICKET_REPLY_NUDGE, T, SCOUT_LINEAR_RULES, SCOUT_MUTED_RULES, SCOUT_PRIOR_UNTAGGED_RULES, SCOUT_JOINED_RULES, SCOUT_REACTION_RULES;
|
|
27442
|
+
var REPLICAS_INSTRUCTIONS_TAG, fenceMarker, INSTRUCTIONS_OPEN, INSTRUCTIONS_CLOSE, managerEventChatNote, MANAGER_EVENT_CHAT_NOTE, BOARD_ANSWER_NOTE, MANAGER_ISSUE_EVENT_CHAT_NOTE, MERGE_RULE, chatRule, BOARD_RULES, ISSUE_RULES, MANAGER_TICKET_MESSAGE_NOTE, MANAGER_TICKET_REPLY_NUDGE, T, SCOUT_LINEAR_RULES, SCOUT_MUTED_RULES, SCOUT_PRIOR_UNTAGGED_RULES, SCOUT_JOINED_RULES, SCOUT_REACTION_RULES;
|
|
27455
27443
|
var init_prompts = __esm({
|
|
27456
27444
|
"../shared/src/prompts.ts"() {
|
|
27457
27445
|
"use strict";
|
|
@@ -27474,15 +27462,28 @@ var init_prompts = __esm({
|
|
|
27474
27462
|
};
|
|
27475
27463
|
INSTRUCTIONS_OPEN = `<${REPLICAS_INSTRUCTIONS_TAG}>`;
|
|
27476
27464
|
INSTRUCTIONS_CLOSE = `</${REPLICAS_INSTRUCTIONS_TAG}>`;
|
|
27477
|
-
|
|
27465
|
+
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.`;
|
|
27466
|
+
MANAGER_EVENT_CHAT_NOTE = managerEventChatNote("update the board if its order, notes or overview changed, and ");
|
|
27478
27467
|
BOARD_ANSWER_NOTE = "The user answered on the board.";
|
|
27468
|
+
MANAGER_ISSUE_EVENT_CHAT_NOTE = managerEventChatNote("");
|
|
27469
|
+
MERGE_RULE = `- When a pull request should merge once it's approved and CI passes, call \`${REPLICAS_MCP_TOOLS.mergeWhenReady}\`: Replicas merges it and sends \`merged\`, or \`needs_attention\` saying why it can't. Never watch CI or pull requests with \`gh\`, sleep loops or wait scripts, and merge one yourself only when the user wants it merged right away.`;
|
|
27470
|
+
chatRule = (view, news) => `- The chat is like texting an assistant. In a turn the user typed, they see the text you write between tool calls as it streams, your final reply, what you send with \`${REPLICAS_MCP_TOOLS.sendToChat}\`, and your \`${REPLICAS_MCP_TOOLS.setStatus}\` line, never your tool calls. Unless you can answer right away, open with one line on what you'll do first and roughly how long it takes. Then call \`${REPLICAS_MCP_TOOLS.setStatus}\` with a few words on your current step, such as "Reading the billing webhook", and again each time you move to a new step. Before your final reply, write only what they'd want to know now: ${news}. Never narrate tool calls or say you're still working. When they message you mid-turn, reply in one line before anything else, then fold it into your work. Write in a line or two with links and any media inline, and never restate ${view} in chat.`;
|
|
27479
27471
|
BOARD_RULES = `- The board in the Ships pane beside this chat is the user's one view of the work: one ticket per task they ask for, holding only that task's pull requests. Replicas fills in each ticket's title, summaries, section and pull requests from the task, the ship's reports and its pull requests, so never restate what a ticket shows, and correct one with \`${REPLICAS_MCP_TOOLS.updateBoard}\` only when it's wrong.
|
|
27480
27472
|
- Keep the board organized with \`${REPLICAS_MCP_TOOLS.updateBoard}\`: tickets in order, most important first; one short note per ticket only when it adds something, such as "Merge after #12"; and one overview line on where the work as a whole stands. Archive tickets the user no longer needs.
|
|
27481
27473
|
- 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.
|
|
27482
27474
|
- 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.
|
|
27483
|
-
|
|
27475
|
+
${MERGE_RULE}
|
|
27484
27476
|
- On every ship event and board answer, act with tools on whatever it unblocks, such as starting the next task once a pull request merges, and update the board if it changed. The user sees nothing you write in these turns unless a message they typed is still unanswered; otherwise reach them only with \`${REPLICAS_MCP_TOOLS.sendToChat}\`, and only for what they'd want right now: a deliverable they asked for, with its media, links or answer; a blocker that needs them, also on the board; or a request of theirs being done. Never for status, such as "PR #12 merged" or "I asked the ship to\u2026". End the turn with a one-line note of what you did.
|
|
27485
|
-
|
|
27477
|
+
${chatRule("the board", "a finding that changes the answer, a ship you started, or a decision you need")}
|
|
27478
|
+
`;
|
|
27479
|
+
ISSUE_RULES = `- Your work lives in issues in your slice of the organization's Issues, which the Issues tab beside this chat shows the user. Before delegating, turn a request into issues with \`replicas issue create\`: one per independent task, so five small bugs are five issues, and a parent with sub-issues for a big project. Reuse an issue the request is about; find it with \`replicas issue list\`. A title says what the task is about, never a ship, branch or pull request name.
|
|
27480
|
+
- Spawn ships with \`issue\`, and pass \`issue\` to \`${REPLICAS_MCP_TOOLS.messageSubagent}\` to point a ship at another one: it is assigned, subscribed and told. Several ships can share an issue. Replicas moves an issue to In progress when a ship starts it, In review when its pull request opens and Done when they merge, and ships comment their progress, so never restate what an issue shows. Order, reprioritize or cancel issues with \`replicas issue update\`.
|
|
27481
|
+
- You are subscribed to every issue in your slice: comments and changes by ships and people arrive as \`<issue_event>\` blocks. Act on them like ship events. Ships assigned to an issue get its comments too, so never relay a comment to them; pass it only to a ship that isn't on the issue.
|
|
27482
|
+
- 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 decision or merge only they can give, assign them to the issue with \`replicas issue assign\` and comment the question with \`replicas issue comment\`; their reply comes back as an \`<issue_event>\`. Once they answer a question you asked, unassign them with \`replicas issue unassign\` so the issue leaves their "Assigned to you"; they stay subscribed. Ships ask and unassign for their own questions, so leave those to them.
|
|
27483
|
+
- 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 assign the user only if you can't decide. On \`ready\` for a pull request that needs a person's review, assign the user with a one-line comment.
|
|
27484
|
+
${MERGE_RULE}
|
|
27485
|
+
- On every ship and issue event, act with tools on whatever it unblocks, such as starting the next task once a pull request merges. The user sees nothing you write in these turns unless a message they typed is still unanswered; otherwise reach them only with \`${REPLICAS_MCP_TOOLS.sendToChat}\`, and only for what they'd want right now: a deliverable they asked for, with its media, links or answer; a blocker that needs them, also assigned to them on its issue; or a request of theirs being done. Never for status, such as "PR #12 merged" or "I asked the ship to\u2026". End the turn with a one-line note of what you did, or only \`No action needed.\` when an issue event needs nothing from you.
|
|
27486
|
+
${chatRule("the Issues tab", "the issues you created, a ship you started, a finding that changes the answer, or a decision you need")}
|
|
27486
27487
|
`;
|
|
27487
27488
|
MANAGER_TICKET_MESSAGE_NOTE = `The user sent this from your ticket on the Manager's board and reads your answer there, not in this chat. Answer them with \`${REPLICAS_MCP_TOOLS.replyOnTicket}\`: briefly, with a link or screenshot if it helps, and a follow-up question only if you need one. Keep longer work and detail in this chat.`;
|
|
27488
27489
|
MANAGER_TICKET_REPLY_NUDGE = `The user is still waiting for your answer on your ticket, and they only read the ticket. Answer them now with \`${REPLICAS_MCP_TOOLS.replyOnTicket}\`, briefly.`;
|
|
@@ -27549,10 +27550,320 @@ var init_message_origin = __esm({
|
|
|
27549
27550
|
}
|
|
27550
27551
|
});
|
|
27551
27552
|
|
|
27553
|
+
// ../shared/src/tag-blocks.ts
|
|
27554
|
+
var ATTRIBUTE, MULTITASK_EVENT_TAG, tagBlockPattern, parseTagAttributes;
|
|
27555
|
+
var init_tag_blocks = __esm({
|
|
27556
|
+
"../shared/src/tag-blocks.ts"() {
|
|
27557
|
+
"use strict";
|
|
27558
|
+
ATTRIBUTE = /(\w+)="([^"]*)"/g;
|
|
27559
|
+
MULTITASK_EVENT_TAG = "multitask_event";
|
|
27560
|
+
tagBlockPattern = (tag) => new RegExp(`<${tag}((?:\\s+\\w+="[^"]*")*)>\\n?([\\s\\S]*?)\\n?</${tag}>`, "g");
|
|
27561
|
+
parseTagAttributes = (raw) => Object.fromEntries([...raw.matchAll(ATTRIBUTE)].map(([, key, value]) => [key, value.replace(/</g, "<").replace(/"/g, '"').replace(/&/g, "&")]));
|
|
27562
|
+
}
|
|
27563
|
+
});
|
|
27564
|
+
|
|
27565
|
+
// ../shared/src/routes/issues.ts
|
|
27566
|
+
var ISSUE_STATUSES, ISSUE_PRIORITIES, ISSUE_ACTOR_TYPES, ISSUE_SUBSCRIBER_ROLES, ISSUE_RELATION_TYPES, ISSUE_PULL_REQUEST_STATES, issueStatusSchema, issuePrioritySchema, issueSubscriberRoleSchema, issueRelationTypeSchema, issuePullRequestStateSchema, ISSUE_STATUS_LABELS, ISSUE_PRIORITY_LABELS, issueActorSchema, ISSUE_KEY_RE, timestamp, nullableTimestamp, issueSchema, issueSubscriberSchema, issueRelationSchema, issuePullRequestSchema, issueCommentSchema, change, nullableId, ISSUE_EVENT_TYPES, issueEventDataSchemas, issueEventBase, issueEventVariant, issueEventSchema, clientMutationId, title2, description, body, createIssueRequestSchema, updateIssueRequestSchema, issueActorRequestSchema, createIssueCommentRequestSchema, updateIssueCommentRequestSchema, createIssueRelationRequestSchema, linkIssuePullRequestRequestSchema, updateIssuePullRequestRequestSchema, issueMutationRequestSchema, updateIssueSettingsRequestSchema, listIssuesQuerySchema, issueDetailResponseSchema, listIssuesResponseSchema, issuesDeltaQuerySchema, issueInboxQuerySchema, markIssueInboxReadRequestSchema, ISSUE_COMMANDS;
|
|
27567
|
+
var init_issues2 = __esm({
|
|
27568
|
+
"../shared/src/routes/issues.ts"() {
|
|
27569
|
+
"use strict";
|
|
27570
|
+
init_zod();
|
|
27571
|
+
ISSUE_STATUSES = ["backlog", "todo", "in_progress", "in_review", "done", "canceled", "duplicate"];
|
|
27572
|
+
ISSUE_PRIORITIES = ["none", "urgent", "high", "medium", "low"];
|
|
27573
|
+
ISSUE_ACTOR_TYPES = ["user", "workspace"];
|
|
27574
|
+
ISSUE_SUBSCRIBER_ROLES = ["assignee", "creator", "mentioned", "manual"];
|
|
27575
|
+
ISSUE_RELATION_TYPES = ["blocks", "duplicate_of"];
|
|
27576
|
+
ISSUE_PULL_REQUEST_STATES = ["draft", "open", "merged", "closed"];
|
|
27577
|
+
issueStatusSchema = external_exports.enum(ISSUE_STATUSES);
|
|
27578
|
+
issuePrioritySchema = external_exports.enum(ISSUE_PRIORITIES);
|
|
27579
|
+
issueSubscriberRoleSchema = external_exports.enum(ISSUE_SUBSCRIBER_ROLES);
|
|
27580
|
+
issueRelationTypeSchema = external_exports.enum(ISSUE_RELATION_TYPES);
|
|
27581
|
+
issuePullRequestStateSchema = external_exports.enum(ISSUE_PULL_REQUEST_STATES);
|
|
27582
|
+
ISSUE_STATUS_LABELS = { backlog: "Backlog", todo: "Todo", in_progress: "In Progress", in_review: "In Review", done: "Done", canceled: "Canceled", duplicate: "Duplicate" };
|
|
27583
|
+
ISSUE_PRIORITY_LABELS = { none: "No priority", urgent: "Urgent", high: "High", medium: "Medium", low: "Low" };
|
|
27584
|
+
issueActorSchema = external_exports.object({
|
|
27585
|
+
type: external_exports.enum(ISSUE_ACTOR_TYPES),
|
|
27586
|
+
id: external_exports.string().toLowerCase().uuid()
|
|
27587
|
+
});
|
|
27588
|
+
ISSUE_KEY_RE = /^[A-Z][A-Z0-9]{0,9}$/;
|
|
27589
|
+
timestamp = external_exports.string();
|
|
27590
|
+
nullableTimestamp = timestamp.nullable();
|
|
27591
|
+
issueSchema = external_exports.object({
|
|
27592
|
+
id: external_exports.string().uuid(),
|
|
27593
|
+
organization_id: external_exports.string().uuid(),
|
|
27594
|
+
number: external_exports.number().int(),
|
|
27595
|
+
identifier: external_exports.string(),
|
|
27596
|
+
title: external_exports.string(),
|
|
27597
|
+
description: external_exports.string(),
|
|
27598
|
+
status: issueStatusSchema,
|
|
27599
|
+
priority: issuePrioritySchema,
|
|
27600
|
+
parent_id: external_exports.string().uuid().nullable(),
|
|
27601
|
+
manager_id: external_exports.string().uuid().nullable(),
|
|
27602
|
+
creator: issueActorSchema,
|
|
27603
|
+
/** Fractional: to move an issue between two others, send the midpoint of their sort orders. */
|
|
27604
|
+
sort_order: external_exports.number(),
|
|
27605
|
+
created_at: timestamp,
|
|
27606
|
+
updated_at: timestamp,
|
|
27607
|
+
completed_at: nullableTimestamp,
|
|
27608
|
+
canceled_at: nullableTimestamp,
|
|
27609
|
+
archived_at: nullableTimestamp
|
|
27610
|
+
});
|
|
27611
|
+
issueSubscriberSchema = external_exports.object({
|
|
27612
|
+
issue_id: external_exports.string().uuid(),
|
|
27613
|
+
subscriber: issueActorSchema,
|
|
27614
|
+
role: issueSubscriberRoleSchema,
|
|
27615
|
+
created_at: timestamp
|
|
27616
|
+
});
|
|
27617
|
+
issueRelationSchema = external_exports.object({
|
|
27618
|
+
id: external_exports.string().uuid(),
|
|
27619
|
+
type: issueRelationTypeSchema,
|
|
27620
|
+
issue_id: external_exports.string().uuid(),
|
|
27621
|
+
related_issue_id: external_exports.string().uuid(),
|
|
27622
|
+
created_at: timestamp
|
|
27623
|
+
});
|
|
27624
|
+
issuePullRequestSchema = external_exports.object({
|
|
27625
|
+
id: external_exports.string().uuid(),
|
|
27626
|
+
issue_id: external_exports.string().uuid(),
|
|
27627
|
+
url: external_exports.string(),
|
|
27628
|
+
pull_request_id: external_exports.string().uuid().nullable(),
|
|
27629
|
+
title: external_exports.string().nullable(),
|
|
27630
|
+
state: issuePullRequestStateSchema,
|
|
27631
|
+
created_at: timestamp,
|
|
27632
|
+
updated_at: timestamp
|
|
27633
|
+
});
|
|
27634
|
+
issueCommentSchema = external_exports.object({
|
|
27635
|
+
id: external_exports.string().uuid(),
|
|
27636
|
+
issue_id: external_exports.string().uuid(),
|
|
27637
|
+
author: issueActorSchema,
|
|
27638
|
+
body: external_exports.string(),
|
|
27639
|
+
created_at: timestamp,
|
|
27640
|
+
updated_at: timestamp
|
|
27641
|
+
});
|
|
27642
|
+
change = (value) => external_exports.object({ from: value, to: value });
|
|
27643
|
+
nullableId = external_exports.string().uuid().nullable();
|
|
27644
|
+
ISSUE_EVENT_TYPES = [
|
|
27645
|
+
"created",
|
|
27646
|
+
"title_changed",
|
|
27647
|
+
"description_changed",
|
|
27648
|
+
"status_changed",
|
|
27649
|
+
"priority_changed",
|
|
27650
|
+
"parent_changed",
|
|
27651
|
+
"manager_changed",
|
|
27652
|
+
"sort_order_changed",
|
|
27653
|
+
"assignee_added",
|
|
27654
|
+
"assignee_removed",
|
|
27655
|
+
"subscriber_added",
|
|
27656
|
+
"subscriber_removed",
|
|
27657
|
+
"relation_added",
|
|
27658
|
+
"relation_removed",
|
|
27659
|
+
"pr_linked",
|
|
27660
|
+
"pr_unlinked",
|
|
27661
|
+
"pr_state_changed",
|
|
27662
|
+
"comment_added",
|
|
27663
|
+
"comment_edited",
|
|
27664
|
+
"comment_deleted",
|
|
27665
|
+
"archived",
|
|
27666
|
+
"restored"
|
|
27667
|
+
];
|
|
27668
|
+
issueEventDataSchemas = {
|
|
27669
|
+
created: external_exports.object({ issue: issueSchema }),
|
|
27670
|
+
title_changed: change(external_exports.string()),
|
|
27671
|
+
description_changed: change(external_exports.string()),
|
|
27672
|
+
status_changed: change(issueStatusSchema).extend({ completed_at: nullableTimestamp, canceled_at: nullableTimestamp }),
|
|
27673
|
+
priority_changed: change(issuePrioritySchema),
|
|
27674
|
+
parent_changed: change(nullableId),
|
|
27675
|
+
manager_changed: change(nullableId),
|
|
27676
|
+
sort_order_changed: change(external_exports.number()),
|
|
27677
|
+
/** `subscriber` is the row after the change: an unassigned principal stays subscribed with role `manual`. */
|
|
27678
|
+
assignee_added: external_exports.object({ subscriber: issueSubscriberSchema }),
|
|
27679
|
+
assignee_removed: external_exports.object({ subscriber: issueSubscriberSchema }),
|
|
27680
|
+
subscriber_added: external_exports.object({ subscriber: issueSubscriberSchema }),
|
|
27681
|
+
subscriber_removed: external_exports.object({ subscriber: issueSubscriberSchema }),
|
|
27682
|
+
relation_added: external_exports.object({ relation: issueRelationSchema }),
|
|
27683
|
+
relation_removed: external_exports.object({ relation: issueRelationSchema }),
|
|
27684
|
+
pr_linked: external_exports.object({ pull_request: issuePullRequestSchema }),
|
|
27685
|
+
pr_unlinked: external_exports.object({ pull_request: issuePullRequestSchema }),
|
|
27686
|
+
pr_state_changed: external_exports.object({ pull_request: issuePullRequestSchema, from: issuePullRequestStateSchema }),
|
|
27687
|
+
comment_added: external_exports.object({ comment: issueCommentSchema }),
|
|
27688
|
+
comment_edited: external_exports.object({ comment: issueCommentSchema, from: external_exports.string() }),
|
|
27689
|
+
comment_deleted: external_exports.object({ comment: issueCommentSchema }),
|
|
27690
|
+
archived: external_exports.object({ archived_at: timestamp }),
|
|
27691
|
+
restored: external_exports.object({
|
|
27692
|
+
issue: issueSchema,
|
|
27693
|
+
subscribers: external_exports.array(issueSubscriberSchema),
|
|
27694
|
+
relations: external_exports.array(issueRelationSchema),
|
|
27695
|
+
pull_requests: external_exports.array(issuePullRequestSchema)
|
|
27696
|
+
})
|
|
27697
|
+
};
|
|
27698
|
+
issueEventBase = external_exports.object({
|
|
27699
|
+
sync_id: external_exports.number().int(),
|
|
27700
|
+
issue_id: external_exports.string().uuid(),
|
|
27701
|
+
actor: issueActorSchema,
|
|
27702
|
+
/** Echo of the `client_mutation_id` sent with the write, so the writer can settle its optimistic change. */
|
|
27703
|
+
client_mutation_id: external_exports.string().nullable(),
|
|
27704
|
+
created_at: timestamp
|
|
27705
|
+
});
|
|
27706
|
+
issueEventVariant = (type) => issueEventBase.extend({ type: external_exports.literal(type), data: issueEventDataSchemas[type] });
|
|
27707
|
+
issueEventSchema = external_exports.discriminatedUnion("type", [issueEventVariant(ISSUE_EVENT_TYPES[0]), ...ISSUE_EVENT_TYPES.slice(1).map(issueEventVariant)]);
|
|
27708
|
+
clientMutationId = external_exports.string().min(1).max(128).optional();
|
|
27709
|
+
title2 = external_exports.string().trim().min(1).max(500);
|
|
27710
|
+
description = external_exports.string().max(1e5);
|
|
27711
|
+
body = external_exports.string().trim().min(1).max(1e5);
|
|
27712
|
+
createIssueRequestSchema = external_exports.object({
|
|
27713
|
+
/** Client-generated id, so an optimistic create can be referenced before the server answers. */
|
|
27714
|
+
id: external_exports.string().uuid().optional(),
|
|
27715
|
+
title: title2,
|
|
27716
|
+
description: description.optional(),
|
|
27717
|
+
status: issueStatusSchema.optional(),
|
|
27718
|
+
priority: issuePrioritySchema.optional(),
|
|
27719
|
+
parent_id: external_exports.string().uuid().optional(),
|
|
27720
|
+
manager_id: external_exports.string().uuid().optional(),
|
|
27721
|
+
sort_order: external_exports.number().finite().optional(),
|
|
27722
|
+
assignees: external_exports.array(issueActorSchema).max(20).optional(),
|
|
27723
|
+
subscribers: external_exports.array(issueActorSchema).max(50).optional(),
|
|
27724
|
+
client_mutation_id: clientMutationId
|
|
27725
|
+
});
|
|
27726
|
+
updateIssueRequestSchema = external_exports.object({
|
|
27727
|
+
title: title2.optional(),
|
|
27728
|
+
description: description.optional(),
|
|
27729
|
+
status: issueStatusSchema.optional(),
|
|
27730
|
+
priority: issuePrioritySchema.optional(),
|
|
27731
|
+
// PATCH semantics: null clears the parent or Manager, omitting it leaves it unchanged.
|
|
27732
|
+
parent_id: nullableId.optional(),
|
|
27733
|
+
manager_id: nullableId.optional(),
|
|
27734
|
+
sort_order: external_exports.number().finite().optional(),
|
|
27735
|
+
client_mutation_id: clientMutationId
|
|
27736
|
+
});
|
|
27737
|
+
issueActorRequestSchema = issueActorSchema.partial().extend({ client_mutation_id: clientMutationId });
|
|
27738
|
+
createIssueCommentRequestSchema = external_exports.object({
|
|
27739
|
+
id: external_exports.string().uuid().optional(),
|
|
27740
|
+
body,
|
|
27741
|
+
client_mutation_id: clientMutationId
|
|
27742
|
+
});
|
|
27743
|
+
updateIssueCommentRequestSchema = external_exports.object({ body, client_mutation_id: clientMutationId });
|
|
27744
|
+
createIssueRelationRequestSchema = external_exports.object({
|
|
27745
|
+
id: external_exports.string().uuid().optional(),
|
|
27746
|
+
type: issueRelationTypeSchema,
|
|
27747
|
+
related_issue: external_exports.string().min(1),
|
|
27748
|
+
client_mutation_id: clientMutationId
|
|
27749
|
+
});
|
|
27750
|
+
linkIssuePullRequestRequestSchema = external_exports.object({
|
|
27751
|
+
id: external_exports.string().uuid().optional(),
|
|
27752
|
+
url: external_exports.string().url().max(2e3),
|
|
27753
|
+
title: external_exports.string().max(500).optional(),
|
|
27754
|
+
state: issuePullRequestStateSchema.optional(),
|
|
27755
|
+
pull_request_id: external_exports.string().uuid().optional(),
|
|
27756
|
+
client_mutation_id: clientMutationId
|
|
27757
|
+
});
|
|
27758
|
+
updateIssuePullRequestRequestSchema = external_exports.object({
|
|
27759
|
+
state: issuePullRequestStateSchema,
|
|
27760
|
+
client_mutation_id: clientMutationId
|
|
27761
|
+
});
|
|
27762
|
+
issueMutationRequestSchema = external_exports.object({ client_mutation_id: clientMutationId });
|
|
27763
|
+
updateIssueSettingsRequestSchema = external_exports.object({ issue_key: external_exports.string().trim().toUpperCase().regex(ISSUE_KEY_RE) });
|
|
27764
|
+
listIssuesQuerySchema = external_exports.object({
|
|
27765
|
+
status: external_exports.string().optional(),
|
|
27766
|
+
priority: external_exports.string().optional(),
|
|
27767
|
+
assignee: external_exports.string().optional(),
|
|
27768
|
+
subscriber: external_exports.string().optional(),
|
|
27769
|
+
creator: external_exports.string().optional(),
|
|
27770
|
+
manager_id: external_exports.string().optional(),
|
|
27771
|
+
parent_id: external_exports.string().optional(),
|
|
27772
|
+
q: external_exports.string().max(200).optional(),
|
|
27773
|
+
include_archived: external_exports.enum(["true", "false"]).optional(),
|
|
27774
|
+
limit: external_exports.coerce.number().int().min(1).max(200).optional(),
|
|
27775
|
+
cursor: external_exports.coerce.number().int().min(0).max(2147483647).optional()
|
|
27776
|
+
});
|
|
27777
|
+
issueDetailResponseSchema = external_exports.object({
|
|
27778
|
+
issue: issueSchema,
|
|
27779
|
+
subscribers: external_exports.array(issueSubscriberSchema),
|
|
27780
|
+
relations: external_exports.array(issueRelationSchema),
|
|
27781
|
+
pull_requests: external_exports.array(issuePullRequestSchema),
|
|
27782
|
+
comments: external_exports.array(issueCommentSchema),
|
|
27783
|
+
events: external_exports.array(issueEventSchema),
|
|
27784
|
+
sub_issues: external_exports.array(issueSchema)
|
|
27785
|
+
});
|
|
27786
|
+
listIssuesResponseSchema = external_exports.object({ issues: external_exports.array(issueSchema), next_cursor: external_exports.number().nullable() });
|
|
27787
|
+
issuesDeltaQuerySchema = external_exports.object({
|
|
27788
|
+
after: external_exports.coerce.number().int().min(0).max(Number.MAX_SAFE_INTEGER),
|
|
27789
|
+
limit: external_exports.coerce.number().int().min(1).max(1e3).optional()
|
|
27790
|
+
});
|
|
27791
|
+
issueInboxQuerySchema = external_exports.object({
|
|
27792
|
+
limit: external_exports.coerce.number().int().min(1).max(100).optional(),
|
|
27793
|
+
before: external_exports.coerce.number().int().min(1).optional()
|
|
27794
|
+
});
|
|
27795
|
+
markIssueInboxReadRequestSchema = external_exports.object({ sync_id: external_exports.number().int().min(0).optional() });
|
|
27796
|
+
ISSUE_COMMANDS = {
|
|
27797
|
+
create: "create",
|
|
27798
|
+
update: "update",
|
|
27799
|
+
get: "get",
|
|
27800
|
+
list: "list",
|
|
27801
|
+
comment: "comment",
|
|
27802
|
+
assign: "assign",
|
|
27803
|
+
unassign: "unassign",
|
|
27804
|
+
subscribe: "subscribe",
|
|
27805
|
+
unsubscribe: "unsubscribe",
|
|
27806
|
+
linkPr: "link-pr",
|
|
27807
|
+
relate: "relate"
|
|
27808
|
+
};
|
|
27809
|
+
}
|
|
27810
|
+
});
|
|
27811
|
+
|
|
27812
|
+
// ../shared/src/issue-events.ts
|
|
27813
|
+
function parseChange(line, excerpt) {
|
|
27814
|
+
const match = line.match(CHANGE_LINE);
|
|
27815
|
+
const rest = (match ? match[3] + match[4] : line).replaceAll(" (agent)", "").replace(/(?:\. Now)?:$/, "");
|
|
27816
|
+
const [, field2, from, to] = rest.match(TRANSITION) ?? [];
|
|
27817
|
+
const transition = transitionSchema.safeParse({ field: field2, from, to }).data;
|
|
27818
|
+
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]];
|
|
27819
|
+
const text4 = transition ? `changed the ${transition.field}: ${labels.join(" \u2192 ")}` : rest;
|
|
27820
|
+
return { actor: match?.[1] ?? "", agent: Boolean(match?.[2]), text: excerpt ? `${text4}: ${excerpt}` : text4, ...transition ? { transition } : {} };
|
|
27821
|
+
}
|
|
27822
|
+
function extractIssueEvents(text4) {
|
|
27823
|
+
return [...text4.matchAll(tagBlockPattern(ISSUE_EVENT_TAG))].flatMap((match) => {
|
|
27824
|
+
const attributes = parseTagAttributes(match[1]);
|
|
27825
|
+
if (!attributes.issue) return [];
|
|
27826
|
+
const detail = match[2].replaceAll(`<\\/${ISSUE_EVENT_TAG}`, `</${ISSUE_EVENT_TAG}`).trim();
|
|
27827
|
+
const changes = detail.split("\n\n").flatMap((paragraph) => {
|
|
27828
|
+
const [line, ...quoted] = paragraph.split("\n");
|
|
27829
|
+
if (!line.trim() || line.startsWith(">")) return [];
|
|
27830
|
+
return [parseChange(line, line.endsWith(". Now:") ? void 0 : quoted.map((quote) => quote.replace(/^>\s?/, "").trim()).find(Boolean))];
|
|
27831
|
+
});
|
|
27832
|
+
return [{
|
|
27833
|
+
id: `${attributes.issue}:${attributes.sync_id ?? ""}`,
|
|
27834
|
+
at: "",
|
|
27835
|
+
kind: "issue",
|
|
27836
|
+
agentId: attributes.issue,
|
|
27837
|
+
agentName: attributes.issue,
|
|
27838
|
+
summary: changes.map(issueChangeSentence).join(" \xB7 "),
|
|
27839
|
+
...detail ? { detail } : {},
|
|
27840
|
+
issue: { title: attributes.title ?? "", url: attributes.url ?? "", changes }
|
|
27841
|
+
}];
|
|
27842
|
+
});
|
|
27843
|
+
}
|
|
27844
|
+
var ISSUE_EVENT_TAG, transitionSchema, issueEventChangeSchema, CHANGE_LINE, TRANSITION, issueChangeSentence;
|
|
27845
|
+
var init_issue_events = __esm({
|
|
27846
|
+
"../shared/src/issue-events.ts"() {
|
|
27847
|
+
"use strict";
|
|
27848
|
+
init_zod();
|
|
27849
|
+
init_issues2();
|
|
27850
|
+
init_tag_blocks();
|
|
27851
|
+
ISSUE_EVENT_TAG = "issue_event";
|
|
27852
|
+
transitionSchema = external_exports.discriminatedUnion("field", [
|
|
27853
|
+
external_exports.object({ field: external_exports.literal("status"), from: issueStatusSchema, to: issueStatusSchema }),
|
|
27854
|
+
external_exports.object({ field: external_exports.literal("priority"), from: issuePrioritySchema, to: issuePrioritySchema })
|
|
27855
|
+
]);
|
|
27856
|
+
issueEventChangeSchema = external_exports.object({ actor: external_exports.string(), agent: external_exports.boolean(), text: external_exports.string(), transition: transitionSchema.optional() });
|
|
27857
|
+
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)(.*)$/;
|
|
27858
|
+
TRANSITION = /^changed the (status|priority): (\w+) → (\w+)$/;
|
|
27859
|
+
issueChangeSentence = (change2) => [change2.actor, change2.text].filter(Boolean).join(" ");
|
|
27860
|
+
}
|
|
27861
|
+
});
|
|
27862
|
+
|
|
27552
27863
|
// ../shared/src/manager-events.ts
|
|
27553
27864
|
function extractManagerEvents(text4) {
|
|
27554
27865
|
return [...text4.matchAll(BLOCK)].flatMap((match) => {
|
|
27555
|
-
const attributes =
|
|
27866
|
+
const attributes = parseTagAttributes(match[1]);
|
|
27556
27867
|
if (!attributes.kind || !attributes.id || !attributes.agent_id) return [];
|
|
27557
27868
|
const kind = MANAGER_EVENT_KINDS.find((candidate) => candidate === attributes.kind) ?? UNKNOWN_EVENT_KIND;
|
|
27558
27869
|
const [summary, ...rest] = match[2].replaceAll(`<\\/${TAG}`, `</${TAG}`).split("\n\n");
|
|
@@ -27572,13 +27883,13 @@ function extractManagerEvents(text4) {
|
|
|
27572
27883
|
});
|
|
27573
27884
|
}
|
|
27574
27885
|
function parseManagerEvents(text4) {
|
|
27575
|
-
const events = extractManagerEvents(text4);
|
|
27576
|
-
return events.length > 0 && text4.replace(BLOCK, "").replaceAll(MERGED_MESSAGE_SEPARATOR.trim(), "").trim() === "" ? events : null;
|
|
27886
|
+
const events = [...extractManagerEvents(text4), ...extractIssueEvents(text4)];
|
|
27887
|
+
return events.length > 0 && text4.replace(BLOCK, "").replace(ISSUE_BLOCK, "").replaceAll(MERGED_MESSAGE_SEPARATOR.trim(), "").trim() === "" ? events : null;
|
|
27577
27888
|
}
|
|
27578
27889
|
function stripManagerEventNotes(content) {
|
|
27579
|
-
return stripInstructionBlocksOutside(content, [...content.matchAll(BLOCK)].map((block) => [block.index, block.index + block[0].length]));
|
|
27890
|
+
return stripInstructionBlocksOutside(content, [...content.matchAll(BLOCK), ...content.matchAll(ISSUE_BLOCK)].map((block) => [block.index, block.index + block[0].length]));
|
|
27580
27891
|
}
|
|
27581
|
-
var MANAGER_EVENT_KINDS, UNKNOWN_EVENT_KIND, MANAGER_EVENT_TYPE, managerEventSchema, TAG, BLOCK,
|
|
27892
|
+
var MANAGER_EVENT_KINDS, UNKNOWN_EVENT_KIND, MANAGER_EVENT_TYPE, managerEventSchema, TAG, BLOCK, ISSUE_BLOCK;
|
|
27582
27893
|
var init_manager_events = __esm({
|
|
27583
27894
|
"../shared/src/manager-events.ts"() {
|
|
27584
27895
|
"use strict";
|
|
@@ -27587,13 +27898,15 @@ var init_manager_events = __esm({
|
|
|
27587
27898
|
init_prompts();
|
|
27588
27899
|
init_message_origin();
|
|
27589
27900
|
init_urls();
|
|
27901
|
+
init_tag_blocks();
|
|
27902
|
+
init_issue_events();
|
|
27590
27903
|
MANAGER_EVENT_KINDS = ["finished", "ready", "needs_attention", "approved", "merged", "closed", "archived", "replied"];
|
|
27591
27904
|
UNKNOWN_EVENT_KIND = "update";
|
|
27592
27905
|
MANAGER_EVENT_TYPE = "multitask-event";
|
|
27593
27906
|
managerEventSchema = external_exports.object({
|
|
27594
27907
|
id: external_exports.string(),
|
|
27595
27908
|
at: external_exports.string(),
|
|
27596
|
-
kind: external_exports.enum([...MANAGER_EVENT_KINDS, UNKNOWN_EVENT_KIND]),
|
|
27909
|
+
kind: external_exports.enum([...MANAGER_EVENT_KINDS, UNKNOWN_EVENT_KIND, "issue"]),
|
|
27597
27910
|
agentId: external_exports.string(),
|
|
27598
27911
|
agentName: external_exports.string(),
|
|
27599
27912
|
summary: external_exports.string(),
|
|
@@ -27601,13 +27914,13 @@ var init_manager_events = __esm({
|
|
|
27601
27914
|
// Set when the subagent is a chat in this workspace rather than a ship; agentId is then that chat's id.
|
|
27602
27915
|
chatId: external_exports.string().optional(),
|
|
27603
27916
|
ticket: external_exports.object({ id: external_exports.string(), title: external_exports.string() }).optional(),
|
|
27917
|
+
issue: external_exports.object({ title: external_exports.string(), url: external_exports.string(), changes: external_exports.array(issueEventChangeSchema) }).optional(),
|
|
27604
27918
|
// Set on events recorded before every kind woke the orchestrator, which were shown as a row when they happened.
|
|
27605
27919
|
noticed: external_exports.boolean().optional()
|
|
27606
27920
|
});
|
|
27607
|
-
TAG =
|
|
27608
|
-
BLOCK =
|
|
27609
|
-
|
|
27610
|
-
unescapeAttribute = (value) => value.replace(/</g, "<").replace(/"/g, '"').replace(/&/g, "&");
|
|
27921
|
+
TAG = MULTITASK_EVENT_TAG;
|
|
27922
|
+
BLOCK = tagBlockPattern(TAG);
|
|
27923
|
+
ISSUE_BLOCK = tagBlockPattern(ISSUE_EVENT_TAG);
|
|
27611
27924
|
}
|
|
27612
27925
|
});
|
|
27613
27926
|
|
|
@@ -35708,7 +36021,7 @@ var init_workspace_target = __esm({
|
|
|
35708
36021
|
});
|
|
35709
36022
|
|
|
35710
36023
|
// ../shared/src/manager-board.ts
|
|
35711
|
-
var MANAGER_TICKET_LIMITS, L, tooLong, text3, clearable, httpsUrl, inlineMarkdown, markdown, linearIdentifier, mediaSchema, questionSchema, managerTicketTitleSchema, managerTicketTaskSchema, managerTicketMediaSchema, managerTicketQuestionsSchema,
|
|
36024
|
+
var MANAGER_TICKET_LIMITS, L, tooLong, text3, clearable, httpsUrl, inlineMarkdown, markdown, linearIdentifier, mediaSchema, questionSchema, managerTicketTitleSchema, managerTicketTaskSchema, managerTicketMediaSchema, managerTicketQuestionsSchema, issueSchema2, fixSchema, updateManagerTicketRequestSchema, updateManagerBoardRequestSchema, answerManagerTicketRequestSchema, managerTicketAnswerRefSchema, replyOnManagerTicketRequestSchema, managerTicketReplyRefSchema, managerTicketThreadSchema, LINEAR_ISSUE_SUMMARIES_MAX, linearIssueSummariesRequestSchema;
|
|
35712
36025
|
var init_manager_board = __esm({
|
|
35713
36026
|
"../shared/src/manager-board.ts"() {
|
|
35714
36027
|
"use strict";
|
|
@@ -35755,11 +36068,11 @@ var init_manager_board = __esm({
|
|
|
35755
36068
|
managerTicketTaskSchema = text3(L.task);
|
|
35756
36069
|
managerTicketMediaSchema = external_exports.array(mediaSchema);
|
|
35757
36070
|
managerTicketQuestionsSchema = external_exports.array(questionSchema.extend({ id: external_exports.string() }));
|
|
35758
|
-
|
|
36071
|
+
issueSchema2 = 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.`);
|
|
35759
36072
|
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.`);
|
|
35760
36073
|
updateManagerTicketRequestSchema = external_exports.object({
|
|
35761
36074
|
title: managerTicketTitleSchema.optional(),
|
|
35762
|
-
issue:
|
|
36075
|
+
issue: issueSchema2,
|
|
35763
36076
|
fix: fixSchema,
|
|
35764
36077
|
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.`),
|
|
35765
36078
|
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.`),
|
|
@@ -35770,7 +36083,7 @@ var init_manager_board = __esm({
|
|
|
35770
36083
|
tickets: external_exports.array(external_exports.object({
|
|
35771
36084
|
id: external_exports.uuid(),
|
|
35772
36085
|
title: managerTicketTitleSchema.optional(),
|
|
35773
|
-
issue:
|
|
36086
|
+
issue: issueSchema2,
|
|
35774
36087
|
fix: fixSchema,
|
|
35775
36088
|
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."),
|
|
35776
36089
|
note: clearable(text3(L.note)).describe(`Your one short comment on the ticket, shown under its row, replacing the last. ${inlineMarkdown}. "" removes it. At most ${L.note} characters.`),
|
|
@@ -39392,7 +39705,19 @@ var init_keyboard_shortcuts = __esm({
|
|
|
39392
39705
|
copyPullRequestGitHubLink: { label: "Copy GitHub link", group: "Review", prefix: "c", keys: { key: "g" } },
|
|
39393
39706
|
copyPullRequest: { label: "Copy PR", group: "Review", prefix: "c", keys: { key: "p" } },
|
|
39394
39707
|
openReviewChat: { label: "Start chat", group: "Review", keys: { key: ";", mod: true } },
|
|
39395
|
-
mergePullRequest: { label: "Merge", group: "Review", keys: { key: "m" } }
|
|
39708
|
+
mergePullRequest: { label: "Merge", group: "Review", keys: { key: "m" } },
|
|
39709
|
+
createIssue: { label: "Create issue", group: "Issues", keys: { key: "c" } },
|
|
39710
|
+
setIssueStatus: { label: "Change status", group: "Issues", keys: { key: "s" } },
|
|
39711
|
+
setIssuePriority: { label: "Change priority", group: "Issues", keys: { key: "p" } },
|
|
39712
|
+
setIssueAssignees: { label: "Assign", group: "Issues", keys: { key: "a" } },
|
|
39713
|
+
nextIssue: { label: "Next issue", group: "Issues", keys: { key: "j" } },
|
|
39714
|
+
previousIssue: { label: "Previous issue", group: "Issues", keys: { key: "k" } },
|
|
39715
|
+
openIssue: { label: "Open issue", group: "Issues", keys: { key: "Enter" } },
|
|
39716
|
+
peekIssue: { label: "Peek issue", group: "Issues", keys: { key: " " } },
|
|
39717
|
+
selectIssue: { label: "Select issue", group: "Issues", keys: { key: "x" } },
|
|
39718
|
+
toggleIssueLayout: { label: "Switch list / board", group: "Issues", keys: { key: "b", mod: true, shift: true } },
|
|
39719
|
+
copyIssueIdentifier: { label: "Copy issue ID", group: "Issues", keys: { key: ".", mod: true } },
|
|
39720
|
+
copyIssueLink: { label: "Copy issue link", group: "Issues", keys: { key: ",", mod: true, shift: true } }
|
|
39396
39721
|
};
|
|
39397
39722
|
COMPOSER_SEND_SHORTCUTS = {
|
|
39398
39723
|
enter: { send: KEYBOARD_SHORTCUTS.send, sendAlternate: KEYBOARD_SHORTCUTS.sendAlternate, newLine: KEYBOARD_SHORTCUTS.newLine },
|
|
@@ -39827,7 +40152,7 @@ var CLI_VERSION;
|
|
|
39827
40152
|
var init_cli_version = __esm({
|
|
39828
40153
|
"../shared/src/cli-version.ts"() {
|
|
39829
40154
|
"use strict";
|
|
39830
|
-
CLI_VERSION = "0.3.
|
|
40155
|
+
CLI_VERSION = "0.3.507";
|
|
39831
40156
|
}
|
|
39832
40157
|
});
|
|
39833
40158
|
|
|
@@ -50397,238 +50722,6 @@ var init_feature_flags = __esm({
|
|
|
50397
50722
|
}
|
|
50398
50723
|
});
|
|
50399
50724
|
|
|
50400
|
-
// ../shared/src/routes/issues.ts
|
|
50401
|
-
var ISSUE_STATUSES, ISSUE_PRIORITIES, ISSUE_ACTOR_TYPES, ISSUE_SUBSCRIBER_ROLES, ISSUE_RELATION_TYPES, ISSUE_PULL_REQUEST_STATES, issueStatusSchema, issuePrioritySchema, issueSubscriberRoleSchema, issueRelationTypeSchema, issuePullRequestStateSchema, issueActorSchema, ISSUE_KEY_RE, timestamp, nullableTimestamp, issueSchema2, issueSubscriberSchema, issueRelationSchema, issuePullRequestSchema, issueCommentSchema, change, nullableId, ISSUE_EVENT_TYPES, issueEventDataSchemas, issueEventBase, issueEventVariant, issueEventSchema, clientMutationId, title2, description, body, createIssueRequestSchema, updateIssueRequestSchema, issueActorRequestSchema, createIssueCommentRequestSchema, updateIssueCommentRequestSchema, createIssueRelationRequestSchema, linkIssuePullRequestRequestSchema, updateIssuePullRequestRequestSchema, issueMutationRequestSchema, updateIssueSettingsRequestSchema, listIssuesQuerySchema, issueDetailResponseSchema, listIssuesResponseSchema, issuesDeltaQuerySchema, issueInboxQuerySchema, markIssueInboxReadRequestSchema;
|
|
50402
|
-
var init_issues2 = __esm({
|
|
50403
|
-
"../shared/src/routes/issues.ts"() {
|
|
50404
|
-
"use strict";
|
|
50405
|
-
init_zod();
|
|
50406
|
-
ISSUE_STATUSES = ["backlog", "todo", "in_progress", "in_review", "done", "canceled", "duplicate"];
|
|
50407
|
-
ISSUE_PRIORITIES = ["none", "urgent", "high", "medium", "low"];
|
|
50408
|
-
ISSUE_ACTOR_TYPES = ["user", "workspace"];
|
|
50409
|
-
ISSUE_SUBSCRIBER_ROLES = ["assignee", "creator", "mentioned", "manual"];
|
|
50410
|
-
ISSUE_RELATION_TYPES = ["blocks", "duplicate_of"];
|
|
50411
|
-
ISSUE_PULL_REQUEST_STATES = ["draft", "open", "merged", "closed"];
|
|
50412
|
-
issueStatusSchema = external_exports.enum(ISSUE_STATUSES);
|
|
50413
|
-
issuePrioritySchema = external_exports.enum(ISSUE_PRIORITIES);
|
|
50414
|
-
issueSubscriberRoleSchema = external_exports.enum(ISSUE_SUBSCRIBER_ROLES);
|
|
50415
|
-
issueRelationTypeSchema = external_exports.enum(ISSUE_RELATION_TYPES);
|
|
50416
|
-
issuePullRequestStateSchema = external_exports.enum(ISSUE_PULL_REQUEST_STATES);
|
|
50417
|
-
issueActorSchema = external_exports.object({
|
|
50418
|
-
type: external_exports.enum(ISSUE_ACTOR_TYPES),
|
|
50419
|
-
id: external_exports.string().toLowerCase().uuid()
|
|
50420
|
-
});
|
|
50421
|
-
ISSUE_KEY_RE = /^[A-Z][A-Z0-9]{0,9}$/;
|
|
50422
|
-
timestamp = external_exports.string();
|
|
50423
|
-
nullableTimestamp = timestamp.nullable();
|
|
50424
|
-
issueSchema2 = external_exports.object({
|
|
50425
|
-
id: external_exports.string().uuid(),
|
|
50426
|
-
organization_id: external_exports.string().uuid(),
|
|
50427
|
-
number: external_exports.number().int(),
|
|
50428
|
-
identifier: external_exports.string(),
|
|
50429
|
-
title: external_exports.string(),
|
|
50430
|
-
description: external_exports.string(),
|
|
50431
|
-
status: issueStatusSchema,
|
|
50432
|
-
priority: issuePrioritySchema,
|
|
50433
|
-
parent_id: external_exports.string().uuid().nullable(),
|
|
50434
|
-
manager_id: external_exports.string().uuid().nullable(),
|
|
50435
|
-
creator: issueActorSchema,
|
|
50436
|
-
/** Fractional: to move an issue between two others, send the midpoint of their sort orders. */
|
|
50437
|
-
sort_order: external_exports.number(),
|
|
50438
|
-
created_at: timestamp,
|
|
50439
|
-
updated_at: timestamp,
|
|
50440
|
-
completed_at: nullableTimestamp,
|
|
50441
|
-
canceled_at: nullableTimestamp,
|
|
50442
|
-
archived_at: nullableTimestamp
|
|
50443
|
-
});
|
|
50444
|
-
issueSubscriberSchema = external_exports.object({
|
|
50445
|
-
issue_id: external_exports.string().uuid(),
|
|
50446
|
-
subscriber: issueActorSchema,
|
|
50447
|
-
role: issueSubscriberRoleSchema,
|
|
50448
|
-
created_at: timestamp
|
|
50449
|
-
});
|
|
50450
|
-
issueRelationSchema = external_exports.object({
|
|
50451
|
-
id: external_exports.string().uuid(),
|
|
50452
|
-
type: issueRelationTypeSchema,
|
|
50453
|
-
issue_id: external_exports.string().uuid(),
|
|
50454
|
-
related_issue_id: external_exports.string().uuid(),
|
|
50455
|
-
created_at: timestamp
|
|
50456
|
-
});
|
|
50457
|
-
issuePullRequestSchema = external_exports.object({
|
|
50458
|
-
id: external_exports.string().uuid(),
|
|
50459
|
-
issue_id: external_exports.string().uuid(),
|
|
50460
|
-
url: external_exports.string(),
|
|
50461
|
-
pull_request_id: external_exports.string().uuid().nullable(),
|
|
50462
|
-
title: external_exports.string().nullable(),
|
|
50463
|
-
state: issuePullRequestStateSchema,
|
|
50464
|
-
created_at: timestamp,
|
|
50465
|
-
updated_at: timestamp
|
|
50466
|
-
});
|
|
50467
|
-
issueCommentSchema = external_exports.object({
|
|
50468
|
-
id: external_exports.string().uuid(),
|
|
50469
|
-
issue_id: external_exports.string().uuid(),
|
|
50470
|
-
author: issueActorSchema,
|
|
50471
|
-
body: external_exports.string(),
|
|
50472
|
-
created_at: timestamp,
|
|
50473
|
-
updated_at: timestamp
|
|
50474
|
-
});
|
|
50475
|
-
change = (value) => external_exports.object({ from: value, to: value });
|
|
50476
|
-
nullableId = external_exports.string().uuid().nullable();
|
|
50477
|
-
ISSUE_EVENT_TYPES = [
|
|
50478
|
-
"created",
|
|
50479
|
-
"title_changed",
|
|
50480
|
-
"description_changed",
|
|
50481
|
-
"status_changed",
|
|
50482
|
-
"priority_changed",
|
|
50483
|
-
"parent_changed",
|
|
50484
|
-
"manager_changed",
|
|
50485
|
-
"sort_order_changed",
|
|
50486
|
-
"assignee_added",
|
|
50487
|
-
"assignee_removed",
|
|
50488
|
-
"subscriber_added",
|
|
50489
|
-
"subscriber_removed",
|
|
50490
|
-
"relation_added",
|
|
50491
|
-
"relation_removed",
|
|
50492
|
-
"pr_linked",
|
|
50493
|
-
"pr_unlinked",
|
|
50494
|
-
"pr_state_changed",
|
|
50495
|
-
"comment_added",
|
|
50496
|
-
"comment_edited",
|
|
50497
|
-
"comment_deleted",
|
|
50498
|
-
"archived",
|
|
50499
|
-
"restored"
|
|
50500
|
-
];
|
|
50501
|
-
issueEventDataSchemas = {
|
|
50502
|
-
created: external_exports.object({ issue: issueSchema2 }),
|
|
50503
|
-
title_changed: change(external_exports.string()),
|
|
50504
|
-
description_changed: change(external_exports.string()),
|
|
50505
|
-
status_changed: change(issueStatusSchema).extend({ completed_at: nullableTimestamp, canceled_at: nullableTimestamp }),
|
|
50506
|
-
priority_changed: change(issuePrioritySchema),
|
|
50507
|
-
parent_changed: change(nullableId),
|
|
50508
|
-
manager_changed: change(nullableId),
|
|
50509
|
-
sort_order_changed: change(external_exports.number()),
|
|
50510
|
-
/** `subscriber` is the row after the change: an unassigned principal stays subscribed with role `manual`. */
|
|
50511
|
-
assignee_added: external_exports.object({ subscriber: issueSubscriberSchema }),
|
|
50512
|
-
assignee_removed: external_exports.object({ subscriber: issueSubscriberSchema }),
|
|
50513
|
-
subscriber_added: external_exports.object({ subscriber: issueSubscriberSchema }),
|
|
50514
|
-
subscriber_removed: external_exports.object({ subscriber: issueSubscriberSchema }),
|
|
50515
|
-
relation_added: external_exports.object({ relation: issueRelationSchema }),
|
|
50516
|
-
relation_removed: external_exports.object({ relation: issueRelationSchema }),
|
|
50517
|
-
pr_linked: external_exports.object({ pull_request: issuePullRequestSchema }),
|
|
50518
|
-
pr_unlinked: external_exports.object({ pull_request: issuePullRequestSchema }),
|
|
50519
|
-
pr_state_changed: external_exports.object({ pull_request: issuePullRequestSchema, from: issuePullRequestStateSchema }),
|
|
50520
|
-
comment_added: external_exports.object({ comment: issueCommentSchema }),
|
|
50521
|
-
comment_edited: external_exports.object({ comment: issueCommentSchema, from: external_exports.string() }),
|
|
50522
|
-
comment_deleted: external_exports.object({ comment: issueCommentSchema }),
|
|
50523
|
-
archived: external_exports.object({ archived_at: timestamp }),
|
|
50524
|
-
restored: external_exports.object({
|
|
50525
|
-
issue: issueSchema2,
|
|
50526
|
-
subscribers: external_exports.array(issueSubscriberSchema),
|
|
50527
|
-
relations: external_exports.array(issueRelationSchema),
|
|
50528
|
-
pull_requests: external_exports.array(issuePullRequestSchema)
|
|
50529
|
-
})
|
|
50530
|
-
};
|
|
50531
|
-
issueEventBase = external_exports.object({
|
|
50532
|
-
sync_id: external_exports.number().int(),
|
|
50533
|
-
issue_id: external_exports.string().uuid(),
|
|
50534
|
-
actor: issueActorSchema,
|
|
50535
|
-
/** Echo of the `client_mutation_id` sent with the write, so the writer can settle its optimistic change. */
|
|
50536
|
-
client_mutation_id: external_exports.string().nullable(),
|
|
50537
|
-
created_at: timestamp
|
|
50538
|
-
});
|
|
50539
|
-
issueEventVariant = (type) => issueEventBase.extend({ type: external_exports.literal(type), data: issueEventDataSchemas[type] });
|
|
50540
|
-
issueEventSchema = external_exports.discriminatedUnion("type", [issueEventVariant(ISSUE_EVENT_TYPES[0]), ...ISSUE_EVENT_TYPES.slice(1).map(issueEventVariant)]);
|
|
50541
|
-
clientMutationId = external_exports.string().min(1).max(128).optional();
|
|
50542
|
-
title2 = external_exports.string().trim().min(1).max(500);
|
|
50543
|
-
description = external_exports.string().max(1e5);
|
|
50544
|
-
body = external_exports.string().trim().min(1).max(1e5);
|
|
50545
|
-
createIssueRequestSchema = external_exports.object({
|
|
50546
|
-
/** Client-generated id, so an optimistic create can be referenced before the server answers. */
|
|
50547
|
-
id: external_exports.string().uuid().optional(),
|
|
50548
|
-
title: title2,
|
|
50549
|
-
description: description.optional(),
|
|
50550
|
-
status: issueStatusSchema.optional(),
|
|
50551
|
-
priority: issuePrioritySchema.optional(),
|
|
50552
|
-
parent_id: external_exports.string().uuid().optional(),
|
|
50553
|
-
manager_id: external_exports.string().uuid().optional(),
|
|
50554
|
-
sort_order: external_exports.number().finite().optional(),
|
|
50555
|
-
assignees: external_exports.array(issueActorSchema).max(20).optional(),
|
|
50556
|
-
subscribers: external_exports.array(issueActorSchema).max(50).optional(),
|
|
50557
|
-
client_mutation_id: clientMutationId
|
|
50558
|
-
});
|
|
50559
|
-
updateIssueRequestSchema = external_exports.object({
|
|
50560
|
-
title: title2.optional(),
|
|
50561
|
-
description: description.optional(),
|
|
50562
|
-
status: issueStatusSchema.optional(),
|
|
50563
|
-
priority: issuePrioritySchema.optional(),
|
|
50564
|
-
// PATCH semantics: null clears the parent or Manager, omitting it leaves it unchanged.
|
|
50565
|
-
parent_id: nullableId.optional(),
|
|
50566
|
-
manager_id: nullableId.optional(),
|
|
50567
|
-
sort_order: external_exports.number().finite().optional(),
|
|
50568
|
-
client_mutation_id: clientMutationId
|
|
50569
|
-
});
|
|
50570
|
-
issueActorRequestSchema = issueActorSchema.partial().extend({ client_mutation_id: clientMutationId });
|
|
50571
|
-
createIssueCommentRequestSchema = external_exports.object({
|
|
50572
|
-
id: external_exports.string().uuid().optional(),
|
|
50573
|
-
body,
|
|
50574
|
-
client_mutation_id: clientMutationId
|
|
50575
|
-
});
|
|
50576
|
-
updateIssueCommentRequestSchema = external_exports.object({ body, client_mutation_id: clientMutationId });
|
|
50577
|
-
createIssueRelationRequestSchema = external_exports.object({
|
|
50578
|
-
id: external_exports.string().uuid().optional(),
|
|
50579
|
-
type: issueRelationTypeSchema,
|
|
50580
|
-
related_issue: external_exports.string().min(1),
|
|
50581
|
-
client_mutation_id: clientMutationId
|
|
50582
|
-
});
|
|
50583
|
-
linkIssuePullRequestRequestSchema = external_exports.object({
|
|
50584
|
-
id: external_exports.string().uuid().optional(),
|
|
50585
|
-
url: external_exports.string().url().max(2e3),
|
|
50586
|
-
title: external_exports.string().max(500).optional(),
|
|
50587
|
-
state: issuePullRequestStateSchema.optional(),
|
|
50588
|
-
pull_request_id: external_exports.string().uuid().optional(),
|
|
50589
|
-
client_mutation_id: clientMutationId
|
|
50590
|
-
});
|
|
50591
|
-
updateIssuePullRequestRequestSchema = external_exports.object({
|
|
50592
|
-
state: issuePullRequestStateSchema,
|
|
50593
|
-
client_mutation_id: clientMutationId
|
|
50594
|
-
});
|
|
50595
|
-
issueMutationRequestSchema = external_exports.object({ client_mutation_id: clientMutationId });
|
|
50596
|
-
updateIssueSettingsRequestSchema = external_exports.object({ issue_key: external_exports.string().trim().toUpperCase().regex(ISSUE_KEY_RE) });
|
|
50597
|
-
listIssuesQuerySchema = external_exports.object({
|
|
50598
|
-
status: external_exports.string().optional(),
|
|
50599
|
-
priority: external_exports.string().optional(),
|
|
50600
|
-
assignee: external_exports.string().optional(),
|
|
50601
|
-
subscriber: external_exports.string().optional(),
|
|
50602
|
-
creator: external_exports.string().optional(),
|
|
50603
|
-
manager_id: external_exports.string().optional(),
|
|
50604
|
-
parent_id: external_exports.string().optional(),
|
|
50605
|
-
q: external_exports.string().max(200).optional(),
|
|
50606
|
-
include_archived: external_exports.enum(["true", "false"]).optional(),
|
|
50607
|
-
limit: external_exports.coerce.number().int().min(1).max(200).optional(),
|
|
50608
|
-
cursor: external_exports.coerce.number().int().min(0).max(2147483647).optional()
|
|
50609
|
-
});
|
|
50610
|
-
issueDetailResponseSchema = external_exports.object({
|
|
50611
|
-
issue: issueSchema2,
|
|
50612
|
-
subscribers: external_exports.array(issueSubscriberSchema),
|
|
50613
|
-
relations: external_exports.array(issueRelationSchema),
|
|
50614
|
-
pull_requests: external_exports.array(issuePullRequestSchema),
|
|
50615
|
-
comments: external_exports.array(issueCommentSchema),
|
|
50616
|
-
events: external_exports.array(issueEventSchema),
|
|
50617
|
-
sub_issues: external_exports.array(issueSchema2)
|
|
50618
|
-
});
|
|
50619
|
-
listIssuesResponseSchema = external_exports.object({ issues: external_exports.array(issueSchema2), next_cursor: external_exports.number().nullable() });
|
|
50620
|
-
issuesDeltaQuerySchema = external_exports.object({
|
|
50621
|
-
after: external_exports.coerce.number().int().min(0).max(Number.MAX_SAFE_INTEGER),
|
|
50622
|
-
limit: external_exports.coerce.number().int().min(1).max(1e3).optional()
|
|
50623
|
-
});
|
|
50624
|
-
issueInboxQuerySchema = external_exports.object({
|
|
50625
|
-
limit: external_exports.coerce.number().int().min(1).max(100).optional(),
|
|
50626
|
-
before: external_exports.coerce.number().int().min(1).optional()
|
|
50627
|
-
});
|
|
50628
|
-
markIssueInboxReadRequestSchema = external_exports.object({ sync_id: external_exports.number().int().min(0).optional() });
|
|
50629
|
-
}
|
|
50630
|
-
});
|
|
50631
|
-
|
|
50632
50725
|
// ../shared/src/routes/repo-files.ts
|
|
50633
50726
|
var MAX_REPO_FILE_CONTENT_BYTES;
|
|
50634
50727
|
var init_repo_files = __esm({
|
|
@@ -51055,6 +51148,8 @@ var init_src = __esm({
|
|
|
51055
51148
|
init_slash_commands();
|
|
51056
51149
|
init_keyboard_shortcuts();
|
|
51057
51150
|
init_prompts();
|
|
51151
|
+
init_issue_events();
|
|
51152
|
+
init_tag_blocks();
|
|
51058
51153
|
init_manager_events();
|
|
51059
51154
|
init_message_origin();
|
|
51060
51155
|
init_user_message_attachments();
|
|
@@ -56549,22 +56644,12 @@ var init_media_gif = __esm({
|
|
|
56549
56644
|
// src/commands/issue.ts
|
|
56550
56645
|
async function callIssueTool(name, args, schema) {
|
|
56551
56646
|
if (!isAgentMode() && !getApiKey()) throw new Error("replicas issue needs an API key: run `replicas login --api-key`, or use it inside a workspace.");
|
|
56552
|
-
|
|
56553
|
-
|
|
56554
|
-
|
|
56555
|
-
|
|
56556
|
-
|
|
56557
|
-
});
|
|
56558
|
-
const text4 = await response.text();
|
|
56559
|
-
if (!response.ok) throw new Error(`Request failed (${response.status}): ${text4}`);
|
|
56560
|
-
const payload = text4.split("\n").filter((line) => line.startsWith("data:")).map((line) => line.slice(5)).at(-1) ?? text4;
|
|
56561
|
-
const message2 = toolMessageSchema.parse(JSON.parse(payload));
|
|
56562
|
-
if (message2.error) {
|
|
56563
|
-
throw new Error(/Tool .* not found/i.test(message2.error.message) ? "Issues are not enabled for this organization" : message2.error.message);
|
|
56647
|
+
try {
|
|
56648
|
+
return schema.parse(await orgAuthenticatedFetch(`/v1/issue-commands/${name}`, { method: "POST", body: args }));
|
|
56649
|
+
} catch (error62) {
|
|
56650
|
+
if (error62 instanceof ApiError && error62.status === 404 && error62.message === "Not found") throw new Error("Issues are not enabled for this organization");
|
|
56651
|
+
throw error62;
|
|
56564
56652
|
}
|
|
56565
|
-
const body2 = message2.result?.content?.find((item) => item.type === "text")?.text ?? "";
|
|
56566
|
-
if (message2.result?.isError) throw new Error(body2.replace(/^Error \d+: /, ""));
|
|
56567
|
-
return schema.parse(JSON.parse(body2));
|
|
56568
56653
|
}
|
|
56569
56654
|
async function uploadAttachments(files) {
|
|
56570
56655
|
if (!files?.length) return void 0;
|
|
@@ -56580,7 +56665,7 @@ function printIssueLine(issue3) {
|
|
|
56580
56665
|
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}`);
|
|
56581
56666
|
}
|
|
56582
56667
|
async function issueCreateCommand(title3, options) {
|
|
56583
|
-
output2(await callIssueTool(
|
|
56668
|
+
output2(await callIssueTool(ISSUE_COMMANDS.create, {
|
|
56584
56669
|
title: title3,
|
|
56585
56670
|
description: readText(options.description, options.descriptionFile, "description"),
|
|
56586
56671
|
status: options.status,
|
|
@@ -56592,7 +56677,7 @@ async function issueCreateCommand(title3, options) {
|
|
|
56592
56677
|
}, mutationSchema), printMutation);
|
|
56593
56678
|
}
|
|
56594
56679
|
async function issueUpdateCommand(issue3, options) {
|
|
56595
|
-
output2(await callIssueTool(
|
|
56680
|
+
output2(await callIssueTool(ISSUE_COMMANDS.update, {
|
|
56596
56681
|
issue: issue3,
|
|
56597
56682
|
title: options.title,
|
|
56598
56683
|
description: readText(options.description, options.descriptionFile, "description"),
|
|
@@ -56603,7 +56688,7 @@ async function issueUpdateCommand(issue3, options) {
|
|
|
56603
56688
|
}, mutationSchema), printMutation);
|
|
56604
56689
|
}
|
|
56605
56690
|
async function issueViewCommand(issue3) {
|
|
56606
|
-
output2(await callIssueTool(
|
|
56691
|
+
output2(await callIssueTool(ISSUE_COMMANDS.get, { issue: issue3 }, issueDetailResponseSchema), (detail) => {
|
|
56607
56692
|
console.log(`${import_chalk29.default.bold.cyan(detail.issue.identifier)} ${import_chalk29.default.bold(detail.issue.title)}`);
|
|
56608
56693
|
console.log(import_chalk29.default.dim(`${detail.issue.status} \xB7 priority ${detail.issue.priority}`));
|
|
56609
56694
|
const assignees = detail.subscribers.filter((subscriber) => subscriber.role === "assignee");
|
|
@@ -56621,7 +56706,7 @@ ${comment.body}`);
|
|
|
56621
56706
|
});
|
|
56622
56707
|
}
|
|
56623
56708
|
async function issueListCommand(options) {
|
|
56624
|
-
output2(await callIssueTool(
|
|
56709
|
+
output2(await callIssueTool(ISSUE_COMMANDS.list, {
|
|
56625
56710
|
query: options.query,
|
|
56626
56711
|
status: csv(options.status),
|
|
56627
56712
|
priority: csv(options.priority),
|
|
@@ -56640,7 +56725,7 @@ async function issueCommentCommand(issue3, body2, options) {
|
|
|
56640
56725
|
const text4 = readText(body2, options.file, "file") ?? "";
|
|
56641
56726
|
const media_ids = await uploadAttachments(options.attach);
|
|
56642
56727
|
if (!text4.trim() && !media_ids) throw new Error("Pass the comment text, --file, or --attach");
|
|
56643
|
-
output2(await callIssueTool(
|
|
56728
|
+
output2(await callIssueTool(ISSUE_COMMANDS.comment, { issue: issue3, body: text4, media_ids }, external_exports.unknown()), () => console.log(`${import_chalk29.default.green("\u2713")} Commented on ${issue3}`));
|
|
56644
56729
|
}
|
|
56645
56730
|
function issueActorCommand(tool, done) {
|
|
56646
56731
|
return async (issue3, who) => {
|
|
@@ -56648,12 +56733,12 @@ function issueActorCommand(tool, done) {
|
|
|
56648
56733
|
};
|
|
56649
56734
|
}
|
|
56650
56735
|
async function issueLinkPrCommand(issue3, url2) {
|
|
56651
|
-
output2(await callIssueTool(
|
|
56736
|
+
output2(await callIssueTool(ISSUE_COMMANDS.linkPr, { issue: issue3, url: url2 }, external_exports.unknown()), () => console.log(`${import_chalk29.default.green("\u2713")} Linked ${url2} to ${issue3}`));
|
|
56652
56737
|
}
|
|
56653
56738
|
async function issueRelateCommand(issue3, type, related) {
|
|
56654
|
-
output2(await callIssueTool(
|
|
56739
|
+
output2(await callIssueTool(ISSUE_COMMANDS.relate, { issue: issue3, type, related_issue: related }, external_exports.unknown()), () => console.log(`${import_chalk29.default.green("\u2713")} ${issue3} ${type.replace("_", " ")} ${related}`));
|
|
56655
56740
|
}
|
|
56656
|
-
var import_node_fs2, import_node_path2, import_chalk29,
|
|
56741
|
+
var import_node_fs2, import_node_path2, import_chalk29, mutationSchema, csv, printMutation;
|
|
56657
56742
|
var init_issue = __esm({
|
|
56658
56743
|
"src/commands/issue.ts"() {
|
|
56659
56744
|
"use strict";
|
|
@@ -56664,14 +56749,9 @@ var init_issue = __esm({
|
|
|
56664
56749
|
init_src();
|
|
56665
56750
|
init_api2();
|
|
56666
56751
|
init_config();
|
|
56667
|
-
init_monolith_url();
|
|
56668
56752
|
init_output();
|
|
56669
56753
|
init_media3();
|
|
56670
|
-
|
|
56671
|
-
result: external_exports.object({ content: external_exports.array(external_exports.object({ type: external_exports.string(), text: external_exports.string().optional() })).optional(), isError: external_exports.boolean().optional() }).optional(),
|
|
56672
|
-
error: external_exports.object({ message: external_exports.string() }).optional()
|
|
56673
|
-
});
|
|
56674
|
-
mutationSchema = external_exports.object({ issue: issueSchema2 });
|
|
56754
|
+
mutationSchema = external_exports.object({ issue: issueSchema });
|
|
56675
56755
|
csv = (value) => value?.split(",").map((entry) => entry.trim()).filter(Boolean).join(",");
|
|
56676
56756
|
printMutation = ({ issue: issue3 }) => console.log(`${import_chalk29.default.green("\u2713")} ${import_chalk29.default.cyan(issue3.identifier)} ${issue3.title} (${issue3.status})`);
|
|
56677
56757
|
}
|
|
@@ -58217,10 +58297,10 @@ var init_src2 = __esm({
|
|
|
58217
58297
|
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>", "me, user:<id> or workspace:<id>").option("--manager <workspaceId>", "A Manager's issues").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));
|
|
58218
58298
|
issue2.command("search <query>").description("Search issues by text or identifier").action(run((query) => issueListCommand({ query })));
|
|
58219
58299
|
issue2.command("comment <issue> [body]").description("Comment on an issue. Mention a member as @their@email.com").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));
|
|
58220
|
-
issue2.command("assign <issue> <who>").description("Assign me, an email, a user ID or a workspace ID").action(run(issueActorCommand(
|
|
58221
|
-
issue2.command("unassign <issue> <who>").description("Remove an assignee (they stay subscribed)").action(run(issueActorCommand(
|
|
58222
|
-
issue2.command("subscribe <issue> [who]").description("Follow an issue (default: you)").action(run(issueActorCommand(
|
|
58223
|
-
issue2.command("unsubscribe <issue> [who]").description("Stop following an issue (default: you)").action(run(issueActorCommand(
|
|
58300
|
+
issue2.command("assign <issue> <who>").description("Assign me, an email, a user ID or a workspace ID").action(run(issueActorCommand(ISSUE_COMMANDS.assign, "Assigned")));
|
|
58301
|
+
issue2.command("unassign <issue> <who>").description("Remove an assignee (they stay subscribed)").action(run(issueActorCommand(ISSUE_COMMANDS.unassign, "Unassigned")));
|
|
58302
|
+
issue2.command("subscribe <issue> [who]").description("Follow an issue (default: you)").action(run(issueActorCommand(ISSUE_COMMANDS.subscribe, "Subscribed")));
|
|
58303
|
+
issue2.command("unsubscribe <issue> [who]").description("Stop following an issue (default: you)").action(run(issueActorCommand(ISSUE_COMMANDS.unsubscribe, "Unsubscribed")));
|
|
58224
58304
|
issue2.command("link-pr <issue> <url>").description("Link a pull request").action(run(issueLinkPrCommand));
|
|
58225
58305
|
issue2.command("relate <issue> <type> <related>").description(`Mark <type> (${ISSUE_RELATION_TYPES.join(" or ")}) another issue`).action(run(issueRelateCommand));
|
|
58226
58306
|
media.command("delete <mediaId>").description("Permanently delete media and stop all of its links working").action(run(mediaDeleteCommand));
|