@agent-native/core 0.133.1 → 0.133.2
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 +6 -0
- package/corpus/core/package.json +1 -1
- package/corpus/core/src/a2a/client.ts +22 -5
- package/corpus/core/src/integrations/webhook-handler.ts +7 -0
- package/corpus/core/src/scripts/call-agent.ts +29 -2
- package/corpus/templates/content/app/components/editor/database/sidebar.tsx +1 -34
- package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +77 -3
- package/corpus/templates/content/app/components/sidebar/DocumentTreeItem.tsx +4 -211
- package/corpus/templates/content/changelog/2026-07-30-deleting-a-page-no-longer-leaves-the-content-sidebar-unrespo.md +6 -0
- package/corpus/templates/content/e2e/playwright.config.ts +2 -1
- package/dist/a2a/client.d.ts +9 -1
- package/dist/a2a/client.d.ts.map +1 -1
- package/dist/a2a/client.js +12 -4
- package/dist/a2a/client.js.map +1 -1
- package/dist/collab/routes.d.ts +1 -1
- package/dist/integrations/webhook-handler.d.ts.map +1 -1
- package/dist/integrations/webhook-handler.js +3 -0
- package/dist/integrations/webhook-handler.js.map +1 -1
- package/dist/notifications/routes.d.ts +1 -1
- package/dist/resources/handlers.d.ts +1 -1
- package/dist/scripts/call-agent.d.ts.map +1 -1
- package/dist/scripts/call-agent.js +24 -2
- package/dist/scripts/call-agent.js.map +1 -1
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/package.json +1 -1
- package/src/a2a/client.ts +22 -5
- package/src/integrations/webhook-handler.ts +7 -0
- package/src/scripts/call-agent.ts +29 -2
|
@@ -38,6 +38,7 @@ import { track } from "../tracking/registry.js";
|
|
|
38
38
|
|
|
39
39
|
const DEFAULT_SERVERLESS_INTEGRATION_A2A_TIMEOUT_MS = 18_000;
|
|
40
40
|
const NETLIFY_INTEGRATION_A2A_TIMEOUT_MS = 2_000;
|
|
41
|
+
const NETLIFY_INTEGRATION_A2A_SUBMISSION_TIMEOUT_MS = 15_000;
|
|
41
42
|
const INTEGRATION_A2A_TOKEN_TTL = "30m";
|
|
42
43
|
const A2A_INVOCATION_EVENT = "$a2a_invocation";
|
|
43
44
|
|
|
@@ -167,13 +168,32 @@ function parseTimeoutMs(value: string | undefined): number | undefined {
|
|
|
167
168
|
return Math.floor(parsed);
|
|
168
169
|
}
|
|
169
170
|
|
|
171
|
+
function hasExplicitNonHostedNetlifyOverride(): boolean {
|
|
172
|
+
return (
|
|
173
|
+
process.env.NETLIFY_LOCAL === "true" || process.env.NETLIFY === "false"
|
|
174
|
+
);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
function isNetlifyHostedRuntimeForIntegrationCall(): boolean {
|
|
178
|
+
if (hasExplicitNonHostedNetlifyOverride()) return false;
|
|
179
|
+
if (process.env.NETLIFY && process.env.NETLIFY !== "false") return true;
|
|
180
|
+
|
|
181
|
+
// NETLIFY is a build-time marker, while deployed Netlify Functions expose
|
|
182
|
+
// SITE_ID at runtime. Recognize the same runtime-only marker used by the
|
|
183
|
+
// durable background and run-manager gates so the integration caller hands
|
|
184
|
+
// slow A2A work to durable delivery before its foreground budget expires.
|
|
185
|
+
return Boolean(process.env.SITE_ID); // guard:allow-env-credential -- Netlify's read-only public site identifier is a runtime host marker, not a user credential.
|
|
186
|
+
}
|
|
187
|
+
|
|
170
188
|
function isServerlessHost(): boolean {
|
|
189
|
+
if (hasExplicitNonHostedNetlifyOverride()) return false;
|
|
190
|
+
|
|
171
191
|
// Detection mirrors db/migrations.ts:297-301. On Cloudflare Workers/Pages,
|
|
172
192
|
// `process.env` is shimmed and CF_PAGES isn't reliably populated at runtime —
|
|
173
193
|
// the canonical signal is the `__cf_env`/`__env__` global injected by the
|
|
174
194
|
// Cloudflare runtime adapter.
|
|
175
195
|
return (
|
|
176
|
-
|
|
196
|
+
isNetlifyHostedRuntimeForIntegrationCall() ||
|
|
177
197
|
!!process.env.AWS_LAMBDA_FUNCTION_NAME ||
|
|
178
198
|
!!process.env.VERCEL ||
|
|
179
199
|
"__cf_env" in globalThis ||
|
|
@@ -193,7 +213,9 @@ function getIntegrationCallTimeoutMs(): number | undefined {
|
|
|
193
213
|
// calls very short so multi-agent integration requests queue downstream
|
|
194
214
|
// continuations quickly instead of spending the parent Slack/email processor
|
|
195
215
|
// budget waiting on separately deployed apps one-by-one.
|
|
196
|
-
if (
|
|
216
|
+
if (isNetlifyHostedRuntimeForIntegrationCall()) {
|
|
217
|
+
return NETLIFY_INTEGRATION_A2A_TIMEOUT_MS;
|
|
218
|
+
}
|
|
197
219
|
|
|
198
220
|
return DEFAULT_SERVERLESS_INTEGRATION_A2A_TIMEOUT_MS;
|
|
199
221
|
}
|
|
@@ -676,6 +698,10 @@ export async function run(
|
|
|
676
698
|
// Docker can wait for slow-but-valid answers; integration processors
|
|
677
699
|
// still need to finish before their current function execution dies.
|
|
678
700
|
const callTimeoutMs = getIntegrationCallTimeoutMs();
|
|
701
|
+
const submissionTimeoutMs =
|
|
702
|
+
callTimeoutMs && isNetlifyHostedRuntimeForIntegrationCall()
|
|
703
|
+
? NETLIFY_INTEGRATION_A2A_SUBMISSION_TIMEOUT_MS
|
|
704
|
+
: undefined;
|
|
679
705
|
responseText = await callAgent(agent.url, messageWithHint, {
|
|
680
706
|
apiKey,
|
|
681
707
|
userEmail: callerEmail,
|
|
@@ -692,6 +718,7 @@ export async function run(
|
|
|
692
718
|
...(callTimeoutMs
|
|
693
719
|
? {
|
|
694
720
|
timeoutMs: callTimeoutMs,
|
|
721
|
+
...(submissionTimeoutMs ? { submissionTimeoutMs } : {}),
|
|
695
722
|
}
|
|
696
723
|
: {}),
|
|
697
724
|
});
|