replicas-cli 0.3.183 → 0.3.185
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 +32 -26
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -19331,6 +19331,7 @@ replicas automation create "Review my PRs" \\
|
|
|
19331
19331
|
--prompt "Leave a code review on this PR" \\
|
|
19332
19332
|
--environment <env-name-or-id> \\
|
|
19333
19333
|
--trigger-github pull_request.opened \\
|
|
19334
|
+
--trigger-github pull_request.synchronize \\
|
|
19334
19335
|
--trigger-github-repos acme/web,acme/api \\
|
|
19335
19336
|
--trigger-github-exclude-users 'dependabot[bot],renovate[bot]'
|
|
19336
19337
|
|
|
@@ -19393,7 +19394,7 @@ replicas automation edit <id> \\
|
|
|
19393
19394
|
--trigger-cron "0 4 * * *" # replaces existing triggers
|
|
19394
19395
|
\`\`\`
|
|
19395
19396
|
|
|
19396
|
-
\`replicas automation edit <id> --trigger-github-exclude-users "dependabot[bot],renovate[bot]"\` updates existing GitHub triggers without replacing the rest of the trigger list. The GitLab equivalent is \`--trigger-gitlab-exclude-users\`. Passing an empty string (for example, \`--trigger-github-exclude-users ""\`) clears existing exclusions for that code host. Passing \`--trigger-github\` or \`--trigger-gitlab\` still replaces triggers, and the matching exclude flag is applied to the replacement
|
|
19397
|
+
\`replicas automation edit <id> --trigger-github-exclude-users "dependabot[bot],renovate[bot]"\` updates existing GitHub triggers without replacing the rest of the trigger list. The GitLab equivalent is \`--trigger-gitlab-exclude-users\`. Passing an empty string (for example, \`--trigger-github-exclude-users ""\`) clears existing exclusions for that code host. Passing \`--trigger-github\` or \`--trigger-gitlab\` still replaces triggers (repeat it to keep several events), and the matching exclude flag is applied to the replacement triggers.
|
|
19397
19398
|
|
|
19398
19399
|
\`replicas automation edit <id> --move-to-org\` turns a personal automation into a shared one the whole team can see. It can't be undone.
|
|
19399
19400
|
|
|
@@ -20103,7 +20104,7 @@ function extractMothershipEvents(text3) {
|
|
|
20103
20104
|
at: attributes.at ?? "",
|
|
20104
20105
|
kind,
|
|
20105
20106
|
agentId: attributes.agent_id,
|
|
20106
|
-
agentName: attributes.agent ?? "
|
|
20107
|
+
agentName: attributes.agent ?? "ship",
|
|
20107
20108
|
summary: summary.trim(),
|
|
20108
20109
|
...detail ? { detail } : {},
|
|
20109
20110
|
...attributes.noticed === "true" ? { noticed: true } : {}
|
|
@@ -31111,7 +31112,7 @@ var CLI_VERSION;
|
|
|
31111
31112
|
var init_cli_version = __esm({
|
|
31112
31113
|
"../shared/src/cli-version.ts"() {
|
|
31113
31114
|
"use strict";
|
|
31114
|
-
CLI_VERSION = "0.3.
|
|
31115
|
+
CLI_VERSION = "0.3.185";
|
|
31115
31116
|
}
|
|
31116
31117
|
});
|
|
31117
31118
|
|
|
@@ -36640,8 +36641,11 @@ function parseActorListOption(value) {
|
|
|
36640
36641
|
return actors.length > 0 ? actors : void 0;
|
|
36641
36642
|
}
|
|
36642
36643
|
function validateGithubReviewersOption(options) {
|
|
36643
|
-
if (options.triggerGithubReviewers !== void 0 &&
|
|
36644
|
-
const error51 = options.triggerGithub && getReviewerLoginsError(
|
|
36644
|
+
if (options.triggerGithubReviewers !== void 0 && options.triggerGithub.length === 0) throw new Error("--trigger-github-reviewers requires --trigger-github");
|
|
36645
|
+
const error51 = options.triggerGithub.length > 0 && getReviewerLoginsError(
|
|
36646
|
+
options.triggerGithub.includes(REVIEW_REQUESTED_EVENT) ? REVIEW_REQUESTED_EVENT : options.triggerGithub[0],
|
|
36647
|
+
parseActorListOption(options.triggerGithubReviewers)
|
|
36648
|
+
);
|
|
36645
36649
|
if (error51) throw new Error(`${error51} (--trigger-github-reviewers)`);
|
|
36646
36650
|
}
|
|
36647
36651
|
function parseDuration(value) {
|
|
@@ -36766,20 +36770,22 @@ function buildTriggersFromOptions(options, runAt, repositories) {
|
|
|
36766
36770
|
["github", options.triggerGithub, options.triggerGithubRepos, options.triggerGithubExcludeUsers],
|
|
36767
36771
|
["gitlab", options.triggerGitlab, options.triggerGitlabRepos, options.triggerGitlabExcludeUsers]
|
|
36768
36772
|
];
|
|
36769
|
-
for (const [type,
|
|
36770
|
-
if (
|
|
36773
|
+
for (const [type, events, repoNames, excludeUsers] of providerTriggers) {
|
|
36774
|
+
if (events.length === 0) continue;
|
|
36771
36775
|
const repositoryIds = resolveTriggerRepositoryIds(repositories, repoNames, type);
|
|
36772
36776
|
const excludedActors = parseActorListOption(excludeUsers);
|
|
36773
|
-
const
|
|
36774
|
-
|
|
36775
|
-
|
|
36776
|
-
|
|
36777
|
-
|
|
36778
|
-
|
|
36779
|
-
|
|
36780
|
-
|
|
36781
|
-
|
|
36782
|
-
|
|
36777
|
+
for (const event of events) {
|
|
36778
|
+
const reviewerLogins = type === "github" && event === REVIEW_REQUESTED_EVENT ? parseActorListOption(options.triggerGithubReviewers) : void 0;
|
|
36779
|
+
triggers.push({
|
|
36780
|
+
type,
|
|
36781
|
+
config: {
|
|
36782
|
+
event,
|
|
36783
|
+
...repositoryIds ? { repository_ids: repositoryIds } : {},
|
|
36784
|
+
...excludedActors ? { excluded_actors: excludedActors } : {},
|
|
36785
|
+
...reviewerLogins ? { reviewer_logins: reviewerLogins } : {}
|
|
36786
|
+
}
|
|
36787
|
+
});
|
|
36788
|
+
}
|
|
36783
36789
|
}
|
|
36784
36790
|
return triggers;
|
|
36785
36791
|
}
|
|
@@ -37060,9 +37066,9 @@ async function automationCreateCommand(name, options) {
|
|
|
37060
37066
|
const minutes = parseInt(options.autoStopMinutes, 10);
|
|
37061
37067
|
if (isNaN(minutes) || minutes < 3 || minutes > 1440) throw new Error("--auto-stop-minutes must be between 3 and 1440");
|
|
37062
37068
|
}
|
|
37063
|
-
if (options.triggerGithubExcludeUsers !== void 0 &&
|
|
37069
|
+
if (options.triggerGithubExcludeUsers !== void 0 && options.triggerGithub.length === 0) throw new Error("--trigger-github-exclude-users requires --trigger-github");
|
|
37064
37070
|
validateGithubReviewersOption(options);
|
|
37065
|
-
if (options.triggerGitlabExcludeUsers !== void 0 &&
|
|
37071
|
+
if (options.triggerGitlabExcludeUsers !== void 0 && options.triggerGitlab.length === 0) throw new Error("--trigger-gitlab-exclude-users requires --trigger-gitlab");
|
|
37066
37072
|
const agentSelection = applyAgentSelection(
|
|
37067
37073
|
{
|
|
37068
37074
|
agent_provider: parseAgentProviderOption(options.agentProvider),
|
|
@@ -37201,10 +37207,10 @@ async function automationEditCommand(id, options) {
|
|
|
37201
37207
|
const minutes = parseInt(options.autoStopMinutes, 10);
|
|
37202
37208
|
if (isNaN(minutes) || minutes < 3 || minutes > 1440) throw new Error("--auto-stop-minutes must be between 3 and 1440");
|
|
37203
37209
|
}
|
|
37204
|
-
const replacingTriggers =
|
|
37205
|
-
if (replacingTriggers && options.triggerGithubExcludeUsers !== void 0 &&
|
|
37210
|
+
const replacingTriggers = options.triggerCron.length > 0 || options.triggerGithub.length > 0 || options.triggerGitlab.length > 0;
|
|
37211
|
+
if (replacingTriggers && options.triggerGithubExcludeUsers !== void 0 && options.triggerGithub.length === 0) throw new Error("--trigger-github-exclude-users requires --trigger-github when replacing triggers");
|
|
37206
37212
|
validateGithubReviewersOption(options);
|
|
37207
|
-
if (replacingTriggers && options.triggerGitlabExcludeUsers !== void 0 &&
|
|
37213
|
+
if (replacingTriggers && options.triggerGitlabExcludeUsers !== void 0 && options.triggerGitlab.length === 0) throw new Error("--trigger-gitlab-exclude-users requires --trigger-gitlab when replacing triggers");
|
|
37208
37214
|
const parsedAgent = {
|
|
37209
37215
|
agent_provider: parseAgentProviderOption(options.agentProvider),
|
|
37210
37216
|
model: parseModelOption(options.model),
|
|
@@ -37218,7 +37224,7 @@ async function automationEditCommand(id, options) {
|
|
|
37218
37224
|
model: existing.automation.model
|
|
37219
37225
|
});
|
|
37220
37226
|
const body = {};
|
|
37221
|
-
const hasOptions = options.name || options.prompt || options.description !== void 0 || workspaceSize || options.enabled !== void 0 || options.prFollowups !== void 0 ||
|
|
37227
|
+
const hasOptions = options.name || options.prompt || options.description !== void 0 || workspaceSize || options.enabled !== void 0 || options.prFollowups !== void 0 || replacingTriggers || options.environment || options.triggerGithubExcludeUsers !== void 0 || options.triggerGitlabExcludeUsers !== void 0 || options.githubChecks !== void 0 || options.addGithubChecks !== void 0 || options.lifecycle || options.sleepWhenDone || options.autoStopMinutes || options.agentProvider !== void 0 || options.model !== void 0 || options.thinkingLevel !== void 0 || options.planMode !== void 0 || options.goalMode !== void 0 || options.fastMode !== void 0 || runAt !== void 0 || maxRuns !== void 0 || workspaceTarget !== void 0 || options.background !== void 0 || options.moveToOrg;
|
|
37222
37228
|
if (!hasOptions) {
|
|
37223
37229
|
const nameResponse = await ask({
|
|
37224
37230
|
type: "text",
|
|
@@ -37290,7 +37296,7 @@ async function automationEditCommand(id, options) {
|
|
|
37290
37296
|
...normalizeAutomationGithubCheckNames(options.addGithubChecks.split(","))
|
|
37291
37297
|
])];
|
|
37292
37298
|
}
|
|
37293
|
-
if (runAt ||
|
|
37299
|
+
if (runAt || replacingTriggers) {
|
|
37294
37300
|
const repositories = options.triggerGithubRepos || options.triggerGitlabRepos ? (await orgAuthenticatedFetch("/v1/repositories")).repositories : [];
|
|
37295
37301
|
const triggers = buildTriggersFromOptions(options, runAt, repositories);
|
|
37296
37302
|
body.triggers = triggers;
|
|
@@ -39028,8 +39034,8 @@ var init_src2 = __esm({
|
|
|
39028
39034
|
automation = program.command("automation").alias("auto").description("Manage automations");
|
|
39029
39035
|
automation.command("list").description("List all automations").option("-p, --page <page>", "Page number").option("-l, --limit <limit>", "Number of items per page").option("--owner <owner>", "Ownership filter: org, user, all").option("--trigger-type <type>", "Only automations with a trigger of this type (cron, github, gitlab, slack, sentry, custom)").option("--enabled <enabled>", "Only enabled or disabled automations (true/false)").option("--search <search>", "Case-insensitive substring match on the name").option("--background <background>", "Only background (true) or main-list (false) automations").action(run(automationListCommand));
|
|
39030
39036
|
automation.command("get <id>").description("Get automation details by ID").action(run(automationGetCommand));
|
|
39031
|
-
automation.command("create [name]").description("Create a new automation").option("-p, --prompt <prompt>", "Prompt for the automation").option("-d, --description <description>", "Description shown with the automation").option("-e, --environment <environment>", "Environment name or ID").option("--size <size>", "Size of workspaces runs create (not a reused existing one): small (default), large, ultra").option("--trigger-cron <schedule>", 'Cron schedule expression, e.g. "0 9 * * 1-5" (repeatable)', collect, []).option("--trigger-cron-timezone <timezone>", "Timezone for cron schedules (default: UTC)").option("--trigger-github <event>", 'GitHub event
|
|
39032
|
-
automation.command("edit <id>").description("Edit an existing automation").option("-n, --name <name>", "New name").option("-p, --prompt <prompt>", "New prompt").option("-d, --description <description>", "New description (pass empty string to clear)").option("--size <size>", "Size of workspaces runs create (not a reused existing one): small, large, ultra").option("--enabled <enabled>", "Enable or disable (true/false)").option("--trigger-cron <schedule>", "Set cron schedule (repeatable; replaces existing triggers)", collect, []).option("--trigger-cron-timezone <timezone>", "Timezone for cron schedules").option("--trigger-github <event>", "Set GitHub event (replaces existing triggers)").option("--trigger-github-repos <repos>", "Comma-separated repo names to filter GitHub trigger").option("--trigger-github-exclude-users <users>", "Comma-separated GitHub usernames to exclude from triggering (pass empty string to clear the list)").option("--trigger-github-reviewers <users>", "Comma-separated GitHub usernames to fire for (required with pull_request.review_requested)").option("--trigger-gitlab <event>", "Set GitLab event (replaces existing triggers)").option("--trigger-gitlab-repos <repos>", "Comma-separated repo names to filter GitLab trigger").option("--trigger-gitlab-exclude-users <users>", "Comma-separated GitLab usernames to exclude from triggering (pass empty string to clear the list)").option("--github-checks <names>", "Comma-separated GitHub check names to create on matching PRs (replaces the current list; pass empty string to remove them)").option("--add-github-checks <names>", "Comma-separated GitHub check names to add, keeping the ones already configured").option("--environment <environment>", "Environment name or ID").option("--lifecycle <policy>", "Workspace lifecycle: delete_when_done (default for new automations), sleep_when_done, archive_when_done, default").option("--sleep-when-done", "Sleep automation workspaces as soon as the agent finishes").option("--auto-stop-minutes <minutes>", "Inactivity timeout in minutes (3-1440, requires --lifecycle default)").option("--pr-followups <enabled>", "Allow follow-up actions on matching PRs (true/false)", parseBooleanOption).option("--agent-provider <provider>", 'Coding agent to use: claude, codex, cursor (or "none" to inherit org default)').option("--model <model>", 'Model identifier (must be valid for --agent-provider; pass "none" to clear)').option("--thinking-level <level>", 'Thinking/reasoning level: low, medium, high, xhigh, max (or "none" to clear)').option("--plan-mode <enabled>", "Run automation messages in plan mode (true/false)", parseBooleanOption).option("--goal-mode <enabled>", "Set automation messages as goals (true/false)", parseBooleanOption).option("--fast-mode <enabled>", "Run automation messages in fast mode (true/false)", parseBooleanOption).option("--in <duration>", "Replace triggers with a one-time run after this long, e.g. 30m, 2h, 3d, 1w").option("--at <datetime>", "Replace triggers with a one-time run at this ISO-8601 time with timezone").option("--max-runs <n>", 'Delete the automation after this many runs in total ("none" for unlimited)').option("--workspace <target>", "Where runs go: new, reuse, current, or a workspace ID").option("--background <enabled>", "Keep it out of the main automations list (true/false)", parseBooleanOption).option("--move-to-org", "Move a personal automation to the organization so teammates can see and edit it (cannot be undone)").action(run(automationEditCommand));
|
|
39037
|
+
automation.command("create [name]").description("Create a new automation").option("-p, --prompt <prompt>", "Prompt for the automation").option("-d, --description <description>", "Description shown with the automation").option("-e, --environment <environment>", "Environment name or ID").option("--size <size>", "Size of workspaces runs create (not a reused existing one): small (default), large, ultra").option("--trigger-cron <schedule>", 'Cron schedule expression, e.g. "0 9 * * 1-5" (repeatable)', collect, []).option("--trigger-cron-timezone <timezone>", "Timezone for cron schedules (default: UTC)").option("--trigger-github <event>", 'GitHub event, e.g. "pull_request.opened" (repeatable)', collect, []).option("--trigger-github-repos <repos>", "Comma-separated repo names to filter GitHub trigger").option("--trigger-github-exclude-users <users>", "Comma-separated GitHub usernames to exclude from triggering (pass empty string to clear the list)").option("--trigger-github-reviewers <users>", "Comma-separated GitHub usernames to fire for (required with pull_request.review_requested)").option("--trigger-gitlab <event>", 'GitLab event, e.g. "merge_request.opened" (repeatable)', collect, []).option("--trigger-gitlab-repos <repos>", "Comma-separated repo names to filter GitLab trigger").option("--trigger-gitlab-exclude-users <users>", "Comma-separated GitLab usernames to exclude from triggering (pass empty string to clear the list)").option("--github-checks <names>", "Comma-separated GitHub check names to create on matching PRs (requires a PR opened/updated trigger)").option("--lifecycle <policy>", "Workspace lifecycle: delete_when_done (default for new automations), sleep_when_done, archive_when_done, default").option("--sleep-when-done", "Sleep automation workspaces as soon as the agent finishes").option("--auto-stop-minutes <minutes>", "Inactivity timeout in minutes (3-1440, requires --lifecycle default)").option("--pr-followups", "Allow follow-up actions on matching PRs").option("--agent-provider <provider>", 'Coding agent to use: claude, codex, cursor (or "none" to inherit org default)').option("--model <model>", 'Model identifier (must be valid for --agent-provider; pass "none" to clear)').option("--thinking-level <level>", 'Thinking/reasoning level: low, medium, high, xhigh, max (or "none" to clear)').option("--plan-mode", "Run automation messages in plan mode").option("--goal-mode", "Set automation messages as goals").option("--fast-mode", "Run automation messages in fast mode").option("--personal", "Create a personal automation owned by the authenticated user").option("--in <duration>", "Run once after this long, e.g. 30m, 2h, 3d, 1w (inside a workspace, defaults --workspace to current)").option("--at <datetime>", "Run once at this ISO-8601 time with timezone, e.g. 2026-10-08T09:00:00-07:00").option("--max-runs <n>", 'Delete the automation after this many runs ("none" for unlimited)').option("--workspace <target>", "Where runs go: new (default, new workspace each run), reuse (one workspace created on the first run), current (this workspace), or a workspace ID").option("--background", "Keep it out of the main automations list (for offhand follow-ups)").option("--disabled", "Create in disabled state").action(run((name, options) => automationCreateCommand(name, { ...options, enabled: !options.disabled })));
|
|
39038
|
+
automation.command("edit <id>").description("Edit an existing automation").option("-n, --name <name>", "New name").option("-p, --prompt <prompt>", "New prompt").option("-d, --description <description>", "New description (pass empty string to clear)").option("--size <size>", "Size of workspaces runs create (not a reused existing one): small, large, ultra").option("--enabled <enabled>", "Enable or disable (true/false)").option("--trigger-cron <schedule>", "Set cron schedule (repeatable; replaces existing triggers)", collect, []).option("--trigger-cron-timezone <timezone>", "Timezone for cron schedules").option("--trigger-github <event>", "Set GitHub event (repeatable; replaces existing triggers)", collect, []).option("--trigger-github-repos <repos>", "Comma-separated repo names to filter GitHub trigger").option("--trigger-github-exclude-users <users>", "Comma-separated GitHub usernames to exclude from triggering (pass empty string to clear the list)").option("--trigger-github-reviewers <users>", "Comma-separated GitHub usernames to fire for (required with pull_request.review_requested)").option("--trigger-gitlab <event>", "Set GitLab event (repeatable; replaces existing triggers)", collect, []).option("--trigger-gitlab-repos <repos>", "Comma-separated repo names to filter GitLab trigger").option("--trigger-gitlab-exclude-users <users>", "Comma-separated GitLab usernames to exclude from triggering (pass empty string to clear the list)").option("--github-checks <names>", "Comma-separated GitHub check names to create on matching PRs (replaces the current list; pass empty string to remove them)").option("--add-github-checks <names>", "Comma-separated GitHub check names to add, keeping the ones already configured").option("--environment <environment>", "Environment name or ID").option("--lifecycle <policy>", "Workspace lifecycle: delete_when_done (default for new automations), sleep_when_done, archive_when_done, default").option("--sleep-when-done", "Sleep automation workspaces as soon as the agent finishes").option("--auto-stop-minutes <minutes>", "Inactivity timeout in minutes (3-1440, requires --lifecycle default)").option("--pr-followups <enabled>", "Allow follow-up actions on matching PRs (true/false)", parseBooleanOption).option("--agent-provider <provider>", 'Coding agent to use: claude, codex, cursor (or "none" to inherit org default)').option("--model <model>", 'Model identifier (must be valid for --agent-provider; pass "none" to clear)').option("--thinking-level <level>", 'Thinking/reasoning level: low, medium, high, xhigh, max (or "none" to clear)').option("--plan-mode <enabled>", "Run automation messages in plan mode (true/false)", parseBooleanOption).option("--goal-mode <enabled>", "Set automation messages as goals (true/false)", parseBooleanOption).option("--fast-mode <enabled>", "Run automation messages in fast mode (true/false)", parseBooleanOption).option("--in <duration>", "Replace triggers with a one-time run after this long, e.g. 30m, 2h, 3d, 1w").option("--at <datetime>", "Replace triggers with a one-time run at this ISO-8601 time with timezone").option("--max-runs <n>", 'Delete the automation after this many runs in total ("none" for unlimited)').option("--workspace <target>", "Where runs go: new, reuse, current, or a workspace ID").option("--background <enabled>", "Keep it out of the main automations list (true/false)", parseBooleanOption).option("--move-to-org", "Move a personal automation to the organization so teammates can see and edit it (cannot be undone)").action(run(automationEditCommand));
|
|
39033
39039
|
automation.command("run <id>").description("Manually trigger an automation (cron-triggered automations only)").action(run(automationRunCommand));
|
|
39034
39040
|
automation.command("delete <id>").description("Delete an automation").option("-f, --force", "Skip confirmation prompt").action(run(automationDeleteCommand));
|
|
39035
39041
|
automation.command("check <checkRunId>").description("Report this automation run's verdict on one of its GitHub checks").requiredOption("--token <token>", "Ownership token for this check, exactly as given in the prompt").requiredOption("--conclusion <conclusion>", "success or failure").requiredOption("--title <title>", "One-line verdict shown on the check").option("--summary <summary>", "What was checked and why it passed or failed").action(run(automationCheckCommand));
|