talon-agent 3.32.1 → 3.33.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.
Files changed (115) hide show
  1. package/package.json +1 -1
  2. package/src/backend/claude-sdk/constants.ts +1 -6
  3. package/src/backend/claude-sdk/index.ts +2 -11
  4. package/src/backend/claude-sdk/models/parsing.ts +2 -2
  5. package/src/backend/claude-sdk/plan-usage.ts +0 -5
  6. package/src/backend/claude-sdk/stream.ts +1 -1
  7. package/src/backend/codex/auth.ts +2 -2
  8. package/src/backend/codex/constants.ts +0 -21
  9. package/src/backend/codex/handler/index.ts +0 -1
  10. package/src/backend/codex/mcp-config.ts +2 -2
  11. package/src/backend/codex/plan-usage.ts +0 -5
  12. package/src/backend/codex/state.ts +1 -1
  13. package/src/backend/codex/token-usage.ts +1 -1
  14. package/src/backend/kilo/index.ts +0 -6
  15. package/src/backend/kilo/server.ts +2 -22
  16. package/src/backend/kilo/sessions.ts +0 -3
  17. package/src/backend/openai-agents/handler/index.ts +0 -1
  18. package/src/backend/openai-agents/handler/state.ts +0 -5
  19. package/src/backend/openai-agents/init.ts +1 -18
  20. package/src/backend/opencode/index.ts +0 -4
  21. package/src/backend/opencode/server.ts +1 -10
  22. package/src/backend/opencode/sessions.ts +0 -3
  23. package/src/backend/remote-server/client.ts +1 -1
  24. package/src/backend/remote-server/events.ts +1 -1
  25. package/src/backend/remote-server/index.ts +4 -27
  26. package/src/backend/remote-server/mcp.ts +1 -4
  27. package/src/backend/remote-server/model-catalog/catalog.ts +1 -1
  28. package/src/backend/remote-server/model-catalog/index.ts +1 -15
  29. package/src/backend/remote-server/model-catalog/provider.ts +0 -1
  30. package/src/backend/remote-server/sse-stream.ts +1 -3
  31. package/src/backend/remote-server/turn-timeout.ts +1 -1
  32. package/src/backend/shared/index.ts +7 -43
  33. package/src/cli/logs.ts +1 -1
  34. package/src/cli/status.ts +1 -1
  35. package/src/core/agent-runtime/backend-registry.ts +1 -1
  36. package/src/core/agent-runtime/capabilities.ts +1 -1
  37. package/src/core/agent-runtime/events.ts +1 -1
  38. package/src/core/background/heartbeat/agent.ts +1 -1
  39. package/src/core/background/heartbeat/index.ts +1 -2
  40. package/src/core/background/isolated-agent.ts +1 -1
  41. package/src/core/background/triggers/exit.ts +1 -1
  42. package/src/core/background/triggers/index.ts +1 -1
  43. package/src/core/bus/events.ts +2 -2
  44. package/src/core/doctor.ts +1 -1
  45. package/src/core/engine/backend-controller/index.ts +1 -3
  46. package/src/core/engine/backend-controller/rebind.ts +2 -2
  47. package/src/core/engine/dispatcher.ts +1 -15
  48. package/src/core/engine/gateway-actions/index.ts +0 -3
  49. package/src/core/engine/gateway-actions/types.ts +1 -1
  50. package/src/core/frontend-runtime/capabilities.ts +0 -2
  51. package/src/core/frontend-runtime/index.ts +1 -6
  52. package/src/core/frontend-runtime/routing.ts +0 -1
  53. package/src/core/mcp-hub/children.ts +0 -5
  54. package/src/core/mesh/index.ts +1 -18
  55. package/src/core/models/active-model.ts +0 -19
  56. package/src/core/plugin/index.ts +0 -1
  57. package/src/core/plugin/registry.ts +1 -1
  58. package/src/core/prompt/templates.ts +0 -5
  59. package/src/core/scripting/lua-runner.ts +1 -1
  60. package/src/core/scripts/runner.ts +1 -1
  61. package/src/core/soul/critic.ts +1 -1
  62. package/src/core/soul/embedder.ts +2 -2
  63. package/src/core/soul/governance.ts +1 -1
  64. package/src/core/soul/hdc.ts +1 -1
  65. package/src/core/soul/reflex.ts +2 -2
  66. package/src/core/soul/retrieve.ts +1 -1
  67. package/src/core/soul/signals.ts +4 -4
  68. package/src/core/soul/types.ts +1 -1
  69. package/src/core/tasks/index.ts +0 -4
  70. package/src/core/tasks/types.ts +1 -1
  71. package/src/core/tools/index.ts +1 -6
  72. package/src/core/tools/mcp-env.ts +3 -33
  73. package/src/core/types.ts +1 -1
  74. package/src/core/update/self-update.ts +1 -1
  75. package/src/core/vfs/fusefs.ts +1 -1
  76. package/src/core/vfs/types.ts +1 -1
  77. package/src/core/weaver/index.ts +1 -1
  78. package/src/core/weaver/typing-loop.ts +1 -1
  79. package/src/frontend/discord/actions/types.ts +1 -1
  80. package/src/frontend/discord/commands/definitions.ts +1 -1
  81. package/src/frontend/discord/handlers/access.ts +0 -5
  82. package/src/frontend/discord/handlers/index.ts +2 -15
  83. package/src/frontend/discord/handlers/registry.ts +0 -6
  84. package/src/frontend/native/protocol.ts +1 -4
  85. package/src/frontend/native/server.ts +1 -1
  86. package/src/frontend/shared/status-context.ts +1 -1
  87. package/src/frontend/telegram/actions/types.ts +1 -1
  88. package/src/frontend/telegram/commands/index.ts +1 -1
  89. package/src/frontend/telegram/commands/state.ts +1 -1
  90. package/src/frontend/telegram/handlers/index.ts +0 -1
  91. package/src/frontend/telegram/helpers/menu.ts +1 -1
  92. package/src/frontend/terminal/commands.ts +1 -4
  93. package/src/frontend/terminal/renderer.ts +1 -1
  94. package/src/frontend/whatsapp/actions/chat-info.ts +0 -3
  95. package/src/frontend/whatsapp/actions/messaging.ts +1 -7
  96. package/src/frontend/whatsapp/actions/shared.ts +1 -1
  97. package/src/frontend/whatsapp/actions/types.ts +1 -1
  98. package/src/frontend/whatsapp/formatting.ts +1 -1
  99. package/src/frontend/whatsapp/media-store.ts +1 -1
  100. package/src/frontend/whatsapp/pins.ts +0 -5
  101. package/src/native/fusefs.ts +3 -3
  102. package/src/native/scheduler-core.ts +1 -1
  103. package/src/native/warden.ts +2 -2
  104. package/src/plugins/mempalace/provision.ts +1 -5
  105. package/src/plugins/playwright/provision.ts +1 -1
  106. package/src/storage/db.ts +1 -1
  107. package/src/storage/goal-store.ts +1 -5
  108. package/src/storage/metrics.ts +0 -5
  109. package/src/storage/repositories/scripts-repo.ts +0 -5
  110. package/src/storage/scheduled-store.ts +1 -5
  111. package/src/storage/script-store.ts +5 -13
  112. package/src/storage/sessions.ts +0 -3
  113. package/src/storage/skill-store.ts +3 -3
  114. package/src/util/exec-output.ts +1 -1
  115. package/src/util/mcp-launcher.ts +3 -0
package/src/cli/status.ts CHANGED
@@ -9,7 +9,7 @@ import { findRunningInstance } from "../core/daemon/discovery.js";
9
9
  import { printBanner, loadConfig } from "./config.js";
10
10
  import { CONFIG_FILE } from "./context.js";
11
11
 
12
- export function formatUptime(seconds: number): string {
12
+ function formatUptime(seconds: number): string {
13
13
  if (seconds < 60) return `${seconds}s`;
14
14
  if (seconds < 3600) return `${Math.floor(seconds / 60)}m ${seconds % 60}s`;
15
15
  return `${Math.floor(seconds / 3600)}h ${Math.floor((seconds % 3600) / 60)}m`;
@@ -58,7 +58,7 @@ export interface BackendInitContext {
58
58
  }
59
59
 
60
60
  /** Result returned by a backend factory's `init` step. */
61
- export interface BackendInstance {
61
+ interface BackendInstance {
62
62
  /** The fully-wired `Backend` the dispatcher will route to. */
63
63
  backend: Backend;
64
64
  /**
@@ -188,7 +188,7 @@ export interface SessionBackend {
188
188
  * the live registry. Returns the diff so the dispatcher can log
189
189
  * what changed.
190
190
  */
191
- export interface ToolRefreshResult {
191
+ interface ToolRefreshResult {
192
192
  added: string[];
193
193
  removed: string[];
194
194
  errors: Record<string, string>;
@@ -81,7 +81,7 @@ export interface AgentResult {
81
81
  * `core/errors.ts` already produces — keep the values stable so
82
82
  * downstream code can pattern-match deterministically.
83
83
  */
84
- export type AgentErrorKind =
84
+ type AgentErrorKind =
85
85
  | "context_overflow"
86
86
  | "rate_limit"
87
87
  | "overload"
@@ -83,7 +83,7 @@ export function buildHeartbeatSystemPrompt(): string {
83
83
  * the heartbeat is a global agent, so it sees every chat's open goals (with
84
84
  * chat ids for routing updates back). Exported for tests.
85
85
  */
86
- export function renderGoalsBlock(): { text: string; count: number } {
86
+ function renderGoalsBlock(): { text: string; count: number } {
87
87
  let text = "(no open goals)";
88
88
  let count = 0;
89
89
  try {
@@ -13,7 +13,6 @@
13
13
  * Re-exports the same public surface the old single-file module exposed.
14
14
  */
15
15
 
16
- export type { HeartbeatState } from "./state.js";
17
16
  export {
18
17
  initHeartbeat,
19
18
  startHeartbeatTimer,
@@ -22,4 +21,4 @@ export {
22
21
  forceHeartbeat,
23
22
  getHeartbeatStatus,
24
23
  } from "./scheduler.js";
25
- export { buildHeartbeatSystemPrompt, renderGoalsBlock } from "./agent.js";
24
+ export { buildHeartbeatSystemPrompt } from "./agent.js";
@@ -19,7 +19,7 @@ import type { OneShotAgentParams, OneShotUsage } from "../types.js";
19
19
  import { logWarn, logError } from "../../util/log.js";
20
20
 
21
21
  /** Default bounded grace after an abort before giving up on the backend. */
22
- export const DEFAULT_ABORT_GRACE_MS = 30 * 1000;
22
+ const DEFAULT_ABORT_GRACE_MS = 30 * 1000;
23
23
 
24
24
  export interface IsolatedRunOptions {
25
25
  readonly background: BackgroundRunner;
@@ -79,7 +79,7 @@ export async function shutdownTriggers(): Promise<void> {
79
79
  await new Promise((r) => setTimeout(r, 250));
80
80
  }
81
81
 
82
- export function killChild(id: string, child: ChildProcess): void {
82
+ function killChild(id: string, child: ChildProcess): void {
83
83
  try {
84
84
  child.kill("SIGTERM");
85
85
  } catch {
@@ -19,7 +19,7 @@ import { commandForLanguage } from "./command.js";
19
19
  import { handleStdoutLine } from "./output.js";
20
20
  import { handleTimeout, finalizeExit } from "./exit.js";
21
21
 
22
- export { initTriggers, getRunningCount, type TriggerDeps } from "./state.js";
22
+ export { initTriggers, getRunningCount } from "./state.js";
23
23
  export { commandForLanguage } from "./command.js";
24
24
  export { spawnTrigger } from "./spawn.js";
25
25
  export { cancelTrigger, shutdownTriggers } from "./exit.js";
@@ -32,7 +32,7 @@ export interface TaskSettledEvent {
32
32
  }
33
33
 
34
34
  /** A chat turn bound its warp and is about to run on the backend. */
35
- export interface TurnStartedEvent {
35
+ interface TurnStartedEvent {
36
36
  readonly type: "turn.started";
37
37
  readonly chatId: string;
38
38
  readonly source: string;
@@ -41,7 +41,7 @@ export interface TurnStartedEvent {
41
41
  }
42
42
 
43
43
  /** A chat turn finished successfully (refusals and failures never emit this). */
44
- export interface TurnCompletedEvent {
44
+ interface TurnCompletedEvent {
45
45
  readonly type: "turn.completed";
46
46
  readonly chatId: string;
47
47
  readonly source: string;
@@ -17,7 +17,7 @@ import { execFileSync } from "node:child_process";
17
17
  import { NATIVE_MODULES } from "../native/registry.js";
18
18
  import { dirs } from "../util/paths.js";
19
19
 
20
- export type DoctorStatus = "ok" | "warn" | "fail" | "info";
20
+ type DoctorStatus = "ok" | "warn" | "fail" | "info";
21
21
 
22
22
  export interface DoctorCheck {
23
23
  label: string;
@@ -28,7 +28,7 @@
28
28
  */
29
29
 
30
30
  export * from "./types.js";
31
- export { roleHolder, chatHolder } from "./holders.js";
31
+ export { roleHolder } from "./holders.js";
32
32
  export {
33
33
  initBackendPool,
34
34
  hasBackendPool,
@@ -48,8 +48,6 @@ export {
48
48
  clearBackendChangeListenersForTest,
49
49
  } from "./pool.js";
50
50
  export {
51
- rebindHolder,
52
- releaseHolder,
53
51
  rebindRole,
54
52
  rebindChat,
55
53
  releaseChat,
@@ -36,7 +36,7 @@ import type { BackendHolder, BackendRole, RebindResult } from "./types.js";
36
36
  *
37
37
  * Use `rebindRole` / `rebindChat` for typed wrappers.
38
38
  */
39
- export async function rebindHolder(
39
+ async function rebindHolder(
40
40
  holder: BackendHolder,
41
41
  newId: string,
42
42
  config: TalonConfig,
@@ -113,7 +113,7 @@ export async function rebindHolder(
113
113
  * No-op when the holder isn't bound — useful for "clear my override"
114
114
  * flows that don't want to care whether the override was ever set.
115
115
  */
116
- export async function releaseHolder(holder: BackendHolder): Promise<void> {
116
+ async function releaseHolder(holder: BackendHolder): Promise<void> {
117
117
  const id = bindings.get(holder);
118
118
  if (!id) return;
119
119
  bindings.delete(holder);
@@ -11,12 +11,7 @@
11
11
  import type { ExecuteParams, ExecuteResult } from "../types.js";
12
12
  import { log } from "../../util/log.js";
13
13
  import { taskTable, type KillOutcome } from "../tasks/index.js";
14
- import {
15
- initWeaver,
16
- type Weaver,
17
- type WeaverDeps,
18
- type ThreadSnapshot,
19
- } from "../weaver/index.js";
14
+ import { initWeaver, type Weaver, type WeaverDeps } from "../weaver/index.js";
20
15
 
21
16
  // ── Dependencies (injected at startup) ──────────────────────────────────────
22
17
 
@@ -49,15 +44,6 @@ export function getActiveCount(): number {
49
44
  return weaver?.getActiveCount() ?? 0;
50
45
  }
51
46
 
52
- /**
53
- * A live view of every Thread the Loom holds — model/backend warp, in-flight
54
- * count, and context state per chat. The hub's observability surface for
55
- * `/status`, drift detection, and remote frontends. Empty before init.
56
- */
57
- export function snapshot(): ThreadSnapshot[] {
58
- return weaver?.snapshot() ?? [];
59
- }
60
-
61
47
  /**
62
48
  * Stop only this chat's active turn. A later message already waiting in the
63
49
  * per-chat FIFO is intentionally left alone and runs after the stop settles.
@@ -100,6 +100,3 @@ export async function handleChatFreeAction(
100
100
  if (!handler) return null;
101
101
  return handler(body, 0);
102
102
  }
103
-
104
- export { chatFreeActions };
105
- export type { SharedActionHandler, SharedActionHandlers } from "./types.js";
@@ -9,7 +9,7 @@
9
9
  import type { ActionResult } from "../../types.js";
10
10
  import type { Backend } from "../../agent-runtime/capabilities.js";
11
11
 
12
- export type SharedActionHandler = (
12
+ type SharedActionHandler = (
13
13
  body: Record<string, unknown>,
14
14
  chatId: number,
15
15
  backend?: Backend | null,
@@ -58,5 +58,3 @@ export type FrontendCreate = (
58
58
 
59
59
  /** A fully-registered frontend: identity plus the factory. */
60
60
  export type FrontendFactory = FrontendDescriptor & { create: FrontendCreate };
61
-
62
- export type { FrontendDescriptor } from "./registry.js";
@@ -9,12 +9,7 @@
9
9
 
10
10
  import "./builtins.js";
11
11
 
12
- export type {
13
- Frontend,
14
- FrontendCreate,
15
- FrontendDescriptor,
16
- FrontendFactory,
17
- } from "./capabilities.js";
12
+ export type { Frontend } from "./capabilities.js";
18
13
  export {
19
14
  getFrontendDescriptor,
20
15
  hasFrontend,
@@ -12,5 +12,4 @@ export {
12
12
  getFrontendDescriptor,
13
13
  resolveFrontendIdAmong,
14
14
  resolveOwnerFrontendId,
15
- type FrontendDescriptor,
16
15
  } from "./registry.js";
@@ -82,11 +82,6 @@ function failureBackoffMs(count: number): number {
82
82
  );
83
83
  }
84
84
 
85
- /** Test seam: forget recorded spawn failures. */
86
- export function resetSpawnFailures(): void {
87
- spawnFailures.clear();
88
- }
89
-
90
85
  /** Idle TTL for hub children; tunable for tests / tight deployments. */
91
86
  function idleTtlMs(): number {
92
87
  const raw = Number(process.env.TALON_MCP_HUB_IDLE_MS);
@@ -7,21 +7,4 @@
7
7
  */
8
8
 
9
9
  export { MeshRegistry } from "./registry.js";
10
- export {
11
- MeshService,
12
- getMeshService,
13
- setMeshService,
14
- type MeshTransport,
15
- type MeshServiceOptions,
16
- type MeshToolResult,
17
- } from "./service.js";
18
- export {
19
- sanitizeCapabilities,
20
- toDeviceInfo,
21
- toDeviceLocation,
22
- type DeviceCommand,
23
- type DeviceCommandResult,
24
- type DeviceInfo,
25
- type DeviceLocation,
26
- type DevicePlatform,
27
- } from "./types.js";
10
+ export { MeshService, getMeshService, setMeshService } from "./service.js";
@@ -307,25 +307,6 @@ export async function getActiveModelForChat(
307
307
  return model;
308
308
  }
309
309
 
310
- /**
311
- * Convenience: same as `resolveActiveModelForChat` but returns just
312
- * the `ModelRef` (or `null`). Use when the source tag isn't needed.
313
- */
314
- export async function getActiveModelRefForChat(
315
- chatId: string,
316
- backend: Backend | null,
317
- backendId: string | null,
318
- config: TalonConfig,
319
- ): Promise<ModelRef | null> {
320
- const { ref } = await resolveActiveModelForChat(
321
- chatId,
322
- backend,
323
- backendId,
324
- config,
325
- );
326
- return ref;
327
- }
328
-
329
310
  // ── ref enrichment ──────────────────────────────────────────────────────────
330
311
 
331
312
  /**
@@ -20,7 +20,6 @@ export {
20
20
  getPlugin,
21
21
  getPluginCount,
22
22
  destroyPlugins,
23
- registerPlugin,
24
23
  getPluginPromptAdditions,
25
24
  } from "./loader.js";
26
25
  export { loadBuiltinPlugins, reloadPlugins } from "./builtins.js";
@@ -11,7 +11,7 @@ import { pathToFileURL } from "node:url";
11
11
  import { logError, logWarn } from "../../util/log.js";
12
12
  import type { LoadedPlugin, PluginMcpEntry } from "./types.js";
13
13
 
14
- export class PluginRegistry {
14
+ class PluginRegistry {
15
15
  private readonly plugins: LoadedPlugin[] = [];
16
16
  private readonly standaloneMcpServers: PluginMcpEntry[] = [];
17
17
 
@@ -117,8 +117,3 @@ export function loadSystemTemplate(
117
117
  }
118
118
  return liquid.renderSync(parsed, vars) as string;
119
119
  }
120
-
121
- /** Test seam: drop the parse cache (e.g. after writing fixture templates). */
122
- export function clearTemplateCache(): void {
123
- parseCache.clear();
124
- }
@@ -70,7 +70,7 @@ const FIRE_PREFIX = "TALON_FIRE:";
70
70
  * Throws on Lua errors (message shaped `<file>:<line>: <msg>` plus
71
71
  * traceback). Restores process.stdout.write before returning.
72
72
  */
73
- export async function runLuaScript(scriptPath: string): Promise<void> {
73
+ async function runLuaScript(scriptPath: string): Promise<void> {
74
74
  const source = readFileSync(scriptPath, "utf-8");
75
75
 
76
76
  const originalWrite = process.stdout.write;
@@ -19,7 +19,7 @@ import { commandForLanguage } from "../background/triggers/index.js";
19
19
  import type { Script } from "../../storage/script-store.js";
20
20
 
21
21
  export const DEFAULT_SCRIPT_TIMEOUT_SECONDS = 60;
22
- export const MAX_SCRIPT_TIMEOUT_SECONDS = 300;
22
+ const MAX_SCRIPT_TIMEOUT_SECONDS = 300;
23
23
 
24
24
  /** Cap on captured stdout/stderr — keeps tool results context-friendly. */
25
25
  const OUTPUT_CAP_CHARS = 16_000;
@@ -17,7 +17,7 @@
17
17
 
18
18
  import { estimateTokens } from "./projector.js";
19
19
 
20
- export type FailureMode = "wall-of-text" | "sycophancy" | "emoji-overload";
20
+ type FailureMode = "wall-of-text" | "sycophancy" | "emoji-overload";
21
21
 
22
22
  export interface CritiqueFeatures {
23
23
  readonly tokens: number;
@@ -23,13 +23,13 @@ export interface Embedder {
23
23
 
24
24
  // ── Vector math ──────────────────────────────────────────────────────────────
25
25
 
26
- export function dot(a: readonly number[], b: readonly number[]): number {
26
+ function dot(a: readonly number[], b: readonly number[]): number {
27
27
  let s = 0;
28
28
  for (let i = 0; i < a.length; i++) s += a[i]! * b[i]!;
29
29
  return s;
30
30
  }
31
31
 
32
- export function norm(a: readonly number[]): number {
32
+ function norm(a: readonly number[]): number {
33
33
  return Math.sqrt(dot(a, a));
34
34
  }
35
35
 
@@ -18,7 +18,7 @@ import { randomUUID } from "node:crypto";
18
18
  import { hashPayload } from "./hash.js";
19
19
  import type { NodePayload } from "./types.js";
20
20
 
21
- export type ProposalStatus = "pending" | "approved" | "rejected";
21
+ type ProposalStatus = "pending" | "approved" | "rejected";
22
22
 
23
23
  export interface Proposal {
24
24
  readonly id: string;
@@ -25,7 +25,7 @@ import { createHash } from "node:crypto";
25
25
 
26
26
  export type Hypervector = Int8Array;
27
27
 
28
- export const DEFAULT_HD_DIM = 4096;
28
+ const DEFAULT_HD_DIM = 4096;
29
29
 
30
30
  /** Deterministic ±1 hypervector for a symbol — the same token always maps here. */
31
31
  export function symbolVector(token: string, dim = DEFAULT_HD_DIM): Hypervector {
@@ -48,7 +48,7 @@ const DELIVERY_ACTIONS = new Set(["end_turn", "send", "react"]);
48
48
  * Keep them small and total; compound conditions get their own named predicate
49
49
  * rather than being expressed in the data.
50
50
  */
51
- export const BUILTIN_PREDICATES: Readonly<Record<string, ReflexPredicate>> = {
51
+ const BUILTIN_PREDICATES: Readonly<Record<string, ReflexPredicate>> = {
52
52
  /** Always-on trigger. */
53
53
  always: () => true,
54
54
 
@@ -85,7 +85,7 @@ function resolve(
85
85
  }
86
86
 
87
87
  /** Evaluate one reflex against a context. */
88
- export function evaluateReflex(
88
+ function evaluateReflex(
89
89
  reflex: ReflexPayload,
90
90
  ctx: ReflexContext,
91
91
  overrides?: Readonly<Record<string, ReflexPredicate>>,
@@ -32,7 +32,7 @@ export interface RetrievalWeights {
32
32
  readonly relevance: number;
33
33
  }
34
34
 
35
- export const DEFAULT_RETRIEVAL_WEIGHTS: RetrievalWeights = {
35
+ const DEFAULT_RETRIEVAL_WEIGHTS: RetrievalWeights = {
36
36
  recency: 1,
37
37
  importance: 1,
38
38
  relevance: 1,
@@ -14,7 +14,7 @@
14
14
 
15
15
  import type { Hash } from "./types.js";
16
16
 
17
- export interface ReactionSignal {
17
+ interface ReactionSignal {
18
18
  readonly kind: "reaction";
19
19
  readonly at: number;
20
20
  readonly emoji: string;
@@ -22,7 +22,7 @@ export interface ReactionSignal {
22
22
  readonly activeNodes: readonly Hash[];
23
23
  }
24
24
 
25
- export interface EngagementSignal {
25
+ interface EngagementSignal {
26
26
  readonly kind: "engagement";
27
27
  readonly at: number;
28
28
  /** Did the conversation continue after Talon's message, or die? */
@@ -56,14 +56,14 @@ export interface DirectiveSignal {
56
56
  readonly ref?: string;
57
57
  }
58
58
 
59
- export interface ReflexFireSignal {
59
+ interface ReflexFireSignal {
60
60
  readonly kind: "reflex-fire";
61
61
  readonly at: number;
62
62
  readonly name: string;
63
63
  readonly severity: "block" | "warn" | "advise";
64
64
  }
65
65
 
66
- export interface ActivationSignal {
66
+ interface ActivationSignal {
67
67
  readonly kind: "activation";
68
68
  readonly at: number;
69
69
  readonly activeNodes: readonly Hash[];
@@ -45,7 +45,7 @@ export type NodeKind =
45
45
  * Where a piece of ground truth came from. Provenance is content, not metadata:
46
46
  * an evidence node's identity includes *who said it, when, and where*.
47
47
  */
48
- export interface EvidenceSource {
48
+ interface EvidenceSource {
49
49
  /** Origin channel: a chat correction, a logged event, a diary line, etc. */
50
50
  readonly origin:
51
51
  | "correction" // someone (usually Dylan) corrected behavior
@@ -10,11 +10,7 @@
10
10
  export { TaskTable, taskTable } from "./table.js";
11
11
  export type {
12
12
  KillOutcome,
13
- TaskBinding,
14
13
  TaskHandle,
15
- TaskKind,
16
14
  TaskRecord,
17
- TaskSpec,
18
15
  TaskState,
19
- TaskUsage,
20
16
  } from "./types.js";
@@ -13,7 +13,7 @@
13
13
  */
14
14
 
15
15
  /** Which unit of agent work a task represents. */
16
- export type TaskKind = "turn" | "heartbeat" | "dream" | "cron" | "trigger";
16
+ type TaskKind = "turn" | "heartbeat" | "dream" | "cron" | "trigger";
17
17
 
18
18
  /** Task lifecycle. `done`, `failed`, and `killed` are terminal. */
19
19
  export type TaskState = "queued" | "running" | "done" | "failed" | "killed";
@@ -241,9 +241,4 @@ export function composeTools(options: ComposeOptions = {}): ToolDefinition[] {
241
241
  }
242
242
 
243
243
  // Re-export types for convenience
244
- export type {
245
- ToolDefinition,
246
- ToolFrontend,
247
- ToolTag,
248
- BridgeFunction,
249
- } from "./types.js";
244
+ export type { ToolDefinition } from "./types.js";
@@ -16,15 +16,11 @@
16
16
  * talon.json — carried to the subprocess as comma-separated env vars.
17
17
  */
18
18
 
19
- import { dirname, resolve } from "node:path";
20
- import { fileURLToPath, pathToFileURL } from "node:url";
21
- import { isBunRuntime } from "../../util/runtime.js";
22
-
23
19
  // ── Env-var names (shared constants, not stringly-typed call sites) ────────
24
20
 
25
- export const ENV_BRIDGE_URL = "TALON_BRIDGE_URL";
26
- export const ENV_CHAT_ID = "TALON_CHAT_ID";
27
- export const ENV_FRONTEND = "TALON_FRONTEND";
21
+ const ENV_BRIDGE_URL = "TALON_BRIDGE_URL";
22
+ const ENV_CHAT_ID = "TALON_CHAT_ID";
23
+ const ENV_FRONTEND = "TALON_FRONTEND";
28
24
  export const ENV_DISABLED_TOOLS = "TALON_DISABLED_TOOLS";
29
25
  export const ENV_DISABLED_TOOL_TAGS = "TALON_DISABLED_TOOL_TAGS";
30
26
 
@@ -62,32 +58,6 @@ export function buildTalonMcpEnv(
62
58
 
63
59
  // ── Spawn spec ──────────────────────────────────────────────────────────────
64
60
 
65
- /**
66
- * The command line that launches Talon's unified MCP tool server.
67
- *
68
- * tsx as a Node loader is passed via `--import <file-url>`: Node
69
- * accepts URLs or absolute paths, but on Windows a raw backslash path
70
- * is ambiguous between path and URL — `pathToFileURL` always parses
71
- * as a loader URL. `node --import` (vs spawning `npx`/`tsx` directly)
72
- * also sidesteps the Node 20.19+ refusal to spawn `.cmd` shims
73
- * without `shell: true` (CVE-2024-27980 mitigation).
74
- *
75
- * Returns a fresh array: callers wrap it in their own supervisor
76
- * (`wrapMcpServer` / `wrapMcpCommand`) and may mutate it.
77
- */
78
- export function talonMcpServerCommand(): string[] {
79
- const here = dirname(fileURLToPath(import.meta.url));
80
- // Bun executes the TS entry natively — no loader, and use the running
81
- // bun binary itself so the child matches the daemon's runtime.
82
- if (isBunRuntime()) {
83
- return [process.execPath, resolve(here, "mcp-server.ts")];
84
- }
85
- const tsxImport = pathToFileURL(
86
- resolve(here, "../../../node_modules/tsx/dist/esm/index.mjs"),
87
- ).href;
88
- return ["node", "--import", tsxImport, resolve(here, "mcp-server.ts")];
89
- }
90
-
91
61
  // ── Parser (server side) ────────────────────────────────────────────────────
92
62
 
93
63
  /** Parse a comma-separated env var into a trimmed, de-blanked list. */
package/src/core/types.ts CHANGED
@@ -202,7 +202,7 @@ export interface ContextManager {
202
202
  * oversized-message), and a successful one by returning. This keeps
203
203
  * the ack settled even when no `onEvent` is supplied at all.
204
204
  */
205
- export type StreamEventSink = {
205
+ type StreamEventSink = {
206
206
  onEvent?: (
207
207
  event: import("./agent-runtime/events.js").AgentEvent,
208
208
  ) => void | Promise<void>;
@@ -41,7 +41,7 @@ export interface UpdateOptions {
41
41
  }
42
42
 
43
43
  /** One executed step in an update run. */
44
- export interface UpdateStep {
44
+ interface UpdateStep {
45
45
  label: string;
46
46
  ok: boolean;
47
47
  output: string;
@@ -91,7 +91,7 @@ export function namespaceFsStatus(): FuseStatus {
91
91
  }
92
92
 
93
93
  /** Test seam — force a status without a real mount. */
94
- export function _setNamespaceFsStatusForTesting(next: FuseStatus): void {
94
+ function _setNamespaceFsStatusForTesting(next: FuseStatus): void {
95
95
  status = next;
96
96
  }
97
97
 
@@ -22,7 +22,7 @@
22
22
  */
23
23
 
24
24
  /** What a path points at. */
25
- export type VfsNodeKind = "dir" | "file";
25
+ type VfsNodeKind = "dir" | "file";
26
26
 
27
27
  /** Errno-style failure vocabulary — every operation fails with one of these. */
28
28
  export type VfsErrorCode =
@@ -1,4 +1,4 @@
1
- export { Thread, type ThreadSnapshot } from "./thread.js";
1
+ export { Thread } from "./thread.js";
2
2
 
3
3
  export { Loom, type ContextRegistry } from "./loom.js";
4
4
  export { carryTurnEvents } from "./shuttle.js";
@@ -8,7 +8,7 @@
8
8
  import { logWarn } from "../../util/log.js";
9
9
 
10
10
  /** Platforms expire typing indicators after ~5s; refresh under that. */
11
- export const TYPING_REFRESH_MS = 4000;
11
+ const TYPING_REFRESH_MS = 4000;
12
12
 
13
13
  export type SendTyping = (
14
14
  numericChatId: number,
@@ -24,7 +24,7 @@ export interface DiscordActionContext {
24
24
  channel: TextBasedChannel | null;
25
25
  }
26
26
 
27
- export type DiscordActionHandler = (
27
+ type DiscordActionHandler = (
28
28
  body: Record<string, unknown>,
29
29
  chatId: number,
30
30
  ctx: DiscordActionContext,
@@ -17,7 +17,7 @@ import type { TalonConfig } from "../../../util/config.js";
17
17
  import { log, logError, logWarn } from "../../../util/log.js";
18
18
  import { getRepoRoot } from "../../../core/update/self-update.js";
19
19
 
20
- export function buildCommandDefinitions(devBuild = false): unknown[] {
20
+ function buildCommandDefinitions(devBuild = false): unknown[] {
21
21
  return [
22
22
  new SlashCommandBuilder()
23
23
  .setName("start")