@polygraph/opencode-plugin 0.4.25 → 0.4.26

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polygraph/opencode-plugin",
3
- "version": "0.4.25",
3
+ "version": "0.4.26",
4
4
  "description": "AI agent skills and subagents for Polygraph multi-repo coordination",
5
5
  "license": "UNLICENSED",
6
6
  "private": false,
package/server.js CHANGED
@@ -112,8 +112,12 @@ function recordValue(value) {
112
112
  // then build a short instruction telling the summarizer to keep the Polygraph
113
113
  // session id and repo list in the compaction summary. Returns null when this is
114
114
  // not a Polygraph session (no matching parent-log sidecar) — a silent no-op.
115
+ //
116
+ // These helpers must NOT be exported: OpenCode calls every export of this
117
+ // module as a plugin factory, and a factory that doesn't return a hooks object
118
+ // crashes the server on startup ("Unexpected server error").
115
119
 
116
- export function polygraphCompactionNote(agentSessionId, root) {
120
+ function polygraphCompactionNote(agentSessionId, root) {
117
121
  const session = readPolygraphSession(agentSessionId, root);
118
122
  if (!session) {
119
123
  return undefined;
@@ -132,7 +136,7 @@ export function polygraphCompactionNote(agentSessionId, root) {
132
136
  );
133
137
  }
134
138
 
135
- export function readPolygraphSession(
139
+ function readPolygraphSession(
136
140
  agentSessionId,
137
141
  root = path.join(homedir(), '.polygraph')
138
142
  ) {
@@ -105,7 +105,7 @@ The subagent will:
105
105
  4. Call `show_session` to retrieve session details
106
106
  5. Return a summary with session URL and repo info
107
107
 
108
- **Case C only — new session just created:** After the init subagent completes and creates the new session, render the session welcome card (skip the session-details block below for this case). Prefer the `session_intro` MCP tool — call it with the session ID; it returns the card as markdown. If that tool is unavailable, run `polygraph session intro -s <sessionId>` via the CLI instead. Either way, print the result to the user verbatim as markdown — do NOT wrap it in a code block or reformat it (the logo is pre-fenced; the rest is live markdown). It needs no other input, and you do not need to call `show_session` first. Then continue (ask the user what they want, or start the requested task).
108
+ **Case C only — new session just created:** After the init subagent completes and creates the new session, render the session welcome card (skip the session-details block below for this case). Prefer the `session_intro` MCP tool — call it with the session ID; it returns the card as markdown. If that tool is unavailable, run `polygraph session intro -s <sessionId>` via the CLI instead. The CLI command is intentionally hidden/internal and may not appear in public command listings, but it remains the correct skill fallback for rendering the welcome card. Either way, print the result to the user verbatim as markdown — do NOT wrap it in a code block or reformat it (the logo is pre-fenced; the rest is live markdown). It needs no other input, and you do not need to call `show_session` first. Then continue (ask the user what they want, or start the requested task).
109
109
 
110
110
  **After receiving the subagent's summary (Case B) or after calling `show_session` for an existing session (Case A), print the session details:**
111
111