replicas-cli 0.3.619 → 0.3.622
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 +37 -21
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -21193,6 +21193,9 @@ var init_sandbox = __esm({
|
|
|
21193
21193
|
});
|
|
21194
21194
|
|
|
21195
21195
|
// ../shared/src/pricing.ts
|
|
21196
|
+
function isClientMessageSource(value) {
|
|
21197
|
+
return typeof value === "string" && CLIENT_MESSAGE_SOURCES.some((source) => source === value);
|
|
21198
|
+
}
|
|
21196
21199
|
var BILLING_BLOCK_TITLES, TRIAL_CREDIT_CENTS, SCOUT_SOURCE, WORKSPACE_SOURCES, CLIENT_MESSAGE_SOURCES, MESSAGE_SOURCES, AUTOMATED_SOURCES, AUTOMATED_SOURCES_SQL, EGRESS_MICRODOLLARS_PER_GB, EGRESS_RATE_LABEL, CREDIT_PLAN_UNITS, PLANS, TEAM_PLAN, ENTERPRISE_PLAN;
|
|
21197
21200
|
var init_pricing = __esm({
|
|
21198
21201
|
"../shared/src/pricing.ts"() {
|
|
@@ -21207,9 +21210,12 @@ var init_pricing = __esm({
|
|
|
21207
21210
|
};
|
|
21208
21211
|
TRIAL_CREDIT_CENTS = 1e4;
|
|
21209
21212
|
SCOUT_SOURCE = "mothership";
|
|
21210
|
-
WORKSPACE_SOURCES = ["api", "dashboard", "slack", "linear", "github", "gitlab", "automation", SCOUT_SOURCE];
|
|
21213
|
+
WORKSPACE_SOURCES = ["api", "dashboard", "mobile", "slack", "linear", "github", "gitlab", "automation", SCOUT_SOURCE];
|
|
21211
21214
|
CLIENT_MESSAGE_SOURCES = ["web", "desktop", "mobile", "tui"];
|
|
21212
|
-
MESSAGE_SOURCES = [
|
|
21215
|
+
MESSAGE_SOURCES = [
|
|
21216
|
+
...CLIENT_MESSAGE_SOURCES,
|
|
21217
|
+
...WORKSPACE_SOURCES.filter((source) => !isClientMessageSource(source))
|
|
21218
|
+
];
|
|
21213
21219
|
AUTOMATED_SOURCES = ["api", "automation"];
|
|
21214
21220
|
AUTOMATED_SOURCES_SQL = AUTOMATED_SOURCES.map((s) => `'${s}'`).join(", ");
|
|
21215
21221
|
EGRESS_MICRODOLLARS_PER_GB = 15e4;
|
|
@@ -23293,7 +23299,7 @@ var init_subagent_mcp = __esm({
|
|
|
23293
23299
|
function identityTokenUrl() {
|
|
23294
23300
|
return `http://127.0.0.1:${IDENTITY_PROXY_PORT}${IDENTITY_TOKEN_PATH}`;
|
|
23295
23301
|
}
|
|
23296
|
-
var AWS_SOURCE_IDENTITY_CLAIM, WORKSPACE_TOKEN_TTL_SECONDS, IDENTITY_PROXY_PORT, IDENTITY_TOKEN_PATH, WORKSPACE_TOKEN_ENV, workspaceAudienceSchema, workspaceTokenRequestSchema, workspaceTokenClaimsSchema, workspaceTokenResponseSchema,
|
|
23302
|
+
var AWS_SOURCE_IDENTITY_CLAIM, WORKSPACE_TOKEN_TTL_SECONDS, IDENTITY_PROXY_PORT, IDENTITY_TOKEN_PATH, WORKSPACE_TOKEN_ENV, workspaceAudienceSchema, workspaceTokenRequestSchema, workspaceTokenClaimsSchema, workspaceTokenResponseSchema, mcpWorkloadAuthSchema, mcpAuthSchema, engineMcpOAuthTokenRequestSchema, engineMcpOAuthTokenResponseSchema;
|
|
23297
23303
|
var init_workspace_identity = __esm({
|
|
23298
23304
|
"../shared/src/workspace-identity.ts"() {
|
|
23299
23305
|
"use strict";
|
|
@@ -23332,12 +23338,6 @@ var init_workspace_identity = __esm({
|
|
|
23332
23338
|
token: external_exports.string(),
|
|
23333
23339
|
expires_at: external_exports.string()
|
|
23334
23340
|
});
|
|
23335
|
-
legacyWorkspaceTokenBundleSchema = external_exports.object({
|
|
23336
|
-
version: external_exports.literal(1),
|
|
23337
|
-
issuer: external_exports.string(),
|
|
23338
|
-
default_audience: external_exports.string(),
|
|
23339
|
-
tokens: external_exports.record(external_exports.string(), external_exports.object({ token: external_exports.string(), expires_at: external_exports.string() }))
|
|
23340
|
-
});
|
|
23341
23341
|
mcpWorkloadAuthSchema = external_exports.strictObject({
|
|
23342
23342
|
type: external_exports.literal("workspace_identity"),
|
|
23343
23343
|
audience: workspaceAudienceSchema
|
|
@@ -24779,7 +24779,8 @@ function parseIssueContractRecord(schema, value, at, report) {
|
|
|
24779
24779
|
}
|
|
24780
24780
|
function parseIssueContractResponse(schema, value, report) {
|
|
24781
24781
|
const rows = isRecord(value) ? Object.fromEntries(Object.entries(value).map(([key, raw]) => {
|
|
24782
|
-
const
|
|
24782
|
+
const shape = schema.shape[key];
|
|
24783
|
+
const field2 = shape instanceof external_exports.ZodOptional ? shape.unwrap() : shape;
|
|
24783
24784
|
return [key, field2 instanceof external_exports.ZodArray && Array.isArray(raw) ? raw.filter((row) => parseIssueContractRecord(field2.element, row, key, report) !== void 0) : raw];
|
|
24784
24785
|
})) : value;
|
|
24785
24786
|
const parsed = external_exports.safeParse(schema, rows);
|
|
@@ -24861,7 +24862,7 @@ function mapIssueActors(value, map2) {
|
|
|
24861
24862
|
return [key, mapIssueActors(inner, map2)];
|
|
24862
24863
|
}));
|
|
24863
24864
|
}
|
|
24864
|
-
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;
|
|
24865
|
+
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, issueRelationKind, 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;
|
|
24865
24866
|
var init_issues = __esm({
|
|
24866
24867
|
"../shared/src/routes/issues.ts"() {
|
|
24867
24868
|
"use strict";
|
|
@@ -24996,6 +24997,7 @@ var init_issues = __esm({
|
|
|
24996
24997
|
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") };
|
|
24997
24998
|
({ created, ...laterVariants } = issueEventVariants);
|
|
24998
24999
|
issueEventSchema = external_exports.discriminatedUnion("type", [created, ...Object.values(laterVariants)]);
|
|
25000
|
+
issueRelationKind = (relation, issueId) => relation.type === "blocks" ? relation.issue_id === issueId ? "blocks" : "blocked_by" : relation.issue_id === issueId ? "duplicate_of" : "duplicated_by";
|
|
24999
25001
|
issueActorDirectorySchema = external_exports.record(external_exports.string(), external_exports.object({ name: external_exports.string(), handle: external_exports.string() }));
|
|
25000
25002
|
clientMutationId = external_exports.string().min(1).max(128).optional();
|
|
25001
25003
|
title = external_exports.string().trim().min(1).max(500);
|
|
@@ -25073,7 +25075,8 @@ var init_issues = __esm({
|
|
|
25073
25075
|
pull_requests: external_exports.array(issuePullRequestSchema),
|
|
25074
25076
|
comments: external_exports.array(issueCommentSchema),
|
|
25075
25077
|
events: external_exports.array(issueEventSchema),
|
|
25076
|
-
sub_issues: external_exports.array(issueSchema)
|
|
25078
|
+
sub_issues: external_exports.array(issueSchema),
|
|
25079
|
+
related_issues: external_exports.array(issueSchema).optional()
|
|
25077
25080
|
});
|
|
25078
25081
|
listIssuesResponseSchema = external_exports.object({ issues: external_exports.array(issueSchema), next_cursor: external_exports.number().nullable() });
|
|
25079
25082
|
issueDirectoryUserSchema = external_exports.object({
|
|
@@ -40799,7 +40802,7 @@ var CLI_VERSION;
|
|
|
40799
40802
|
var init_cli_version = __esm({
|
|
40800
40803
|
"../shared/src/cli-version.ts"() {
|
|
40801
40804
|
"use strict";
|
|
40802
|
-
CLI_VERSION = "0.3.
|
|
40805
|
+
CLI_VERSION = "0.3.622";
|
|
40803
40806
|
}
|
|
40804
40807
|
});
|
|
40805
40808
|
|
|
@@ -57615,9 +57618,6 @@ function readText(inline, file2, what) {
|
|
|
57615
57618
|
if (inline !== void 0 && file2 !== void 0) throw new Error(`Pass either --${what} or --${what}-file, not both`);
|
|
57616
57619
|
return file2 === void 0 ? inline : import_node_fs2.default.readFileSync(file2 === "-" ? 0 : file2, "utf8");
|
|
57617
57620
|
}
|
|
57618
|
-
function printIssueLine(issue3) {
|
|
57619
|
-
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}`);
|
|
57620
|
-
}
|
|
57621
57621
|
async function issueCreateCommand(title3, options) {
|
|
57622
57622
|
await callIssueTool(ISSUE_COMMANDS.create, {
|
|
57623
57623
|
title: title3,
|
|
@@ -57652,14 +57652,29 @@ async function issueViewCommand(issue3) {
|
|
|
57652
57652
|
${renderIssueMentions(detail.issue.description, actors)}`);
|
|
57653
57653
|
for (const pr2 of detail.pull_requests) console.log(`
|
|
57654
57654
|
${import_chalk29.default.magenta("PR")} ${pr2.url} (${pr2.state})`);
|
|
57655
|
-
|
|
57655
|
+
const issueById = new Map([detail.issue, ...detail.sub_issues, ...detail.related_issues ?? []].map((related) => [related.id, related]));
|
|
57656
|
+
const identifierOf = (id) => issueById.get(id)?.identifier ?? (detail.related_issues ? "a deleted issue" : id);
|
|
57657
|
+
const links = [
|
|
57658
|
+
...detail.issue.parent_id ? [{ label: "parent", id: detail.issue.parent_id }] : [],
|
|
57659
|
+
...detail.relations.map((relation) => ({
|
|
57660
|
+
label: issueRelationKind(relation, detail.issue.id).replace("_", " "),
|
|
57661
|
+
id: relation.issue_id === detail.issue.id ? relation.related_issue_id : relation.issue_id
|
|
57662
|
+
})),
|
|
57663
|
+
...detail.sub_issues.map((sub) => ({ label: "sub-issue", id: sub.id }))
|
|
57664
|
+
];
|
|
57665
|
+
const linkLines = links.map(({ label, id }) => {
|
|
57666
|
+
const related = issueById.get(id);
|
|
57667
|
+
return `${import_chalk29.default.dim(label.padEnd(13))} ${related ? issueLine(related) : import_chalk29.default.dim(identifierOf(id))}`;
|
|
57668
|
+
});
|
|
57669
|
+
if (linkLines.length) console.log(`
|
|
57670
|
+
${linkLines.join("\n")}`);
|
|
57656
57671
|
for (const comment of detail.comments) {
|
|
57657
57672
|
console.log(`
|
|
57658
57673
|
${import_chalk29.default.dim(`\u2014 ${name(comment.author)}, ${comment.created_at}`)}
|
|
57659
57674
|
${renderIssueMentions(comment.body, actors)}`);
|
|
57660
57675
|
}
|
|
57661
57676
|
const activity = detail.events.flatMap((event) => {
|
|
57662
|
-
const change2 = describeIssueEvent(event, name,
|
|
57677
|
+
const change2 = describeIssueEvent(event, name, identifierOf);
|
|
57663
57678
|
return change2 ? [`${import_chalk29.default.dim(event.created_at)} ${name(event.actor)} ${change2}`] : [];
|
|
57664
57679
|
});
|
|
57665
57680
|
if (activity.length) console.log(`
|
|
@@ -57679,7 +57694,7 @@ async function issueListCommand(options) {
|
|
|
57679
57694
|
limit: options.limit ? Number(options.limit) : void 0
|
|
57680
57695
|
}, listIssuesResponseSchema, ({ issues, next_cursor }) => {
|
|
57681
57696
|
if (issues.length === 0) console.log(import_chalk29.default.dim("No issues"));
|
|
57682
|
-
issues.forEach(
|
|
57697
|
+
issues.forEach((issue3) => console.log(issueLine(issue3)));
|
|
57683
57698
|
if (next_cursor !== null) console.log(import_chalk29.default.dim("More issues exist; narrow the filters or raise --limit."));
|
|
57684
57699
|
});
|
|
57685
57700
|
}
|
|
@@ -57703,7 +57718,7 @@ async function issueUnlinkPrCommand(issue3, url2) {
|
|
|
57703
57718
|
async function issueRelateCommand(issue3, type, related) {
|
|
57704
57719
|
await callIssueTool(ISSUE_COMMANDS.relate, { issue: issue3, type, related_issue: related }, noData, () => console.log(`${import_chalk29.default.green("\u2713")} ${issue3} ${type.replace("_", " ")} ${related}`));
|
|
57705
57720
|
}
|
|
57706
|
-
var import_node_fs2, import_node_path2, import_chalk29, mutationSchema, noData, csv, printMutation;
|
|
57721
|
+
var import_node_fs2, import_node_path2, import_chalk29, mutationSchema, noData, csv, issueLine, printMutation;
|
|
57707
57722
|
var init_issue = __esm({
|
|
57708
57723
|
"src/commands/issue.ts"() {
|
|
57709
57724
|
"use strict";
|
|
@@ -57719,6 +57734,7 @@ var init_issue = __esm({
|
|
|
57719
57734
|
mutationSchema = external_exports.object({ issue: issueSchema });
|
|
57720
57735
|
noData = external_exports.looseObject({});
|
|
57721
57736
|
csv = (value) => value?.split(",").map((entry) => entry.trim()).filter(Boolean).join(",");
|
|
57737
|
+
issueLine = (issue3) => `${import_chalk29.default.cyan(issue3.identifier.padEnd(9))} ${issue3.status.padEnd(11)} ${issue3.priority === "none" ? "" : import_chalk29.default.yellow(`${issue3.priority} `)}${issue3.title}${issue3.archived_at ? import_chalk29.default.dim(" (archived)") : ""}`;
|
|
57722
57738
|
printMutation = ({ issue: issue3 }) => console.log(`${import_chalk29.default.green("\u2713")} ${import_chalk29.default.cyan(issue3.identifier)} ${issue3.title} (${issue3.status})`);
|
|
57723
57739
|
}
|
|
57724
57740
|
});
|
|
@@ -59323,7 +59339,7 @@ var init_src2 = __esm({
|
|
|
59323
59339
|
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");
|
|
59324
59340
|
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));
|
|
59325
59341
|
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));
|
|
59326
|
-
issue2.command("view <issue>").description("Show an issue with its
|
|
59342
|
+
issue2.command("view <issue>").description("Show an issue with its parent, relations, sub-issues, pull requests, comments and activity").action(run(issueViewCommand));
|
|
59327
59343
|
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));
|
|
59328
59344
|
issue2.command("search <query>").description("Search issues by text or identifier").action(run((query) => issueListCommand({ query })));
|
|
59329
59345
|
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));
|