replicas-cli 0.3.2 → 0.3.4
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 +106 -46
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -22988,7 +22988,8 @@ var sendChatMessageRequestSchema = external_exports.object({
|
|
|
22988
22988
|
senderDisplayName: external_exports.string().optional(),
|
|
22989
22989
|
senderAvatarUrl: external_exports.string().optional(),
|
|
22990
22990
|
errorNotificationTarget: integrationErrorNotificationTargetSchema.optional(),
|
|
22991
|
-
errorNotificationTargets: external_exports.array(integrationErrorNotificationTargetSchema).optional()
|
|
22991
|
+
errorNotificationTargets: external_exports.array(integrationErrorNotificationTargetSchema).optional(),
|
|
22992
|
+
streamSlackActivity: external_exports.boolean().optional()
|
|
22992
22993
|
}).passthrough();
|
|
22993
22994
|
function normalizeCodexAspTranscriptStatus(status, failed = false) {
|
|
22994
22995
|
if (failed || status === "failed" || status === "declined") return "failed";
|
|
@@ -23646,15 +23647,65 @@ function areUserMessagesWithinMatchWindow(a, b) {
|
|
|
23646
23647
|
// ../shared/src/uuid.ts
|
|
23647
23648
|
var UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
23648
23649
|
|
|
23650
|
+
// ../shared/src/automations/github/index.ts
|
|
23651
|
+
var REPO_FILTER_PARAM = {
|
|
23652
|
+
id: "repository_ids",
|
|
23653
|
+
label: "Filter by repository",
|
|
23654
|
+
type: "repository_ids"
|
|
23655
|
+
};
|
|
23656
|
+
var EXCLUDED_ACTORS_PARAM = {
|
|
23657
|
+
id: "excluded_actors",
|
|
23658
|
+
label: "Exclude users",
|
|
23659
|
+
type: "excluded_actors"
|
|
23660
|
+
};
|
|
23661
|
+
var REVIEWER_LOGINS_PARAM = {
|
|
23662
|
+
id: "reviewer_logins",
|
|
23663
|
+
label: "Requested reviewers",
|
|
23664
|
+
type: "reviewer_logins",
|
|
23665
|
+
required: true
|
|
23666
|
+
};
|
|
23667
|
+
var GROUP_PR_EVENTS_PARAM = {
|
|
23668
|
+
id: "group_pr_events",
|
|
23669
|
+
label: "Group PR events to same workspace",
|
|
23670
|
+
type: "boolean"
|
|
23671
|
+
};
|
|
23672
|
+
var REVIEW_REQUESTED_EVENT = "pull_request.review_requested";
|
|
23673
|
+
var GITHUB_TRIGGER = {
|
|
23674
|
+
type: "github",
|
|
23675
|
+
label: "GitHub",
|
|
23676
|
+
description: "Trigger on repository events",
|
|
23677
|
+
icon: "github",
|
|
23678
|
+
events: [
|
|
23679
|
+
{ id: "pull_request.opened", label: "PR opened", parameters: [REPO_FILTER_PARAM, EXCLUDED_ACTORS_PARAM, GROUP_PR_EVENTS_PARAM] },
|
|
23680
|
+
{ id: "pull_request.synchronize", label: "PR updated (new commits)", parameters: [REPO_FILTER_PARAM, EXCLUDED_ACTORS_PARAM, GROUP_PR_EVENTS_PARAM] },
|
|
23681
|
+
{ id: REVIEW_REQUESTED_EVENT, label: "PR review requested", parameters: [REVIEWER_LOGINS_PARAM, REPO_FILTER_PARAM, EXCLUDED_ACTORS_PARAM] },
|
|
23682
|
+
{ id: "pull_request.merged", label: "PR merged", parameters: [REPO_FILTER_PARAM, EXCLUDED_ACTORS_PARAM] },
|
|
23683
|
+
{ id: "pull_request.closed", label: "PR closed", parameters: [REPO_FILTER_PARAM, EXCLUDED_ACTORS_PARAM] },
|
|
23684
|
+
{ id: "pull_request.command", label: "PR command (/replicas run)", parameters: [REPO_FILTER_PARAM, EXCLUDED_ACTORS_PARAM, GROUP_PR_EVENTS_PARAM] }
|
|
23685
|
+
]
|
|
23686
|
+
};
|
|
23687
|
+
|
|
23649
23688
|
// ../shared/src/automations/trigger-schemas.ts
|
|
23689
|
+
function getReviewerLoginsError(event, logins) {
|
|
23690
|
+
const isReviewRequested = event === REVIEW_REQUESTED_EVENT;
|
|
23691
|
+
if (isReviewRequested === !!logins?.some((login) => login.trim().replace(/^@+/, ""))) return null;
|
|
23692
|
+
return isReviewRequested ? "The PR review requested trigger needs at least one GitHub username" : "Requested reviewers only apply to the PR review requested trigger";
|
|
23693
|
+
}
|
|
23650
23694
|
var repositoryTriggerConfigSchema = external_exports.object({
|
|
23651
23695
|
event: external_exports.string(),
|
|
23652
23696
|
repository_ids: external_exports.array(external_exports.string().regex(UUID_RE, "must be a repository id")).optional(),
|
|
23653
23697
|
group_pr_events: external_exports.boolean().optional(),
|
|
23654
|
-
excluded_actors: external_exports.array(external_exports.string()).optional()
|
|
23698
|
+
excluded_actors: external_exports.array(external_exports.string()).optional(),
|
|
23699
|
+
reviewer_logins: external_exports.array(external_exports.string()).optional()
|
|
23655
23700
|
});
|
|
23656
23701
|
var cronTriggerSchema = external_exports.object({ type: external_exports.literal("cron"), config: external_exports.object({ schedule: external_exports.string(), timezone: external_exports.string().optional() }) });
|
|
23657
|
-
var githubTriggerSchema = external_exports.object({
|
|
23702
|
+
var githubTriggerSchema = external_exports.object({
|
|
23703
|
+
type: external_exports.literal("github"),
|
|
23704
|
+
config: repositoryTriggerConfigSchema.superRefine((config3, ctx) => {
|
|
23705
|
+
const message2 = getReviewerLoginsError(config3.event, config3.reviewer_logins);
|
|
23706
|
+
if (message2) ctx.addIssue({ code: "custom", message: message2, path: ["reviewer_logins"] });
|
|
23707
|
+
})
|
|
23708
|
+
});
|
|
23658
23709
|
var gitlabTriggerSchema = external_exports.object({ type: external_exports.literal("gitlab"), config: repositoryTriggerConfigSchema });
|
|
23659
23710
|
var automationTriggerSchema = external_exports.discriminatedUnion("type", [
|
|
23660
23711
|
cronTriggerSchema,
|
|
@@ -23721,9 +23772,22 @@ var mcpWorkloadAuthSchema = external_exports.strictObject({
|
|
|
23721
23772
|
type: external_exports.literal("workspace_identity"),
|
|
23722
23773
|
audience: workspaceAudienceSchema
|
|
23723
23774
|
});
|
|
23775
|
+
var mcpAuthSchema = external_exports.discriminatedUnion("type", [
|
|
23776
|
+
mcpWorkloadAuthSchema,
|
|
23777
|
+
external_exports.strictObject({ type: external_exports.literal("oauth") })
|
|
23778
|
+
]);
|
|
23724
23779
|
function identityTokenUrl() {
|
|
23725
23780
|
return `http://127.0.0.1:${IDENTITY_PROXY_PORT}${IDENTITY_TOKEN_PATH}`;
|
|
23726
23781
|
}
|
|
23782
|
+
var engineMcpOAuthTokenRequestSchema = external_exports.object({
|
|
23783
|
+
environment_mcp_id: external_exports.string().uuid(),
|
|
23784
|
+
force_refresh: external_exports.boolean().optional()
|
|
23785
|
+
});
|
|
23786
|
+
var engineMcpOAuthTokenResponseSchema = external_exports.object({
|
|
23787
|
+
url: external_exports.string(),
|
|
23788
|
+
access_token: external_exports.string(),
|
|
23789
|
+
expires_at: external_exports.string().nullable()
|
|
23790
|
+
});
|
|
23727
23791
|
|
|
23728
23792
|
// ../shared/src/routes/environment.ts
|
|
23729
23793
|
var ENVIRONMENT_MCP_TRANSPORTS = ["stdio", "http", "sse"];
|
|
@@ -23733,7 +23797,7 @@ var createEnvironmentMcpRequestSchema = external_exports.object({
|
|
|
23733
23797
|
transport: external_exports.enum(ENVIRONMENT_MCP_TRANSPORTS),
|
|
23734
23798
|
config: external_exports.union([
|
|
23735
23799
|
external_exports.object({ command: external_exports.string().min(1), args: external_exports.array(external_exports.string()).optional(), env: stringMap.optional() }),
|
|
23736
|
-
external_exports.object({ url: external_exports.url(), headers: stringMap.optional(), auth:
|
|
23800
|
+
external_exports.object({ url: external_exports.url(), headers: stringMap.optional(), auth: mcpAuthSchema.optional() })
|
|
23737
23801
|
]).describe("stdio: `{ command, args, env }`. http/sse: `{ url, headers }`.")
|
|
23738
23802
|
});
|
|
23739
23803
|
var updateEnvironmentMcpRequestSchema = createEnvironmentMcpRequestSchema.partial();
|
|
@@ -24336,7 +24400,7 @@ Trigger shapes:
|
|
|
24336
24400
|
{ "type": "cron", "config": { "schedule": "0 9 * * 1-5", "timezone": "UTC" } }
|
|
24337
24401
|
\`\`\`
|
|
24338
24402
|
|
|
24339
|
-
GitHub events: \`pull_request.opened\`, \`pull_request.synchronize\`, \`pull_request.merged\`, \`pull_request.closed\`. GitLab events: \`merge_request.opened\`, \`merge_request.updated\`, \`merge_request.merged\`, \`merge_request.closed\`. Use one trigger type family per automation and pick the code host the repositories actually live on.
|
|
24403
|
+
GitHub events: \`pull_request.opened\`, \`pull_request.synchronize\`, \`pull_request.review_requested\` (requires a \`reviewer_logins\` list of GitHub usernames), \`pull_request.merged\`, \`pull_request.closed\`. GitLab events: \`merge_request.opened\`, \`merge_request.updated\`, \`merge_request.merged\`, \`merge_request.closed\`. Use one trigger type family per automation and pick the code host the repositories actually live on.
|
|
24340
24404
|
|
|
24341
24405
|
Test the hooks before proposing them: run the drafted warm hook and start hook scripts in this workspace (from \`~/workspaces\`) and fix the earliest failure until both exit 0 on a second run.
|
|
24342
24406
|
|
|
@@ -27390,6 +27454,11 @@ function parseClaudeEvents(events, parentToolUseId) {
|
|
|
27390
27454
|
const completedStreamIds = /* @__PURE__ */ new Set();
|
|
27391
27455
|
const supersededStreamIds = /* @__PURE__ */ new Set();
|
|
27392
27456
|
let liveStreamId = null;
|
|
27457
|
+
const endStreamingTools = (exceptStreamId) => {
|
|
27458
|
+
for (const streamId of streamingTools.keys()) {
|
|
27459
|
+
if (streamId !== exceptStreamId) streamingTools.delete(streamId);
|
|
27460
|
+
}
|
|
27461
|
+
};
|
|
27393
27462
|
let compaction;
|
|
27394
27463
|
const assistantThinking = /* @__PURE__ */ new Map();
|
|
27395
27464
|
const assistantTextCounts = /* @__PURE__ */ new Map();
|
|
@@ -27443,6 +27512,7 @@ function parseClaudeEvents(events, parentToolUseId) {
|
|
|
27443
27512
|
supersededStreamIds.add(liveStreamId);
|
|
27444
27513
|
}
|
|
27445
27514
|
liveStreamId = payload.streamId;
|
|
27515
|
+
endStreamingTools(payload.streamId);
|
|
27446
27516
|
const existing = partialIndexes.get(payload.streamId) ?? {};
|
|
27447
27517
|
if (payload.thinking && !assistantThinking.has(payload.streamId)) {
|
|
27448
27518
|
const reasoningMessage = {
|
|
@@ -27540,6 +27610,7 @@ function parseClaudeEvents(events, parentToolUseId) {
|
|
|
27540
27610
|
}
|
|
27541
27611
|
const streamRefs = messageId ? partialIndexes.get(messageId) : void 0;
|
|
27542
27612
|
if (messageId) {
|
|
27613
|
+
endStreamingTools(messageId);
|
|
27543
27614
|
if (liveStreamId !== null && liveStreamId !== messageId) {
|
|
27544
27615
|
supersededStreamIds.add(liveStreamId);
|
|
27545
27616
|
}
|
|
@@ -27654,6 +27725,7 @@ function parseClaudeEvents(events, parentToolUseId) {
|
|
|
27654
27725
|
}
|
|
27655
27726
|
});
|
|
27656
27727
|
}
|
|
27728
|
+
if (event.type === "claude-result" || event.type === CHAT_INTERRUPTED_EVENT_TYPE) endStreamingTools();
|
|
27657
27729
|
if (compaction && (event.type === "claude-result" || event.type === CHAT_INTERRUPTED_EVENT_TYPE)) {
|
|
27658
27730
|
compaction.status = "failed";
|
|
27659
27731
|
compaction.completedAt = event.timestamp;
|
|
@@ -28245,7 +28317,7 @@ var headlessAgentRequestSchema = external_exports.object({
|
|
|
28245
28317
|
});
|
|
28246
28318
|
|
|
28247
28319
|
// ../shared/src/cli-version.ts
|
|
28248
|
-
var CLI_VERSION = "0.3.
|
|
28320
|
+
var CLI_VERSION = "0.3.4";
|
|
28249
28321
|
|
|
28250
28322
|
// ../shared/src/version.ts
|
|
28251
28323
|
function compareVersions(v1, v2) {
|
|
@@ -28806,36 +28878,6 @@ function validateAgentSelection(body, existing, modelCatalogs = {}) {
|
|
|
28806
28878
|
return createSuccessResult({ agentProvider, model: model2, thinkingLevel: thinkingLevel2 });
|
|
28807
28879
|
}
|
|
28808
28880
|
|
|
28809
|
-
// ../shared/src/automations/github/index.ts
|
|
28810
|
-
var REPO_FILTER_PARAM = {
|
|
28811
|
-
id: "repository_ids",
|
|
28812
|
-
label: "Filter by repository",
|
|
28813
|
-
type: "repository_ids"
|
|
28814
|
-
};
|
|
28815
|
-
var EXCLUDED_ACTORS_PARAM = {
|
|
28816
|
-
id: "excluded_actors",
|
|
28817
|
-
label: "Exclude users",
|
|
28818
|
-
type: "excluded_actors"
|
|
28819
|
-
};
|
|
28820
|
-
var GROUP_PR_EVENTS_PARAM = {
|
|
28821
|
-
id: "group_pr_events",
|
|
28822
|
-
label: "Group PR events to same workspace",
|
|
28823
|
-
type: "boolean"
|
|
28824
|
-
};
|
|
28825
|
-
var GITHUB_TRIGGER = {
|
|
28826
|
-
type: "github",
|
|
28827
|
-
label: "GitHub",
|
|
28828
|
-
description: "Trigger on repository events",
|
|
28829
|
-
icon: "github",
|
|
28830
|
-
events: [
|
|
28831
|
-
{ id: "pull_request.opened", label: "PR opened", parameters: [REPO_FILTER_PARAM, EXCLUDED_ACTORS_PARAM, GROUP_PR_EVENTS_PARAM] },
|
|
28832
|
-
{ id: "pull_request.synchronize", label: "PR updated (new commits)", parameters: [REPO_FILTER_PARAM, EXCLUDED_ACTORS_PARAM, GROUP_PR_EVENTS_PARAM] },
|
|
28833
|
-
{ id: "pull_request.merged", label: "PR merged", parameters: [REPO_FILTER_PARAM, EXCLUDED_ACTORS_PARAM] },
|
|
28834
|
-
{ id: "pull_request.closed", label: "PR closed", parameters: [REPO_FILTER_PARAM, EXCLUDED_ACTORS_PARAM] },
|
|
28835
|
-
{ id: "pull_request.command", label: "PR command (/replicas run)", parameters: [REPO_FILTER_PARAM, EXCLUDED_ACTORS_PARAM, GROUP_PR_EVENTS_PARAM] }
|
|
28836
|
-
]
|
|
28837
|
-
};
|
|
28838
|
-
|
|
28839
28881
|
// ../shared/src/automations/gitlab/index.ts
|
|
28840
28882
|
var REPO_FILTER_PARAM2 = {
|
|
28841
28883
|
id: "repository_ids",
|
|
@@ -32506,11 +32548,16 @@ function parseWorkspaceLifecyclePolicyOption(value) {
|
|
|
32506
32548
|
if (isAutomationLifecyclePolicy(value)) return value;
|
|
32507
32549
|
throw new Error(`Invalid lifecycle policy: ${value}. Valid options: ${AUTOMATION_LIFECYCLE_POLICIES.join(", ")}`);
|
|
32508
32550
|
}
|
|
32509
|
-
function
|
|
32551
|
+
function parseActorListOption(value) {
|
|
32510
32552
|
if (value === void 0) return void 0;
|
|
32511
32553
|
const actors = value.split(",").map((actor) => actor.trim()).filter(Boolean);
|
|
32512
32554
|
return actors.length > 0 ? actors : void 0;
|
|
32513
32555
|
}
|
|
32556
|
+
function validateGithubReviewersOption(options) {
|
|
32557
|
+
if (options.triggerGithubReviewers !== void 0 && !options.triggerGithub) throw new Error("--trigger-github-reviewers requires --trigger-github");
|
|
32558
|
+
const error51 = options.triggerGithub && getReviewerLoginsError(options.triggerGithub, parseActorListOption(options.triggerGithubReviewers));
|
|
32559
|
+
if (error51) throw new Error(`${error51} (--trigger-github-reviewers)`);
|
|
32560
|
+
}
|
|
32514
32561
|
var DURATION_UNIT_MS = { m: 6e4, h: 36e5, d: 864e5, w: 6048e5 };
|
|
32515
32562
|
function parseDuration(value) {
|
|
32516
32563
|
const parts = [...value.trim().toLowerCase().matchAll(/(\d+)\s*([mhdw])/g)];
|
|
@@ -32595,6 +32642,7 @@ function formatTrigger(trigger) {
|
|
|
32595
32642
|
const config3 = trigger.config;
|
|
32596
32643
|
const details = [
|
|
32597
32644
|
config3.repository_ids?.length ? `${config3.repository_ids.length} repo${config3.repository_ids.length > 1 ? "s" : ""} filtered` : null,
|
|
32645
|
+
config3.reviewer_logins?.length ? `reviewers: ${config3.reviewer_logins.join(", ")}` : null,
|
|
32598
32646
|
config3.excluded_actors?.length ? `exclude: ${config3.excluded_actors.join(", ")}` : null
|
|
32599
32647
|
].filter(Boolean);
|
|
32600
32648
|
return `github: ${config3.event}${details.length > 0 ? ` (${details.join(", ")})` : ""}`;
|
|
@@ -32636,13 +32684,15 @@ function buildTriggersFromOptions(options, runAt, repositories) {
|
|
|
32636
32684
|
for (const [type, event, repoNames, excludeUsers] of providerTriggers) {
|
|
32637
32685
|
if (!event) continue;
|
|
32638
32686
|
const repositoryIds = resolveTriggerRepositoryIds(repositories, repoNames, type);
|
|
32639
|
-
const excludedActors =
|
|
32687
|
+
const excludedActors = parseActorListOption(excludeUsers);
|
|
32688
|
+
const reviewerLogins = type === "github" ? parseActorListOption(options.triggerGithubReviewers) : void 0;
|
|
32640
32689
|
triggers.push({
|
|
32641
32690
|
type,
|
|
32642
32691
|
config: {
|
|
32643
32692
|
event,
|
|
32644
32693
|
...repositoryIds ? { repository_ids: repositoryIds } : {},
|
|
32645
|
-
...excludedActors ? { excluded_actors: excludedActors } : {}
|
|
32694
|
+
...excludedActors ? { excluded_actors: excludedActors } : {},
|
|
32695
|
+
...reviewerLogins ? { reviewer_logins: reviewerLogins } : {}
|
|
32646
32696
|
}
|
|
32647
32697
|
});
|
|
32648
32698
|
}
|
|
@@ -32854,13 +32904,21 @@ async function promptForTriggers(repositories) {
|
|
|
32854
32904
|
name: "excludedActors",
|
|
32855
32905
|
message: "Exclude GitHub users (comma-separated, optional):"
|
|
32856
32906
|
});
|
|
32857
|
-
const excludedActors =
|
|
32907
|
+
const excludedActors = parseActorListOption(excludedActorsResponse.excludedActors);
|
|
32908
|
+
const reviewerLogins = eventResponse.event === REVIEW_REQUESTED_EVENT ? parseActorListOption((await ask({
|
|
32909
|
+
type: "text",
|
|
32910
|
+
name: "reviewers",
|
|
32911
|
+
message: "Fire when review is requested from (comma-separated GitHub users):",
|
|
32912
|
+
validate: (value) => parseActorListOption(value) ? true : "Enter at least one GitHub username"
|
|
32913
|
+
})).reviewers) : void 0;
|
|
32914
|
+
if (eventResponse.event === REVIEW_REQUESTED_EVENT && !reviewerLogins) return triggers;
|
|
32858
32915
|
triggers.push({
|
|
32859
32916
|
type: "github",
|
|
32860
32917
|
config: {
|
|
32861
32918
|
event: eventResponse.event,
|
|
32862
32919
|
...triggerRepoIds ? { repository_ids: triggerRepoIds } : {},
|
|
32863
|
-
...excludedActors ? { excluded_actors: excludedActors } : {}
|
|
32920
|
+
...excludedActors ? { excluded_actors: excludedActors } : {},
|
|
32921
|
+
...reviewerLogins ? { reviewer_logins: reviewerLogins } : {}
|
|
32864
32922
|
}
|
|
32865
32923
|
});
|
|
32866
32924
|
} else if (typeResponse.type === "gitlab") {
|
|
@@ -32889,7 +32947,7 @@ async function promptForTriggers(repositories) {
|
|
|
32889
32947
|
name: "excludedActors",
|
|
32890
32948
|
message: "Exclude GitLab users (comma-separated, optional):"
|
|
32891
32949
|
});
|
|
32892
|
-
const excludedActors =
|
|
32950
|
+
const excludedActors = parseActorListOption(excludedActorsResponse.excludedActors);
|
|
32893
32951
|
triggers.push({
|
|
32894
32952
|
type: "gitlab",
|
|
32895
32953
|
config: {
|
|
@@ -32922,6 +32980,7 @@ async function automationCreateCommand(name, options) {
|
|
|
32922
32980
|
if (isNaN(minutes) || minutes < 3 || minutes > 1440) throw new Error("--auto-stop-minutes must be between 3 and 1440");
|
|
32923
32981
|
}
|
|
32924
32982
|
if (options.triggerGithubExcludeUsers !== void 0 && !options.triggerGithub) throw new Error("--trigger-github-exclude-users requires --trigger-github");
|
|
32983
|
+
validateGithubReviewersOption(options);
|
|
32925
32984
|
if (options.triggerGitlabExcludeUsers !== void 0 && !options.triggerGitlab) throw new Error("--trigger-gitlab-exclude-users requires --trigger-gitlab");
|
|
32926
32985
|
const agentSelection = applyAgentSelection(
|
|
32927
32986
|
{
|
|
@@ -33060,6 +33119,7 @@ async function automationEditCommand(id, options) {
|
|
|
33060
33119
|
}
|
|
33061
33120
|
const replacingTriggers = Boolean(options.triggerCron || options.triggerGithub || options.triggerGitlab);
|
|
33062
33121
|
if (replacingTriggers && options.triggerGithubExcludeUsers !== void 0 && !options.triggerGithub) throw new Error("--trigger-github-exclude-users requires --trigger-github when replacing triggers");
|
|
33122
|
+
validateGithubReviewersOption(options);
|
|
33063
33123
|
if (replacingTriggers && options.triggerGitlabExcludeUsers !== void 0 && !options.triggerGitlab) throw new Error("--trigger-gitlab-exclude-users requires --trigger-gitlab when replacing triggers");
|
|
33064
33124
|
const parsedAgent = {
|
|
33065
33125
|
agent_provider: parseAgentProviderOption(options.agentProvider),
|
|
@@ -33149,8 +33209,8 @@ async function automationEditCommand(id, options) {
|
|
|
33149
33209
|
const triggers = buildTriggersFromOptions(options, runAt, repositories);
|
|
33150
33210
|
body.triggers = triggers;
|
|
33151
33211
|
} else if (options.triggerGithubExcludeUsers !== void 0 || options.triggerGitlabExcludeUsers !== void 0) {
|
|
33152
|
-
const githubExcludedActors =
|
|
33153
|
-
const gitlabExcludedActors =
|
|
33212
|
+
const githubExcludedActors = parseActorListOption(options.triggerGithubExcludeUsers);
|
|
33213
|
+
const gitlabExcludedActors = parseActorListOption(options.triggerGitlabExcludeUsers);
|
|
33154
33214
|
let matchedGithub = options.triggerGithubExcludeUsers === void 0;
|
|
33155
33215
|
let matchedGitlab = options.triggerGitlabExcludeUsers === void 0;
|
|
33156
33216
|
body.triggers = existing.automation.triggers.map((trigger) => {
|
|
@@ -34026,8 +34086,8 @@ credentials.command("remove <service>").description("Remove stored credentials f
|
|
|
34026
34086
|
var automation = program.command("automation").alias("auto").description("Manage automations");
|
|
34027
34087
|
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));
|
|
34028
34088
|
automation.command("get <id>").description("Get automation details by ID").action(run(automationGetCommand));
|
|
34029
|
-
automation.command("create [name]").description("Create a new automation").option("-p, --prompt <prompt>", "Prompt for the automation").option("-e, --environment <environment>", "Environment name or ID").option("--trigger-cron <schedule>", 'Cron schedule expression (e.g. "0 9 * * 1-5")').option("--trigger-cron-timezone <timezone>", "Timezone for cron trigger (default: UTC)").option("--trigger-github <event>", 'GitHub event (e.g. "pull_request.opened")').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-gitlab <event>", 'GitLab event (e.g. "merge_request.opened")').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: archive_when_done, sleep_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 })));
|
|
34030
|
-
automation.command("edit <id>").description("Edit an existing automation").option("-n, --name <name>", "New name").option("-p, --prompt <prompt>", "New prompt").option("--enabled <enabled>", "Enable or disable (true/false)").option("--trigger-cron <schedule>", "Set cron schedule (replaces existing triggers)").option("--trigger-cron-timezone <timezone>", "Timezone for cron trigger").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-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: archive_when_done, sleep_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).action(run(automationEditCommand));
|
|
34089
|
+
automation.command("create [name]").description("Create a new automation").option("-p, --prompt <prompt>", "Prompt for the automation").option("-e, --environment <environment>", "Environment name or ID").option("--trigger-cron <schedule>", 'Cron schedule expression (e.g. "0 9 * * 1-5")').option("--trigger-cron-timezone <timezone>", "Timezone for cron trigger (default: UTC)").option("--trigger-github <event>", 'GitHub event (e.g. "pull_request.opened")').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")').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: archive_when_done, sleep_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 })));
|
|
34090
|
+
automation.command("edit <id>").description("Edit an existing automation").option("-n, --name <name>", "New name").option("-p, --prompt <prompt>", "New prompt").option("--enabled <enabled>", "Enable or disable (true/false)").option("--trigger-cron <schedule>", "Set cron schedule (replaces existing triggers)").option("--trigger-cron-timezone <timezone>", "Timezone for cron trigger").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: archive_when_done, sleep_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).action(run(automationEditCommand));
|
|
34031
34091
|
automation.command("run <id>").description("Manually trigger an automation (cron-triggered automations only)").action(run(automationRunCommand));
|
|
34032
34092
|
automation.command("delete <id>").description("Delete an automation").option("-f, --force", "Skip confirmation prompt").action(run(automationDeleteCommand));
|
|
34033
34093
|
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));
|