opencode-acp 1.2.0 → 1.3.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 +1 @@
1
- {"version":3,"file":"inject.d.ts","sourceRoot":"","sources":["../../../../lib/messages/inject/inject.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAC1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAEzD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAmDzD,eAAO,MAAM,oBAAoB,GAC7B,OAAO,YAAY,EACnB,QAAQ,YAAY,EACpB,QAAQ,MAAM,EACd,UAAU,SAAS,EAAE,EACrB,SAAS,cAAc,EACvB,wBAAwB,sBAAsB,KAC/C,IAoHF,CAAA;AAmDD,eAAO,MAAM,gBAAgB,GACzB,OAAO,YAAY,EACnB,QAAQ,YAAY,EACpB,UAAU,SAAS,EAAE,EACrB,wBAAwB,sBAAsB,KAC/C,IAiEF,CAAA"}
1
+ {"version":3,"file":"inject.d.ts","sourceRoot":"","sources":["../../../../lib/messages/inject/inject.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAC1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAEzD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAoDzD,eAAO,MAAM,oBAAoB,GAC7B,OAAO,YAAY,EACnB,QAAQ,YAAY,EACpB,QAAQ,MAAM,EACd,UAAU,SAAS,EAAE,EACrB,SAAS,cAAc,EACvB,wBAAwB,sBAAsB,KAC/C,IAoHF,CAAA;AA+CD,eAAO,MAAM,gBAAgB,GACzB,OAAO,YAAY,EACnB,QAAQ,YAAY,EACpB,UAAU,SAAS,EAAE,EACrB,wBAAwB,sBAAsB,KAC/C,IAiEF,CAAA"}
@@ -28,6 +28,11 @@ export declare function isContextOverLimits(config: PluginConfig, state: Session
28
28
  modelContextLimit: number | undefined;
29
29
  };
30
30
  export declare function addAnchor(anchorMessageIds: Set<string>, anchorMessageId: string, anchorMessageIndex: number, messages: WithParts[], interval: number): boolean;
31
+ /**
32
+ * Build tiered context usage guidance based on actual config thresholds.
33
+ * Shared by inject.ts (suffix message) and utils.ts (anchored nudges).
34
+ */
35
+ export declare function buildContextUsageGuidance(config: PluginConfig, currentTokens?: number, modelContextLimit?: number): string;
31
36
  export declare function applyAnchoredNudges(state: SessionState, config: PluginConfig, messages: WithParts[], prompts: RuntimePrompts, compressionPriorities?: CompressionPriorityMap, currentTokens?: number, modelContextLimit?: number, suffixMessage?: WithParts | null): void;
32
37
  export {};
33
38
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../lib/messages/inject/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAMhD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAEzD,OAAO,EACH,KAAK,sBAAsB,EAG9B,MAAM,aAAa,CAAA;AAapB,MAAM,WAAW,oBAAoB;IACjC,UAAU,EAAE,MAAM,GAAG,SAAS,CAAA;IAC9B,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;CAC9B;AAED,MAAM,WAAW,qBAAqB;IAClC,OAAO,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,EAAE,YAAY,EACpB,KAAK,EAAE,YAAY,EACnB,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,QAAQ,EAAE,SAAS,EAAE;;;;;EA6CxB;AAED,wBAAgB,SAAS,CACrB,gBAAgB,EAAE,GAAG,CAAC,MAAM,CAAC,EAC7B,eAAe,EAAE,MAAM,EACvB,kBAAkB,EAAE,MAAM,EAC1B,QAAQ,EAAE,SAAS,EAAE,EACrB,QAAQ,EAAE,MAAM,GACjB,OAAO,CAsBT;AAmJD;;;GAGG;AACH,wBAAgB,yBAAyB,CACrC,MAAM,EAAE,YAAY,EACpB,aAAa,CAAC,EAAE,MAAM,EACtB,iBAAiB,CAAC,EAAE,MAAM,GAC3B,MAAM,CAwBR;AAED,wBAAgB,mBAAmB,CAC/B,KAAK,EAAE,YAAY,EACnB,MAAM,EAAE,YAAY,EACpB,QAAQ,EAAE,SAAS,EAAE,EACrB,OAAO,EAAE,cAAc,EACvB,qBAAqB,CAAC,EAAE,sBAAsB,EAC9C,aAAa,CAAC,EAAE,MAAM,EACtB,iBAAiB,CAAC,EAAE,MAAM,EAC1B,aAAa,CAAC,EAAE,SAAS,GAAG,IAAI,GACjC,IAAI,CAsFN"}
@@ -1,2 +1,2 @@
1
- export declare const SYSTEM = "\nYou operate in a context-constrained environment. Manage context continuously to avoid buildup and preserve retrieval quality. Efficient context management is paramount for your agentic performance.\n\nThe tools you have for context management are `compress` and `decompress`. `compress` replaces older conversation content with technical summaries you produce. `decompress` restores previously compressed content when you need exact details.\n\n`<dcp-message-id>` and `<dcp-system-reminder>` tags are environment-injected metadata. Do not output them.\n\nTHE PHILOSOPHY OF COMPRESS\n`compress` transforms conversation content into dense, high-fidelity summaries. This is not cleanup - it is crystallization. Your summary becomes the authoritative record of what transpired.\n\nThink of compression as phase transitions: raw exploration becomes refined understanding. The original context served its purpose; your summary now carries that understanding forward.\n\nCOMPRESS WHEN\n\nA section is genuinely closed and the raw conversation has served its purpose:\n\n- Research concluded and findings are clear\n- Implementation finished and verified\n- Exploration exhausted and patterns understood\n- Dead-end noise can be discarded without waiting for a whole chapter to close\n\nDO NOT COMPRESS IF\n\n- Raw context is still relevant and needed for edits or precise references\n- The target content is still actively in progress\n- You may need exact code, error messages, or file contents in the immediate next steps\n\nBefore compressing, ask: _\"Is this section closed enough to become summary-only right now?\"_\n\nEvaluate conversation signal-to-noise REGULARLY. Use `compress` deliberately with quality-first summaries. Prioritize stale content intelligently to maintain a high-signal context window that supports your agency.\n\nIt is of your responsibility to keep a sharp, high-quality context window for optimal performance.\n";
1
+ export declare const SYSTEM = "\n\nYou operate in a context-constrained environment. Context management helps preserve retrieval quality, but your primary goal is completing the task at hand. Do not let context management distract from the actual work.\n\nThe tools you have for context management are `compress` and `decompress`. `compress` replaces older conversation content with technical summaries you produce. `decompress` restores previously compressed content when you need exact details.\n\n`<dcp-message-id>` and `<dcp-system-reminder>` tags are environment-injected metadata. Do not output them.\n\nCOMPRESSION PHILOSOPHY\n\nCompression replaces raw conversation content with dense summaries. When used correctly, it keeps your context sharp and focused. When used carelessly, it destroys information you need.\n\nThe key principle: compress based on context pressure, not habit. When context is ample, compress rarely or not at all. When context is tight, compress aggressively but selectively. The runtime context usage indicator tells you the current pressure level.\n\nCONTEXT PRESSURE LEVELS\n\n- Ample: Context is well below the threshold. Do NOT compress unless there is obvious waste (huge terminal dumps, duplicated content). Focus entirely on your task.\n- Moderate: Context is approaching the threshold. Compress completed sections proactively. Prioritize high-token waste over minor cleanup.\n- High: Context has exceeded the threshold. Compress aggressively. Every compression should free meaningful tokens. Preserve only what is essential for the current task.\n\nWHAT TO COMPRESS FIRST (high value, low risk)\n\n- Verbose terminal/bash command output (build logs, test output, directory listings)\n- Exploration that led nowhere (failed approaches, dead-end searches)\n- Redundant tool results (reading the same file multiple times, repeated status checks)\n- Intermediate steps of completed multi-step tasks\n- Large file contents that have already been used and are no longer needed\n\nWHAT TO COMPRESS CAREFULLY (high risk - verify before compressing)\n\n- Temporary secrets/keys/tokens needed later: Do NOT compress unless recorded elsewhere\n- File paths and directory structures: Keep in summary - losing these wastes tokens rediscovering them\n- Key function/method signatures and APIs: Summarize with exact names and signatures\n- Critical error messages and stack traces: Keep the error type and key detail in summary\n- User preferences and requirements: These must survive compression intact\n- Architectural decisions and rationale: Summarize the decision, not just the conclusion\n\nBEFORE COMPRESSING IMPORTANT CONTENT\n\nVerify the information is persisted in one of:\n- A file you have written or edited\n- An issue, PR, or devlog entry\n- The compression summary itself (include the critical bits explicitly)\n\nIf it is not persisted anywhere, either persist it first or include it explicitly in your compression summary.\n\nAFTER COMPRESSING\n\nGenerate recovery breadcrumbs in your summary so future-you can reconstruct the context:\n- Reference specific files by path\n- Include key variable names, function signatures, or configuration values\n- Note what was decided and why, not just what was done\n- Example: \"Implemented auth check in src/middleware.ts using validateToken() from auth.ts - user table is users not user\"\n\nIf you later realize you need the original details from a compressed block, use `decompress` to restore them. You can decompress, read the content, then re-compress if needed.\n\nUse `compress` and `decompress` deliberately with quality-first summaries. Prioritize stale content intelligently to maintain a high-signal context window.\n";
2
2
  //# sourceMappingURL=system.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"system.d.ts","sourceRoot":"","sources":["../../../lib/prompts/system.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM,u5DAgClB,CAAA"}
1
+ {"version":3,"file":"system.d.ts","sourceRoot":"","sources":["../../../lib/prompts/system.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM,umHAyDlB,CAAA"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "opencode-acp",
4
- "version": "1.2.0",
4
+ "version": "1.3.0",
5
5
  "type": "module",
6
6
  "description": "Active Context Pruning — model-driven context management for OpenCode (hardened fork of DCP with 34 bug fixes)",
7
7
  "main": "./dist/index.js",