mirror of
https://github.com/bendtherules/opencode-plugin-compaction-prompt.git
synced 2026-08-18 21:52:46 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
658f30e38c | ||
|
|
9f549acfde |
@@ -1,5 +1,9 @@
|
||||
# Changelog
|
||||
|
||||
## 0.3.1
|
||||
|
||||
- Fix the OpenCode `$ARGUMENTS` token in the `plugin-compaction-init` template so it is properly substituted instead of being written into the memory file.
|
||||
|
||||
## 0.3.0
|
||||
|
||||
- Auto-register a `/plugin-compaction-init` slash command that scaffolds the compaction memory file with `## Keep` and `## Discard` sections of classification rules. User-supplied arguments are appended to extend the defaults.
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "opencode-plugin-compaction-prompt",
|
||||
"version": "0.3.0",
|
||||
"version": "0.3.1",
|
||||
"description": "Customize OpenCode's compaction prompt to preserve important context and omit unnecessary details.",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
|
||||
+2
-2
@@ -21,7 +21,7 @@ const initCommandName = "plugin-compaction-init";
|
||||
|
||||
/**
|
||||
* Builds the prompt the auto-registered `/plugin-compaction-init` slash
|
||||
* command sends to the model. `$ARGUMENTS$` is left unsubstituted so
|
||||
* command sends to the model. `$ARGUMENTS` is left unsubstituted so
|
||||
* OpenCode substitutes it at invocation time.
|
||||
*
|
||||
* @param memoryFile Literal path to the memory file, inserted verbatim.
|
||||
@@ -46,7 +46,7 @@ Keep all details related to the keep topics below, and discard everything relate
|
||||
|
||||
- Any other older discussions not mentioned above.
|
||||
|
||||
$ARGUMENTS$
|
||||
$ARGUMENTS
|
||||
`;
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -179,10 +179,10 @@ describe("buildInitCommandTemplate", () => {
|
||||
expect(template).toContain("## Discard\n");
|
||||
});
|
||||
|
||||
test("leaves $ARGUMENTS$ unsubstituted for OpenCode to fill in", () => {
|
||||
test("leaves $ARGUMENTS unsubstituted for OpenCode to fill in", () => {
|
||||
const template = buildInitCommandTemplate(".opencode/compaction.md");
|
||||
|
||||
expect(template.trimEnd().endsWith("$ARGUMENTS$")).toBe(true);
|
||||
expect(template.trimEnd().endsWith("$ARGUMENTS")).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -210,7 +210,7 @@ describe("CompactionPromptPlugin config hook", () => {
|
||||
"## Discard",
|
||||
);
|
||||
expect(cfg.command?.["plugin-compaction-init"].template).toContain(
|
||||
"$ARGUMENTS$",
|
||||
"$ARGUMENTS",
|
||||
);
|
||||
expect(context.logs).toHaveLength(0);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user