@agent-native/core 0.98.5 → 0.98.7
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 +2 -2
- package/corpus/core/CHANGELOG.md +18 -0
- package/corpus/core/docs/content/external-agents.mdx +66 -7
- package/corpus/core/docs/content/locales/ar-SA/external-agents.mdx +40 -7
- package/corpus/core/docs/content/locales/de-DE/external-agents.mdx +41 -7
- package/corpus/core/docs/content/locales/es-ES/external-agents.mdx +41 -7
- package/corpus/core/docs/content/locales/fr-FR/external-agents.mdx +41 -7
- package/corpus/core/docs/content/locales/hi-IN/external-agents.mdx +40 -7
- package/corpus/core/docs/content/locales/ja-JP/external-agents.mdx +40 -7
- package/corpus/core/docs/content/locales/ko-KR/external-agents.mdx +40 -7
- package/corpus/core/docs/content/locales/pt-BR/external-agents.mdx +41 -7
- package/corpus/core/docs/content/locales/zh-CN/external-agents.mdx +39 -7
- package/corpus/core/docs/content/locales/zh-TW/external-agents.mdx +39 -7
- package/corpus/core/package.json +1 -1
- package/corpus/core/src/a2a/handlers.ts +101 -26
- package/corpus/core/src/a2a/task-store.ts +128 -3
- package/corpus/core/src/client/session-replay.ts +67 -5
- package/corpus/core/src/integrations/adapters/slack.ts +207 -17
- package/corpus/core/src/integrations/identity-links-store.ts +210 -0
- package/corpus/core/src/integrations/identity.ts +196 -0
- package/corpus/core/src/integrations/index.ts +6 -0
- package/corpus/core/src/integrations/plugin.ts +130 -1
- package/corpus/core/src/integrations/types.ts +37 -0
- package/corpus/core/src/integrations/webhook-handler.ts +1 -0
- package/corpus/core/src/mcp/build-server.ts +127 -22
- package/corpus/core/src/mcp/builtin-tools.ts +5 -2
- package/corpus/core/src/mcp/external-agent-policy.ts +18 -0
- package/corpus/core/src/mcp/index.ts +1 -0
- package/corpus/core/src/server/agent-chat/plugin-options.ts +12 -1
- package/corpus/core/src/server/agent-chat/script-entries.ts +20 -3
- package/corpus/core/src/server/agent-chat-plugin.ts +3 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/external-agents/SKILL.md +34 -5
- package/corpus/templates/analytics/.agents/skills/session-replay/SKILL.md +4 -1
- package/corpus/templates/analytics/AGENTS.md +20 -5
- package/corpus/templates/analytics/actions/create-session-replay-agent-link.ts +0 -1
- package/corpus/templates/analytics/actions/get-session-replay-events.ts +0 -1
- package/corpus/templates/analytics/actions/get-session-replay-timeline.ts +40 -0
- package/corpus/templates/analytics/actions/list-error-issues.ts +12 -0
- package/corpus/templates/analytics/actions/query-agent-native-analytics.ts +4 -1
- package/corpus/templates/analytics/app/pages/sessions/SessionsPage.tsx +48 -17
- package/corpus/templates/analytics/changelog/2026-07-12-analytics-uses-the-full-in-app-agent-for-multi-step-incident.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-12-connected-external-agents-can-now-look-up-sessions-error-iss.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-12-session-identities-stay-visible-when-demo-mode-is-off.md +6 -0
- package/corpus/templates/analytics/server/handlers/session-replay.ts +15 -9
- package/corpus/templates/analytics/server/lib/analytics-connector-catalog.ts +2 -2
- package/corpus/templates/analytics/server/lib/error-capture.ts +47 -5
- package/corpus/templates/analytics/server/lib/session-replay-agent-context.ts +72 -22
- package/corpus/templates/analytics/server/lib/session-replay.ts +41 -11
- package/corpus/templates/analytics/server/plugins/agent-chat.ts +7 -0
- package/corpus/templates/analytics/server/plugins/db.ts +15 -0
- package/corpus/templates/analytics/server/routes/api/session-replay/agent-diagnostics.json.get.ts +8 -5
- package/corpus/templates/analytics/server/routes/api/session-replay/agent-events.json.get.ts +8 -3
- package/corpus/templates/calendar/app/components/calendar/DeleteEventDialog.tsx +12 -2
- package/corpus/templates/forms/app/global.css +54 -8
- package/corpus/templates/forms/app/pages/AskPage.tsx +35 -13
- package/corpus/templates/forms/app/pages/FormBuilderPage.tsx +11 -17
- package/corpus/templates/forms/app/pages/ResponsesPage.tsx +8 -5
- package/corpus/templates/forms/changelog/2026-07-12-ask-forms-suggestions-now-sit-beneath-the-composer-for-a-tig.md +6 -0
- package/corpus/templates/forms/changelog/2026-07-12-builder-response-tables-now-fill-the-view-without-a-redundan.md +6 -0
- package/corpus/templates/forms/changelog/2026-07-12-response-tables-now-fill-the-available-pane-with-a-flexible-.md +6 -0
- package/corpus/templates/mail/AGENTS.md +3 -1
- package/corpus/templates/mail/server/lib/mail-integrations.ts +3 -0
- package/dist/a2a/handlers.d.ts.map +1 -1
- package/dist/a2a/handlers.js +89 -20
- package/dist/a2a/handlers.js.map +1 -1
- package/dist/a2a/task-store.d.ts +32 -1
- package/dist/a2a/task-store.d.ts.map +1 -1
- package/dist/a2a/task-store.js +111 -4
- package/dist/a2a/task-store.js.map +1 -1
- package/dist/client/session-replay.d.ts.map +1 -1
- package/dist/client/session-replay.js +53 -8
- package/dist/client/session-replay.js.map +1 -1
- package/dist/collab/routes.d.ts +1 -1
- package/dist/integrations/adapters/slack.d.ts.map +1 -1
- package/dist/integrations/adapters/slack.js +176 -17
- package/dist/integrations/adapters/slack.js.map +1 -1
- package/dist/integrations/identity-links-store.d.ts +23 -0
- package/dist/integrations/identity-links-store.d.ts.map +1 -0
- package/dist/integrations/identity-links-store.js +158 -0
- package/dist/integrations/identity-links-store.js.map +1 -0
- package/dist/integrations/identity.d.ts +28 -0
- package/dist/integrations/identity.d.ts.map +1 -0
- package/dist/integrations/identity.js +142 -0
- package/dist/integrations/identity.js.map +1 -0
- package/dist/integrations/index.d.ts +2 -0
- package/dist/integrations/index.d.ts.map +1 -1
- package/dist/integrations/index.js +2 -0
- package/dist/integrations/index.js.map +1 -1
- package/dist/integrations/plugin.d.ts.map +1 -1
- package/dist/integrations/plugin.js +93 -1
- package/dist/integrations/plugin.js.map +1 -1
- package/dist/integrations/types.d.ts +31 -0
- package/dist/integrations/types.d.ts.map +1 -1
- package/dist/integrations/types.js.map +1 -1
- package/dist/integrations/webhook-handler.js +1 -0
- package/dist/integrations/webhook-handler.js.map +1 -1
- package/dist/mcp/build-server.d.ts +9 -2
- package/dist/mcp/build-server.d.ts.map +1 -1
- package/dist/mcp/build-server.js +97 -20
- package/dist/mcp/build-server.js.map +1 -1
- package/dist/mcp/builtin-tools.d.ts.map +1 -1
- package/dist/mcp/builtin-tools.js +5 -2
- package/dist/mcp/builtin-tools.js.map +1 -1
- package/dist/mcp/external-agent-policy.d.ts +19 -0
- package/dist/mcp/external-agent-policy.d.ts.map +1 -0
- package/dist/mcp/external-agent-policy.js +2 -0
- package/dist/mcp/external-agent-policy.js.map +1 -0
- package/dist/mcp/index.d.ts +1 -0
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js.map +1 -1
- package/dist/notifications/routes.d.ts +1 -1
- package/dist/provider-api/corpus-jobs.d.ts +2 -2
- package/dist/server/agent-chat/plugin-options.d.ts +11 -1
- package/dist/server/agent-chat/plugin-options.d.ts.map +1 -1
- package/dist/server/agent-chat/plugin-options.js.map +1 -1
- package/dist/server/agent-chat/script-entries.d.ts.map +1 -1
- package/dist/server/agent-chat/script-entries.js +16 -2
- package/dist/server/agent-chat/script-entries.js.map +1 -1
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +3 -0
- package/dist/server/agent-chat-plugin.js.map +1 -1
- package/dist/templates/workspace-core/.agents/skills/external-agents/SKILL.md +34 -5
- package/docs/content/external-agents.mdx +66 -7
- package/docs/content/locales/ar-SA/external-agents.mdx +40 -7
- package/docs/content/locales/de-DE/external-agents.mdx +41 -7
- package/docs/content/locales/es-ES/external-agents.mdx +41 -7
- package/docs/content/locales/fr-FR/external-agents.mdx +41 -7
- package/docs/content/locales/hi-IN/external-agents.mdx +40 -7
- package/docs/content/locales/ja-JP/external-agents.mdx +40 -7
- package/docs/content/locales/ko-KR/external-agents.mdx +40 -7
- package/docs/content/locales/pt-BR/external-agents.mdx +41 -7
- package/docs/content/locales/zh-CN/external-agents.mdx +39 -7
- package/docs/content/locales/zh-TW/external-agents.mdx +39 -7
- package/package.json +1 -1
- package/src/templates/workspace-core/.agents/skills/external-agents/SKILL.md +34 -5
package/dist/mcp/build-server.js
CHANGED
|
@@ -93,7 +93,7 @@ function explicitlyRequestsFullMcpCatalog(requestMeta) {
|
|
|
93
93
|
// (100k+ tokens) into a context window just because a client called itself
|
|
94
94
|
// "code"/"cursor"/"codex" was a recurring footgun. Everything else gets the
|
|
95
95
|
// connector/compact catalog plus `tool-search`, which keeps every tool
|
|
96
|
-
//
|
|
96
|
+
// discoverable; only permitted actions are callable without full opt-in.
|
|
97
97
|
if (process.env.AGENT_NATIVE_MCP_FULL_CATALOG === "1")
|
|
98
98
|
return true;
|
|
99
99
|
return requestMeta?.fullCatalog === true;
|
|
@@ -117,19 +117,80 @@ function warnFullCatalogServed(toolCount) {
|
|
|
117
117
|
`This is a large context payload meant to be a rare, explicit opt-in — most ` +
|
|
118
118
|
`clients should use the default compact/connector catalog + tool-search instead.`);
|
|
119
119
|
}
|
|
120
|
+
function isAuthenticatedReadAction(entry) {
|
|
121
|
+
return (entry.http !== false &&
|
|
122
|
+
entry.http?.method === "GET" &&
|
|
123
|
+
entry.readOnly === true &&
|
|
124
|
+
entry.publicAgent?.expose === true &&
|
|
125
|
+
entry.publicAgent.readOnly === true &&
|
|
126
|
+
entry.publicAgent.requiresAuth === true);
|
|
127
|
+
}
|
|
120
128
|
/**
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
*
|
|
129
|
+
* Hard exclusion list for the `authenticatedReads: "auto"` derivation ONLY
|
|
130
|
+
* (see `autoAuthenticatedReadNames` below). Explicit `connectorCatalog`
|
|
131
|
+
* entries are a deliberate, reviewed choice made by the app and are NOT
|
|
132
|
+
* affected by this list — an app can still list any of these names in
|
|
133
|
+
* `connectorCatalog` on purpose.
|
|
134
|
+
*
|
|
135
|
+
* These are the footgun families this file's other comments already call
|
|
136
|
+
* out ("removes footguns (db-exec, seed-*, extension tools, browser-session
|
|
137
|
+
* tools, etc.)" above, and "keeps db-exec / seed-* / extension /
|
|
138
|
+
* browser-session footguns off the external surface" near the connector
|
|
139
|
+
* tier below): generic core SQL access, template demo/seed data, the
|
|
140
|
+
* extension-management suite, live browser-session control, and Context
|
|
141
|
+
* X-Ray internals. `isAuthenticatedReadAction` only inspects action
|
|
142
|
+
* metadata (http/readOnly/publicAgent flags) — nothing stops a future
|
|
143
|
+
* change from mis-annotating one of these with that exact flag set again,
|
|
144
|
+
* the way `db-query`/`db-schema` were briefly (and accidentally) annotated
|
|
145
|
+
* before it was caught in review. These names can never be auto-derived
|
|
146
|
+
* from metadata alone; exposing one to external callers requires an
|
|
147
|
+
* explicit `connectorCatalog` entry.
|
|
126
148
|
*/
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
149
|
+
const AUTO_READ_EXCLUDED_ACTION_NAMES = new Set([
|
|
150
|
+
"db-query",
|
|
151
|
+
"db-schema",
|
|
152
|
+
"db-exec",
|
|
153
|
+
"db-patch",
|
|
154
|
+
"context-manifest-get",
|
|
155
|
+
"context-pin",
|
|
156
|
+
"context-evict",
|
|
157
|
+
"context-restore",
|
|
158
|
+
"context-report",
|
|
159
|
+
]);
|
|
160
|
+
/**
|
|
161
|
+
* Substring/prefix patterns for excluded name *families* that aren't a
|
|
162
|
+
* fixed, enumerable set: `seed-*` varies per app/template, and the
|
|
163
|
+
* extension-management and browser-session tool suites use varying verb
|
|
164
|
+
* prefixes around a shared noun (e.g. `list-extensions`, `create-extension`,
|
|
165
|
+
* `hide-extension`; `list-browser-sessions`, `run-browser-session-action`) —
|
|
166
|
+
* so a leading-prefix match alone would miss most of them.
|
|
167
|
+
*/
|
|
168
|
+
const AUTO_READ_EXCLUDED_ACTION_PATTERNS = [
|
|
169
|
+
/^seed-/,
|
|
170
|
+
/extension/,
|
|
171
|
+
/browser-session/,
|
|
172
|
+
];
|
|
173
|
+
function isAutoReadExcludedActionName(name) {
|
|
174
|
+
return (AUTO_READ_EXCLUDED_ACTION_NAMES.has(name) ||
|
|
175
|
+
AUTO_READ_EXCLUDED_ACTION_PATTERNS.some((pattern) => pattern.test(name)));
|
|
176
|
+
}
|
|
177
|
+
function autoAuthenticatedReadNames(actions, config) {
|
|
178
|
+
if (config.externalAgents?.authenticatedReads !== "auto")
|
|
179
|
+
return new Set();
|
|
180
|
+
return new Set(Object.entries(actions)
|
|
181
|
+
.filter(([name, entry]) => isAuthenticatedReadAction(entry) &&
|
|
182
|
+
!isAutoReadExcludedActionName(name))
|
|
183
|
+
.map(([name]) => name));
|
|
184
|
+
}
|
|
185
|
+
function externalAgentDenySet(config) {
|
|
186
|
+
return new Set((config.externalAgents?.denyActions ?? [])
|
|
187
|
+
.map((name) => name.trim())
|
|
188
|
+
.filter(Boolean));
|
|
189
|
+
}
|
|
190
|
+
function externalAgentWritesAreAskAppOnly(config) {
|
|
191
|
+
return (config.externalAgents?.writes === "ask_app_only" ||
|
|
192
|
+
(config.externalAgents?.authenticatedReads === "auto" &&
|
|
193
|
+
config.externalAgents?.writes !== "allowlisted"));
|
|
133
194
|
}
|
|
134
195
|
function metadataObject(value) {
|
|
135
196
|
return value && typeof value === "object" && !Array.isArray(value)
|
|
@@ -926,15 +987,19 @@ export async function createMCPServerForRequest(config, identity, requestMeta) {
|
|
|
926
987
|
const advertisedActionsBeforeConnector = compactMcpAppCatalog
|
|
927
988
|
? Object.fromEntries(Object.entries(visibleActions).filter(([name, entry]) => isActionAdvertisedInCompactMcpAppCatalog(name, entry, config)))
|
|
928
989
|
: visibleActions;
|
|
990
|
+
const autoReadNames = autoAuthenticatedReadNames(visibleActions, config);
|
|
991
|
+
const connectorNames = new Set([
|
|
992
|
+
...(config.connectorCatalog ?? []),
|
|
993
|
+
...autoReadNames,
|
|
994
|
+
]);
|
|
995
|
+
const denyNames = externalAgentDenySet(config);
|
|
996
|
+
const automaticConnectorPolicyActive = config.externalAgents?.authenticatedReads === "auto";
|
|
929
997
|
// Connector-catalog tier: when a template declares a connector allow-list,
|
|
930
|
-
// serve exactly that curated surface
|
|
931
|
-
//
|
|
932
|
-
//
|
|
933
|
-
// so the ~105-tool full catalog can never leak just because a deployment
|
|
934
|
-
// forgot to set one. It also keeps db-exec / seed-* / extension /
|
|
998
|
+
// serve exactly that curated surface plus any explicitly annotated
|
|
999
|
+
// authenticated reads from `externalAgents.authenticatedReads: "auto"`.
|
|
1000
|
+
// This stays compact by default and keeps db-exec / seed-* / extension /
|
|
935
1001
|
// browser-session footguns off the external surface.
|
|
936
|
-
const connectorCatalogActive =
|
|
937
|
-
config.connectorCatalog.length > 0 &&
|
|
1002
|
+
const connectorCatalogActive = (connectorNames.size > 0 || automaticConnectorPolicyActive) &&
|
|
938
1003
|
!fullCatalogRequested;
|
|
939
1004
|
// When the connector catalog is active, filter directly from visibleActions
|
|
940
1005
|
// rather than advertisedActionsBeforeConnector. This ensures the connector
|
|
@@ -942,7 +1007,19 @@ export async function createMCPServerForRequest(config, identity, requestMeta) {
|
|
|
942
1007
|
// narrow to just the compact-catalog builtins when shouldUseCompactMcpCatalogByDefault
|
|
943
1008
|
// would have activated the compact catalog for the same caller.
|
|
944
1009
|
const advertisedActions = connectorCatalogActive
|
|
945
|
-
? Object.fromEntries(Object.entries(visibleActions).filter(([name]) =>
|
|
1010
|
+
? Object.fromEntries(Object.entries(visibleActions).filter(([name, entry]) => {
|
|
1011
|
+
if (denyNames.has(name))
|
|
1012
|
+
return false;
|
|
1013
|
+
if (COMPACT_MCP_APP_CATALOG_BUILTINS.has(name))
|
|
1014
|
+
return true;
|
|
1015
|
+
if (!connectorNames.has(name))
|
|
1016
|
+
return false;
|
|
1017
|
+
if (externalAgentWritesAreAskAppOnly(config) &&
|
|
1018
|
+
entry.readOnly !== true) {
|
|
1019
|
+
return false;
|
|
1020
|
+
}
|
|
1021
|
+
return true;
|
|
1022
|
+
}))
|
|
946
1023
|
: advertisedActionsBeforeConnector;
|
|
947
1024
|
if (fullCatalogRequested) {
|
|
948
1025
|
warnFullCatalogServed(Object.keys(advertisedActions).length);
|