cc-viewer 1.9.37 → 1.9.39

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 (29) hide show
  1. package/README.md +4 -0
  2. package/cli.js +4 -0
  3. package/dist/assets/App-CpjhCyrl.js +2 -0
  4. package/dist/assets/App-DwLJPKiz.css +1 -0
  5. package/dist/assets/{ArchivePreview-BBXuZnGC.js → ArchivePreview-BHhhDCbz.js} +1 -1
  6. package/dist/assets/{AudioPreview-BmqzQZGt.js → AudioPreview-B0A6FVQc.js} +1 -1
  7. package/dist/assets/{MdxEditorPanel-BLcS9OVC.js → MdxEditorPanel-CEZPc4wd.js} +1 -1
  8. package/dist/assets/{Mobile-4mZy680Y.js → Mobile-B6az-Lrt.js} +1 -1
  9. package/dist/assets/{ProxyStatsModal-BDLwkqxD.js → ProxyStatsModal-B2PEO1Bm.js} +1 -1
  10. package/dist/assets/{SubtitlePreview-ei5OtiKq.js → SubtitlePreview-Ca7FKVpv.js} +1 -1
  11. package/dist/assets/index-DMmTEKEL.js +2 -0
  12. package/dist/assets/seqResourceLoaders-BJEa97Uq.js +2 -0
  13. package/dist/assets/seqResourceLoaders-BdxjrasH.css +41 -0
  14. package/dist/index.html +1 -1
  15. package/node_modules/@ccv/core/src/sdk-task-label.js +70 -0
  16. package/package.json +1 -1
  17. package/server/lib/chat-queue.js +159 -31
  18. package/server/lib/compact-inject-guard.js +100 -0
  19. package/server/lib/project-prefs.js +3 -2
  20. package/server/lib/sdk-manager.js +113 -2
  21. package/server/lib/task-state.js +11 -0
  22. package/server/routes/preferences.js +9 -2
  23. package/server/routes/project-prefs.js +6 -0
  24. package/server/server.js +207 -0
  25. package/dist/assets/App-BJIeZQK0.css +0 -1
  26. package/dist/assets/App-C_AI6A4g.js +0 -2
  27. package/dist/assets/index-CVnJzK-y.js +0 -2
  28. package/dist/assets/seqResourceLoaders-BT5ki0J4.js +0 -2
  29. package/dist/assets/seqResourceLoaders-CXgVOdgW.css +0 -41
package/README.md CHANGED
@@ -162,6 +162,10 @@ Task definitions and scheduling state live in `preferences.json` (the `scheduled
162
162
 
163
163
  You can **Run now**, pause/resume, delete, and see the last 20 runs (an isolated-session run can jump straight to its session). Fires are silent (the message just appears in the conversation); completions and failures surface as a toast. Note: a task only fires while `ccv` is running, and the scheduler does not run in a workspace-management (unbound) process.
164
164
 
165
+ ### Context compaction settings
166
+
167
+ Open **Context compaction** from the (+) menu to manage a list of compaction rules, each with a title, a custom script, a trigger threshold (a percentage of the context window, or an absolute size in K tokens), and an **execution timing**. When a turn-end check finds context usage above a rule's threshold, the timing decides what happens: **Ask the user** floats a bubble above the composer and `/compact <script>` is injected only after you click **Compact now**; **after 30s / 3min** shows the same bubble with a countdown and runs automatically when it ends (paused while hidden); **automatically** injects without any bubble. A built-in "default compaction rule" (75% / ask-the-user) is always present — it can't be deleted, but everything else (title / script / threshold / enabled / timing) is editable — and a dashed watermark line marks its threshold on the context usage bar once usage comes within 100K of it. Injection never happens mid-turn, with one exception: a built-in forced compaction fires when usage crosses 960K tokens, interrupting the current turn to inject the default rule's current script (user-edited, or the built-in fallback). Rules live in the `contextCompaction` key in `preferences.json` and follow the per-project preference scope like any other preference (a project fork can override them), and work in both SDK and PTY modes. The trigger is hardened against flapping: an over-limit reading is clamped (not fatal), hysteresis re-arms only after usage drops back below the line, a successful injection cools down for a few turns, and repeated failures open a circuit breaker.
168
+
165
169
  ### Programming mode
166
170
 
167
171
  After launching with ccv you'll see:
package/cli.js CHANGED
@@ -957,6 +957,7 @@ async function runImSdkMode(platformId) {
957
957
  serverMod.setSdkCancelApproval(sdkManager.cancelApproval);
958
958
  serverMod.setSdkAutoCancelApproval(sdkManager.autoCancelApproval);
959
959
  serverMod.setSdkSendUserMessage(sdkManager.sendUserMessage);
960
+ serverMod.setSdkForceSendUserMessage(sdkManager.forceSendUserMessage);
960
961
  serverMod.setSdkInterruptTurn(sdkManager.interruptTurn);
961
962
  serverMod.setSdkRetryTurn(sdkManager.retryInterruptedTurn);
962
963
  serverMod.setSdkGetPendingApprovals(sdkManager.getPendingApprovals);
@@ -965,6 +966,7 @@ async function runImSdkMode(platformId) {
965
966
  serverMod.setSdkGetContextUsageSnapshot(sdkManager.getContextUsageSnapshot);
966
967
  serverMod.setSdkGetMcpStatusSnapshot(sdkManager.getMcpStatusSnapshot);
967
968
  serverMod.setSdkGetSessionStateSnapshot(sdkManager.getSessionStateSnapshot);
969
+ serverMod.setSdkGetTurnGate(sdkManager.getTurnGate);
968
970
  serverMod.setSdkGetSdkTaskSnapshot(sdkManager.getSdkTaskSnapshot);
969
971
  serverMod.setSdkResolveBoundPrimaryInstanceKey(sdkManager.resolveBoundPrimaryInstanceKey);
970
972
  serverMod.setSdkSendQueuedNow(sdkManager.sendQueuedNow);
@@ -1231,6 +1233,7 @@ async function runSdkMode(extraClaudeArgs = [], cwd, noOpen = false) {
1231
1233
  serverMod.setSdkCancelApproval(sdkManager.cancelApproval);
1232
1234
  serverMod.setSdkAutoCancelApproval(sdkManager.autoCancelApproval);
1233
1235
  serverMod.setSdkSendUserMessage(sdkManager.sendUserMessage);
1236
+ serverMod.setSdkForceSendUserMessage(sdkManager.forceSendUserMessage);
1234
1237
  serverMod.setSdkInterruptTurn(sdkManager.interruptTurn);
1235
1238
  serverMod.setSdkRetryTurn(sdkManager.retryInterruptedTurn);
1236
1239
  serverMod.setSdkGetPendingApprovals(sdkManager.getPendingApprovals);
@@ -1239,6 +1242,7 @@ async function runSdkMode(extraClaudeArgs = [], cwd, noOpen = false) {
1239
1242
  serverMod.setSdkGetContextUsageSnapshot(sdkManager.getContextUsageSnapshot);
1240
1243
  serverMod.setSdkGetMcpStatusSnapshot(sdkManager.getMcpStatusSnapshot);
1241
1244
  serverMod.setSdkGetSessionStateSnapshot(sdkManager.getSessionStateSnapshot);
1245
+ serverMod.setSdkGetTurnGate(sdkManager.getTurnGate);
1242
1246
  serverMod.setSdkGetSdkTaskSnapshot(sdkManager.getSdkTaskSnapshot);
1243
1247
  // WS attach-stamp coherence: the bound cwd's primary instanceKey, used to cohere a
1244
1248
  // bound-project client's `_ccvViewInstance` during the pre-poll hydration window.