@agent-native/core 0.210.0 → 0.210.1-nightly-20261020010058
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/dist/action.js +16 -1
- package/dist/agent/production-agent.d.ts +1 -0
- package/dist/agent/production-agent.js +2 -0
- package/dist/agent/reaped-run-thread.d.ts +1 -1
- package/dist/agent/reaped-run-thread.js +21 -6
- package/dist/agent/run-store.fencing.worker.js +58 -0
- package/dist/agent/run-store.js +7 -5
- package/dist/agent/run-thread-projector.d.ts +27 -0
- package/dist/agent/run-thread-projector.js +79 -0
- package/dist/agent/thread-data-builder.js +38 -13
- package/dist/automation/index.d.ts +1 -1
- package/dist/cli/create.d.ts +1 -1
- package/dist/cli/create.js +30 -27
- package/dist/cli/package-lifecycle.js +3 -2
- package/dist/cli/setup-agents.d.ts +5 -0
- package/dist/cli/setup-agents.js +91 -34
- package/dist/cli/skills.js +8 -14
- package/dist/cli/tar-command.d.ts +1 -0
- package/dist/cli/tar-command.js +9 -0
- package/dist/cli/template-baseline.js +6 -3
- package/dist/cli/template-sync.d.ts +2 -1
- package/dist/cli/template-sync.js +2 -1
- package/dist/client/agent-chat.d.ts +1 -0
- package/dist/client/agent-chat.js +1 -1
- package/dist/client/api-path.d.ts +1 -0
- package/dist/client/api-path.js +6 -0
- package/dist/client/chat/agentkit-agent-native.js +6 -2
- package/dist/client/chat/runtime.js +3 -0
- package/dist/client/use-agent-chat-context.js +6 -3
- package/dist/client/use-db-sync.js +3 -0
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/collab/routes.d.ts +2 -2
- package/dist/deploy/immutable-assets.d.ts +1 -1
- package/dist/deploy/immutable-assets.js +1 -1
- package/dist/deploy/workspace-deploy.js +12 -5
- package/dist/file-upload/actions/upload-image.d.ts +3 -3
- package/dist/jobs/actions/manage-recurring-job.d.ts +1 -1
- package/dist/jobs/background-automation-runner.js +16 -7
- package/dist/mcp/build-server.js +5 -1
- package/dist/mcp/embed-app.js +84 -17
- package/dist/notifications/routes.d.ts +3 -3
- package/dist/observability/routes.d.ts +7 -7
- package/dist/org/actions/invite-organization-member.js +1 -0
- package/dist/org/actions/list-organization-members.js +1 -0
- package/dist/org/index.d.ts +1 -1
- package/dist/progress/routes.d.ts +1 -1
- package/dist/provider-api/actions/custom-provider-registration.d.ts +6 -6
- package/dist/provider-api/actions/provider-api.d.ts +8 -8
- package/dist/scripts/db/exec.js +18 -6
- package/dist/scripts/db/patch.js +20 -8
- package/dist/scripts/db/postgres-client.d.ts +2 -0
- package/dist/scripts/db/postgres-client.js +17 -1
- package/dist/scripts/db/query.js +7 -6
- package/dist/scripts/db/safety.js +2 -1
- package/dist/secrets/routes.d.ts +10 -10
- package/dist/server/agent-chat-plugin.js +17 -8
- 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/agent-teams.js +9 -3
- package/dist/server/framework-request-handler.js +19 -0
- package/dist/server/fusion-app.d.ts +7 -0
- package/dist/server/fusion-app.js +11 -2
- package/dist/templates/builder-code-starter/.agents/skills/actions/SKILL.md.patch +1 -1
- package/dist/templates/builder-code-starter/app/hooks/use-navigation-state.ts.patch +26 -45
- package/dist/templates/builder-code-starter/server/plugins/agent-chat.ts.patch +2 -1
- package/dist/templates/chat/.agents/skills/context-awareness/SKILL.md +5 -0
- package/dist/templates/chat/app/components/chat/ChatHomeRedirect.tsx +2 -2
- package/dist/templates/chat/app/hooks/use-navigation-state.ts +51 -22
- package/dist/templates/chat/server/plugins/agent-chat.ts +1 -0
- package/dist/templates/default/.agents/skills/context-awareness/SKILL.md +5 -0
- package/dist/templates/workspace-core/.agents/skills/context-awareness/SKILL.md +5 -0
- package/dist/triggers/actions/manage-automation.d.ts +5 -5
- package/package.json +5 -5
- package/src/templates/builder-code-starter/.agents/skills/actions/SKILL.md.patch +1 -1
- package/src/templates/builder-code-starter/app/hooks/use-navigation-state.ts.patch +26 -45
- package/src/templates/builder-code-starter/server/plugins/agent-chat.ts.patch +2 -1
- package/src/templates/chat/.agents/skills/context-awareness/SKILL.md +5 -0
- package/src/templates/chat/app/components/chat/ChatHomeRedirect.tsx +2 -2
- package/src/templates/chat/app/hooks/use-navigation-state.ts +51 -22
- package/src/templates/chat/server/plugins/agent-chat.ts +1 -0
- package/src/templates/default/.agents/skills/context-awareness/SKILL.md +5 -0
- package/src/templates/workspace-core/.agents/skills/context-awareness/SKILL.md +5 -0
|
@@ -8,8 +8,8 @@ export declare const AGENT_ENGINE_API_KEY_ACTION_NAME = "agent-engine-api-key";
|
|
|
8
8
|
* resolveEngine's credential detection.
|
|
9
9
|
*/
|
|
10
10
|
export declare function createAgentEngineDisconnectHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
|
|
11
|
-
error: string;
|
|
12
11
|
ok?: undefined;
|
|
12
|
+
error: string;
|
|
13
13
|
scope?: undefined;
|
|
14
14
|
} | {
|
|
15
15
|
ok: boolean;
|
|
@@ -7,8 +7,9 @@ import { actionsToEngineTools, filterActionsByAllowedNames, filterInitialEngineT
|
|
|
7
7
|
import { runAgentLoop, appendAgentLoopContinuation, } from "../agent/production-agent.js";
|
|
8
8
|
import { abortRun, getActiveRunForThreadAsync, getRun, startRun, subscribeToRun, } from "../agent/run-manager.js";
|
|
9
9
|
import { ensureRunTables, getRunEventsSince, lockTaskExecutionLease, revokeTaskExecutionLease, } from "../agent/run-store.js";
|
|
10
|
+
import { buildAssistantMessageFromRunJournal } from "../agent/run-thread-projector.js";
|
|
10
11
|
import { resolveMaxSubagentDelegationDepth } from "../agent/runtime-context.js";
|
|
11
|
-
import {
|
|
12
|
+
import { foldAssistantTurn, threadDataToEngineMessages, } from "../agent/thread-data-builder.js";
|
|
12
13
|
import { attachToolSearch } from "../agent/tool-search.js";
|
|
13
14
|
import { compareAndSetAppState, compareAndSetManyAppState, readAppState, writeAppState, listAppState, deleteAppState, } from "../application-state/script-helpers.js";
|
|
14
15
|
import { redactArgsToValue, redactTextToSummary } from "../audit/redact.js";
|
|
@@ -1346,9 +1347,14 @@ async function persistTaskThreadData(task, description, run, runId, turnId) {
|
|
|
1346
1347
|
if (!repo.headId)
|
|
1347
1348
|
repo.headId = userMsgId;
|
|
1348
1349
|
}
|
|
1349
|
-
const assistantMsg =
|
|
1350
|
-
|
|
1350
|
+
const assistantMsg = await buildAssistantMessageFromRunJournal({
|
|
1351
|
+
threadId: task.threadId,
|
|
1351
1352
|
turnId,
|
|
1353
|
+
runId,
|
|
1354
|
+
runEvents: run.events ?? [],
|
|
1355
|
+
options: {
|
|
1356
|
+
suppressInternalContinuation: true,
|
|
1357
|
+
},
|
|
1352
1358
|
});
|
|
1353
1359
|
if (assistantMsg) {
|
|
1354
1360
|
repo = foldAssistantTurn(repo, assistantMsg, { runId, turnId });
|
|
@@ -30,6 +30,8 @@ const EARLY_FRAMEWORK_PATHS_KEY = "_agentNativeEarlyFrameworkPaths";
|
|
|
30
30
|
const MIDDLEWARE_DISPATCHER_PATCHED_KEY = "_agentNativeMiddlewareDispatcherPatched";
|
|
31
31
|
const REQUEST_CONTEXT_BOUNDARY_KEY = "_agentNativeRequestContextBoundary";
|
|
32
32
|
const RETIRED_PATH_CONTEXT_KEY = "_frameworkRetiredPathname";
|
|
33
|
+
const ROUTE_MIDDLEWARE_BATCH_SIZE = 64;
|
|
34
|
+
const routeMiddlewareBatches = new WeakMap();
|
|
33
35
|
const CANONICAL_AUTH_EARLY_PATHS = [
|
|
34
36
|
"/",
|
|
35
37
|
SIGN_IN_ENTRY_PATH,
|
|
@@ -501,6 +503,23 @@ function registerMiddleware(nitroApp, path, handler, options = {}) {
|
|
|
501
503
|
if (options.prepend) {
|
|
502
504
|
chain.unshift(middleware);
|
|
503
505
|
}
|
|
506
|
+
else if (path) {
|
|
507
|
+
const last = chain[chain.length - 1];
|
|
508
|
+
const existing = last && routeMiddlewareBatches.get(last);
|
|
509
|
+
if (existing && existing.length < ROUTE_MIDDLEWARE_BATCH_SIZE) {
|
|
510
|
+
existing.push(middleware);
|
|
511
|
+
return;
|
|
512
|
+
}
|
|
513
|
+
const batch = [middleware];
|
|
514
|
+
const dispatch = (event, next) => {
|
|
515
|
+
const run = (index) => index === batch.length
|
|
516
|
+
? Promise.resolve().then(next)
|
|
517
|
+
: batch[index](event, () => run(index + 1));
|
|
518
|
+
return run(0);
|
|
519
|
+
};
|
|
520
|
+
routeMiddlewareBatches.set(dispatch, batch);
|
|
521
|
+
chain.push(dispatch);
|
|
522
|
+
}
|
|
504
523
|
else {
|
|
505
524
|
chain.push(middleware);
|
|
506
525
|
}
|
|
@@ -42,6 +42,13 @@ export interface SendFusionMessageResult {
|
|
|
42
42
|
* afterwards, or was fire-and-forget.
|
|
43
43
|
*/
|
|
44
44
|
completed?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* True when the message was dispatched but this call stopped hearing from
|
|
47
|
+
* the run before it ended (timed out or the stream was cut off): Builder
|
|
48
|
+
* may still be applying it, so it must not be treated as failed-and-safe
|
|
49
|
+
* to resend, nor as done.
|
|
50
|
+
*/
|
|
51
|
+
unconfirmed?: boolean;
|
|
45
52
|
response?: string;
|
|
46
53
|
error?: string;
|
|
47
54
|
}
|
|
@@ -339,8 +339,16 @@ export async function sendFusionBranchMessage(args) {
|
|
|
339
339
|
}
|
|
340
340
|
catch (error) {
|
|
341
341
|
if (controller.signal.aborted) {
|
|
342
|
-
if (dispatched)
|
|
343
|
-
|
|
342
|
+
if (dispatched) {
|
|
343
|
+
// Fire-and-forget never waits for the run, so dispatch is the outcome.
|
|
344
|
+
if (fireAndForget)
|
|
345
|
+
return { sent: true };
|
|
346
|
+
return {
|
|
347
|
+
sent: true,
|
|
348
|
+
unconfirmed: true,
|
|
349
|
+
error: "Timed out waiting for the app agent to finish; it may still be working",
|
|
350
|
+
};
|
|
351
|
+
}
|
|
344
352
|
return {
|
|
345
353
|
sent: false,
|
|
346
354
|
error: "Timed out sending message to the app agent",
|
|
@@ -364,6 +372,7 @@ export async function sendFusionBranchMessage(args) {
|
|
|
364
372
|
return { sent: dispatched };
|
|
365
373
|
return {
|
|
366
374
|
sent: dispatched,
|
|
375
|
+
...(dispatched ? { unconfirmed: true } : {}),
|
|
367
376
|
error: "The app agent's run ended before it finished",
|
|
368
377
|
};
|
|
369
378
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
===================================================================
|
|
2
2
|
--- a/.agents/skills/actions/SKILL.md
|
|
3
3
|
+++ b/.agents/skills/actions/SKILL.md
|
|
4
|
-
@@ -
|
|
4
|
+
@@ -158,8 +158,22 @@
|
|
5
5
|
```
|
|
6
6
|
|
|
7
7
|
CLI flags become action input fields (`--key value` or `--key=value`); the runner does not read or write files for `--input` or `--output`. The default template dispatches through core's `runScript()` in `actions/run.ts`. Action names are lowercase-with-hyphens (`pnpm action my-action` → `actions/my-action.ts`).
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
===================================================================
|
|
2
2
|
--- a/app/hooks/use-navigation-state.ts
|
|
3
3
|
+++ b/app/hooks/use-navigation-state.ts
|
|
4
|
-
@@ -
|
|
5
|
-
import { appBasePath, appPath } from "@agent-native/core/client/api-path";
|
|
6
|
-
import { useAgentRouteState } from "@agent-native/core/client/navigation";
|
|
7
|
-
|
|
4
|
+
@@ -7,7 +6,0 @@
|
|
8
5
|
-import {
|
|
9
6
|
- chatThreadPath,
|
|
10
7
|
- HOME_PATH,
|
|
@@ -12,37 +9,30 @@
|
|
|
12
9
|
- NEW_CHAT_PATH,
|
|
13
10
|
- threadIdFromPath,
|
|
14
11
|
-} from "@/lib/chat-paths";
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
export interface NavigationState {
|
|
18
|
-
view: string;
|
|
19
|
-
path?: string;
|
|
12
|
+
@@ -20,1 +12,0 @@
|
|
20
13
|
- threadId?: string;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
export function useNavigationState() {
|
|
24
|
-
useAgentRouteState<NavigationState>({
|
|
25
|
-
browserTabId: TAB_ID,
|
|
26
|
-
requestSource: TAB_ID,
|
|
27
|
-
- getNavigationState: ({ pathname }) => {
|
|
28
|
-
- const threadId = threadIdFromPath(pathname);
|
|
29
|
-
- return {
|
|
30
|
-
- view: viewForPath(pathname),
|
|
31
|
-
- path: appPath(pathname),
|
|
32
|
-
- ...(threadId ? { threadId } : {}),
|
|
33
|
-
- };
|
|
34
|
-
- },
|
|
14
|
+
@@ -27,1 +19,5 @@
|
|
15
|
+
- getNavigationState: ({ pathname }) => navigationStateForPath(pathname),
|
|
35
16
|
+ getNavigationState: ({ pathname }) => ({
|
|
36
17
|
+ view: viewForPath(pathname),
|
|
37
|
-
+ path:
|
|
18
|
+
+ path: pathname,
|
|
19
|
+
+ publicPath: appPathFromLocalRoute(pathname),
|
|
38
20
|
+ }),
|
|
39
|
-
|
|
40
|
-
-
|
|
41
|
-
+
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
21
|
+
@@ -33,1 +29,1 @@
|
|
22
|
+
- const fallbackPath = pathForCommand(command);
|
|
23
|
+
+ const fallbackPath = pathForView(command?.view);
|
|
24
|
+
@@ -52,10 +47,0 @@
|
|
25
|
+
-export function navigationStateForPath(pathname: string): NavigationState {
|
|
26
|
+
- const threadId = threadIdFromPath(pathname);
|
|
27
|
+
- return {
|
|
28
|
+
- view: viewForPath(pathname),
|
|
29
|
+
- path: pathname,
|
|
30
|
+
- publicPath: appPathFromLocalRoute(pathname),
|
|
31
|
+
- ...(threadId ? { threadId } : {}),
|
|
32
|
+
- };
|
|
33
|
+
-}
|
|
34
|
+
-
|
|
35
|
+
@@ -63,11 +49,2 @@
|
|
46
36
|
- if (isChatPathname(pathname)) return "chat";
|
|
47
37
|
- if (pathname === HOME_PATH) return "home";
|
|
48
38
|
- if (pathname.startsWith("/database")) return "database";
|
|
@@ -56,14 +46,11 @@
|
|
|
56
46
|
- return "chat";
|
|
57
47
|
+ if (pathname === "/") return "home";
|
|
58
48
|
+ return "home";
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
function pathForView(view?: string): string {
|
|
62
|
-
switch (view) {
|
|
49
|
+
@@ -78,3 +54,0 @@
|
|
63
50
|
- case "chat":
|
|
64
51
|
- case "ask":
|
|
65
52
|
- return NEW_CHAT_PATH;
|
|
66
|
-
|
|
53
|
+
@@ -82,13 +56,1 @@
|
|
67
54
|
- return HOME_PATH;
|
|
68
55
|
- case "database":
|
|
69
56
|
- return "/database";
|
|
@@ -78,12 +65,11 @@
|
|
|
78
65
|
- case "team":
|
|
79
66
|
- return "/settings/organization";
|
|
80
67
|
+ return "/";
|
|
81
|
-
|
|
68
|
+
@@ -96,1 +58,1 @@
|
|
82
69
|
- return HOME_PATH;
|
|
83
70
|
+ return "/";
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
71
|
+
@@ -99,8 +60,0 @@
|
|
72
|
+
-
|
|
87
73
|
-export function pathForCommand(command: any): string {
|
|
88
74
|
- const path = pathForView(command?.view);
|
|
89
75
|
- if (command?.view !== "chat" && command?.view !== "ask") return path;
|
|
@@ -91,8 +77,3 @@
|
|
|
91
77
|
- typeof command?.threadId === "string" ? command.threadId.trim() : "";
|
|
92
78
|
- return threadId ? chatThreadPath(threadId) : path;
|
|
93
79
|
-}
|
|
94
|
-
-
|
|
95
|
-
function routerPath(path: string): string {
|
|
96
|
-
const basePath = appBasePath();
|
|
97
|
-
if (!basePath) return path;
|
|
98
|
-
if (path === basePath) return "/";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
===================================================================
|
|
2
2
|
--- a/server/plugins/agent-chat.ts
|
|
3
3
|
+++ b/server/plugins/agent-chat.ts
|
|
4
|
-
@@ -4,
|
|
4
|
+
@@ -4,24 +4,21 @@
|
|
5
5
|
loadActionsFromStaticRegistry,
|
|
6
6
|
} from "@agent-native/core/server";
|
|
7
7
|
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
export default createAgentChatPlugin({
|
|
19
19
|
appId: "chat",
|
|
20
20
|
actions: loadActionsFromStaticRegistry(actionsRegistry),
|
|
21
|
+
mcp: { connectorCatalog: [] },
|
|
21
22
|
- initialToolNames: INITIAL_TOOL_NAMES,
|
|
22
23
|
+ nativeActionsInDev: true,
|
|
23
24
|
+ finalResponseGuard: appOperationFinalResponseGuard,
|
|
@@ -196,6 +196,11 @@ changes. If a command can arrive while a chat stream is rendering, prefer
|
|
|
196
196
|
`navigate(path, { replace: true, flushSync: true })` over a view-transition
|
|
197
197
|
wrapper so the URL and visible route commit together.
|
|
198
198
|
|
|
199
|
+
Keep `path` router-local. A segment matching the app mount prefix remains part
|
|
200
|
+
of the local route unless a matching `view` route or explicit `publicPath`
|
|
201
|
+
identifies the mounted URL. Carry the mounted form separately in `publicPath`;
|
|
202
|
+
never infer that `path` is mounted from its prefix alone.
|
|
203
|
+
|
|
199
204
|
## Jitter Prevention
|
|
200
205
|
|
|
201
206
|
Agent-side application-state writes are tagged with
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { appPathFromLocalRoute } from "@agent-native/core/client/api-path";
|
|
2
2
|
import { markAgentChatHomeHandoff } from "@agent-native/toolkit/app/chat/agentkit-chat/rail";
|
|
3
3
|
import { useEffect, useRef, useState } from "react";
|
|
4
4
|
|
|
@@ -14,7 +14,7 @@ export default function ChatHomeRedirect() {
|
|
|
14
14
|
handoffStartedRef.current = true;
|
|
15
15
|
markAgentChatHomeHandoff("chat");
|
|
16
16
|
try {
|
|
17
|
-
window.location.replace(
|
|
17
|
+
window.location.replace(appPathFromLocalRoute(chatThreadPath(threadId)));
|
|
18
18
|
} catch (error) {
|
|
19
19
|
handoffStartedRef.current = false;
|
|
20
20
|
throw error;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
appBasePath,
|
|
3
|
+
appPathFromLocalRoute,
|
|
4
|
+
} from "@agent-native/core/client/api-path";
|
|
2
5
|
import { useAgentRouteState } from "@agent-native/core/client/navigation";
|
|
3
6
|
|
|
4
7
|
import {
|
|
@@ -11,8 +14,9 @@ import {
|
|
|
11
14
|
import { TAB_ID } from "@/lib/tab-id";
|
|
12
15
|
|
|
13
16
|
export interface NavigationState {
|
|
14
|
-
view
|
|
17
|
+
view?: string;
|
|
15
18
|
path?: string;
|
|
19
|
+
publicPath?: string;
|
|
16
20
|
threadId?: string;
|
|
17
21
|
}
|
|
18
22
|
|
|
@@ -20,19 +24,54 @@ export function useNavigationState() {
|
|
|
20
24
|
useAgentRouteState<NavigationState>({
|
|
21
25
|
browserTabId: TAB_ID,
|
|
22
26
|
requestSource: TAB_ID,
|
|
23
|
-
getNavigationState: ({ pathname }) =>
|
|
24
|
-
|
|
25
|
-
return {
|
|
26
|
-
view: viewForPath(pathname),
|
|
27
|
-
path: appPath(pathname),
|
|
28
|
-
...(threadId ? { threadId } : {}),
|
|
29
|
-
};
|
|
30
|
-
},
|
|
31
|
-
getCommandPath: (command) =>
|
|
32
|
-
routerPath(command.path || pathForCommand(command)),
|
|
27
|
+
getNavigationState: ({ pathname }) => navigationStateForPath(pathname),
|
|
28
|
+
getCommandPath: commandPathForNavigation,
|
|
33
29
|
});
|
|
34
30
|
}
|
|
35
31
|
|
|
32
|
+
export function commandPathForNavigation(command: NavigationState): string {
|
|
33
|
+
const fallbackPath = pathForCommand(command);
|
|
34
|
+
const path = typeof command?.path === "string" ? command.path : "";
|
|
35
|
+
if (!path) return fallbackPath;
|
|
36
|
+
|
|
37
|
+
const basePath = appBasePath();
|
|
38
|
+
if (!basePath) return path;
|
|
39
|
+
|
|
40
|
+
const suffixIndex = path.search(/[?#]/);
|
|
41
|
+
const pathname = suffixIndex === -1 ? path : path.slice(0, suffixIndex);
|
|
42
|
+
const suffix = suffixIndex === -1 ? "" : path.slice(suffixIndex);
|
|
43
|
+
const publicPath =
|
|
44
|
+
typeof command?.publicPath === "string" ? command.publicPath : "";
|
|
45
|
+
const publicPathSuffixIndex = publicPath.search(/[?#]/);
|
|
46
|
+
const declaredPublicPath =
|
|
47
|
+
publicPathSuffixIndex === -1
|
|
48
|
+
? publicPath
|
|
49
|
+
: publicPath.slice(0, publicPathSuffixIndex);
|
|
50
|
+
const publicViewPath = appPathFromLocalRoute(pathForView(command?.view));
|
|
51
|
+
if (
|
|
52
|
+
matchesPathPrefix(pathname, basePath) &&
|
|
53
|
+
(matchesPathPrefix(pathname, publicViewPath) ||
|
|
54
|
+
(declaredPublicPath && declaredPublicPath === pathname))
|
|
55
|
+
) {
|
|
56
|
+
return `${pathname.slice(basePath.length) || "/"}${suffix}`;
|
|
57
|
+
}
|
|
58
|
+
return path;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function matchesPathPrefix(pathname: string, prefix: string): boolean {
|
|
62
|
+
return pathname === prefix || pathname.startsWith(`${prefix}/`);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export function navigationStateForPath(pathname: string): NavigationState {
|
|
66
|
+
const threadId = threadIdFromPath(pathname);
|
|
67
|
+
return {
|
|
68
|
+
view: viewForPath(pathname),
|
|
69
|
+
path: pathname,
|
|
70
|
+
publicPath: appPathFromLocalRoute(pathname),
|
|
71
|
+
...(threadId ? { threadId } : {}),
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
|
|
36
75
|
function viewForPath(pathname: string): string {
|
|
37
76
|
if (isChatPathname(pathname)) return "chat";
|
|
38
77
|
if (pathname === HOME_PATH) return "home";
|
|
@@ -78,13 +117,3 @@ export function pathForCommand(command: any): string {
|
|
|
78
117
|
typeof command?.threadId === "string" ? command.threadId.trim() : "";
|
|
79
118
|
return threadId ? chatThreadPath(threadId) : path;
|
|
80
119
|
}
|
|
81
|
-
|
|
82
|
-
function routerPath(path: string): string {
|
|
83
|
-
const basePath = appBasePath();
|
|
84
|
-
if (!basePath) return path;
|
|
85
|
-
if (path === basePath) return "/";
|
|
86
|
-
if (path.startsWith(`${basePath}/`)) {
|
|
87
|
-
return path.slice(basePath.length) || "/";
|
|
88
|
-
}
|
|
89
|
-
return path;
|
|
90
|
-
}
|
|
@@ -16,6 +16,7 @@ const INITIAL_TOOL_NAMES = [
|
|
|
16
16
|
export default createAgentChatPlugin({
|
|
17
17
|
appId: "chat",
|
|
18
18
|
actions: loadActionsFromStaticRegistry(actionsRegistry),
|
|
19
|
+
mcp: { connectorCatalog: [] },
|
|
19
20
|
initialToolNames: INITIAL_TOOL_NAMES,
|
|
20
21
|
resolveOrgId: async (event) => (await getOrgContext(event)).orgId,
|
|
21
22
|
systemPrompt: `You are the Chat app agent.
|
|
@@ -196,6 +196,11 @@ changes. If a command can arrive while a chat stream is rendering, prefer
|
|
|
196
196
|
`navigate(path, { replace: true, flushSync: true })` over a view-transition
|
|
197
197
|
wrapper so the URL and visible route commit together.
|
|
198
198
|
|
|
199
|
+
Keep `path` router-local. A segment matching the app mount prefix remains part
|
|
200
|
+
of the local route unless a matching `view` route or explicit `publicPath`
|
|
201
|
+
identifies the mounted URL. Carry the mounted form separately in `publicPath`;
|
|
202
|
+
never infer that `path` is mounted from its prefix alone.
|
|
203
|
+
|
|
199
204
|
## Jitter Prevention
|
|
200
205
|
|
|
201
206
|
Agent-side application-state writes are tagged with
|
|
@@ -196,6 +196,11 @@ changes. If a command can arrive while a chat stream is rendering, prefer
|
|
|
196
196
|
`navigate(path, { replace: true, flushSync: true })` over a view-transition
|
|
197
197
|
wrapper so the URL and visible route commit together.
|
|
198
198
|
|
|
199
|
+
Keep `path` router-local. A segment matching the app mount prefix remains part
|
|
200
|
+
of the local route unless a matching `view` route or explicit `publicPath`
|
|
201
|
+
identifies the mounted URL. Carry the mounted form separately in `publicPath`;
|
|
202
|
+
never infer that `path` is mounted from its prefix alone.
|
|
203
|
+
|
|
199
204
|
## Jitter Prevention
|
|
200
205
|
|
|
201
206
|
Agent-side application-state writes are tagged with
|
|
@@ -13,8 +13,6 @@ declare const _default: import("../../action.js").ActionDefinition<{
|
|
|
13
13
|
executionEngine?: string;
|
|
14
14
|
executionCwd?: string;
|
|
15
15
|
}, {
|
|
16
|
-
deleted?: undefined;
|
|
17
|
-
enabled?: undefined;
|
|
18
16
|
created: boolean;
|
|
19
17
|
name: string;
|
|
20
18
|
scope: "organization" | "personal";
|
|
@@ -25,31 +23,33 @@ declare const _default: import("../../action.js").ActionDefinition<{
|
|
|
25
23
|
reasoningEffort: "auto" | "high" | "low" | "max" | "medium" | "minimal" | "none" | "xhigh";
|
|
26
24
|
webhookPath: string;
|
|
27
25
|
nextRun: string;
|
|
26
|
+
deleted?: undefined;
|
|
27
|
+
enabled?: undefined;
|
|
28
28
|
executionHostId?: undefined;
|
|
29
29
|
executionEngine?: undefined;
|
|
30
30
|
executionCwd?: undefined;
|
|
31
31
|
} | {
|
|
32
|
-
enabled?: undefined;
|
|
33
|
-
nextRun?: undefined;
|
|
34
32
|
created?: undefined;
|
|
35
33
|
scope?: undefined;
|
|
36
34
|
triggerType?: undefined;
|
|
37
35
|
event?: undefined;
|
|
38
36
|
deleted: boolean;
|
|
39
37
|
name: string;
|
|
38
|
+
enabled?: undefined;
|
|
40
39
|
schedule?: undefined;
|
|
41
40
|
timezone?: undefined;
|
|
42
41
|
reasoningEffort?: undefined;
|
|
43
42
|
executionHostId?: undefined;
|
|
44
43
|
executionEngine?: undefined;
|
|
45
44
|
executionCwd?: undefined;
|
|
45
|
+
nextRun?: undefined;
|
|
46
46
|
webhookPath?: undefined;
|
|
47
47
|
} | {
|
|
48
|
-
deleted?: undefined;
|
|
49
48
|
created?: undefined;
|
|
50
49
|
scope?: undefined;
|
|
51
50
|
triggerType?: undefined;
|
|
52
51
|
event?: undefined;
|
|
52
|
+
deleted?: undefined;
|
|
53
53
|
name: string;
|
|
54
54
|
enabled: boolean;
|
|
55
55
|
schedule: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-native/core",
|
|
3
|
-
"version": "0.210.
|
|
3
|
+
"version": "0.210.1-nightly-20261020010058",
|
|
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": {
|
|
@@ -711,7 +711,7 @@
|
|
|
711
711
|
"yaml": "^2.9.0",
|
|
712
712
|
"yjs": "^13.6.33",
|
|
713
713
|
"zod": "^4.3.6",
|
|
714
|
-
"@agent-native/agentkit": "^0.210.
|
|
714
|
+
"@agent-native/agentkit": "^0.210.1-nightly-20261020010058",
|
|
715
715
|
"@agent-native/recap-cli": "^0.5.75"
|
|
716
716
|
},
|
|
717
717
|
"devDependencies": {
|
|
@@ -728,7 +728,7 @@
|
|
|
728
728
|
"@better-auth/scim": "1.7.6",
|
|
729
729
|
"@better-auth/sso": "1.7.6",
|
|
730
730
|
"@builder.io/ai-utils": "^0.84.0",
|
|
731
|
-
"@electric-sql/pglite": "^0.5.
|
|
731
|
+
"@electric-sql/pglite": "^0.5.9",
|
|
732
732
|
"@excalidraw/excalidraw": "0.18.1",
|
|
733
733
|
"@excalidraw/mermaid-to-excalidraw": "2.2.2",
|
|
734
734
|
"@launchdarkly/node-server-sdk": "^9.13.6",
|
|
@@ -782,7 +782,7 @@
|
|
|
782
782
|
"xlsx": "^0.18.5"
|
|
783
783
|
},
|
|
784
784
|
"peerDependencies": {
|
|
785
|
-
"@agent-native/core-corpus": "
|
|
785
|
+
"@agent-native/core-corpus": "0.210.1-nightly-20261020010058",
|
|
786
786
|
"@ai-sdk/anthropic": ">=3",
|
|
787
787
|
"@ai-sdk/cohere": ">=3",
|
|
788
788
|
"@ai-sdk/google": ">=3",
|
|
@@ -794,7 +794,7 @@
|
|
|
794
794
|
"@better-auth/scim": "1.7.6",
|
|
795
795
|
"@better-auth/sso": "1.7.6",
|
|
796
796
|
"@builder.io/ai-utils": "^0.84.0",
|
|
797
|
-
"@electric-sql/pglite": "^0.5.
|
|
797
|
+
"@electric-sql/pglite": "^0.5.9",
|
|
798
798
|
"@launchdarkly/node-server-sdk": "^9.13.6",
|
|
799
799
|
"@openrouter/ai-sdk-provider": ">=2",
|
|
800
800
|
"@opentelemetry/api": "^1.9.1",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
===================================================================
|
|
2
2
|
--- a/.agents/skills/actions/SKILL.md
|
|
3
3
|
+++ b/.agents/skills/actions/SKILL.md
|
|
4
|
-
@@ -
|
|
4
|
+
@@ -158,8 +158,22 @@
|
|
5
5
|
```
|
|
6
6
|
|
|
7
7
|
CLI flags become action input fields (`--key value` or `--key=value`); the runner does not read or write files for `--input` or `--output`. The default template dispatches through core's `runScript()` in `actions/run.ts`. Action names are lowercase-with-hyphens (`pnpm action my-action` → `actions/my-action.ts`).
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
===================================================================
|
|
2
2
|
--- a/app/hooks/use-navigation-state.ts
|
|
3
3
|
+++ b/app/hooks/use-navigation-state.ts
|
|
4
|
-
@@ -
|
|
5
|
-
import { appBasePath, appPath } from "@agent-native/core/client/api-path";
|
|
6
|
-
import { useAgentRouteState } from "@agent-native/core/client/navigation";
|
|
7
|
-
|
|
4
|
+
@@ -7,7 +6,0 @@
|
|
8
5
|
-import {
|
|
9
6
|
- chatThreadPath,
|
|
10
7
|
- HOME_PATH,
|
|
@@ -12,37 +9,30 @@
|
|
|
12
9
|
- NEW_CHAT_PATH,
|
|
13
10
|
- threadIdFromPath,
|
|
14
11
|
-} from "@/lib/chat-paths";
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
export interface NavigationState {
|
|
18
|
-
view: string;
|
|
19
|
-
path?: string;
|
|
12
|
+
@@ -20,1 +12,0 @@
|
|
20
13
|
- threadId?: string;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
export function useNavigationState() {
|
|
24
|
-
useAgentRouteState<NavigationState>({
|
|
25
|
-
browserTabId: TAB_ID,
|
|
26
|
-
requestSource: TAB_ID,
|
|
27
|
-
- getNavigationState: ({ pathname }) => {
|
|
28
|
-
- const threadId = threadIdFromPath(pathname);
|
|
29
|
-
- return {
|
|
30
|
-
- view: viewForPath(pathname),
|
|
31
|
-
- path: appPath(pathname),
|
|
32
|
-
- ...(threadId ? { threadId } : {}),
|
|
33
|
-
- };
|
|
34
|
-
- },
|
|
14
|
+
@@ -27,1 +19,5 @@
|
|
15
|
+
- getNavigationState: ({ pathname }) => navigationStateForPath(pathname),
|
|
35
16
|
+ getNavigationState: ({ pathname }) => ({
|
|
36
17
|
+ view: viewForPath(pathname),
|
|
37
|
-
+ path:
|
|
18
|
+
+ path: pathname,
|
|
19
|
+
+ publicPath: appPathFromLocalRoute(pathname),
|
|
38
20
|
+ }),
|
|
39
|
-
|
|
40
|
-
-
|
|
41
|
-
+
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
21
|
+
@@ -33,1 +29,1 @@
|
|
22
|
+
- const fallbackPath = pathForCommand(command);
|
|
23
|
+
+ const fallbackPath = pathForView(command?.view);
|
|
24
|
+
@@ -52,10 +47,0 @@
|
|
25
|
+
-export function navigationStateForPath(pathname: string): NavigationState {
|
|
26
|
+
- const threadId = threadIdFromPath(pathname);
|
|
27
|
+
- return {
|
|
28
|
+
- view: viewForPath(pathname),
|
|
29
|
+
- path: pathname,
|
|
30
|
+
- publicPath: appPathFromLocalRoute(pathname),
|
|
31
|
+
- ...(threadId ? { threadId } : {}),
|
|
32
|
+
- };
|
|
33
|
+
-}
|
|
34
|
+
-
|
|
35
|
+
@@ -63,11 +49,2 @@
|
|
46
36
|
- if (isChatPathname(pathname)) return "chat";
|
|
47
37
|
- if (pathname === HOME_PATH) return "home";
|
|
48
38
|
- if (pathname.startsWith("/database")) return "database";
|
|
@@ -56,14 +46,11 @@
|
|
|
56
46
|
- return "chat";
|
|
57
47
|
+ if (pathname === "/") return "home";
|
|
58
48
|
+ return "home";
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
function pathForView(view?: string): string {
|
|
62
|
-
switch (view) {
|
|
49
|
+
@@ -78,3 +54,0 @@
|
|
63
50
|
- case "chat":
|
|
64
51
|
- case "ask":
|
|
65
52
|
- return NEW_CHAT_PATH;
|
|
66
|
-
|
|
53
|
+
@@ -82,13 +56,1 @@
|
|
67
54
|
- return HOME_PATH;
|
|
68
55
|
- case "database":
|
|
69
56
|
- return "/database";
|
|
@@ -78,12 +65,11 @@
|
|
|
78
65
|
- case "team":
|
|
79
66
|
- return "/settings/organization";
|
|
80
67
|
+ return "/";
|
|
81
|
-
|
|
68
|
+
@@ -96,1 +58,1 @@
|
|
82
69
|
- return HOME_PATH;
|
|
83
70
|
+ return "/";
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
71
|
+
@@ -99,8 +60,0 @@
|
|
72
|
+
-
|
|
87
73
|
-export function pathForCommand(command: any): string {
|
|
88
74
|
- const path = pathForView(command?.view);
|
|
89
75
|
- if (command?.view !== "chat" && command?.view !== "ask") return path;
|
|
@@ -91,8 +77,3 @@
|
|
|
91
77
|
- typeof command?.threadId === "string" ? command.threadId.trim() : "";
|
|
92
78
|
- return threadId ? chatThreadPath(threadId) : path;
|
|
93
79
|
-}
|
|
94
|
-
-
|
|
95
|
-
function routerPath(path: string): string {
|
|
96
|
-
const basePath = appBasePath();
|
|
97
|
-
if (!basePath) return path;
|
|
98
|
-
if (path === basePath) return "/";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
===================================================================
|
|
2
2
|
--- a/server/plugins/agent-chat.ts
|
|
3
3
|
+++ b/server/plugins/agent-chat.ts
|
|
4
|
-
@@ -4,
|
|
4
|
+
@@ -4,24 +4,21 @@
|
|
5
5
|
loadActionsFromStaticRegistry,
|
|
6
6
|
} from "@agent-native/core/server";
|
|
7
7
|
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
export default createAgentChatPlugin({
|
|
19
19
|
appId: "chat",
|
|
20
20
|
actions: loadActionsFromStaticRegistry(actionsRegistry),
|
|
21
|
+
mcp: { connectorCatalog: [] },
|
|
21
22
|
- initialToolNames: INITIAL_TOOL_NAMES,
|
|
22
23
|
+ nativeActionsInDev: true,
|
|
23
24
|
+ finalResponseGuard: appOperationFinalResponseGuard,
|
|
@@ -196,6 +196,11 @@ changes. If a command can arrive while a chat stream is rendering, prefer
|
|
|
196
196
|
`navigate(path, { replace: true, flushSync: true })` over a view-transition
|
|
197
197
|
wrapper so the URL and visible route commit together.
|
|
198
198
|
|
|
199
|
+
Keep `path` router-local. A segment matching the app mount prefix remains part
|
|
200
|
+
of the local route unless a matching `view` route or explicit `publicPath`
|
|
201
|
+
identifies the mounted URL. Carry the mounted form separately in `publicPath`;
|
|
202
|
+
never infer that `path` is mounted from its prefix alone.
|
|
203
|
+
|
|
199
204
|
## Jitter Prevention
|
|
200
205
|
|
|
201
206
|
Agent-side application-state writes are tagged with
|