replicas-cli 0.2.376 → 0.2.378
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 +82 -3
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -7602,7 +7602,7 @@ function createErrorResult(error) {
|
|
|
7602
7602
|
}
|
|
7603
7603
|
|
|
7604
7604
|
// ../shared/src/agent.ts
|
|
7605
|
-
var VALID_AGENT_PROVIDERS = ["claude", "codex", "cursor", "opencode", "relay"];
|
|
7605
|
+
var VALID_AGENT_PROVIDERS = ["claude", "codex", "cursor", "opencode", "pi", "relay"];
|
|
7606
7606
|
var VALID_CODING_AGENT_PROVIDERS = VALID_AGENT_PROVIDERS.filter(
|
|
7607
7607
|
(provider) => provider !== "relay"
|
|
7608
7608
|
);
|
|
@@ -7633,6 +7633,11 @@ var AGENT_PROVIDER_OPTIONS = [
|
|
|
7633
7633
|
label: "Opencode",
|
|
7634
7634
|
description: "Use Opencode for tasks"
|
|
7635
7635
|
},
|
|
7636
|
+
{
|
|
7637
|
+
value: "pi",
|
|
7638
|
+
label: "Pi",
|
|
7639
|
+
description: "Use Pi for tasks"
|
|
7640
|
+
},
|
|
7636
7641
|
{
|
|
7637
7642
|
value: "relay",
|
|
7638
7643
|
label: "Relay",
|
|
@@ -7651,6 +7656,8 @@ function getProviderDisplayName(provider, variant = "short") {
|
|
|
7651
7656
|
return "Cursor";
|
|
7652
7657
|
case "opencode":
|
|
7653
7658
|
return "Opencode";
|
|
7659
|
+
case "pi":
|
|
7660
|
+
return "Pi";
|
|
7654
7661
|
case "relay":
|
|
7655
7662
|
return "Relay";
|
|
7656
7663
|
case "claude":
|
|
@@ -7711,6 +7718,7 @@ var DEFAULT_CHAT_TITLES = {
|
|
|
7711
7718
|
codex: "Codex",
|
|
7712
7719
|
cursor: "Cursor",
|
|
7713
7720
|
opencode: "Opencode",
|
|
7721
|
+
pi: "Pi",
|
|
7714
7722
|
relay: "Relay"
|
|
7715
7723
|
};
|
|
7716
7724
|
function isDefaultChat(chat) {
|
|
@@ -7740,6 +7748,12 @@ var GPT_5_6_TERRA_MODEL = "gpt-5.6-terra";
|
|
|
7740
7748
|
var GPT_5_6_LUNA_MODEL = "gpt-5.6-luna";
|
|
7741
7749
|
var DEFAULT_CODEX_MODEL = GPT_5_6_SOL_MODEL;
|
|
7742
7750
|
var DEFAULT_OPENCODE_MODEL = "z-ai/glm-5.2";
|
|
7751
|
+
var OPENROUTER_MODELS = [
|
|
7752
|
+
DEFAULT_OPENCODE_MODEL,
|
|
7753
|
+
"minimax/minimax-m3",
|
|
7754
|
+
"xiaomi/mimo-v2.5-pro",
|
|
7755
|
+
"moonshotai/kimi-k2.6"
|
|
7756
|
+
];
|
|
7743
7757
|
function normalizeClaudeModel(model) {
|
|
7744
7758
|
if (model === "opus" || model === CLAUDE_OPUS_1M_MODEL || model === LEGACY_CLAUDE_OPUS_1M_MODEL) {
|
|
7745
7759
|
return DEFAULT_CLAUDE_MODEL;
|
|
@@ -7800,7 +7814,8 @@ var AGENT_MODELS = {
|
|
|
7800
7814
|
CLAUDE_HAIKU_4_5_MODEL,
|
|
7801
7815
|
"kimi-k2.5"
|
|
7802
7816
|
],
|
|
7803
|
-
opencode:
|
|
7817
|
+
opencode: OPENROUTER_MODELS,
|
|
7818
|
+
pi: OPENROUTER_MODELS,
|
|
7804
7819
|
relay: [CLAUDE_FABLE_5_MODEL, DEFAULT_CLAUDE_MODEL, CLAUDE_SONNET_5_MODEL]
|
|
7805
7820
|
};
|
|
7806
7821
|
var MODEL_LABELS = {
|
|
@@ -9817,7 +9832,7 @@ var HOOK_EXEC_MAX_BUFFER_BYTES = 10 * 1024 * 1024;
|
|
|
9817
9832
|
var REPLICAS_CONFIG_FILENAMES = ["replicas.json", "replicas.yaml", "replicas.yml"];
|
|
9818
9833
|
|
|
9819
9834
|
// ../shared/src/cli-version.ts
|
|
9820
|
-
var CLI_VERSION = "0.2.
|
|
9835
|
+
var CLI_VERSION = "0.2.378";
|
|
9821
9836
|
|
|
9822
9837
|
// ../shared/src/version.ts
|
|
9823
9838
|
function compareVersions(v1, v2) {
|
|
@@ -10645,6 +10660,67 @@ function parseOpencodeEvents(events) {
|
|
|
10645
10660
|
return messages;
|
|
10646
10661
|
}
|
|
10647
10662
|
|
|
10663
|
+
// ../shared/src/display-message/parsers/pi-parser.ts
|
|
10664
|
+
function nestedPayload(event) {
|
|
10665
|
+
return isRecord(event.payload.assistantMessageEvent) ? event.payload.assistantMessageEvent : event.payload;
|
|
10666
|
+
}
|
|
10667
|
+
function setById2(messages, id, message) {
|
|
10668
|
+
const index = messages.findIndex((candidate) => candidate.id === id);
|
|
10669
|
+
if (index === -1) messages.push(message);
|
|
10670
|
+
else messages[index] = message;
|
|
10671
|
+
}
|
|
10672
|
+
function toolStatus2(value) {
|
|
10673
|
+
return value === "completed" || value === "success" ? "completed" : value === "error" ? "failed" : "in_progress";
|
|
10674
|
+
}
|
|
10675
|
+
function parsePiEvents(events) {
|
|
10676
|
+
const messages = [];
|
|
10677
|
+
const text = /* @__PURE__ */ new Map();
|
|
10678
|
+
const thinking = /* @__PURE__ */ new Map();
|
|
10679
|
+
let activeMessageId = "assistant";
|
|
10680
|
+
for (const event of events) {
|
|
10681
|
+
if (event.type === "event_msg" && event.payload.type === "user_message" && typeof event.payload.message === "string") {
|
|
10682
|
+
messages.push({ id: `pi-user-${event.timestamp}-${messages.length}`, type: "user", content: event.payload.message, timestamp: event.timestamp });
|
|
10683
|
+
continue;
|
|
10684
|
+
}
|
|
10685
|
+
if (event.type === "pi-error") {
|
|
10686
|
+
messages.push({ id: `pi-error-${event.timestamp}-${messages.length}`, type: "error", message: String(event.payload.message ?? "Pi run failed"), timestamp: event.timestamp });
|
|
10687
|
+
continue;
|
|
10688
|
+
}
|
|
10689
|
+
if (event.type === "pi-message_update") {
|
|
10690
|
+
const payload = nestedPayload(event);
|
|
10691
|
+
const id = typeof payload.id === "string" ? payload.id : activeMessageId;
|
|
10692
|
+
if (payload.type === "text_delta" && typeof payload.delta === "string") text.set(id, `${text.get(id) ?? ""}${payload.delta}`);
|
|
10693
|
+
if (payload.type === "thinking_delta" && typeof payload.delta === "string") thinking.set(id, `${thinking.get(id) ?? ""}${payload.delta}`);
|
|
10694
|
+
const textContent = text.get(id);
|
|
10695
|
+
const thinkingContent = thinking.get(id);
|
|
10696
|
+
if (textContent !== void 0) setById2(messages, `pi-${id}`, { id: `pi-${id}`, type: "agent", content: textContent, timestamp: event.timestamp });
|
|
10697
|
+
if (thinkingContent !== void 0) setById2(messages, `pi-thinking-${id}`, { id: `pi-thinking-${id}`, type: "reasoning", content: thinkingContent, status: "in_progress", timestamp: event.timestamp });
|
|
10698
|
+
continue;
|
|
10699
|
+
}
|
|
10700
|
+
if (event.type === "pi-message_start") {
|
|
10701
|
+
const message = isRecord(event.payload.message) ? event.payload.message : null;
|
|
10702
|
+
activeMessageId = typeof message?.id === "string" ? message.id : `assistant-${event.timestamp}`;
|
|
10703
|
+
continue;
|
|
10704
|
+
}
|
|
10705
|
+
if (event.type === "pi-tool_execution_start" || event.type === "pi-tool_execution_update" || event.type === "pi-tool_execution_end") {
|
|
10706
|
+
const payload = event.payload;
|
|
10707
|
+
const input = payload.args ?? payload.input;
|
|
10708
|
+
const id = typeof payload.toolCallId === "string" ? payload.toolCallId : typeof payload.id === "string" ? payload.id : `tool-${event.timestamp}`;
|
|
10709
|
+
setById2(messages, `pi-tool-${id}`, {
|
|
10710
|
+
id: `pi-tool-${id}`,
|
|
10711
|
+
type: "tool_call",
|
|
10712
|
+
server: "pi",
|
|
10713
|
+
tool: typeof payload.toolName === "string" ? payload.toolName : "tool",
|
|
10714
|
+
input: isRecord(input) ? input : stringifyDisplayValue(input),
|
|
10715
|
+
output: event.type === "pi-tool_execution_end" ? stringifyDisplayValue(payload.result ?? payload.error) : void 0,
|
|
10716
|
+
status: event.type === "pi-tool_execution_end" ? toolStatus2(payload.isError ? "error" : "completed") : "in_progress",
|
|
10717
|
+
timestamp: event.timestamp
|
|
10718
|
+
});
|
|
10719
|
+
}
|
|
10720
|
+
}
|
|
10721
|
+
return messages;
|
|
10722
|
+
}
|
|
10723
|
+
|
|
10648
10724
|
// ../shared/src/display-message/task-accumulator.ts
|
|
10649
10725
|
function mapTaskStatus(status) {
|
|
10650
10726
|
if (status === "in_progress" || status === "completed") return status;
|
|
@@ -11428,6 +11504,9 @@ function parseAgentEvents(events, agentType) {
|
|
|
11428
11504
|
if (agentType === "opencode") {
|
|
11429
11505
|
return parseOpencodeEvents(events);
|
|
11430
11506
|
}
|
|
11507
|
+
if (agentType === "pi") {
|
|
11508
|
+
return parsePiEvents(events);
|
|
11509
|
+
}
|
|
11431
11510
|
return parseClaudeEvents(events);
|
|
11432
11511
|
}
|
|
11433
11512
|
function parseDisplayMessages(events, agentType, codexAspTranscript, options = {}) {
|