replicas-cli 0.2.273 → 0.2.274
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 +41 -22
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -9236,7 +9236,7 @@ var HOOK_EXEC_MAX_BUFFER_BYTES = 10 * 1024 * 1024;
|
|
|
9236
9236
|
var REPLICAS_CONFIG_FILENAMES = ["replicas.json", "replicas.yaml", "replicas.yml"];
|
|
9237
9237
|
|
|
9238
9238
|
// ../shared/src/cli-version.ts
|
|
9239
|
-
var CLI_VERSION = "0.2.
|
|
9239
|
+
var CLI_VERSION = "0.2.274";
|
|
9240
9240
|
|
|
9241
9241
|
// ../shared/src/engine/environment.ts
|
|
9242
9242
|
var DESKTOP_NOVNC_PORT = 6080;
|
|
@@ -9323,6 +9323,7 @@ function normalizeCodexAspTranscriptStatus(status, failed = false) {
|
|
|
9323
9323
|
}
|
|
9324
9324
|
|
|
9325
9325
|
// ../shared/src/routes/workspaces.ts
|
|
9326
|
+
var VALID_LIFECYCLE_POLICIES = ["default", "delete_when_done", "delete_after_inactivity"];
|
|
9326
9327
|
function workspaceConfigWithCapabilities(config2, capabilities = {}) {
|
|
9327
9328
|
const mergedCapabilities = {
|
|
9328
9329
|
...config2?.capabilities,
|
|
@@ -12824,6 +12825,16 @@ function parseModelOption(value) {
|
|
|
12824
12825
|
if (trimmed === "" || trimmed.toLowerCase() === "none") return null;
|
|
12825
12826
|
return normalizeClaudeModel(trimmed) ?? trimmed;
|
|
12826
12827
|
}
|
|
12828
|
+
function isWorkspaceLifecyclePolicy(value) {
|
|
12829
|
+
return VALID_LIFECYCLE_POLICIES.some((policy) => policy === value);
|
|
12830
|
+
}
|
|
12831
|
+
function parseWorkspaceLifecyclePolicyOption(value) {
|
|
12832
|
+
if (!value) return void 0;
|
|
12833
|
+
if (isWorkspaceLifecyclePolicy(value)) return value;
|
|
12834
|
+
console.log(chalk18.red(`Invalid lifecycle policy: ${value}`));
|
|
12835
|
+
console.log(chalk18.gray(`Valid options: ${VALID_LIFECYCLE_POLICIES.join(", ")}`));
|
|
12836
|
+
process.exit(1);
|
|
12837
|
+
}
|
|
12827
12838
|
function applyAgentSelection(body, existing) {
|
|
12828
12839
|
const result = validateAgentSelection(body, existing);
|
|
12829
12840
|
if (!result.ok) {
|
|
@@ -12864,6 +12875,14 @@ function formatAgentSummary(automation2) {
|
|
|
12864
12875
|
}
|
|
12865
12876
|
return parts.join(" / ");
|
|
12866
12877
|
}
|
|
12878
|
+
function formatModeSummary(automation2) {
|
|
12879
|
+
const modes = [
|
|
12880
|
+
automation2.plan_mode ? "plan" : null,
|
|
12881
|
+
automation2.goal_mode ? "goal" : null,
|
|
12882
|
+
automation2.fast_mode ? "fast" : null
|
|
12883
|
+
].filter(Boolean);
|
|
12884
|
+
return modes.length > 0 ? modes.join(", ") : "default";
|
|
12885
|
+
}
|
|
12867
12886
|
function resolveSelectableEnvironmentId(envInput, selectableEnvs) {
|
|
12868
12887
|
const env = selectableEnvs.find((e) => e.name === envInput || e.id === envInput);
|
|
12869
12888
|
if (!env) {
|
|
@@ -12896,6 +12915,9 @@ function printAutomation(automation2) {
|
|
|
12896
12915
|
if (automation2.agent_provider || automation2.model || automation2.thinking_level) {
|
|
12897
12916
|
console.log(chalk18.gray(` Agent: ${formatAgentSummary(automation2)}`));
|
|
12898
12917
|
}
|
|
12918
|
+
if (automation2.plan_mode || automation2.goal_mode || automation2.fast_mode) {
|
|
12919
|
+
console.log(chalk18.gray(` Modes: ${formatModeSummary(automation2)}`));
|
|
12920
|
+
}
|
|
12899
12921
|
console.log(chalk18.gray(` PR Follow-ups: ${automation2.config.capabilities?.pr_followups === true ? chalk18.green("managed") : "read-only"}`));
|
|
12900
12922
|
console.log(chalk18.gray(` Created: ${formatDate2(automation2.created_at)}`));
|
|
12901
12923
|
console.log(chalk18.gray(` Updated: ${formatDate2(automation2.updated_at)}`));
|
|
@@ -12967,6 +12989,7 @@ Automation: ${automation2.name}
|
|
|
12967
12989
|
console.log(chalk18.gray(` Agent: ${automation2.agent_provider ? getProviderDisplayName(automation2.agent_provider) : "organization default"}`));
|
|
12968
12990
|
console.log(chalk18.gray(` Model: ${automation2.model ? MODEL_LABELS[automation2.model] ?? automation2.model : "agent default"}`));
|
|
12969
12991
|
console.log(chalk18.gray(` Thinking Level: ${automation2.thinking_level ?? "agent default"}`));
|
|
12992
|
+
console.log(chalk18.gray(` Modes: ${formatModeSummary(automation2)}`));
|
|
12970
12993
|
console.log(chalk18.gray(` PR Follow-ups: ${automation2.config.capabilities?.pr_followups === true ? "managed" : "read-only"}`));
|
|
12971
12994
|
console.log(chalk18.gray(` Created: ${formatDate2(automation2.created_at)}`));
|
|
12972
12995
|
console.log(chalk18.gray(` Updated: ${formatDate2(automation2.updated_at)}`));
|
|
@@ -13051,13 +13074,8 @@ async function promptForTriggers(repositories) {
|
|
|
13051
13074
|
}
|
|
13052
13075
|
async function automationCreateCommand(name, options) {
|
|
13053
13076
|
ensureOrgApiAuthenticated();
|
|
13054
|
-
const
|
|
13055
|
-
if (options.
|
|
13056
|
-
console.log(chalk18.red(`Invalid lifecycle policy: ${options.lifecycle}`));
|
|
13057
|
-
console.log(chalk18.gray(`Valid options: ${validLifecycles.join(", ")}`));
|
|
13058
|
-
process.exit(1);
|
|
13059
|
-
}
|
|
13060
|
-
if (options.autoStopMinutes && options.lifecycle !== "delete_after_inactivity") {
|
|
13077
|
+
const lifecyclePolicy = parseWorkspaceLifecyclePolicyOption(options.lifecycle);
|
|
13078
|
+
if (options.autoStopMinutes && lifecyclePolicy !== "delete_after_inactivity") {
|
|
13061
13079
|
console.log(chalk18.red("--auto-stop-minutes requires --lifecycle delete_after_inactivity"));
|
|
13062
13080
|
process.exit(1);
|
|
13063
13081
|
}
|
|
@@ -13192,8 +13210,11 @@ async function automationCreateCommand(name, options) {
|
|
|
13192
13210
|
triggers,
|
|
13193
13211
|
enabled: options.enabled !== false,
|
|
13194
13212
|
config: workspaceConfigWithPrFollowups(void 0, prFollowups),
|
|
13195
|
-
...
|
|
13213
|
+
...lifecyclePolicy ? { workspace_lifecycle_policy: lifecyclePolicy } : {},
|
|
13196
13214
|
...options.autoStopMinutes ? { workspace_auto_stop_minutes: parseInt(options.autoStopMinutes, 10) } : {},
|
|
13215
|
+
...options.planMode ? { plan_mode: true } : {},
|
|
13216
|
+
...options.goalMode ? { goal_mode: true } : {},
|
|
13217
|
+
...options.fastMode ? { fast_mode: true } : {},
|
|
13197
13218
|
...agentSelection
|
|
13198
13219
|
};
|
|
13199
13220
|
console.log(chalk18.gray("\nCreating automation..."));
|
|
@@ -13220,13 +13241,8 @@ Created automation: ${automation2.name}`));
|
|
|
13220
13241
|
}
|
|
13221
13242
|
async function automationEditCommand(id, options) {
|
|
13222
13243
|
ensureOrgApiAuthenticated();
|
|
13223
|
-
const
|
|
13224
|
-
if (options.
|
|
13225
|
-
console.log(chalk18.red(`Invalid lifecycle policy: ${options.lifecycle}`));
|
|
13226
|
-
console.log(chalk18.gray(`Valid options: ${validLifecycles.join(", ")}`));
|
|
13227
|
-
process.exit(1);
|
|
13228
|
-
}
|
|
13229
|
-
if (options.autoStopMinutes && options.lifecycle !== "delete_after_inactivity") {
|
|
13244
|
+
const lifecyclePolicy = parseWorkspaceLifecyclePolicyOption(options.lifecycle);
|
|
13245
|
+
if (options.autoStopMinutes && lifecyclePolicy !== "delete_after_inactivity") {
|
|
13230
13246
|
console.log(chalk18.red("--auto-stop-minutes requires --lifecycle delete_after_inactivity"));
|
|
13231
13247
|
process.exit(1);
|
|
13232
13248
|
}
|
|
@@ -13249,7 +13265,7 @@ async function automationEditCommand(id, options) {
|
|
|
13249
13265
|
model: existing.automation.model
|
|
13250
13266
|
});
|
|
13251
13267
|
const body = {};
|
|
13252
|
-
const hasOptions = options.name || options.prompt || options.enabled !== void 0 || options.prFollowups !== void 0 || options.triggerCron || options.triggerGithub || options.environment || options.lifecycle || options.autoStopMinutes || options.agentProvider !== void 0 || options.model !== void 0 || options.thinkingLevel !== void 0;
|
|
13268
|
+
const hasOptions = options.name || options.prompt || options.enabled !== void 0 || options.prFollowups !== void 0 || options.triggerCron || options.triggerGithub || options.environment || options.lifecycle || 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;
|
|
13253
13269
|
if (!hasOptions) {
|
|
13254
13270
|
const nameResponse = await prompts4({
|
|
13255
13271
|
type: "text",
|
|
@@ -13351,15 +13367,18 @@ async function automationEditCommand(id, options) {
|
|
|
13351
13367
|
const selectableEnvs = envResp.environments.filter((e) => !e.is_global);
|
|
13352
13368
|
body.environment_id = resolveSelectableEnvironmentId(options.environment, selectableEnvs);
|
|
13353
13369
|
}
|
|
13354
|
-
if (
|
|
13355
|
-
body.workspace_lifecycle_policy =
|
|
13356
|
-
if (
|
|
13370
|
+
if (lifecyclePolicy) {
|
|
13371
|
+
body.workspace_lifecycle_policy = lifecyclePolicy;
|
|
13372
|
+
if (lifecyclePolicy !== "delete_after_inactivity") {
|
|
13357
13373
|
body.workspace_auto_stop_minutes = null;
|
|
13358
13374
|
}
|
|
13359
13375
|
}
|
|
13360
13376
|
if (options.autoStopMinutes) {
|
|
13361
13377
|
body.workspace_auto_stop_minutes = parseInt(options.autoStopMinutes, 10);
|
|
13362
13378
|
}
|
|
13379
|
+
if (options.planMode !== void 0) body.plan_mode = options.planMode;
|
|
13380
|
+
if (options.goalMode !== void 0) body.goal_mode = options.goalMode;
|
|
13381
|
+
if (options.fastMode !== void 0) body.fast_mode = options.fastMode;
|
|
13363
13382
|
Object.assign(body, agentSelection);
|
|
13364
13383
|
}
|
|
13365
13384
|
if (Object.keys(body).length === 0) {
|
|
@@ -17903,7 +17922,7 @@ automation.command("get <id>").description("Get automation details by ID").actio
|
|
|
17903
17922
|
process.exit(1);
|
|
17904
17923
|
}
|
|
17905
17924
|
});
|
|
17906
|
-
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("--lifecycle <policy>", "Workspace lifecycle: delete_when_done, delete_after_inactivity, default").option("--auto-stop-minutes <minutes>", "Inactivity timeout in minutes (3-1440, requires --lifecycle delete_after_inactivity)").option("--pr-followups", "Allow follow-up actions on matching PRs").option("--agent-provider <provider>", 'Coding agent to use: claude, codex, 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("--personal", "Create a personal automation owned by the authenticated user").option("--disabled", "Create in disabled state").action(async (name, options) => {
|
|
17925
|
+
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("--lifecycle <policy>", "Workspace lifecycle: delete_when_done, delete_after_inactivity, default").option("--auto-stop-minutes <minutes>", "Inactivity timeout in minutes (3-1440, requires --lifecycle delete_after_inactivity)").option("--pr-followups", "Allow follow-up actions on matching PRs").option("--agent-provider <provider>", 'Coding agent to use: claude, codex, 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) => {
|
|
17907
17926
|
try {
|
|
17908
17927
|
await automationCreateCommand(name, {
|
|
17909
17928
|
...options,
|
|
@@ -17918,7 +17937,7 @@ automation.command("create [name]").description("Create a new automation").optio
|
|
|
17918
17937
|
process.exit(1);
|
|
17919
17938
|
}
|
|
17920
17939
|
});
|
|
17921
|
-
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("--environment <environment>", "Environment name or ID").option("--lifecycle <policy>", "Workspace lifecycle: delete_when_done, delete_after_inactivity, default").option("--auto-stop-minutes <minutes>", "Inactivity timeout in minutes (3-1440, requires --lifecycle 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, 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)').action(async (id, options) => {
|
|
17940
|
+
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("--environment <environment>", "Environment name or ID").option("--lifecycle <policy>", "Workspace lifecycle: delete_when_done, delete_after_inactivity, default").option("--auto-stop-minutes <minutes>", "Inactivity timeout in minutes (3-1440, requires --lifecycle 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, 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) => {
|
|
17922
17941
|
try {
|
|
17923
17942
|
await automationEditCommand(id, options);
|
|
17924
17943
|
} catch (error) {
|