@agent-native/core 0.36.0 → 0.37.0
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/cli/skills.d.ts.map +1 -1
- package/dist/cli/skills.js +78 -0
- package/dist/cli/skills.js.map +1 -1
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +8 -4
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/MultiTabAssistantChat.d.ts.map +1 -1
- package/dist/client/MultiTabAssistantChat.js +14 -10
- package/dist/client/MultiTabAssistantChat.js.map +1 -1
- package/dist/client/dynamic-suggestions.d.ts +13 -7
- package/dist/client/dynamic-suggestions.d.ts.map +1 -1
- package/dist/client/dynamic-suggestions.js +23 -12
- package/dist/client/dynamic-suggestions.js.map +1 -1
- package/dist/client/index.d.ts +1 -0
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +1 -0
- package/dist/client/index.js.map +1 -1
- package/dist/client/route-state.d.ts +116 -0
- package/dist/client/route-state.d.ts.map +1 -0
- package/dist/client/route-state.js +205 -0
- package/dist/client/route-state.js.map +1 -0
- package/dist/templates/default/AGENTS.md +7 -1
- package/dist/templates/default/app/hooks/use-navigation-state.ts +10 -76
- package/docs/content/context-awareness.md +90 -48
- package/docs/content/creating-templates.md +22 -1
- package/package.json +2 -1
- package/src/templates/default/AGENTS.md +7 -1
- package/src/templates/default/app/hooks/use-navigation-state.ts +10 -76
|
@@ -6,7 +6,7 @@ import ReactMarkdown, { defaultUrlTransform } from "react-markdown";
|
|
|
6
6
|
import remarkGfm from "remark-gfm";
|
|
7
7
|
import { createAgentChatAdapter, } from "./agent-chat-adapter.js";
|
|
8
8
|
import { appendAgentChatContextToMessage, formatAgentChatContextItemsForPrompt, normalizeAgentChatContextItem, publishAgentChatContextItems, refreshAgentChatContext, } from "./agent-chat.js";
|
|
9
|
-
import {
|
|
9
|
+
import { useAgentDynamicSuggestionsResult, } from "./dynamic-suggestions.js";
|
|
10
10
|
import { initialSmoothStreamingGraphemeCount, SMOOTH_STREAMING_COMMIT_INTERVAL_MS, smoothStreamingPunctuationDelayMs, smoothStreamingRevealCount, splitStreamingTextGraphemes, } from "../shared/streaming-text-smoothing.js";
|
|
11
11
|
import { getActiveRun } from "./active-run-state.js";
|
|
12
12
|
import { AgentAutoContinueSignal, readSSEStreamRaw, } from "./sse-event-processor.js";
|
|
@@ -1949,13 +1949,16 @@ function ensureMessageMetadata(repo) {
|
|
|
1949
1949
|
// Re-export for backwards compatibility
|
|
1950
1950
|
import { extractThreadMeta, normalizeThreadRepository, } from "../agent/thread-data-builder.js";
|
|
1951
1951
|
export { extractThreadMeta };
|
|
1952
|
+
function EmptyStateSuggestionSkeleton() {
|
|
1953
|
+
return (_jsxs("div", { className: "flex w-full max-w-[280px] flex-col gap-1.5", "aria-hidden": "true", children: [_jsx("div", { className: "h-12 w-full rounded-lg border border-border bg-muted/60 animate-pulse" }), _jsx("div", { className: "h-12 w-full rounded-lg border border-border bg-muted/60 animate-pulse" }), _jsx("div", { className: "h-12 w-full rounded-lg border border-border bg-muted/60 animate-pulse" })] }));
|
|
1954
|
+
}
|
|
1952
1955
|
const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateText, suggestions, dynamicSuggestions, emptyStateAddon, showHeader = true, onSwitchToCli, className, apiUrl, tabId, browserTabId, threadId, contextScope, isActiveComposer = true, onMessageCountChange, onSaveThread, onGenerateTitle, composerSlot, composerAreaClassName, composerPlaceholder, composerLayoutVariant = "default", centerComposerWhenEmpty = false, emptyStateDisplay = "default", composerToolbarSlot, composerExtraActionButton, composerDisabled = false, composerDisabledPlaceholder, isNewThread, onSlashCommand, execMode, onExecModeChange, planModeDisabled, planModeDisabledReason, selectedModel, defaultModel, selectedEngine, selectedEffort, availableModels, onModelChange, onEffortChange, onForkChat, onConnectProvider, plusMenuMode = "full", providerStatusChecksEnabled = true, loadHistoryRepository, historyReloadKey, externalStreaming = false, }, ref) {
|
|
1953
1956
|
const thread = useThread();
|
|
1954
1957
|
const threadRuntime = useThreadRuntime();
|
|
1955
1958
|
const composerRuntime = useComposerRuntime();
|
|
1956
1959
|
const isRuntimeRunning = thread.isRunning;
|
|
1957
1960
|
const messages = thread.messages;
|
|
1958
|
-
const resolvedSuggestions =
|
|
1961
|
+
const { suggestions: resolvedSuggestions, isLoading: suggestionsLoading } = useAgentDynamicSuggestionsResult({
|
|
1959
1962
|
staticSuggestions: suggestions,
|
|
1960
1963
|
dynamicSuggestions,
|
|
1961
1964
|
browserTabId,
|
|
@@ -3248,12 +3251,13 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
|
|
|
3248
3251
|
? "text-xs text-background bg-foreground hover:opacity-90 px-3 py-1.5 rounded-md"
|
|
3249
3252
|
: "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: cn("agent-empty-state", emptyStateDisplay === "hidden"
|
|
3250
3253
|
? "sr-only"
|
|
3251
|
-
: "flex h-full flex-col items-center justify-center gap-4 px-4 py-16"), 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: "
|
|
3254
|
+
: "flex h-full flex-col items-center justify-center gap-4 px-4 py-16"), 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: "sr-only", children: emptyStateText ?? "How can I help you?" }), emptyStateAddon, suggestionsLoading ? (_jsx(EmptyStateSuggestionSkeleton, {})) : resolvedSuggestions &&
|
|
3255
|
+
resolvedSuggestions.length > 0 ? (_jsx("div", { className: "flex flex-col gap-1.5 w-full max-w-[280px]", children: resolvedSuggestions.map((suggestion) => (_jsx("button", { onClick: () => {
|
|
3252
3256
|
threadRuntime.append({
|
|
3253
3257
|
role: "user",
|
|
3254
3258
|
content: [{ type: "text", text: suggestion }],
|
|
3255
3259
|
});
|
|
3256
|
-
}, className: "w-full rounded-lg border border-border px-3 py-2 text-left text-[13px] text-muted-foreground hover:bg-accent hover:text-foreground", children: suggestion }, suggestion))) }))] })) : (_jsxs("div", { className: "agent-thread-content flex flex-col gap-4 px-4 py-4", children: [_jsx(AssistantMessageListErrorBoundary, { resetKey: messageListResetKey, children: _jsx(ThreadPrimitive.Messages, { components: {
|
|
3260
|
+
}, className: "w-full rounded-lg border border-border px-3 py-2 text-left text-[13px] text-muted-foreground hover:bg-accent hover:text-foreground", children: suggestion }, suggestion))) })) : null] })) : (_jsxs("div", { className: "agent-thread-content flex flex-col gap-4 px-4 py-4", children: [_jsx(AssistantMessageListErrorBoundary, { resetKey: messageListResetKey, children: _jsx(ThreadPrimitive.Messages, { components: {
|
|
3257
3261
|
UserMessage,
|
|
3258
3262
|
AssistantMessage,
|
|
3259
3263
|
} }) }), missingApiKey && (_jsx(BuilderSetupCard, { onConnected: handleBuilderConnected, bouncePulse: missingKeyBouncePulse })), visibleLoopLimit && !showRunningInUI && (_jsx(LoopLimitContinueCard, { info: visibleLoopLimit, onContinue: () => {
|