@agent-native/core 0.211.0 → 0.212.0-nightly-20261021010049
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/README.md +1 -1
- package/dist/app-config/analytics.d.ts +1 -0
- package/dist/app-config/analytics.js +7 -0
- package/dist/app-config/schema.d.ts +1 -0
- package/dist/chat-threads/store.d.ts +28 -2
- package/dist/chat-threads/store.js +75 -13
- package/dist/cli/template-baseline.js +18 -5
- package/dist/cli/template-sync.js +100 -19
- package/dist/client/agent-chat/index.d.ts +2 -1
- package/dist/client/agent-chat/index.js +2 -1
- package/dist/client/chat/agentkit-protocol.js +21 -1
- package/dist/client/chat/run-outcome.d.ts +1 -0
- package/dist/client/chat/runtime.js +6 -0
- package/dist/client/sharing/index.d.ts +2 -1
- package/dist/client/sharing/index.js +2 -1
- package/dist/client/sharing/share-controller-helpers.d.ts +14 -1
- package/dist/client/sharing/share-controller-helpers.js +46 -1
- package/dist/client/sharing/useShareButtonController.d.ts +12 -0
- package/dist/client/sharing/useShareButtonController.js +76 -57
- package/dist/client/sharing/useShareDialogController.d.ts +3 -0
- package/dist/client/sharing/useShareDialogController.js +77 -49
- package/dist/client/sharing/useShareVisibilityTransition.d.ts +68 -0
- package/dist/client/sharing/useShareVisibilityTransition.js +224 -0
- package/dist/client/use-chat-thread-list.d.ts +40 -0
- package/dist/client/use-chat-thread-list.js +210 -0
- package/dist/client/use-chat-threads.d.ts +67 -0
- package/dist/client/use-chat-threads.js +141 -23
- package/dist/client/use-db-sync.d.ts +1 -0
- package/dist/client/use-db-sync.js +13 -1
- package/dist/collab/__fixtures__/live-copy-tasks.d.ts +1 -0
- package/dist/collab/__fixtures__/live-copy-tasks.js +92 -0
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/collab/bounded-task-bundle.d.ts +17 -0
- package/dist/collab/bounded-task-bundle.js +39 -0
- package/dist/collab/bounded-task-source.d.ts +14 -0
- package/dist/collab/bounded-task-source.js +8 -0
- package/dist/collab/bounded-tasks.d.ts +67 -0
- package/dist/collab/bounded-tasks.js +439 -0
- package/dist/collab/client.js +2 -1
- package/dist/collab/index.d.ts +5 -2
- package/dist/collab/index.js +5 -2
- package/dist/collab/live-copy-tasks.d.ts +80 -0
- package/dist/collab/live-copy-tasks.js +330 -0
- package/dist/collab/live-copy.d.ts +188 -0
- package/dist/collab/live-copy.js +415 -0
- package/dist/collab/routes.d.ts +5 -0
- package/dist/collab/routes.js +24 -8
- package/dist/collab/storage.d.ts +53 -1
- package/dist/collab/storage.js +93 -5
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/collab/ydoc-manager.d.ts +92 -3
- package/dist/collab/ydoc-manager.js +447 -38
- package/dist/db/client.d.ts +6 -0
- package/dist/db/client.js +25 -5
- package/dist/deploy/build.js +2 -0
- package/dist/extensions/actions.js +1 -0
- package/dist/jobs/actions/manage-recurring-job.d.ts +1 -1
- package/dist/mcp/agent-connected.js +5 -1
- package/dist/mcp/build-server.js +39 -10
- package/dist/notifications/routes.d.ts +1 -1
- package/dist/observability/routes.d.ts +1 -1
- package/dist/org/index.d.ts +2 -2
- package/dist/progress/routes.d.ts +1 -1
- package/dist/provider-api/actions/custom-provider-registration.d.ts +16 -16
- package/dist/provider-api/actions/provider-api.d.ts +10 -10
- package/dist/server/agent-chat-plugin.js +80 -17
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/agent-engine-default-model-route.d.ts +1 -1
- package/dist/server/analytics.d.ts +1 -0
- package/dist/server/analytics.js +18 -1
- package/dist/server/collab-plugin.d.ts +10 -1
- package/dist/server/collab-plugin.js +89 -20
- package/dist/server/index.d.ts +1 -1
- package/dist/server/realtime-token.d.ts +1 -1
- package/dist/shared/optional-node-builtins.d.ts +1 -0
- package/dist/shared/optional-node-builtins.js +3 -0
- package/dist/sharing/access.d.ts +1 -0
- package/dist/sharing/access.js +113 -95
- package/dist/tracking/providers.d.ts +1 -0
- package/dist/tracking/providers.js +2 -1
- package/dist/triggers/actions/manage-automation.d.ts +2 -2
- package/dist/vite/bounded-task-plugin.d.ts +22 -0
- package/dist/vite/bounded-task-plugin.js +44 -0
- package/dist/vite/client.js +2 -0
- package/dist/vitest-config.js +3 -0
- package/dist/workspace-connections/actions/list-workspace-user-groups.d.ts +1 -1
- package/docs/content/deployment-environment-variables.mdx +1 -0
- package/docs/content/environment-variables.mdx +1 -0
- package/docs/content/sharing.mdx +36 -0
- package/docs/content/toolkit-sharing.mdx +98 -12
- package/package.json +5 -3
|
@@ -20,6 +20,7 @@ hosting behavior.
|
|
|
20
20
|
| `APP_URL` | Optional canonical public origin. Checked ahead of `BETTER_AUTH_URL` when resolving the A2A JWT audience, the OAuth public origin, self-dispatch webhook targets, and generated resource links. Set it explicitly on preview/staging deploys where the request host is unreliable. |
|
|
21
21
|
| `AGENT_PROD_CODE_EXECUTION` | Optional production code-execution mode: `off` (default), `sandboxed`, or `trusted`. See [Production Code Execution](/docs/actions-agent-tools#production-code-execution). |
|
|
22
22
|
| `AGENT_NATIVE_SSR_CACHE` | Deployment-wide SSR shell cache policy: unset/`on` keeps the default hard-cache, `off` sends `no-store`, or a duration such as `30s` / `5m` sets a shorter freshness. See [SSR Caching](/docs/ssr-caching). |
|
|
23
|
+
| `AGENT_NATIVE_HEAD_SCRIPT_SRC` | Optional HTTPS URL of a script loaded with `defer` in the `<head>` of every server-rendered page. Use it for deployment-specific tooling such as an internal feedback widget, without changing app source. Non-HTTPS URLs fail config validation. |
|
|
23
24
|
| `AGENT_NATIVE_ENABLE_KEEP_WARM` | Opt into the Netlify keep-warm scheduled function. Unset by default. See [Keep-warm](/docs/netlify#netlify-keep-warm). |
|
|
24
25
|
| `AGENT_NATIVE_DISABLE_KEEP_WARM` | Compatibility kill switch for the Netlify keep-warm scheduled function. See [Keep-warm](/docs/netlify#netlify-keep-warm). |
|
|
25
26
|
| `AGENT_NATIVE_KEEP_WARM_SCHEDULE` | Override the keep-warm cadence with a 5-field cron expression (default `* * * * *` when enabled). An unparseable value fails the build. See [Keep-warm](/docs/netlify#netlify-keep-warm). |
|
|
@@ -95,6 +95,7 @@ public app behavior, use the config paths above instead.
|
|
|
95
95
|
| `ACCESS_TOKEN` / `ACCESS_TOKENS` | Static bearer fallback for MCP and Connect clients. | One token or a delimited token list; these are not browser auth. |
|
|
96
96
|
| `AGENT_PROD_CODE_EXECUTION` | Production code-execution policy. | `off`, `sandboxed`, or `trusted`. See [Production Code Execution](/docs/actions-agent-tools#production-code-execution). |
|
|
97
97
|
| `AGENT_NATIVE_SSR_CACHE` | Deployment-wide public SSR shell cache policy. | Unset/`on`, `off`, or a duration such as `30s` or `5m`. See [SSR Caching](/docs/ssr-caching). |
|
|
98
|
+
| `AGENT_NATIVE_HEAD_SCRIPT_SRC` | Extra script injected into every server-rendered page head with `defer`. | An absolute `https://` URL; non-HTTPS values fail config validation. |
|
|
98
99
|
| `AGENT_NATIVE_ENABLE_KEEP_WARM` | Opts into the Netlify keep-warm scheduled function; unset by default. | `1`; see [Keep-warm](/docs/netlify#netlify-keep-warm). |
|
|
99
100
|
| `AGENT_NATIVE_DISABLE_KEEP_WARM` | Compatibility kill switch for the Netlify keep-warm scheduled function. | `1`; see [Keep-warm](/docs/netlify#netlify-keep-warm). |
|
|
100
101
|
| `AGENT_NATIVE_KEEP_WARM_SCHEDULE` | Keep-warm cadence override when enabled. | A 5-field cron expression such as `*/5 * * * *`; an unparseable value fails the build. |
|
package/docs/content/sharing.mdx
CHANGED
|
@@ -135,6 +135,8 @@ Every shareable resource gets a share button in its header. Clicking it opens a
|
|
|
135
135
|
- General access: visibility selector (`Private` / `Organization` / `Public link`).
|
|
136
136
|
- A copy-link button that respects the current visibility.
|
|
137
137
|
|
|
138
|
+
Moving a resource from `Private` to `Organization` asks for confirmation first. Nothing changes until the user confirms. Cancel or Escape keeps the current access. If saving fails, the dialog shows the error and the user can try again. Other visibility changes save at once. The confirmation lives in the share UI only. `set-resource-visibility` is unchanged, so the agent and any other caller still change visibility directly and the resource's sharing policy still decides what is allowed.
|
|
139
|
+
|
|
138
140
|
<WireframeBlock id="doc-block-sharing2">
|
|
139
141
|
<Screen
|
|
140
142
|
surface="popover"
|
|
@@ -158,6 +160,40 @@ import { ShareButton } from "@agent-native/toolkit/app/sharing";
|
|
|
158
160
|
|
|
159
161
|
For lists, drop a `<VisibilityBadge visibility={row.visibility} />` next to each row so users can see at a glance what's private vs. shared.
|
|
160
162
|
|
|
163
|
+
## Shared chats {#shared-chats}
|
|
164
|
+
|
|
165
|
+
Agent chat threads use the same model. A new or forked chat is private to its owner, and sharing a chat follows the rules above.
|
|
166
|
+
|
|
167
|
+
Each chat in a history list carries two fields so a row can say whose chat it is and why you can see it:
|
|
168
|
+
|
|
169
|
+
| Field | Value |
|
|
170
|
+
| ------------- | ----------------------------------------------------------------------------------------------------------------- |
|
|
171
|
+
| `ownerEmail` | The chat's owner. |
|
|
172
|
+
| `accessBasis` | `owner`, `direct` (a grant to you by name), or `organization`. `direct` wins over `organization` when both apply. |
|
|
173
|
+
|
|
174
|
+
History lists and search take an `ownership` filter:
|
|
175
|
+
|
|
176
|
+
- `all` (default) lists every chat you can access.
|
|
177
|
+
- `mine` lists chats you own, even when they are shared with the organization.
|
|
178
|
+
- `shared` lists chats you can access that someone else owns.
|
|
179
|
+
|
|
180
|
+
The server applies `ownership` before pagination, so `limit`, `offset`, and `hasMore` describe the filtered list. Search takes the same filter. An unknown value is rejected with a 400 instead of falling back to `all`. Access rules do not change, and listing never loads transcripts.
|
|
181
|
+
|
|
182
|
+
Migration: custom history list and search callers must send a positive integer `limit` and a non-negative integer `offset`, or omit them to use the defaults. Malformed values now return HTTP 400 instead of being coerced. Valid limits above 200 are capped at 200.
|
|
183
|
+
|
|
184
|
+
In client code, `useChatThreadList()` from `@agent-native/core/client` pages one list at a time:
|
|
185
|
+
|
|
186
|
+
```tsx
|
|
187
|
+
import { useChatThreadList } from "@agent-native/core/client";
|
|
188
|
+
|
|
189
|
+
const shared = useChatThreadList({ ownership: "shared", pageSize: 50 });
|
|
190
|
+
// shared.threads, shared.hasMore, shared.loadMore(), shared.error
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
`refreshOnThreadUpdates` defaults to `true`. Set it to `false` to skip refreshes triggered by `notifyChatThreadsUpdated()`. Initial loading, manual `refresh()`, paging, and reloading after an Activity resumes still work. Changing this option preserves loaded rows and does not fetch by itself.
|
|
194
|
+
|
|
195
|
+
A failed request sets `error` and keeps the rows already loaded. It never looks like an empty list. `<ShareButton>` and `<ShareDialog>` refresh mounted chat lists after they save. If you change a chat's sharing some other way, call `notifyChatThreadsUpdated()` so mounted lists refetch.
|
|
196
|
+
|
|
161
197
|
## Same model, agent and UI {#agent-and-ui}
|
|
162
198
|
|
|
163
199
|
The framework auto-mounts these actions in every template — the agent calls them as tools, and the UI calls them through `useActionQuery` / `useActionMutation`:
|
|
@@ -64,8 +64,10 @@ registerShareableResource({
|
|
|
64
64
|
Render the standard controls where users decide access:
|
|
65
65
|
|
|
66
66
|
```tsx
|
|
67
|
-
import {
|
|
68
|
-
|
|
67
|
+
import {
|
|
68
|
+
ShareButton,
|
|
69
|
+
VisibilityBadge,
|
|
70
|
+
} from "@agent-native/toolkit/app/sharing";
|
|
69
71
|
|
|
70
72
|
<VisibilityBadge visibility={dashboard.visibility} />;
|
|
71
73
|
<ShareButton resourceType="dashboard" resourceId={dashboard.id} />;
|
|
@@ -93,18 +95,39 @@ or mutations; core and app wrappers inject data and callbacks.
|
|
|
93
95
|
/>
|
|
94
96
|
</WireframeBlock>
|
|
95
97
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
import
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
`<ShareButton>` and `<ShareDialog>` are Toolkit UI exported from
|
|
103
|
-
`@agent-native/toolkit/app/sharing`. They use Core client hooks and the shared
|
|
104
|
-
sharing actions. When building custom sharing UI, import
|
|
105
|
-
`useShareButtonController` and `useShareDialogController` from
|
|
98
|
+
`<ShareButton>`, `<ShareDialog>`, and `<VisibilityBadge>` are exported from
|
|
99
|
+
`@agent-native/toolkit/app/sharing`. They use Core client hooks, the shared
|
|
100
|
+
sharing actions, and the app's localized text. When building custom sharing UI,
|
|
101
|
+
import `useShareButtonController` and `useShareDialogController` from
|
|
106
102
|
`@agent-native/core/client/sharing`.
|
|
107
103
|
|
|
104
|
+
The presentational pieces in `@agent-native/toolkit/sharing` take their text
|
|
105
|
+
from the app. `VisibilityBadge` there accepts a `labels` object with `private`,
|
|
106
|
+
`org`, and `public` text. Any label you leave out falls back to the legacy
|
|
107
|
+
English default ("Private", "Org", "Public"), so existing callers keep their
|
|
108
|
+
text. `OwnershipFilter` requires labels for `all`, `mine`, and `shared`. The
|
|
109
|
+
`@agent-native/toolkit/app/sharing` versions always fill those labels from the
|
|
110
|
+
app's localized text, so use them unless you supply the copy yourself.
|
|
111
|
+
|
|
112
|
+
Moving a resource from Private to Organization in `<ShareButton>` or
|
|
113
|
+
`<ShareDialog>` opens a confirmation first. Nothing is saved until the user
|
|
114
|
+
confirms, and Cancel or Escape keeps the current access. The confirmation is UI
|
|
115
|
+
intent only. The share actions and their policy checks are unchanged for the
|
|
116
|
+
agent. For chat threads, both components refresh mounted chat lists after they
|
|
117
|
+
save.
|
|
118
|
+
|
|
119
|
+
Custom surfaces get the same confirmation through
|
|
120
|
+
`useShareButtonController().visibilityTransition` (`request`, `confirm`,
|
|
121
|
+
`cancel`) and render it with `ShareVisibilityConfirmDialog`. `request` returns a
|
|
122
|
+
promise that resolves once the change is saved. A direct change rejects with
|
|
123
|
+
the save's error. A held change whose confirmation fails keeps the error and
|
|
124
|
+
the retry in the dialog and its promise stays pending until a retry succeeds,
|
|
125
|
+
or rejects with `ShareVisibilityNotSavedError` when it is cancelled or
|
|
126
|
+
invalidated, so a held change is never reported as saved. The
|
|
127
|
+
older `handleVisibilityChange` is a deprecated alias for `request` and never
|
|
128
|
+
skips the confirmation. Requests from a closed surface are ignored, and a
|
|
129
|
+
pending change is dropped when the resource changes.
|
|
130
|
+
|
|
108
131
|
### Toolkit vs Core {#toolkit-vs-core}
|
|
109
132
|
|
|
110
133
|
Toolkit sharing UI renders badges, rows, base dialogs, and role pickers when
|
|
@@ -113,6 +136,69 @@ request context, org membership lookups, share tables, resource registration,
|
|
|
113
136
|
access filters, visibility changes, invites, roles, and the private access
|
|
114
137
|
tokens that back agent-readable public surfaces.
|
|
115
138
|
|
|
139
|
+
## Shared chat history {#shared-chat-history}
|
|
140
|
+
|
|
141
|
+
`@agent-native/toolkit/chat-history` renders the chat sidebar. Core supplies the
|
|
142
|
+
rows and Toolkit renders them, so an app can show My chats and Shared with you
|
|
143
|
+
as separate sections. See [Sharing & Privacy](/docs/sharing#shared-chats) for
|
|
144
|
+
the `ownership` filter and the `ownerEmail` and `accessBasis` fields.
|
|
145
|
+
|
|
146
|
+
`<ChatHistoryRail>` accepts `sections` as well as a flat `items` list. Each
|
|
147
|
+
section previews five rows and has its own **Show all** and **Show less**
|
|
148
|
+
control, loading, error, and empty states, and optional load-more:
|
|
149
|
+
|
|
150
|
+
```tsx
|
|
151
|
+
import { ChatHistoryRail } from "@agent-native/toolkit/chat-history";
|
|
152
|
+
import { useChatThreadList } from "@agent-native/core/client";
|
|
153
|
+
|
|
154
|
+
const mine = useChatThreadList({ ownership: "mine" });
|
|
155
|
+
const shared = useChatThreadList({ ownership: "shared" });
|
|
156
|
+
|
|
157
|
+
<ChatHistoryRail
|
|
158
|
+
onNewChat={startChat}
|
|
159
|
+
railLabels={{
|
|
160
|
+
newChat: t("newChat"),
|
|
161
|
+
showMore: t("showMore"),
|
|
162
|
+
showLess: t("showLess"),
|
|
163
|
+
sections: {
|
|
164
|
+
showAll: t("showAll"),
|
|
165
|
+
showLess: t("showLess"),
|
|
166
|
+
loadMore: t("loadMore"),
|
|
167
|
+
loadingMore: t("loadingMore"),
|
|
168
|
+
retry: t("retry"),
|
|
169
|
+
},
|
|
170
|
+
}}
|
|
171
|
+
sections={[
|
|
172
|
+
{ id: "mine", label: t("myChats"), items: toItems(mine.threads) },
|
|
173
|
+
{
|
|
174
|
+
id: "shared",
|
|
175
|
+
label: t("sharedWithYou"),
|
|
176
|
+
items: toItems(shared.threads),
|
|
177
|
+
hasMore: shared.hasMore,
|
|
178
|
+
loadingMore: shared.loadingMore,
|
|
179
|
+
onLoadMore: shared.loadMore,
|
|
180
|
+
loading: shared.loading,
|
|
181
|
+
error: shared.error ? t("loadFailed") : undefined,
|
|
182
|
+
onRetry: shared.refresh,
|
|
183
|
+
},
|
|
184
|
+
]}
|
|
185
|
+
/>;
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
With `sections`, `railLabels.sections` is required and has no defaults. Pass
|
|
189
|
+
`showAll`, `showLess`, `loadMore`, `loadingMore`, and `retry` as translated text,
|
|
190
|
+
and override them per section with `section.labels` when needed.
|
|
191
|
+
|
|
192
|
+
Show all reveals the rows already loaded. When the server has more, a disclosed
|
|
193
|
+
section also offers Load more. A failed load shows above the rows that already
|
|
194
|
+
loaded, so it never reads as an empty section.
|
|
195
|
+
|
|
196
|
+
Rows can show who owns a chat and why the viewer can see it. Set `ownerLabel`,
|
|
197
|
+
`accessLabel`, and `accessBasis` on a `ChatHistoryItem`. The app passes
|
|
198
|
+
translated text, because the Toolkit list ships none. Shared rows should show a
|
|
199
|
+
direct grant over organization access when both apply, which is how Core
|
|
200
|
+
reports `accessBasis`.
|
|
201
|
+
|
|
116
202
|
## What's next
|
|
117
203
|
|
|
118
204
|
- [**Sharing & Privacy**](/docs/sharing) — the framework-level access model
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-native/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.212.0-nightly-20261021010049",
|
|
4
4
|
"description": "The agentic application framework for building autonomous agents with intuitive UIs",
|
|
5
5
|
"homepage": "https://github.com/BuilderIO/agent-native#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -403,6 +403,7 @@
|
|
|
403
403
|
},
|
|
404
404
|
"./router": "./dist/router/index.js",
|
|
405
405
|
"./collab": "./dist/collab/index.js",
|
|
406
|
+
"./collab/live-copy-tasks": "./dist/collab/live-copy-tasks.js",
|
|
406
407
|
"./a2a": "./dist/a2a/index.js",
|
|
407
408
|
"./mcp": "./dist/mcp/index.js",
|
|
408
409
|
"./mcp/fetch": "./dist/mcp/fetch-handler.js",
|
|
@@ -554,6 +555,7 @@
|
|
|
554
555
|
"./client/sharing/useResourceAccessGate": "./dist/client/sharing/useResourceAccessGate.js",
|
|
555
556
|
"./client/sharing/useShareButtonController": "./dist/client/sharing/useShareButtonController.js",
|
|
556
557
|
"./client/sharing/useShareDialogController": "./dist/client/sharing/useShareDialogController.js",
|
|
558
|
+
"./client/sharing/useShareVisibilityTransition": "./dist/client/sharing/useShareVisibilityTransition.js",
|
|
557
559
|
"./client/sign-in-return": "./dist/client/sign-in-return.js",
|
|
558
560
|
"./client/sign-out": "./dist/client/sign-out.js",
|
|
559
561
|
"./client/tool-display": "./dist/client/tool-display.js",
|
|
@@ -711,7 +713,7 @@
|
|
|
711
713
|
"yaml": "^2.9.0",
|
|
712
714
|
"yjs": "^13.6.33",
|
|
713
715
|
"zod": "^4.3.6",
|
|
714
|
-
"@agent-native/agentkit": "^0.
|
|
716
|
+
"@agent-native/agentkit": "^0.212.0-nightly-20261021010049",
|
|
715
717
|
"@agent-native/recap-cli": "^0.5.78"
|
|
716
718
|
},
|
|
717
719
|
"devDependencies": {
|
|
@@ -782,7 +784,7 @@
|
|
|
782
784
|
"xlsx": "^0.18.5"
|
|
783
785
|
},
|
|
784
786
|
"peerDependencies": {
|
|
785
|
-
"@agent-native/core-corpus": "
|
|
787
|
+
"@agent-native/core-corpus": "0.212.0-nightly-20261021010049",
|
|
786
788
|
"@ai-sdk/anthropic": ">=3",
|
|
787
789
|
"@ai-sdk/cohere": ">=3",
|
|
788
790
|
"@ai-sdk/google": ">=3",
|