@botiverse/raft-daemon 0.60.0 → 0.61.0

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/cli/index.js CHANGED
@@ -218,6 +218,7 @@ function targetHostClassForUrl(url2) {
218
218
  const hostname3 = url2.hostname.toLowerCase();
219
219
  if (hostname3 === "127.0.0.1" || hostname3 === "localhost" || hostname3 === "::1") return "local_daemon";
220
220
  if (hostname3 === "api.slock.ai") return "api.slock.ai";
221
+ if (hostname3 === "api.raft.build") return "api.raft.build";
221
222
  return "custom_server";
222
223
  }
223
224
  function upstreamLayerForFetchError(url2, err) {
@@ -1476,6 +1477,12 @@ import fs2 from "fs";
1476
1477
  import path4 from "path";
1477
1478
  import { randomUUID } from "crypto";
1478
1479
 
1480
+ // ../shared/src/typeGuards.ts
1481
+ function makeIsMember(members) {
1482
+ const set2 = new Set(members);
1483
+ return (value) => typeof value === "string" && set2.has(value);
1484
+ }
1485
+
1479
1486
  // ../shared/src/slockRefs.ts
1480
1487
  var SLOCK_REF_CHANNEL_NAME_PATTERN = String.raw`[\p{L}\p{N}_-]+`;
1481
1488
  var SLOCK_REF_USER_NAME_PATTERN = SLOCK_REF_CHANNEL_NAME_PATTERN;
@@ -1499,6 +1506,10 @@ var CHANNEL_MESSAGE_RE = new RegExp(
1499
1506
  String.raw`^#(${SLOCK_REF_CHANNEL_NAME_PATTERN})(?::(${SLOCK_REF_THREAD_SHORT_ID_PATTERN}))?\s+msg=(${SLOCK_REF_MESSAGE_ID_PATTERN})$`,
1500
1507
  "iu"
1501
1508
  );
1509
+ var DM_MESSAGE_RE = new RegExp(
1510
+ String.raw`^dm:@(${SLOCK_REF_DM_PEER_PATTERN})(?::(${SLOCK_REF_THREAD_SHORT_ID_PATTERN}))?\s+msg=(${SLOCK_REF_MESSAGE_ID_PATTERN})$`,
1511
+ "iu"
1512
+ );
1502
1513
 
1503
1514
  // ../shared/src/producerFactLineage.ts
1504
1515
  var PRODUCER_FACT_TEXT_LABEL = "producerFactId";
@@ -15721,6 +15732,9 @@ var SERVER_CAPABILITY_MATRIX = {
15721
15732
  };
15722
15733
 
15723
15734
  // ../shared/src/index.ts
15735
+ var AGENT_ACTIVITIES = ["online", "thinking", "working", "error", "offline"];
15736
+ var isAgentActivity = makeIsMember(AGENT_ACTIVITIES);
15737
+ var VALID_ACTIVITIES = new Set(AGENT_ACTIVITIES);
15724
15738
  var EXTERNAL_AGENT_ACTIVITY_EVENT_SCHEMA = "raft-activity.v1";
15725
15739
  var EXTERNAL_AGENT_ACTIVITY_DRAIN_SCHEMA = "raft-activity-drain.v1";
15726
15740
  var EXTERNAL_AGENT_ACTIVITY_INGEST_SCHEMA = "raft-agent-activity-ingest.v1";
@@ -15736,7 +15750,11 @@ var RUNTIMES = [
15736
15750
  { id: "claude", displayName: "Claude Code", binary: "claude", supported: true },
15737
15751
  { id: "codex", displayName: "Codex CLI", binary: "codex", supported: true },
15738
15752
  { id: "antigravity", displayName: "Antigravity CLI", binary: "agy", supported: true },
15739
- { id: "kimi", displayName: "Kimi CLI", binary: "kimi", supported: true },
15753
+ // Kimi: prefer the in-process SDK (`kimi-sdk` "Kimi Code") for new agents.
15754
+ // The legacy `kimi` (kimi-cli child-process) entry stays for backward compat
15755
+ // with existing `runtime=kimi` agents but is labelled deprecated.
15756
+ { id: "kimi-sdk", displayName: "Kimi Code", binary: "", supported: true },
15757
+ { id: "kimi", displayName: "Kimi CLI (deprecated)", binary: "kimi", supported: true },
15740
15758
  { id: "copilot", displayName: "Copilot CLI", binary: "copilot", supported: true },
15741
15759
  { id: "cursor", displayName: "Cursor CLI", binary: "cursor-agent", supported: true },
15742
15760
  { id: "gemini", displayName: "Gemini CLI", binary: "gemini", supported: true },
@@ -15808,6 +15826,15 @@ var RUNTIME_MODELS = {
15808
15826
  // built-in option is to defer to whatever default model the CLI already uses.
15809
15827
  kimi: [
15810
15828
  { id: "default", label: "Configured Default" }
15829
+ ],
15830
+ // kimi-sdk runs the Kimi Code SDK in-process. Surface the canonical model
15831
+ // first so getDefaultModel("kimi-sdk") returns it (without a static entry,
15832
+ // useRuntimeModels falls back to Claude's list and getDefaultModel returns
15833
+ // "sonnet" — which the SDK driver would pass through to the Kimi session
15834
+ // and the LLM call would fail). Mirrors detectKimiSdkModels() in the daemon.
15835
+ "kimi-sdk": [
15836
+ { id: "kimi-code/kimi-for-coding", label: "Kimi-K2.6 (Kimi for Coding)", verified: "launchable" },
15837
+ { id: "kimi-k2-0905-preview", label: "Kimi K2 (preview)", verified: "suggestion_only" }
15811
15838
  ]
15812
15839
  };
15813
15840
  var PLAN_CONFIG = {
package/dist/core.js CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  runBundledSlockCli,
12
12
  scanWorkspaceDirectories,
13
13
  subscribeDaemonLogs
14
- } from "./chunk-65UFKNJJ.js";
14
+ } from "./chunk-XMSXOB5R.js";
15
15
  export {
16
16
  DAEMON_CLI_USAGE,
17
17
  DaemonCore,
@@ -235,6 +235,7 @@ function targetHostClassForUrl(url2) {
235
235
  const hostname3 = url2.hostname.toLowerCase();
236
236
  if (hostname3 === "127.0.0.1" || hostname3 === "localhost" || hostname3 === "::1") return "local_daemon";
237
237
  if (hostname3 === "api.slock.ai") return "api.slock.ai";
238
+ if (hostname3 === "api.raft.build") return "api.raft.build";
238
239
  return "custom_server";
239
240
  }
240
241
  function upstreamLayerForFetchError(url2, err) {
@@ -1457,6 +1458,10 @@ function describeMintError(code, serverUrl) {
1457
1458
  }
1458
1459
  return void 0;
1459
1460
  }
1461
+ function makeIsMember(members) {
1462
+ const set2 = new Set(members);
1463
+ return (value) => typeof value === "string" && set2.has(value);
1464
+ }
1460
1465
  var SLOCK_REF_CHANNEL_NAME_PATTERN = String.raw`[\p{L}\p{N}_-]+`;
1461
1466
  var SLOCK_REF_USER_NAME_PATTERN = SLOCK_REF_CHANNEL_NAME_PATTERN;
1462
1467
  var SLOCK_REF_DM_PEER_PATTERN = String.raw`[\w-]+`;
@@ -1479,6 +1484,10 @@ var CHANNEL_MESSAGE_RE = new RegExp(
1479
1484
  String.raw`^#(${SLOCK_REF_CHANNEL_NAME_PATTERN})(?::(${SLOCK_REF_THREAD_SHORT_ID_PATTERN}))?\s+msg=(${SLOCK_REF_MESSAGE_ID_PATTERN})$`,
1480
1485
  "iu"
1481
1486
  );
1487
+ var DM_MESSAGE_RE = new RegExp(
1488
+ String.raw`^dm:@(${SLOCK_REF_DM_PEER_PATTERN})(?::(${SLOCK_REF_THREAD_SHORT_ID_PATTERN}))?\s+msg=(${SLOCK_REF_MESSAGE_ID_PATTERN})$`,
1489
+ "iu"
1490
+ );
1482
1491
  var PRODUCER_FACT_TEXT_LABEL = "producerFactId";
1483
1492
  function formatProducerFactLineageNote(producerFactId) {
1484
1493
  const id = normalizeProducerFactId(producerFactId);
@@ -15527,6 +15536,9 @@ var SERVER_CAPABILITY_MATRIX = {
15527
15536
  joinPublicChannels: true
15528
15537
  })
15529
15538
  };
15539
+ var AGENT_ACTIVITIES = ["online", "thinking", "working", "error", "offline"];
15540
+ var isAgentActivity = makeIsMember(AGENT_ACTIVITIES);
15541
+ var VALID_ACTIVITIES = new Set(AGENT_ACTIVITIES);
15530
15542
  var EXTERNAL_AGENT_ACTIVITY_EVENT_SCHEMA = "raft-activity.v1";
15531
15543
  var EXTERNAL_AGENT_ACTIVITY_DRAIN_SCHEMA = "raft-activity-drain.v1";
15532
15544
  var EXTERNAL_AGENT_ACTIVITY_INGEST_SCHEMA = "raft-agent-activity-ingest.v1";
@@ -15542,7 +15554,11 @@ var RUNTIMES = [
15542
15554
  { id: "claude", displayName: "Claude Code", binary: "claude", supported: true },
15543
15555
  { id: "codex", displayName: "Codex CLI", binary: "codex", supported: true },
15544
15556
  { id: "antigravity", displayName: "Antigravity CLI", binary: "agy", supported: true },
15545
- { id: "kimi", displayName: "Kimi CLI", binary: "kimi", supported: true },
15557
+ // Kimi: prefer the in-process SDK (`kimi-sdk` "Kimi Code") for new agents.
15558
+ // The legacy `kimi` (kimi-cli child-process) entry stays for backward compat
15559
+ // with existing `runtime=kimi` agents but is labelled deprecated.
15560
+ { id: "kimi-sdk", displayName: "Kimi Code", binary: "", supported: true },
15561
+ { id: "kimi", displayName: "Kimi CLI (deprecated)", binary: "kimi", supported: true },
15546
15562
  { id: "copilot", displayName: "Copilot CLI", binary: "copilot", supported: true },
15547
15563
  { id: "cursor", displayName: "Cursor CLI", binary: "cursor-agent", supported: true },
15548
15564
  { id: "gemini", displayName: "Gemini CLI", binary: "gemini", supported: true },
@@ -15614,6 +15630,15 @@ var RUNTIME_MODELS = {
15614
15630
  // built-in option is to defer to whatever default model the CLI already uses.
15615
15631
  kimi: [
15616
15632
  { id: "default", label: "Configured Default" }
15633
+ ],
15634
+ // kimi-sdk runs the Kimi Code SDK in-process. Surface the canonical model
15635
+ // first so getDefaultModel("kimi-sdk") returns it (without a static entry,
15636
+ // useRuntimeModels falls back to Claude's list and getDefaultModel returns
15637
+ // "sonnet" — which the SDK driver would pass through to the Kimi session
15638
+ // and the LLM call would fail). Mirrors detectKimiSdkModels() in the daemon.
15639
+ "kimi-sdk": [
15640
+ { id: "kimi-code/kimi-for-coding", label: "Kimi-K2.6 (Kimi for Coding)", verified: "launchable" },
15641
+ { id: "kimi-k2-0905-preview", label: "Kimi K2 (preview)", verified: "suggestion_only" }
15617
15642
  ]
15618
15643
  };
15619
15644
  var PLAN_CONFIG = {
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  DAEMON_CLI_USAGE,
4
4
  DaemonCore,
5
5
  parseDaemonCliArgs
6
- } from "./chunk-65UFKNJJ.js";
6
+ } from "./chunk-XMSXOB5R.js";
7
7
 
8
8
  // src/index.ts
9
9
  var parsedArgs = parseDaemonCliArgs(process.argv.slice(2));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botiverse/raft-daemon",
3
- "version": "0.60.0",
3
+ "version": "0.61.0",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "raft-daemon": "dist/raft-daemon.js",
@@ -43,6 +43,7 @@
43
43
  "release:alpha": "npm version prerelease --preid=alpha --no-git-tag-version && cd ../.. && pnpm install --lockfile-only && git add packages/daemon/package.json pnpm-lock.yaml && git commit -m \"chore: bump @botiverse/raft-daemon to v$(node -p \"require('./packages/daemon/package.json').version\")\" && git tag daemon-v$(node -p \"require('./packages/daemon/package.json').version\") && git push && git push --tags"
44
44
  },
45
45
  "dependencies": {
46
+ "@botiverse/kimi-code-sdk": "0.9.3",
46
47
  "@earendil-works/pi-ai": "0.79.3",
47
48
  "@earendil-works/pi-coding-agent": "0.79.3",
48
49
  "@jackwener/opencli": "^1.8.3",