opencode-codegraph 0.1.8 → 0.1.10

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 CHANGED
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.10 - 2026-03-20
4
+
5
+ - add conversational workflow-intent enrichment when the user asks what to do next, whether a change is ready, or whether they can push
6
+ - add `/next` as a dedicated guided workflow command in the OpenCode command set
7
+
8
+ ## 0.1.9 - 2026-03-20
9
+
10
+ - document the new `/next` guided workflow command in plugin and integration docs
11
+ - align command inventory around seven OpenCode workflow commands
12
+
3
13
  ## 0.1.8 - 2026-03-20
4
14
 
5
15
  - add normalized workflow states (`refresh_needed`, `trace_pending`, `review_required`, `ready_to_continue`) across dogfooding status and review trace flows
package/README.md CHANGED
@@ -38,6 +38,8 @@ Plugin injects:
38
38
  ```
39
39
 
40
40
  If the message also suggests an edit intent (`refactor`, `fix`, `modify`, `update`, etc.), the plugin appends a pre-edit warning block with complexity, fan-out, dead-code, and security hints for the referenced file.
41
+
42
+ If the message suggests workflow guidance intent (`what next`, `am I done`, `can I push`, etc.), the plugin appends the current dogfooding status summary so the session can answer with the right next command immediately.
41
43
 
42
44
  ### System Prompt
43
45
 
@@ -89,6 +91,7 @@ Place in `.opencode/commands/`:
89
91
  | `/onboard` | Codebase understanding |
90
92
  | `/update` | Freshness check and incremental CPG update |
91
93
  | `/status` | Unified freshness + latest review-trace status |
94
+ | `/next` | Single best next command for the current workflow state |
92
95
 
93
96
  ## Custom Agent
94
97
 
@@ -108,6 +111,7 @@ Place in `.opencode/commands/`:
108
111
  | `experimental.chat.system.transform` | Inject project summary into system prompt |
109
112
  | `chat.message` | Add CPG context for mentioned files |
110
113
  | `chat.message` (edit intent) | Add pre-edit warnings for files likely to be modified |
114
+ | `chat.message` (workflow intent) | Add dogfooding status when the user asks what to do next |
111
115
  | `tool.execute.after` | Trigger CPG update after git commit and append structured post-commit review summary |
112
116
  | `permission.ask` | Auto-allow `codegraph_*` tools |
113
117
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-codegraph",
3
- "version": "0.1.8",
3
+ "version": "0.1.10",
4
4
  "description": "OpenCode plugin for CodeGraph CPG-powered code analysis",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
package/src/index.ts CHANGED
@@ -23,6 +23,7 @@ import {
23
23
  getHeadCommit,
24
24
  isGitCommit,
25
25
  messageSuggestsEditing,
26
+ messageSuggestsWorkflowGuidance,
26
27
  recommendedCommandFromReviewTrace,
27
28
  recommendedNextActionFromReviewTrace,
28
29
  readReviewTraceSnapshot,
@@ -66,15 +67,32 @@ const codegraphPlugin: Plugin = async (input) => {
66
67
  }
67
68
  },
68
69
 
69
- // -----------------------------------------------------------------
70
- // 2. Chat message: auto-enrich with CPG context for mentioned files
71
- // -----------------------------------------------------------------
70
+ // -----------------------------------------------------------------
71
+ // 2. Chat message: auto-enrich with CPG context for mentioned files
72
+ // -----------------------------------------------------------------
72
73
  "chat.message": async (_inp, output) => {
73
74
  const files = extractFileRefs(output.parts)
74
- if (files.length === 0) return
75
75
  const editIntent = messageSuggestsEditing(output.parts)
76
+ const workflowIntent = messageSuggestsWorkflowGuidance(output.parts)
77
+
78
+ if (!files.length && !workflowIntent) return
76
79
 
77
80
  try {
81
+ if (workflowIntent) {
82
+ try {
83
+ const rawStatus = await $`python -m src.cli.import_commands dogfood status --json`.quiet().text()
84
+ const statusSummary = formatDogfoodStatusSummary(JSON.parse(rawStatus))
85
+ if (statusSummary) {
86
+ output.parts.push({
87
+ type: "text",
88
+ text: statusSummary,
89
+ } as any)
90
+ }
91
+ } catch {
92
+ // Keep chat responsive if status lookup is unavailable
93
+ }
94
+ }
95
+
78
96
  for (const file of files.slice(0, 5)) {
79
97
  const context = await api.getFileCPGContext(projectId, file)
80
98
  if (context) {
package/src/util.ts CHANGED
@@ -104,6 +104,27 @@ export function messageSuggestsEditing(parts: Array<{ type: string; text?: strin
104
104
  return false
105
105
  }
106
106
 
107
+ export function messageSuggestsWorkflowGuidance(parts: Array<{ type: string; text?: string }>): boolean {
108
+ const patterns = [
109
+ /\bwhat next\b/i,
110
+ /\bnext step\b/i,
111
+ /\bwhat should i do next\b/i,
112
+ /\bam i done\b/i,
113
+ /\bcan i push\b/i,
114
+ /\bis this ready\b/i,
115
+ ]
116
+
117
+ for (const part of parts) {
118
+ if (part.type !== "text" || !part.text) continue
119
+ const text = part.text
120
+ if (patterns.some((pattern) => pattern.test(text))) {
121
+ return true
122
+ }
123
+ }
124
+
125
+ return false
126
+ }
127
+
107
128
  export function fileNeedsRegistrationCheck(filePath: string): boolean {
108
129
  const normalized = filePath.replace(/\\/g, "/")
109
130
  const isHandlerLike = ["scenarios/", "services/", "analysis/", "security/"].some((segment) =>