cc-viewer 1.7.23 → 1.8.1

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 (262) hide show
  1. package/README.md +20 -0
  2. package/cli.js +92 -11
  3. package/concepts/ar/GlobalSettings.md +2 -2
  4. package/concepts/ar/ToolsFirst.md +1 -1
  5. package/concepts/da/GlobalSettings.md +2 -2
  6. package/concepts/da/ToolsFirst.md +1 -1
  7. package/concepts/de/GlobalSettings.md +2 -2
  8. package/concepts/de/ToolsFirst.md +1 -1
  9. package/concepts/en/GlobalSettings.md +2 -2
  10. package/concepts/en/ToolsFirst.md +1 -1
  11. package/concepts/es/GlobalSettings.md +2 -2
  12. package/concepts/es/ToolsFirst.md +1 -1
  13. package/concepts/fr/GlobalSettings.md +2 -2
  14. package/concepts/fr/ToolsFirst.md +1 -1
  15. package/concepts/it/GlobalSettings.md +2 -2
  16. package/concepts/it/ToolsFirst.md +1 -1
  17. package/concepts/ja/GlobalSettings.md +2 -2
  18. package/concepts/ja/ToolsFirst.md +1 -1
  19. package/concepts/ko/GlobalSettings.md +2 -2
  20. package/concepts/ko/ToolsFirst.md +1 -1
  21. package/concepts/no/GlobalSettings.md +2 -2
  22. package/concepts/no/ToolsFirst.md +1 -1
  23. package/concepts/pl/GlobalSettings.md +2 -2
  24. package/concepts/pl/ToolsFirst.md +1 -1
  25. package/concepts/pt-BR/GlobalSettings.md +2 -2
  26. package/concepts/pt-BR/ToolsFirst.md +1 -1
  27. package/concepts/ru/GlobalSettings.md +2 -2
  28. package/concepts/ru/ToolsFirst.md +1 -1
  29. package/concepts/th/GlobalSettings.md +2 -2
  30. package/concepts/th/ToolsFirst.md +1 -1
  31. package/concepts/tr/GlobalSettings.md +2 -2
  32. package/concepts/tr/ToolsFirst.md +1 -1
  33. package/concepts/uk/GlobalSettings.md +2 -2
  34. package/concepts/uk/ToolsFirst.md +1 -1
  35. package/concepts/zh/GlobalSettings.md +2 -2
  36. package/concepts/zh/ToolsFirst.md +1 -1
  37. package/concepts/zh-TW/GlobalSettings.md +2 -2
  38. package/concepts/zh-TW/ToolsFirst.md +1 -1
  39. package/dist/assets/App-CqQJDjfT.js +2 -0
  40. package/dist/assets/App-ssYfrjwF.css +1 -0
  41. package/dist/assets/{MdxEditorPanel-e5DlfcqJ.js → MdxEditorPanel-DXwb5tSD.js} +1 -1
  42. package/dist/assets/{Mobile-B8xwCLgr.js → Mobile-DOjKURO3.js} +1 -1
  43. package/dist/assets/{ProxyStatsModal-_w677xPM.js → ProxyStatsModal-BEnxiRXF.js} +1 -1
  44. package/dist/assets/index-CH_N7vvX.js +2 -0
  45. package/dist/assets/seqResourceLoaders-BJhO6zhW.js +2 -0
  46. package/dist/assets/seqResourceLoaders-DI0G5nu1.css +41 -0
  47. package/dist/index.html +1 -1
  48. package/findcc.js +17 -8
  49. package/node_modules/@ccv/core/package.json +13 -0
  50. package/{server/lib → node_modules/@ccv/core/src}/approval-modal-prefs.js +1 -1
  51. package/node_modules/@ccv/core/src/clearCheckpoint.js +7 -0
  52. package/{src/utils → node_modules/@ccv/core/src}/contentFilter.js +207 -141
  53. package/{server/lib → node_modules/@ccv/core/src}/context-rules.js +2 -2
  54. package/{server/lib → node_modules/@ccv/core/src}/delta-reconstructor.js +60 -4
  55. package/{server/lib → node_modules/@ccv/core/src}/error-report.js +5 -4
  56. package/{server/lib → node_modules/@ccv/core/src}/session-boundary.js +3 -3
  57. package/{src/utils → node_modules/@ccv/core/src}/teammateDetector.js +9 -0
  58. package/{server/lib → node_modules/@ccv/core/src}/tools-xml-formatter.js +3 -3
  59. package/{server/lib → node_modules/@ccv/core/src}/v2-transcript-normalizer.js +1 -1
  60. package/{server/lib → node_modules/@ccv/core/src}/voice-pack-events.js +2 -2
  61. package/package.json +11 -97
  62. package/server/_paths.js +28 -7
  63. package/server/i18n.js +60 -0
  64. package/server/interceptor.js +36 -11
  65. package/server/lib/adapters/dingtalk-adapter.js +2 -2
  66. package/server/lib/adapters/discord-adapter.js +2 -2
  67. package/server/lib/adapters/feishu-adapter.js +2 -2
  68. package/server/lib/adapters/wecom-adapter.js +2 -2
  69. package/server/lib/approval-policy.js +29 -0
  70. package/server/lib/{ask-store.js → ask/ask-store.js} +3 -3
  71. package/server/lib/{perm-bridge.js → ask/perm-bridge.js} +5 -5
  72. package/server/lib/builtin-model-prompts.js +198 -0
  73. package/server/lib/chat-queue.js +341 -0
  74. package/server/lib/cli-inject.js +1 -1
  75. package/server/lib/context-watcher.js +3 -3
  76. package/server/lib/create_system_prompt.js +0 -9
  77. package/server/lib/enrich-plan-input.js +1 -1
  78. package/server/lib/ensure-hooks.js +2 -2
  79. package/server/lib/file-access-policy.js +6 -1
  80. package/server/lib/file-api.js +17 -1
  81. package/server/lib/{dingtalk-bridge.js → im/dingtalk-bridge.js} +1 -1
  82. package/server/lib/{im-append-system.js → im/im-append-system.js} +5 -13
  83. package/server/lib/{im-bridge-core.js → im/im-bridge-core.js} +12 -6
  84. package/server/lib/{im-config.js → im/im-config.js} +1 -1
  85. package/server/lib/im/im-deny.js +4 -0
  86. package/server/lib/{im-lang.js → im/im-lang.js} +1 -1
  87. package/server/lib/{im-lock.js → im/im-lock.js} +2 -2
  88. package/server/lib/{im-process-manager.js → im/im-process-manager.js} +1 -1
  89. package/server/lib/{im-senders.js → im/im-senders.js} +1 -1
  90. package/server/lib/{im-skills.js → im/im-skills.js} +2 -2
  91. package/server/lib/interceptor-core.js +8 -5
  92. package/server/lib/kv-cache-analyzer.js +6 -5
  93. package/server/lib/launch-config.js +329 -0
  94. package/server/lib/log-file-utils.js +21 -0
  95. package/server/lib/log-management.js +6 -17
  96. package/server/lib/log-stream.js +1 -1
  97. package/server/lib/log-watcher.js +1 -1
  98. package/server/lib/model-system-prompts.js +18 -2
  99. package/server/lib/prefs-store.js +2 -2
  100. package/server/lib/project-prefs.js +6 -6
  101. package/server/lib/project-state.js +15 -0
  102. package/server/lib/{proxy-retry.js → proxy/proxy-retry.js} +2 -2
  103. package/server/lib/{proxy-stats.js → proxy/proxy-stats.js} +3 -3
  104. package/server/lib/sdk-adapter.js +6 -74
  105. package/server/lib/sdk-manager.js +383 -278
  106. package/server/lib/skills-api.js +1 -1
  107. package/server/lib/spawn-model-resolver.js +21 -6
  108. package/server/lib/stats-worker.js +2 -2
  109. package/server/lib/system-prompt-files.js +53 -15
  110. package/server/lib/system-prompt-render.js +23 -7
  111. package/server/lib/system-prompt-snapshots.js +452 -0
  112. package/server/lib/updater.js +63 -3
  113. package/server/lib/user-prompt-extract.js +5 -5
  114. package/server/lib/v2/adapter.js +3 -3
  115. package/server/lib/v2/conversation-store.js +1 -1
  116. package/server/lib/v2/convert.js +3 -3
  117. package/server/lib/v2/jsonl-read.js +1 -1
  118. package/server/lib/v2/live-feed.js +3 -3
  119. package/server/lib/v2/meta-rows.js +3 -3
  120. package/server/lib/v2/replay.js +1 -1
  121. package/server/lib/v2/session-list.js +1 -1
  122. package/server/lib/v2/session-owner.js +1 -1
  123. package/server/lib/v2/v2-writer.js +26 -1
  124. package/server/lib/v2/verify.js +1 -1
  125. package/server/lib/voice-pack-manager.js +4 -5
  126. package/server/lib/wire-compress.js +1 -1
  127. package/server/proxy.js +5 -5
  128. package/server/pty-manager.js +285 -184
  129. package/server/routes/ask-perm.js +1 -1
  130. package/server/routes/dingtalk.js +3 -3
  131. package/server/routes/events.js +2 -2
  132. package/server/routes/expert.js +74 -13
  133. package/server/routes/im.js +5 -5
  134. package/server/routes/preferences.js +3 -3
  135. package/server/routes/workspaces.js +1 -1
  136. package/server/server.js +207 -58
  137. package/server/system-prompt-templates/systemPromptModel.md +0 -8
  138. package/server/system-prompt-templates/systemPromptVariables.ar.md +0 -7
  139. package/server/system-prompt-templates/systemPromptVariables.da.md +0 -7
  140. package/server/system-prompt-templates/systemPromptVariables.de.md +0 -7
  141. package/server/system-prompt-templates/systemPromptVariables.es.md +0 -7
  142. package/server/system-prompt-templates/systemPromptVariables.fr.md +0 -7
  143. package/server/system-prompt-templates/systemPromptVariables.it.md +0 -7
  144. package/server/system-prompt-templates/systemPromptVariables.ja.md +0 -7
  145. package/server/system-prompt-templates/systemPromptVariables.ko.md +0 -7
  146. package/server/system-prompt-templates/systemPromptVariables.md +0 -7
  147. package/server/system-prompt-templates/systemPromptVariables.no.md +0 -7
  148. package/server/system-prompt-templates/systemPromptVariables.pl.md +0 -7
  149. package/server/system-prompt-templates/systemPromptVariables.pt-BR.md +0 -7
  150. package/server/system-prompt-templates/systemPromptVariables.ru.md +0 -7
  151. package/server/system-prompt-templates/systemPromptVariables.th.md +0 -7
  152. package/server/system-prompt-templates/systemPromptVariables.tr.md +0 -7
  153. package/server/system-prompt-templates/systemPromptVariables.uk.md +0 -7
  154. package/server/system-prompt-templates/systemPromptVariables.zh-TW.md +0 -7
  155. package/server/system-prompt-templates/systemPromptVariables.zh.md +0 -7
  156. package/ultraAgents/README.md +3 -0
  157. package/ultraAgents/test-analysis-expert.json +45 -0
  158. package/dist/assets/App-BWajJyJh.css +0 -1
  159. package/dist/assets/App-CusqoEAB.js +0 -2
  160. package/dist/assets/index-D6FmFsIz.js +0 -2
  161. package/dist/assets/seqResourceLoaders-3K77Znll.js +0 -2
  162. package/dist/assets/seqResourceLoaders-BgD_Rwvc.css +0 -41
  163. package/src/utils/apiUrl.js +0 -26
  164. package/src/utils/askFallback.js +0 -21
  165. package/src/utils/askOptionDesc.js +0 -55
  166. package/src/utils/askPortalMatcher.js +0 -54
  167. package/src/utils/autoApproveOptions.js +0 -27
  168. package/src/utils/avatarAnimationPostPass.js +0 -49
  169. package/src/utils/builtinPresets.js +0 -18
  170. package/src/utils/clearCheckpoint.js +0 -7
  171. package/src/utils/commandValidator.js +0 -45
  172. package/src/utils/contextRaw.js +0 -18
  173. package/src/utils/contextSidebarNavigation.js +0 -16
  174. package/src/utils/contextTurns.js +0 -117
  175. package/src/utils/displayScaleHelper.js +0 -47
  176. package/src/utils/effectiveModel.js +0 -17
  177. package/src/utils/entry-slim.js +0 -563
  178. package/src/utils/entryCache.js +0 -144
  179. package/src/utils/errorReport.js +0 -6
  180. package/src/utils/fileExpandedPathsStorage.js +0 -70
  181. package/src/utils/fileIcons.jsx +0 -36
  182. package/src/utils/fileOpen.js +0 -37
  183. package/src/utils/formatters.js +0 -48
  184. package/src/utils/gitApi.js +0 -50
  185. package/src/utils/gitTreeBuilder.js +0 -19
  186. package/src/utils/helpers.js +0 -854
  187. package/src/utils/identityHeal.js +0 -108
  188. package/src/utils/imConnState.js +0 -59
  189. package/src/utils/imOrigin.js +0 -24
  190. package/src/utils/imTr.js +0 -7
  191. package/src/utils/imageCompress.js +0 -83
  192. package/src/utils/imageDownscale.js +0 -28
  193. package/src/utils/imageResize.js +0 -112
  194. package/src/utils/ingestPipeline.js +0 -47
  195. package/src/utils/isProxyMode.js +0 -11
  196. package/src/utils/lazyWithReload.js +0 -53
  197. package/src/utils/markdown.js +0 -30
  198. package/src/utils/markdownIncremental.js +0 -39
  199. package/src/utils/markdownProfiler.js +0 -113
  200. package/src/utils/mdExtensionDetect.js +0 -64
  201. package/src/utils/memoryLinkParser.js +0 -44
  202. package/src/utils/modalMask.js +0 -15
  203. package/src/utils/modelSuggestions.js +0 -48
  204. package/src/utils/monotime.js +0 -6
  205. package/src/utils/pinnedMenu.js +0 -55
  206. package/src/utils/presetShortcuts.js +0 -14
  207. package/src/utils/projectAlias.js +0 -135
  208. package/src/utils/promptClassifier.js +0 -112
  209. package/src/utils/promptDetect.js +0 -196
  210. package/src/utils/promptNav.js +0 -60
  211. package/src/utils/ptyChunkBuilder.js +0 -251
  212. package/src/utils/quickMenuHoverIntent.js +0 -35
  213. package/src/utils/rateLimitParser.js +0 -119
  214. package/src/utils/readResultPool.js +0 -106
  215. package/src/utils/refreshCachedItemProp.js +0 -30
  216. package/src/utils/resizeCalc.js +0 -21
  217. package/src/utils/resolveLocalized.js +0 -17
  218. package/src/utils/searchApi.js +0 -47
  219. package/src/utils/searchReplace.js +0 -51
  220. package/src/utils/seqResourceLoaders.js +0 -79
  221. package/src/utils/sessionManager.js +0 -482
  222. package/src/utils/sessionMerge.js +0 -239
  223. package/src/utils/skillModalController.js +0 -111
  224. package/src/utils/skillsParser.js +0 -116
  225. package/src/utils/slashCommandLabels.js +0 -80
  226. package/src/utils/splitDragCalc.js +0 -73
  227. package/src/utils/stickyBottomController.js +0 -643
  228. package/src/utils/svgSanitize.js +0 -48
  229. package/src/utils/systemTags.js +0 -47
  230. package/src/utils/tClaude.js +0 -20
  231. package/src/utils/teamModalBuilder.js +0 -351
  232. package/src/utils/teamSessionParser.js +0 -190
  233. package/src/utils/teammateAvatars.js +0 -194
  234. package/src/utils/termDiag.js +0 -114
  235. package/src/utils/terminalClipboard.js +0 -117
  236. package/src/utils/terminalWriteQueue.js +0 -398
  237. package/src/utils/thinkingMerge.js +0 -49
  238. package/src/utils/toolCatalog.js +0 -30
  239. package/src/utils/toolResultBuilder.js +0 -411
  240. package/src/utils/toolResultClassifier.js +0 -16
  241. package/src/utils/toolResultCore.js +0 -194
  242. package/src/utils/toolsDiff.js +0 -44
  243. package/src/utils/toolsXmlFormatter.js +0 -3
  244. package/src/utils/ultraplanController.js +0 -109
  245. package/src/utils/ultraplanExperts.js +0 -86
  246. package/src/utils/ultraplanTemplates.js +0 -154
  247. package/src/utils/userImageRefs.js +0 -49
  248. package/src/utils/v3Assembler.js +0 -125
  249. package/src/utils/v3Rows.js +0 -49
  250. package/src/utils/voicePackPlayer.js +0 -233
  251. package/src/utils/webSearchGrouping.js +0 -111
  252. package/src/utils/workflowFormat.js +0 -52
  253. package/src/utils/workflowRuns.js +0 -118
  254. package/src/utils/workflowStore.js +0 -94
  255. /package/{src/utils → node_modules/@ccv/core/src}/requestType.js +0 -0
  256. /package/server/lib/{ask-bridge.js → ask/ask-bridge.js} +0 -0
  257. /package/server/lib/{ask-constants.js → ask/ask-constants.js} +0 -0
  258. /package/server/lib/{ask-reaper.js → ask/ask-reaper.js} +0 -0
  259. /package/server/lib/{dingtalk-config.js → im/dingtalk-config.js} +0 -0
  260. /package/server/lib/{im-log-watcher.js → im/im-log-watcher.js} +0 -0
  261. /package/server/lib/{proxy-env.js → proxy/proxy-env.js} +0 -0
  262. /package/server/lib/{proxy-errors.js → proxy/proxy-errors.js} +0 -0
@@ -24,15 +24,15 @@
24
24
 
25
25
  import { watch, existsSync, readdirSync, readFileSync, statSync, openSync, readSync, closeSync } from 'node:fs';
26
26
  import { join } from 'node:path';
27
- import { reportSwallowed } from '../error-report.js';
28
- import { createIncrementalReconstructor } from '../delta-reconstructor.js';
27
+ import { reportSwallowed } from '@ccv/core/error-report';
28
+ import { createIncrementalReconstructor } from '@ccv/core/delta-reconstructor';
29
29
  import { processWatchedEntry, sendEventToClients, sendEventRawToClients } from '../log-watcher.js';
30
30
  import { SessionSynthesizer } from './adapter.js';
31
31
  import { isDiscardableSession } from './session-select.js';
32
32
  import { isForeignLiveOwned } from './session-owner.js';
33
33
  import { isConvertRunning } from './convert-manager.js';
34
34
  import { computeCacheLoss } from './meta-rows.js';
35
- import { classifyRequest, withAgentNameSubType } from '../../../src/utils/requestType.js';
35
+ import { classifyRequest, withAgentNameSubType } from '@ccv/core/requestType';
36
36
 
37
37
  const FSWATCH_DEBOUNCE_MS = 80;
38
38
  const SAFETY_POLL_MS = 5000;
@@ -7,7 +7,7 @@
7
7
  * dropped — the wire carries rows only (~1.3KB each vs full entries).
8
8
  *
9
9
  * Two DELIBERATE classification divergences from the legacy full-entry list
10
- * (both more correct; pinned in test/v2-meta-rows.test.js, declared in
10
+ * (both more correct; pinned in packages/app/test/v2-meta-rows.test.js, declared in
11
11
  * history.md):
12
12
  * - membership is the journal fold — a SUPERSET of the synthesizer's output
13
13
  * (conv-gapped crash-orphans get a row; their detail fetch answers 404 and
@@ -21,8 +21,8 @@ import { readJsonlTolerant } from './replay.js';
21
21
  import { iterateJsonlLines } from './jsonl-read.js';
22
22
  import { iterateV2Items, findTeammateSessionDirs } from './adapter.js';
23
23
  import { SingleFlight } from './singleflight.js';
24
- import { reportSwallowed } from '../error-report.js';
25
- import { classifyRequest, withAgentNameSubType } from '../../../src/utils/requestType.js';
24
+ import { reportSwallowed } from '@ccv/core/error-report';
25
+ import { classifyRequest, withAgentNameSubType } from '@ccv/core/requestType';
26
26
 
27
27
  // KEEP IN SYNC: server/lib/v2/adapter.js itemKey — (sessionId, seq) identity.
28
28
  const itemKey = (sessionId, seq) => `${sessionId}\x00${seq}`;
@@ -12,7 +12,7 @@
12
12
  import { existsSync, readFileSync, readdirSync } from 'node:fs';
13
13
  import { join } from 'node:path';
14
14
  import { createHash } from 'node:crypto';
15
- import { messageFingerprint, normalizeMsgForEquality } from '../session-boundary.js';
15
+ import { messageFingerprint, normalizeMsgForEquality } from '@ccv/core/session-boundary';
16
16
  import { isSupportedWireFormat } from './layout.js';
17
17
  import { iterateJsonlLines } from './jsonl-read.js';
18
18
 
@@ -26,7 +26,7 @@ import { listSessionIds, readJsonlTolerant } from './replay.js';
26
26
  import { readPromptsHead, collectPromptsFromEvents } from '../user-prompt-extract.js';
27
27
  import { isDiscardableSession } from './session-select.js';
28
28
  import { isSupportedWireFormat, dirSizeSync } from './layout.js';
29
- import { reportSwallowed } from '../error-report.js';
29
+ import { reportSwallowed } from '@ccv/core/error-report';
30
30
 
31
31
  const MAX_PROJECTS = 32;
32
32
 
@@ -26,7 +26,7 @@
26
26
  import { readFileSync, writeFileSync, unlinkSync, existsSync } from 'node:fs';
27
27
  import { join } from 'node:path';
28
28
  import { isPidAlive } from '../pid-alive.js';
29
- import { reportSwallowed } from '../error-report.js';
29
+ import { reportSwallowed } from '@ccv/core/error-report';
30
30
 
31
31
  export const OWNER_LOCK_NAME = 'owner.lock';
32
32
 
@@ -19,7 +19,7 @@
19
19
  import { statfsSync, existsSync, readdirSync, readFileSync } from 'node:fs';
20
20
  import { join, basename } from 'node:path';
21
21
  import { AsyncWriteQueue } from '../async-write-queue.js';
22
- import { reportSwallowed } from '../error-report.js';
22
+ import { reportSwallowed } from '@ccv/core/error-report';
23
23
  import { ensureSessionDirSync, compactLocalTs14, sanitizePathComponent } from './layout.js';
24
24
  import { resolveSessionDirName, latestMainSession } from './session-select.js';
25
25
  import { acquireSessionClaim, releaseSessionClaim, isForeignLiveOwned } from './session-owner.js';
@@ -29,6 +29,7 @@ import { ConversationStore } from './conversation-store.js';
29
29
  import { parseUserId, classifyKind, ConvResolver } from './identity.js';
30
30
  import { parseAgentId, findHeader } from './agent-id.js';
31
31
  import { extractUserTexts, flattenPromptText, isSuggestionMode, readPromptsHead } from '../user-prompt-extract.js';
32
+ import { consumePendingForWireByKey, writeSnapshotByKey, systemTextOfBody } from '../system-prompt-snapshots.js';
32
33
 
33
34
  // Below this many free bytes on the log volume, v2 skips writing and reports
34
35
  // once — logging must not be the thing that fills the disk (plan risk #9).
@@ -428,6 +429,30 @@ export class V2Writer {
428
429
  // (live ≈ now; convert = the historical first-entry ts).
429
430
  const s = this._session(sid, parsed && entry.body.metadata.user_id, parsed && parsed.encoding, project, entry.timestamp, adoptTarget);
430
431
 
432
+ // System-prompt snapshot, Bind A (wire): the FIRST main request of a session
433
+ // carries the launch's rendered injection in body.system — match it against the
434
+ // project's pending queue and key the snapshot to the wire sid (== transcript
435
+ // uuid for fresh sessions), so a later `-c`/`-r` can pin byte-identical content
436
+ // instead of re-rendering variables and busting the prompt-prefix cache.
437
+ // count_tokens/heartbeat probes wear main-agent shapes but aren't the user's
438
+ // turn (same gate as the resume-switch above); adopted (-c) sessions skip —
439
+ // their pendings are resumeExpected, reserved for the SessionStart-hook bind.
440
+ // First-main-only via the per-session flag: probes may create the session state
441
+ // before the real turn arrives. The live-sessions-dir gate keeps the offline
442
+ // converter (staging dirs) from consuming LIVE pendings. Fully caught: a lost
443
+ // bind degrades to the no-record resume path, never to a dropped log entry.
444
+ if (!adoptTarget && entry.mainAgent && !entry.isCountTokens && !entry.isHeartbeat
445
+ && this._sessionsDirName === 'sessions'
446
+ && s && !s.sysPromptBindDone) {
447
+ s.sysPromptBindDone = true;
448
+ try {
449
+ const pend = consumePendingForWireByKey(project, systemTextOfBody(entry.body), this._logDir);
450
+ if (pend) {
451
+ writeSnapshotByKey(project, sid, { entries: pend.entries, model: pend.model, boundVia: 'wire' }, { logDir: this._logDir });
452
+ }
453
+ } catch (err) { reportSwallowed('v2-write.sys-prompt-bind', err); }
454
+ }
455
+
431
456
  // Flush requests that arrived before the first sid (they belong here).
432
457
  // Their handles are parked in _lateHandles so a completion that arrives
433
458
  // after the flush still gets its done line (folded by rid).
@@ -28,7 +28,7 @@
28
28
  import { statSync } from 'node:fs';
29
29
  import { dirname } from 'node:path';
30
30
  import { iterateRawEntriesAsync } from '../log-stream.js';
31
- import { createIncrementalReconstructor } from '../delta-reconstructor.js';
31
+ import { createIncrementalReconstructor } from '@ccv/core/delta-reconstructor';
32
32
  import { listSessionIds, readSession, indexSession, messagesDigest, blobRefOf } from './replay.js';
33
33
 
34
34
  const MAX_REPORTED_DIFFS = 50;
@@ -11,7 +11,7 @@
11
11
  import { existsSync, mkdirSync, writeFileSync, unlinkSync, readdirSync, statSync, readFileSync, lstatSync } from 'node:fs';
12
12
  import { join, extname } from 'node:path';
13
13
  import { randomUUID } from 'node:crypto';
14
- import { EVENT_KEYS, DEFAULT_BINDINGS, BUNDLED_PACK_IDS } from './voice-pack-events.js';
14
+ import { EVENT_KEYS, DEFAULT_BINDINGS, BUNDLED_PACK_IDS } from '@ccv/core/voice-pack-events';
15
15
  import { DIST_DIR, PUBLIC_DIR } from '../_paths.js';
16
16
 
17
17
  // Bundled pack lookup order, per packId:
@@ -35,7 +35,7 @@ for (const packId of BUNDLED_PACK_IDS) {
35
35
  }
36
36
  }
37
37
 
38
- export { EVENT_KEYS } from './voice-pack-events.js';
38
+ export { EVENT_KEYS } from '@ccv/core/voice-pack-events';
39
39
  export const ID_PATTERN = /^[a-f0-9-]{8,64}$/;
40
40
  export const ALLOWED_EXTS = new Set(['.mp3', '.wav', '.ogg', '.m4a']);
41
41
  export const MAX_AUDIO_BYTES = 2 * 1024 * 1024; // 2MB per file
@@ -334,6 +334,5 @@ export function reconcileVoicePackPrefs(logDir, vp) {
334
334
  // Re-export shared defaults so consumers can pull everything from one module.
335
335
  export { DEFAULT_BINDINGS, BUNDLED_PACK_IDS };
336
336
 
337
- // mergeApprovalModalPrefs / mergeVoicePackInto moved to server/lib/approval-modal-prefs.js
338
- //( — merge logic isn't voice-pack-specific). Import from
339
- // './approval-modal-prefs.js' directly.
337
+ // mergeApprovalModalPrefs / mergeVoicePackInto moved to @ccv/core/approval-modal-prefs
338
+ // (merge logic isn't voice-pack-specific). Import from '@ccv/core/approval-modal-prefs' directly.
@@ -19,7 +19,7 @@
19
19
  * knee on large sessions; q5 collapses to ~2.5x there).
20
20
  */
21
21
  import zlib from 'node:zlib';
22
- import { reportSwallowed } from './error-report.js';
22
+ import { reportSwallowed } from '@ccv/core/error-report';
23
23
  import { awaitDrainOrClose } from './sse-backpressure.js';
24
24
 
25
25
  const C = zlib.constants;
package/server/proxy.js CHANGED
@@ -5,13 +5,13 @@ import { join, basename } from 'node:path';
5
5
  import { homedir } from 'node:os';
6
6
  import * as interceptor from './interceptor.js';
7
7
  import { setupInterceptor } from './interceptor.js';
8
- import { extractApiErrorMessage, formatProxyRequestError } from './lib/proxy-errors.js';
9
- import { getProxyDispatcher } from './lib/proxy-env.js';
8
+ import { extractApiErrorMessage, formatProxyRequestError } from './lib/proxy/proxy-errors.js';
9
+ import { getProxyDispatcher } from './lib/proxy/proxy-env.js';
10
10
  import { getClaudeConfigDir } from '../findcc.js';
11
11
  import { isAnthropicApiPath, classifyProxyRole } from './lib/interceptor-core.js';
12
- import { executeRequest, extractModel } from './lib/proxy-retry.js';
13
- import { buildRecord, appendRecord, dailyFilePath, todayStr, emitProxyStatsUpdate } from './lib/proxy-stats.js';
14
- import { reportSwallowed } from './lib/error-report.js';
12
+ import { executeRequest, extractModel } from './lib/proxy/proxy-retry.js';
13
+ import { buildRecord, appendRecord, dailyFilePath, todayStr, emitProxyStatsUpdate } from './lib/proxy/proxy-stats.js';
14
+ import { reportSwallowed } from '@ccv/core/error-report';
15
15
  import { LOG_DIR } from '../findcc.js';
16
16
 
17
17
  // Setup interceptor to patch fetch