replicas-cli 0.2.244 → 0.2.245
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 +26 -11
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -7539,6 +7539,21 @@ function isRecord(value) {
|
|
|
7539
7539
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
7540
7540
|
}
|
|
7541
7541
|
|
|
7542
|
+
// ../shared/src/result.ts
|
|
7543
|
+
function createSuccessResult(data) {
|
|
7544
|
+
return { ok: true, data };
|
|
7545
|
+
}
|
|
7546
|
+
function createErrorResult(error) {
|
|
7547
|
+
return {
|
|
7548
|
+
ok: false,
|
|
7549
|
+
error: {
|
|
7550
|
+
message: error.message,
|
|
7551
|
+
code: error.code,
|
|
7552
|
+
details: error.details
|
|
7553
|
+
}
|
|
7554
|
+
};
|
|
7555
|
+
}
|
|
7556
|
+
|
|
7542
7557
|
// ../shared/src/agent.ts
|
|
7543
7558
|
var VALID_AGENT_PROVIDERS = ["claude", "codex", "relay"];
|
|
7544
7559
|
function isValidAgentProvider(value) {
|
|
@@ -9142,7 +9157,7 @@ var HOOK_EXEC_MAX_BUFFER_BYTES = 10 * 1024 * 1024;
|
|
|
9142
9157
|
var REPLICAS_CONFIG_FILENAMES = ["replicas.json", "replicas.yaml", "replicas.yml"];
|
|
9143
9158
|
|
|
9144
9159
|
// ../shared/src/cli-version.ts
|
|
9145
|
-
var CLI_VERSION = "0.2.
|
|
9160
|
+
var CLI_VERSION = "0.2.245";
|
|
9146
9161
|
|
|
9147
9162
|
// ../shared/src/engine/environment.ts
|
|
9148
9163
|
var DESKTOP_NOVNC_PORT = 6080;
|
|
@@ -9276,7 +9291,7 @@ function validateAgentSelection(body, existing) {
|
|
|
9276
9291
|
const agentProvider = body.agent_provider;
|
|
9277
9292
|
if (agentProvider !== void 0 && agentProvider !== null) {
|
|
9278
9293
|
if (!isValidAgentProvider(agentProvider)) {
|
|
9279
|
-
return {
|
|
9294
|
+
return createErrorResult({ message: `Invalid agent_provider: must be one of ${VALID_AGENT_PROVIDERS.join(", ")}` });
|
|
9280
9295
|
}
|
|
9281
9296
|
}
|
|
9282
9297
|
const effectiveAgent = agentProvider !== void 0 ? agentProvider : existing.agentProvider;
|
|
@@ -9287,24 +9302,24 @@ function validateAgentSelection(body, existing) {
|
|
|
9287
9302
|
}
|
|
9288
9303
|
if (model !== void 0 && model !== null) {
|
|
9289
9304
|
if (typeof model !== "string" || model.trim().length === 0) {
|
|
9290
|
-
return {
|
|
9305
|
+
return createErrorResult({ message: "model must be a non-empty string" });
|
|
9291
9306
|
}
|
|
9292
9307
|
model = normalizeClaudeModel(model) ?? model;
|
|
9293
9308
|
if (!effectiveAgent) {
|
|
9294
|
-
return {
|
|
9309
|
+
return createErrorResult({ message: "Cannot set model without an agent_provider (the model would be applied against the org default agent and may not be valid for it)" });
|
|
9295
9310
|
}
|
|
9296
9311
|
const allowed = AGENT_MODELS[effectiveAgent];
|
|
9297
9312
|
if (!allowed.includes(model)) {
|
|
9298
|
-
return {
|
|
9313
|
+
return createErrorResult({ message: `Invalid model "${model}" for agent ${effectiveAgent}. Valid models: ${allowed.join(", ")}` });
|
|
9299
9314
|
}
|
|
9300
9315
|
}
|
|
9301
9316
|
const thinkingLevel = body.thinking_level;
|
|
9302
9317
|
if (thinkingLevel !== void 0 && thinkingLevel !== null) {
|
|
9303
9318
|
if (!isValidThinkingLevel(thinkingLevel)) {
|
|
9304
|
-
return {
|
|
9319
|
+
return createErrorResult({ message: `Invalid thinking_level: must be one of ${VALID_THINKING_LEVELS.join(", ")}` });
|
|
9305
9320
|
}
|
|
9306
9321
|
}
|
|
9307
|
-
return {
|
|
9322
|
+
return createSuccessResult({ agentProvider, model, thinkingLevel });
|
|
9308
9323
|
}
|
|
9309
9324
|
|
|
9310
9325
|
// ../shared/src/automations/github/index.ts
|
|
@@ -12503,13 +12518,13 @@ function parseModelOption(value) {
|
|
|
12503
12518
|
function applyAgentSelection(body, existing) {
|
|
12504
12519
|
const result = validateAgentSelection(body, existing);
|
|
12505
12520
|
if (!result.ok) {
|
|
12506
|
-
console.log(chalk18.red(result.error));
|
|
12521
|
+
console.log(chalk18.red(result.error.message));
|
|
12507
12522
|
process.exit(1);
|
|
12508
12523
|
}
|
|
12509
12524
|
const out = {};
|
|
12510
|
-
if (result.
|
|
12511
|
-
if (result.
|
|
12512
|
-
if (result.
|
|
12525
|
+
if (result.data.agentProvider !== void 0) out.agent_provider = result.data.agentProvider;
|
|
12526
|
+
if (result.data.model !== void 0) out.model = result.data.model;
|
|
12527
|
+
if (result.data.thinkingLevel !== void 0) out.thinking_level = result.data.thinkingLevel;
|
|
12513
12528
|
return out;
|
|
12514
12529
|
}
|
|
12515
12530
|
function formatTrigger(trigger) {
|