@polygraph/claude-plugin 0.5.1 → 0.5.2
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/.claude-plugin/plugin.json +1 -1
- package/hooks/CAPTURE_CONTRACT.md +178 -0
- package/hooks/agent-session-capture.mjs +214 -0
- package/hooks/agent-session-finalize.mjs +115 -30
- package/hooks/agent-session-link.mjs +35 -13
- package/hooks/capture-cli.mjs +294 -0
- package/hooks/ensure-agent-session-capture-worker.mjs +63 -0
- package/hooks/ensure-agent-session-capture.mjs +79 -0
- package/hooks/finalize-agent-session-worker.mjs +63 -0
- package/hooks/finalize-agent-session.mjs +24 -10
- package/hooks/hooks.json +23 -1
- package/hooks/record-session-mapping.mjs +17 -15
- package/package.json +1 -1
- package/skills/polygraph/SKILL.md +3 -2
- package/skills/polygraph/reference/publish-changes.md +48 -1
- package/skills/polygraph/reference/session-description.md +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Publishing Changes Reference
|
|
2
2
|
|
|
3
|
-
The branch-to-PR flow: push branches, create draft PRs, mark them ready,
|
|
3
|
+
The branch-to-PR flow: push branches, create draft PRs, mark them ready, associate PRs created outside Polygraph, and update associated PRs. `push_branch`, `create_pr`, and `associate_pr` all require a `description` following the Session Description Policy — read [`session-description.md`](session-description.md) before writing one. `update_pr` does not require a session timeline description.
|
|
4
4
|
|
|
5
5
|
## Push Branches
|
|
6
6
|
|
|
@@ -151,3 +151,50 @@ associate_pr(
|
|
|
151
151
|
```
|
|
152
152
|
|
|
153
153
|
**Returns** the list of PRs now associated with the session.
|
|
154
|
+
|
|
155
|
+
## Update an Associated PR
|
|
156
|
+
|
|
157
|
+
Use the MCP `update_pr` tool to update one PR already associated with the named Polygraph session. Do not use `gh` or call Ocean HTTP directly. `mark_pr_ready` remains a separate operation.
|
|
158
|
+
|
|
159
|
+
**Parameters:**
|
|
160
|
+
|
|
161
|
+
- `sessionId` (required): The Polygraph session ID.
|
|
162
|
+
- `prUrl` (required): The URL of a PR already associated with the session.
|
|
163
|
+
- `title` (optional): Replacement PR title.
|
|
164
|
+
- `body` (optional): Replacement user-authored PR body. Pass an empty string to clear it. The managed Polygraph session footer remains server-owned.
|
|
165
|
+
- `labels` (optional): A collection update with `mode` and `values`.
|
|
166
|
+
- `assignees` (optional): A collection update with `mode` and `values`.
|
|
167
|
+
|
|
168
|
+
Omitted fields remain unchanged. For `labels` and `assignees`:
|
|
169
|
+
|
|
170
|
+
- `{ mode: "set", values: [...] }` replaces the complete collection. An empty `values` list clears it. Use `set` only when you intend to replace every value because it can remove labels or assignees applied by humans.
|
|
171
|
+
- `add` and `remove` preserve unrelated values and require a non-empty `values` list.
|
|
172
|
+
|
|
173
|
+
Set the complete label collection and clear the user-authored body:
|
|
174
|
+
|
|
175
|
+
```
|
|
176
|
+
update_pr(
|
|
177
|
+
sessionId: "<session-id>",
|
|
178
|
+
prUrl: "https://github.com/org/repo/pull/123",
|
|
179
|
+
body: "",
|
|
180
|
+
labels: {
|
|
181
|
+
mode: "set",
|
|
182
|
+
values: ["documentation", "release-note"]
|
|
183
|
+
}
|
|
184
|
+
)
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
Add an assignee while leaving the title, body, labels, and other assignees unchanged:
|
|
188
|
+
|
|
189
|
+
```
|
|
190
|
+
update_pr(
|
|
191
|
+
sessionId: "<session-id>",
|
|
192
|
+
prUrl: "https://github.com/org/repo/pull/123",
|
|
193
|
+
assignees: {
|
|
194
|
+
mode: "add",
|
|
195
|
+
values: ["octocat"]
|
|
196
|
+
}
|
|
197
|
+
)
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
Metadata updates do not require a session timeline `description`.
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
`description` is user-facing Polygraph session context.
|
|
6
6
|
|
|
7
|
-
`description` is required for `push_branch`, `create_pr`, and `associate_pr`, and is the primary input to `update_session` (which takes `title` and/or `description`).
|
|
7
|
+
`description` is required for `push_branch`, `create_pr`, and `associate_pr`, and is the primary input to `update_session` (which takes `title` and/or `description`). Metadata updates through `update_pr` do not require a session timeline description, and `mark_pr_ready` does not take one. The Polygraph web app renders the description as Markdown, so use real Markdown headings — not flat `Label:` lines. Use the canonical structured format:
|
|
8
8
|
|
|
9
9
|
```markdown
|
|
10
10
|
## Goal
|