@polygraph/opencode-plugin 0.4.28 → 0.4.29
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.
|
@@ -15,7 +15,7 @@ These tools are available via MCP and CLI. Use whichever is available in your en
|
|
|
15
15
|
|
|
16
16
|
| MCP Tool | CLI Equivalent | Description |
|
|
17
17
|
| --- | --- | --- |
|
|
18
|
-
| `list_repos` | `polygraph repo list` | Discover candidate repositories
|
|
18
|
+
| `list_repos` | `polygraph repo list` | Discover candidate repositories. |
|
|
19
19
|
| `start_session` | `polygraph session start --repo <ids>` | Initialize a NEW session with selected repositories. Only use when no `sessionId` was provided. |
|
|
20
20
|
| `add_repo` | — | Attach repositories to an EXISTING session. Use when `sessionId` was provided and the session has no repos yet, or when the user wants to add more. |
|
|
21
21
|
| `show_session` | `polygraph session show <id> [--details]` | Get full session details including URL, and use details when session summary, repo IDs, PR URLs, and PR descriptions are needed |
|
|
@@ -58,16 +58,22 @@ Call `list_repos` to discover available candidate repositories:
|
|
|
58
58
|
list_repos()
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
+
`list_repos` accepts these optional parameters; set whichever apply. Refer to the tool schema for each parameter.
|
|
62
|
+
|
|
63
|
+
- `connectedTo`: repo ID, name, or full name (e.g. `nrwl/ocean`); pair with `connectionType`
|
|
64
|
+
- `connectionType`: `directly-upstream` | `directly-downstream` | `directly-both` (default) | `upstream` | `downstream` | `both`
|
|
65
|
+
- `publishedPackages`, `consumedPackages`, `publishedApis`, `consumedApis`: arrays of package names / API paths
|
|
66
|
+
- `nameFilter`: array of repo name patterns (e.g. `nrwl/*`)
|
|
67
|
+
- `semanticQuery`: free-text description of the repositories you want
|
|
68
|
+
|
|
61
69
|
This returns:
|
|
62
70
|
|
|
63
|
-
- **`
|
|
64
|
-
- **`candidates`**: Candidate account repositories, each with:
|
|
71
|
+
- **`repos`**: Candidate account repositories, each with:
|
|
65
72
|
- `id`: Repository ID
|
|
66
73
|
- `name`: Repository name
|
|
74
|
+
- `repository`: Full repo name (e.g., `org/repo`)
|
|
75
|
+
- `provider`: VCS provider (e.g., `GITHUB`)
|
|
67
76
|
- `description`: AI-generated description of what the repository does (may be null)
|
|
68
|
-
- `vcsConfiguration.repositoryFullName`: Full repo name (e.g., `org/repo`)
|
|
69
|
-
- `graphRelationship`: How this repository relates to the initiator (`distance`, `direction`, `path`), or `null` if the repository is not in the dependency graph. When `initiator` is null, `graphRelationship` will be null for all candidates.
|
|
70
|
-
- **`dependencyGraph`**: Graph of repository dependency `edges` (always available, independent of initiator)
|
|
71
77
|
|
|
72
78
|
### Step 2: Select Relevant Repos
|
|
73
79
|
|
|
@@ -77,14 +83,11 @@ If `selectedRepoIds` or exact repo refs were provided by the main agent, use tho
|
|
|
77
83
|
|
|
78
84
|
Otherwise, analyze the candidates using the `userContext` to determine which repos are relevant:
|
|
79
85
|
|
|
80
|
-
1. Read each
|
|
81
|
-
2. Match against the `userContext`
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
- Direction (upstream/downstream based on the nature of the change)
|
|
86
|
-
3. Select only the repos that are clearly relevant to the task
|
|
87
|
-
4. If uncertain which repos are relevant, include all candidates (safe default)
|
|
86
|
+
1. Read each repo's `description`
|
|
87
|
+
2. Match repo descriptions against the `userContext` to identify relevant repos
|
|
88
|
+
3. Select the repos that are relevant to the task
|
|
89
|
+
4. When uncertain, include all candidates
|
|
90
|
+
5. When the user described the task in natural language and the result is large, re-query with `semanticQuery` set to that description
|
|
88
91
|
|
|
89
92
|
### Step 3: Initialize Polygraph Session or Attach Repos
|
|
90
93
|
|
|
@@ -140,11 +143,6 @@ Return a structured summary in this format:
|
|
|
140
143
|
| Repo | Repository ID | Description | Selected |
|
|
141
144
|
| --- | --- | --- | --- |
|
|
142
145
|
| REPO_FULL_NAME | REPOSITORY_ID | DESCRIPTION | Yes/No |
|
|
143
|
-
|
|
144
|
-
### Initiator
|
|
145
|
-
(Only include this section if `list_repos` was called and `initiator` is non-null)
|
|
146
|
-
- **Name:** <initiator name>
|
|
147
|
-
- **Repo:** <initiator repo full name>
|
|
148
146
|
```
|
|
149
147
|
|
|
150
148
|
## Important Notes
|
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@ Polygraph functionality is available via both MCP tools and CLI commands. Use wh
|
|
|
18
18
|
|
|
19
19
|
| MCP Tool | CLI Equivalent | Description |
|
|
20
20
|
| --- | --- | --- |
|
|
21
|
-
| `list_repos` | `polygraph repo list` | Discover candidate repositories
|
|
21
|
+
| `list_repos` | `polygraph repo list` | Discover candidate repositories. |
|
|
22
22
|
| `start_session` | `polygraph session start --repo <ids>` | Initialize a Polygraph session with selected repositories |
|
|
23
23
|
| `spawn_agent` | — | Start a new child task or send a follow-up to an active task in another repository. Input: `{ sessionId, repo, instruction, context? }`. Output: `{ taskId, message, status: 'delegated' }`. Follow-up routing is automatic: if the repo already has an active child task, the instruction is delivered to it as a follow-up message; otherwise a new child run starts. A repo has at most one active child at a time. A session resume or reconstruction is read-only context restoration; after resuming, do not use `spawn_agent` to continue changes unless the user explicitly asks for changes. |
|
|
24
24
|
| `show_agent` | — | Poll flat per-child status for the session. Output: `{ children: PolygraphChildStatusItem[] }` where each item exposes `repositoryId`, `repoFullName`, `status`, `lastOutputLines`, `durationMs`, `instruction`, `agentType?`, `inputRequiredQuestion?`. `status` is an AcpRunStatus: `'created' \| 'in-progress' \| 'input-required' \| 'permission-required' \| 'completed' \| 'failed' \| 'cancelled'` (British double-L on `'cancelled'`). `inputRequiredQuestion` is populated only when `status === 'input-required'`. |
|