cliskill 1.0.8 → 1.1.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.
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  runCli
4
- } from "../chunk-4XDWZXBP.js";
4
+ } from "../chunk-LHS6LLBW.js";
5
5
  import "../chunk-AJENHWD3.js";
6
6
  export {
7
7
  runCli
@@ -132,9 +132,9 @@ var appConfigSchema = z.object({
132
132
  }).default({}),
133
133
  /** Context window — no subscription limits */
134
134
  contextWindow: z.object({
135
- maxTokens: z.number().default(1e6),
136
- compactionThreshold: z.number().default(0.75),
137
- warningThreshold: z.number().default(0.6),
135
+ maxTokens: z.number().default(256e3),
136
+ compactionThreshold: z.number().default(0.65),
137
+ warningThreshold: z.number().default(0.5),
138
138
  strategy: z.enum(["sliding", "compaction", "hybrid"]).default("hybrid")
139
139
  }).default({}),
140
140
  /** Theme configuration for terminal output */
@@ -3187,9 +3187,9 @@ function countLatinChars(text) {
3187
3187
 
3188
3188
  // src/services/context-compaction.ts
3189
3189
  var DEFAULT_CONFIG = {
3190
- maxTokens: 128e3,
3191
- compactionThreshold: 0.8,
3192
- keepRecentMessages: 6
3190
+ maxTokens: 256e3,
3191
+ compactionThreshold: 0.65,
3192
+ keepRecentMessages: 4
3193
3193
  };
3194
3194
  var AUTOCOMPACT_BUFFER_TOKENS = 13e3;
3195
3195
  var MAX_CONSECUTIVE_FAILURES = 3;
@@ -6019,9 +6019,9 @@ var FastModeManager = class {
6019
6019
 
6020
6020
  // src/services/context-window.ts
6021
6021
  var DEFAULT_CONFIG4 = {
6022
- maxTokens: 1e6,
6023
- compactionThreshold: 0.8,
6024
- warningThreshold: 0.6,
6022
+ maxTokens: 256e3,
6023
+ compactionThreshold: 0.65,
6024
+ warningThreshold: 0.5,
6025
6025
  strategy: "hybrid"
6026
6026
  };
6027
6027
  var ContextWindowManager = class {
@@ -6531,12 +6531,33 @@ ${result.summary}` }]
6531
6531
  inputTokens: state.totalInputTokens,
6532
6532
  outputTokens: state.totalOutputTokens
6533
6533
  };
6534
+ const currentContextTokens = parser.usage.inputTokens;
6534
6535
  const budget = checkTokenBudget(
6535
- state.totalInputTokens,
6536
- state.totalOutputTokens,
6536
+ currentContextTokens,
6537
+ 0,
6538
+ // output already included in next turn's input
6537
6539
  contextWindow.getMaxTokens()
6538
6540
  );
6539
6541
  if (budget.shouldBlock) {
6542
+ const compactionInput = state.messages.map((m) => ({
6543
+ role: m.role,
6544
+ content: formatContentBlocks2(m.content)
6545
+ }));
6546
+ try {
6547
+ const compactResult = await compactor.compact(compactionInput, effectiveSystemPrompt);
6548
+ if (compactResult.removedMessages > 0) {
6549
+ const summaryMsg = {
6550
+ role: "user",
6551
+ content: [{ type: "text", text: `[Previous conversation summary]
6552
+ ${compactResult.summary}` }]
6553
+ };
6554
+ const keptStart = state.messages.length - compactResult.keptMessages;
6555
+ state.messages = [summaryMsg, ...state.messages.slice(keptStart)];
6556
+ yield { type: "context_compacted", summary: compactResult.summary, removedCount: compactResult.removedMessages };
6557
+ continue;
6558
+ }
6559
+ } catch {
6560
+ }
6540
6561
  yield {
6541
6562
  type: "error",
6542
6563
  error: new Error(
@@ -7463,7 +7484,11 @@ function InkApp({ model, toolCount, onSubmit, onCancel }) {
7463
7484
  setOutputTokens(event.outputTokens);
7464
7485
  break;
7465
7486
  case "context_compacted":
7466
- setSpinnerLabel(`Compacting context (${event.removedCount} msgs)...`);
7487
+ if (event.removedCount > 0) {
7488
+ setSpinnerLabel(`Context compacted (-${event.removedCount} msgs)`);
7489
+ } else {
7490
+ setSpinnerLabel("Context optimized");
7491
+ }
7467
7492
  break;
7468
7493
  case "loop_complete":
7469
7494
  setInputTokens(event.usage.inputTokens);
@@ -11528,4 +11553,4 @@ export {
11528
11553
  MCPConnectionManager,
11529
11554
  runCli
11530
11555
  };
11531
- //# sourceMappingURL=chunk-4XDWZXBP.js.map
11556
+ //# sourceMappingURL=chunk-LHS6LLBW.js.map