opencode-codegraph 0.1.30 → 0.1.33

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,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.33 - 2026-03-21
4
+
5
+ - expose workflow policy transparency in plugin summaries via `policy_version` and `priority_reason`
6
+
7
+ ## 0.1.32 - 2026-03-21
8
+
9
+ - align workflow-update blocks with the same closure-oriented framing used by other status-oriented surfaces
10
+
11
+ ## 0.1.31 - 2026-03-21
12
+
13
+ - add current workflow guidance to `codegraph_explain_function` so tool-level explanations align with command-level DX
14
+
3
15
  ## 0.1.30 - 2026-03-21
4
16
 
5
17
  - align git-oriented guidance and workflow-transition rendering with the shared workflow guidance block
package/README.md CHANGED
@@ -119,6 +119,7 @@ Place in `.opencode/commands/`:
119
119
  | `tool.execute.after` | Trigger CPG update after git commit and append structured post-commit review summary |
120
120
  | generic `tool.execute.after` | Surface workflow-state transitions after other bash commands when the underlying state changes |
121
121
  | `codegraph_review` tool | Returns review results together with current workflow guidance and suggested follow-up command |
122
+ | `codegraph_explain_function` tool | Returns function analysis together with current workflow guidance |
122
123
  | `experimental.session.compacting` | Preserve current dogfooding status when OpenCode compacts long sessions |
123
124
  | `command.execute.before` | Inject current dogfooding status into `/review`, `/audit`, `/update`, `/status`, `/next`, `/continue`, `/maintain-db`, and `/unlock-db` |
124
125
  | `db_locked` recovery path | Surface lock-holder-aware recovery guidance when DuckDB is blocked by another process |
@@ -127,6 +128,7 @@ Place in `.opencode/commands/`:
127
128
  Across status-oriented surfaces, the plugin is converging on one shared summary contract:
128
129
 
129
130
  - workflow state
131
+ - policy version / priority reason
130
132
  - primary issue
131
133
  - recovery sequence
132
134
  - blockers
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-codegraph",
3
- "version": "0.1.30",
3
+ "version": "0.1.33",
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
@@ -425,14 +425,21 @@ const codegraphPlugin: Plugin = async (input) => {
425
425
  description:
426
426
  "Deep analysis of a function using CPG. Shows callers, callees, " +
427
427
  "complexity, taint paths, and security findings.",
428
- args: {
429
- name: tool.schema.string().describe("Function or method name to analyze"),
430
- },
431
- async execute(args) {
432
- const result = await api.explainFunction(projectId, args.name)
433
- return result
434
- },
435
- }),
428
+ args: {
429
+ name: tool.schema.string().describe("Function or method name to analyze"),
430
+ },
431
+ async execute(args) {
432
+ const result = await api.explainFunction(projectId, args.name)
433
+ try {
434
+ const rawStatus = await $`python -m src.cli.import_commands dogfood status --json`.quiet().text()
435
+ const status = JSON.parse(rawStatus)
436
+ const guidance = formatWorkflowGuidanceBlock(status)
437
+ return guidance ? `${result}\n\n${guidance}` : result
438
+ } catch {
439
+ return result
440
+ }
441
+ },
442
+ }),
436
443
  },
437
444
 
438
445
  // -----------------------------------------------------------------
package/src/util.ts CHANGED
@@ -46,6 +46,8 @@ export type DogfoodStatusSnapshot = {
46
46
  }
47
47
  review_trace?: ReviewTraceSnapshot | null
48
48
  workflow_state?: string
49
+ policy_version?: string
50
+ priority_reason?: string
49
51
  recommended_next_action?: string
50
52
  recommended_command?: string
51
53
  primary_issue?: string
@@ -61,6 +63,8 @@ export type DogfoodStatusSnapshot = {
61
63
 
62
64
  function workflowSummaryLines(snapshot: DogfoodStatusSnapshot): string[] {
63
65
  const workflowState = snapshot.workflow_state
66
+ const policyVersion = snapshot.policy_version
67
+ const priorityReason = snapshot.priority_reason
64
68
  const nextAction = snapshot.recommended_next_action
65
69
  const nextCommand = snapshot.recommended_command
66
70
  const primaryIssue = snapshot.primary_issue
@@ -77,6 +81,12 @@ function workflowSummaryLines(snapshot: DogfoodStatusSnapshot): string[] {
77
81
  if (workflowState) {
78
82
  lines.push(`- Workflow state: ${workflowState}`)
79
83
  }
84
+ if (policyVersion) {
85
+ lines.push(`- Policy version: ${policyVersion}`)
86
+ }
87
+ if (priorityReason) {
88
+ lines.push(`- Priority reason: ${priorityReason}`)
89
+ }
80
90
  if (nextAction) {
81
91
  lines.push(`- Next action: ${nextAction}`)
82
92
  }
@@ -540,16 +550,15 @@ export function formatWorkflowStateTransition(
540
550
  const primaryIssue = snapshot.primary_issue
541
551
  const blockers = Array.isArray(snapshot.blockers) ? snapshot.blockers.filter(Boolean) : []
542
552
 
543
- const lines = [
544
- "## CodeGraph Workflow Update",
545
- "",
546
- `- Workflow state changed: ${previousState} -> ${currentState}`,
547
- ]
553
+ const lines = ["## CodeGraph Workflow Update", "", "### What changed", ""]
554
+ lines.push(`- Workflow state changed: ${previousState} -> ${currentState}`)
548
555
 
549
556
  if (primaryIssue) {
550
557
  lines.push(`- Primary issue: ${primaryIssue}`)
551
558
  }
552
559
 
560
+ lines.push("", "### What to do now", "")
561
+
553
562
  if (nextAction) {
554
563
  lines.push(`- Next action: ${nextAction}`)
555
564
  }