replicas-cli 0.2.545 → 0.2.547

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.
Files changed (2) hide show
  1. package/dist/index.cjs +116 -24
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -7645,6 +7645,7 @@ var AGENT = {
7645
7645
  CURSOR: "cursor",
7646
7646
  DEEPSEEK: "deepseek",
7647
7647
  FX: "fx",
7648
+ KIMI: "kimi",
7648
7649
  OPENCODE: "opencode",
7649
7650
  PI: "pi",
7650
7651
  RELAY: "relay"
@@ -7686,6 +7687,11 @@ var AGENT_PROVIDER_OPTIONS = [
7686
7687
  label: "fx",
7687
7688
  description: "Use fx for tasks"
7688
7689
  },
7690
+ {
7691
+ value: "kimi",
7692
+ label: "Kimi Code",
7693
+ description: "Use Kimi Code for tasks"
7694
+ },
7689
7695
  {
7690
7696
  value: "opencode",
7691
7697
  label: "Opencode",
@@ -7710,6 +7716,7 @@ var THINKING_LEVELS_BY_AGENT = {
7710
7716
  cursor: STANDARD_THINKING_LEVELS,
7711
7717
  deepseek: STANDARD_THINKING_LEVELS,
7712
7718
  fx: STANDARD_THINKING_LEVELS,
7719
+ kimi: STANDARD_THINKING_LEVELS,
7713
7720
  opencode: STANDARD_THINKING_LEVELS,
7714
7721
  pi: STANDARD_THINKING_LEVELS,
7715
7722
  relay: [...STANDARD_THINKING_LEVELS, "ultracode"]
@@ -7733,6 +7740,8 @@ function getProviderDisplayName(provider, variant = "short") {
7733
7740
  return variant === "long" ? "DeepSeek Harness" : "DeepSeek";
7734
7741
  case "fx":
7735
7742
  return "fx";
7743
+ case "kimi":
7744
+ return variant === "long" ? "Kimi Code" : "Kimi";
7736
7745
  case "opencode":
7737
7746
  return "Opencode";
7738
7747
  case "pi":
@@ -7801,6 +7810,9 @@ var AGENT_CREDENTIAL_METHODS_IN_ORDER = {
7801
7810
  [AGENT.FX]: [
7802
7811
  { method: CREDENTIAL_METHOD.AI_GATEWAY, credentialType: CREDENTIAL_TYPE.AI_GATEWAY_API_KEY }
7803
7812
  ],
7813
+ [AGENT.KIMI]: [
7814
+ { method: CREDENTIAL_METHOD.AI_GATEWAY, credentialType: CREDENTIAL_TYPE.AI_GATEWAY_API_KEY }
7815
+ ],
7804
7816
  [AGENT.OPENCODE]: [
7805
7817
  { method: CREDENTIAL_METHOD.OPENCODE_GO, credentialType: CREDENTIAL_TYPE.OPENCODE_GO_API_KEY },
7806
7818
  { method: CREDENTIAL_METHOD.ASTER, credentialType: CREDENTIAL_TYPE.ASTER_API_KEY },
@@ -22415,6 +22427,7 @@ var DEFAULT_OPENCODE_MODEL = "z-ai/glm-5.2";
22415
22427
  var DEEPSEEK_V4_PRO_MODEL = "deepseek/deepseek-v4-pro-0813";
22416
22428
  var DEEPSEEK_V4_FLASH_MODEL = "deepseek/deepseek-v4-flash-0731";
22417
22429
  var DEFAULT_FX_MODEL = "zai/glm-5.2";
22430
+ var DEFAULT_KIMI_MODEL = "moonshotai/kimi-k2.6";
22418
22431
  var OPENROUTER_MODELS = [
22419
22432
  DEFAULT_OPENCODE_MODEL,
22420
22433
  DEEPSEEK_V4_PRO_MODEL,
@@ -22501,6 +22514,7 @@ var AGENT_MODELS = {
22501
22514
  ],
22502
22515
  deepseek: prioritizeDeepseekModels(OPENROUTER_MODELS),
22503
22516
  fx: [DEFAULT_FX_MODEL],
22517
+ kimi: [DEFAULT_KIMI_MODEL],
22504
22518
  opencode: [...OPENROUTER_MODELS, ...ASTER_MODELS],
22505
22519
  pi: [...OPENROUTER_MODELS, ...ASTER_MODELS],
22506
22520
  relay: [CLAUDE_FABLE_5_MODEL, CLAUDE_OPUS_5_MODEL, CLAUDE_OPUS_4_8_MODEL, CLAUDE_SONNET_5_MODEL]
@@ -24392,7 +24406,7 @@ var headlessFilesystemAgentResultSchema = external_exports.object({
24392
24406
  });
24393
24407
 
24394
24408
  // ../shared/src/cli-version.ts
24395
- var CLI_VERSION = "0.2.545";
24409
+ var CLI_VERSION = "0.2.547";
24396
24410
 
24397
24411
  // ../shared/src/version.ts
24398
24412
  function compareVersions(v1, v2) {
@@ -25508,71 +25522,146 @@ function parseDeepseekEvents(events) {
25508
25522
  return messages;
25509
25523
  }
25510
25524
 
25511
- // ../shared/src/display-message/parsers/fx-parser.ts
25512
- function getFxTextChunk(update, kind) {
25525
+ // ../shared/src/display-message/parsers/acp-parser.ts
25526
+ var FX_CONTEXT_DIAGNOSTIC = /^\[context\] skill catalog omitted .*?(?:\r?\n|$)/;
25527
+ function getAcpTextChunk(update, kind) {
25513
25528
  if (!isRecord(update) || update.sessionUpdate !== kind || !isRecord(update.content) || update.content.type !== "text") return null;
25514
- return typeof update.content.text === "string" && update.content.text ? update.content.text : null;
25529
+ return typeof update.content.text === "string" && update.content.text.length > 0 ? update.content.text : null;
25515
25530
  }
25516
- function parseFxEvents(events) {
25531
+ function isProviderEvent(event, provider, suffix) {
25532
+ return event.type === `acp-${suffix}` && (event.payload.provider === void 0 || event.payload.provider === provider) || event.type === `${provider}-${suffix}`;
25533
+ }
25534
+ function parseAcpEvents(events, provider) {
25517
25535
  const messages = [];
25536
+ const activeChunks = {};
25537
+ const resolvedInputs = /* @__PURE__ */ new Map();
25538
+ let chunkSequence = 0;
25518
25539
  for (const event of events) {
25519
- const content = getUserMessage(event);
25520
- if (content !== null) {
25521
- if (content.trim()) {
25540
+ const userContent = getUserMessage(event);
25541
+ if (userContent !== null) {
25542
+ activeChunks.agent_message_chunk = void 0;
25543
+ activeChunks.agent_thought_chunk = void 0;
25544
+ if (userContent.trim()) {
25522
25545
  messages.push({
25523
- id: getUserMessageId(event) ?? `fx-user-${event.timestamp}`,
25546
+ id: getUserMessageId(event) ?? `${provider}-user-${event.timestamp}`,
25524
25547
  type: "user",
25525
- content,
25548
+ content: userContent,
25526
25549
  timestamp: event.timestamp
25527
25550
  });
25528
25551
  }
25529
25552
  continue;
25530
25553
  }
25531
- if (event.type === "fx-error") {
25554
+ if (isProviderEvent(event, provider, "error")) {
25532
25555
  messages.push({
25533
- id: `fx-error-${event.timestamp}`,
25556
+ id: `${provider}-error-${event.timestamp}`,
25534
25557
  type: "error",
25535
- message: typeof event.payload.message === "string" ? event.payload.message : "fx failed",
25558
+ message: typeof event.payload.message === "string" ? event.payload.message : `${provider} failed`,
25536
25559
  timestamp: event.timestamp
25537
25560
  });
25538
25561
  continue;
25539
25562
  }
25540
- if (event.type === "fx-turn-complete") {
25563
+ if (isProviderEvent(event, provider, "turn-complete")) {
25541
25564
  for (const message of messages) {
25542
25565
  if (message.type === "reasoning" && message.status === "in_progress") message.status = "completed";
25543
25566
  }
25567
+ activeChunks.agent_message_chunk = void 0;
25568
+ activeChunks.agent_thought_chunk = void 0;
25544
25569
  continue;
25545
25570
  }
25546
- if (event.type !== "fx-session-update" || !isRecord(event.payload.update)) continue;
25571
+ if (event.type === "replicas-tool-input-request" && typeof event.payload.toolUseId === "string" && typeof event.payload.requestId === "string") {
25572
+ const message = messages.find((candidate) => candidate.type === "tool_call" && candidate.id === `${provider}-tool-${event.payload.toolUseId}`);
25573
+ if (message && (Array.isArray(event.payload.options) || Array.isArray(event.payload.questions))) {
25574
+ const resolved = resolvedInputs.get(event.payload.toolUseId);
25575
+ message.inputRequest = {
25576
+ requestId: event.payload.requestId,
25577
+ status: resolved?.selectionId === "aborted" ? "aborted" : resolved ? "resolved" : "pending",
25578
+ ...Array.isArray(event.payload.options) ? { options: event.payload.options } : {},
25579
+ ...Array.isArray(event.payload.questions) ? { questions: event.payload.questions } : {},
25580
+ ...resolved ? { selectionId: resolved.selectionId } : {},
25581
+ ...resolved?.selectionSummary ? { selectionSummary: resolved.selectionSummary } : {}
25582
+ };
25583
+ }
25584
+ continue;
25585
+ }
25586
+ if (event.type === "replicas-tool-input-resolved" && typeof event.payload.toolUseId === "string" && typeof event.payload.selectionId === "string") {
25587
+ const resolved = {
25588
+ selectionId: event.payload.selectionId,
25589
+ ...typeof event.payload.selectionSummary === "string" ? { selectionSummary: event.payload.selectionSummary } : {}
25590
+ };
25591
+ resolvedInputs.set(event.payload.toolUseId, resolved);
25592
+ const message = messages.find((candidate) => candidate.type === "tool_call" && candidate.id === `${provider}-tool-${event.payload.toolUseId}`);
25593
+ if (message?.inputRequest) {
25594
+ message.inputRequest = {
25595
+ ...message.inputRequest,
25596
+ status: resolved.selectionId === "aborted" ? "aborted" : "resolved",
25597
+ ...resolved
25598
+ };
25599
+ }
25600
+ continue;
25601
+ }
25602
+ if (!isProviderEvent(event, provider, "session-update") || !isRecord(event.payload.update)) continue;
25547
25603
  const update = event.payload.update;
25548
25604
  const kind = update.sessionUpdate;
25549
25605
  if (kind === "agent_message_chunk" || kind === "agent_thought_chunk") {
25550
- const content2 = getFxTextChunk(update, kind);
25551
- if (!content2) continue;
25552
- const id = typeof update.messageId === "string" ? `fx-${update.messageId}` : `fx-${kind}-${event.timestamp}`;
25606
+ const content = getAcpTextChunk(update, kind);
25607
+ if (content === null) continue;
25608
+ const explicitId = typeof update.messageId === "string" && update.messageId.length > 0 ? `${provider}-${kind}-${update.messageId}` : null;
25609
+ const id = explicitId ?? activeChunks[kind] ?? `${provider}-${kind}-${chunkSequence++}`;
25610
+ activeChunks[kind] = id;
25611
+ const otherKind = kind === "agent_message_chunk" ? "agent_thought_chunk" : "agent_message_chunk";
25612
+ if (!explicitId) activeChunks[otherKind] = void 0;
25553
25613
  const existing = messages.find((message) => message.id === id);
25554
- const text = `${existing && "content" in existing && typeof existing.content === "string" ? existing.content : ""}${content2}`;
25614
+ const text = `${existing && "content" in existing && typeof existing.content === "string" ? existing.content : ""}${content}`.replace(provider === "fx" ? FX_CONTEXT_DIAGNOSTIC : /$^/, "");
25615
+ if (!text) continue;
25555
25616
  upsertDisplayMessage(messages, kind === "agent_thought_chunk" ? { id, type: "reasoning", content: text, status: "in_progress", timestamp: existing?.timestamp ?? event.timestamp } : { id, type: "agent", content: text, timestamp: existing?.timestamp ?? event.timestamp });
25556
25617
  continue;
25557
25618
  }
25619
+ activeChunks.agent_message_chunk = void 0;
25620
+ activeChunks.agent_thought_chunk = void 0;
25558
25621
  if ((kind === "tool_call" || kind === "tool_call_update") && typeof update.toolCallId === "string") {
25559
- const id = `fx-tool-${update.toolCallId}`;
25622
+ const id = `${provider}-tool-${update.toolCallId}`;
25560
25623
  const existing = messages.find((message) => message.id === id && message.type === "tool_call");
25561
25624
  const status = update.status === "completed" || update.status === "failed" ? update.status === "failed" ? "failed" : "completed" : "in_progress";
25625
+ const contentOutput = Array.isArray(update.content) && update.content.length > 0 ? stringifyDisplayValue(update.content) : void 0;
25562
25626
  upsertDisplayMessage(messages, createCallDisplayMessage({
25563
25627
  id,
25564
- server: "fx",
25565
- tool: typeof update.name === "string" ? update.name : typeof update.title === "string" ? update.title : existing?.tool ?? "tool",
25628
+ server: provider,
25629
+ tool: typeof update.name === "string" && update.name ? update.name : typeof update.title === "string" && update.title ? update.title : existing?.tool ?? (typeof update.kind === "string" ? update.kind : "tool"),
25566
25630
  input: update.rawInput === void 0 ? existing?.input : isRecord(update.rawInput) ? update.rawInput : stringifyDisplayValue(update.rawInput),
25567
- output: update.rawOutput === void 0 ? existing?.output : stringifyDisplayValue(update.rawOutput),
25631
+ output: update.rawOutput === void 0 ? contentOutput ?? existing?.output : stringifyDisplayValue(update.rawOutput),
25568
25632
  status,
25569
- timestamp: event.timestamp
25633
+ timestamp: existing?.timestamp ?? event.timestamp
25570
25634
  }));
25635
+ continue;
25636
+ }
25637
+ const plan = kind === "plan" ? update : isRecord(update.plan) ? update.plan : void 0;
25638
+ if ((kind === "plan" || kind === "plan_update") && plan && Array.isArray(plan.entries)) {
25639
+ const items = plan.entries.flatMap((entry) => {
25640
+ if (!isRecord(entry) || typeof entry.content !== "string") return [];
25641
+ const itemStatus = entry.status === "completed" || entry.status === "in_progress" ? entry.status : "pending";
25642
+ return [{
25643
+ text: entry.content,
25644
+ completed: entry.status === "completed",
25645
+ itemStatus
25646
+ }];
25647
+ });
25648
+ upsertDisplayMessage(messages, {
25649
+ id: `${provider}-plan-${typeof plan.planId === "string" ? plan.planId : "current"}`,
25650
+ type: "todo_list",
25651
+ items,
25652
+ status: items.every((item) => item.completed) ? "completed" : "in_progress",
25653
+ timestamp: event.timestamp
25654
+ });
25571
25655
  }
25572
25656
  }
25573
25657
  return messages;
25574
25658
  }
25575
25659
 
25660
+ // ../shared/src/display-message/parsers/fx-parser.ts
25661
+ function parseFxEvents(events) {
25662
+ return parseAcpEvents(events, "fx");
25663
+ }
25664
+
25576
25665
  // ../shared/src/display-message/parsers/opencode-parser.ts
25577
25666
  function timestampFromMs(value, fallback) {
25578
25667
  return typeof value === "number" && Number.isFinite(value) ? new Date(value).toISOString() : fallback;
@@ -26740,6 +26829,9 @@ function parseAgentEvents(events, agentType) {
26740
26829
  if (agentType === "fx") {
26741
26830
  return parseFxEvents(events);
26742
26831
  }
26832
+ if (agentType === "kimi") {
26833
+ return parseAcpEvents(events, "kimi");
26834
+ }
26743
26835
  if (agentType === "opencode") {
26744
26836
  return parseOpencodeEvents(events);
26745
26837
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-cli",
3
- "version": "0.2.545",
3
+ "version": "0.2.547",
4
4
  "description": "CLI for managing Replicas workspaces - SSH into cloud dev environments with automatic port forwarding",
5
5
  "main": "dist/index.cjs",
6
6
  "bin": {