opencode-codegraph 0.1.18 → 0.1.19
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 +4 -0
- package/README.md +1 -0
- package/package.json +1 -1
- package/src/index.ts +22 -0
- package/src/util.ts +6 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.19 - 2026-03-20
|
|
4
|
+
|
|
5
|
+
- add workflow guidance directly to `git status` and `git diff` command output inside OpenCode
|
|
6
|
+
|
|
3
7
|
## 0.1.18 - 2026-03-20
|
|
4
8
|
|
|
5
9
|
- make after-test guidance test-result aware so failing test runs explicitly block review/push guidance until failures are fixed
|
package/README.md
CHANGED
|
@@ -115,6 +115,7 @@ Place in `.opencode/commands/`:
|
|
|
115
115
|
| `chat.message` (edit intent) | Add pre-edit warnings for files likely to be modified |
|
|
116
116
|
| `chat.message` (workflow intent) | Add dogfooding status when the user asks what to do next |
|
|
117
117
|
| `tool.execute.after` on test commands | Add after-test workflow guidance and detect failed test runs before suggesting the next command |
|
|
118
|
+
| `tool.execute.after` on `git status` / `git diff` | Add current workflow guidance directly to common git inspection commands |
|
|
118
119
|
| `tool.execute.after` | Trigger CPG update after git commit and append structured post-commit review summary |
|
|
119
120
|
| `experimental.session.compacting` | Preserve current dogfooding status when OpenCode compacts long sessions |
|
|
120
121
|
| `command.execute.before` | Inject current dogfooding status into `/review`, `/audit`, `/update`, `/status`, and `/next` |
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -24,6 +24,7 @@ import {
|
|
|
24
24
|
formatReviewTraceSummary,
|
|
25
25
|
getHeadCommit,
|
|
26
26
|
isGitCommit,
|
|
27
|
+
isGitStatusLikeCommand,
|
|
27
28
|
isTestCommand,
|
|
28
29
|
messageSuggestsEditing,
|
|
29
30
|
messageSuggestsWorkflowGuidance,
|
|
@@ -194,6 +195,27 @@ const codegraphPlugin: Plugin = async (input) => {
|
|
|
194
195
|
}
|
|
195
196
|
}
|
|
196
197
|
|
|
198
|
+
if (isGitStatusLikeCommand(command)) {
|
|
199
|
+
try {
|
|
200
|
+
const rawStatus = await $`python -m src.cli.import_commands dogfood status --json`.quiet().text()
|
|
201
|
+
const status = JSON.parse(rawStatus)
|
|
202
|
+
const guidance = formatDogfoodStatusSummary(status)
|
|
203
|
+
if (guidance) {
|
|
204
|
+
output.title = "CodeGraph: git workflow guidance ready"
|
|
205
|
+
const existingOutput = output.output?.trimEnd() || ""
|
|
206
|
+
output.output = existingOutput ? `${existingOutput}\n\n${guidance}` : guidance
|
|
207
|
+
output.metadata = {
|
|
208
|
+
...output.metadata,
|
|
209
|
+
codegraph_git_workflow_state: status.workflow_state || null,
|
|
210
|
+
codegraph_git_next_action: status.recommended_next_action || null,
|
|
211
|
+
codegraph_git_recommended_command: status.recommended_command || null,
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
} catch {
|
|
215
|
+
// Best-effort guidance only
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
197
219
|
if (!isGitCommit(output.output)) return
|
|
198
220
|
|
|
199
221
|
try {
|
package/src/util.ts
CHANGED
|
@@ -99,6 +99,12 @@ export function isTestCommand(command: string): boolean {
|
|
|
99
99
|
)
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
+
export function isGitStatusLikeCommand(command: string): boolean {
|
|
103
|
+
if (!command) return false
|
|
104
|
+
const normalized = command.toLowerCase()
|
|
105
|
+
return normalized.includes("git status") || normalized.includes("git diff")
|
|
106
|
+
}
|
|
107
|
+
|
|
102
108
|
export function didTestCommandFail(output: string): boolean {
|
|
103
109
|
if (!output) return false
|
|
104
110
|
const normalized = output.toLowerCase()
|