opencode-completion-gate 1.3.1 → 2.0.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/CHANGELOG.md +11 -0
- package/README.md +4 -2
- package/dist/gate.d.ts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +545 -31
- package/dist/plugin.js +302 -221
- package/dist/types.d.ts +22 -3
- package/package.json +4 -5
package/dist/types.d.ts
CHANGED
|
@@ -91,10 +91,29 @@ export interface TerminalBuildFailure {
|
|
|
91
91
|
taskName?: string;
|
|
92
92
|
previewErrors: string[];
|
|
93
93
|
}
|
|
94
|
+
/**
|
|
95
|
+
* V2-shaped reviewer-session client. The concrete implementation is built from
|
|
96
|
+
* the OpenCode V2 plugin `Context` in `gate.ts`; the abstraction stays narrow so
|
|
97
|
+
* `runReviewAssertion` remains unit-testable without a live server.
|
|
98
|
+
*/
|
|
94
99
|
export interface ReviewSessionClient {
|
|
95
100
|
session: {
|
|
96
|
-
create(
|
|
97
|
-
|
|
98
|
-
|
|
101
|
+
create(input?: {
|
|
102
|
+
directory?: string;
|
|
103
|
+
}): Promise<{
|
|
104
|
+
id?: string;
|
|
105
|
+
}>;
|
|
106
|
+
prompt(input: {
|
|
107
|
+
sessionID: string;
|
|
108
|
+
text: string;
|
|
109
|
+
agent?: string;
|
|
110
|
+
}): Promise<void>;
|
|
111
|
+
/** Concatenated assistant text produced in the session so far. */
|
|
112
|
+
context(input: {
|
|
113
|
+
sessionID: string;
|
|
114
|
+
}): Promise<string>;
|
|
115
|
+
abort?(input: {
|
|
116
|
+
sessionID: string;
|
|
117
|
+
}): Promise<void>;
|
|
99
118
|
};
|
|
100
119
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-completion-gate",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "OpenCode plugin: per-session quality gate that blocks declaring done until configured assertions pass",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/plugin.js",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
},
|
|
18
18
|
"scripts": {
|
|
19
19
|
"build": "npm run build:bundle && npm run build:types",
|
|
20
|
-
"build:bundle": "esbuild src/plugin.ts --bundle --platform=node --format=esm --outfile=dist/plugin.js --external:fs --external:path --external:os --external:child_process --external:@opencode
|
|
20
|
+
"build:bundle": "esbuild src/plugin.ts --bundle --platform=node --format=esm --outfile=dist/plugin.js --external:fs --external:path --external:os --external:child_process --external:@opencode/plugin && esbuild src/index.ts --bundle --platform=node --format=esm --outfile=dist/index.js --external:fs --external:path --external:os --external:child_process --external:@opencode/plugin",
|
|
21
21
|
"build:types": "tsc --emitDeclarationOnly --declaration --outDir dist",
|
|
22
22
|
"test": "vitest run",
|
|
23
23
|
"test:watch": "vitest",
|
|
@@ -60,12 +60,11 @@
|
|
|
60
60
|
"provenance": true
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
|
-
"@opencode
|
|
63
|
+
"@opencode/plugin": ">=2.0.0"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"@eslint/js": "^9.17.0",
|
|
67
|
-
"@opencode
|
|
68
|
-
"@opencode-ai/sdk": "^1.0.223",
|
|
67
|
+
"@opencode/plugin": "^2.0.29",
|
|
69
68
|
"@types/node": "^20.10.0",
|
|
70
69
|
"@vitest/coverage-v8": "^1.0.0",
|
|
71
70
|
"esbuild": "^0.27.2",
|