@agent-native/core 0.44.3 → 0.45.0

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.
Files changed (129) hide show
  1. package/dist/cli/connect.d.ts +2 -1
  2. package/dist/cli/connect.d.ts.map +1 -1
  3. package/dist/cli/connect.js +185 -5
  4. package/dist/cli/connect.js.map +1 -1
  5. package/dist/cli/index.js +27 -0
  6. package/dist/cli/index.js.map +1 -1
  7. package/dist/cli/plan-local.d.ts +43 -0
  8. package/dist/cli/plan-local.d.ts.map +1 -0
  9. package/dist/cli/plan-local.js +477 -0
  10. package/dist/cli/plan-local.js.map +1 -0
  11. package/dist/cli/pr-visual-recap-workflow.d.ts +1 -1
  12. package/dist/cli/pr-visual-recap-workflow.d.ts.map +1 -1
  13. package/dist/cli/pr-visual-recap-workflow.js +1 -1
  14. package/dist/cli/pr-visual-recap-workflow.js.map +1 -1
  15. package/dist/cli/recap.d.ts +164 -0
  16. package/dist/cli/recap.d.ts.map +1 -1
  17. package/dist/cli/recap.js +657 -10
  18. package/dist/cli/recap.js.map +1 -1
  19. package/dist/cli/skills.d.ts +6 -2
  20. package/dist/cli/skills.d.ts.map +1 -1
  21. package/dist/cli/skills.js +440 -37
  22. package/dist/cli/skills.js.map +1 -1
  23. package/dist/client/blocks/library/AnnotatedCodeBlock.d.ts.map +1 -1
  24. package/dist/client/blocks/library/AnnotatedCodeBlock.js +18 -4
  25. package/dist/client/blocks/library/AnnotatedCodeBlock.js.map +1 -1
  26. package/dist/client/blocks/library/ApiEndpointBlock.d.ts.map +1 -1
  27. package/dist/client/blocks/library/ApiEndpointBlock.js +11 -7
  28. package/dist/client/blocks/library/ApiEndpointBlock.js.map +1 -1
  29. package/dist/client/blocks/library/DiffBlock.d.ts.map +1 -1
  30. package/dist/client/blocks/library/DiffBlock.js +90 -7
  31. package/dist/client/blocks/library/DiffBlock.js.map +1 -1
  32. package/dist/client/blocks/library/HighlightedCode.d.ts +2 -1
  33. package/dist/client/blocks/library/HighlightedCode.d.ts.map +1 -1
  34. package/dist/client/blocks/library/HighlightedCode.js +2 -2
  35. package/dist/client/blocks/library/HighlightedCode.js.map +1 -1
  36. package/dist/client/blocks/library/JsonExplorerBlock.d.ts.map +1 -1
  37. package/dist/client/blocks/library/JsonExplorerBlock.js +57 -13
  38. package/dist/client/blocks/library/JsonExplorerBlock.js.map +1 -1
  39. package/dist/client/blocks/library/annotation-rail.d.ts +15 -5
  40. package/dist/client/blocks/library/annotation-rail.d.ts.map +1 -1
  41. package/dist/client/blocks/library/annotation-rail.js +35 -24
  42. package/dist/client/blocks/library/annotation-rail.js.map +1 -1
  43. package/dist/client/blocks/library/code-filename-label.d.ts +8 -0
  44. package/dist/client/blocks/library/code-filename-label.d.ts.map +1 -0
  45. package/dist/client/blocks/library/code-filename-label.js +15 -0
  46. package/dist/client/blocks/library/code-filename-label.js.map +1 -0
  47. package/dist/client/blocks/library/code.d.ts.map +1 -1
  48. package/dist/client/blocks/library/code.js +28 -6
  49. package/dist/client/blocks/library/code.js.map +1 -1
  50. package/dist/client/blocks/library/columns.d.ts.map +1 -1
  51. package/dist/client/blocks/library/columns.js +11 -1
  52. package/dist/client/blocks/library/columns.js.map +1 -1
  53. package/dist/client/blocks/library/diff.config.d.ts +1 -1
  54. package/dist/client/blocks/library/diff.config.js.map +1 -1
  55. package/dist/client/blocks/library/narrow-container.d.ts +13 -0
  56. package/dist/client/blocks/library/narrow-container.d.ts.map +1 -0
  57. package/dist/client/blocks/library/narrow-container.js +32 -0
  58. package/dist/client/blocks/library/narrow-container.js.map +1 -0
  59. package/dist/client/blocks/library/question-form.d.ts.map +1 -1
  60. package/dist/client/blocks/library/question-form.js +8 -9
  61. package/dist/client/blocks/library/question-form.js.map +1 -1
  62. package/dist/client/blocks/library/tabs.d.ts.map +1 -1
  63. package/dist/client/blocks/library/tabs.js +11 -5
  64. package/dist/client/blocks/library/tabs.js.map +1 -1
  65. package/dist/client/blocks/types.d.ts +2 -0
  66. package/dist/client/blocks/types.d.ts.map +1 -1
  67. package/dist/client/blocks/types.js.map +1 -1
  68. package/dist/client/composer/TiptapComposer.d.ts.map +1 -1
  69. package/dist/client/composer/TiptapComposer.js +4 -1
  70. package/dist/client/composer/TiptapComposer.js.map +1 -1
  71. package/dist/client/db-admin/TableEditor.d.ts.map +1 -1
  72. package/dist/client/db-admin/TableEditor.js +3 -1
  73. package/dist/client/db-admin/TableEditor.js.map +1 -1
  74. package/dist/db/client.d.ts +19 -0
  75. package/dist/db/client.d.ts.map +1 -1
  76. package/dist/db/client.js +43 -2
  77. package/dist/db/client.js.map +1 -1
  78. package/dist/db/migrations.d.ts.map +1 -1
  79. package/dist/db/migrations.js +9 -2
  80. package/dist/db/migrations.js.map +1 -1
  81. package/dist/deploy/build.d.ts.map +1 -1
  82. package/dist/deploy/build.js +8 -0
  83. package/dist/deploy/build.js.map +1 -1
  84. package/dist/extensions/html-shell.js +1 -1
  85. package/dist/extensions/html-shell.js.map +1 -1
  86. package/dist/jobs/scheduler.d.ts.map +1 -1
  87. package/dist/jobs/scheduler.js +5 -1
  88. package/dist/jobs/scheduler.js.map +1 -1
  89. package/dist/mcp/build-server.d.ts +1 -0
  90. package/dist/mcp/build-server.d.ts.map +1 -1
  91. package/dist/mcp/build-server.js +7 -3
  92. package/dist/mcp/build-server.js.map +1 -1
  93. package/dist/mcp/oauth-route.d.ts.map +1 -1
  94. package/dist/mcp/oauth-route.js +56 -19
  95. package/dist/mcp/oauth-route.js.map +1 -1
  96. package/dist/mcp/oauth-store.d.ts +1 -0
  97. package/dist/mcp/oauth-store.d.ts.map +1 -1
  98. package/dist/mcp/oauth-store.js +9 -0
  99. package/dist/mcp/oauth-store.js.map +1 -1
  100. package/dist/mcp/server.d.ts.map +1 -1
  101. package/dist/mcp/server.js +9 -4
  102. package/dist/mcp/server.js.map +1 -1
  103. package/dist/mcp-client/errors.js +3 -3
  104. package/dist/mcp-client/errors.js.map +1 -1
  105. package/dist/server/agent-chat-plugin.d.ts.map +1 -1
  106. package/dist/server/agent-chat-plugin.js +3 -1
  107. package/dist/server/agent-chat-plugin.js.map +1 -1
  108. package/dist/server/agent-teams.d.ts.map +1 -1
  109. package/dist/server/agent-teams.js +10 -2
  110. package/dist/server/agent-teams.js.map +1 -1
  111. package/dist/server/auth.d.ts.map +1 -1
  112. package/dist/server/auth.js +7 -3
  113. package/dist/server/auth.js.map +1 -1
  114. package/dist/server/recap-image-route.d.ts.map +1 -1
  115. package/dist/server/recap-image-route.js +3 -6
  116. package/dist/server/recap-image-route.js.map +1 -1
  117. package/dist/server/sentry.d.ts.map +1 -1
  118. package/dist/server/sentry.js +12 -5
  119. package/dist/server/sentry.js.map +1 -1
  120. package/dist/server/social-og-image.d.ts.map +1 -1
  121. package/dist/server/social-og-image.js +3 -1
  122. package/dist/server/social-og-image.js.map +1 -1
  123. package/dist/styles/blocks.css +36 -10
  124. package/dist/templates/workspace-core/.agents/skills/external-agents/SKILL.md +22 -6
  125. package/docs/content/plan-plugin.md +18 -1
  126. package/docs/content/pr-visual-recap.md +37 -10
  127. package/docs/content/template-plan.md +45 -1
  128. package/package.json +1 -1
  129. package/src/templates/workspace-core/.agents/skills/external-agents/SKILL.md +22 -6
@@ -14,7 +14,24 @@ One install gives you:
14
14
  - **Two skills** — `/visual-plan` (the canonical entry point) and `/visual-recap`.
15
15
  - **The Plan MCP connector** — registered against the hosted app at `https://plan.agent-native.com` (MCP endpoint `https://plan.agent-native.com/_agent-native/mcp`, server name `agent-native-plans`).
16
16
 
17
- Both skills **always publish to the hosted Plan app** — they create a plan via the MCP connector and hand you a link or inline plan to review. They never dump an inline Markdown/ASCII plan into chat as the deliverable. If a Plan tool returns `needs auth`, `Unauthorized`, or `Session terminated`, authenticate the connector (see each route below) instead of falling back to inline output.
17
+ By default, both skills publish to the hosted Plan app — they create a plan via
18
+ the MCP connector and hand you a link or inline plan to review. They never dump
19
+ an inline Markdown/ASCII plan into chat as the deliverable. If a Plan tool
20
+ returns `needs auth`, `Unauthorized`, or `Session terminated`, authenticate the
21
+ connector (see each route below) instead of falling back to inline output.
22
+
23
+ The exception is explicit **local-files privacy mode**. When you ask for no DB
24
+ writes or set `AGENT_NATIVE_PLANS_MODE=local-files`, the skills must not call
25
+ the Plan MCP connector. They write `plans/<slug>/plan.mdx` plus optional
26
+ `canvas.mdx`, `prototype.mdx`, and `.plan-state.json`, then preview locally with:
27
+
28
+ ```bash
29
+ agent-native plan local preview --dir plans/<slug> --kind plan
30
+ ```
31
+
32
+ This keeps plan content out of the Agent-Native Plan database. Hosted sharing,
33
+ comments, screenshots, and plan history are unavailable until you explicitly
34
+ publish later.
18
35
 
19
36
  > The plugin (`agent-native-visual-plans`) carries app id `visual-plans`, which is why the Claude Code plugin name and Codex plugin name are both `agent-native-visual-plans`. The Plan app's display name is "Agent-Native Plan".
20
37
 
@@ -1,26 +1,28 @@
1
1
  ---
2
2
  title: "PR Visual Recap"
3
- description: "A GitHub Action that runs your repo's visual-recap skill on every PR. An LLM coding agent reads the diff, publishes an interactive recap plan, and posts it as a sticky PR comment with an inline screenshot. Informational and non-blocking."
3
+ description: "A GitHub Action that runs your repo's visual-recap skill on every PR. An LLM coding agent reads the diff, publishes an interactive recap plan, shows an informational check, and posts a sticky PR comment with an inline screenshot. Informational and non-blocking."
4
4
  ---
5
5
 
6
6
  # PR Visual Recap
7
7
 
8
- PR Visual Recap is a GitHub Action that turns every pull request into a **visual code review**. On each push, an LLM coding agent runs your repo's [`visual-recap`](/docs/template-plan) skill against the PR diff, publishes a structured recap plan to the hosted Plans app, and upserts **one sticky PR comment** that links to the interactive plan with an **inline screenshot** embedded right in the comment.
8
+ PR Visual Recap is a GitHub Action that turns every pull request into a **visual code review**. On each push, an LLM coding agent runs your repo's [`visual-recap`](/docs/template-plan) skill against the PR diff, publishes a structured recap plan to the hosted Plans app, shows an informational `Visual Recap` check while it runs, and upserts **one sticky PR comment** that links to the interactive plan with an **inline screenshot** embedded right in the comment.
9
9
 
10
10
  This is not a deterministic diff renderer. The action invokes a real coding agent (Claude Code CLI by default, or OpenAI Codex CLI) that reads the change, decides what matters, and authors the recap by calling the Plans MCP tool `create-visual-recap` — the same tool the `/visual-recap` slash command uses. You get a high-altitude, schema/API/before-after view of the change instead of a wall of raw diff.
11
11
 
12
- The recap is **informational and non-blocking**. It is not a required check, it never blocks the PR, and it never replaces reading the actual diff. The sticky comment is a review aid, not a sign-off.
12
+ The recap is **informational and non-blocking**. It creates a check row so reviewers can see that generation is in progress, but it is not a required check, it never blocks the PR, and it never replaces reading the actual diff. The sticky comment is a review aid, not a sign-off.
13
13
 
14
14
  ## What it does
15
15
 
16
16
  On each PR push, the workflow:
17
17
 
18
18
  1. Collects a bounded diff between the PR base and head.
19
- 2. Runs the configured coding agent against that diff. The agent reads your repo's `visual-recap` skill and authors a recap, publishing it with `create-visual-recap`.
20
- 3. Reads the published plan URL the agent wrote to `recap-url.txt`.
21
- 4. Opens that URL in headless Chrome and screenshots the rendered plan.
22
- 5. Uploads the PNG to a signed public image route on the Plans app.
23
- 6. Upserts a single sticky PR comment that embeds the screenshot **inline** (served through GitHub's camo image proxy) next to the link to the interactive recap.
19
+ 2. Creates an informational `Visual Recap` GitHub check with `Review in progress`.
20
+ 3. Runs the configured coding agent against that diff. The agent reads your repo's `visual-recap` skill and authors a recap, publishing it with `create-visual-recap`.
21
+ 4. Reads the published plan URL the agent wrote to `recap-url.txt`.
22
+ 5. Opens that URL in headless Chrome and screenshots the rendered plan.
23
+ 6. Uploads the PNG to a signed public image route on the Plans app.
24
+ 7. Upserts a single sticky PR comment that embeds the screenshot **inline** (served through GitHub's camo image proxy) next to the link to the interactive recap.
25
+ 8. Completes the `Visual Recap` check as success, skipped, or neutral.
24
26
 
25
27
  A re-push updates the same plan and the same sticky comment in place — no orphaned plans, no comment spam.
26
28
 
@@ -89,12 +91,37 @@ The workflow uses the plain `pull_request` trigger, **not** `pull_request_target
89
91
 
90
92
  This also means you can merge the workflow file **before** the secrets exist: with no token configured, every run is a quiet no-op until you set the secrets.
91
93
 
94
+ ## Local-files privacy mode
95
+
96
+ The GitHub Action is designed for hosted, shareable PR review. If you want a
97
+ recap without sending recap content to the Agent-Native Plan database, run the
98
+ same helper flow locally in local-files mode instead:
99
+
100
+ ```bash
101
+ agent-native recap collect-diff --base main --head HEAD --out recap.diff --stat recap.stat
102
+ agent-native recap scan --diff recap.diff
103
+ agent-native recap build-prompt --pr 123 --diff recap.diff --stat recap.stat --local-files --local-dir plans/pr-123-visual-recap
104
+ ```
105
+
106
+ Give the generated `recap-prompt.md` to your coding agent. In local-files mode
107
+ the prompt instructs the agent to write `plans/pr-123-visual-recap/plan.mdx`
108
+ plus optional visual files and then run:
109
+
110
+ ```bash
111
+ agent-native plan local preview --dir plans/pr-123-visual-recap --kind recap
112
+ ```
113
+
114
+ The returned `file://` preview, or `/local-plans/pr-123-visual-recap` in a local
115
+ Plan app using the same `PLAN_LOCAL_DIR`, is the review link. This mode disables
116
+ the hosted sticky PR comment, inline screenshot upload, usage attachment, and
117
+ browser comments until you explicitly publish.
118
+
92
119
  ## It's informational, not a gate
93
120
 
94
121
  The recap is a review aid layered on top of the normal PR flow:
95
122
 
96
- - It is **never a required check** and never blocks merging.
97
- - A generation or publish failure surfaces as an explanatory sticky comment, not a red X on unrelated code.
123
+ - It shows a `Visual Recap` check row for visibility, but it is **never a required check** and never blocks merging.
124
+ - A generation or publish failure completes neutrally and surfaces as an explanatory sticky comment, not a red X on unrelated code.
98
125
  - The recap and its screenshot **do not imply the diff has been reviewed**. Reviewers still need to read the actual changed lines.
99
126
 
100
127
  ## Related
@@ -162,6 +162,47 @@ Sharing and commenting are the workflows that need an account:
162
162
  The hosted Plans connector lives at `https://plan.agent-native.com/_agent-native/mcp`.
163
163
  Never put shared secrets in skill files.
164
164
 
165
+ ## Local-files privacy mode {#local-files}
166
+
167
+ For privacy-focused work, ask for local-files mode:
168
+
169
+ ```text
170
+ Use /visual-plan in local-files mode. Do not write this plan to the Plan DB.
171
+ ```
172
+
173
+ or set the convention for your agent environment:
174
+
175
+ ```bash
176
+ export AGENT_NATIVE_PLANS_MODE=local-files
177
+ ```
178
+
179
+ In this mode the agent writes a local MDX folder under `plans/<slug>/` and must
180
+ not call the hosted Plan MCP tools. The durable files are:
181
+
182
+ - `plan.mdx`
183
+ - optional `canvas.mdx`
184
+ - optional `prototype.mdx`
185
+ - optional `.plan-state.json`
186
+
187
+ After writing the folder, the agent validates and previews it locally:
188
+
189
+ ```bash
190
+ agent-native plan local preview --dir plans/<slug> --kind plan
191
+ ```
192
+
193
+ If you run the Plan app locally with the same `PLAN_LOCAL_DIR`, you can open the
194
+ read-only app route:
195
+
196
+ ```text
197
+ http://localhost:<port>/local-plans/<slug>
198
+ ```
199
+
200
+ Local-files mode prevents plan or recap content from going to the Agent-Native
201
+ Plan database. It also disables hosted sharing, browser comments, plan history,
202
+ and publish/export receipts until you explicitly opt into publishing. It does
203
+ not automatically make your coding agent's LLM local; choose a local or approved
204
+ model if that privacy boundary matters too.
205
+
165
206
  ## Useful prompts
166
207
 
167
208
  - "Use `/visual-plan` before changing the auth flow."
@@ -169,6 +210,7 @@ Never put shared secrets in skill files.
169
210
  - "Use `/visual-plan` on the Markdown plan below and make it easier to review."
170
211
  - "Run `/visual-recap` on this PR so I can review the shape of the change first."
171
212
  - "Use `/visual-recap` on the diff between `main` and this branch."
213
+ - "Use `/visual-recap` in local-files mode so no recap content is written to the Plan DB."
172
214
 
173
215
  ## Recovering from auth errors {#auth-errors}
174
216
 
@@ -205,7 +247,9 @@ persistence, or running a fully self-hosted review surface.
205
247
  For fully offline, no-account use, you can run the Plans app locally and sync
206
248
  your plans to your repo as MDX. This local mode is a separate, advanced path —
207
249
  not the default hosted flow — and is best when you need everything to stay on
208
- your machine and in version control.
250
+ your machine and in version control. For the stricter no-DB path, use
251
+ [local-files privacy mode](#local-files), which reads from MDX folders instead
252
+ of creating local SQL rows.
209
253
 
210
254
  ## What's next
211
255
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-native/core",
3
- "version": "0.44.3",
3
+ "version": "0.45.0",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": ">=22"
@@ -95,9 +95,9 @@ For local stdio proxying, Codex/Cowork compatibility, or clients without
95
95
  remote MCP OAuth, use the hosted connect fallback:
96
96
 
97
97
  ```bash
98
- npx @agent-native/core connect https://dispatch.agent-native.com
98
+ npx @agent-native/core@latest connect https://dispatch.agent-native.com
99
99
  # or, for an isolated app:
100
- npx @agent-native/core connect https://mail.agent-native.com
100
+ npx @agent-native/core@latest connect https://mail.agent-native.com
101
101
  ```
102
102
 
103
103
  The command opens the app in the browser, the user clicks **Authorize**, and a
@@ -111,6 +111,19 @@ Claude bearer-token entry is the migration path: the CLI replaces
111
111
  `Authorization` headers with URL-only OAuth config and tells the user to
112
112
  authenticate from `/mcp`.
113
113
 
114
+ To re-authenticate an already-installed local/fallback client without
115
+ reinstalling skills or connectors, use:
116
+
117
+ ```bash
118
+ npx @agent-native/core@latest reconnect https://dispatch.agent-native.com --client codex
119
+ # or:
120
+ npx @agent-native/core@latest connect reconnect https://dispatch.agent-native.com --client codex
121
+ ```
122
+
123
+ With no URL, `reconnect` searches the selected client config for the existing
124
+ Agent Native MCP entry. Pass `--name <serverName>` when the config has multiple
125
+ entries or a custom server name.
126
+
114
127
  Under the hood: a logged-in browser session mints an `A2A_SECRET`-signed JWT
115
128
  carrying the caller's `sub` + `org_domain` and a unique `jti`, so tool runs
116
129
  stay tenant-scoped via `runWithRequestContext`. The existing
@@ -339,14 +352,17 @@ and mutating actions are filtered out (`filterPublicAgentActions`). The full
339
352
  surface appears when authenticated as a real caller: a deployed /
340
353
  `AGENT_MODE=production` app, or a local app reached through `connect` /
341
354
  `agent-native mcp install` (which provisions an identity-bearing token). A
342
- sparse `tools/list` means you are hitting an unauthenticated dev endpoint —
343
- connect or present a token rather than assuming the action is missing.
355
+ sparse or empty `tools/list` is diagnostic, not proof of auth failure: check
356
+ OAuth scopes, compact-catalog filtering, and the client/server auth status
357
+ before telling the user they are unauthenticated.
344
358
 
345
359
  ## Do
346
360
 
347
361
  - Do connect local/fallback clients to Dispatch with
348
- `npx @agent-native/core connect https://dispatch.agent-native.com`; use a
349
- direct app URL only when the host should be isolated to one app.
362
+ `npx @agent-native/core@latest connect https://dispatch.agent-native.com`;
363
+ use `npx @agent-native/core@latest reconnect ...` for reauth without
364
+ reinstalling; use a direct app URL only when the host should be isolated to
365
+ one app.
350
366
  - Do add a `link` builder to any action that produces or lists a navigable
351
367
  resource (draft, event, dashboard, document).
352
368
  - Do add `mcpApp` when a UI-capable MCP host should render an inline review or