@agent-native/core 0.20.1 → 0.20.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/dist/agent/engine/registry.d.ts.map +1 -1
- package/dist/agent/engine/registry.js +21 -5
- package/dist/agent/engine/registry.js.map +1 -1
- package/dist/cli/connect.d.ts +21 -1
- package/dist/cli/connect.d.ts.map +1 -1
- package/dist/cli/connect.js +137 -11
- package/dist/cli/connect.js.map +1 -1
- package/dist/cli/index.js +4 -3
- package/dist/cli/index.js.map +1 -1
- package/dist/client/composer/TiptapComposer.d.ts.map +1 -1
- package/dist/client/composer/TiptapComposer.js +57 -48
- package/dist/client/composer/TiptapComposer.js.map +1 -1
- package/dist/mcp/connect-route.d.ts.map +1 -1
- package/dist/mcp/connect-route.js +6 -20
- package/dist/mcp/connect-route.js.map +1 -1
- package/dist/server/credential-provider.d.ts.map +1 -1
- package/dist/server/credential-provider.js +30 -17
- package/dist/server/credential-provider.js.map +1 -1
- package/dist/server/google-auth-plugin.d.ts.map +1 -1
- package/dist/server/google-auth-plugin.js +16 -8
- package/dist/server/google-auth-plugin.js.map +1 -1
- package/dist/server/onboarding-html.d.ts.map +1 -1
- package/dist/server/onboarding-html.js +16 -8
- package/dist/server/onboarding-html.js.map +1 -1
- package/docs/content/external-agents.md +5 -1
- package/package.json +2 -2
|
@@ -11,7 +11,6 @@ import { MentionPopover } from "./MentionPopover.js";
|
|
|
11
11
|
import { useMentionSearch } from "./use-mention-search.js";
|
|
12
12
|
import { useSkills } from "./use-skills.js";
|
|
13
13
|
import { IconArrowUp, IconCheck, IconChevronDown, IconChevronRight, IconBulb, IconClock, IconBolt, IconTool, IconX, IconClipboardList, IconPencil, IconPlugConnected, } from "@tabler/icons-react";
|
|
14
|
-
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
15
14
|
import { useBuilderConnectFlow } from "../settings/useBuilderStatus.js";
|
|
16
15
|
import { useVoiceDictation } from "./useVoiceDictation.js";
|
|
17
16
|
import { VoiceButton, VoiceRecordingOverlay } from "./VoiceButton.js";
|
|
@@ -22,6 +21,7 @@ import { getComposerDraftKey } from "./draft-key.js";
|
|
|
22
21
|
import { createPastedTextFile, shouldConvertPasteToAttachment, } from "./pasted-text.js";
|
|
23
22
|
import { getReasoningEffortOptionsForModel, reasoningEffortLabel, } from "../../shared/reasoning-effort.js";
|
|
24
23
|
import { Tooltip, TooltipContent, TooltipTrigger, } from "../components/ui/tooltip.js";
|
|
24
|
+
import { Popover, PopoverContent, PopoverTrigger, } from "../components/ui/popover.js";
|
|
25
25
|
export function canSubmitComposerContent(options) {
|
|
26
26
|
return (!options.disabled &&
|
|
27
27
|
(options.hasEditorContent || options.attachmentCount > 0));
|
|
@@ -194,19 +194,19 @@ export function createTiptapComposerExtensions(getPlaceholder) {
|
|
|
194
194
|
}
|
|
195
195
|
function ModeSelector({ mode, onChange, planModeDisabled = false, planModeDisabledReason = "Open Agent Native Desktop to use Plan mode.", }) {
|
|
196
196
|
const [open, setOpen] = useState(false);
|
|
197
|
-
return (_jsxs(
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
197
|
+
return (_jsxs(Popover, { open: open, onOpenChange: setOpen, children: [_jsx(PopoverTrigger, { asChild: true, children: _jsxs("button", { type: "button", "aria-label": mode === "build" ? "Act mode" : "Plan mode", "data-agent-composer-slot": "mode-button", className: "agent-composer-mode-button shrink-0 flex items-center gap-1 rounded-md px-2 py-1 text-[12px] font-medium text-muted-foreground hover:bg-accent/50 hover:text-foreground", children: [mode === "build" ? "Act" : "Plan", _jsx(IconChevronDown, { className: "h-3 w-3 opacity-60" })] }) }), _jsxs(PopoverContent, { side: "top", align: "end", sideOffset: 6, collisionPadding: 8, "data-agent-native-composer-popover": "true", className: "z-[260] w-60 rounded-lg border-border p-0 py-1 shadow-lg", style: { fontSize: 13 }, children: [_jsxs("button", { type: "button", onClick: () => {
|
|
198
|
+
onChange("build");
|
|
199
|
+
setOpen(false);
|
|
200
|
+
}, className: "flex w-full items-center gap-3 px-3 py-2 hover:bg-accent/50 text-left", children: [_jsx(IconPencil, { className: "h-4 w-4 shrink-0 text-muted-foreground" }), _jsxs("div", { className: "flex-1 min-w-0", children: [_jsx("span", { className: "font-medium text-foreground text-[13px]", children: "Act" }), _jsx("p", { className: "text-[11px] text-muted-foreground mt-0.5", children: "Use tools and make approved changes" })] }), mode === "build" && (_jsx(IconCheck, { className: "h-3.5 w-3.5 shrink-0 text-blue-500" }))] }), _jsxs("button", { type: "button", disabled: planModeDisabled, title: planModeDisabled ? planModeDisabledReason : undefined, onClick: () => {
|
|
201
|
+
if (planModeDisabled)
|
|
202
|
+
return;
|
|
203
|
+
onChange("plan");
|
|
204
|
+
setOpen(false);
|
|
205
|
+
}, className: `flex w-full items-center gap-3 px-3 py-2 text-left ${planModeDisabled
|
|
206
|
+
? "cursor-not-allowed opacity-60"
|
|
207
|
+
: "hover:bg-accent/50"}`, children: [_jsx(IconClipboardList, { className: "h-4 w-4 shrink-0 text-muted-foreground" }), _jsxs("div", { className: "flex-1 min-w-0", children: [_jsx("span", { className: "font-medium text-foreground text-[13px]", children: "Plan" }), _jsx("p", { className: "text-[11px] text-muted-foreground mt-0.5", children: planModeDisabled
|
|
208
|
+
? planModeDisabledReason
|
|
209
|
+
: "Read-only research and approval first" })] }), mode === "plan" && !planModeDisabled && (_jsx(IconCheck, { className: "h-3.5 w-3.5 shrink-0 text-blue-500" }))] })] })] }));
|
|
210
210
|
}
|
|
211
211
|
const FRIENDLY_MODEL_NAMES = {
|
|
212
212
|
auto: "Default model",
|
|
@@ -356,40 +356,49 @@ function ModelSelector({ model, effort = "auto", engines, onChange, onEffortChan
|
|
|
356
356
|
window.dispatchEvent(new CustomEvent("agent-panel:open-settings"));
|
|
357
357
|
setOpen(false);
|
|
358
358
|
}, []);
|
|
359
|
-
return (_jsxs(
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
359
|
+
return (_jsxs(Popover, { open: open, onOpenChange: setOpen, children: [_jsx(PopoverTrigger, { asChild: true, children: _jsxs("button", { type: "button", "data-agent-composer-slot": "model-button", className: "agent-composer-model-button flex min-w-0 max-w-[10.5rem] shrink items-center gap-1 rounded-md px-2 py-1 text-[12px] font-medium text-muted-foreground hover:bg-accent/50 hover:text-foreground", children: [_jsx("span", { className: "min-w-0 truncate", children: friendlyModelName(model) }), effortOptions.length > 0 && (_jsxs("span", { className: "agent-composer-model-effort min-w-0 shrink truncate text-muted-foreground/70", children: ["\u00B7 ", reasoningEffortLabel(effort)] })), _jsx(IconChevronDown, { className: "h-3 w-3 shrink-0 opacity-60" })] }) }), _jsxs(PopoverContent, { side: "top", align: "end", sideOffset: 6, collisionPadding: 8, "data-agent-native-composer-popover": "true", className: "z-[260] box-border w-72 overflow-y-auto rounded-lg border-border p-0 py-1 shadow-lg", style: providerGroups.length > 0
|
|
360
|
+
? {
|
|
361
|
+
fontSize: 13,
|
|
362
|
+
height: "min(500px, var(--radix-popover-content-available-height, 500px))",
|
|
363
|
+
}
|
|
364
|
+
: {
|
|
365
|
+
fontSize: 13,
|
|
366
|
+
maxHeight: "min(500px, var(--radix-popover-content-available-height, 500px))",
|
|
367
|
+
}, children: [showBuilderCta && (_jsxs(_Fragment, { children: [_jsxs("button", { type: "button", onClick: () => {
|
|
368
|
+
if (onConnectProvider) {
|
|
369
|
+
onConnectProvider();
|
|
370
|
+
}
|
|
371
|
+
else {
|
|
372
|
+
builderFlow.start();
|
|
373
|
+
}
|
|
374
|
+
}, disabled: !onConnectProvider && builderFlow.connecting, className: "flex w-full items-start gap-2 px-3 py-2 text-left hover:bg-accent/50 disabled:opacity-60", children: [_jsx(IconPlugConnected, { className: "h-4 w-4 shrink-0 mt-0.5 text-blue-500" }), _jsxs("span", { className: "flex-1 min-w-0", children: [_jsx("span", { className: "block text-[12px] font-medium text-foreground", children: !onConnectProvider && builderFlow.connecting
|
|
375
|
+
? "Connecting Builder.io…"
|
|
376
|
+
: "Connect Builder.io" }), _jsx("span", { className: "block text-[11px] text-muted-foreground", children: "Free credits for Claude, OpenAI & Gemini" })] })] }), _jsx("div", { className: "my-1 border-t border-border" })] })), autoModelGroup && (_jsxs("button", { type: "button", onClick: () => {
|
|
377
|
+
onChange("auto", autoModelGroup.engine);
|
|
378
|
+
setOpen(false);
|
|
379
|
+
}, className: "flex w-full items-center gap-3 px-3 py-1.5 text-left hover:bg-accent/50", children: [_jsx("span", { className: "flex-1 min-w-0 text-[13px] text-foreground truncate", children: "Auto" }), model === "auto" && (_jsx(IconCheck, { className: "h-3.5 w-3.5 shrink-0 text-blue-500" }))] })), autoModelGroup && providerGroups.length > 0 && (_jsx("div", { className: "my-1 border-t border-border" })), providerGroups.map((group) => {
|
|
380
|
+
const models = latestModelsOnly(group.models);
|
|
381
|
+
const groupKey = `${group.engine}:${group.label}`;
|
|
382
|
+
const isExpanded = expandedGroups.has(groupKey);
|
|
383
|
+
const ChevronIcon = isExpanded ? IconChevronDown : IconChevronRight;
|
|
384
|
+
return (_jsxs("div", { children: [_jsxs("div", { className: "flex items-center hover:bg-accent/30", children: [_jsxs("button", { type: "button", "aria-expanded": isExpanded, onClick: () => toggleGroup(groupKey), className: "flex flex-1 min-w-0 items-center gap-1.5 px-2 py-1.5 cursor-pointer text-left", children: [_jsx(ChevronIcon, { className: "h-3 w-3 shrink-0 text-muted-foreground" }), _jsx("span", { className: "text-[11px] font-medium text-muted-foreground uppercase tracking-wide shrink-0", children: group.label }), !isExpanded && groupKey === selectedGroupKey && (_jsx("span", { className: "text-[11px] text-muted-foreground/80 truncate", children: friendlyModelName(model) }))] }), !group.configured && (_jsx("button", { type: "button", className: "text-[10px] text-muted-foreground/60 hover:text-foreground cursor-pointer pr-3 py-1.5", onClick: openLlmSettings, children: "needs API key" }))] }), isExpanded &&
|
|
385
|
+
models.map((m) => (_jsxs("button", { type: "button", onClick: () => {
|
|
386
|
+
if (!group.configured) {
|
|
387
|
+
openLlmSettings();
|
|
388
|
+
return;
|
|
389
|
+
}
|
|
390
|
+
onChange(m, group.engine);
|
|
391
|
+
const nextOptions = getReasoningEffortOptionsForModel(m);
|
|
392
|
+
if (effort !== "auto" &&
|
|
393
|
+
nextOptions.length > 0 &&
|
|
394
|
+
!nextOptions.includes(effort)) {
|
|
395
|
+
onEffortChange?.("auto");
|
|
396
|
+
}
|
|
397
|
+
setOpen(false);
|
|
398
|
+
}, className: `flex w-full items-center gap-3 pl-7 pr-3 py-1.5 text-left ${group.configured
|
|
399
|
+
? "hover:bg-accent/50"
|
|
400
|
+
: "opacity-40 cursor-default"}`, children: [_jsx("span", { className: "flex-1 min-w-0 text-[13px] text-foreground truncate", children: friendlyModelName(m) }), m === model && group.configured && (_jsx(IconCheck, { className: "h-3.5 w-3.5 shrink-0 text-blue-500" }))] }, m)))] }, groupKey));
|
|
401
|
+
}), effortOptions.length > 0 && (_jsxs(_Fragment, { children: [_jsx("div", { className: "my-1 border-t border-border" }), _jsx("div", { className: "px-3 py-1.5 text-[11px] font-medium text-muted-foreground uppercase tracking-wide", children: "Reasoning" }), effortOptions.map((option) => (_jsxs("button", { type: "button", onClick: () => onEffortChange?.(option), className: "flex w-full items-center gap-3 px-3 py-1.5 text-left hover:bg-accent/50", children: [_jsx("span", { className: "flex-1 min-w-0 text-[13px] text-foreground truncate", children: reasoningEffortLabel(option) }), option === effort && (_jsx(IconCheck, { className: "h-3.5 w-3.5 shrink-0 text-blue-500" }))] }, option)))] }))] })] }));
|
|
393
402
|
}
|
|
394
403
|
export function TiptapComposer({ placeholder = "Message agent...", disabled = false, focusRef, initialText, initialTextKey, onSubmit, clearOnSubmit = true, onTextChange, actionButton, extraActionButton, attachButton, modeControl, toolbarSlot, layoutVariant = "default", slashCommands = [], slashSkills = [], includeDefaultSlashCommands = true, includeDefaultSlashSkills = true, onSlashCommand, execMode, onExecModeChange, planModeDisabled = false, planModeDisabledReason, voiceEnabled = true, selectedModel, selectedEffort, availableModels, onModelChange, onEffortChange, providerConnectStatusEnabled, onConnectProvider, draftScope, plusMenuMode = "full", interceptBuildRequestsForBuilder = false, }) {
|
|
395
404
|
const [popover, setPopover] = useState(null);
|