replicas-cli 0.2.342 → 0.2.344
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.mjs +133 -57
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -8685,59 +8685,26 @@ var GOOGLE_ABILITY = {
|
|
|
8685
8685
|
|
|
8686
8686
|
// ../shared/src/default-skills/replicas-agent/abilities/learnings.ts
|
|
8687
8687
|
var SECTION6 = `### Learnings
|
|
8688
|
-
|
|
8688
|
+
Propose additions, updates, or deletions to curated organization knowledge.
|
|
8689
8689
|
|
|
8690
|
-
**Reference:** \`references/LEARNINGS.md
|
|
8691
|
-
|
|
8692
|
-
Use this when:
|
|
8693
|
-
- You are starting a substantive task and have gathered enough context to write a meaningful query
|
|
8694
|
-
- A user corrects you about a durable fact, preference, or process worth keeping
|
|
8695
|
-
- You find an existing learning contradicted by the current code or docs`;
|
|
8690
|
+
**Reference:** \`references/LEARNINGS.md\``;
|
|
8696
8691
|
var REFERENCE6 = `# Learnings
|
|
8697
8692
|
|
|
8698
|
-
Learnings are curated, human-approved knowledge entries your organization maintains: conventions, gotchas, environment facts, and process rules.
|
|
8699
|
-
|
|
8700
|
-
## Reading Learnings
|
|
8701
|
-
|
|
8702
|
-
\`\`\`bash
|
|
8703
|
-
replicas learnings read --query "<enriched query>"
|
|
8704
|
-
\`\`\`
|
|
8705
|
-
|
|
8706
|
-
**When to read:** once you've collected enough context to write a meaningful query \u2014 typically after your first look at the relevant code. Don't wait until you're deep into execution; learnings are most valuable before you commit to an approach.
|
|
8707
|
-
|
|
8708
|
-
**Enrich the query.** Use codebase specifics (feature area, module/component names), not the raw user request. Triggers describe *situations*, so a query grounded in what the task actually touches matches far better.
|
|
8709
|
-
|
|
8710
|
-
Example: the user asks "remove the PRs chart projections". After locating the chart you know it lives in the platform admin dashboard, so query:
|
|
8711
|
-
|
|
8712
|
-
\`\`\`bash
|
|
8713
|
-
replicas learnings read --query "Remove the PRs chart in the platform admin dashboard"
|
|
8714
|
-
\`\`\`
|
|
8715
|
-
|
|
8716
|
-
This matches a learning triggered on "UI/UX work on the admin panel" that the raw request would have missed.
|
|
8717
|
-
|
|
8718
|
-
Output is a list of blocks \u2014 id, name, and content. Use the ids to propose updates or deletions.
|
|
8719
|
-
|
|
8720
|
-
## Proposing changes
|
|
8693
|
+
Learnings are curated, human-approved knowledge entries your organization maintains: conventions, gotchas, environment facts, and process rules.
|
|
8721
8694
|
|
|
8722
8695
|
All writes are proposals: a human reviews them in the dashboard, and nothing takes effect until approved.
|
|
8723
8696
|
|
|
8724
|
-
|
|
8725
|
-
replicas learnings add --name "<short name>" --content "<the knowledge>" [--trigger "<when to surface it>"] [--always] [--global]
|
|
8726
|
-
replicas learnings update <id> [--name "..."] [--content "..."] [--trigger "..."] [--always true|false]
|
|
8727
|
-
replicas learnings delete <id>
|
|
8728
|
-
\`\`\`
|
|
8729
|
-
|
|
8730
|
-
\`--always\` marks an entry as always-returned (no trigger needed); \`--global\` proposes org-wide scope instead of this workspace's environment.
|
|
8697
|
+
Use \`replicas learnings --help\` and subcommand help such as \`replicas learnings add --help\`, \`replicas learnings update --help\`, or \`replicas learnings delete --help\` for current command syntax.
|
|
8731
8698
|
|
|
8732
8699
|
**Be very conservative:**
|
|
8733
|
-
- Propose \`add\` only for
|
|
8700
|
+
- Propose \`add\` only for repeatable, org-useful facts likely to matter again: explicit user corrections, hard-won environment or process knowledge.
|
|
8734
8701
|
- Never store task-specific details, anything derivable by reading the repo, or secrets/credentials.
|
|
8735
|
-
- Propose \`update\` or \`delete\` when a learning is contradicted by the current code or docs
|
|
8702
|
+
- Propose \`update\` or \`delete\` when a learning is contradicted by the current code or docs, especially if the outdated guidance would affect future repeated work.
|
|
8736
8703
|
- Write narrow triggers describing when the entry should surface (e.g. "UI/UX work on the admin panel"), not vague topics.`;
|
|
8737
8704
|
var LEARNINGS_ABILITY = {
|
|
8738
8705
|
label: "Learnings",
|
|
8739
|
-
description: "
|
|
8740
|
-
bullet: "-
|
|
8706
|
+
description: "Propose changes to curated org knowledge for human review.",
|
|
8707
|
+
bullet: "- Proposing changes to organization Learnings (curated, human-approved knowledge)",
|
|
8741
8708
|
section: SECTION6,
|
|
8742
8709
|
referenceFile: { name: "LEARNINGS.md", content: REFERENCE6 }
|
|
8743
8710
|
};
|
|
@@ -9270,6 +9237,7 @@ In agent mode the CLI hides commands that don't make sense for in-workspace agen
|
|
|
9270
9237
|
| "Make an automation that runs every weekday at 9am" | \`replicas automation create\` (interactive) or \`--trigger-cron "0 9 * * 1-5"\` |
|
|
9271
9238
|
| "Make an automation that runs when a PR opens on \`acme/web\`" | \`replicas automation create ... --trigger-github pull_request.opened --trigger-github-repos acme/web\` |
|
|
9272
9239
|
| "Make an automation that runs when an MR opens on \`acme/web\`" | \`replicas automation create ... --trigger-gitlab merge_request.opened --trigger-gitlab-repos acme/web\` |
|
|
9240
|
+
| "Ignore Dependabot for this PR automation" | \`replicas automation edit <id> --trigger-github-exclude-users 'dependabot[bot]'\` |
|
|
9273
9241
|
| "What repos are connected?" | \`replicas repos\` |
|
|
9274
9242
|
| "Set up a \`replicas.json\` in this repo" | \`replicas init\` (\`-y\` for YAML) |
|
|
9275
9243
|
|
|
@@ -9356,13 +9324,15 @@ replicas automation create "Review my PRs" \\
|
|
|
9356
9324
|
--prompt "Leave a code review on this PR" \\
|
|
9357
9325
|
--environment <env-name-or-id> \\
|
|
9358
9326
|
--trigger-github pull_request.opened \\
|
|
9359
|
-
--trigger-github-repos acme/web,acme/api
|
|
9327
|
+
--trigger-github-repos acme/web,acme/api \\
|
|
9328
|
+
--trigger-github-exclude-users 'dependabot[bot],renovate[bot]'
|
|
9360
9329
|
|
|
9361
9330
|
replicas automation create "Review my MRs" \\
|
|
9362
9331
|
--prompt "Leave a code review on this MR" \\
|
|
9363
9332
|
--environment <env-name-or-id> \\
|
|
9364
9333
|
--trigger-gitlab merge_request.opened \\
|
|
9365
|
-
--trigger-gitlab-repos acme/web,acme/api
|
|
9334
|
+
--trigger-gitlab-repos acme/web,acme/api \\
|
|
9335
|
+
--trigger-gitlab-exclude-users 'bot-user'
|
|
9366
9336
|
|
|
9367
9337
|
# Disable on creation
|
|
9368
9338
|
replicas automation create ... --disabled
|
|
@@ -9386,6 +9356,8 @@ replicas automation edit <id> \\
|
|
|
9386
9356
|
--trigger-cron "0 4 * * *" # replaces existing triggers
|
|
9387
9357
|
\`\`\`
|
|
9388
9358
|
|
|
9359
|
+
\`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 trigger.
|
|
9360
|
+
|
|
9389
9361
|
\`replicas automation edit <id>\` with no flags drops into interactive mode.
|
|
9390
9362
|
|
|
9391
9363
|
## Repositories
|
|
@@ -9560,6 +9532,27 @@ var REPLICAS_AGENT_ABILITIES = Object.keys(
|
|
|
9560
9532
|
);
|
|
9561
9533
|
|
|
9562
9534
|
// ../shared/src/routes/preferences.ts
|
|
9535
|
+
var EMPTY_AGENT_DEFAULT_SETTINGS = {
|
|
9536
|
+
agent_provider: null,
|
|
9537
|
+
model: null,
|
|
9538
|
+
thinking_level: null,
|
|
9539
|
+
goal_mode: null,
|
|
9540
|
+
fast_mode: null
|
|
9541
|
+
};
|
|
9542
|
+
var DEFAULT_USER_PREFERENCES = {
|
|
9543
|
+
default_agent: "codex",
|
|
9544
|
+
default_model: null,
|
|
9545
|
+
cursor_models: null,
|
|
9546
|
+
close_workspace_on_pr_close: true,
|
|
9547
|
+
default_environment_id: null,
|
|
9548
|
+
respond_to_ci_workflows: true,
|
|
9549
|
+
respond_to_ci_checks: true,
|
|
9550
|
+
respond_to_human_pr_reviews: false,
|
|
9551
|
+
pr_user_attribution: false,
|
|
9552
|
+
auto_draft_prs: false,
|
|
9553
|
+
default_fast_mode: false,
|
|
9554
|
+
agent_defaults: { ...EMPTY_AGENT_DEFAULT_SETTINGS }
|
|
9555
|
+
};
|
|
9563
9556
|
var DEFAULT_REPLICAS_AGENT_ABILITIES = Object.fromEntries(
|
|
9564
9557
|
REPLICAS_AGENT_ABILITIES.map((key) => [key, true])
|
|
9565
9558
|
);
|
|
@@ -9599,7 +9592,7 @@ var HOOK_EXEC_MAX_BUFFER_BYTES = 10 * 1024 * 1024;
|
|
|
9599
9592
|
var REPLICAS_CONFIG_FILENAMES = ["replicas.json", "replicas.yaml", "replicas.yml"];
|
|
9600
9593
|
|
|
9601
9594
|
// ../shared/src/cli-version.ts
|
|
9602
|
-
var CLI_VERSION = "0.2.
|
|
9595
|
+
var CLI_VERSION = "0.2.344";
|
|
9603
9596
|
|
|
9604
9597
|
// ../shared/src/engine/environment.ts
|
|
9605
9598
|
var DESKTOP_NOVNC_PORT = 6080;
|
|
@@ -13639,6 +13632,20 @@ function parseWorkspaceLifecyclePolicyOption(value) {
|
|
|
13639
13632
|
console.log(chalk18.gray(`Valid options: ${VALID_LIFECYCLE_POLICIES.join(", ")}`));
|
|
13640
13633
|
process.exit(1);
|
|
13641
13634
|
}
|
|
13635
|
+
function parseExcludedActorsOption(value) {
|
|
13636
|
+
if (value === void 0) return void 0;
|
|
13637
|
+
const actors = value.split(",").map((actor) => actor.trim()).filter(Boolean);
|
|
13638
|
+
return actors.length > 0 ? actors : void 0;
|
|
13639
|
+
}
|
|
13640
|
+
function withExcludedActors(config2, excludedActors) {
|
|
13641
|
+
const next = { ...config2 };
|
|
13642
|
+
if (excludedActors?.length) {
|
|
13643
|
+
next.excluded_actors = excludedActors;
|
|
13644
|
+
} else {
|
|
13645
|
+
delete next.excluded_actors;
|
|
13646
|
+
}
|
|
13647
|
+
return next;
|
|
13648
|
+
}
|
|
13642
13649
|
function parseAutomationLifecycleOptions(options) {
|
|
13643
13650
|
if (options.sleepWhenDone && options.lifecycle && options.lifecycle !== "sleep_when_done") {
|
|
13644
13651
|
console.log(chalk18.red("--sleep-when-done cannot be combined with a different --lifecycle value"));
|
|
@@ -13667,13 +13674,19 @@ function formatTrigger(trigger) {
|
|
|
13667
13674
|
}
|
|
13668
13675
|
if (trigger.type === "github") {
|
|
13669
13676
|
const config2 = trigger.config;
|
|
13670
|
-
const
|
|
13671
|
-
|
|
13677
|
+
const details = [
|
|
13678
|
+
config2.repository_ids?.length ? `${config2.repository_ids.length} repo${config2.repository_ids.length > 1 ? "s" : ""} filtered` : null,
|
|
13679
|
+
config2.excluded_actors?.length ? `exclude: ${config2.excluded_actors.join(", ")}` : null
|
|
13680
|
+
].filter(Boolean);
|
|
13681
|
+
return `github: ${config2.event}${details.length > 0 ? ` (${details.join(", ")})` : ""}`;
|
|
13672
13682
|
}
|
|
13673
13683
|
if (trigger.type === "gitlab") {
|
|
13674
13684
|
const config2 = trigger.config;
|
|
13675
|
-
const
|
|
13676
|
-
|
|
13685
|
+
const details = [
|
|
13686
|
+
config2.repository_ids?.length ? `${config2.repository_ids.length} project${config2.repository_ids.length > 1 ? "s" : ""} filtered` : null,
|
|
13687
|
+
config2.excluded_actors?.length ? `exclude: ${config2.excluded_actors.join(", ")}` : null
|
|
13688
|
+
].filter(Boolean);
|
|
13689
|
+
return `gitlab: ${config2.event}${details.length > 0 ? ` (${details.join(", ")})` : ""}`;
|
|
13677
13690
|
}
|
|
13678
13691
|
return `${trigger.type}`;
|
|
13679
13692
|
}
|
|
@@ -13888,11 +13901,18 @@ async function promptForTriggers(repositories) {
|
|
|
13888
13901
|
triggerRepoIds = filterResponse.repos;
|
|
13889
13902
|
}
|
|
13890
13903
|
}
|
|
13904
|
+
const excludedActorsResponse = await prompts4({
|
|
13905
|
+
type: "text",
|
|
13906
|
+
name: "excludedActors",
|
|
13907
|
+
message: "Exclude GitHub users (comma-separated, optional):"
|
|
13908
|
+
});
|
|
13909
|
+
const excludedActors = parseExcludedActorsOption(excludedActorsResponse.excludedActors);
|
|
13891
13910
|
triggers.push({
|
|
13892
13911
|
type: "github",
|
|
13893
13912
|
config: {
|
|
13894
13913
|
event: eventResponse.event,
|
|
13895
|
-
...triggerRepoIds ? { repository_ids: triggerRepoIds } : {}
|
|
13914
|
+
...triggerRepoIds ? { repository_ids: triggerRepoIds } : {},
|
|
13915
|
+
...excludedActors ? { excluded_actors: excludedActors } : {}
|
|
13896
13916
|
}
|
|
13897
13917
|
});
|
|
13898
13918
|
} else if (typeResponse.type === "gitlab") {
|
|
@@ -13916,11 +13936,18 @@ async function promptForTriggers(repositories) {
|
|
|
13916
13936
|
triggerRepoIds = filterResponse.repos;
|
|
13917
13937
|
}
|
|
13918
13938
|
}
|
|
13939
|
+
const excludedActorsResponse = await prompts4({
|
|
13940
|
+
type: "text",
|
|
13941
|
+
name: "excludedActors",
|
|
13942
|
+
message: "Exclude GitLab users (comma-separated, optional):"
|
|
13943
|
+
});
|
|
13944
|
+
const excludedActors = parseExcludedActorsOption(excludedActorsResponse.excludedActors);
|
|
13919
13945
|
triggers.push({
|
|
13920
13946
|
type: "gitlab",
|
|
13921
13947
|
config: {
|
|
13922
13948
|
event: eventResponse.event,
|
|
13923
|
-
...triggerRepoIds ? { repository_ids: triggerRepoIds } : {}
|
|
13949
|
+
...triggerRepoIds ? { repository_ids: triggerRepoIds } : {},
|
|
13950
|
+
...excludedActors ? { excluded_actors: excludedActors } : {}
|
|
13924
13951
|
}
|
|
13925
13952
|
});
|
|
13926
13953
|
}
|
|
@@ -13948,6 +13975,14 @@ async function automationCreateCommand(name, options) {
|
|
|
13948
13975
|
process.exit(1);
|
|
13949
13976
|
}
|
|
13950
13977
|
}
|
|
13978
|
+
if (options.triggerGithubExcludeUsers !== void 0 && !options.triggerGithub) {
|
|
13979
|
+
console.log(chalk18.red("--trigger-github-exclude-users requires --trigger-github"));
|
|
13980
|
+
process.exit(1);
|
|
13981
|
+
}
|
|
13982
|
+
if (options.triggerGitlabExcludeUsers !== void 0 && !options.triggerGitlab) {
|
|
13983
|
+
console.log(chalk18.red("--trigger-gitlab-exclude-users requires --trigger-gitlab"));
|
|
13984
|
+
process.exit(1);
|
|
13985
|
+
}
|
|
13951
13986
|
const agentSelection = applyAgentSelection(
|
|
13952
13987
|
{
|
|
13953
13988
|
agent_provider: parseAgentProviderOption(options.agentProvider),
|
|
@@ -14026,21 +14061,25 @@ async function automationCreateCommand(name, options) {
|
|
|
14026
14061
|
}
|
|
14027
14062
|
if (options.triggerGithub) {
|
|
14028
14063
|
const githubRepoIds = resolveTriggerRepositoryIds(repositories, options.triggerGithubRepos, "github");
|
|
14064
|
+
const githubExcludedActors = parseExcludedActorsOption(options.triggerGithubExcludeUsers);
|
|
14029
14065
|
triggers.push({
|
|
14030
14066
|
type: "github",
|
|
14031
14067
|
config: {
|
|
14032
14068
|
event: options.triggerGithub,
|
|
14033
|
-
...githubRepoIds ? { repository_ids: githubRepoIds } : {}
|
|
14069
|
+
...githubRepoIds ? { repository_ids: githubRepoIds } : {},
|
|
14070
|
+
...githubExcludedActors ? { excluded_actors: githubExcludedActors } : {}
|
|
14034
14071
|
}
|
|
14035
14072
|
});
|
|
14036
14073
|
}
|
|
14037
14074
|
if (options.triggerGitlab) {
|
|
14038
14075
|
const gitlabRepoIds = resolveTriggerRepositoryIds(repositories, options.triggerGitlabRepos, "gitlab");
|
|
14076
|
+
const gitlabExcludedActors = parseExcludedActorsOption(options.triggerGitlabExcludeUsers);
|
|
14039
14077
|
triggers.push({
|
|
14040
14078
|
type: "gitlab",
|
|
14041
14079
|
config: {
|
|
14042
14080
|
event: options.triggerGitlab,
|
|
14043
|
-
...gitlabRepoIds ? { repository_ids: gitlabRepoIds } : {}
|
|
14081
|
+
...gitlabRepoIds ? { repository_ids: gitlabRepoIds } : {},
|
|
14082
|
+
...gitlabExcludedActors ? { excluded_actors: gitlabExcludedActors } : {}
|
|
14044
14083
|
}
|
|
14045
14084
|
});
|
|
14046
14085
|
}
|
|
@@ -14108,6 +14147,15 @@ async function automationEditCommand(id, options) {
|
|
|
14108
14147
|
process.exit(1);
|
|
14109
14148
|
}
|
|
14110
14149
|
}
|
|
14150
|
+
const replacingTriggers = Boolean(options.triggerCron || options.triggerGithub || options.triggerGitlab);
|
|
14151
|
+
if (replacingTriggers && options.triggerGithubExcludeUsers !== void 0 && !options.triggerGithub) {
|
|
14152
|
+
console.log(chalk18.red("--trigger-github-exclude-users requires --trigger-github when replacing triggers"));
|
|
14153
|
+
process.exit(1);
|
|
14154
|
+
}
|
|
14155
|
+
if (replacingTriggers && options.triggerGitlabExcludeUsers !== void 0 && !options.triggerGitlab) {
|
|
14156
|
+
console.log(chalk18.red("--trigger-gitlab-exclude-users requires --trigger-gitlab when replacing triggers"));
|
|
14157
|
+
process.exit(1);
|
|
14158
|
+
}
|
|
14111
14159
|
const parsedAgent = {
|
|
14112
14160
|
agent_provider: parseAgentProviderOption(options.agentProvider),
|
|
14113
14161
|
model: parseModelOption(options.model),
|
|
@@ -14125,7 +14173,7 @@ async function automationEditCommand(id, options) {
|
|
|
14125
14173
|
model: existing.automation.model
|
|
14126
14174
|
});
|
|
14127
14175
|
const body = {};
|
|
14128
|
-
const hasOptions = options.name || options.prompt || options.enabled !== void 0 || options.prFollowups !== void 0 || options.triggerCron || options.triggerGithub || options.triggerGitlab || options.environment || 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;
|
|
14176
|
+
const hasOptions = options.name || options.prompt || options.enabled !== void 0 || options.prFollowups !== void 0 || options.triggerCron || options.triggerGithub || options.triggerGitlab || options.environment || options.triggerGithubExcludeUsers !== void 0 || options.triggerGitlabExcludeUsers !== 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;
|
|
14129
14177
|
if (!hasOptions) {
|
|
14130
14178
|
const nameResponse = await prompts4({
|
|
14131
14179
|
type: "text",
|
|
@@ -14203,11 +14251,13 @@ async function automationEditCommand(id, options) {
|
|
|
14203
14251
|
options.triggerGithubRepos,
|
|
14204
14252
|
"github"
|
|
14205
14253
|
);
|
|
14254
|
+
const githubExcludedActors = parseExcludedActorsOption(options.triggerGithubExcludeUsers);
|
|
14206
14255
|
triggers.push({
|
|
14207
14256
|
type: "github",
|
|
14208
14257
|
config: {
|
|
14209
14258
|
event: options.triggerGithub,
|
|
14210
|
-
...githubRepoIds ? { repository_ids: githubRepoIds } : {}
|
|
14259
|
+
...githubRepoIds ? { repository_ids: githubRepoIds } : {},
|
|
14260
|
+
...githubExcludedActors ? { excluded_actors: githubExcludedActors } : {}
|
|
14211
14261
|
}
|
|
14212
14262
|
});
|
|
14213
14263
|
}
|
|
@@ -14218,15 +14268,41 @@ async function automationEditCommand(id, options) {
|
|
|
14218
14268
|
options.triggerGitlabRepos,
|
|
14219
14269
|
"gitlab"
|
|
14220
14270
|
);
|
|
14271
|
+
const gitlabExcludedActors = parseExcludedActorsOption(options.triggerGitlabExcludeUsers);
|
|
14221
14272
|
triggers.push({
|
|
14222
14273
|
type: "gitlab",
|
|
14223
14274
|
config: {
|
|
14224
14275
|
event: options.triggerGitlab,
|
|
14225
|
-
...gitlabRepoIds ? { repository_ids: gitlabRepoIds } : {}
|
|
14276
|
+
...gitlabRepoIds ? { repository_ids: gitlabRepoIds } : {},
|
|
14277
|
+
...gitlabExcludedActors ? { excluded_actors: gitlabExcludedActors } : {}
|
|
14226
14278
|
}
|
|
14227
14279
|
});
|
|
14228
14280
|
}
|
|
14229
14281
|
body.triggers = triggers;
|
|
14282
|
+
} else if (options.triggerGithubExcludeUsers !== void 0 || options.triggerGitlabExcludeUsers !== void 0) {
|
|
14283
|
+
const githubExcludedActors = parseExcludedActorsOption(options.triggerGithubExcludeUsers);
|
|
14284
|
+
const gitlabExcludedActors = parseExcludedActorsOption(options.triggerGitlabExcludeUsers);
|
|
14285
|
+
let matchedGithub = options.triggerGithubExcludeUsers === void 0;
|
|
14286
|
+
let matchedGitlab = options.triggerGitlabExcludeUsers === void 0;
|
|
14287
|
+
body.triggers = existing.automation.triggers.map((trigger) => {
|
|
14288
|
+
if (trigger.type === "github" && options.triggerGithubExcludeUsers !== void 0) {
|
|
14289
|
+
matchedGithub = true;
|
|
14290
|
+
return { ...trigger, config: withExcludedActors(trigger.config, githubExcludedActors) };
|
|
14291
|
+
}
|
|
14292
|
+
if (trigger.type === "gitlab" && options.triggerGitlabExcludeUsers !== void 0) {
|
|
14293
|
+
matchedGitlab = true;
|
|
14294
|
+
return { ...trigger, config: withExcludedActors(trigger.config, gitlabExcludedActors) };
|
|
14295
|
+
}
|
|
14296
|
+
return trigger;
|
|
14297
|
+
});
|
|
14298
|
+
if (!matchedGithub) {
|
|
14299
|
+
console.log(chalk18.red("No existing GitHub trigger found. Pass --trigger-github to create one."));
|
|
14300
|
+
process.exit(1);
|
|
14301
|
+
}
|
|
14302
|
+
if (!matchedGitlab) {
|
|
14303
|
+
console.log(chalk18.red("No existing GitLab trigger found. Pass --trigger-gitlab to create one."));
|
|
14304
|
+
process.exit(1);
|
|
14305
|
+
}
|
|
14230
14306
|
}
|
|
14231
14307
|
if (options.environment) {
|
|
14232
14308
|
const envResp = await orgAuthenticatedFetch("/v1/environments");
|
|
@@ -20222,7 +20298,7 @@ automation.command("get <id>").description("Get automation details by ID").actio
|
|
|
20222
20298
|
process.exit(1);
|
|
20223
20299
|
}
|
|
20224
20300
|
});
|
|
20225
|
-
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-gitlab <event>", 'GitLab event (e.g. "merge_request.opened")').option("--trigger-gitlab-repos <repos>", "Comma-separated repo names to filter GitLab trigger").option("--lifecycle <policy>", "Workspace lifecycle: archive_when_done, sleep_when_done, delete_after_inactivity, 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 or delete_after_inactivity)").option("--pr-followups", "Allow follow-up actions on matching PRs").option("--agent-provider <provider>", 'Coding agent to use: claude, codex, cursor, relay (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, max (or "none" to clear)').option("--plan-mode", "Run automation messages in plan mode").option("--goal-mode", "Set automation messages as Codex goals").option("--fast-mode", "Run automation messages in fast mode").option("--personal", "Create a personal automation owned by the authenticated user").option("--disabled", "Create in disabled state").action(async (name, options) => {
|
|
20301
|
+
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("--lifecycle <policy>", "Workspace lifecycle: archive_when_done, sleep_when_done, delete_after_inactivity, 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 or delete_after_inactivity)").option("--pr-followups", "Allow follow-up actions on matching PRs").option("--agent-provider <provider>", 'Coding agent to use: claude, codex, cursor, relay (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, max (or "none" to clear)').option("--plan-mode", "Run automation messages in plan mode").option("--goal-mode", "Set automation messages as Codex goals").option("--fast-mode", "Run automation messages in fast mode").option("--personal", "Create a personal automation owned by the authenticated user").option("--disabled", "Create in disabled state").action(async (name, options) => {
|
|
20226
20302
|
try {
|
|
20227
20303
|
await automationCreateCommand(name, {
|
|
20228
20304
|
...options,
|
|
@@ -20237,7 +20313,7 @@ automation.command("create [name]").description("Create a new automation").optio
|
|
|
20237
20313
|
process.exit(1);
|
|
20238
20314
|
}
|
|
20239
20315
|
});
|
|
20240
|
-
automation.command("edit <id>").description("Edit an existing automation").option("-n, --name <name>", "New name").option("-p, --prompt <prompt>", "New prompt").option("-e, --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-gitlab <event>", "Set GitLab event (replaces existing triggers)").option("--trigger-gitlab-repos <repos>", "Comma-separated repo names to filter GitLab trigger").option("--environment <environment>", "Environment name or ID").option("--lifecycle <policy>", "Workspace lifecycle: archive_when_done, sleep_when_done, delete_after_inactivity, 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 or delete_after_inactivity)").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, relay (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, 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 Codex goals (true/false)", parseBooleanOption).option("--fast-mode <enabled>", "Run automation messages in fast mode (true/false)", parseBooleanOption).action(async (id, options) => {
|
|
20316
|
+
automation.command("edit <id>").description("Edit an existing automation").option("-n, --name <name>", "New name").option("-p, --prompt <prompt>", "New prompt").option("-e, --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("--environment <environment>", "Environment name or ID").option("--lifecycle <policy>", "Workspace lifecycle: archive_when_done, sleep_when_done, delete_after_inactivity, 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 or delete_after_inactivity)").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, relay (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, 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 Codex goals (true/false)", parseBooleanOption).option("--fast-mode <enabled>", "Run automation messages in fast mode (true/false)", parseBooleanOption).action(async (id, options) => {
|
|
20241
20317
|
try {
|
|
20242
20318
|
await automationEditCommand(id, options);
|
|
20243
20319
|
} catch (error) {
|