@agent-native/core 0.12.23 → 0.12.24

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.
Files changed (64) hide show
  1. package/dist/agent/thread-data-builder.d.ts +10 -0
  2. package/dist/agent/thread-data-builder.d.ts.map +1 -1
  3. package/dist/agent/thread-data-builder.js +80 -0
  4. package/dist/agent/thread-data-builder.js.map +1 -1
  5. package/dist/agent/types.d.ts +7 -0
  6. package/dist/agent/types.d.ts.map +1 -1
  7. package/dist/agent/types.js.map +1 -1
  8. package/dist/cli/create.d.ts.map +1 -1
  9. package/dist/cli/create.js +3 -3
  10. package/dist/cli/create.js.map +1 -1
  11. package/dist/client/AgentPanel.d.ts.map +1 -1
  12. package/dist/client/AgentPanel.js +9 -1
  13. package/dist/client/AgentPanel.js.map +1 -1
  14. package/dist/client/AssistantChat.d.ts.map +1 -1
  15. package/dist/client/AssistantChat.js +49 -10
  16. package/dist/client/AssistantChat.js.map +1 -1
  17. package/dist/client/ErrorBoundary.d.ts.map +1 -1
  18. package/dist/client/ErrorBoundary.js +3 -2
  19. package/dist/client/ErrorBoundary.js.map +1 -1
  20. package/dist/client/agent-chat-adapter.d.ts.map +1 -1
  21. package/dist/client/agent-chat-adapter.js +93 -45
  22. package/dist/client/agent-chat-adapter.js.map +1 -1
  23. package/dist/client/composer/PromptComposer.js +1 -1
  24. package/dist/client/composer/PromptComposer.js.map +1 -1
  25. package/dist/client/composer/TiptapComposer.d.ts +5 -0
  26. package/dist/client/composer/TiptapComposer.d.ts.map +1 -1
  27. package/dist/client/composer/TiptapComposer.js +10 -1
  28. package/dist/client/composer/TiptapComposer.js.map +1 -1
  29. package/dist/client/onboarding/OnboardingPanel.js +2 -1
  30. package/dist/client/onboarding/OnboardingPanel.js.map +1 -1
  31. package/dist/client/progress/RunsTray.d.ts.map +1 -1
  32. package/dist/client/progress/RunsTray.js +18 -3
  33. package/dist/client/progress/RunsTray.js.map +1 -1
  34. package/dist/client/resources/ResourceTree.d.ts.map +1 -1
  35. package/dist/client/resources/ResourceTree.js +5 -4
  36. package/dist/client/resources/ResourceTree.js.map +1 -1
  37. package/dist/client/settings/useBuilderStatus.d.ts.map +1 -1
  38. package/dist/client/settings/useBuilderStatus.js +5 -3
  39. package/dist/client/settings/useBuilderStatus.js.map +1 -1
  40. package/dist/collab/client.d.ts +9 -0
  41. package/dist/collab/client.d.ts.map +1 -1
  42. package/dist/collab/client.js +36 -10
  43. package/dist/collab/client.js.map +1 -1
  44. package/dist/onboarding/default-steps.js +1 -1
  45. package/dist/onboarding/default-steps.js.map +1 -1
  46. package/dist/progress/store.d.ts.map +1 -1
  47. package/dist/progress/store.js +1 -1
  48. package/dist/progress/store.js.map +1 -1
  49. package/dist/server/action-routes.d.ts +2 -0
  50. package/dist/server/action-routes.d.ts.map +1 -1
  51. package/dist/server/action-routes.js +4 -1
  52. package/dist/server/action-routes.js.map +1 -1
  53. package/dist/server/agent-chat-plugin.d.ts.map +1 -1
  54. package/dist/server/agent-chat-plugin.js +27 -15
  55. package/dist/server/agent-chat-plugin.js.map +1 -1
  56. package/dist/server/index.d.ts +1 -1
  57. package/dist/server/index.d.ts.map +1 -1
  58. package/dist/server/index.js +1 -1
  59. package/dist/server/index.js.map +1 -1
  60. package/dist/server/request-context.d.ts +9 -0
  61. package/dist/server/request-context.d.ts.map +1 -1
  62. package/dist/server/request-context.js +13 -0
  63. package/dist/server/request-context.js.map +1 -1
  64. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"AssistantChat.d.ts","sourceRoot":"","sources":["../../src/client/AssistantChat.tsx"],"names":[],"mappings":"AAAA,OAAO,KAQN,MAAM,OAAO,CAAC;AA6Bf,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AA8rErE,MAAM,WAAW,mBAAmB;IAClC,qDAAqD;IACrD,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,6DAA6D;IAC7D,YAAY,CAAC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;IACnD,wEAAwE;IACxE,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB;AAED,eAAO,MAAM,mBAAmB,gBAAgB,CAAC;AAEjD,8DAA8D;AAC9D,wBAAgB,gBAAgB,CAAC,KAAK,CAAC,EAAE,MAAM,QAI9C;AAqCD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,CAAC;AA25C7B,eAAO,MAAM,aAAa,gGA4DxB,CAAC"}
@@ -1216,6 +1216,7 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
1216
1216
  // is connected — `BuilderSetupCard` watches this to replay a one-shot bounce.
1217
1217
  const [missingKeyBouncePulse, setMissingKeyBouncePulse] = useState(0);
1218
1218
  const [authError, setAuthError] = useState(null);
1219
+ const [authSessionAvailable, setAuthSessionAvailable] = useState(false);
1219
1220
  const [queuedMessages, setQueuedMessages] = useState([]);
1220
1221
  // Tracks the JSON of the last queue we successfully persisted so the
1221
1222
  // debounced save effect can skip no-op writes (e.g. restore-from-server
@@ -1583,8 +1584,6 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
1583
1584
  return;
1584
1585
  const repo = threadRuntime.export();
1585
1586
  const { title, preview } = extractThreadMeta(repo);
1586
- if (!title)
1587
- return;
1588
1587
  lastSaveTimeRef.current = now;
1589
1588
  savedTitleRef.current = title;
1590
1589
  onSaveThreadRef.current(threadId, {
@@ -1703,6 +1702,25 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
1703
1702
  };
1704
1703
  }, []);
1705
1704
  // Listen for auth error events from the adapter
1705
+ const checkAuthSession = useCallback(async () => {
1706
+ try {
1707
+ const res = await fetch(agentNativePath("/_agent-native/auth/session"), {
1708
+ cache: "no-store",
1709
+ });
1710
+ if (!res.ok)
1711
+ return false;
1712
+ const data = await res.json().catch(() => null);
1713
+ const hasSession = !!data && !data.error;
1714
+ setAuthSessionAvailable(hasSession);
1715
+ if (hasSession) {
1716
+ setAuthError(null);
1717
+ }
1718
+ return hasSession;
1719
+ }
1720
+ catch {
1721
+ return false;
1722
+ }
1723
+ }, []);
1706
1724
  useEffect(() => {
1707
1725
  const handler = (e) => {
1708
1726
  const detail = e.detail;
@@ -1713,11 +1731,26 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
1713
1731
  eventThreadId !== threadId) {
1714
1732
  return;
1715
1733
  }
1734
+ setAuthSessionAvailable(false);
1716
1735
  setAuthError({ sessionExpired: detail?.reason === "session-expired" });
1736
+ void checkAuthSession();
1717
1737
  };
1718
1738
  window.addEventListener("agent-chat:auth-error", handler);
1719
1739
  return () => window.removeEventListener("agent-chat:auth-error", handler);
1720
- }, [tabId, threadId]);
1740
+ }, [checkAuthSession, tabId, threadId]);
1741
+ useEffect(() => {
1742
+ if (!authError)
1743
+ return;
1744
+ const handler = () => void checkAuthSession();
1745
+ const timer = window.setTimeout(handler, 250);
1746
+ window.addEventListener("focus", handler);
1747
+ window.addEventListener("agent-engine:configured-changed", handler);
1748
+ return () => {
1749
+ window.clearTimeout(timer);
1750
+ window.removeEventListener("focus", handler);
1751
+ window.removeEventListener("agent-engine:configured-changed", handler);
1752
+ };
1753
+ }, [authError, checkAuthSession]);
1721
1754
  // Listen for loop-limit events from the adapter
1722
1755
  useEffect(() => {
1723
1756
  const handler = (e) => {
@@ -2040,16 +2073,20 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
2040
2073
  (!userStoppedRunRef.current.runId ||
2041
2074
  !visibleRunError.runId ||
2042
2075
  userStoppedRunRef.current.runId === visibleRunError.runId));
2043
- return (_jsx(CheckpointContext.Provider, { value: checkpointCtx, children: _jsx(MessageActionsContext.Provider, { value: messageActionsCtx, children: _jsx(ChatRunningContext.Provider, { value: isRunning, children: _jsxs("div", { className: cn("flex flex-1 flex-col h-full min-h-0 text-foreground", className), children: [showHeader && (_jsxs("div", { className: "flex h-11 shrink-0 items-center justify-between border-b border-border px-4", children: [_jsx("span", { className: "text-[13px] font-medium text-muted-foreground", children: "Agent" }), _jsx("div", { className: "flex items-center gap-1", children: onSwitchToCli && (_jsx(TooltipProvider, { delayDuration: 200, children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsxs("button", { onClick: onSwitchToCli, "aria-label": "Switch to CLI", className: "flex items-center gap-1 text-[12px] text-muted-foreground hover:text-foreground px-2 py-1 rounded-md hover:bg-accent", children: [_jsx(IconTerminal, { className: "h-3.5 w-3.5" }), "CLI"] }) }), _jsx(TooltipContent, { children: "Switch to CLI" })] }) })) })] })), _jsx("div", { ref: scrollRef, className: "flex-1 overflow-y-auto overflow-x-hidden min-h-0", children: authError ? (_jsxs("div", { className: "flex flex-col items-center justify-center h-full px-4 gap-3", children: [_jsx("div", { className: "flex h-10 w-10 items-center justify-center rounded-full bg-destructive/10", children: _jsx(IconLock, { className: "h-5 w-5 text-destructive" }) }), _jsxs("div", { className: "text-center max-w-[280px]", children: [_jsx("p", { className: "text-sm font-medium text-foreground mb-1", children: authError.sessionExpired
2044
- ? "Session expired"
2045
- : "Authentication required" }), _jsx("p", { className: "text-xs text-muted-foreground leading-relaxed", children: authError.sessionExpired
2046
- ? "Your session may have expired. Log out and log back in to reconnect."
2047
- : "You need to log in to use the agent." })] }), _jsxs("div", { className: "flex gap-2", children: [!authError.sessionExpired && (_jsx("button", { onClick: () => {
2076
+ return (_jsx(CheckpointContext.Provider, { value: checkpointCtx, children: _jsx(MessageActionsContext.Provider, { value: messageActionsCtx, children: _jsx(ChatRunningContext.Provider, { value: isRunning, children: _jsxs("div", { className: cn("flex flex-1 flex-col h-full min-h-0 text-foreground", className), children: [showHeader && (_jsxs("div", { className: "flex h-11 shrink-0 items-center justify-between border-b border-border px-4", children: [_jsx("span", { className: "text-[13px] font-medium text-muted-foreground", children: "Agent" }), _jsx("div", { className: "flex items-center gap-1", children: onSwitchToCli && (_jsx(TooltipProvider, { delayDuration: 200, children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsxs("button", { onClick: onSwitchToCli, "aria-label": "Switch to CLI", className: "flex items-center gap-1 text-[12px] text-muted-foreground hover:text-foreground px-2 py-1 rounded-md hover:bg-accent", children: [_jsx(IconTerminal, { className: "h-3.5 w-3.5" }), "CLI"] }) }), _jsx(TooltipContent, { children: "Switch to CLI" })] }) })) })] })), _jsx("div", { ref: scrollRef, className: "flex-1 overflow-y-auto overflow-x-hidden min-h-0", children: authError ? (_jsxs("div", { className: "flex flex-col items-center justify-center h-full px-4 gap-3", children: [_jsx("div", { className: "flex h-10 w-10 items-center justify-center rounded-full bg-destructive/10", children: _jsx(IconLock, { className: "h-5 w-5 text-destructive" }) }), _jsxs("div", { className: "text-center max-w-[280px]", children: [_jsx("p", { className: "text-sm font-medium text-foreground mb-1", children: authSessionAvailable
2077
+ ? "Chat session needs refresh"
2078
+ : authError.sessionExpired
2079
+ ? "Session expired"
2080
+ : "Authentication required" }), _jsx("p", { className: "text-xs text-muted-foreground leading-relaxed", children: authSessionAvailable
2081
+ ? "You're signed in, but this chat connection needs to reconnect."
2082
+ : authError.sessionExpired
2083
+ ? "Your session may have expired. Log out and log back in to reconnect."
2084
+ : "You need to log in to use the agent." })] }), _jsxs("div", { className: "flex gap-2", children: [!authError.sessionExpired && !authSessionAvailable && (_jsx("button", { onClick: () => {
2048
2085
  const ret = window.location.pathname + window.location.search;
2049
2086
  window.location.href =
2050
2087
  agentNativePath("/_agent-native/sign-in") +
2051
2088
  `?return=${encodeURIComponent(ret)}`;
2052
- }, className: "text-xs text-background bg-foreground hover:opacity-90 px-3 py-1.5 rounded-md", children: "Log in" })), authError.sessionExpired && (_jsx("button", { onClick: async () => {
2089
+ }, className: "text-xs text-background bg-foreground hover:opacity-90 px-3 py-1.5 rounded-md", children: "Log in" })), authError.sessionExpired && !authSessionAvailable && (_jsx("button", { onClick: async () => {
2053
2090
  try {
2054
2091
  await fetch(agentNativePath("/_agent-native/auth/logout"), {
2055
2092
  method: "POST",
@@ -2060,7 +2097,9 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
2060
2097
  }, className: "text-xs text-destructive hover:text-destructive/80 px-3 py-1.5 rounded-md border border-destructive/30 hover:bg-destructive/10", children: "Log out" })), _jsx("button", { onClick: () => {
2061
2098
  setAuthError(null);
2062
2099
  window.location.reload();
2063
- }, className: "text-xs text-muted-foreground hover:text-foreground px-3 py-1.5 rounded-md border border-border hover:bg-accent", children: "Retry" })] })] })) : missingApiKey && messages.length === 0 ? (_jsx("div", { className: "flex flex-col items-center justify-center h-full px-2", children: _jsx(BuilderSetupCard, { onConnected: handleBuilderConnected, bouncePulse: missingKeyBouncePulse }) })) : isRestoring ? (_jsxs("div", { className: "flex flex-col gap-3 p-4", children: [_jsx("div", { className: "flex justify-end", children: _jsx("div", { className: "h-8 w-32 rounded-lg bg-muted animate-pulse" }) }), _jsxs("div", { className: "flex flex-col gap-1.5", children: [_jsx("div", { className: "h-4 w-48 rounded bg-muted animate-pulse" }), _jsx("div", { className: "h-4 w-64 rounded bg-muted animate-pulse" }), _jsx("div", { className: "h-4 w-40 rounded bg-muted animate-pulse" })] })] })) : messages.length === 0 && !isReconnecting ? (_jsxs("div", { className: "flex flex-col items-center justify-center gap-4 py-16 px-4 h-full", children: [_jsx("div", { className: "flex h-10 w-10 items-center justify-center rounded-full bg-muted", children: _jsx(IconMessage, { className: "h-5 w-5 text-muted-foreground" }) }), _jsx("p", { className: "text-sm text-muted-foreground text-center max-w-[240px]", children: emptyStateText ?? "How can I help you?" }), suggestions && suggestions.length > 0 && (_jsx("div", { className: "flex flex-col gap-1.5 w-full max-w-[280px]", children: suggestions.map((suggestion) => (_jsx("button", { onClick: () => {
2100
+ }, className: authSessionAvailable
2101
+ ? "text-xs text-background bg-foreground hover:opacity-90 px-3 py-1.5 rounded-md"
2102
+ : "text-xs text-muted-foreground hover:text-foreground px-3 py-1.5 rounded-md border border-border hover:bg-accent", children: "Refresh chat" })] })] })) : missingApiKey && messages.length === 0 ? (_jsx("div", { className: "flex flex-col items-center justify-center h-full px-2", children: _jsx(BuilderSetupCard, { onConnected: handleBuilderConnected, bouncePulse: missingKeyBouncePulse }) })) : isRestoring ? (_jsxs("div", { className: "flex flex-col gap-3 p-4", children: [_jsx("div", { className: "flex justify-end", children: _jsx("div", { className: "h-8 w-32 rounded-lg bg-muted animate-pulse" }) }), _jsxs("div", { className: "flex flex-col gap-1.5", children: [_jsx("div", { className: "h-4 w-48 rounded bg-muted animate-pulse" }), _jsx("div", { className: "h-4 w-64 rounded bg-muted animate-pulse" }), _jsx("div", { className: "h-4 w-40 rounded bg-muted animate-pulse" })] })] })) : messages.length === 0 && !isReconnecting ? (_jsxs("div", { className: "flex flex-col items-center justify-center gap-4 py-16 px-4 h-full", children: [_jsx("div", { className: "flex h-10 w-10 items-center justify-center rounded-full bg-muted", children: _jsx(IconMessage, { className: "h-5 w-5 text-muted-foreground" }) }), _jsx("p", { className: "text-sm text-muted-foreground text-center max-w-[240px]", children: emptyStateText ?? "How can I help you?" }), suggestions && suggestions.length > 0 && (_jsx("div", { className: "flex flex-col gap-1.5 w-full max-w-[280px]", children: suggestions.map((suggestion) => (_jsx("button", { onClick: () => {
2064
2103
  threadRuntime.append({
2065
2104
  role: "user",
2066
2105
  content: [{ type: "text", text: suggestion }],