@ccx-agent/opencode-ccx 0.2.6 → 0.2.8
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.
- package/README.md +4 -5
- package/dist/hooks/chat-params.d.ts +2 -1
- package/dist/hooks/verification-reminder.d.ts +1 -1
- package/dist/index.js +13 -39
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -90,7 +90,7 @@ graph TD
|
|
|
90
90
|
User([User Request]) --> OP[OpenCode Agent Loop]
|
|
91
91
|
|
|
92
92
|
subgraph ccx Plugin
|
|
93
|
-
H1[chat.message] -.->|
|
|
93
|
+
H1[chat.message] -.->|Track File Edits| OP
|
|
94
94
|
H2[chat.system.transform] -.->|Load CLAUDE.md & Context| OP
|
|
95
95
|
H3[chat.params] -.->|Agent-specific Temp/TopP| OP
|
|
96
96
|
|
|
@@ -102,7 +102,7 @@ graph TD
|
|
|
102
102
|
ToolCall -->|Execute| Exec[Run Tool]
|
|
103
103
|
|
|
104
104
|
Exec -->|After| H5[tool.execute.after]
|
|
105
|
-
H5 -.->|Track Edits
|
|
105
|
+
H5 -.->|Track Edits| OP
|
|
106
106
|
|
|
107
107
|
OP -->|Context Full| H6[session.compacting]
|
|
108
108
|
H6 -.->|Preserve Plan & Verdict| OP
|
|
@@ -149,7 +149,7 @@ ccx uses every major hook point in the OpenCode plugin API to dynamically shape
|
|
|
149
149
|
|
|
150
150
|
| Hook | What it does |
|
|
151
151
|
|------|-------------|
|
|
152
|
-
| **chat.message** |
|
|
152
|
+
| **chat.message** | Tracks file edits across the session for verification threshold detection |
|
|
153
153
|
| **chat.params** | Tunes temperature/topP per agent — low for plan/verification (precision), higher for explore (creativity) |
|
|
154
154
|
| **experimental.chat.system.transform** | Dynamically injects project instructions (CLAUDE.md), session context (edited files list), and verification reminders into the system prompt |
|
|
155
155
|
| **tool.definition** | Appends safety rules to bash/edit/write tool descriptions, usage hints to glob/grep/read |
|
|
@@ -175,9 +175,8 @@ ccx was built by studying Claude Code's prompt architecture and adapting its cor
|
|
|
175
175
|
|--------------------|--------------------|
|
|
176
176
|
| 8-section system prompt | 8 composable prompt sections, near-identical content |
|
|
177
177
|
| 5 subagent types (explore, plan, verify, general, coordinator) | Same 5 agents with equivalent prompts |
|
|
178
|
-
| Verification contract (3+ file edits → mandatory review) | Dynamic system prompt injection
|
|
178
|
+
| Verification contract (3+ file edits → mandatory review) | Dynamic system prompt injection |
|
|
179
179
|
| VERDICT protocol (PASS/FAIL/PARTIAL) | Identical format and adversarial strategies |
|
|
180
|
-
| Per-turn `<system-reminder>` attachments | `chat.message` hook injects context each turn |
|
|
181
180
|
| Project instructions (CLAUDE.md) | Auto-loaded from CLAUDE.md / .claude/instructions.md / AGENTS.md |
|
|
182
181
|
| Tool safety hints | `tool.definition` hook appends rules to bash/edit/write descriptions |
|
|
183
182
|
| Context compaction preservation | Custom compaction prompt via `experimental.session.compacting` |
|
|
@@ -11,8 +11,9 @@ type ChatParamsInput = {
|
|
|
11
11
|
type ChatParamsOutput = {
|
|
12
12
|
temperature: number;
|
|
13
13
|
topP: number;
|
|
14
|
+
top_p?: number;
|
|
14
15
|
topK: number;
|
|
15
16
|
options: Record<string, unknown>;
|
|
16
17
|
};
|
|
17
|
-
export declare function createChatParamsHook(): (
|
|
18
|
+
export declare function createChatParamsHook(): (_input: ChatParamsInput, output: ChatParamsOutput) => Promise<void>;
|
|
18
19
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { OhMyCCAgentConfig } from "../config/schema";
|
|
2
|
-
export declare function createVerificationReminder(config: OhMyCCAgentConfig): (input: unknown,
|
|
2
|
+
export declare function createVerificationReminder(config: OhMyCCAgentConfig): (input: unknown, _output: unknown) => Promise<void>;
|
package/dist/index.js
CHANGED
|
@@ -13554,7 +13554,7 @@ config(en_default());
|
|
|
13554
13554
|
// src/config/schema.ts
|
|
13555
13555
|
var verificationSchema = exports_external.object({
|
|
13556
13556
|
auto_remind: exports_external.boolean().default(true),
|
|
13557
|
-
min_file_edits: exports_external.int().nonnegative().default(
|
|
13557
|
+
min_file_edits: exports_external.int().nonnegative().default(3)
|
|
13558
13558
|
});
|
|
13559
13559
|
var configSchema = exports_external.object({
|
|
13560
13560
|
enabled: exports_external.boolean().default(true),
|
|
@@ -13563,7 +13563,7 @@ var configSchema = exports_external.object({
|
|
|
13563
13563
|
output_style: exports_external.string().min(1).nullable().default(null),
|
|
13564
13564
|
verification: verificationSchema.default({
|
|
13565
13565
|
auto_remind: true,
|
|
13566
|
-
min_file_edits:
|
|
13566
|
+
min_file_edits: 3
|
|
13567
13567
|
})
|
|
13568
13568
|
});
|
|
13569
13569
|
|
|
@@ -13734,24 +13734,16 @@ function createChatMessageHook(_config) {
|
|
|
13734
13734
|
}
|
|
13735
13735
|
|
|
13736
13736
|
// src/hooks/chat-params.ts
|
|
13737
|
-
var AGENT_PARAMS = {
|
|
13738
|
-
"ccx-plan": { temperature: 0.3 },
|
|
13739
|
-
"ccx-verification": { temperature: 0.2 },
|
|
13740
|
-
"ccx-explore": { temperature: 0.5 },
|
|
13741
|
-
"ccx-coordinator": { temperature: 0.4 },
|
|
13742
|
-
"ccx-general-purpose": { temperature: 0.5 }
|
|
13743
|
-
};
|
|
13744
13737
|
function createChatParamsHook() {
|
|
13745
|
-
return async (
|
|
13746
|
-
const
|
|
13747
|
-
|
|
13748
|
-
|
|
13749
|
-
|
|
13750
|
-
|
|
13751
|
-
|
|
13752
|
-
|
|
13753
|
-
|
|
13754
|
-
output.topK = agentParams.topK;
|
|
13738
|
+
return async (_input, output) => {
|
|
13739
|
+
const out = output;
|
|
13740
|
+
const hasTemperature = out.temperature !== undefined;
|
|
13741
|
+
const hasTopP = out.topP !== undefined || out.top_p !== undefined;
|
|
13742
|
+
const hasBoth = hasTemperature && hasTopP;
|
|
13743
|
+
if (hasBoth) {
|
|
13744
|
+
delete out.topP;
|
|
13745
|
+
delete out.top_p;
|
|
13746
|
+
}
|
|
13755
13747
|
};
|
|
13756
13748
|
}
|
|
13757
13749
|
|
|
@@ -14742,8 +14734,7 @@ function getSessionState(sessionID) {
|
|
|
14742
14734
|
return existing;
|
|
14743
14735
|
}
|
|
14744
14736
|
const created = {
|
|
14745
|
-
editedFiles: new Set
|
|
14746
|
-
reminded: false
|
|
14737
|
+
editedFiles: new Set
|
|
14747
14738
|
};
|
|
14748
14739
|
sessionStateById.set(sessionID, created);
|
|
14749
14740
|
return created;
|
|
@@ -14755,20 +14746,8 @@ function getFilePath(value) {
|
|
|
14755
14746
|
const candidates = [value.filePath, value.path, value.filename];
|
|
14756
14747
|
return candidates.find((candidate) => typeof candidate === "string");
|
|
14757
14748
|
}
|
|
14758
|
-
function appendReminder(output, message) {
|
|
14759
|
-
if (!isRecord3(output)) {
|
|
14760
|
-
return;
|
|
14761
|
-
}
|
|
14762
|
-
const existingOutput = typeof output.output === "string" ? output.output : "";
|
|
14763
|
-
output.output = existingOutput ? `${existingOutput}
|
|
14764
|
-
|
|
14765
|
-
${message}` : message;
|
|
14766
|
-
const metadata = isRecord3(output.metadata) ? output.metadata : {};
|
|
14767
|
-
metadata.verificationReminder = { message };
|
|
14768
|
-
output.metadata = metadata;
|
|
14769
|
-
}
|
|
14770
14749
|
function createVerificationReminder(config2) {
|
|
14771
|
-
return async (input,
|
|
14750
|
+
return async (input, _output) => {
|
|
14772
14751
|
if (!config2.verification.auto_remind || !isRecord3(input)) {
|
|
14773
14752
|
return;
|
|
14774
14753
|
}
|
|
@@ -14783,11 +14762,6 @@ function createVerificationReminder(config2) {
|
|
|
14783
14762
|
}
|
|
14784
14763
|
const state = getSessionState(sessionID);
|
|
14785
14764
|
state.editedFiles.add(filePath);
|
|
14786
|
-
if (state.reminded || state.editedFiles.size < config2.verification.min_file_edits) {
|
|
14787
|
-
return;
|
|
14788
|
-
}
|
|
14789
|
-
state.reminded = true;
|
|
14790
|
-
appendReminder(output, `You have edited ${state.editedFiles.size} files. Consider running verification before reporting completion.`);
|
|
14791
14765
|
};
|
|
14792
14766
|
}
|
|
14793
14767
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ccx-agent/opencode-ccx",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.8",
|
|
4
4
|
"description": "Production-grade prompt engineering for OpenCode — disciplined coding, risk-aware actions, adversarial verification",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|