@ccx-agent/opencode-ccx 0.6.0 → 0.8.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.
- package/README.md +14 -0
- package/dist/config/schema.d.ts +6 -0
- package/dist/hooks/verification-reminder.d.ts +4 -0
- package/dist/index.js +84 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -340,6 +340,16 @@ Example:
|
|
|
340
340
|
"explore_min_queries": 3,
|
|
341
341
|
"coordinator_enabled": false,
|
|
342
342
|
"allow_subagent_delegation": false,
|
|
343
|
+
"agents": {
|
|
344
|
+
"verification": {
|
|
345
|
+
"model": "anthropic/claude-sonnet-4-5",
|
|
346
|
+
"temperature": 0
|
|
347
|
+
},
|
|
348
|
+
"explore": {
|
|
349
|
+
"model": "openai/gpt-5-mini",
|
|
350
|
+
"temperature": 0.4
|
|
351
|
+
}
|
|
352
|
+
},
|
|
343
353
|
"context_bundle": {
|
|
344
354
|
"enabled": true,
|
|
345
355
|
"include_cwd": true,
|
|
@@ -387,6 +397,10 @@ Example:
|
|
|
387
397
|
| `subagent_orchestration.explore_min_queries` | `number` | `3` | Escalate to `ccx-explore` when directed lookup likely needs more than this query count |
|
|
388
398
|
| `subagent_orchestration.coordinator_enabled` | `boolean` | `false` | Register and advertise `ccx-coordinator` subagent |
|
|
389
399
|
| `subagent_orchestration.allow_subagent_delegation` | `boolean` | `false` | Permit subagents to delegate further. When `false`, runtime recursion guard blocks nested `task` delegation from `ccx-*` subagents unless explicit delegation-approval metadata is present |
|
|
400
|
+
| `subagent_orchestration.agents.<name>.model` | `string` | unset | Override a registered ccx subagent model using OpenCode's `provider/model` format, e.g. `anthropic/claude-sonnet-4-5` |
|
|
401
|
+
| `subagent_orchestration.agents.<name>.variant` | `string` | unset | Default model variant for that subagent when using its configured model |
|
|
402
|
+
| `subagent_orchestration.agents.<name>.temperature` | `number` | unset | Override that subagent's temperature; must be non-negative |
|
|
403
|
+
| `subagent_orchestration.agents.<name>.top_p` | `number` | unset | Override that subagent's top-p sampling value; must be between 0 and 1 |
|
|
390
404
|
| `subagent_orchestration.context_bundle.enabled` | `boolean` | `true` | Inject a shared context bundle (cwd, git snapshot, recently changed files) into `task` tool args before execution |
|
|
391
405
|
| `subagent_orchestration.context_bundle.include_cwd` | `boolean` | `true` | Include the working directory in the injected bundle |
|
|
392
406
|
| `subagent_orchestration.context_bundle.include_git` | `boolean` | `true` | Include the per-session git snapshot in the injected bundle |
|
package/dist/config/schema.d.ts
CHANGED
|
@@ -55,6 +55,12 @@ export declare const configSchema: z.ZodObject<{
|
|
|
55
55
|
explore_min_queries: z.ZodDefault<z.ZodInt>;
|
|
56
56
|
coordinator_enabled: z.ZodDefault<z.ZodBoolean>;
|
|
57
57
|
allow_subagent_delegation: z.ZodDefault<z.ZodBoolean>;
|
|
58
|
+
agents: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
59
|
+
model: z.ZodOptional<z.ZodString>;
|
|
60
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
61
|
+
temperature: z.ZodOptional<z.ZodNumber>;
|
|
62
|
+
top_p: z.ZodOptional<z.ZodNumber>;
|
|
63
|
+
}, z.core.$strip>>>;
|
|
58
64
|
context_bundle: z.ZodDefault<z.ZodObject<{
|
|
59
65
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
60
66
|
include_cwd: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -2,7 +2,11 @@ import type { OhMyCCAgentConfig } from "../config/schema";
|
|
|
2
2
|
export declare function createVerificationReminder(config: OhMyCCAgentConfig): (input: unknown, _output: unknown) => Promise<void>;
|
|
3
3
|
export declare function getVerificationState(sessionID: string): {
|
|
4
4
|
editedFilesCount: number;
|
|
5
|
+
dirtyFilesCount: number;
|
|
5
6
|
verificationTriggered: boolean;
|
|
6
7
|
};
|
|
7
8
|
export declare function listEditedFiles(sessionID: string, limit?: number): string[];
|
|
9
|
+
export declare function listDirtyFiles(sessionID: string, limit?: number): string[];
|
|
10
|
+
export declare function markVerificationStarted(sessionID: string): void;
|
|
11
|
+
export declare function getIncrementalVerificationContext(sessionID: string): string | null;
|
|
8
12
|
export declare function requiresVerification(sessionID: string, minFileEdits: number): boolean;
|
package/dist/index.js
CHANGED
|
@@ -21577,7 +21577,7 @@ function finalize(ctx, schema) {
|
|
|
21577
21577
|
result.$schema = "http://json-schema.org/draft-07/schema#";
|
|
21578
21578
|
} else if (ctx.target === "draft-04") {
|
|
21579
21579
|
result.$schema = "http://json-schema.org/draft-04/schema#";
|
|
21580
|
-
} else if (ctx.target === "openapi-3.0") {}
|
|
21580
|
+
} else if (ctx.target === "openapi-3.0") {}
|
|
21581
21581
|
if (ctx.external?.uri) {
|
|
21582
21582
|
const id = ctx.external.registry.get(schema)?.id;
|
|
21583
21583
|
if (!id)
|
|
@@ -21825,7 +21825,7 @@ var literalProcessor = (schema, ctx, json, _params) => {
|
|
|
21825
21825
|
if (val === undefined) {
|
|
21826
21826
|
if (ctx.unrepresentable === "throw") {
|
|
21827
21827
|
throw new Error("Literal `undefined` cannot be represented in JSON Schema");
|
|
21828
|
-
}
|
|
21828
|
+
}
|
|
21829
21829
|
} else if (typeof val === "bigint") {
|
|
21830
21830
|
if (ctx.unrepresentable === "throw") {
|
|
21831
21831
|
throw new Error("BigInt literals cannot be represented in JSON Schema");
|
|
@@ -24231,10 +24231,17 @@ var sessionWorkflowsSchema = exports_external.object({
|
|
|
24231
24231
|
full_context_command: exports_external.string().min(1).nullable().default(null),
|
|
24232
24232
|
status_command: exports_external.string().min(1).nullable().default(null)
|
|
24233
24233
|
});
|
|
24234
|
+
var subagentModelConfigSchema = exports_external.object({
|
|
24235
|
+
model: exports_external.string().min(1).optional(),
|
|
24236
|
+
variant: exports_external.string().min(1).optional(),
|
|
24237
|
+
temperature: exports_external.number().finite().min(0).optional(),
|
|
24238
|
+
top_p: exports_external.number().finite().min(0).max(1).optional()
|
|
24239
|
+
});
|
|
24234
24240
|
var subagentOrchestrationSchema = exports_external.object({
|
|
24235
24241
|
explore_min_queries: exports_external.int().positive().default(3),
|
|
24236
24242
|
coordinator_enabled: exports_external.boolean().default(false),
|
|
24237
24243
|
allow_subagent_delegation: exports_external.boolean().default(false),
|
|
24244
|
+
agents: exports_external.record(exports_external.string().min(1), subagentModelConfigSchema).default({}),
|
|
24238
24245
|
context_bundle: contextBundleSchema.default({
|
|
24239
24246
|
enabled: true,
|
|
24240
24247
|
include_cwd: true,
|
|
@@ -24302,6 +24309,7 @@ var configSchema = exports_external.object({
|
|
|
24302
24309
|
explore_min_queries: 3,
|
|
24303
24310
|
coordinator_enabled: false,
|
|
24304
24311
|
allow_subagent_delegation: false,
|
|
24312
|
+
agents: {},
|
|
24305
24313
|
context_bundle: {
|
|
24306
24314
|
enabled: true,
|
|
24307
24315
|
include_cwd: true,
|
|
@@ -25002,6 +25010,8 @@ Execute verification directly in this session. Delegate again only when the call
|
|
|
25002
25010
|
=== WHAT YOU RECEIVE ===
|
|
25003
25011
|
You will be given: the original task specification, the list of changed files, the implementation approach, and optionally a path to a plan or spec document.
|
|
25004
25012
|
|
|
25013
|
+
You may also receive an "Incremental Verification Context" with dirty files and previous verification baselines from this session. Treat it as a cache hint, not proof. Prefer targeted verification of dirty files and their affected dependencies. Re-run full build/test/lint only when the dirty set includes broad-impact files such as dependency manifests, lockfiles, build config, shared test config, public API barrels, schemas, migrations, or infrastructure config; when the previous baseline was FAIL/PARTIAL; or when impact cannot be bounded.
|
|
25014
|
+
|
|
25005
25015
|
=== VERIFICATION STRATEGY ===
|
|
25006
25016
|
Tailor your approach to the nature of the changes:
|
|
25007
25017
|
|
|
@@ -25019,10 +25029,11 @@ Tailor your approach to the nature of the changes:
|
|
|
25019
25029
|
|
|
25020
25030
|
=== REQUIRED STEPS (universal baseline) ===
|
|
25021
25031
|
1. Read the project's CLAUDE.md / README to discover build commands, test commands, and conventions. Inspect package.json / Makefile / pyproject.toml for available scripts. If the implementer referenced a plan or specification document, read it \u2014 that defines the success criteria.
|
|
25022
|
-
2.
|
|
25023
|
-
3. Execute the
|
|
25024
|
-
4.
|
|
25025
|
-
5.
|
|
25032
|
+
2. Determine whether verification can be incremental. If the Incremental Verification Context shows only localized dirty files, choose the narrowest build/test/typecheck/lint commands that exercise those files and their dependents. If risk cannot be bounded, use the full commands.
|
|
25033
|
+
3. Execute the selected build or typecheck command when applicable. A relevant build/typecheck failure is an immediate FAIL.
|
|
25034
|
+
4. Execute the selected test suite or targeted tests when they exist. Relevant test failures are an immediate FAIL.
|
|
25035
|
+
5. Run configured linters only for affected files when the tooling supports it; otherwise run the full linter only for broad-impact changes.
|
|
25036
|
+
6. Inspect related code for regressions.
|
|
25026
25037
|
|
|
25027
25038
|
After the baseline, apply the type-specific strategy from above. Scale your thoroughness to match the stakes: a disposable utility script does not require concurrency analysis; production payment processing demands exhaustive coverage.
|
|
25028
25039
|
|
|
@@ -25057,6 +25068,8 @@ You discovered something that appears broken. Before declaring FAIL, ensure you
|
|
|
25057
25068
|
Do not abuse these as reasons to dismiss genuine problems \u2014 but equally, do not FAIL on behavior that was deliberately chosen.
|
|
25058
25069
|
|
|
25059
25070
|
=== OUTPUT FORMAT (REQUIRED) ===
|
|
25071
|
+
Start with one short line: "+ Scope: incremental" or "+ Scope: full", followed by the reason.
|
|
25072
|
+
|
|
25060
25073
|
Every individual check MUST use this structure. Any check missing a Command run block is not a PASS \u2014 it is a skip.
|
|
25061
25074
|
|
|
25062
25075
|
\`\`\`
|
|
@@ -25305,6 +25318,12 @@ function buildToolRestrictions(def) {
|
|
|
25305
25318
|
}
|
|
25306
25319
|
return tools;
|
|
25307
25320
|
}
|
|
25321
|
+
function buildSubagentModelSettings(config2, def) {
|
|
25322
|
+
const settings = config2.subagent_orchestration.agents[def.name];
|
|
25323
|
+
if (!settings)
|
|
25324
|
+
return {};
|
|
25325
|
+
return Object.fromEntries(Object.entries(settings).filter(([, value]) => value !== undefined));
|
|
25326
|
+
}
|
|
25308
25327
|
function buildSubagentGuidance(config2) {
|
|
25309
25328
|
const exploreMinQueries = config2.subagent_orchestration.explore_min_queries;
|
|
25310
25329
|
const spotCheckMinCommands = config2.verification.spot_check_min_commands;
|
|
@@ -25399,7 +25418,8 @@ function createConfigHook(config2, directory) {
|
|
|
25399
25418
|
description: def.description,
|
|
25400
25419
|
mode: "subagent",
|
|
25401
25420
|
prompt: def.getSystemPrompt(),
|
|
25402
|
-
tools: buildToolRestrictions(def)
|
|
25421
|
+
tools: buildToolRestrictions(def),
|
|
25422
|
+
...buildSubagentModelSettings(config2, def)
|
|
25403
25423
|
};
|
|
25404
25424
|
}
|
|
25405
25425
|
input.agent = {
|
|
@@ -25535,6 +25555,8 @@ function getSessionState(sessionID) {
|
|
|
25535
25555
|
}
|
|
25536
25556
|
const created = {
|
|
25537
25557
|
editedFiles: new Set,
|
|
25558
|
+
dirtyFiles: new Set,
|
|
25559
|
+
verificationBaselines: [],
|
|
25538
25560
|
verificationTriggered: false
|
|
25539
25561
|
};
|
|
25540
25562
|
sessionStateById.set(sessionID, created);
|
|
@@ -25562,7 +25584,7 @@ function createVerificationReminder(config2) {
|
|
|
25562
25584
|
const subagentType = typeof rawArgs.subagent_type === "string" ? rawArgs.subagent_type.toLowerCase() : typeof rawArgs.subagentType === "string" ? rawArgs.subagentType.toLowerCase() : "";
|
|
25563
25585
|
const verificationSubagent = `${config2.agent_name}-verification`;
|
|
25564
25586
|
if (subagentType === verificationSubagent || subagentType === "verification") {
|
|
25565
|
-
|
|
25587
|
+
markVerificationStarted(sessionID);
|
|
25566
25588
|
}
|
|
25567
25589
|
return;
|
|
25568
25590
|
}
|
|
@@ -25575,12 +25597,14 @@ function createVerificationReminder(config2) {
|
|
|
25575
25597
|
}
|
|
25576
25598
|
const state = getSessionState(sessionID);
|
|
25577
25599
|
state.editedFiles.add(filePath);
|
|
25600
|
+
state.dirtyFiles.add(filePath);
|
|
25578
25601
|
};
|
|
25579
25602
|
}
|
|
25580
25603
|
function getVerificationState(sessionID) {
|
|
25581
25604
|
const state = getSessionState(sessionID);
|
|
25582
25605
|
return {
|
|
25583
25606
|
editedFilesCount: state.editedFiles.size,
|
|
25607
|
+
dirtyFilesCount: state.dirtyFiles.size,
|
|
25584
25608
|
verificationTriggered: state.verificationTriggered
|
|
25585
25609
|
};
|
|
25586
25610
|
}
|
|
@@ -25588,6 +25612,45 @@ function listEditedFiles(sessionID, limit = 20) {
|
|
|
25588
25612
|
const state = getSessionState(sessionID);
|
|
25589
25613
|
return [...state.editedFiles].slice(-limit);
|
|
25590
25614
|
}
|
|
25615
|
+
function markVerificationStarted(sessionID) {
|
|
25616
|
+
const state = getSessionState(sessionID);
|
|
25617
|
+
state.verificationTriggered = true;
|
|
25618
|
+
const files = [...state.dirtyFiles];
|
|
25619
|
+
if (files.length === 0)
|
|
25620
|
+
return;
|
|
25621
|
+
state.verificationBaselines.push({
|
|
25622
|
+
files,
|
|
25623
|
+
createdAt: Date.now()
|
|
25624
|
+
});
|
|
25625
|
+
state.dirtyFiles.clear();
|
|
25626
|
+
if (state.verificationBaselines.length > 5) {
|
|
25627
|
+
state.verificationBaselines = state.verificationBaselines.slice(-5);
|
|
25628
|
+
}
|
|
25629
|
+
}
|
|
25630
|
+
function getIncrementalVerificationContext(sessionID) {
|
|
25631
|
+
const state = getSessionState(sessionID);
|
|
25632
|
+
const dirtyFiles = [...state.dirtyFiles];
|
|
25633
|
+
const previousBaselines = state.verificationBaselines.slice(-3);
|
|
25634
|
+
if (dirtyFiles.length === 0 && previousBaselines.length === 0)
|
|
25635
|
+
return null;
|
|
25636
|
+
const lines = [
|
|
25637
|
+
"# Incremental Verification Context",
|
|
25638
|
+
"Use this to avoid rerunning unrelated full verification. Reuse previous conclusions only when the affected files and commands are unchanged; run fresh checks for dirty files and their dependencies."
|
|
25639
|
+
];
|
|
25640
|
+
if (dirtyFiles.length > 0) {
|
|
25641
|
+
lines.push("", `Dirty files since last verification (${dirtyFiles.length}):`, ...dirtyFiles.map((file2) => `- ${file2}`));
|
|
25642
|
+
} else {
|
|
25643
|
+
lines.push("", "Dirty files since last verification: none tracked.");
|
|
25644
|
+
}
|
|
25645
|
+
if (previousBaselines.length > 0) {
|
|
25646
|
+
lines.push("", "Previous verification baselines in this session:");
|
|
25647
|
+
for (const baseline of previousBaselines) {
|
|
25648
|
+
lines.push(`- ${new Date(baseline.createdAt).toISOString()}: ${baseline.files.join(", ")}`);
|
|
25649
|
+
}
|
|
25650
|
+
}
|
|
25651
|
+
return lines.join(`
|
|
25652
|
+
`);
|
|
25653
|
+
}
|
|
25591
25654
|
function requiresVerification(sessionID, minFileEdits) {
|
|
25592
25655
|
const state = getSessionState(sessionID);
|
|
25593
25656
|
return state.editedFiles.size >= minFileEdits && !state.verificationTriggered;
|
|
@@ -25732,6 +25795,10 @@ function formatSessionEditedFiles(sessionID, limit) {
|
|
|
25732
25795
|
Files edited in this session (${files.length} total): ${files.join(", ")}`;
|
|
25733
25796
|
return header;
|
|
25734
25797
|
}
|
|
25798
|
+
function getSubagentType(args2) {
|
|
25799
|
+
const raw = typeof args2.subagent_type === "string" ? args2.subagent_type : typeof args2.subagentType === "string" ? args2.subagentType : "";
|
|
25800
|
+
return raw.toLowerCase();
|
|
25801
|
+
}
|
|
25735
25802
|
function createContextBundleHook(args2) {
|
|
25736
25803
|
const { config: config2, directory } = args2;
|
|
25737
25804
|
return async (input, output) => {
|
|
@@ -25776,6 +25843,15 @@ ${recent}`);
|
|
|
25776
25843
|
if (editedSummary) {
|
|
25777
25844
|
bundleParts.push(editedSummary);
|
|
25778
25845
|
}
|
|
25846
|
+
const verificationSubagent = `${config2.agent_name}-verification`;
|
|
25847
|
+
const subagentType = getSubagentType(output.args);
|
|
25848
|
+
const isVerificationTask = subagentType === verificationSubagent || subagentType === "verification";
|
|
25849
|
+
if (sessionID && isVerificationTask) {
|
|
25850
|
+
const incrementalContext = getIncrementalVerificationContext(sessionID);
|
|
25851
|
+
if (incrementalContext) {
|
|
25852
|
+
bundleParts.push(incrementalContext);
|
|
25853
|
+
}
|
|
25854
|
+
}
|
|
25779
25855
|
if (bundleParts.length === 0)
|
|
25780
25856
|
return;
|
|
25781
25857
|
const bundle = [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ccx-agent/opencode-ccx",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
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",
|