replicas-cli 0.2.658 → 0.2.660
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 +50 -12
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -7718,6 +7718,9 @@ function isValidAgentProvider(value) {
|
|
|
7718
7718
|
function isValidCodingAgentProvider(value) {
|
|
7719
7719
|
return VALID_CODING_AGENT_PROVIDERS.some((provider) => provider === value);
|
|
7720
7720
|
}
|
|
7721
|
+
function isValidRelayBaseProvider(value) {
|
|
7722
|
+
return VALID_RELAY_BASE_PROVIDERS.some((provider) => provider === value);
|
|
7723
|
+
}
|
|
7721
7724
|
var AGENT_PROVIDER_OPTIONS = [
|
|
7722
7725
|
{
|
|
7723
7726
|
value: "claude",
|
|
@@ -22436,6 +22439,7 @@ function isCredentialScope(value) {
|
|
|
22436
22439
|
var fallbackHarnessStepSchema = external_exports.object({
|
|
22437
22440
|
kind: external_exports.literal("harness"),
|
|
22438
22441
|
provider: external_exports.enum(VALID_AGENT_PROVIDERS),
|
|
22442
|
+
relayBaseProvider: external_exports.enum(VALID_RELAY_BASE_PROVIDERS).optional(),
|
|
22439
22443
|
model: external_exports.string().min(1),
|
|
22440
22444
|
thinkingLevel: external_exports.enum(VALID_THINKING_LEVELS).optional()
|
|
22441
22445
|
});
|
|
@@ -22748,6 +22752,7 @@ var chatForkInfoSchema = external_exports.object({
|
|
|
22748
22752
|
});
|
|
22749
22753
|
var forkChatRequestSchema = external_exports.object({
|
|
22750
22754
|
provider: external_exports.enum(VALID_AGENT_PROVIDERS),
|
|
22755
|
+
relayBaseProvider: external_exports.enum(VALID_RELAY_BASE_PROVIDERS).optional(),
|
|
22751
22756
|
model: external_exports.string().min(1).optional(),
|
|
22752
22757
|
thinkingLevel: external_exports.enum(VALID_THINKING_LEVELS).optional(),
|
|
22753
22758
|
title: external_exports.string().min(1).max(200).optional(),
|
|
@@ -22811,6 +22816,9 @@ function coerceAuthFallbackPayload(payload) {
|
|
|
22811
22816
|
}
|
|
22812
22817
|
|
|
22813
22818
|
// ../shared/src/engine/v1.ts
|
|
22819
|
+
function getChatExecutionProvider(chat) {
|
|
22820
|
+
return chat.provider === "relay" ? chat.relayBaseProvider ?? DEFAULT_RELAY_BASE_PROVIDER : chat.provider;
|
|
22821
|
+
}
|
|
22814
22822
|
var createChatRequestSchema = external_exports.object({
|
|
22815
22823
|
id: external_exports.string().uuid().optional(),
|
|
22816
22824
|
createdAt: external_exports.string().datetime().optional(),
|
|
@@ -22922,6 +22930,9 @@ function coerceBackgroundTaskPayload(payload) {
|
|
|
22922
22930
|
return {
|
|
22923
22931
|
subtype,
|
|
22924
22932
|
taskId,
|
|
22933
|
+
toolUseId: optionalString(payload.tool_use_id),
|
|
22934
|
+
subagentType: optionalString(payload.subagent_type),
|
|
22935
|
+
isBackgrounded: optionalBoolean(payload.is_backgrounded),
|
|
22925
22936
|
description: optionalString(payload.description),
|
|
22926
22937
|
summary: optionalString(payload.summary),
|
|
22927
22938
|
outputFile: optionalString(payload.output_file),
|
|
@@ -24768,6 +24779,7 @@ var REPLICAS_AGENT_ABILITIES = Object.keys(
|
|
|
24768
24779
|
// ../shared/src/routes/preferences.ts
|
|
24769
24780
|
var EMPTY_AGENT_DEFAULT_SETTINGS = {
|
|
24770
24781
|
agent_provider: null,
|
|
24782
|
+
relay_base_provider: null,
|
|
24771
24783
|
model: null,
|
|
24772
24784
|
thinking_level: null,
|
|
24773
24785
|
goal_mode: null,
|
|
@@ -26454,11 +26466,13 @@ function parseClaudeEvents(events, parentToolUseId) {
|
|
|
26454
26466
|
if (payload?.ambient) ambientTaskIds.add(payload.taskId);
|
|
26455
26467
|
if (payload && !ambientTaskIds.has(payload.taskId)) {
|
|
26456
26468
|
const existing = taskMessageMap.get(payload.taskId);
|
|
26457
|
-
const nextStatus = payload.subtype === "task_notification" ? normalizeBackgroundTaskStatus(payload.status) : payload.subtype === "task_updated" ? normalizeBackgroundTaskStatus(payload.patch?.status) : existing?.status ?? "in_progress";
|
|
26469
|
+
const nextStatus = payload.subtype === "task_notification" ? normalizeBackgroundTaskStatus(payload.status) : payload.subtype === "task_updated" && payload.patch?.status !== void 0 ? normalizeBackgroundTaskStatus(payload.patch?.status) : existing?.status ?? "in_progress";
|
|
26458
26470
|
const nextMessage = {
|
|
26459
26471
|
id: existing?.id ?? `task-${event.timestamp}-${messages.length}`,
|
|
26460
26472
|
type: "background_task",
|
|
26461
26473
|
taskId: payload.taskId,
|
|
26474
|
+
toolUseId: payload.toolUseId ?? existing?.toolUseId,
|
|
26475
|
+
subagentType: payload.subagentType ?? existing?.subagentType,
|
|
26462
26476
|
status: nextStatus,
|
|
26463
26477
|
description: payload.description ?? payload.patch?.description ?? existing?.description,
|
|
26464
26478
|
summary: payload.summary ?? existing?.summary,
|
|
@@ -26469,7 +26483,7 @@ function parseClaudeEvents(events, parentToolUseId) {
|
|
|
26469
26483
|
lastToolName: payload.lastToolName ?? existing?.lastToolName,
|
|
26470
26484
|
usage: payload.usage ?? existing?.usage,
|
|
26471
26485
|
error: payload.patch?.error ?? existing?.error,
|
|
26472
|
-
isBackgrounded: payload.patch?.isBackgrounded ?? existing?.isBackgrounded,
|
|
26486
|
+
isBackgrounded: payload.isBackgrounded ?? payload.patch?.isBackgrounded ?? existing?.isBackgrounded,
|
|
26473
26487
|
timestamp: existing?.timestamp ?? event.timestamp
|
|
26474
26488
|
};
|
|
26475
26489
|
if (existing) {
|
|
@@ -26562,6 +26576,15 @@ function parseClaudeEvents(events, parentToolUseId) {
|
|
|
26562
26576
|
}
|
|
26563
26577
|
});
|
|
26564
26578
|
for (const message of messages) {
|
|
26579
|
+
if (message.type === "background_task" && message.toolUseId) {
|
|
26580
|
+
const toolInfo = toolCallMap.get(message.toolUseId);
|
|
26581
|
+
const toolMessage = toolInfo ? messages[toolInfo.messageIndex] : void 0;
|
|
26582
|
+
if (toolMessage?.type === "command") message.command = toolMessage.command;
|
|
26583
|
+
if (toolMessage?.type === "subagent") {
|
|
26584
|
+
message.prompt ?? (message.prompt = toolMessage.prompt);
|
|
26585
|
+
message.subagentType ?? (message.subagentType = toolMessage.subagentType);
|
|
26586
|
+
}
|
|
26587
|
+
}
|
|
26565
26588
|
if (message.type !== "subagent_followup") continue;
|
|
26566
26589
|
const target = messages.find((candidate) => candidate.type === "subagent" && candidate.chatId === message.chatId);
|
|
26567
26590
|
if (target?.type === "subagent") {
|
|
@@ -27245,7 +27268,7 @@ var headlessFilesystemAgentResultSchema = external_exports.object({
|
|
|
27245
27268
|
});
|
|
27246
27269
|
|
|
27247
27270
|
// ../shared/src/cli-version.ts
|
|
27248
|
-
var CLI_VERSION = "0.2.
|
|
27271
|
+
var CLI_VERSION = "0.2.660";
|
|
27249
27272
|
|
|
27250
27273
|
// ../shared/src/version.ts
|
|
27251
27274
|
function compareVersions(v1, v2) {
|
|
@@ -27683,35 +27706,50 @@ function validateAgentSelection(body, existing, modelCatalogs = {}) {
|
|
|
27683
27706
|
}
|
|
27684
27707
|
}
|
|
27685
27708
|
const effectiveAgent = agentProvider !== void 0 ? agentProvider : existing.agentProvider;
|
|
27686
|
-
|
|
27709
|
+
let relayBaseProvider = body.relay_base_provider;
|
|
27710
|
+
if (relayBaseProvider != null && !isValidRelayBaseProvider(relayBaseProvider)) {
|
|
27711
|
+
return createErrorResult({ message: `Invalid relay_base_provider: must be one of ${VALID_RELAY_BASE_PROVIDERS.join(", ")}` });
|
|
27712
|
+
}
|
|
27713
|
+
if (relayBaseProvider && effectiveAgent !== "relay") {
|
|
27714
|
+
return createErrorResult({ message: "relay_base_provider is only valid when agent_provider is relay" });
|
|
27715
|
+
}
|
|
27716
|
+
if (agentProvider !== void 0 && agentProvider !== "relay" && relayBaseProvider === void 0 && existing.relayBaseProvider) {
|
|
27717
|
+
relayBaseProvider = null;
|
|
27718
|
+
}
|
|
27719
|
+
const effectiveRelayBase = relayBaseProvider !== void 0 ? relayBaseProvider : existing.relayBaseProvider;
|
|
27720
|
+
const agentChanged = agentProvider !== void 0 && agentProvider !== existing.agentProvider || relayBaseProvider !== void 0 && relayBaseProvider !== (existing.relayBaseProvider ?? null);
|
|
27721
|
+
const executionAgent = effectiveAgent ? getChatExecutionProvider({ provider: effectiveAgent, relayBaseProvider: effectiveRelayBase ?? existing.inheritedRelayBaseProvider }) : effectiveAgent;
|
|
27687
27722
|
let model = body.model;
|
|
27688
27723
|
if (agentChanged && model === void 0 && existing.model) {
|
|
27689
27724
|
model = null;
|
|
27690
27725
|
}
|
|
27726
|
+
let thinkingLevel = body.thinking_level;
|
|
27727
|
+
if (agentChanged && thinkingLevel === void 0 && existing.thinkingLevel && executionAgent && !getThinkingLevelOptions(executionAgent).includes(existing.thinkingLevel)) {
|
|
27728
|
+
thinkingLevel = null;
|
|
27729
|
+
}
|
|
27691
27730
|
if (model !== void 0 && model !== null) {
|
|
27692
27731
|
if (typeof model !== "string" || model.trim().length === 0) {
|
|
27693
27732
|
return createErrorResult({ message: "model must be a non-empty string" });
|
|
27694
27733
|
}
|
|
27695
27734
|
model = normalizeClaudeModel(model) ?? model;
|
|
27696
|
-
if (!
|
|
27735
|
+
if (!executionAgent) {
|
|
27697
27736
|
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)" });
|
|
27698
27737
|
}
|
|
27699
|
-
const allowed = getAgentModelOptions(
|
|
27700
|
-
if (!isAgentModelAllowed(
|
|
27701
|
-
return createErrorResult({ message: `Invalid model "${model}" for agent ${
|
|
27738
|
+
const allowed = getAgentModelOptions(executionAgent, modelCatalogs);
|
|
27739
|
+
if (!isAgentModelAllowed(executionAgent, model, modelCatalogs)) {
|
|
27740
|
+
return createErrorResult({ message: `Invalid model "${model}" for agent ${executionAgent}. Valid models: ${allowed.join(", ")}` });
|
|
27702
27741
|
}
|
|
27703
27742
|
}
|
|
27704
|
-
const thinkingLevel = body.thinking_level;
|
|
27705
27743
|
if (thinkingLevel !== void 0 && thinkingLevel !== null) {
|
|
27706
27744
|
if (!effectiveAgent && isProviderSpecificThinkingLevel(thinkingLevel)) {
|
|
27707
27745
|
return createErrorResult({ message: `Cannot set ${thinkingLevel} without an agent_provider` });
|
|
27708
27746
|
}
|
|
27709
|
-
if (!isValidThinkingLevel(thinkingLevel) ||
|
|
27710
|
-
const validLevels =
|
|
27747
|
+
if (!isValidThinkingLevel(thinkingLevel) || executionAgent && !getThinkingLevelOptions(executionAgent).includes(thinkingLevel)) {
|
|
27748
|
+
const validLevels = executionAgent ? getThinkingLevelOptions(executionAgent) : VALID_THINKING_LEVELS;
|
|
27711
27749
|
return createErrorResult({ message: `Invalid thinking_level: must be one of ${validLevels.join(", ")}` });
|
|
27712
27750
|
}
|
|
27713
27751
|
}
|
|
27714
|
-
return createSuccessResult({ agentProvider, model, thinkingLevel });
|
|
27752
|
+
return createSuccessResult({ agentProvider, relayBaseProvider, model, thinkingLevel });
|
|
27715
27753
|
}
|
|
27716
27754
|
|
|
27717
27755
|
// ../shared/src/automations/github/index.ts
|