opencode-codegraph 0.1.20 → 0.1.21
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 +5 -0
- package/package.json +1 -1
- package/src/index.ts +32 -2
- package/src/util.ts +6 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.21 - 2026-03-20
|
|
4
|
+
|
|
5
|
+
- append workflow guidance to the `codegraph_review` custom tool so tool results stay aligned with current dogfooding state
|
|
6
|
+
- add `/continue` as a safe guided execution command for refresh/review workflow steps
|
|
7
|
+
|
|
3
8
|
## 0.1.20 - 2026-03-20
|
|
4
9
|
|
|
5
10
|
- append workflow guidance to the `codegraph_review` custom tool so tool results stay aligned with current dogfooding state
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -22,6 +22,7 @@ import {
|
|
|
22
22
|
formatDogfoodStatusSummary,
|
|
23
23
|
formatPendingReviewTraceSummary,
|
|
24
24
|
formatReviewTraceSummary,
|
|
25
|
+
formatReviewTraceUpdateSummary,
|
|
25
26
|
formatWorkflowGuidanceBlock,
|
|
26
27
|
getHeadCommit,
|
|
27
28
|
isGitCommit,
|
|
@@ -44,8 +45,20 @@ const codegraphPlugin: Plugin = async (input) => {
|
|
|
44
45
|
const apiUrl = process.env.CODEGRAPH_API_URL || "http://localhost:8000"
|
|
45
46
|
const api = new CodeGraphAPI(apiUrl)
|
|
46
47
|
|
|
47
|
-
// Detect project ID from environment or opencode.json
|
|
48
|
-
const projectId = process.env.CODEGRAPH_PROJECT || ""
|
|
48
|
+
// Detect project ID from environment or opencode.json
|
|
49
|
+
const projectId = process.env.CODEGRAPH_PROJECT || ""
|
|
50
|
+
let pendingReviewCommit: string | null = null
|
|
51
|
+
|
|
52
|
+
const consumePendingReviewTraceUpdate = async (): Promise<string | null> => {
|
|
53
|
+
if (!pendingReviewCommit) return null
|
|
54
|
+
const commit = pendingReviewCommit
|
|
55
|
+
const traceSnapshot = await readReviewTraceSnapshot(directory, commit, 1, 0)
|
|
56
|
+
if (!traceSnapshot) return null
|
|
57
|
+
const workflowState = traceSnapshot.workflow_state || workflowStateFromReviewTrace(traceSnapshot)
|
|
58
|
+
if (workflowState === "trace_pending") return null
|
|
59
|
+
pendingReviewCommit = null
|
|
60
|
+
return formatReviewTraceUpdateSummary(traceSnapshot)
|
|
61
|
+
}
|
|
49
62
|
|
|
50
63
|
return {
|
|
51
64
|
// -----------------------------------------------------------------
|
|
@@ -96,6 +109,14 @@ const codegraphPlugin: Plugin = async (input) => {
|
|
|
96
109
|
}
|
|
97
110
|
|
|
98
111
|
try {
|
|
112
|
+
const pendingUpdate = await consumePendingReviewTraceUpdate()
|
|
113
|
+
if (pendingUpdate) {
|
|
114
|
+
output.parts.push({
|
|
115
|
+
type: "text",
|
|
116
|
+
text: pendingUpdate,
|
|
117
|
+
} as any)
|
|
118
|
+
}
|
|
119
|
+
|
|
99
120
|
const rawStatus = await $`python -m src.cli.import_commands dogfood status --json`.quiet().text()
|
|
100
121
|
const statusSummary = formatDogfoodStatusSummary(JSON.parse(rawStatus))
|
|
101
122
|
if (statusSummary) {
|
|
@@ -120,6 +141,14 @@ const codegraphPlugin: Plugin = async (input) => {
|
|
|
120
141
|
if (!files.length && !workflowIntent) return
|
|
121
142
|
|
|
122
143
|
try {
|
|
144
|
+
const pendingUpdate = await consumePendingReviewTraceUpdate()
|
|
145
|
+
if (pendingUpdate) {
|
|
146
|
+
output.parts.push({
|
|
147
|
+
type: "text",
|
|
148
|
+
text: pendingUpdate,
|
|
149
|
+
} as any)
|
|
150
|
+
}
|
|
151
|
+
|
|
123
152
|
if (workflowIntent) {
|
|
124
153
|
try {
|
|
125
154
|
const rawStatus = await $`python -m src.cli.import_commands dogfood status --json`.quiet().text()
|
|
@@ -245,6 +274,7 @@ const codegraphPlugin: Plugin = async (input) => {
|
|
|
245
274
|
}
|
|
246
275
|
} else {
|
|
247
276
|
traceSummary = formatPendingReviewTraceSummary(commit)
|
|
277
|
+
pendingReviewCommit = commit
|
|
248
278
|
output.metadata = {
|
|
249
279
|
...output.metadata,
|
|
250
280
|
codegraph_review_trace_status: "pending_or_missing",
|
package/src/util.ts
CHANGED
|
@@ -257,6 +257,12 @@ export function formatReviewTraceSummary(snapshot: ReviewTraceSnapshot): string
|
|
|
257
257
|
return lines.join("\n")
|
|
258
258
|
}
|
|
259
259
|
|
|
260
|
+
export function formatReviewTraceUpdateSummary(snapshot: ReviewTraceSnapshot): string | null {
|
|
261
|
+
const base = formatReviewTraceSummary(snapshot)
|
|
262
|
+
if (!base) return null
|
|
263
|
+
return base.replace("## CodeGraph Post-Commit Summary", "## CodeGraph Review Trace Update")
|
|
264
|
+
}
|
|
265
|
+
|
|
260
266
|
export function whatChangedFromReviewTrace(snapshot: ReviewTraceSnapshot): string[] {
|
|
261
267
|
const items: string[] = []
|
|
262
268
|
const status = snapshot.status || "unknown"
|