@agent-native/core 0.72.3 → 0.73.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.
- package/corpus/README.md +1 -1
- package/corpus/core/CHANGELOG.md +38 -0
- package/corpus/core/docs/content/skills-guide.md +14 -0
- package/corpus/core/docs/content/template-clips.md +7 -1
- package/corpus/core/package.json +6 -6
- package/corpus/core/src/a2a/client.ts +7 -3
- package/corpus/core/src/agent/durable-background.ts +25 -12
- package/corpus/core/src/cli/create.ts +1 -1
- package/corpus/core/src/cli/skills.ts +450 -19
- package/corpus/core/src/client/api-path.ts +28 -0
- package/corpus/core/src/client/embed-auth.ts +26 -0
- package/corpus/core/src/client/mcp-app-host.ts +6 -0
- package/corpus/core/src/client/mcp-apps/McpAppRenderer.tsx +227 -33
- package/corpus/core/src/client/resources/use-mcp-servers.ts +1 -0
- package/corpus/core/src/client/settings/DemoModeSection.tsx +3 -1
- package/corpus/core/src/demo/fetch-interceptor.ts +1 -1
- package/corpus/core/src/embedding/agent.ts +6 -1
- package/corpus/core/src/embedding/bridge.ts +34 -1
- package/corpus/core/src/mcp/build-server.ts +38 -10
- package/corpus/core/src/mcp/embed-app.ts +120 -45
- package/corpus/core/src/mcp/index.ts +5 -0
- package/corpus/core/src/mcp/org-directory.ts +70 -11
- package/corpus/core/src/mcp/server.ts +14 -0
- package/corpus/core/src/mcp-client/config.ts +12 -0
- package/corpus/core/src/mcp-client/index.ts +2 -0
- package/corpus/core/src/mcp-client/manager.ts +268 -9
- package/corpus/core/src/mcp-client/remote-store.ts +154 -0
- package/corpus/core/src/mcp-client/routes.ts +2 -0
- package/corpus/core/src/server/agent-chat-plugin.ts +8 -0
- package/corpus/core/src/server/auth.ts +7 -0
- package/corpus/core/src/server/index.ts +1 -0
- package/corpus/core/src/server/onboarding-html.ts +95 -9
- package/corpus/core/src/shared/mcp-embed-headers.ts +44 -3
- package/corpus/core/src/templates/default/AGENTS.md +4 -0
- package/corpus/core/src/templates/default/package.json +2 -1
- package/corpus/core/src/templates/headless/AGENTS.md +4 -0
- package/corpus/core/src/templates/headless/package.json +1 -0
- package/corpus/core/src/templates/workspace-root/AGENTS.md +4 -0
- package/corpus/core/src/templates/workspace-root/README.md +4 -0
- package/corpus/core/src/templates/workspace-root/package.json +1 -0
- package/corpus/core/src/vite/client.ts +53 -0
- package/corpus/templates/analytics/actions/update-dashboard.ts +3 -4
- package/corpus/templates/analytics/app/components/dashboard/SqlChart.tsx +144 -40
- package/corpus/templates/analytics/app/global.css +15 -13
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/PanelEditorDialog.tsx +9 -32
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/SqlChartCard.tsx +0 -26
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/index.tsx +0 -23
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/pivot.ts +65 -2
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/types.ts +3 -4
- package/corpus/templates/analytics/changelog/2026-06-24-dashboard-charts-now-fill-sparse-template-time-series-suppor.md +6 -0
- package/corpus/templates/analytics/changelog/2026-06-24-dashboard-rows-now-auto-fit-panels-so-one-two-or-three-chart.md +6 -0
- package/corpus/templates/analytics/changelog/2026-06-24-dashboard-traffic-tables-now-show-top-urls-and-shared-clips-.md +6 -0
- package/corpus/templates/analytics/changelog/2026-06-24-first-party-signup-and-pageview-panels-now-honor-dashboard-filters.md +5 -0
- package/corpus/templates/analytics/changelog/2026-06-24-first-party-template-dashboards-now-include-repeat-users-ret.md +6 -0
- package/corpus/templates/analytics/changelog/2026-06-24-retention-charts-now-break-out-1-day-and-7-day-return-rates-.md +6 -0
- package/corpus/templates/analytics/seeds/dashboards/agent-native-templates-first-party.json +256 -44
- package/corpus/templates/analytics/server/lib/dashboard-catalog.ts +7 -2
- package/corpus/templates/analytics/server/lib/first-party-analytics.ts +35 -8
- package/corpus/templates/analytics/server/lib/first-party-metric-catalog.ts +287 -42
- package/corpus/templates/assets/.agents/skills/a2a-assets/SKILL.md +17 -10
- package/corpus/templates/assets/.agents/skills/asset-generation/SKILL.md +15 -6
- package/corpus/templates/assets/AGENTS.md +7 -5
- package/corpus/templates/assets/actions/generate-asset.ts +161 -0
- package/corpus/templates/assets/actions/list-assets.ts +4 -2
- package/corpus/templates/assets/actions/open-asset-picker.ts +84 -3
- package/corpus/templates/assets/app/routes/library.tsx +243 -40
- package/corpus/templates/calendar/changelog/2026-06-23-added-a-heads-up-explaining-google-s-app-not-verified-screen.md +1 -1
- package/corpus/templates/calendar/server/plugins/auth.ts +12 -0
- package/corpus/templates/clips/.agents/skills/recording/SKILL.md +7 -7
- package/corpus/templates/clips/AGENTS.md +6 -2
- package/corpus/templates/clips/app/components/capture-install-options.tsx +20 -4
- package/corpus/templates/clips/app/components/player/player-controls.tsx +62 -32
- package/corpus/templates/clips/app/lib/capture-install-options.ts +39 -5
- package/corpus/templates/clips/app/routes/download.tsx +2 -2
- package/corpus/templates/clips/app/routes/share.$shareId.tsx +1 -1
- package/corpus/templates/clips/changelog/2026-06-24-inline-slack-playback-controls-no-longer-shift-when-adjustin.md +6 -0
- package/corpus/templates/clips/changelog/2026-06-24-shared-clips-now-expose-their-full-console-log-stream-all-le.md +6 -0
- package/corpus/templates/clips/changelog/2026-06-24-shared-clips-now-expose-their-full-fetch-xhr-network-request.md +6 -0
- package/corpus/templates/clips/changelog/2026-06-24-the-chrome-extension-option-now-only-appears-on-supported-hosts.md +5 -0
- package/corpus/templates/clips/chrome-extension/STORE_DRAFT.md +13 -8
- package/corpus/templates/clips/chrome-extension/public/manifest.json +1 -1
- package/corpus/templates/clips/chrome-extension/scripts/package.ts +15 -2
- package/corpus/templates/clips/chrome-extension/src/overlay.css +4 -25
- package/corpus/templates/clips/chrome-extension/src/overlay.ts +1 -3
- package/corpus/templates/clips/desktop/src-tauri/src/native_speech.rs +9 -0
- package/corpus/templates/clips/server/lib/public-agent-context.ts +67 -24
- package/corpus/templates/design/AGENTS.md +10 -5
- package/corpus/templates/design/actions/connect-assets-mcp.ts +131 -0
- package/corpus/templates/design/actions/insert-asset.ts +219 -0
- package/corpus/templates/design/actions/view-screen.ts +3 -1
- package/corpus/templates/design/app/components/editor/PromptDialog.tsx +1 -1
- package/corpus/templates/design/app/pages/DesignEditor.tsx +53 -0
- package/corpus/templates/design/server/plugins/agent-chat.ts +5 -1
- package/corpus/templates/design/server/plugins/assets-mcp.ts +60 -0
- package/corpus/templates/mail/server/plugins/auth.ts +4 -1
- package/corpus/templates/plan/app/pages/PlansPage.tsx +271 -197
- package/corpus/templates/plan/server/plan-content.ts +45 -2
- package/dist/a2a/client.d.ts +1 -0
- package/dist/a2a/client.d.ts.map +1 -1
- package/dist/a2a/client.js +5 -3
- package/dist/a2a/client.js.map +1 -1
- package/dist/agent/durable-background.d.ts +9 -4
- package/dist/agent/durable-background.d.ts.map +1 -1
- package/dist/agent/durable-background.js +24 -11
- package/dist/agent/durable-background.js.map +1 -1
- package/dist/cli/create.js +1 -1
- package/dist/cli/create.js.map +1 -1
- package/dist/cli/skills.d.ts.map +1 -1
- package/dist/cli/skills.js +361 -19
- package/dist/cli/skills.js.map +1 -1
- package/dist/client/api-path.d.ts.map +1 -1
- package/dist/client/api-path.js +27 -0
- package/dist/client/api-path.js.map +1 -1
- package/dist/client/embed-auth.d.ts.map +1 -1
- package/dist/client/embed-auth.js +27 -0
- package/dist/client/embed-auth.js.map +1 -1
- package/dist/client/mcp-app-host.d.ts.map +1 -1
- package/dist/client/mcp-app-host.js +5 -0
- package/dist/client/mcp-app-host.js.map +1 -1
- package/dist/client/mcp-apps/McpAppRenderer.d.ts +1 -0
- package/dist/client/mcp-apps/McpAppRenderer.d.ts.map +1 -1
- package/dist/client/mcp-apps/McpAppRenderer.js +179 -33
- package/dist/client/mcp-apps/McpAppRenderer.js.map +1 -1
- package/dist/client/resources/use-mcp-servers.d.ts +1 -0
- package/dist/client/resources/use-mcp-servers.d.ts.map +1 -1
- package/dist/client/resources/use-mcp-servers.js.map +1 -1
- package/dist/client/settings/DemoModeSection.d.ts.map +1 -1
- package/dist/client/settings/DemoModeSection.js +3 -1
- package/dist/client/settings/DemoModeSection.js.map +1 -1
- package/dist/demo/fetch-interceptor.js +1 -1
- package/dist/demo/fetch-interceptor.js.map +1 -1
- package/dist/embedding/agent.d.ts +1 -1
- package/dist/embedding/agent.d.ts.map +1 -1
- package/dist/embedding/agent.js +1 -1
- package/dist/embedding/agent.js.map +1 -1
- package/dist/embedding/bridge.d.ts.map +1 -1
- package/dist/embedding/bridge.js +27 -1
- package/dist/embedding/bridge.js.map +1 -1
- package/dist/extensions/schema.d.ts +2 -2
- package/dist/mcp/build-server.d.ts +2 -0
- package/dist/mcp/build-server.d.ts.map +1 -1
- package/dist/mcp/build-server.js +32 -9
- package/dist/mcp/build-server.js.map +1 -1
- package/dist/mcp/embed-app.d.ts.map +1 -1
- package/dist/mcp/embed-app.js +120 -45
- package/dist/mcp/embed-app.js.map +1 -1
- package/dist/mcp/index.d.ts +1 -0
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +1 -0
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/org-directory.d.ts +1 -0
- package/dist/mcp/org-directory.d.ts.map +1 -1
- package/dist/mcp/org-directory.js +59 -11
- package/dist/mcp/org-directory.js.map +1 -1
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +9 -0
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp-client/config.d.ts +12 -0
- package/dist/mcp-client/config.d.ts.map +1 -1
- package/dist/mcp-client/config.js.map +1 -1
- package/dist/mcp-client/index.d.ts +1 -1
- package/dist/mcp-client/index.d.ts.map +1 -1
- package/dist/mcp-client/index.js +1 -1
- package/dist/mcp-client/index.js.map +1 -1
- package/dist/mcp-client/manager.d.ts +2 -0
- package/dist/mcp-client/manager.d.ts.map +1 -1
- package/dist/mcp-client/manager.js +201 -9
- package/dist/mcp-client/manager.js.map +1 -1
- package/dist/mcp-client/remote-store.d.ts +27 -0
- package/dist/mcp-client/remote-store.d.ts.map +1 -1
- package/dist/mcp-client/remote-store.js +105 -0
- package/dist/mcp-client/remote-store.js.map +1 -1
- package/dist/mcp-client/routes.d.ts +1 -0
- package/dist/mcp-client/routes.d.ts.map +1 -1
- package/dist/mcp-client/routes.js +1 -0
- package/dist/mcp-client/routes.js.map +1 -1
- package/dist/provider-api/actions/github-repo-files.d.ts +2 -2
- package/dist/provider-api/actions/query-staged-dataset.d.ts +3 -3
- package/dist/provider-api/corpus-jobs.d.ts +8 -8
- package/dist/server/agent-chat-plugin.d.ts +2 -0
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +8 -0
- package/dist/server/agent-chat-plugin.js.map +1 -1
- package/dist/server/auth.d.ts +7 -0
- package/dist/server/auth.d.ts.map +1 -1
- package/dist/server/auth.js +1 -0
- package/dist/server/auth.js.map +1 -1
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +1 -1
- package/dist/server/index.js.map +1 -1
- package/dist/server/onboarding-html.d.ts +15 -0
- package/dist/server/onboarding-html.d.ts.map +1 -1
- package/dist/server/onboarding-html.js +73 -9
- package/dist/server/onboarding-html.js.map +1 -1
- package/dist/shared/mcp-embed-headers.d.ts +3 -1
- package/dist/shared/mcp-embed-headers.d.ts.map +1 -1
- package/dist/shared/mcp-embed-headers.js +40 -3
- package/dist/shared/mcp-embed-headers.js.map +1 -1
- package/dist/sharing/actions/list-resource-shares.d.ts +1 -1
- package/dist/sharing/actions/set-resource-visibility.d.ts +2 -2
- package/dist/sharing/actions/share-resource.d.ts +1 -1
- package/dist/sharing/schema.d.ts +1 -1
- package/dist/templates/default/AGENTS.md +4 -0
- package/dist/templates/default/package.json +2 -1
- package/dist/templates/headless/AGENTS.md +4 -0
- package/dist/templates/headless/package.json +1 -0
- package/dist/templates/workspace-root/AGENTS.md +4 -0
- package/dist/templates/workspace-root/README.md +4 -0
- package/dist/templates/workspace-root/package.json +1 -0
- package/dist/vite/client.d.ts.map +1 -1
- package/dist/vite/client.js +44 -0
- package/dist/vite/client.js.map +1 -1
- package/docs/content/skills-guide.md +14 -0
- package/docs/content/template-clips.md +7 -1
- package/package.json +6 -6
- package/src/templates/default/AGENTS.md +4 -0
- package/src/templates/default/package.json +2 -1
- package/src/templates/headless/AGENTS.md +4 -0
- package/src/templates/headless/package.json +1 -0
- package/src/templates/workspace-root/AGENTS.md +4 -0
- package/src/templates/workspace-root/README.md +4 -0
- package/src/templates/workspace-root/package.json +1 -0
package/corpus/README.md
CHANGED
package/corpus/core/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,43 @@
|
|
|
1
1
|
# @agent-native/core
|
|
2
2
|
|
|
3
|
+
## 0.73.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- d684bbf: Durable background agent runs are now **on by default** for hosted apps. Previously the `AGENT_CHAT_DURABLE_BACKGROUND` flag was opt-in (off unless set truthy); it is now opt-out — unset means enabled, and an app disables it with an explicit falsy value (`AGENT_CHAT_DURABLE_BACKGROUND=false`).
|
|
8
|
+
|
|
9
|
+
The gate still composes with the existing guards, so a run only goes durable when the runtime is hosted/serverless **and** `A2A_SECRET` is configured — local dev and unconfigured apps stay on the synchronous inline path unchanged. Default-on uses the server-driven agnostic continuation path (verified in prod: long multi-step runs complete past the 40s soft-timeout with no thrash and no int4 overflow). The Netlify 15-min `-background` function emit (`isDurableBackgroundDeployEnabled`) remains opt-in until its path is separately verified.
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- d684bbf: Clarify the Clips "agent-readable clips" docs so the "see and hear" promise is
|
|
14
|
+
accurate: frame-viewing works in any image-capable agent (ChatGPT, Claude Code,
|
|
15
|
+
Cursor, Codex, MCP-connected agents), while text-only web chats fall back to the
|
|
16
|
+
transcript and can take an uploaded frame. Verified empirically — ChatGPT fetches
|
|
17
|
+
the JPEG frame URLs and describes the screen; claude.ai's web chat reads the
|
|
18
|
+
transcript only. Docs-only copy change; the agent-context/frame APIs are
|
|
19
|
+
unchanged.
|
|
20
|
+
- d684bbf: Add scaffold skill refresh commands for generated Agent Native apps and workspaces, plus public `@agent-native/skills` status/update forwarding.
|
|
21
|
+
- d684bbf: Redesign the Google sign-in preflight notice on the onboarding/sign-in screen
|
|
22
|
+
to match the in-app connect popover: an amber warning-icon chip beside a bold
|
|
23
|
+
heading and muted body copy, with the close affordance moved to the top-right.
|
|
24
|
+
The `googleSignInNotice.body` already accepts a string array, so reassurance
|
|
25
|
+
like "It's safe to continue." now renders on its own line. The Continue /
|
|
26
|
+
Run-locally action buttons no longer wrap their labels (`white-space: nowrap`).
|
|
27
|
+
Purely presentational — the host-gating, Continue, and Run-locally behaviors are
|
|
28
|
+
unchanged.
|
|
29
|
+
- d684bbf: Add a secondary hosted-app signup notice linking to the Agent-Native Terms and Privacy Policy.
|
|
30
|
+
|
|
31
|
+
## 0.72.4
|
|
32
|
+
|
|
33
|
+
### Patch Changes
|
|
34
|
+
|
|
35
|
+
- 17b696f: Avoid credentialed cross-origin demo status checks from opaque embedded MCP app frames.
|
|
36
|
+
- 17b696f: Mint a fresh MCP App embed session when cached host state contains an expired one-time embed ticket, and keep native MCP host shells alive so they can recover on refresh.
|
|
37
|
+
- 17b696f: Handle asset picker selections from opaque MCP App parent frames and wait for native MCP host initialization before forwarding selected asset messages.
|
|
38
|
+
- 17b696f: Inject per-request identity tokens for trusted first-party org-scoped remote MCP servers, preserving static headers for third-party remotes.
|
|
39
|
+
- 17b696f: Bound MCP client connection and tools/list handshakes so stale org MCP servers do not stall dev-server startup after reloads.
|
|
40
|
+
|
|
3
41
|
## 0.72.3
|
|
4
42
|
|
|
5
43
|
### Patch Changes
|
|
@@ -264,3 +264,17 @@ npx @agent-native/core@latest skills update visual-plan
|
|
|
264
264
|
the copied folder hash to the latest bundled skill, and rewrites stale folders in
|
|
265
265
|
place. Newly copied Agent Native skills include an `agent-native-skill.json`
|
|
266
266
|
marker so future status output can identify the source and hash.
|
|
267
|
+
|
|
268
|
+
Generated Agent Native apps and workspaces also include framework-provided
|
|
269
|
+
skills under `.agents/skills` (or `packages/shared/.agents/skills` in a
|
|
270
|
+
workspace). Refresh those scaffolded skills from the current/latest CLI with:
|
|
271
|
+
|
|
272
|
+
```bash
|
|
273
|
+
npm run skills:update
|
|
274
|
+
# or, without relying on the local package script:
|
|
275
|
+
npx @agent-native/core@latest skills update scaffold --project
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
`AGENTS.md` and `.agents/skills` stay canonical. The update command also repairs
|
|
279
|
+
Claude compatibility links (`CLAUDE.md` and `.claude/skills`) so Claude Code sees
|
|
280
|
+
the same instructions without maintaining a second copy.
|
|
@@ -15,7 +15,7 @@ A capture-everything app: screen recordings, meeting notes from your calendar, a
|
|
|
15
15
|
}
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
-
Think along the lines of Loom + Granola + Wispr Flow rolled into one app — but the agent is a first-class editor across every surface, and the recordings, meetings, and dictations are yours, not a SaaS vendor's. Clips also makes shared recordings agent-readable: paste a normal Clips share link into an agent
|
|
18
|
+
Think along the lines of Loom + Granola + Wispr Flow rolled into one app — but the agent is a first-class editor across every surface, and the recordings, meetings, and dictations are yours, not a SaaS vendor's. Clips also makes shared recordings agent-readable: paste a normal Clips share link into an agent and it can "hear" the transcript as text and "see" timestamped screen frames as images — no raw video needed. Frame-viewing works in any image-capable agent (ChatGPT, Claude Code, Cursor, Codex); text-only web chats still get the full transcript and can take a frame you upload.
|
|
19
19
|
|
|
20
20
|
```an-diagram title="Capture, transcribe, reuse" summary="Three capture types land in one library; the agent transcribes, titles, and summarizes, then every transcript is searchable and shareable."
|
|
21
21
|
{
|
|
@@ -69,6 +69,12 @@ a compact agent context URL, and that context points to the transcript and frame
|
|
|
69
69
|
APIs, so models that only accept text or still images can still understand what
|
|
70
70
|
happened in the recording.
|
|
71
71
|
|
|
72
|
+
Any agent that can fetch an image URL into its vision — ChatGPT, Claude Code,
|
|
73
|
+
Cursor, Codex, and MCP-connected agents — reads the transcript and sees the
|
|
74
|
+
frames. A few text-only web chats read the transcript but won't pull frame images
|
|
75
|
+
in on their own; there, upload a key frame or open the clip in an image-capable
|
|
76
|
+
agent.
|
|
77
|
+
|
|
72
78
|
| Endpoint | What agents get |
|
|
73
79
|
| ------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
|
|
74
80
|
| `/api/agent-context.json?id=<recordingId>` | Clip metadata, transcript status, chapters, CTAs, recommended frames, and links to the transcript/frame APIs |
|
package/corpus/core/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-native/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.73.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=22"
|
|
@@ -70,6 +70,11 @@
|
|
|
70
70
|
"./client/observability": "./dist/client/observability/index.js",
|
|
71
71
|
"./client/onboarding": "./dist/client/onboarding/index.js",
|
|
72
72
|
"./client/settings/useBuilderStatus": "./dist/client/settings/useBuilderStatus.js",
|
|
73
|
+
"./embedding": "./dist/embedding/index.js",
|
|
74
|
+
"./embedding/agent": "./dist/embedding/agent.js",
|
|
75
|
+
"./embedding/bridge": "./dist/embedding/bridge.js",
|
|
76
|
+
"./embedding/protocol": "./dist/embedding/protocol.js",
|
|
77
|
+
"./embedding/react": "./dist/embedding/react.js",
|
|
73
78
|
"./onboarding": "./dist/onboarding/index.js",
|
|
74
79
|
"./shared": "./dist/shared/index.js",
|
|
75
80
|
"./scripts": "./dist/scripts/index.js",
|
|
@@ -117,11 +122,6 @@
|
|
|
117
122
|
"./router": "./dist/router/index.js",
|
|
118
123
|
"./collab": "./dist/collab/index.js",
|
|
119
124
|
"./a2a": "./dist/a2a/index.js",
|
|
120
|
-
"./embedding": "./dist/embedding/index.js",
|
|
121
|
-
"./embedding/react": "./dist/embedding/react.js",
|
|
122
|
-
"./embedding/bridge": "./dist/embedding/bridge.js",
|
|
123
|
-
"./embedding/agent": "./dist/embedding/agent.js",
|
|
124
|
-
"./embedding/protocol": "./dist/embedding/protocol.js",
|
|
125
125
|
"./mcp": "./dist/mcp/index.js",
|
|
126
126
|
"./mcp-client": "./dist/mcp-client/index.js",
|
|
127
127
|
"./tracking": "./dist/tracking/index.js",
|
|
@@ -43,6 +43,7 @@ export async function signA2AToken(
|
|
|
43
43
|
options?: {
|
|
44
44
|
expiresIn?: string | number;
|
|
45
45
|
preferGlobalSecret?: boolean;
|
|
46
|
+
audience?: string | string[];
|
|
46
47
|
/**
|
|
47
48
|
* Extra JWT claims to merge alongside `sub` / `org_domain`. Used by the
|
|
48
49
|
* MCP connect flow to add a revocable `jti` and a `scope: "mcp-connect"`
|
|
@@ -67,7 +68,7 @@ export async function signA2AToken(
|
|
|
67
68
|
process.env.BETTER_AUTH_URL ||
|
|
68
69
|
"http://localhost:3000";
|
|
69
70
|
|
|
70
|
-
|
|
71
|
+
const jwt = new jose.SignJWT({
|
|
71
72
|
...(options?.extraClaims ?? {}),
|
|
72
73
|
// `sub` / `org_domain` are spread AFTER extraClaims so a caller-supplied
|
|
73
74
|
// map can never override the verified identity claims.
|
|
@@ -77,8 +78,11 @@ export async function signA2AToken(
|
|
|
77
78
|
.setProtectedHeader({ alg: "HS256" })
|
|
78
79
|
.setIssuer(appUrl)
|
|
79
80
|
.setIssuedAt()
|
|
80
|
-
.setExpirationTime(options?.expiresIn ?? "15m")
|
|
81
|
-
|
|
81
|
+
.setExpirationTime(options?.expiresIn ?? "15m");
|
|
82
|
+
|
|
83
|
+
if (options?.audience) jwt.setAudience(options.audience);
|
|
84
|
+
|
|
85
|
+
return jwt.sign(new TextEncoder().encode(secret));
|
|
82
86
|
}
|
|
83
87
|
|
|
84
88
|
export class A2AClient {
|
|
@@ -17,8 +17,10 @@
|
|
|
17
17
|
*
|
|
18
18
|
* GUARDRAIL: when `isAgentChatDurableBackgroundEnabled()` returns false, the
|
|
19
19
|
* agent-chat handler must behave byte-for-byte like the current synchronous
|
|
20
|
-
* path. The
|
|
21
|
-
* 1. `AGENT_CHAT_DURABLE_BACKGROUND` env is
|
|
20
|
+
* path. The gate is true only when ALL of these hold:
|
|
21
|
+
* 1. `AGENT_CHAT_DURABLE_BACKGROUND` env is not explicitly disabled. It is
|
|
22
|
+
* DEFAULT-ON: unset/empty counts as enabled; set it to a falsy value
|
|
23
|
+
* (`false`/`0`/`no`/`off`) to opt a specific app back out.
|
|
22
24
|
* 2. The runtime is hosted/serverless (local dev keeps the inline path so SSE
|
|
23
25
|
* stays a single live stream and no second function is needed).
|
|
24
26
|
* 3. `A2A_SECRET` is configured (the HMAC handoff is required to authenticate
|
|
@@ -41,7 +43,10 @@ import {
|
|
|
41
43
|
export const AGENT_CHAT_PROCESS_RUN_PATH =
|
|
42
44
|
"/_agent-native/agent-chat/_process-run";
|
|
43
45
|
|
|
44
|
-
/**
|
|
46
|
+
/**
|
|
47
|
+
* Env flag for durable background runs. DEFAULT-ON: unset means enabled; an app
|
|
48
|
+
* opts OUT with an explicit falsy value (`false`/`0`/`no`/`off`).
|
|
49
|
+
*/
|
|
45
50
|
export const AGENT_CHAT_DURABLE_BACKGROUND_ENV =
|
|
46
51
|
"AGENT_CHAT_DURABLE_BACKGROUND";
|
|
47
52
|
|
|
@@ -87,21 +92,29 @@ function isFlagEnabled(): boolean {
|
|
|
87
92
|
// Read the literal key (not `process.env[CONST]`) so guard:no-env-credentials
|
|
88
93
|
// can statically verify it against the allowlisted `AGENT_*` prefix. Keep this
|
|
89
94
|
// in sync with AGENT_CHAT_DURABLE_BACKGROUND_ENV.
|
|
95
|
+
//
|
|
96
|
+
// DEFAULT-ON: durable background runs are the desired behavior for every
|
|
97
|
+
// hosted app (verified in prod — long multi-step runs complete past the 40s
|
|
98
|
+
// soft-timeout with no thrash). So an unset flag means ON; an app opts OUT
|
|
99
|
+
// only with an explicit falsy value. This still composes with the hosted +
|
|
100
|
+
// A2A_SECRET gates below, so non-hosted / unconfigured apps stay synchronous.
|
|
90
101
|
const raw = process.env.AGENT_CHAT_DURABLE_BACKGROUND;
|
|
91
|
-
if (raw == null) return
|
|
102
|
+
if (raw == null) return true;
|
|
92
103
|
const normalized = raw.trim().toLowerCase();
|
|
93
|
-
return (
|
|
94
|
-
normalized === "
|
|
95
|
-
normalized === "
|
|
96
|
-
normalized === "
|
|
97
|
-
normalized === "
|
|
104
|
+
return !(
|
|
105
|
+
normalized === "0" ||
|
|
106
|
+
normalized === "false" ||
|
|
107
|
+
normalized === "no" ||
|
|
108
|
+
normalized === "off"
|
|
98
109
|
);
|
|
99
110
|
}
|
|
100
111
|
|
|
101
112
|
/**
|
|
102
|
-
* The single gate. True
|
|
103
|
-
* A2A_SECRET is configured. False otherwise — and
|
|
104
|
-
* synchronous behavior is used, unchanged.
|
|
113
|
+
* The single gate. True when the flag is not explicitly disabled (default-on)
|
|
114
|
+
* AND the runtime is hosted AND A2A_SECRET is configured. False otherwise — and
|
|
115
|
+
* false means the current synchronous behavior is used, unchanged. So a local /
|
|
116
|
+
* non-hosted / unconfigured app stays synchronous even with the flag defaulting
|
|
117
|
+
* on; durable only engages where the runtime actually supports it.
|
|
105
118
|
*/
|
|
106
119
|
export function isAgentChatDurableBackgroundEnabled(): boolean {
|
|
107
120
|
return (
|
|
@@ -1893,7 +1893,7 @@ function copyDir(src: string, dest: string, root?: string): void {
|
|
|
1893
1893
|
|
|
1894
1894
|
function shouldSkipScaffoldEntry(name: string, srcPath?: string): boolean {
|
|
1895
1895
|
if (
|
|
1896
|
-
|
|
1896
|
+
/^settings(?:\..*)?\.json$/.test(name) &&
|
|
1897
1897
|
srcPath?.split(path.sep).includes(".claude")
|
|
1898
1898
|
) {
|
|
1899
1899
|
return true;
|