@botiverse/raft-daemon 0.72.4-play.20260710140617 → 0.72.4

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.
@@ -1472,10 +1472,6 @@ var TRACE_B0_FIELD_DEFINITIONS = defineTraceFields([
1472
1472
  { key: "phase", fieldClass: "query_axis", placement: "span_or_event", valueKind: "closed_enum", enumBinding: "pending_457" },
1473
1473
  { key: "eligibility_subcheck", fieldClass: "query_axis", placement: "event", valueKind: "closed_enum", enumBinding: "pending_457" },
1474
1474
  { key: "hint_source", fieldClass: "family_query_axis", placement: "event", valueKind: "closed_enum", scope: "family:activity" },
1475
- { key: "candidate_activity", fieldClass: "family_query_axis", placement: "event", valueKind: "closed_enum", scope: "family:activity" },
1476
- { key: "served_activity", fieldClass: "family_query_axis", placement: "event", valueKind: "closed_enum", scope: "family:activity" },
1477
- { key: "write_action", fieldClass: "family_query_axis", placement: "event", valueKind: "closed_enum", scope: "family:activity", enumBinding: "stable", enumValues: ["none"] },
1478
- { key: "arbitration_reason", fieldClass: "family_query_axis", placement: "event", valueKind: "closed_enum", scope: "family:activity", enumBinding: "stable", enumValues: ["trusted_snapshot", "owner_mirror_read_through"] },
1479
1475
  { key: "weak_source", fieldClass: "family_query_axis", placement: "event", valueKind: "closed_enum", scope: "family:activity" },
1480
1476
  { key: "competing_fact", fieldClass: "family_query_axis", placement: "event", valueKind: "closed_enum", scope: "family:activity" },
1481
1477
  { key: "resolved_activity", fieldClass: "family_query_axis", placement: "event", valueKind: "closed_enum", scope: "family:activity" },
@@ -2032,7 +2028,7 @@ var agentStatusSchema = z2.enum(["active", "inactive", "stopped"]);
2032
2028
  var reminderStatusSchema = z2.enum(["scheduled", "fired", "canceled"]);
2033
2029
  var reminderEventTypeSchema = z2.enum(["scheduled", "fired", "snoozed", "updated", "canceled"]);
2034
2030
  var reasoningEffortSchema = z2.enum(["low", "medium", "high", "xhigh", "max", "ultra"]);
2035
- var profileVisibilityMembershipStatusSchema = z2.enum(["active", "left", "removed"]);
2031
+ var profileVisibilityMembershipStatusSchema = z2.enum(["active", "removed"]);
2036
2032
  var passthroughObject = (shape) => z2.object(shape).passthrough();
2037
2033
  var taskStatusSchema = z2.enum(["todo", "in_progress", "in_review", "done", "closed"]);
2038
2034
  var agentApiEventsQuerySchema = passthroughObject({
@@ -2102,10 +2098,6 @@ var agentApiSendBodySchema = passthroughObject({
2102
2098
  draftReplacedExisting: optionalBooleanSchema,
2103
2099
  seenUpToSeq: optionalNumberSchema
2104
2100
  });
2105
- var legacyAgentSendBodySchema = agentApiSendBodySchema.extend({
2106
- channel: z2.string().optional(),
2107
- dm_to: z2.string().optional()
2108
- });
2109
2101
  var agentApiMessageResolveParamsSchema = passthroughObject({
2110
2102
  msgId: z2.string().trim().min(1).transform(asMessageId)
2111
2103
  });
@@ -5151,15 +5143,6 @@ function listLegacySlockStatePaths(slockHome = resolveSlockHome(), homeDir = os.
5151
5143
  return candidates.filter((candidate) => existsSync(candidate.path));
5152
5144
  }
5153
5145
 
5154
- // src/authEnv.ts
5155
- var DAEMON_API_KEY_ENV = "SLOCK_MACHINE_API_KEY";
5156
- var SLOCK_AGENT_TOKEN_ENV = "SLOCK_AGENT_TOKEN";
5157
- function scrubDaemonChildEnv(env) {
5158
- delete env[DAEMON_API_KEY_ENV];
5159
- delete env[SLOCK_AGENT_TOKEN_ENV];
5160
- return env;
5161
- }
5162
-
5163
5146
  // src/agentCredentialProxy.ts
5164
5147
  import { randomBytes } from "crypto";
5165
5148
  import http from "http";
@@ -6741,9 +6724,7 @@ var LOOPBACK_NO_PROXY = "127.0.0.1,localhost";
6741
6724
  var CLI_TRANSPORT_TRACE_DIR_ENV = "SLOCK_CLI_TRANSPORT_TRACE_DIR";
6742
6725
  var safePathPart = (value) => value.replace(/[^a-zA-Z0-9_.-]/g, "_");
6743
6726
  var RAW_CREDENTIAL_ENV_DENYLIST = [
6744
- "SLOCK_AGENT_TOKEN",
6745
- "SLOCK_AGENT_CREDENTIAL_KEY",
6746
- "SLOCK_AGENT_CREDENTIAL_KEY_FILE"
6727
+ "SLOCK_AGENT_CREDENTIAL_KEY"
6747
6728
  ];
6748
6729
  var WORKSPACE_CLI_TRANSPORT_FILENAMES = [
6749
6730
  "agent-token",
@@ -7098,7 +7079,7 @@ set "SLOCK_AGENT_ACTIVE_CAPABILITIES=${DEFAULT_ACTIVE_CAPABILITIES}"\r
7098
7079
  SLOCK_SERVER_URL: ctx.config.serverUrl,
7099
7080
  PATH: `${slockDir}${path2.delimiter}${process.env.PATH ?? ""}`
7100
7081
  };
7101
- scrubDaemonChildEnv(spawnEnv);
7082
+ delete spawnEnv.SLOCK_AGENT_TOKEN;
7102
7083
  for (const key of RAW_CREDENTIAL_ENV_DENYLIST) {
7103
7084
  delete spawnEnv[key];
7104
7085
  }
@@ -7666,7 +7647,7 @@ function requiresWindowsShell(command, platform = process.platform) {
7666
7647
  }
7667
7648
  function resolveCommandOnPath(command, deps = {}) {
7668
7649
  const platform = deps.platform ?? process.platform;
7669
- const env = scrubDaemonChildEnv({ ...withWindowsUserEnvironment(deps.env ?? process.env, deps) });
7650
+ const env = withWindowsUserEnvironment(deps.env ?? process.env, deps);
7670
7651
  const execFileSyncFn = deps.execFileSyncFn ?? execFileSync;
7671
7652
  const existsSyncFn = deps.existsSyncFn ?? existsSync3;
7672
7653
  if (platform === "win32") {
@@ -7692,7 +7673,7 @@ function firstExistingPath(candidates, deps = {}) {
7692
7673
  return null;
7693
7674
  }
7694
7675
  function readCommandVersion(command, args = [], deps = {}) {
7695
- const env = scrubDaemonChildEnv({ ...withWindowsUserEnvironment(deps.env ?? process.env, deps) });
7676
+ const env = withWindowsUserEnvironment(deps.env ?? process.env, deps);
7696
7677
  const execFileSyncFn = deps.execFileSyncFn ?? execFileSync;
7697
7678
  try {
7698
7679
  const output = normalizeExecOutput(execFileSyncFn(command, [...args, "--version"], {
@@ -9776,11 +9757,11 @@ function detectCursorModels(runCommand = runCursorModelsCommand) {
9776
9757
  return parseCursorModelsOutput(String(result.stdout || ""));
9777
9758
  }
9778
9759
  function buildCursorModelProbeEnv(deps = {}) {
9779
- return scrubDaemonChildEnv(withWindowsUserEnvironment({
9760
+ return withWindowsUserEnvironment({
9780
9761
  ...deps.env ?? process.env,
9781
9762
  FORCE_COLOR: "0",
9782
9763
  NO_COLOR: "1"
9783
- }, deps));
9764
+ }, deps);
9784
9765
  }
9785
9766
  function runCursorModelsCommand() {
9786
9767
  return spawnSync("cursor-agent", ["models"], {
@@ -9836,7 +9817,7 @@ function resolveGeminiSpawn(commandArgs, deps = {}) {
9836
9817
  }
9837
9818
  const execFileSyncFn = deps.execFileSyncFn ?? execFileSync3;
9838
9819
  const existsSyncFn = deps.existsSyncFn ?? existsSync5;
9839
- const env = scrubDaemonChildEnv({ ...deps.env ?? process.env });
9820
+ const env = deps.env ?? process.env;
9840
9821
  const winPath = path8.win32;
9841
9822
  let geminiEntry = null;
9842
9823
  try {
@@ -9973,15 +9954,12 @@ var GeminiDriver = class {
9973
9954
  // src/drivers/kimi.ts
9974
9955
  import { randomUUID as randomUUID2 } from "crypto";
9975
9956
  import { spawn as spawn7 } from "child_process";
9976
- import { chmodSync, existsSync as existsSync6, readFileSync as readFileSync3, writeFileSync as writeFileSync3 } from "fs";
9957
+ import { existsSync as existsSync6, readFileSync as readFileSync3, writeFileSync as writeFileSync3 } from "fs";
9977
9958
  import os4 from "os";
9978
9959
  import path9 from "path";
9979
9960
  var KIMI_WIRE_PROTOCOL_VERSION = "1.3";
9980
9961
  var KIMI_SYSTEM_PROMPT_FILE = ".slock-kimi-system.md";
9981
9962
  var KIMI_AGENT_FILE = ".slock-kimi-agent.yaml";
9982
- var KIMI_GENERATED_CONFIG_FILE = ".slock-kimi-config.toml";
9983
- var SLOCK_KIMI_CONFIG_CONTENT_ENV = "SLOCK_KIMI_CONFIG_CONTENT";
9984
- var SLOCK_KIMI_CONFIG_FILE_ENV = "SLOCK_KIMI_CONFIG_FILE";
9985
9963
  function parseToolArguments(raw) {
9986
9964
  if (typeof raw !== "string") return raw;
9987
9965
  try {
@@ -9990,73 +9968,6 @@ function parseToolArguments(raw) {
9990
9968
  return raw;
9991
9969
  }
9992
9970
  }
9993
- function readKimiConfigSource(home = os4.homedir(), env = process.env) {
9994
- const inlineConfig = env[SLOCK_KIMI_CONFIG_CONTENT_ENV];
9995
- if (inlineConfig && inlineConfig.trim()) {
9996
- return {
9997
- raw: inlineConfig,
9998
- explicitPath: null,
9999
- sourcePath: SLOCK_KIMI_CONFIG_CONTENT_ENV
10000
- };
10001
- }
10002
- const explicitPath = env[SLOCK_KIMI_CONFIG_FILE_ENV];
10003
- const configPath = explicitPath && explicitPath.trim() ? explicitPath : path9.join(home, ".kimi", "config.toml");
10004
- try {
10005
- return {
10006
- raw: readFileSync3(configPath, "utf8"),
10007
- explicitPath: explicitPath && explicitPath.trim() ? explicitPath : null,
10008
- sourcePath: configPath
10009
- };
10010
- } catch {
10011
- return {
10012
- raw: null,
10013
- explicitPath: explicitPath && explicitPath.trim() ? explicitPath : null,
10014
- sourcePath: configPath
10015
- };
10016
- }
10017
- }
10018
- function buildKimiSpawnEnv(env = process.env) {
10019
- const spawnEnv = { ...env, FORCE_COLOR: "0", NO_COLOR: "1" };
10020
- delete spawnEnv[SLOCK_KIMI_CONFIG_CONTENT_ENV];
10021
- delete spawnEnv[SLOCK_KIMI_CONFIG_FILE_ENV];
10022
- return scrubDaemonChildEnv(spawnEnv);
10023
- }
10024
- function buildKimiEffectiveEnv(ctx, overrideEnv) {
10025
- return {
10026
- ...process.env,
10027
- ...ctx.config.envVars || {},
10028
- ...overrideEnv || {}
10029
- };
10030
- }
10031
- function buildKimiLaunchOptions(ctx, opts = {}) {
10032
- const env = buildKimiEffectiveEnv(ctx, opts.env);
10033
- const source = readKimiConfigSource(opts.home ?? os4.homedir(), env);
10034
- const args = [];
10035
- let configFilePath = null;
10036
- let configContent = null;
10037
- if (source.explicitPath) {
10038
- configFilePath = source.explicitPath;
10039
- } else if (source.raw !== null && source.sourcePath === SLOCK_KIMI_CONFIG_CONTENT_ENV) {
10040
- configFilePath = path9.join(ctx.workingDirectory, KIMI_GENERATED_CONFIG_FILE);
10041
- configContent = source.raw;
10042
- if (opts.writeGeneratedConfig !== false) {
10043
- writeFileSync3(configFilePath, source.raw, { encoding: "utf8", mode: 384 });
10044
- chmodSync(configFilePath, 384);
10045
- }
10046
- }
10047
- if (configFilePath) {
10048
- args.push("--config-file", configFilePath);
10049
- }
10050
- if (ctx.config.model && ctx.config.model !== "default") {
10051
- args.push("--model", ctx.config.model);
10052
- }
10053
- return {
10054
- args,
10055
- env: buildKimiSpawnEnv(env),
10056
- configFilePath,
10057
- configContent
10058
- };
10059
- }
10060
9971
  function resolveKimiSpawn(commandArgs, deps = {}) {
10061
9972
  return {
10062
9973
  command: resolveCommandOnPath("kimi", deps) ?? "kimi",
@@ -10080,25 +9991,7 @@ var KimiDriver = class {
10080
9991
  };
10081
9992
  model = {
10082
9993
  detectedModelsVerifiedAs: "launchable",
10083
- toLaunchSpec: (modelId, ctx, opts) => {
10084
- if (!ctx) return { args: ["--model", modelId] };
10085
- const launchCtx = {
10086
- ...ctx,
10087
- config: {
10088
- ...ctx.config,
10089
- model: modelId
10090
- }
10091
- };
10092
- const launch = buildKimiLaunchOptions(launchCtx, {
10093
- home: opts?.home,
10094
- writeGeneratedConfig: false
10095
- });
10096
- return {
10097
- args: launch.args,
10098
- env: launch.env,
10099
- configFiles: launch.configFilePath ? [launch.configFilePath] : void 0
10100
- };
10101
- }
9994
+ toLaunchSpec: (modelId) => ({ args: ["--model", modelId] })
10102
9995
  };
10103
9996
  supportsStdinNotification = true;
10104
9997
  busyDeliveryMode = "direct";
@@ -10122,23 +10015,21 @@ var KimiDriver = class {
10122
10015
  ` system_prompt_path: ./${KIMI_SYSTEM_PROMPT_FILE}`,
10123
10016
  ""
10124
10017
  ].join("\n"), "utf8");
10125
- const launch = buildKimiLaunchOptions(ctx);
10126
10018
  const args = [
10127
10019
  "--wire",
10128
10020
  "--yolo",
10129
10021
  "--agent-file",
10130
10022
  agentFilePath,
10131
10023
  "--session",
10132
- this.sessionId,
10133
- ...launch.args
10024
+ this.sessionId
10134
10025
  ];
10135
10026
  const launchRuntimeFields = runtimeConfigToLaunchFields(hydrateRuntimeConfig(ctx.config));
10136
10027
  if (launchRuntimeFields.model && launchRuntimeFields.model !== "default") {
10137
10028
  args.push("--model", launchRuntimeFields.model);
10138
10029
  }
10139
10030
  const spawnEnv = (await prepareCliTransport(ctx, { NO_COLOR: "1" })).spawnEnv;
10140
- const spawnTarget = resolveKimiSpawn(args);
10141
- const proc = spawn7(spawnTarget.command, spawnTarget.args, {
10031
+ const launch = resolveKimiSpawn(args);
10032
+ const proc = spawn7(launch.command, launch.args, {
10142
10033
  cwd: ctx.workingDirectory,
10143
10034
  stdio: ["pipe", "pipe", "pipe"],
10144
10035
  env: spawnEnv,
@@ -10146,7 +10037,7 @@ var KimiDriver = class {
10146
10037
  // and has an 8191-character command-line limit. Kimi's official
10147
10038
  // installer/uv entrypoint is an executable, so launch it directly and
10148
10039
  // keep prompts on stdin / files instead of routing through cmd.exe.
10149
- shell: spawnTarget.shell
10040
+ shell: launch.shell
10150
10041
  });
10151
10042
  proc.stdin?.write(JSON.stringify({
10152
10043
  jsonrpc: "2.0",
@@ -10259,9 +10150,14 @@ var KimiDriver = class {
10259
10150
  return detectKimiModels();
10260
10151
  }
10261
10152
  };
10262
- function detectKimiModels(home = os4.homedir(), opts = {}) {
10263
- const raw = readKimiConfigSource(home, opts.env).raw;
10264
- if (raw === null) return null;
10153
+ function detectKimiModels(home = os4.homedir()) {
10154
+ const configPath = path9.join(home, ".kimi", "config.toml");
10155
+ let raw;
10156
+ try {
10157
+ raw = readFileSync3(configPath, "utf8");
10158
+ } catch {
10159
+ return null;
10160
+ }
10265
10161
  const models = [];
10266
10162
  const sectionRe = /^\s*\[models(?:\.([^\]]+)|"\.[^"]+"|\."[^"]+")\s*\]\s*$/gm;
10267
10163
  const lineRe = /^\s*\[models\.(.+?)\s*\]\s*$/gm;
@@ -10521,12 +10417,6 @@ var KimiSdkRuntimeSession = class {
10521
10417
  get closed() {
10522
10418
  return this.didClose;
10523
10419
  }
10524
- // In-process SDK session: there is no OS pid to probe with signal-0, so
10525
- // liveness is unknowable via the pid-probe boundary. Return undefined, which
10526
- // callers treat the same as the historic "no pid" probe result (RS-011).
10527
- isAlive() {
10528
- return void 0;
10529
- }
10530
10420
  on(event, cb) {
10531
10421
  this.events.on(event, cb);
10532
10422
  }
@@ -10946,7 +10836,7 @@ function runOpenCodeModelsCommand(home, deps = {}) {
10946
10836
  const platform = deps.platform ?? process.platform;
10947
10837
  const spawnSyncFn = deps.spawnSyncFn ?? spawnSync2;
10948
10838
  const result = spawnSyncFn("opencode", ["models"], {
10949
- env: scrubDaemonChildEnv({ ...process.env, HOME: home, FORCE_COLOR: "0", NO_COLOR: "1" }),
10839
+ env: { ...process.env, HOME: home, FORCE_COLOR: "0", NO_COLOR: "1" },
10950
10840
  encoding: "utf8",
10951
10841
  timeout: 5e3,
10952
10842
  shell: platform === "win32"
@@ -11794,12 +11684,6 @@ var PiSdkRuntimeSession = class {
11794
11684
  get closed() {
11795
11685
  return this.didClose;
11796
11686
  }
11797
- // In-process SDK session: there is no OS pid to probe with signal-0, so
11798
- // liveness is unknowable via the pid-probe boundary. Return undefined, which
11799
- // callers treat the same as the historic "no pid" probe result (RS-011).
11800
- isAlive() {
11801
- return void 0;
11802
- }
11803
11687
  on(event, cb) {
11804
11688
  this.events.on(event, cb);
11805
11689
  }
@@ -12118,25 +12002,6 @@ var ChildProcessRuntimeSession = class {
12118
12002
  get closed() {
12119
12003
  return this.process ? this.process.exitCode != null || this.process.signalCode != null : false;
12120
12004
  }
12121
- /**
12122
- * Read-only OS liveness introspection (signal-0), NOT control IO — exposed so
12123
- * managers query liveness through the session boundary (RS-011) instead of
12124
- * poking the raw pid. Preserves the historic `probeRuntimeProcessLiveness`
12125
- * semantics exactly: undefined when there is no pid, true on success or EPERM,
12126
- * false otherwise. Deliberately does NOT short-circuit on `this.closed` — the
12127
- * original probe checked only pid + signal-0.
12128
- */
12129
- isAlive() {
12130
- const pid = this.process?.pid;
12131
- if (typeof pid !== "number") return void 0;
12132
- try {
12133
- process.kill(pid, 0);
12134
- return true;
12135
- } catch (err) {
12136
- const code = typeof err === "object" && err !== null && "code" in err ? err.code : void 0;
12137
- return code === "EPERM" ? true : false;
12138
- }
12139
- }
12140
12005
  on(event, cb) {
12141
12006
  this.events.on(event, cb);
12142
12007
  }
@@ -12250,61 +12115,6 @@ function getDriver(runtimeId) {
12250
12115
  return driver;
12251
12116
  }
12252
12117
 
12253
- // src/daemonOrphanReaper.ts
12254
- async function reapOrphanProcesses(pids, logger2, recordTrace) {
12255
- const survivors = pids.filter((pid) => {
12256
- try {
12257
- process.kill(pid, 0);
12258
- return true;
12259
- } catch {
12260
- return false;
12261
- }
12262
- });
12263
- if (survivors.length === 0) return false;
12264
- for (const pid of survivors) {
12265
- logger2.warn(`[Daemon] Agent subprocess ${pid} survived stopAll; sending SIGKILL`);
12266
- try {
12267
- process.kill(pid, "SIGKILL");
12268
- } catch {
12269
- }
12270
- }
12271
- recordTrace("daemon.agent.stop_all.survivor_reaped", {
12272
- survivor_count: survivors.length,
12273
- survivor_pids: survivors.join(","),
12274
- reason: "shutdown_survivor",
12275
- signal: "SIGKILL"
12276
- });
12277
- const deadline = Date.now() + 2e3;
12278
- while (Date.now() < deadline) {
12279
- const alive = survivors.filter((pid) => {
12280
- try {
12281
- process.kill(pid, 0);
12282
- return true;
12283
- } catch {
12284
- return false;
12285
- }
12286
- });
12287
- if (alive.length === 0) break;
12288
- await new Promise((r) => setTimeout(r, 50));
12289
- }
12290
- const stillAlive = survivors.filter((pid) => {
12291
- try {
12292
- process.kill(pid, 0);
12293
- return true;
12294
- } catch {
12295
- return false;
12296
- }
12297
- });
12298
- const outcome = stillAlive.length > 0 ? "survivors_still_alive" : "survivors_killed";
12299
- recordTrace("daemon.agent.stop_all.completed", {
12300
- survivor_count: survivors.length,
12301
- reaped_count: survivors.length - stillAlive.length,
12302
- still_alive_count: stillAlive.length,
12303
- outcome
12304
- }, stillAlive.length > 0 ? "error" : "ok");
12305
- return true;
12306
- }
12307
-
12308
12118
  // src/workspaces.ts
12309
12119
  import { readdir, rm, stat } from "fs/promises";
12310
12120
  import path13 from "path";
@@ -13731,88 +13541,6 @@ var RuntimeNotificationState = class {
13731
13541
  }
13732
13542
  };
13733
13543
 
13734
- // src/proxyFailureTrace.ts
13735
- function failureReason(input) {
13736
- if (input.lifecycleInvalidContext) return "local_daemon_state_invalid";
13737
- const text = `${input.errorCause ?? ""} ${input.errorMessage}`.toLowerCase();
13738
- if (/enotfound|eai_again|\bdns\b/.test(text)) return "dns";
13739
- if (/econnrefused|econnreset|epipe|und_err_socket|\bsocket\b|other side closed|terminated/.test(text)) return "tcp";
13740
- if (/certificate|\btls\b/.test(text)) return "tls";
13741
- if (/und_err_headers_timeout|und_err_body_timeout|\btimeout\b/.test(text)) return "read_timeout";
13742
- if (/\bproxy\b/.test(text)) return "proxy_connect";
13743
- if (/\bfly\b/.test(text)) return "fly_edge";
13744
- return "unknown";
13745
- }
13746
- function boundedErrorClass(value) {
13747
- if (value === "TypeError") return "TypeError";
13748
- if (value === "AbortError") return "AbortError";
13749
- if (value === "Error") return "Error";
13750
- return "OtherError";
13751
- }
13752
- function boundedMethod(value) {
13753
- const method = value.toUpperCase();
13754
- return ["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"].includes(method) ? method : "OTHER";
13755
- }
13756
- function cannedExcerpt(reason) {
13757
- switch (reason) {
13758
- case "local_daemon_state_invalid":
13759
- return "Local daemon lifecycle state rejected the proxy request";
13760
- case "dns":
13761
- return "Upstream DNS resolution failed";
13762
- case "tcp":
13763
- return "Upstream TCP connection failed";
13764
- case "tls":
13765
- return "Upstream TLS negotiation failed";
13766
- case "read_timeout":
13767
- return "Upstream response timed out";
13768
- case "proxy_connect":
13769
- return "Upstream proxy connection failed";
13770
- case "fly_edge":
13771
- return "Upstream edge transport failed";
13772
- case "unknown":
13773
- return "Proxy request failed with an unclassified cause";
13774
- }
13775
- }
13776
- function daemonProxyFailureTraceAttrs(input) {
13777
- const reason = failureReason(input);
13778
- return {
13779
- route_family: routeFamilyForPath(input.pathname),
13780
- method: boundedMethod(input.method),
13781
- outcome: "error",
13782
- reason,
13783
- error_class: boundedErrorClass(input.errorName),
13784
- error_excerpt: cannedExcerpt(reason),
13785
- ...typeof input.responseStatusCode === "number" ? { response_status_code: input.responseStatusCode } : {},
13786
- response_code_present: Boolean(input.responseCode)
13787
- };
13788
- }
13789
- function daemonTransportErrorExcerpt(input) {
13790
- if (input.normalizedCode === "local_daemon_state_invalid") {
13791
- return "Local daemon lifecycle state rejected the proxy request";
13792
- }
13793
- if (input.normalizedCode === "server_5xx") return "Upstream server returned a 5xx response";
13794
- switch (input.upstreamLayer) {
13795
- case "dns":
13796
- return "Upstream DNS resolution failed";
13797
- case "tcp":
13798
- return "Upstream TCP connection failed";
13799
- case "tls":
13800
- return "Upstream TLS negotiation failed";
13801
- case "read_timeout":
13802
- return "Upstream response timed out";
13803
- case "proxy_connect":
13804
- return "Upstream proxy connection failed";
13805
- case "fly_edge":
13806
- return "Upstream edge transport failed";
13807
- case "body_decode_failure":
13808
- return "Upstream response body could not be decoded";
13809
- case "http_status":
13810
- return "Upstream HTTP request failed";
13811
- case "unknown":
13812
- return "Proxy transport failed with an unclassified cause";
13813
- }
13814
- }
13815
-
13816
13544
  // src/agentProcessManager.ts
13817
13545
  var DEFAULT_MAX_CONCURRENT_AGENT_STARTS = 5;
13818
13546
  var DEFAULT_AGENT_START_INTERVAL_MS = 500;
@@ -16278,9 +16006,17 @@ var AgentProcessManager = class _AgentProcessManager {
16278
16006
  };
16279
16007
  }
16280
16008
  recordAgentProxyFailure(agentId, input) {
16281
- this.recordDaemonTrace("daemon.proxy.failed", {
16009
+ this.recordDaemonTrace("daemon.agent.proxy.failure", {
16282
16010
  agentId,
16283
- ...daemonProxyFailureTraceAttrs(input)
16011
+ method: input.method,
16012
+ path: input.pathname,
16013
+ query_keys: input.queryKeys,
16014
+ error_name: input.errorName,
16015
+ error_message: input.errorMessage,
16016
+ response_status_code: input.responseStatusCode,
16017
+ response_code: input.responseCode,
16018
+ lifecycle_invalid_agent_id: input.lifecycleInvalidAgentId,
16019
+ lifecycle_invalid_context: input.lifecycleInvalidContext
16284
16020
  }, "error");
16285
16021
  }
16286
16022
  recordAgentProxyTransportNormalizedError(agentId, input) {
@@ -16292,7 +16028,7 @@ var AgentProcessManager = class _AgentProcessManager {
16292
16028
  response_started: input.responseStarted,
16293
16029
  upstream_layer: input.upstreamLayer,
16294
16030
  ...typeof input.upstreamStatus === "number" ? { upstream_status: input.upstreamStatus } : {},
16295
- error_excerpt: daemonTransportErrorExcerpt(input),
16031
+ ...input.originalMessage ? { original_message: input.originalMessage } : {},
16296
16032
  launchId: input.launchId,
16297
16033
  target_host_class: input.targetHostClass,
16298
16034
  downstream_caller: input.downstreamCaller,
@@ -18452,12 +18188,57 @@ Use \`raft message read\` to catch up on the channels listed above, then stop. R
18452
18188
  pids: pids.join(",")
18453
18189
  });
18454
18190
  await Promise.all(ids.map((id) => this.stopAgent(id, { wait: true, silent: true })));
18455
- const reapedSurvivors = await reapOrphanProcesses(
18456
- pids,
18457
- logger,
18458
- (name, attrs, status) => this.recordDaemonTrace(name, attrs, status)
18459
- );
18460
- if (!reapedSurvivors) {
18191
+ const survivors = pids.filter((pid) => {
18192
+ try {
18193
+ process.kill(pid, 0);
18194
+ return true;
18195
+ } catch {
18196
+ return false;
18197
+ }
18198
+ });
18199
+ if (survivors.length > 0) {
18200
+ for (const pid of survivors) {
18201
+ logger.warn(`[Daemon] Agent subprocess ${pid} survived stopAll; sending SIGKILL`);
18202
+ try {
18203
+ process.kill(pid, "SIGKILL");
18204
+ } catch {
18205
+ }
18206
+ }
18207
+ this.recordDaemonTrace("daemon.agent.stop_all.survivor_reaped", {
18208
+ survivor_count: survivors.length,
18209
+ survivor_pids: survivors.join(","),
18210
+ reason: "shutdown_survivor",
18211
+ signal: "SIGKILL"
18212
+ });
18213
+ const deadline = Date.now() + 2e3;
18214
+ while (Date.now() < deadline) {
18215
+ const alive = survivors.filter((pid) => {
18216
+ try {
18217
+ process.kill(pid, 0);
18218
+ return true;
18219
+ } catch {
18220
+ return false;
18221
+ }
18222
+ });
18223
+ if (alive.length === 0) break;
18224
+ await new Promise((r) => setTimeout(r, 50));
18225
+ }
18226
+ const stillAlive = survivors.filter((pid) => {
18227
+ try {
18228
+ process.kill(pid, 0);
18229
+ return true;
18230
+ } catch {
18231
+ return false;
18232
+ }
18233
+ });
18234
+ const outcome = stillAlive.length > 0 ? "survivors_still_alive" : "survivors_killed";
18235
+ this.recordDaemonTrace("daemon.agent.stop_all.completed", {
18236
+ survivor_count: survivors.length,
18237
+ reaped_count: survivors.length - stillAlive.length,
18238
+ still_alive_count: stillAlive.length,
18239
+ outcome
18240
+ }, stillAlive.length > 0 ? "error" : "ok");
18241
+ } else {
18461
18242
  this.recordDaemonTrace("daemon.agent.stop_all.completed", {
18462
18243
  agent_count: ids.length,
18463
18244
  survivor_count: 0,
@@ -19199,8 +18980,7 @@ Use \`raft message read\` to catch up on the channels listed above, then stop. R
19199
18980
  const ap = this.agents.get(agentId);
19200
18981
  const entries = [...extraTrajectory];
19201
18982
  const hasToolStart = entries.some((e) => e.kind === "tool_start");
19202
- const isThinkingProgressFrame = activityKind === "thinking" && detail === "" && detailKind === "none" && entries.every((e) => e.kind === "thinking" || e.kind === "text");
19203
- if (!hasToolStart && !isThinkingProgressFrame) {
18983
+ if (!hasToolStart) {
19204
18984
  entries.push({
19205
18985
  kind: "status",
19206
18986
  activity: activityKind,
@@ -20212,7 +19992,15 @@ Use \`raft message read\` to catch up on the channels listed above, then stop. R
20212
19992
  return true;
20213
19993
  }
20214
19994
  probeRuntimeProcessLiveness(ap) {
20215
- return ap.runtime.isAlive();
19995
+ const pid = ap.runtime.pid;
19996
+ if (typeof pid !== "number") return void 0;
19997
+ try {
19998
+ process.kill(pid, 0);
19999
+ return true;
20000
+ } catch (err) {
20001
+ const code = typeof err === "object" && err !== null && "code" in err ? err.code : void 0;
20002
+ return code === "EPERM" ? true : false;
20003
+ }
20216
20004
  }
20217
20005
  recoverStaleProcessForQueuedMessageIfNeeded(agentId, ap) {
20218
20006
  const staleForMs = ap.runtimeProgress.ageMs();
@@ -22285,190 +22073,23 @@ function readPositiveIntegerEnv2(name, fallback) {
22285
22073
  }
22286
22074
 
22287
22075
  // src/computerMigrationGuard.ts
22288
- import { existsSync as existsSync9, readdirSync as readdirSync6, readFileSync as readFileSync9 } from "fs";
22076
+ import { existsSync as existsSync9, readdirSync as readdirSync6, readFileSync as readFileSync8 } from "fs";
22289
22077
  import path18 from "path";
22290
-
22291
- // src/legacySupervisor.ts
22292
- import { execFileSync as execFileSync4 } from "child_process";
22293
- import { readFileSync as readFileSync8 } from "fs";
22294
- function execFileText(file, args) {
22295
- try {
22296
- return execFileSync4(file, args, {
22297
- encoding: "utf8",
22298
- timeout: 1e3,
22299
- maxBuffer: 256 * 1024,
22300
- stdio: ["ignore", "pipe", "ignore"]
22301
- });
22302
- } catch {
22303
- return void 0;
22304
- }
22305
- }
22306
- function readFileText(file) {
22307
- try {
22308
- return readFileSync8(file, "utf8");
22309
- } catch {
22310
- return void 0;
22311
- }
22312
- }
22313
- function defaultProbe(pid) {
22314
- return {
22315
- pid,
22316
- platform: process.platform,
22317
- env: process.env,
22318
- execFile: execFileText,
22319
- readFile: readFileText
22320
- };
22321
- }
22322
- function shellQuote(value) {
22323
- return `'${value.replace(/'/g, `'\\''`)}'`;
22324
- }
22325
- function parentPid(probe, pid) {
22326
- const stdout = probe.execFile("ps", ["-o", "ppid=", "-p", String(pid)]);
22327
- const parsed = Number.parseInt(stdout?.trim() ?? "", 10);
22328
- return Number.isInteger(parsed) && parsed > 0 ? parsed : void 0;
22329
- }
22330
- function processCommand(probe, pid) {
22331
- return probe.execFile("ps", ["-o", "command=", "-p", String(pid)])?.trim().toLowerCase() ?? "";
22332
- }
22333
- function relatedProcessIds(probe) {
22334
- const ids = [probe.pid];
22335
- let current = probe.pid;
22336
- for (let depth = 0; depth < 12; depth += 1) {
22337
- const parent = parentPid(probe, current);
22338
- if (!parent || ids.includes(parent)) break;
22339
- ids.push(parent);
22340
- if (parent === 1) break;
22341
- current = parent;
22342
- }
22343
- return ids;
22344
- }
22345
- function detectPm2(probe, relatedPids) {
22346
- const hasPm2Ancestor = relatedPids.slice(1).some((pid) => processCommand(probe, pid).includes("pm2"));
22347
- const hasPm2Environment = Boolean(probe.env.PM2_HOME || probe.env.pm_id);
22348
- if (!hasPm2Ancestor && !hasPm2Environment) return void 0;
22349
- const pm2Json = probe.execFile("pm2", ["jlist"]);
22350
- if (pm2Json) {
22351
- try {
22352
- const entries = JSON.parse(pm2Json);
22353
- const entry = entries.find(
22354
- (candidate) => typeof candidate.pid === "number" && relatedPids.includes(candidate.pid)
22355
- );
22356
- if (entry) {
22357
- const name = typeof entry.name === "string" && entry.name.length > 0 ? entry.name : String(entry.pid);
22358
- return {
22359
- kind: "pm2",
22360
- detail: `PM2 app ${JSON.stringify(name)} is supervising this legacy daemon.`,
22361
- cleanupCommands: [`pm2 delete ${shellQuote(name)}`, "pm2 save"]
22362
- };
22363
- }
22364
- } catch {
22365
- }
22366
- }
22367
- return {
22368
- kind: "pm2",
22369
- detail: "PM2 is supervising this legacy daemon, but its app name could not be resolved.",
22370
- cleanupCommands: ["pm2 delete <legacy-daemon-app-name>", "pm2 save"]
22371
- };
22372
- }
22373
- function systemdUnitFromCgroup(cgroup) {
22374
- if (!cgroup) return void 0;
22375
- for (const line of cgroup.split("\n")) {
22376
- const pathPart = line.slice(line.lastIndexOf(":") + 1);
22377
- let unit;
22378
- for (const segment of pathPart.split("/")) {
22379
- if (segment.endsWith(".service") && segment.length > ".service".length && !/^user@\d+\.service$/.test(segment)) {
22380
- unit = segment;
22381
- }
22382
- }
22383
- if (unit) return { unit, user: pathPart.includes("/user.slice/") };
22384
- }
22385
- return void 0;
22386
- }
22387
- function detectSystemd(probe) {
22388
- if (probe.platform !== "linux") return void 0;
22389
- const cgroupUnit = systemdUnitFromCgroup(
22390
- probe.readFile(`/proc/${probe.pid}/cgroup`)
22391
- );
22392
- const hasSystemdEvidence = cgroupUnit !== void 0 || probe.env.INVOCATION_ID !== void 0;
22393
- if (!hasSystemdEvidence) return void 0;
22394
- if (cgroupUnit) {
22395
- const prefix = cgroupUnit.user ? "systemctl --user" : "sudo systemctl";
22396
- return {
22397
- kind: "systemd",
22398
- detail: `systemd unit ${JSON.stringify(cgroupUnit.unit)} is supervising this legacy daemon.`,
22399
- cleanupCommands: [
22400
- `${prefix} disable --now ${shellQuote(cgroupUnit.unit)}`
22401
- ]
22402
- };
22403
- }
22404
- return {
22405
- kind: "systemd",
22406
- detail: "systemd is supervising this legacy daemon, but its unit name could not be resolved.",
22407
- cleanupCommands: [
22408
- "systemctl --user disable --now <legacy-daemon-unit>.service"
22409
- ]
22410
- };
22411
- }
22412
- function detectLaunchd(probe) {
22413
- if (probe.platform !== "darwin") return void 0;
22414
- const label = probe.env.LAUNCH_JOBKEY_LABEL || probe.env.XPC_SERVICE_NAME;
22415
- if (!label || label === "0") return void 0;
22416
- return {
22417
- kind: "launchd",
22418
- detail: `launchd job ${JSON.stringify(label)} is supervising this legacy daemon.`,
22419
- cleanupCommands: [
22420
- `launchctl bootout gui/$(id -u)/${shellQuote(label)}`,
22421
- `rm -f ~/Library/LaunchAgents/${shellQuote(`${label}.plist`)}`
22422
- ]
22423
- };
22424
- }
22425
- function detectLegacyDaemonSupervisor(pid = process.pid) {
22426
- return detectLegacyDaemonSupervisorWithProbe(defaultProbe(pid));
22427
- }
22428
- function detectLegacyDaemonSupervisorWithProbe(probe) {
22429
- const relatedPids = relatedProcessIds(probe);
22430
- return detectPm2(probe, relatedPids) ?? detectSystemd(probe) ?? detectLaunchd(probe);
22431
- }
22432
- var legacyDaemonSupervisorFallbackCommands = [
22433
- "PM2: pm2 delete <legacy-daemon-app-name> && pm2 save",
22434
- "systemd: systemctl --user disable --now <legacy-daemon-unit>.service",
22435
- "launchd: launchctl bootout gui/$(id -u) ~/Library/LaunchAgents/<legacy-daemon-label>.plist && rm -f ~/Library/LaunchAgents/<legacy-daemon-label>.plist"
22436
- ];
22437
-
22438
- // src/computerMigrationGuard.ts
22439
22078
  var LegacyDaemonKeyAdoptedByComputerError = class extends Error {
22440
22079
  code = "LEGACY_DAEMON_KEY_ADOPTED_BY_COMPUTER";
22441
22080
  attachmentPath;
22442
22081
  serverId;
22443
- constructor(match, supervisor = detectLegacyDaemonSupervisor() ?? null) {
22082
+ constructor(match) {
22444
22083
  const serverDisplay = match.serverSlug ? `/${match.serverSlug}` : match.serverId;
22445
22084
  const startCommand = match.serverSlug ? `raft-computer start /${match.serverSlug}` : "raft-computer start";
22446
- const statusCommand = match.serverSlug ? `raft-computer status /${match.serverSlug}` : "raft-computer status";
22447
- const supervisorGuidance = formatSupervisorGuidance(
22448
- supervisor ?? void 0
22449
- );
22450
22085
  super(
22451
- `Legacy Raft daemon startup refused: this machine key was already migrated to Raft Computer for ${serverDisplay}.
22452
- Raft Computer now owns this connection; do not restart raft-daemon with the migrated key.
22453
- ${supervisorGuidance}
22454
- Then start and verify Raft Computer:
22455
- ${startCommand}
22456
- ${statusCommand}`
22086
+ `This legacy daemon key was already adopted by Raft Computer for ${serverDisplay}. Start the Computer supervisor instead: ${startCommand}. Legacy daemon startup is blocked to avoid relaunching a migrated machine key.`
22457
22087
  );
22458
22088
  this.name = "LegacyDaemonKeyAdoptedByComputerError";
22459
22089
  this.attachmentPath = match.attachmentPath;
22460
22090
  this.serverId = match.serverId;
22461
22091
  }
22462
22092
  };
22463
- function formatSupervisorGuidance(supervisor) {
22464
- if (supervisor) {
22465
- return `${supervisor.detail}
22466
- Remove the old supervisor entry so it cannot auto-restart:
22467
- ` + supervisor.cleanupCommands.map((command) => ` ${command}`).join("\n");
22468
- }
22469
- return `If a process manager keeps restarting the old daemon, remove the entry you configured:
22470
- ` + legacyDaemonSupervisorFallbackCommands.map((command) => ` ${command}`).join("\n");
22471
- }
22472
22093
  function daemonApiKeyFingerprint(apiKey) {
22473
22094
  return getDaemonMachineLockId(apiKey).slice("machine-".length);
22474
22095
  }
@@ -22485,7 +22106,7 @@ function findAdoptedComputerForLegacyFingerprint(slockHome, legacyApiKeyFingerpr
22485
22106
  const attachmentPath = path18.join(serversDir, serverId, "runner.state.json");
22486
22107
  let raw;
22487
22108
  try {
22488
- raw = readFileSync9(attachmentPath, "utf8");
22109
+ raw = readFileSync8(attachmentPath, "utf8");
22489
22110
  } catch {
22490
22111
  continue;
22491
22112
  }
@@ -22507,10 +22128,7 @@ function findAdoptedComputerForLegacyFingerprint(slockHome, legacyApiKeyFingerpr
22507
22128
  }
22508
22129
  function assertLegacyDaemonKeyNotAdoptedByComputer(options) {
22509
22130
  const legacyApiKeyFingerprint = daemonApiKeyFingerprint(options.apiKey);
22510
- const match = findAdoptedComputerForLegacyFingerprint(
22511
- options.slockHome,
22512
- legacyApiKeyFingerprint
22513
- );
22131
+ const match = findAdoptedComputerForLegacyFingerprint(options.slockHome, legacyApiKeyFingerprint);
22514
22132
  if (match) throw new LegacyDaemonKeyAdoptedByComputerError(match);
22515
22133
  }
22516
22134
 
@@ -23707,10 +23325,10 @@ function sanitizePathSegment2(value) {
23707
23325
  }
23708
23326
 
23709
23327
  // src/secretFile.ts
23710
- import { chmodSync as chmodSync2, mkdirSync as mkdirSync7, readFileSync as readFileSync10, writeFileSync as writeFileSync7 } from "fs";
23328
+ import { chmodSync, mkdirSync as mkdirSync7, readFileSync as readFileSync9, writeFileSync as writeFileSync7 } from "fs";
23711
23329
  import path22 from "path";
23712
23330
  function readSecretFileSync(filePath) {
23713
- return readFileSync10(filePath, "utf8").trim();
23331
+ return readFileSync9(filePath, "utf8").trim();
23714
23332
  }
23715
23333
 
23716
23334
  // src/core.ts
@@ -23916,8 +23534,6 @@ function parseDaemonCliArgs(args) {
23916
23534
  return { serverUrl, apiKey };
23917
23535
  }
23918
23536
  function readDaemonVersion(moduleUrl = import.meta.url) {
23919
- const baked = process.env.RAFT_DAEMON_VERSION;
23920
- if (typeof baked === "string" && baked.length > 0) return baked;
23921
23537
  try {
23922
23538
  const require2 = createRequire3(moduleUrl);
23923
23539
  return require2("../package.json").version;
@@ -23946,7 +23562,7 @@ function resolveSlockCliPathOrEmpty(moduleUrl = import.meta.url) {
23946
23562
  }
23947
23563
  async function runBundledSlockCli(argv) {
23948
23564
  process.argv = [process.execPath, "slock", ...argv];
23949
- await import("./dist-CRXPFW5L.js");
23565
+ await import("./dist-VNC64ECP.js");
23950
23566
  }
23951
23567
  function detectRuntimes(tracer = noopTracer) {
23952
23568
  const ids = [];
@@ -25374,9 +24990,6 @@ export {
25374
24990
  resolveWorkspaceDirectoryPath,
25375
24991
  scanWorkspaceDirectories,
25376
24992
  deleteWorkspaceDirectory,
25377
- detectLegacyDaemonSupervisor,
25378
- detectLegacyDaemonSupervisorWithProbe,
25379
- legacyDaemonSupervisorFallbackCommands,
25380
24993
  AGENT_MIGRATION_TRANSPORT_HOST_ENV,
25381
24994
  AGENT_MIGRATION_TRANSPORT_PORT_ENV,
25382
24995
  AGENT_MIGRATION_TRANSPORT_PUBLIC_URL_ENV,
package/dist/cli/index.js CHANGED
@@ -28886,10 +28886,6 @@ var TRACE_B0_FIELD_DEFINITIONS = defineTraceFields([
28886
28886
  { key: "phase", fieldClass: "query_axis", placement: "span_or_event", valueKind: "closed_enum", enumBinding: "pending_457" },
28887
28887
  { key: "eligibility_subcheck", fieldClass: "query_axis", placement: "event", valueKind: "closed_enum", enumBinding: "pending_457" },
28888
28888
  { key: "hint_source", fieldClass: "family_query_axis", placement: "event", valueKind: "closed_enum", scope: "family:activity" },
28889
- { key: "candidate_activity", fieldClass: "family_query_axis", placement: "event", valueKind: "closed_enum", scope: "family:activity" },
28890
- { key: "served_activity", fieldClass: "family_query_axis", placement: "event", valueKind: "closed_enum", scope: "family:activity" },
28891
- { key: "write_action", fieldClass: "family_query_axis", placement: "event", valueKind: "closed_enum", scope: "family:activity", enumBinding: "stable", enumValues: ["none"] },
28892
- { key: "arbitration_reason", fieldClass: "family_query_axis", placement: "event", valueKind: "closed_enum", scope: "family:activity", enumBinding: "stable", enumValues: ["trusted_snapshot", "owner_mirror_read_through"] },
28893
28889
  { key: "weak_source", fieldClass: "family_query_axis", placement: "event", valueKind: "closed_enum", scope: "family:activity" },
28894
28890
  { key: "competing_fact", fieldClass: "family_query_axis", placement: "event", valueKind: "closed_enum", scope: "family:activity" },
28895
28891
  { key: "resolved_activity", fieldClass: "family_query_axis", placement: "event", valueKind: "closed_enum", scope: "family:activity" },
@@ -42943,7 +42939,7 @@ var agentStatusSchema = external_exports.enum(["active", "inactive", "stopped"])
42943
42939
  var reminderStatusSchema = external_exports.enum(["scheduled", "fired", "canceled"]);
42944
42940
  var reminderEventTypeSchema = external_exports.enum(["scheduled", "fired", "snoozed", "updated", "canceled"]);
42945
42941
  var reasoningEffortSchema = external_exports.enum(["low", "medium", "high", "xhigh", "max", "ultra"]);
42946
- var profileVisibilityMembershipStatusSchema = external_exports.enum(["active", "left", "removed"]);
42942
+ var profileVisibilityMembershipStatusSchema = external_exports.enum(["active", "removed"]);
42947
42943
  var passthroughObject = (shape) => external_exports.object(shape).passthrough();
42948
42944
  var taskStatusSchema = external_exports.enum(["todo", "in_progress", "in_review", "done", "closed"]);
42949
42945
  var agentApiEventsQuerySchema = passthroughObject({
@@ -43013,10 +43009,6 @@ var agentApiSendBodySchema = passthroughObject({
43013
43009
  draftReplacedExisting: optionalBooleanSchema,
43014
43010
  seenUpToSeq: optionalNumberSchema
43015
43011
  });
43016
- var legacyAgentSendBodySchema = agentApiSendBodySchema.extend({
43017
- channel: external_exports.string().optional(),
43018
- dm_to: external_exports.string().optional()
43019
- });
43020
43012
  var agentApiMessageResolveParamsSchema = passthroughObject({
43021
43013
  msgId: external_exports.string().trim().min(1).transform(asMessageId)
43022
43014
  });
@@ -45172,9 +45164,6 @@ init_esm_shims();
45172
45164
  // ../shared/src/sync-core/testing.ts
45173
45165
  init_esm_shims();
45174
45166
 
45175
- // ../shared/src/docs/crossPageInvariants.ts
45176
- init_esm_shims();
45177
-
45178
45167
  // ../shared/src/testing/failpoints.ts
45179
45168
  init_esm_shims();
45180
45169
  var NoopFailpointRegistry = class {
@@ -53895,25 +53884,6 @@ function unsupportedAuthNextAction(service, handoff2) {
53895
53884
  "`oauth_session_cookie` manifests are session-cookie services and are not directly invokable through this command yet."
53896
53885
  ].join(" ");
53897
53886
  }
53898
- function approvalRequiredNextAction(input) {
53899
- const requestId = input.login.approval?.requestId ?? input.login.requestId ?? "-";
53900
- const target = input.login.approval?.target ?? input.requestedTarget?.trim() ?? null;
53901
- const actionCardMessageId = input.login.approval?.actionCardMessageId ?? null;
53902
- const loginTarget = target ?? "<current-channel-or-thread>";
53903
- const loginCommand = `raft integration login --service ${JSON.stringify(input.service.clientId)} --target ${JSON.stringify(loginTarget)}`;
53904
- if (actionCardMessageId) {
53905
- return [
53906
- `Approval request ${requestId} was posted to ${target ?? "-"} as card ${actionCardMessageId}.`,
53907
- "Ask a server owner/admin to approve the card, then rerun the same integration invoke command.",
53908
- `If the approval card must be posted again, run \`${loginCommand}\`.`
53909
- ].join(" ");
53910
- }
53911
- return [
53912
- `Approval request ${requestId} exists, but no approval card was posted.`,
53913
- `Run \`${loginCommand}\` to post the owner/admin approval card in the current conversation,`,
53914
- "then ask a server owner/admin to approve it and rerun the same integration invoke command."
53915
- ].join(" ");
53916
- }
53917
53887
  async function manifestInvalidNextAction(service, err, prepareHandoff) {
53918
53888
  const message = err instanceof Error ? err.message : String(err);
53919
53889
  if (/auth\.type must be login_with_raft/.test(message)) {
@@ -54077,13 +54047,7 @@ var integrationInvokeCommand = defineCommand(
54077
54047
  throw cliError(
54078
54048
  "INTEGRATION_APPROVAL_REQUIRED",
54079
54049
  "human approval is required before invoking this integration action",
54080
- {
54081
- suggestedNextAction: approvalRequiredNextAction({
54082
- service,
54083
- login: loginRes.data,
54084
- requestedTarget: opts.target
54085
- })
54086
- }
54050
+ { suggestedNextAction: "Ask a server owner/admin to approve the integration login request, then rerun the command." }
54087
54051
  );
54088
54052
  }
54089
54053
  const session = await ensureIntegrationServiceSession({
package/dist/core.js CHANGED
@@ -15,12 +15,9 @@ import {
15
15
  buildAgentMigrationObjectStoreBundle,
16
16
  createAgentMigrationHttpTransport,
17
17
  deleteWorkspaceDirectory,
18
- detectLegacyDaemonSupervisor,
19
- detectLegacyDaemonSupervisorWithProbe,
20
18
  detectRuntimes,
21
19
  executeAgentMigrationAdoptPlan,
22
20
  hashAgentMigrationManifest,
23
- legacyDaemonSupervisorFallbackCommands,
24
21
  parseDaemonCliArgs,
25
22
  readDaemonVersion,
26
23
  resolveAgentMigrationControlSeamEnabled,
@@ -33,7 +30,7 @@ import {
33
30
  stageAgentMigrationObjectStoreBundle,
34
31
  subscribeDaemonLogs,
35
32
  verifyAgentMigrationAdoptPlan
36
- } from "./chunk-R56QPYOR.js";
33
+ } from "./chunk-TPDIIRNC.js";
37
34
  export {
38
35
  AGENT_MIGRATION_BUNDLE_SCHEMA_VERSION,
39
36
  AGENT_MIGRATION_CONTROL_SEAM_ENV,
@@ -51,12 +48,9 @@ export {
51
48
  buildAgentMigrationObjectStoreBundle,
52
49
  createAgentMigrationHttpTransport,
53
50
  deleteWorkspaceDirectory,
54
- detectLegacyDaemonSupervisor,
55
- detectLegacyDaemonSupervisorWithProbe,
56
51
  detectRuntimes,
57
52
  executeAgentMigrationAdoptPlan,
58
53
  hashAgentMigrationManifest,
59
- legacyDaemonSupervisorFallbackCommands,
60
54
  parseDaemonCliArgs,
61
55
  readDaemonVersion,
62
56
  resolveAgentMigrationControlSeamEnabled,
@@ -28632,10 +28632,6 @@ var TRACE_B0_FIELD_DEFINITIONS = defineTraceFields([
28632
28632
  { key: "phase", fieldClass: "query_axis", placement: "span_or_event", valueKind: "closed_enum", enumBinding: "pending_457" },
28633
28633
  { key: "eligibility_subcheck", fieldClass: "query_axis", placement: "event", valueKind: "closed_enum", enumBinding: "pending_457" },
28634
28634
  { key: "hint_source", fieldClass: "family_query_axis", placement: "event", valueKind: "closed_enum", scope: "family:activity" },
28635
- { key: "candidate_activity", fieldClass: "family_query_axis", placement: "event", valueKind: "closed_enum", scope: "family:activity" },
28636
- { key: "served_activity", fieldClass: "family_query_axis", placement: "event", valueKind: "closed_enum", scope: "family:activity" },
28637
- { key: "write_action", fieldClass: "family_query_axis", placement: "event", valueKind: "closed_enum", scope: "family:activity", enumBinding: "stable", enumValues: ["none"] },
28638
- { key: "arbitration_reason", fieldClass: "family_query_axis", placement: "event", valueKind: "closed_enum", scope: "family:activity", enumBinding: "stable", enumValues: ["trusted_snapshot", "owner_mirror_read_through"] },
28639
28635
  { key: "weak_source", fieldClass: "family_query_axis", placement: "event", valueKind: "closed_enum", scope: "family:activity" },
28640
28636
  { key: "competing_fact", fieldClass: "family_query_axis", placement: "event", valueKind: "closed_enum", scope: "family:activity" },
28641
28637
  { key: "resolved_activity", fieldClass: "family_query_axis", placement: "event", valueKind: "closed_enum", scope: "family:activity" },
@@ -42497,7 +42493,7 @@ var agentStatusSchema = external_exports.enum(["active", "inactive", "stopped"])
42497
42493
  var reminderStatusSchema = external_exports.enum(["scheduled", "fired", "canceled"]);
42498
42494
  var reminderEventTypeSchema = external_exports.enum(["scheduled", "fired", "snoozed", "updated", "canceled"]);
42499
42495
  var reasoningEffortSchema = external_exports.enum(["low", "medium", "high", "xhigh", "max", "ultra"]);
42500
- var profileVisibilityMembershipStatusSchema = external_exports.enum(["active", "left", "removed"]);
42496
+ var profileVisibilityMembershipStatusSchema = external_exports.enum(["active", "removed"]);
42501
42497
  var passthroughObject = (shape) => external_exports.object(shape).passthrough();
42502
42498
  var taskStatusSchema = external_exports.enum(["todo", "in_progress", "in_review", "done", "closed"]);
42503
42499
  var agentApiEventsQuerySchema = passthroughObject({
@@ -42567,10 +42563,6 @@ var agentApiSendBodySchema = passthroughObject({
42567
42563
  draftReplacedExisting: optionalBooleanSchema,
42568
42564
  seenUpToSeq: optionalNumberSchema
42569
42565
  });
42570
- var legacyAgentSendBodySchema = agentApiSendBodySchema.extend({
42571
- channel: external_exports.string().optional(),
42572
- dm_to: external_exports.string().optional()
42573
- });
42574
42566
  var agentApiMessageResolveParamsSchema = passthroughObject({
42575
42567
  msgId: external_exports.string().trim().min(1).transform(asMessageId)
42576
42568
  });
@@ -44688,7 +44680,6 @@ init_esm_shims();
44688
44680
  init_esm_shims();
44689
44681
  init_esm_shims();
44690
44682
  init_esm_shims();
44691
- init_esm_shims();
44692
44683
  var NoopFailpointRegistry = class {
44693
44684
  get enabled() {
44694
44685
  return false;
@@ -53190,25 +53181,6 @@ function unsupportedAuthNextAction(service, handoff2) {
53190
53181
  "`oauth_session_cookie` manifests are session-cookie services and are not directly invokable through this command yet."
53191
53182
  ].join(" ");
53192
53183
  }
53193
- function approvalRequiredNextAction(input) {
53194
- const requestId = input.login.approval?.requestId ?? input.login.requestId ?? "-";
53195
- const target = input.login.approval?.target ?? input.requestedTarget?.trim() ?? null;
53196
- const actionCardMessageId = input.login.approval?.actionCardMessageId ?? null;
53197
- const loginTarget = target ?? "<current-channel-or-thread>";
53198
- const loginCommand = `raft integration login --service ${JSON.stringify(input.service.clientId)} --target ${JSON.stringify(loginTarget)}`;
53199
- if (actionCardMessageId) {
53200
- return [
53201
- `Approval request ${requestId} was posted to ${target ?? "-"} as card ${actionCardMessageId}.`,
53202
- "Ask a server owner/admin to approve the card, then rerun the same integration invoke command.",
53203
- `If the approval card must be posted again, run \`${loginCommand}\`.`
53204
- ].join(" ");
53205
- }
53206
- return [
53207
- `Approval request ${requestId} exists, but no approval card was posted.`,
53208
- `Run \`${loginCommand}\` to post the owner/admin approval card in the current conversation,`,
53209
- "then ask a server owner/admin to approve it and rerun the same integration invoke command."
53210
- ].join(" ");
53211
- }
53212
53184
  async function manifestInvalidNextAction(service, err, prepareHandoff) {
53213
53185
  const message = err instanceof Error ? err.message : String(err);
53214
53186
  if (/auth\.type must be login_with_raft/.test(message)) {
@@ -53372,13 +53344,7 @@ var integrationInvokeCommand = defineCommand(
53372
53344
  throw cliError(
53373
53345
  "INTEGRATION_APPROVAL_REQUIRED",
53374
53346
  "human approval is required before invoking this integration action",
53375
- {
53376
- suggestedNextAction: approvalRequiredNextAction({
53377
- service,
53378
- login: loginRes.data,
53379
- requestedTarget: opts.target
53380
- })
53381
- }
53347
+ { suggestedNextAction: "Ask a server owner/admin to approve the integration login request, then rerun the command." }
53382
53348
  );
53383
53349
  }
53384
53350
  const session = await ensureIntegrationServiceSession({
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  DAEMON_CLI_USAGE,
4
4
  DaemonCore,
5
5
  parseDaemonCliArgs
6
- } from "./chunk-R56QPYOR.js";
6
+ } from "./chunk-TPDIIRNC.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.72.4-play.20260710140617",
3
+ "version": "0.72.4",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "raft-daemon": "dist/raft-daemon.js",