@yeaft/webchat-agent 0.1.854 → 0.1.856

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 (174) hide show
  1. package/bin/yeaft-stats.js +3 -3
  2. package/connection/message-router.js +73 -44
  3. package/context.js +4 -4
  4. package/expert-roles.js +1 -1
  5. package/index.js +1 -1
  6. package/package.json +4 -4
  7. package/service/index.js +1 -1
  8. package/{unify → yeaft}/attachments.js +7 -7
  9. package/{unify → yeaft}/cli.js +4 -4
  10. package/{unify → yeaft}/compact/compactor.js +10 -10
  11. package/{unify → yeaft}/config-api.js +12 -12
  12. package/{unify → yeaft}/config.js +19 -19
  13. package/{unify → yeaft}/conversation/migrate-messages-threadid.js +1 -1
  14. package/{unify → yeaft}/conversation/persist.js +194 -65
  15. package/{unify → yeaft}/conversation/search.js +28 -23
  16. package/{unify → yeaft}/debug-trace.js +1 -1
  17. package/{unify → yeaft}/dream-v2/limits.js +3 -3
  18. package/{unify → yeaft}/dream-v2/runner.js +1 -1
  19. package/{unify → yeaft}/dream-v2/session-wiring.js +2 -2
  20. package/{unify → yeaft}/effort.js +2 -2
  21. package/{unify → yeaft}/engine.js +8 -8
  22. package/{unify → yeaft}/eval/run-eval.js +11 -11
  23. package/{unify → yeaft}/eval/runner.js +1 -1
  24. package/{unify → yeaft}/groups/feature-flag.js +2 -2
  25. package/{unify → yeaft}/groups/index.js +2 -2
  26. package/{unify → yeaft}/groups/pre-flow.js +1 -1
  27. package/{unify → yeaft}/groups/project-doc.js +1 -1
  28. package/{unify → yeaft}/history-compact.js +3 -3
  29. package/{unify → yeaft}/index.js +1 -1
  30. package/{unify → yeaft}/init.js +15 -9
  31. package/{unify → yeaft}/llm/adapter.js +1 -1
  32. package/{unify → yeaft}/llm/anthropic.js +2 -2
  33. package/{unify → yeaft}/llm/models-dev.js +10 -3
  34. package/{unify → yeaft}/llm/openai-responses.js +2 -2
  35. package/{unify → yeaft}/llm/router.js +1 -1
  36. package/{unify → yeaft}/mcp.js +1 -1
  37. package/{unify → yeaft}/memory/ams-registry.js +1 -1
  38. package/{unify → yeaft}/memory/seed-backfill.js +1 -1
  39. package/{unify → yeaft}/memory/store-v2.js +1 -1
  40. package/{unify → yeaft}/models.js +3 -3
  41. package/{unify → yeaft}/pair-sanitize.js +2 -2
  42. package/{unify → yeaft}/personas.js +1 -1
  43. package/{unify → yeaft}/prompts.js +1 -1
  44. package/{unify → yeaft}/routing/index.js +1 -1
  45. package/{unify → yeaft}/routing/router.js +1 -1
  46. package/{unify → yeaft}/session.js +8 -8
  47. package/{unify → yeaft}/skills.js +2 -2
  48. package/{unify → yeaft}/stats/format.js +1 -1
  49. package/{unify → yeaft}/stop-hooks.js +1 -1
  50. package/{unify → yeaft}/sub-agent/runner.js +1 -1
  51. package/{unify → yeaft}/tools/ask-user.js +2 -2
  52. package/{unify → yeaft}/tools/enter-worktree.js +1 -1
  53. package/{unify → yeaft}/tools/exit-worktree.js +1 -1
  54. package/{unify → yeaft}/tools/mcp-tools.js +1 -1
  55. package/{unify → yeaft}/tools/registry.js +2 -2
  56. package/{unify → yeaft}/tools/skill.js +1 -1
  57. package/{unify → yeaft}/tools/start-plan.js +1 -1
  58. package/{unify → yeaft}/tools/types.js +3 -3
  59. package/{unify → yeaft}/tools/web-search.js +1 -1
  60. package/{unify → yeaft}/turn-utils.js +1 -1
  61. package/{unify → yeaft}/vp/index.js +1 -1
  62. package/{unify → yeaft}/vp/registry.js +1 -1
  63. package/{unify → yeaft}/vp/vp-bridge.js +8 -8
  64. package/{unify → yeaft}/web-bridge.js +230 -230
  65. /package/{unify → yeaft}/archive/tool-results.js +0 -0
  66. /package/{unify → yeaft}/archive/trace.js +0 -0
  67. /package/{unify → yeaft}/archive/turn-archive.js +0 -0
  68. /package/{unify → yeaft}/compact/decisions-log.js +0 -0
  69. /package/{unify → yeaft}/compact/orchestrator.js +0 -0
  70. /package/{unify → yeaft}/compact/triggers.js +0 -0
  71. /package/{unify → yeaft}/compact/turn-group.js +0 -0
  72. /package/{unify → yeaft}/dream-v2/apply.js +0 -0
  73. /package/{unify → yeaft}/dream-v2/merge.js +0 -0
  74. /package/{unify → yeaft}/dream-v2/prompts/create.md +0 -0
  75. /package/{unify → yeaft}/dream-v2/prompts/extract-group.md +0 -0
  76. /package/{unify → yeaft}/dream-v2/prompts/extract-topic.md +0 -0
  77. /package/{unify → yeaft}/dream-v2/prompts/extract-user.md +0 -0
  78. /package/{unify → yeaft}/dream-v2/prompts/extract-vp.md +0 -0
  79. /package/{unify → yeaft}/dream-v2/prompts/index.js +0 -0
  80. /package/{unify → yeaft}/dream-v2/prompts/summarize-scope.md +0 -0
  81. /package/{unify → yeaft}/dream-v2/prompts/triage-pass1.md +0 -0
  82. /package/{unify → yeaft}/dream-v2/prompts/triage-pass2.md +0 -0
  83. /package/{unify → yeaft}/dream-v2/prompts/update.md +0 -0
  84. /package/{unify → yeaft}/dream-v2/schedule.js +0 -0
  85. /package/{unify → yeaft}/dream-v2/segment.js +0 -0
  86. /package/{unify → yeaft}/dream-v2/snapshot.js +0 -0
  87. /package/{unify → yeaft}/dream-v2/state.js +0 -0
  88. /package/{unify → yeaft}/dream-v2/triage.js +0 -0
  89. /package/{unify → yeaft}/eval/cases/e2e.js +0 -0
  90. /package/{unify → yeaft}/eval/cases/memory.js +0 -0
  91. /package/{unify → yeaft}/eval/cases/skills.js +0 -0
  92. /package/{unify → yeaft}/eval/cases/tool-use.js +0 -0
  93. /package/{unify → yeaft}/groups/coordinator.js +0 -0
  94. /package/{unify → yeaft}/groups/group-config.js +0 -0
  95. /package/{unify → yeaft}/groups/group-crud.js +0 -0
  96. /package/{unify → yeaft}/groups/group-store.js +0 -0
  97. /package/{unify → yeaft}/groups/ids.js +0 -0
  98. /package/{unify → yeaft}/groups/roster.js +0 -0
  99. /package/{unify → yeaft}/groups/seed-default.js +0 -0
  100. /package/{unify → yeaft}/llm/credentials/github-copilot.js +0 -0
  101. /package/{unify → yeaft}/llm/credentials/index.js +0 -0
  102. /package/{unify → yeaft}/memory/adjust.js +0 -0
  103. /package/{unify → yeaft}/memory/ams.js +0 -0
  104. /package/{unify → yeaft}/memory/budget.js +0 -0
  105. /package/{unify → yeaft}/memory/consolidate.js +0 -0
  106. /package/{unify → yeaft}/memory/index-db.js +0 -0
  107. /package/{unify → yeaft}/memory/keywords.js +0 -0
  108. /package/{unify → yeaft}/memory/preflow.js +0 -0
  109. /package/{unify → yeaft}/memory/segment-store.js +0 -0
  110. /package/{unify → yeaft}/memory/segment-sync.js +0 -0
  111. /package/{unify → yeaft}/memory/segment.js +0 -0
  112. /package/{unify → yeaft}/memory/summary-store.js +0 -0
  113. /package/{unify → yeaft}/router/continuity.js +0 -0
  114. /package/{unify → yeaft}/router/thinking.js +0 -0
  115. /package/{unify → yeaft}/routing/loop-guard.js +0 -0
  116. /package/{unify → yeaft}/stats/tool-usage.js +0 -0
  117. /package/{unify → yeaft}/storage/atomic.js +0 -0
  118. /package/{unify → yeaft}/storage/compact.js +0 -0
  119. /package/{unify → yeaft}/storage/index.js +0 -0
  120. /package/{unify → yeaft}/storage/jsonl-index.js +0 -0
  121. /package/{unify → yeaft}/storage/jsonl-log.js +0 -0
  122. /package/{unify → yeaft}/storage/shard-index.js +0 -0
  123. /package/{unify → yeaft}/storage/shard-store.js +0 -0
  124. /package/{unify → yeaft}/sub-agent/spawned-prompt.js +0 -0
  125. /package/{unify → yeaft}/templates/base.md +0 -0
  126. /package/{unify → yeaft}/templates/common-rules.md +0 -0
  127. /package/{unify → yeaft}/templates/harness/router-handoff.md +0 -0
  128. /package/{unify → yeaft}/templates/harness/router-shape.md +0 -0
  129. /package/{unify → yeaft}/templates/harness/worker-shape.md +0 -0
  130. /package/{unify → yeaft}/templates/identity-yeaft.md +0 -0
  131. /package/{unify → yeaft}/templates/mode-dream.md +0 -0
  132. /package/{unify → yeaft}/templates/mode-unified.md +0 -0
  133. /package/{unify → yeaft}/templates/personas/explorer.md +0 -0
  134. /package/{unify → yeaft}/templates/personas/implementer.md +0 -0
  135. /package/{unify → yeaft}/templates/personas/researcher.md +0 -0
  136. /package/{unify → yeaft}/templates/personas/reviewer.md +0 -0
  137. /package/{unify → yeaft}/templates/plan-instruction.md +0 -0
  138. /package/{unify → yeaft}/templates/tool-guidance.md +0 -0
  139. /package/{unify → yeaft}/tool-folding/exec-log.js +0 -0
  140. /package/{unify → yeaft}/tool-folding/fallback-stub.js +0 -0
  141. /package/{unify → yeaft}/tool-folding/index.js +0 -0
  142. /package/{unify → yeaft}/tool-folding/reflection-prompt.js +0 -0
  143. /package/{unify → yeaft}/tool-folding/t1-reflector.js +0 -0
  144. /package/{unify → yeaft}/tool-folding/t2-reflector.js +0 -0
  145. /package/{unify → yeaft}/tools/agent.js +0 -0
  146. /package/{unify → yeaft}/tools/apply-patch.js +0 -0
  147. /package/{unify → yeaft}/tools/bash.js +0 -0
  148. /package/{unify → yeaft}/tools/close-agent.js +0 -0
  149. /package/{unify → yeaft}/tools/file-edit.js +0 -0
  150. /package/{unify → yeaft}/tools/file-read.js +0 -0
  151. /package/{unify → yeaft}/tools/file-write.js +0 -0
  152. /package/{unify → yeaft}/tools/glob.js +0 -0
  153. /package/{unify → yeaft}/tools/grep.js +0 -0
  154. /package/{unify → yeaft}/tools/history-search.js +0 -0
  155. /package/{unify → yeaft}/tools/image-generation.js +0 -0
  156. /package/{unify → yeaft}/tools/index.js +0 -0
  157. /package/{unify → yeaft}/tools/js-repl.js +0 -0
  158. /package/{unify → yeaft}/tools/list-agents.js +0 -0
  159. /package/{unify → yeaft}/tools/list-dir.js +0 -0
  160. /package/{unify → yeaft}/tools/notebook-edit.js +0 -0
  161. /package/{unify → yeaft}/tools/route-forward.js +0 -0
  162. /package/{unify → yeaft}/tools/send-message.js +0 -0
  163. /package/{unify → yeaft}/tools/todo-write.js +0 -0
  164. /package/{unify → yeaft}/tools/view-image.js +0 -0
  165. /package/{unify → yeaft}/tools/wait-agent.js +0 -0
  166. /package/{unify → yeaft}/tools/web-fetch.js +0 -0
  167. /package/{unify → yeaft}/vp/seed-defaults.js +0 -0
  168. /package/{unify → yeaft}/vp/seed-topup.js +0 -0
  169. /package/{unify → yeaft}/vp/stock-ids.js +0 -0
  170. /package/{unify → yeaft}/vp/thread-classifier.js +0 -0
  171. /package/{unify → yeaft}/vp/vp-crud.js +0 -0
  172. /package/{unify → yeaft}/vp/vp-loader.js +0 -0
  173. /package/{unify → yeaft}/vp/vp-store.js +0 -0
  174. /package/{unify → yeaft}/vp-status-broker.js +0 -0
@@ -22,7 +22,7 @@
22
22
  * (a) Does NOT touch RoleInstance state machine internals (that's 334c).
23
23
  * (b) Does NOT touch live-diff (334h).
24
24
  * (c) Persistence routes through group.appendMessage via Coordinator.
25
- * (d) Tool schema uses defineTool (agent/unify/tools/types.js).
25
+ * (d) Tool schema uses defineTool (agent/yeaft/tools/types.js).
26
26
  */
27
27
 
28
28
  import { resolveMemberId } from '../groups/roster.js';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * session.js — Session orchestrator for Yeaft Unify
2
+ * session.js — Session orchestrator for Yeaft Yeaft
3
3
  *
4
4
  * Single entry point: loadSession(options?) → Session
5
5
  *
@@ -101,7 +101,7 @@ function prepareToolStatsDir(yeaftDir) {
101
101
  mkdirSyncSafe(statsDir, { recursive: true });
102
102
  } catch (err) {
103
103
  console.warn(
104
- `[Unify] Could not create stats dir ${statsDir}: ${err?.message || err}. ` +
104
+ `[Yeaft] Could not create stats dir ${statsDir}: ${err?.message || err}. ` +
105
105
  `Tool-usage counters will live in memory only.`
106
106
  );
107
107
  }
@@ -161,7 +161,7 @@ export async function loadSession(options = {}) {
161
161
  // completed, warn the user. Do NOT auto-run migration: that is
162
162
  // an explicit action via bin/yeaft-migrate.js.
163
163
  try {
164
- if (config?.features?.unifyGroupChat === true) {
164
+ if (config?.features?.yeaftGroupChat === true) {
165
165
  const stateFile = join(yeaftDir, '.migration-state.json');
166
166
  let completed = false;
167
167
  if (existsSyncSafe(stateFile)) {
@@ -173,7 +173,7 @@ export async function loadSession(options = {}) {
173
173
  }
174
174
  if (!completed) {
175
175
  console.warn(
176
- '[Yeaft] features.unifyGroupChat=true but storage migration is not complete. ' +
176
+ '[Yeaft] features.yeaftGroupChat=true but storage migration is not complete. ' +
177
177
  'Run `yeaft-migrate` before using the new group-chat tree, or unset the flag.',
178
178
  );
179
179
  }
@@ -402,8 +402,8 @@ export async function loadSession(options = {}) {
402
402
  // ─── 9a-pre. Create per-group history Compactor ────────
403
403
  // Owns the post-turn single-flight + race-guarded compactor that used
404
404
  // to live inline in web-bridge.js. Bridge keeps history ownership and
405
- // wires the WS sink (`unify_history_compacted`) via
406
- // `compactor.setOnCompacted` from `installUnifyRuntimeBridge`.
405
+ // wires the WS sink (`yeaft_history_compacted`) via
406
+ // `compactor.setOnCompacted` from `installYeaftRuntimeBridge`.
407
407
  const compactor = new Compactor({
408
408
  summarize: ({ system, prompt, maxTokens } = {}) =>
409
409
  engine.summarizeForCompact({ system, prompt, maxTokens }),
@@ -534,8 +534,8 @@ export async function loadSession(options = {}) {
534
534
  // with web-bridge.js (which already imports this module to call
535
535
  // loadSession).
536
536
  async abort(opts = {}) {
537
- const { abortUnifySession } = await import('./web-bridge.js');
538
- return abortUnifySession(opts);
537
+ const { abortYeaftSession } = await import('./web-bridge.js');
538
+ return abortYeaftSession(opts);
539
539
  },
540
540
  };
541
541
  }
@@ -19,7 +19,7 @@
19
19
  * - keywords: array of match keywords (alternative to trigger)
20
20
  * - platforms: array of ["macos", "linux", "windows"]
21
21
  *
22
- * Reference: yeaft-unify-design.md §8, yeaft-unify-core-systems.md
22
+ * Reference: yeaft-yeaft-design.md §8, yeaft-yeaft-core-systems.md
23
23
  */
24
24
 
25
25
  import { existsSync, readFileSync, readdirSync, writeFileSync, unlinkSync, mkdirSync, statSync } from 'fs';
@@ -385,7 +385,7 @@ export class SkillManager {
385
385
  * This is the "progressive disclosure" list tier.
386
386
  *
387
387
  * task-311: the legacy `mode` parameter (chat/work filter) is accepted but
388
- * ignored — Unify no longer has mode distinction, so every skill is treated
388
+ * ignored — Yeaft no longer has mode distinction, so every skill is treated
389
389
  * as universally applicable. The `mode` field on each record is still
390
390
  * surfaced for historic YAML compatibility.
391
391
  *
@@ -2,7 +2,7 @@
2
2
  * format.js — human-readable formatters for tool-usage stats.
3
3
  *
4
4
  * Single source of truth shared by the agent-side CLI (`bin/yeaft-stats.js`)
5
- * and the REPL `/stats` command. The frontend `UnifyToolStatsDrawer.js`
5
+ * and the REPL `/stats` command. The frontend `YeaftToolStatsDrawer.js`
6
6
  * copies the same logic verbatim because the no-build-step web layer can't
7
7
  * import from `agent/`; keep the two definitions byte-identical when
8
8
  * tweaking either side.
@@ -11,7 +11,7 @@
11
11
  * Dream V2 owns all background memory maintenance (scope summaries +
12
12
  * memory writes via dream-v2/session-wiring.js → createV2DreamScheduler).
13
13
  *
14
- * Reference: yeaft-unify-core-systems.md §4.4
14
+ * Reference: yeaft-yeaft-core-systems.md §4.4
15
15
  */
16
16
 
17
17
  import { isPermissionError } from './init.js';
@@ -118,7 +118,7 @@ export function startSubAgent(agent, deps = {}) {
118
118
  // Share the session-shared ToolUsageStats so sub-agent tool calls
119
119
  // land in the same on-disk snapshot the parent records into. Sub-
120
120
  // agents are often the heaviest tool users — leaving them out
121
- // skewed `unify_fetch_tool_stats` output.
121
+ // skewed `yeaft_fetch_tool_stats` output.
122
122
  toolStats: deps.toolStats || null,
123
123
  });
124
124
 
@@ -1,11 +1,11 @@
1
1
  /**
2
2
  * ask-user.js — Ask the user a question and wait for their response.
3
3
  *
4
- * In Unify mode this tool sends a question through the web-bridge
4
+ * In Yeaft mode this tool sends a question through the web-bridge
5
5
  * and blocks (via Promise) until the user answers. The answer is
6
6
  * returned as the tool result.
7
7
  *
8
- * Reference: yeaft-unify-design.md §8
8
+ * Reference: yeaft-yeaft-design.md §8
9
9
  */
10
10
 
11
11
  import { defineTool } from './types.js';
@@ -5,7 +5,7 @@
5
5
  * sub-agents that need to work on files without conflicting with
6
6
  * the main working tree or other workers.
7
7
  *
8
- * Reference: yeaft-unify-design.md §8, yeaft-unify-core-systems.md §3.2
8
+ * Reference: yeaft-yeaft-design.md §8, yeaft-yeaft-core-systems.md §3.2
9
9
  */
10
10
 
11
11
  import { defineTool } from './types.js';
@@ -4,7 +4,7 @@
4
4
  * Exits and optionally removes a worktree created by EnterWorktree.
5
5
  * Can keep the worktree (preserve branch) or remove it cleanly.
6
6
  *
7
- * Reference: yeaft-unify-design.md §8
7
+ * Reference: yeaft-yeaft-design.md §8
8
8
  */
9
9
 
10
10
  import { defineTool } from './types.js';
@@ -7,7 +7,7 @@
7
7
  *
8
8
  * These are exported as an array (unlike other tool files that export a single tool).
9
9
  *
10
- * Reference: yeaft-unify-design.md §8
10
+ * Reference: yeaft-yeaft-design.md §8
11
11
  */
12
12
 
13
13
  import { defineTool } from './types.js';
@@ -1,10 +1,10 @@
1
1
  /**
2
- * registry.js — Tool registration center for Yeaft Unify
2
+ * registry.js — Tool registration center for Yeaft Yeaft
3
3
  *
4
4
  * Manages tool registration and execution dispatch.
5
5
  * The engine uses this to get tool definitions for the LLM and to execute tool calls.
6
6
  *
7
- * NOTE (task-297): Mode-based filtering (chat/work) has been removed. Unify now runs as
7
+ * NOTE (task-297): Mode-based filtering (chat/work) has been removed. Yeaft now runs as
8
8
  * a single unified mode where all registered tools are available. Tool definitions may
9
9
  * still carry a `modes` field, but the registry ignores it.
10
10
  */
@@ -10,7 +10,7 @@
10
10
  * Directory-based skills (SKILL.md + references/ + templates/) support
11
11
  * reading linked files via the view action's filePath parameter.
12
12
  *
13
- * Reference: yeaft-unify-design.md §8
13
+ * Reference: yeaft-yeaft-design.md §8
14
14
  */
15
15
 
16
16
  import { defineTool } from './types.js';
@@ -64,7 +64,7 @@ The tool takes the topic plus optional guiding fields (stuckAt, userProblem, exp
64
64
  properties: {
65
65
  topic: {
66
66
  type: 'string',
67
- description: 'One-sentence statement of what is being planned (e.g. "Add dark-mode toggle to UnifyPage settings").',
67
+ description: 'One-sentence statement of what is being planned (e.g. "Add dark-mode toggle to YeaftPage settings").',
68
68
  },
69
69
  userProblem: {
70
70
  type: 'string',
@@ -1,13 +1,13 @@
1
1
  /**
2
- * types.js — Tool definition interface for Yeaft Unify
2
+ * types.js — Tool definition interface for Yeaft Yeaft
3
3
  *
4
4
  * All tools use the defineTool() function to create tool definitions.
5
5
  * This ensures consistent shape and API-format conversion.
6
6
  *
7
- * Reference: yeaft-unify-core-systems.md §3.1
7
+ * Reference: yeaft-yeaft-core-systems.md §3.1
8
8
  *
9
9
  * task-311: the legacy `modes` field (task-297 deprecated) is now fully
10
- * removed — Unify runs in a single unified mode.
10
+ * removed — Yeaft runs in a single unified mode.
11
11
  */
12
12
 
13
13
  /**
@@ -60,7 +60,7 @@ Guidelines:
60
60
  const signal = ctx?.signal;
61
61
  const errors = [];
62
62
 
63
- // Backend preference set in UnifySettings → Search tab. When the
63
+ // Backend preference set in YeaftSettings → Search tab. When the
64
64
  // user picks `playwright` we'd normally call the playwright-service;
65
65
  // that service is not yet shipped (next PR), so the preference is
66
66
  // recorded for forward-compat and we transparently fall through to
@@ -1,5 +1,5 @@
1
1
  /**
2
- * turn-utils.js — Turn-based slicing primitives for the Unify history.
2
+ * turn-utils.js — Turn-based slicing primitives for the Yeaft history.
3
3
  *
4
4
  * "Turn" = one user-side round-trip, NOT one user-role message.
5
5
  * Multi-VP fan-out emits N user messages (each `@vp-<id> <text>`) for
@@ -1,5 +1,5 @@
1
1
  /**
2
- * index.js — Public barrel for agent/unify/vp.
2
+ * index.js — Public barrel for agent/yeaft/vp.
3
3
  */
4
4
 
5
5
  export { parseRoleMd, loadVpFromDir, scanVpLibrary, count, DEFAULT_VP_LIB_DIR } from './vp-store.js';
@@ -7,7 +7,7 @@
7
7
  *
8
8
  * The previous RoleInstance map (per (vpId, groupId) pair, with LRU
9
9
  * eviction) was removed in GC.2 — production fans out per-VP via
10
- * `handleUnifyGroupChat` -> `runVpTurn` directly and never instantiated
10
+ * `handleYeaftGroupChat` -> `runVpTurn` directly and never instantiated
11
11
  * RoleInstance.
12
12
  */
13
13
 
@@ -12,7 +12,7 @@
12
12
  * • color / avatar → web-derived, NOT emitted here
13
13
  *
14
14
  * task-334h — live diff:
15
- * • subscribers (Set of sendUnifyEvent fns) receive per-vp `vp_updated`
15
+ * • subscribers (Set of sendYeaftEvent fns) receive per-vp `vp_updated`
16
16
  * and `vp_removed` events as VpLoader's debounced rescan commits
17
17
  * added / updated / removed vpIds.
18
18
  * • Event shape: `{ type, vpId, vp?, reason? }` where `reason` ∈
@@ -230,21 +230,21 @@ export function buildVpSnapshot(registry = defaultRegistry) {
230
230
  }
231
231
 
232
232
  /**
233
- * Handle an `unify_vp_subscribe` request from the web client.
233
+ * Handle an `yeaft_vp_subscribe` request from the web client.
234
234
  *
235
- * Registers `sendUnifyEvent` as a live-diff subscriber, emits an initial
235
+ * Registers `sendYeaftEvent` as a live-diff subscriber, emits an initial
236
236
  * `vp_snapshot`, and (on first call process-wide) starts the VpLoader
237
237
  * whose debounced rescan fans out `vp_updated` / `vp_removed` events.
238
238
  *
239
239
  * Returns an unsubscribe fn the caller MAY invoke on WS close to prevent
240
240
  * sending to a dead socket. Web-bridge is expected to manage this.
241
241
  *
242
- * @param {(event: object) => void} sendUnifyEvent
242
+ * @param {(event: object) => void} sendYeaftEvent
243
243
  * @param {import('./registry.js').Registry} [registry]
244
244
  * @param {{dir?: string}} [options]
245
245
  * @returns {() => void} unsubscribe fn
246
246
  */
247
- export function handleVpSubscribe(sendUnifyEvent, registry = defaultRegistry, options = {}) {
247
+ export function handleVpSubscribe(sendYeaftEvent, registry = defaultRegistry, options = {}) {
248
248
  const { loader, fresh } = ensureLoader(registry, options);
249
249
  // task-338-F2 + task-339-followup: replay semantics.
250
250
  //
@@ -273,13 +273,13 @@ export function handleVpSubscribe(sendUnifyEvent, registry = defaultRegistry, op
273
273
  if (shouldRescan && loader && typeof loader.rescanNow === 'function') {
274
274
  try { loader.rescanNow(); } catch { /* never crash subscribe on rescan */ }
275
275
  }
276
- _subscribers.add(sendUnifyEvent);
276
+ _subscribers.add(sendYeaftEvent);
277
277
  try {
278
- sendUnifyEvent(buildVpSnapshot(registry));
278
+ sendYeaftEvent(buildVpSnapshot(registry));
279
279
  } catch {
280
280
  // Never crash the WS pipeline from snapshot serialisation.
281
281
  }
282
- return () => { _subscribers.delete(sendUnifyEvent); };
282
+ return () => { _subscribers.delete(sendYeaftEvent); };
283
283
  }
284
284
 
285
285
  /**