@agent-native/core 0.12.29 → 0.12.31
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/index.d.ts +1 -1
- package/dist/agent/index.d.ts.map +1 -1
- package/dist/agent/index.js.map +1 -1
- package/dist/agent/production-agent.d.ts +25 -1
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +47 -7
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/agent/run-manager.d.ts.map +1 -1
- package/dist/agent/run-manager.js +21 -5
- package/dist/agent/run-manager.js.map +1 -1
- package/dist/client/AgentPanel.d.ts.map +1 -1
- package/dist/client/AgentPanel.js +10 -3
- package/dist/client/AgentPanel.js.map +1 -1
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +77 -20
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/MultiTabAssistantChat.d.ts.map +1 -1
- package/dist/client/MultiTabAssistantChat.js +9 -8
- package/dist/client/MultiTabAssistantChat.js.map +1 -1
- package/dist/client/agent-chat-adapter.d.ts.map +1 -1
- package/dist/client/agent-chat-adapter.js +23 -4
- package/dist/client/agent-chat-adapter.js.map +1 -1
- package/dist/client/composer/TiptapComposer.js +1 -1
- package/dist/client/composer/TiptapComposer.js.map +1 -1
- package/dist/client/dev-overlay/DevOverlay.d.ts.map +1 -1
- package/dist/client/dev-overlay/DevOverlay.js +5 -1
- package/dist/client/dev-overlay/DevOverlay.js.map +1 -1
- package/dist/client/guided-questions.d.ts +77 -0
- package/dist/client/guided-questions.d.ts.map +1 -0
- package/dist/client/guided-questions.js +295 -0
- package/dist/client/guided-questions.js.map +1 -0
- 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/org/OrgSwitcher.d.ts.map +1 -1
- package/dist/client/org/OrgSwitcher.js +8 -1
- package/dist/client/org/OrgSwitcher.js.map +1 -1
- package/dist/client/settings/SettingsPanel.d.ts +3 -1
- package/dist/client/settings/SettingsPanel.d.ts.map +1 -1
- package/dist/client/settings/SettingsPanel.js +78 -12
- package/dist/client/settings/SettingsPanel.js.map +1 -1
- package/dist/client/settings/SettingsSection.d.ts +2 -1
- package/dist/client/settings/SettingsSection.d.ts.map +1 -1
- package/dist/client/settings/SettingsSection.js +2 -2
- package/dist/client/settings/SettingsSection.js.map +1 -1
- package/dist/client/sharing/ShareButton.d.ts +4 -0
- package/dist/client/sharing/ShareButton.d.ts.map +1 -1
- package/dist/client/sharing/ShareButton.js +76 -32
- package/dist/client/sharing/ShareButton.js.map +1 -1
- package/dist/client/sharing/ShareButton.spec.js +54 -7
- package/dist/client/sharing/ShareButton.spec.js.map +1 -1
- package/dist/client/use-db-sync.d.ts +12 -2
- package/dist/client/use-db-sync.d.ts.map +1 -1
- package/dist/client/use-db-sync.js +195 -53
- package/dist/client/use-db-sync.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/server/agent-chat-plugin.d.ts +25 -1
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +3 -0
- package/dist/server/agent-chat-plugin.js.map +1 -1
- package/dist/server/core-routes-plugin.js +2 -2
- package/dist/server/core-routes-plugin.js.map +1 -1
- package/dist/server/index.d.ts +3 -2
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +2 -1
- package/dist/server/index.js.map +1 -1
- package/dist/server/poll-events.d.ts +12 -0
- package/dist/server/poll-events.d.ts.map +1 -0
- package/dist/server/poll-events.js +41 -0
- package/dist/server/poll-events.js.map +1 -0
- package/dist/server/poll.d.ts +4 -0
- package/dist/server/poll.d.ts.map +1 -1
- package/dist/server/poll.js +19 -12
- package/dist/server/poll.js.map +1 -1
- package/dist/templates/default/react-router.config.ts +1 -0
- package/package.json +1 -1
- package/src/templates/default/react-router.config.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SAAS;QAC7B,WAAW,EAAE,OAAO,EAAE,WAAW;QACjC,KAAK;QACL,YAAY;QACZ,UAAU;KACX,CAAC;AACJ,CAAC","sourcesContent":["import { useCallback, useEffect, useMemo, useState } from \"react\";\nimport { useQuery, useQueryClient } from \"@tanstack/react-query\";\nimport {\n IconCheck,\n IconChevronRight,\n IconHelpCircle,\n IconUpload,\n IconX,\n} from \"@tabler/icons-react\";\nimport { agentNativePath } from \"./api-path.js\";\nimport { sendToAgentChat } from \"./agent-chat.js\";\nimport { cn } from \"./utils.js\";\n\nexport type GuidedQuestionType =\n | \"text-options\"\n | \"color-options\"\n | \"slider\"\n | \"file\"\n | \"freeform\";\n\nexport interface GuidedQuestionOption {\n label: string;\n value: string;\n color?: string;\n icon?: string;\n description?: string;\n recommended?: boolean;\n}\n\nexport interface GuidedQuestion {\n id: string;\n type: GuidedQuestionType;\n header?: string;\n question: string;\n description?: string;\n options?: GuidedQuestionOption[];\n choices?: GuidedQuestionOption[];\n multiSelect?: boolean;\n min?: number;\n max?: number;\n step?: number;\n required?: boolean;\n placeholder?: string;\n allowOther?: boolean;\n includeExplore?: boolean;\n includeDecide?: boolean;\n}\n\nexport type GuidedQuestionAnswers = Record<string, unknown>;\n\nexport interface GuidedQuestionPayload {\n questions: GuidedQuestion[];\n title?: string;\n description?: string;\n skipLabel?: string;\n submitLabel?: string;\n}\n\nconst OTHER_OPTION_PREFIX = \"__other__:\";\nconst EXPLORE_OPTION: GuidedQuestionOption = {\n label: \"Explore a few options\",\n value: \"__explore__\",\n description: \"Show me a few distinct directions before committing.\",\n};\nconst DECIDE_OPTION: GuidedQuestionOption = {\n label: \"Decide for me\",\n value: \"__decide__\",\n description: \"Use your judgment and keep moving.\",\n};\n\nfunction isFileLike(value: unknown): value is { name: string } {\n return (\n typeof value === \"object\" &&\n value !== null &&\n \"name\" in value &&\n typeof (value as { name?: unknown }).name === \"string\"\n );\n}\n\nexport function isOtherGuidedAnswer(value: unknown): value is string {\n return typeof value === \"string\" && value.startsWith(OTHER_OPTION_PREFIX);\n}\n\nexport function getOtherGuidedAnswerText(value: unknown): string {\n return isOtherGuidedAnswer(value)\n ? value.slice(OTHER_OPTION_PREFIX.length)\n : \"\";\n}\n\nexport function makeOtherGuidedAnswer(text = \"\"): string {\n return `${OTHER_OPTION_PREFIX}${text}`;\n}\n\nexport function hasGuidedAnswer(value: unknown): boolean {\n if (value == null || value === \"\") return false;\n if (Array.isArray(value)) return value.some(hasGuidedAnswer);\n if (isOtherGuidedAnswer(value)) {\n return getOtherGuidedAnswerText(value).trim().length > 0;\n }\n return true;\n}\n\nexport function formatGuidedAnswerValue(value: unknown): unknown {\n if (Array.isArray(value)) {\n return value.map(formatGuidedAnswerValue).filter(hasGuidedAnswer);\n }\n if (isOtherGuidedAnswer(value)) {\n const text = getOtherGuidedAnswerText(value).trim();\n return text ? `Other: ${text}` : \"\";\n }\n if (isFileLike(value)) return value.name;\n return value;\n}\n\nexport function normalizeGuidedAnswers(\n answers: GuidedQuestionAnswers,\n): GuidedQuestionAnswers {\n return Object.fromEntries(\n Object.entries(answers).map(([id, value]) => [\n id,\n formatGuidedAnswerValue(value),\n ]),\n );\n}\n\nexport function formatGuidedAnswersForAgent(\n answers: GuidedQuestionAnswers,\n): string {\n return Object.entries(normalizeGuidedAnswers(answers))\n .filter(([, value]) => hasGuidedAnswer(value))\n .map(([id, value]) => {\n if (Array.isArray(value)) return `${id}: ${value.join(\", \")}`;\n return `${id}: ${String(value)}`;\n })\n .join(\"\\n\");\n}\n\nfunction optionKey(option: GuidedQuestionOption): string {\n return `${option.value.toLowerCase()}::${option.label.toLowerCase()}`;\n}\n\nfunction withDefaultOptions(question: GuidedQuestion): GuidedQuestionOption[] {\n const base = question.options ?? question.choices ?? [];\n const seen = new Set(base.map(optionKey));\n const result = [...base];\n const maybePush = (option: GuidedQuestionOption, enabled: boolean) => {\n if (!enabled) return;\n const key = optionKey(option);\n const label = option.label.toLowerCase();\n const value = option.value.toLowerCase();\n const duplicate = result.some(\n (existing) =>\n optionKey(existing) === key ||\n existing.label.toLowerCase() === label ||\n existing.value.toLowerCase() === value,\n );\n if (duplicate || seen.has(key)) return;\n seen.add(key);\n result.push(option);\n };\n maybePush(EXPLORE_OPTION, question.includeExplore !== false);\n maybePush(DECIDE_OPTION, question.includeDecide !== false);\n return result;\n}\n\nexport interface GuidedQuestionFlowProps {\n questions: GuidedQuestion[];\n onSubmit: (answers: GuidedQuestionAnswers) => void;\n onSkip: () => void;\n title?: string;\n description?: string;\n skipLabel?: string;\n submitLabel?: string;\n className?: string;\n}\n\nexport function GuidedQuestionFlow({\n questions,\n onSubmit,\n onSkip,\n title = \"A few choices before I generate\",\n description = \"Pick what you know. Use Other for anything that does not fit, or let the agent decide.\",\n skipLabel = \"Skip\",\n submitLabel = \"Continue\",\n className,\n}: GuidedQuestionFlowProps) {\n const [answers, setAnswers] = useState<GuidedQuestionAnswers>({});\n\n useEffect(() => {\n setAnswers({});\n }, [questions]);\n\n const setAnswer = useCallback((id: string, value: unknown) => {\n setAnswers((prev) => ({ ...prev, [id]: value }));\n }, []);\n\n const allRequiredAnswered = questions\n .filter((question) => question.required)\n .every((question) => hasGuidedAnswer(answers[question.id]));\n\n return (\n <div\n className={cn(\n \"flex h-full w-full items-center justify-center bg-background text-foreground\",\n className,\n )}\n >\n <div className=\"flex max-h-full w-full max-w-3xl flex-col px-4 py-6 sm:px-8 sm:py-10\">\n <div className=\"mb-6 flex items-start gap-3\">\n <div className=\"mt-0.5 flex h-9 w-9 shrink-0 items-center justify-center rounded-md border border-border bg-muted/40 text-primary\">\n <IconHelpCircle className=\"h-5 w-5\" />\n </div>\n <div className=\"min-w-0\">\n <h2 className=\"text-xl font-semibold tracking-normal text-foreground sm:text-2xl\">\n {title}\n </h2>\n {description && (\n <p className=\"mt-1 max-w-2xl text-sm leading-5 text-muted-foreground\">\n {description}\n </p>\n )}\n </div>\n </div>\n\n <div className=\"min-h-0 flex-1 space-y-4 overflow-y-auto pr-1\">\n {questions.map((question, index) => (\n <QuestionCard\n key={question.id}\n index={index}\n question={question}\n value={answers[question.id]}\n onChange={(value) => setAnswer(question.id, value)}\n />\n ))}\n </div>\n\n <div className=\"mt-5 flex shrink-0 items-center justify-between gap-4 border-t border-border pt-4\">\n <div className=\"flex items-center gap-1.5\">\n {questions.map((question, index) => (\n <span\n key={question.id || index}\n className={cn(\n \"h-1.5 w-1.5 rounded-full\",\n hasGuidedAnswer(answers[question.id])\n ? \"bg-primary\"\n : \"bg-muted-foreground/30\",\n )}\n />\n ))}\n </div>\n <div className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={onSkip}\n className=\"cursor-pointer rounded-md px-3 py-2 text-sm text-muted-foreground transition-colors hover:bg-muted/60 hover:text-foreground\"\n >\n {skipLabel}\n </button>\n <button\n type=\"button\"\n onClick={() => onSubmit(normalizeGuidedAnswers(answers))}\n disabled={!allRequiredAnswered}\n className=\"inline-flex cursor-pointer items-center gap-2 rounded-md bg-primary px-3.5 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:cursor-not-allowed disabled:opacity-45\"\n >\n {submitLabel}\n <IconChevronRight className=\"h-4 w-4\" />\n </button>\n </div>\n </div>\n </div>\n </div>\n );\n}\n\nfunction QuestionCard({\n index,\n question,\n value,\n onChange,\n}: {\n index: number;\n question: GuidedQuestion;\n value: unknown;\n onChange: (value: unknown) => void;\n}) {\n return (\n <section className=\"rounded-lg border border-border bg-card/65 p-4 shadow-sm\">\n <div className=\"mb-3 flex gap-3\">\n <div className=\"flex h-6 min-w-6 items-center justify-center rounded-md bg-muted text-xs font-medium text-muted-foreground\">\n {index + 1}\n </div>\n <div className=\"min-w-0\">\n {question.header && (\n <p className=\"mb-1 text-[11px] font-medium uppercase text-muted-foreground\">\n {question.header}\n </p>\n )}\n <h3 className=\"text-sm font-medium leading-5 text-foreground\">\n {question.question}\n {question.required && (\n <span className=\"ml-1 text-destructive\">*</span>\n )}\n </h3>\n {question.description && (\n <p className=\"mt-1 text-xs leading-5 text-muted-foreground\">\n {question.description}\n </p>\n )}\n </div>\n </div>\n\n {question.type === \"text-options\" && (\n <TextOptions question={question} value={value} onChange={onChange} />\n )}\n {question.type === \"color-options\" && (\n <ColorOptions question={question} value={value} onChange={onChange} />\n )}\n {question.type === \"slider\" && (\n <SliderQuestion question={question} value={value} onChange={onChange} />\n )}\n {question.type === \"file\" && (\n <FileDropZone value={value} onChange={onChange} />\n )}\n {question.type === \"freeform\" && (\n <textarea\n value={typeof value === \"string\" ? value : \"\"}\n onChange={(event) => onChange(event.target.value)}\n placeholder={question.placeholder ?? \"Type your answer...\"}\n className=\"min-h-[84px] w-full resize-none rounded-md border border-border bg-muted/45 px-3 py-2 text-sm text-foreground outline-none placeholder:text-muted-foreground/70 focus:border-primary\"\n />\n )}\n </section>\n );\n}\n\nfunction TextOptions({\n question,\n value,\n onChange,\n}: {\n question: GuidedQuestion;\n value: unknown;\n onChange: (value: unknown) => void;\n}) {\n const options = useMemo(() => withDefaultOptions(question), [question]);\n const multiSelect = question.multiSelect === true;\n const selectedValues = Array.isArray(value) ? value : [];\n const otherSelected = multiSelect\n ? selectedValues.some(isOtherGuidedAnswer)\n : isOtherGuidedAnswer(value);\n const otherText = multiSelect\n ? getOtherGuidedAnswerText(selectedValues.find(isOtherGuidedAnswer))\n : getOtherGuidedAnswerText(value);\n\n const isSelected = (optionValue: string) =>\n multiSelect ? selectedValues.includes(optionValue) : value === optionValue;\n\n const toggleOption = (optionValue: string) => {\n if (!multiSelect) {\n onChange(optionValue);\n return;\n }\n const next = selectedValues.includes(optionValue)\n ? selectedValues.filter((item) => item !== optionValue)\n : [...selectedValues, optionValue];\n onChange(next);\n };\n\n const toggleOther = () => {\n if (!multiSelect) {\n onChange(otherSelected ? \"\" : makeOtherGuidedAnswer());\n return;\n }\n if (otherSelected) {\n onChange(selectedValues.filter((item) => !isOtherGuidedAnswer(item)));\n return;\n }\n onChange([...selectedValues, makeOtherGuidedAnswer()]);\n };\n\n const setOtherText = (text: string) => {\n const nextOther = makeOtherGuidedAnswer(text);\n if (!multiSelect) {\n onChange(nextOther);\n return;\n }\n onChange([\n ...selectedValues.filter((item) => !isOtherGuidedAnswer(item)),\n nextOther,\n ]);\n };\n\n const allowOther = question.allowOther !== false;\n\n return (\n <div className=\"space-y-3\">\n <div className=\"grid gap-2 sm:grid-cols-2\">\n {options.map((option) => (\n <OptionButton\n key={`${option.value}:${option.label}`}\n option={option}\n selected={isSelected(option.value)}\n multiSelect={multiSelect}\n onClick={() => toggleOption(option.value)}\n />\n ))}\n {allowOther && (\n <OptionButton\n option={{\n label: \"Other...\",\n value: \"__other__\",\n description: \"Tell the agent exactly what you mean.\",\n }}\n selected={otherSelected}\n multiSelect={multiSelect}\n onClick={toggleOther}\n />\n )}\n </div>\n {allowOther && otherSelected && (\n <textarea\n autoFocus\n value={otherText}\n onChange={(event) => setOtherText(event.target.value)}\n placeholder={question.placeholder ?? \"Type a custom answer...\"}\n className=\"min-h-[72px] w-full resize-none rounded-md border border-border bg-muted/45 px-3 py-2 text-sm text-foreground outline-none placeholder:text-muted-foreground/70 focus:border-primary\"\n />\n )}\n </div>\n );\n}\n\nfunction OptionButton({\n option,\n selected,\n multiSelect,\n onClick,\n}: {\n option: GuidedQuestionOption;\n selected: boolean;\n multiSelect?: boolean;\n onClick: () => void;\n}) {\n return (\n <button\n type=\"button\"\n onClick={onClick}\n className={cn(\n \"group flex min-h-[56px] cursor-pointer items-start gap-2 rounded-md border px-3 py-2 text-left transition-colors\",\n selected\n ? \"border-primary bg-primary/10 text-primary\"\n : \"border-border bg-muted/30 text-muted-foreground hover:border-muted-foreground/50 hover:bg-muted/45 hover:text-foreground\",\n )}\n >\n {multiSelect && (\n <span\n className={cn(\n \"mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded border\",\n selected ? \"border-primary bg-primary text-primary-foreground\" : \"\",\n )}\n >\n {selected && <IconCheck className=\"h-3 w-3\" />}\n </span>\n )}\n <span className=\"min-w-0 flex-1\">\n <span className=\"flex flex-wrap items-center gap-1.5 text-sm font-medium leading-5\">\n {option.label}\n {option.recommended && (\n <span className=\"rounded-sm bg-primary/15 px-1.5 py-0.5 text-[10px] font-medium uppercase text-primary\">\n Recommended\n </span>\n )}\n </span>\n {option.description && (\n <span className=\"mt-0.5 block text-xs leading-4 text-muted-foreground\">\n {option.description}\n </span>\n )}\n </span>\n </button>\n );\n}\n\nfunction ColorOptions({\n question,\n value,\n onChange,\n}: {\n question: GuidedQuestion;\n value: unknown;\n onChange: (value: unknown) => void;\n}) {\n const options = question.options ?? question.choices ?? [];\n const multiSelect = question.multiSelect === true;\n const selectedValues = Array.isArray(value) ? value : [];\n const isSelected = (optionValue: string) =>\n multiSelect ? selectedValues.includes(optionValue) : value === optionValue;\n\n const toggleOption = (optionValue: string) => {\n if (!multiSelect) {\n onChange(optionValue);\n return;\n }\n onChange(\n selectedValues.includes(optionValue)\n ? selectedValues.filter((item) => item !== optionValue)\n : [...selectedValues, optionValue],\n );\n };\n\n return (\n <div className=\"flex flex-wrap gap-3\">\n {options.map((option) => {\n const selected = isSelected(option.value);\n return (\n <button\n type=\"button\"\n key={`${option.value}:${option.label}`}\n onClick={() => toggleOption(option.value)}\n className=\"group flex cursor-pointer flex-col items-center gap-1.5\"\n >\n <span\n className={cn(\n \"h-10 w-10 rounded-full\",\n selected\n ? \"ring-2 ring-primary ring-offset-2 ring-offset-background\"\n : \"ring-1 ring-border group-hover:ring-muted-foreground/50\",\n )}\n style={{ backgroundColor: option.color || option.value }}\n />\n <span\n className={cn(\n \"max-w-20 truncate text-[10px]\",\n selected ? \"text-foreground\" : \"text-muted-foreground\",\n )}\n >\n {option.label}\n </span>\n </button>\n );\n })}\n </div>\n );\n}\n\nfunction SliderQuestion({\n question,\n value,\n onChange,\n}: {\n question: GuidedQuestion;\n value: unknown;\n onChange: (value: unknown) => void;\n}) {\n const min = question.min ?? 0;\n const max = question.max ?? 100;\n const step = question.step ?? 1;\n const current =\n typeof value === \"number\" ? value : Math.round((min + max) / 2);\n\n return (\n <div className=\"flex items-center gap-4\">\n <span className=\"w-8 text-xs text-muted-foreground\">{min}</span>\n <input\n type=\"range\"\n min={min}\n max={max}\n step={step}\n value={current}\n onChange={(event) => onChange(Number(event.target.value))}\n className=\"h-2 flex-1 cursor-pointer accent-primary\"\n />\n <span className=\"w-8 text-right text-xs text-muted-foreground\">\n {max}\n </span>\n <span className=\"min-w-10 text-right text-sm font-medium tabular-nums text-foreground\">\n {current}\n </span>\n </div>\n );\n}\n\nfunction FileDropZone({\n value,\n onChange,\n}: {\n value: unknown;\n onChange: (value: unknown) => void;\n}) {\n const [dragOver, setDragOver] = useState(false);\n const files: File[] = Array.isArray(value) ? (value as File[]) : [];\n\n const addFiles = (incoming: File[]) => onChange([...files, ...incoming]);\n const removeFile = (index: number) =>\n onChange(files.filter((_, fileIndex) => fileIndex !== index));\n\n return (\n <div>\n <div\n onDragOver={(event) => {\n event.preventDefault();\n setDragOver(true);\n }}\n onDragLeave={() => setDragOver(false)}\n onDrop={(event) => {\n event.preventDefault();\n setDragOver(false);\n addFiles(Array.from(event.dataTransfer.files));\n }}\n className={cn(\n \"flex cursor-pointer flex-col items-center justify-center rounded-md border-2 border-dashed p-5 transition-colors\",\n dragOver\n ? \"border-primary bg-primary/5\"\n : \"border-border bg-muted/30 hover:border-muted-foreground/50\",\n )}\n >\n <IconUpload className=\"mb-2 h-5 w-5 text-muted-foreground\" />\n <p className=\"text-sm text-muted-foreground\">\n Drag files here or{\" \"}\n <label className=\"cursor-pointer text-primary hover:underline\">\n browse\n <input\n type=\"file\"\n multiple\n onChange={(event) => {\n if (event.target.files)\n addFiles(Array.from(event.target.files));\n event.currentTarget.value = \"\";\n }}\n className=\"hidden\"\n />\n </label>\n </p>\n </div>\n\n {files.length > 0 && (\n <div className=\"mt-2 space-y-1\">\n {files.map((file, index) => (\n <div\n key={`${file.name}:${index}`}\n className=\"flex items-center gap-2 rounded-md bg-muted/50 px-2 py-1 text-xs text-muted-foreground\"\n >\n <IconCheck className=\"h-3 w-3 text-primary\" />\n <span className=\"min-w-0 flex-1 truncate\">{file.name}</span>\n <button\n type=\"button\"\n onClick={() => removeFile(index)}\n className=\"cursor-pointer text-muted-foreground/70 hover:text-foreground\"\n aria-label={`Remove ${file.name}`}\n >\n <IconX className=\"h-3 w-3\" />\n </button>\n </div>\n ))}\n </div>\n )}\n </div>\n );\n}\n\nexport interface UseGuidedQuestionFlowOptions {\n stateKey?: string;\n queryKey?: readonly unknown[];\n refetchInterval?: number | false;\n submitMessage?: string;\n skipMessage?: string;\n buildSubmitContext?: (args: {\n answers: GuidedQuestionAnswers;\n formattedAnswers: string;\n }) => string;\n buildSkipContext?: () => string;\n}\n\nexport function useGuidedQuestionFlow({\n stateKey = \"show-questions\",\n queryKey = [\"show-questions\"],\n refetchInterval = 2_000,\n submitMessage = \"Here are my answers — go ahead.\",\n skipMessage = \"Skip the questions — decide for me.\",\n buildSubmitContext,\n buildSkipContext,\n}: UseGuidedQuestionFlowOptions = {}) {\n const queryClient = useQueryClient();\n const [payload, setPayload] = useState<GuidedQuestionPayload | null>(null);\n const endpoint = agentNativePath(\n `/_agent-native/application-state/${stateKey}`,\n );\n\n const { data } = useQuery({\n queryKey,\n queryFn: async () => {\n const res = await fetch(endpoint);\n if (!res.ok) return null;\n const text = await res.text();\n if (!text) return null;\n try {\n const parsed = JSON.parse(text);\n if (Array.isArray(parsed?.questions) && parsed.questions.length > 0) {\n return { ...parsed, _ts: Date.now() } as GuidedQuestionPayload & {\n _ts: number;\n };\n }\n } catch {\n return null;\n }\n return null;\n },\n refetchInterval,\n structuralSharing: false,\n });\n\n useEffect(() => {\n if (Array.isArray(data?.questions) && data.questions.length > 0) {\n setPayload(data);\n } else {\n setPayload(null);\n }\n }, [data]);\n\n const clear = useCallback(() => {\n setPayload(null);\n queryClient.setQueryData(queryKey, null);\n fetch(endpoint, {\n method: \"DELETE\",\n headers: { \"X-Agent-Native-CSRF\": \"1\" },\n }).catch(() => {});\n }, [endpoint, queryClient, queryKey]);\n\n const handleSubmit = useCallback(\n (answers: GuidedQuestionAnswers) => {\n const formattedAnswers = formatGuidedAnswersForAgent(answers);\n const context =\n buildSubmitContext?.({ answers, formattedAnswers }) ??\n [\n \"The user answered the pre-generation questions.\",\n \"\",\n \"Answers:\",\n formattedAnswers,\n ].join(\"\\n\");\n sendToAgentChat({ message: submitMessage, context, submit: true });\n clear();\n },\n [buildSubmitContext, clear, submitMessage],\n );\n\n const handleSkip = useCallback(() => {\n sendToAgentChat({\n message: skipMessage,\n context: buildSkipContext?.(),\n submit: true,\n });\n clear();\n }, [buildSkipContext, clear, skipMessage]);\n\n return {\n payload,\n questions: payload?.questions ?? null,\n title: payload?.title,\n description: payload?.description,\n skipLabel: payload?.skipLabel,\n submitLabel: payload?.submitLabel,\n clear,\n handleSubmit,\n handleSkip,\n };\n}\n"]}
|
package/dist/client/index.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export { AssistantChat, clearChatStorage, type AssistantChatProps, type Assistan
|
|
|
17
17
|
export { MultiTabAssistantChat, type MultiTabAssistantChatProps, type MultiTabAssistantChatHeaderProps, } from "./MultiTabAssistantChat.js";
|
|
18
18
|
export { createAgentChatAdapter } from "./agent-chat-adapter.js";
|
|
19
19
|
export { PromptComposer, type PromptComposerProps, type PromptComposerFile, type PromptComposerSubmitOptions, } from "./composer/PromptComposer.js";
|
|
20
|
+
export { GuidedQuestionFlow, useGuidedQuestionFlow, formatGuidedAnswerValue, formatGuidedAnswersForAgent, getOtherGuidedAnswerText, hasGuidedAnswer, isOtherGuidedAnswer, makeOtherGuidedAnswer, normalizeGuidedAnswers, type GuidedQuestion, type GuidedQuestionAnswers, type GuidedQuestionFlowProps, type GuidedQuestionOption, type GuidedQuestionPayload, type GuidedQuestionType, type UseGuidedQuestionFlowOptions, } from "./guided-questions.js";
|
|
20
21
|
export { useChatThreads, type ChatThreadSummary, type ChatThreadData, } from "./use-chat-threads.js";
|
|
21
22
|
export { AgentPanel, AgentSidebar, AgentToggleButton, focusAgentChat, type AgentPanelProps, type AgentSidebarProps, } from "./AgentPanel.js";
|
|
22
23
|
export { AgentNativeIcon } from "./components/icons/AgentNativeIcon.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,eAAe,EACf,aAAa,EACb,KAAK,gBAAgB,GACtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EACL,eAAe,EACf,UAAU,EACV,WAAW,EACX,OAAO,GACR,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EACL,aAAa,EACb,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,GACtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,kBAAkB,EAClB,KAAK,uBAAuB,GAC7B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,kBAAkB,EAClB,KAAK,uBAAuB,GAC7B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,SAAS,EACT,cAAc,EACd,mBAAmB,GACpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAC;AAChC,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EACL,WAAW,EACX,cAAc,EACd,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,SAAS,EACT,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,KAAK,QAAQ,GACd,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,sBAAsB,EACtB,gBAAgB,EAChB,iBAAiB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AC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC"}
|
package/dist/client/index.js
CHANGED
|
@@ -19,6 +19,7 @@ export { AssistantChat, clearChatStorage, } from "./AssistantChat.js";
|
|
|
19
19
|
export { MultiTabAssistantChat, } from "./MultiTabAssistantChat.js";
|
|
20
20
|
export { createAgentChatAdapter } from "./agent-chat-adapter.js";
|
|
21
21
|
export { PromptComposer, } from "./composer/PromptComposer.js";
|
|
22
|
+
export { GuidedQuestionFlow, useGuidedQuestionFlow, formatGuidedAnswerValue, formatGuidedAnswersForAgent, getOtherGuidedAnswerText, hasGuidedAnswer, isOtherGuidedAnswer, makeOtherGuidedAnswer, normalizeGuidedAnswers, } from "./guided-questions.js";
|
|
22
23
|
export { useChatThreads, } from "./use-chat-threads.js";
|
|
23
24
|
export { AgentPanel, AgentSidebar, AgentToggleButton, focusAgentChat, } from "./AgentPanel.js";
|
|
24
25
|
export { AgentNativeIcon } from "./components/icons/AgentNativeIcon.js";
|
package/dist/client/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAEtE,yBAAyB,EAAE,CAAC;AAE5B,OAAO,EACL,eAAe,EACf,aAAa,GAEd,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EACL,eAAe,EACf,UAAU,EACV,WAAW,EACX,OAAO,GACR,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EACL,aAAa,GAGd,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,kBAAkB,GAEnB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,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B,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,qBAAqB,GACtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,sBAAsB,EACtB,cAAc,GACf,MAAM,0BAA0B,CAAC;AAClC,yBAAyB;AACzB,OAAO,EACL,WAAW,GAEZ,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,iBAAiB,GAElB,MAAM,mCAAmC,CAAC;AAC3C,sCAAsC;AACtC,OAAO,EACL,mBAAmB,EACnB,qBAAqB,GAKtB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC","sourcesContent":["import { installRouteChunkRecovery } from \"./route-chunk-recovery.js\";\n\ninstallRouteChunkRecovery();\n\nexport {\n sendToAgentChat,\n generateTabId,\n type AgentChatMessage,\n} from \"./agent-chat.js\";\nexport { useAgentChatGenerating } from \"./use-agent-chat.js\";\nexport { useDevMode } from \"./use-dev-mode.js\";\nexport {\n agentNativePath,\n appApiPath,\n appBasePath,\n appPath,\n} from \"./api-path.js\";\nexport { useSendToAgentChat } from \"./use-send-to-agent-chat.js\";\nexport {\n useChatModels,\n type UseChatModelsResult,\n type EngineModelGroup,\n} from \"./use-chat-models.js\";\nexport {\n CodeRequiredDialog,\n type CodeRequiredDialogProps,\n} from \"./components/CodeRequiredDialog.js\";\nexport {\n CodeAgentIndicator,\n type CodeAgentIndicatorProps,\n} from \"./components/CodeAgentIndicator.js\";\nexport {\n useDbSync,\n useFileWatcher,\n useScreenRefreshKey,\n} from \"./use-db-sync.js\";\nexport { cn } from \"./utils.js\";\nexport { ApiKeySettings } from \"./components/ApiKeySettings.js\";\nexport { useSession, type AuthSession } from \"./use-session.js\";\nexport {\n sendToFrame,\n onFrameMessage,\n requestUserInfo,\n getFrameOrigin,\n getCallbackOrigin,\n oauthRedirectUri,\n isInFrame,\n enterStyleEditing,\n enterTextEditing,\n exitSelectionMode,\n type UserInfo,\n} from \"./frame.js\";\nexport {\n getBuilderParentOrigin,\n isInBuilderFrame,\n sendToBuilderChat,\n type BuilderChatMessage,\n} from \"./builder-frame.js\";\nexport {\n NewWorkspaceAppFlow,\n type NewWorkspaceAppFlowProps,\n type VaultSecretOption,\n} from \"./NewWorkspaceAppFlow.js\";\nexport {\n AssistantChat,\n clearChatStorage,\n type AssistantChatProps,\n type AssistantChatHandle,\n} from \"./AssistantChat.js\";\nexport {\n MultiTabAssistantChat,\n type MultiTabAssistantChatProps,\n type MultiTabAssistantChatHeaderProps,\n} from \"./MultiTabAssistantChat.js\";\nexport { createAgentChatAdapter } from \"./agent-chat-adapter.js\";\nexport {\n PromptComposer,\n type PromptComposerProps,\n type PromptComposerFile,\n type PromptComposerSubmitOptions,\n} from \"./composer/PromptComposer.js\";\nexport {\n useChatThreads,\n type ChatThreadSummary,\n type ChatThreadData,\n} from \"./use-chat-threads.js\";\nexport {\n AgentPanel,\n AgentSidebar,\n AgentToggleButton,\n focusAgentChat,\n type AgentPanelProps,\n type AgentSidebarProps,\n} from \"./AgentPanel.js\";\nexport { AgentNativeIcon } from \"./components/icons/AgentNativeIcon.js\";\nexport { SettingsPanel, type SettingsPanelProps } from \"./settings/index.js\";\n// Deprecated — use AgentSidebar + AgentToggleButton instead\nexport {\n ProductionAgentPanel,\n type ProductionAgentPanelProps,\n} from \"./ProductionAgentPanel.js\";\nexport {\n useProductionAgent,\n type ProductionAgentMessage,\n type UseProductionAgentOptions,\n type UseProductionAgentResult,\n} from \"./useProductionAgent.js\";\nexport { Turnstile, type TurnstileProps } from \"./Turnstile.js\";\nexport {\n OpenSourceBadge,\n PoweredByBadge,\n type OpenSourceBadgeProps,\n type PoweredByBadgeProps,\n} from \"./PoweredByBadge.js\";\nexport { FeedbackButton, type FeedbackButtonProps } from \"./FeedbackButton.js\";\nexport { ErrorBoundary } from \"./ErrorBoundary.js\";\nexport { installRouteChunkRecovery } from \"./route-chunk-recovery.js\";\nexport { ClientOnly } from \"./ClientOnly.js\";\nexport { DefaultSpinner } from \"./DefaultSpinner.js\";\nexport {\n getThemeInitScript,\n themeInitScript,\n type ThemePreference,\n} from \"./theme.js\";\nexport { AgentTerminal, type AgentTerminalProps } from \"./terminal/index.js\";\nexport {\n trackEvent,\n trackSessionStatus,\n configureTracking,\n setSentryUser,\n captureError,\n captureClientException,\n type ClientCaptureContext,\n} from \"./analytics.js\";\nexport {\n useCollaborativeDoc,\n emailToColor,\n emailToName,\n type UseCollaborativeDocOptions,\n type UseCollaborativeDocResult,\n type CollabUser,\n} from \"../collab/client.js\";\nexport {\n ResourcesPanel,\n ResourceTree,\n ResourceEditor,\n useResources,\n useResourceTree,\n useResource,\n useCreateResource,\n useUpdateResource,\n useDeleteResource,\n useUploadResource,\n type Resource,\n type ResourceMeta,\n type TreeNode,\n type ResourceScope,\n type ResourceTreeProps,\n type ResourceEditorProps,\n} from \"./resources/index.js\";\nexport type {\n AppToFrameMessage,\n FrameToAppMessage,\n FrameMessage,\n CodeCompleteMessage,\n ChatRunningMessage,\n} from \"./frame-protocol.js\";\nexport {\n CommandMenu,\n useCommandMenuShortcut,\n openAgentSidebar,\n submitToAgent,\n type CommandMenuProps,\n type CommandGroupProps,\n type CommandItemProps,\n type CommandShortcutProps,\n} from \"./CommandMenu.js\";\nexport {\n DevOverlay,\n useDevOverlayShortcut,\n registerDevPanel,\n unregisterDevPanel,\n listDevPanels,\n subscribeDevPanels,\n useDevOption,\n clearAllDevOverlayStorage,\n devOptionKey,\n DEV_OVERLAY_STORAGE_PREFIX,\n type DevOverlayProps,\n type DevPanel,\n type DevOption,\n type DevBooleanOption,\n type DevSelectOption,\n type DevStringOption,\n type DevActionOption,\n type DevOptionValue,\n} from \"./dev-overlay/index.js\";\nexport {\n useActionQuery,\n useActionMutation,\n type ActionRegistry,\n} from \"./use-action.js\";\nexport {\n ShareButton,\n ShareDialog,\n VisibilityBadge,\n type ShareButtonProps,\n type ShareDialogProps,\n type VisibilityBadgeProps,\n} from \"./sharing/index.js\";\nexport {\n postNavigate,\n isInAgentEmbed,\n AGENT_NAVIGATE_MESSAGE_TYPE,\n type AgentNavigateMessage,\n} from \"./embed.js\";\nexport { IframeEmbed, parseEmbedBody } from \"./IframeEmbed.js\";\nexport {\n useAvatarUrl,\n uploadAvatar,\n invalidateAvatarCache,\n} from \"./use-avatar.js\";\nexport {\n ObservabilityDashboard,\n ThumbsFeedback,\n} from \"./observability/index.js\";\n// Presence UI components\nexport {\n PresenceBar,\n type PresenceBarProps,\n} from \"./components/PresenceBar.js\";\nexport {\n AgentPresenceChip,\n type AgentPresenceChipProps,\n} from \"./components/AgentPresenceChip.js\";\n// Structured data collaboration hooks\nexport {\n useCollaborativeMap,\n useCollaborativeArray,\n type UseCollaborativeMapOptions,\n type UseCollaborativeMapResult,\n type UseCollaborativeArrayOptions,\n type UseCollaborativeArrayResult,\n} from \"../collab/client-struct.js\";\nexport { NotificationsBell } from \"./notifications/index.js\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAEtE,yBAAyB,EAAE,CAAC;AAE5B,OAAO,EACL,eAAe,EACf,aAAa,GAEd,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EACL,eAAe,EACf,UAAU,EACV,WAAW,EACX,OAAO,GACR,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EACL,aAAa,GAGd,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,kBAAkB,GAEnB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,kBAAkB,GAEnB,MAAM,oCAAoC,CAAC;AAC5C,OAAO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X,eAAe,GAIhB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,YAAY,EACZ,cAAc,EACd,2BAA2B,GAE5B,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,qBAAqB,GACtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,sBAAsB,EACtB,cAAc,GACf,MAAM,0BAA0B,CAAC;AAClC,yBAAyB;AACzB,OAAO,EACL,WAAW,GAEZ,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,iBAAiB,GAElB,MAAM,mCAAmC,CAAC;AAC3C,sCAAsC;AACtC,OAAO,EACL,mBAAmB,EACnB,qBAAqB,GAKtB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC","sourcesContent":["import { installRouteChunkRecovery } from \"./route-chunk-recovery.js\";\n\ninstallRouteChunkRecovery();\n\nexport {\n sendToAgentChat,\n generateTabId,\n type AgentChatMessage,\n} from \"./agent-chat.js\";\nexport { useAgentChatGenerating } from \"./use-agent-chat.js\";\nexport { useDevMode } from \"./use-dev-mode.js\";\nexport {\n agentNativePath,\n appApiPath,\n appBasePath,\n appPath,\n} from \"./api-path.js\";\nexport { useSendToAgentChat } from \"./use-send-to-agent-chat.js\";\nexport {\n useChatModels,\n type UseChatModelsResult,\n type EngineModelGroup,\n} from \"./use-chat-models.js\";\nexport {\n CodeRequiredDialog,\n type CodeRequiredDialogProps,\n} from \"./components/CodeRequiredDialog.js\";\nexport {\n CodeAgentIndicator,\n type CodeAgentIndicatorProps,\n} from \"./components/CodeAgentIndicator.js\";\nexport {\n useDbSync,\n useFileWatcher,\n useScreenRefreshKey,\n} from \"./use-db-sync.js\";\nexport { cn } from \"./utils.js\";\nexport { ApiKeySettings } from \"./components/ApiKeySettings.js\";\nexport { useSession, type AuthSession } from \"./use-session.js\";\nexport {\n sendToFrame,\n onFrameMessage,\n requestUserInfo,\n getFrameOrigin,\n getCallbackOrigin,\n oauthRedirectUri,\n isInFrame,\n enterStyleEditing,\n enterTextEditing,\n exitSelectionMode,\n type UserInfo,\n} from \"./frame.js\";\nexport {\n getBuilderParentOrigin,\n isInBuilderFrame,\n sendToBuilderChat,\n type BuilderChatMessage,\n} from \"./builder-frame.js\";\nexport {\n NewWorkspaceAppFlow,\n type NewWorkspaceAppFlowProps,\n type VaultSecretOption,\n} from \"./NewWorkspaceAppFlow.js\";\nexport {\n AssistantChat,\n clearChatStorage,\n type AssistantChatProps,\n type AssistantChatHandle,\n} from \"./AssistantChat.js\";\nexport {\n MultiTabAssistantChat,\n type MultiTabAssistantChatProps,\n type MultiTabAssistantChatHeaderProps,\n} from \"./MultiTabAssistantChat.js\";\nexport { createAgentChatAdapter } from \"./agent-chat-adapter.js\";\nexport {\n PromptComposer,\n type PromptComposerProps,\n type PromptComposerFile,\n type PromptComposerSubmitOptions,\n} from \"./composer/PromptComposer.js\";\nexport {\n GuidedQuestionFlow,\n useGuidedQuestionFlow,\n formatGuidedAnswerValue,\n formatGuidedAnswersForAgent,\n getOtherGuidedAnswerText,\n hasGuidedAnswer,\n isOtherGuidedAnswer,\n makeOtherGuidedAnswer,\n normalizeGuidedAnswers,\n type GuidedQuestion,\n type GuidedQuestionAnswers,\n type GuidedQuestionFlowProps,\n type GuidedQuestionOption,\n type GuidedQuestionPayload,\n type GuidedQuestionType,\n type UseGuidedQuestionFlowOptions,\n} from \"./guided-questions.js\";\nexport {\n useChatThreads,\n type ChatThreadSummary,\n type ChatThreadData,\n} from \"./use-chat-threads.js\";\nexport {\n AgentPanel,\n AgentSidebar,\n AgentToggleButton,\n focusAgentChat,\n type AgentPanelProps,\n type AgentSidebarProps,\n} from \"./AgentPanel.js\";\nexport { AgentNativeIcon } from \"./components/icons/AgentNativeIcon.js\";\nexport { SettingsPanel, type SettingsPanelProps } from \"./settings/index.js\";\n// Deprecated — use AgentSidebar + AgentToggleButton instead\nexport {\n ProductionAgentPanel,\n type ProductionAgentPanelProps,\n} from \"./ProductionAgentPanel.js\";\nexport {\n useProductionAgent,\n type ProductionAgentMessage,\n type UseProductionAgentOptions,\n type UseProductionAgentResult,\n} from \"./useProductionAgent.js\";\nexport { Turnstile, type TurnstileProps } from \"./Turnstile.js\";\nexport {\n OpenSourceBadge,\n PoweredByBadge,\n type OpenSourceBadgeProps,\n type PoweredByBadgeProps,\n} from \"./PoweredByBadge.js\";\nexport { FeedbackButton, type FeedbackButtonProps } from \"./FeedbackButton.js\";\nexport { ErrorBoundary } from \"./ErrorBoundary.js\";\nexport { installRouteChunkRecovery } from \"./route-chunk-recovery.js\";\nexport { ClientOnly } from \"./ClientOnly.js\";\nexport { DefaultSpinner } from \"./DefaultSpinner.js\";\nexport {\n getThemeInitScript,\n themeInitScript,\n type ThemePreference,\n} from \"./theme.js\";\nexport { AgentTerminal, type AgentTerminalProps } from \"./terminal/index.js\";\nexport {\n trackEvent,\n trackSessionStatus,\n configureTracking,\n setSentryUser,\n captureError,\n captureClientException,\n type ClientCaptureContext,\n} from \"./analytics.js\";\nexport {\n useCollaborativeDoc,\n emailToColor,\n emailToName,\n type UseCollaborativeDocOptions,\n type UseCollaborativeDocResult,\n type CollabUser,\n} from \"../collab/client.js\";\nexport {\n ResourcesPanel,\n ResourceTree,\n ResourceEditor,\n useResources,\n useResourceTree,\n useResource,\n useCreateResource,\n useUpdateResource,\n useDeleteResource,\n useUploadResource,\n type Resource,\n type ResourceMeta,\n type TreeNode,\n type ResourceScope,\n type ResourceTreeProps,\n type ResourceEditorProps,\n} from \"./resources/index.js\";\nexport type {\n AppToFrameMessage,\n FrameToAppMessage,\n FrameMessage,\n CodeCompleteMessage,\n ChatRunningMessage,\n} from \"./frame-protocol.js\";\nexport {\n CommandMenu,\n useCommandMenuShortcut,\n openAgentSidebar,\n submitToAgent,\n type CommandMenuProps,\n type CommandGroupProps,\n type CommandItemProps,\n type CommandShortcutProps,\n} from \"./CommandMenu.js\";\nexport {\n DevOverlay,\n useDevOverlayShortcut,\n registerDevPanel,\n unregisterDevPanel,\n listDevPanels,\n subscribeDevPanels,\n useDevOption,\n clearAllDevOverlayStorage,\n devOptionKey,\n DEV_OVERLAY_STORAGE_PREFIX,\n type DevOverlayProps,\n type DevPanel,\n type DevOption,\n type DevBooleanOption,\n type DevSelectOption,\n type DevStringOption,\n type DevActionOption,\n type DevOptionValue,\n} from \"./dev-overlay/index.js\";\nexport {\n useActionQuery,\n useActionMutation,\n type ActionRegistry,\n} from \"./use-action.js\";\nexport {\n ShareButton,\n ShareDialog,\n VisibilityBadge,\n type ShareButtonProps,\n type ShareDialogProps,\n type VisibilityBadgeProps,\n} from \"./sharing/index.js\";\nexport {\n postNavigate,\n isInAgentEmbed,\n AGENT_NAVIGATE_MESSAGE_TYPE,\n type AgentNavigateMessage,\n} from \"./embed.js\";\nexport { IframeEmbed, parseEmbedBody } from \"./IframeEmbed.js\";\nexport {\n useAvatarUrl,\n uploadAvatar,\n invalidateAvatarCache,\n} from \"./use-avatar.js\";\nexport {\n ObservabilityDashboard,\n ThumbsFeedback,\n} from \"./observability/index.js\";\n// Presence UI components\nexport {\n PresenceBar,\n type PresenceBarProps,\n} from \"./components/PresenceBar.js\";\nexport {\n AgentPresenceChip,\n type AgentPresenceChipProps,\n} from \"./components/AgentPresenceChip.js\";\n// Structured data collaboration hooks\nexport {\n useCollaborativeMap,\n useCollaborativeArray,\n type UseCollaborativeMapOptions,\n type UseCollaborativeMapResult,\n type UseCollaborativeArrayOptions,\n type UseCollaborativeArrayResult,\n} from \"../collab/client-struct.js\";\nexport { NotificationsBell } from \"./notifications/index.js\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OrgSwitcher.d.ts","sourceRoot":"","sources":["../../../src/client/org/OrgSwitcher.tsx"],"names":[],"mappings":"AAwBA,MAAM,WAAW,gBAAgB;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2EAA2E;IAC3E,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,6EAA6E;IAC7E,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;
|
|
1
|
+
{"version":3,"file":"OrgSwitcher.d.ts","sourceRoot":"","sources":["../../../src/client/org/OrgSwitcher.tsx"],"names":[],"mappings":"AAwBA,MAAM,WAAW,gBAAgB;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2EAA2E;IAC3E,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,6EAA6E;IAC7E,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AA6BD;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,EAC1B,SAAS,EACT,cAAc,EACd,YAAY,EACZ,YAAsB,GACvB,EAAE,gBAAgB,2CAgalB"}
|
|
@@ -21,6 +21,9 @@ function personalLabelFromEmail(email) {
|
|
|
21
21
|
const POPOVER_CONTENT_CLASS = "z-50 min-w-[14rem] rounded-md border border-border bg-popover py-1 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2";
|
|
22
22
|
const ITEM_CLASS = "flex w-full items-center gap-2 px-2.5 py-1.5 text-xs text-foreground hover:bg-accent focus-visible:bg-accent focus:outline-none disabled:opacity-50 disabled:pointer-events-none";
|
|
23
23
|
const SECTION_LABEL_CLASS = "px-2.5 pt-1 pb-0.5 text-[10px] uppercase tracking-wide text-muted-foreground";
|
|
24
|
+
function workspaceSettingsPath(path) {
|
|
25
|
+
return `${path.replace(/#.*$/, "")}#workspace-settings`;
|
|
26
|
+
}
|
|
24
27
|
/**
|
|
25
28
|
* Compact org switcher button. Shows the active org (or "Personal" when the
|
|
26
29
|
* user has none); opens a popover with the user's other orgs, pending
|
|
@@ -127,7 +130,11 @@ export function OrgSwitcher({ className, hideWhenSingle, reserveSpace, settingsP
|
|
|
127
130
|
}, disabled: joinByDomain.isPending, className: "rounded px-1.5 py-0.5 text-[11px] font-medium text-primary hover:bg-primary/10 disabled:opacity-50 cursor-pointer", children: isJoining ? (_jsx(IconLoader2, { className: "h-3 w-3 animate-spin" })) : ("Join") })] }, match.orgId));
|
|
128
131
|
})] })), _jsx("div", { className: "my-1 h-px bg-border" }), inOrg && (_jsxs("button", { type: "button", onClick: () => {
|
|
129
132
|
setOpen(false);
|
|
130
|
-
|
|
133
|
+
window.dispatchEvent(new CustomEvent("agent-panel:open"));
|
|
134
|
+
window.dispatchEvent(new CustomEvent("agent-panel:open-settings", {
|
|
135
|
+
detail: { section: "workspace-settings" },
|
|
136
|
+
}));
|
|
137
|
+
navigate(workspaceSettingsPath(settingsPath));
|
|
131
138
|
}, className: `${ITEM_CLASS} cursor-pointer`, children: [_jsx(IconSettings, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }), _jsx("span", { className: "flex-1 text-left", children: "Workspace settings" })] })), _jsxs("button", { type: "button", onClick: () => setMode("create"), className: `${ITEM_CLASS} cursor-pointer`, children: [_jsx(IconPlus, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }), _jsx("span", { className: "flex-1 text-left", children: "Create organization" })] }), canInvite && (_jsxs("button", { type: "button", onClick: () => setMode("invite"), className: `${ITEM_CLASS} cursor-pointer`, children: [_jsx(IconUserPlus, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }), _jsx("span", { className: "flex-1 text-left", children: "Invite member" })] })), _jsx("div", { className: "my-1 h-px bg-border" }), _jsxs("button", { type: "button", onClick: handleSignOut, disabled: signingOut, className: `${ITEM_CLASS} cursor-pointer`, children: [signingOut ? (_jsx(IconLoader2, { className: "h-3.5 w-3.5 shrink-0 animate-spin text-muted-foreground" })) : (_jsx(IconLogout, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" })), _jsxs("span", { className: "flex-1 text-left", children: ["Sign out", org.email ? (_jsxs("span", { className: "ml-1 text-muted-foreground", children: ["(", org.email, ")"] })) : null] })] }), (switchOrg.error ||
|
|
132
139
|
acceptInvitation.error ||
|
|
133
140
|
joinByDomain.error) && (_jsx("div", { className: "px-2.5 pt-1 text-[11px] text-destructive", children: (switchOrg.error ||
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OrgSwitcher.js","sourceRoot":"","sources":["../../../src/client/org/OrgSwitcher.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,gBAAgB,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EACL,YAAY,EACZ,SAAS,EACT,WAAW,EACX,UAAU,EACV,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,YAAY,GACb,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,MAAM,EACN,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,mBAAmB,EACnB,eAAe,GAChB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAgBjD,SAAS,sBAAsB,CAAC,KAAgC;IAC9D,IAAI,CAAC,KAAK;QAAE,OAAO,UAAU,CAAC;IAC9B,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC;IAC3C,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;IACrD,IAAI,CAAC,OAAO;QAAE,OAAO,UAAU,CAAC;IAChC,OAAO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,eAAK,SAAS,EAAC,kCAAkC,aAC/C,iBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,EAC9B,QAAQ,EAAE,YAAY,CAAC,SAAS,EAChC,SAAS,EAAC,8GAA8G,uBAGjH,EACT,iBACE,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAE,YAAY,CAAC,SAAS,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,EACvD,SAAS,EAAC,wIAAwI,YAEjJ,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC,CACxB,KAAC,WAAW,IAAC,SAAS,EAAC,8BAA8B,GAAG,CACzD,CAAC,CAAC,CAAC,CACF,aAAa,CACd,GACM,IACL,IACD,CACR,IACwB,GACH,IACJ,CACzB,CAAC;AACJ,CAAC","sourcesContent":["import { useState } from \"react\";\nimport { useNavigate } from \"react-router\";\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\";\nimport {\n IconBuilding,\n IconCheck,\n IconLoader2,\n IconLogout,\n IconPlus,\n IconSelector,\n IconSettings,\n IconUser,\n IconUserPlus,\n} from \"@tabler/icons-react\";\nimport {\n useOrg,\n useSwitchOrg,\n useCreateOrg,\n useInviteMember,\n useAcceptInvitation,\n useJoinByDomain,\n} from \"./hooks.js\";\nimport { agentNativePath } from \"../api-path.js\";\n\nexport interface OrgSwitcherProps {\n className?: string;\n /** Hide entirely when the user only belongs to one org. Default: false. */\n hideWhenSingle?: boolean;\n /** Keep the switcher's button height reserved while org state is loading. */\n reserveSpace?: boolean;\n /**\n * Where the \"Workspace settings\" item navigates to. Defaults to `/team`,\n * which every framework template mounts via the shared `TeamPage`.\n * Templates that mount the settings page elsewhere can override.\n */\n settingsPath?: string;\n}\n\nfunction personalLabelFromEmail(email: string | null | undefined): string {\n if (!email) return \"Personal\";\n const local = email.split(\"@\")[0] ?? email;\n const cleaned = local.replace(/[._-]+/g, \" \").trim();\n if (!cleaned) return \"Personal\";\n return cleaned\n .split(\" \")\n .filter(Boolean)\n .map((w) => w.charAt(0).toUpperCase() + w.slice(1))\n .join(\" \");\n}\n\ntype Mode = \"list\" | \"create\" | \"invite\";\n\nconst POPOVER_CONTENT_CLASS =\n \"z-50 min-w-[14rem] rounded-md border border-border bg-popover py-1 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\";\n\nconst ITEM_CLASS =\n \"flex w-full items-center gap-2 px-2.5 py-1.5 text-xs text-foreground hover:bg-accent focus-visible:bg-accent focus:outline-none disabled:opacity-50 disabled:pointer-events-none\";\n\nconst SECTION_LABEL_CLASS =\n \"px-2.5 pt-1 pb-0.5 text-[10px] uppercase tracking-wide text-muted-foreground\";\n\n/**\n * Compact org switcher button. Shows the active org (or \"Personal\" when the\n * user has none); opens a popover with the user's other orgs, pending\n * invitations, inline forms to create a new org / invite a teammate, and a\n * sign-out item. Renders nothing in dev / no-auth mode.\n */\nexport function OrgSwitcher({\n className,\n hideWhenSingle,\n reserveSpace,\n settingsPath = \"/team\",\n}: OrgSwitcherProps) {\n const { data: org, isLoading } = useOrg();\n const switchOrg = useSwitchOrg();\n const createOrg = useCreateOrg();\n const inviteMember = useInviteMember();\n const acceptInvitation = useAcceptInvitation();\n const joinByDomain = useJoinByDomain();\n const navigate = useNavigate();\n const [open, setOpen] = useState(false);\n const [mode, setMode] = useState<Mode>(\"list\");\n const [newName, setNewName] = useState(\"\");\n const [inviteEmail, setInviteEmail] = useState(\"\");\n const [signingOut, setSigningOut] = useState(false);\n const [joiningOrgId, setJoiningOrgId] = useState<string | null>(null);\n\n const handleOpenChange = (next: boolean) => {\n setOpen(next);\n if (!next) {\n setMode(\"list\");\n setNewName(\"\");\n setInviteEmail(\"\");\n }\n };\n\n const handleSignOut = async () => {\n if (signingOut) return;\n setSigningOut(true);\n try {\n await fetch(agentNativePath(\"/_agent-native/auth/logout\"), {\n method: \"POST\",\n credentials: \"include\",\n });\n } catch {\n /* fall through to reload — server may already have cleared the cookie */\n }\n window.location.reload();\n };\n\n if (!org) {\n return reserveSpace && isLoading ? (\n <div aria-hidden=\"true\" className={`h-8 ${className ?? \"\"}`} />\n ) : null;\n }\n\n const orgs = org.orgs ?? [];\n const pendingInvitations = org.pendingInvitations ?? [];\n const domainMatches = org.domainMatches ?? [];\n const orgCount = orgs.length;\n const hasAny =\n orgCount > 0 || pendingInvitations.length > 0 || domainMatches.length > 0;\n if (!hasAny && !org.email) {\n return reserveSpace ? (\n <div aria-hidden=\"true\" className={`h-8 ${className ?? \"\"}`} />\n ) : null;\n }\n if (\n hideWhenSingle &&\n orgCount < 2 &&\n pendingInvitations.length === 0 &&\n domainMatches.length === 0\n ) {\n return reserveSpace ? (\n <div aria-hidden=\"true\" className={`h-8 ${className ?? \"\"}`} />\n ) : null;\n }\n\n const canInvite =\n !!org.orgId && (org.role === \"owner\" || org.role === \"admin\");\n\n const personalLabel = personalLabelFromEmail(org.email);\n const inOrg = !!org.orgId;\n const buttonLabel = org.orgName ?? \"Personal\";\n const ButtonIcon = inOrg ? IconBuilding : IconUser;\n\n return (\n <PopoverPrimitive.Root open={open} onOpenChange={handleOpenChange}>\n <PopoverPrimitive.Trigger asChild>\n <button\n type=\"button\"\n className={`flex w-full items-center gap-2 rounded-md border border-border/50 px-2.5 py-1.5 text-xs font-medium text-muted-foreground hover:bg-accent/50 hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring cursor-pointer ${className ?? \"\"}`}\n >\n <ButtonIcon className=\"h-3.5 w-3.5 shrink-0\" />\n <span className=\"truncate flex-1 text-left\">{buttonLabel}</span>\n <IconSelector className=\"h-3 w-3 shrink-0 opacity-50\" />\n </button>\n </PopoverPrimitive.Trigger>\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n side=\"top\"\n align=\"start\"\n sideOffset={6}\n collisionPadding={12}\n className={POPOVER_CONTENT_CLASS}\n onOpenAutoFocus={(e) => {\n // Don't auto-focus the first item — feels heavy on a switcher.\n if (mode === \"list\") e.preventDefault();\n }}\n >\n {mode === \"list\" && (\n <>\n {!inOrg && (\n <div\n className=\"flex w-full items-center gap-2 px-2.5 py-1.5 text-xs text-muted-foreground\"\n aria-disabled=\"true\"\n >\n <IconUser className=\"h-3.5 w-3.5 shrink-0\" />\n <span className=\"truncate flex-1 text-left\">\n Personal ({personalLabel})\n </span>\n </div>\n )}\n {orgs.length > 0 && (\n <div className={SECTION_LABEL_CLASS}>Organizations</div>\n )}\n {orgs.map((o) => (\n <button\n key={o.orgId}\n type=\"button\"\n onClick={async () => {\n if (o.orgId === org.orgId) {\n setOpen(false);\n return;\n }\n try {\n await switchOrg.mutateAsync(o.orgId);\n setOpen(false);\n } catch {\n /* error surfaced via switchOrg.error */\n }\n }}\n disabled={switchOrg.isPending}\n className={`${ITEM_CLASS} cursor-pointer`}\n >\n <IconBuilding className=\"h-3.5 w-3.5 shrink-0 text-muted-foreground\" />\n <span className=\"truncate flex-1 text-left\">{o.orgName}</span>\n {o.orgId === org.orgId && (\n <IconCheck className=\"h-3.5 w-3.5 shrink-0 text-muted-foreground\" />\n )}\n </button>\n ))}\n\n {pendingInvitations.length > 0 && (\n <>\n {orgs.length > 0 && <div className=\"my-1 h-px bg-border\" />}\n <div className={SECTION_LABEL_CLASS}>Invitations</div>\n {pendingInvitations.map((inv) => (\n <div\n key={inv.id}\n className=\"flex items-center gap-2 px-2.5 py-1.5 text-xs\"\n >\n <IconBuilding className=\"h-3.5 w-3.5 shrink-0 text-muted-foreground\" />\n <span className=\"truncate flex-1 text-foreground\">\n {inv.orgName}\n </span>\n <button\n type=\"button\"\n onClick={async () => {\n try {\n await acceptInvitation.mutateAsync(inv.id);\n setOpen(false);\n } catch {\n /* error surfaced via acceptInvitation.error */\n }\n }}\n disabled={acceptInvitation.isPending}\n className=\"rounded px-1.5 py-0.5 text-[11px] font-medium text-primary hover:bg-primary/10 disabled:opacity-50 cursor-pointer\"\n >\n {acceptInvitation.isPending ? (\n <IconLoader2 className=\"h-3 w-3 animate-spin\" />\n ) : (\n \"Join\"\n )}\n </button>\n </div>\n ))}\n </>\n )}\n\n {domainMatches.length > 0 && (\n <>\n {(orgs.length > 0 || pendingInvitations.length > 0) && (\n <div className=\"my-1 h-px bg-border\" />\n )}\n <div className={SECTION_LABEL_CLASS}>Join your team</div>\n {domainMatches.map((match) => {\n const isJoining =\n joinByDomain.isPending && joiningOrgId === match.orgId;\n return (\n <div\n key={match.orgId}\n className=\"flex items-center gap-2 px-2.5 py-1.5 text-xs\"\n >\n <IconBuilding className=\"h-3.5 w-3.5 shrink-0 text-muted-foreground\" />\n <span className=\"truncate flex-1 text-foreground\">\n {match.orgName}\n </span>\n <button\n type=\"button\"\n onClick={async () => {\n setJoiningOrgId(match.orgId);\n try {\n await joinByDomain.mutateAsync(match.orgId);\n setOpen(false);\n } catch {\n /* error surfaced via joinByDomain.error */\n } finally {\n setJoiningOrgId(null);\n }\n }}\n disabled={joinByDomain.isPending}\n className=\"rounded px-1.5 py-0.5 text-[11px] font-medium text-primary hover:bg-primary/10 disabled:opacity-50 cursor-pointer\"\n >\n {isJoining ? (\n <IconLoader2 className=\"h-3 w-3 animate-spin\" />\n ) : (\n \"Join\"\n )}\n </button>\n </div>\n );\n })}\n </>\n )}\n\n <div className=\"my-1 h-px bg-border\" />\n {inOrg && (\n <button\n type=\"button\"\n onClick={() => {\n setOpen(false);\n navigate(settingsPath);\n }}\n className={`${ITEM_CLASS} cursor-pointer`}\n >\n <IconSettings className=\"h-3.5 w-3.5 shrink-0 text-muted-foreground\" />\n <span className=\"flex-1 text-left\">Workspace settings</span>\n </button>\n )}\n <button\n type=\"button\"\n onClick={() => setMode(\"create\")}\n className={`${ITEM_CLASS} cursor-pointer`}\n >\n <IconPlus className=\"h-3.5 w-3.5 shrink-0 text-muted-foreground\" />\n <span className=\"flex-1 text-left\">Create organization</span>\n </button>\n {canInvite && (\n <button\n type=\"button\"\n onClick={() => setMode(\"invite\")}\n className={`${ITEM_CLASS} cursor-pointer`}\n >\n <IconUserPlus className=\"h-3.5 w-3.5 shrink-0 text-muted-foreground\" />\n <span className=\"flex-1 text-left\">Invite member</span>\n </button>\n )}\n\n <div className=\"my-1 h-px bg-border\" />\n <button\n type=\"button\"\n onClick={handleSignOut}\n disabled={signingOut}\n className={`${ITEM_CLASS} cursor-pointer`}\n >\n {signingOut ? (\n <IconLoader2 className=\"h-3.5 w-3.5 shrink-0 animate-spin text-muted-foreground\" />\n ) : (\n <IconLogout className=\"h-3.5 w-3.5 shrink-0 text-muted-foreground\" />\n )}\n <span className=\"flex-1 text-left\">\n Sign out\n {org.email ? (\n <span className=\"ml-1 text-muted-foreground\">\n ({org.email})\n </span>\n ) : null}\n </span>\n </button>\n\n {(switchOrg.error ||\n acceptInvitation.error ||\n joinByDomain.error) && (\n <div className=\"px-2.5 pt-1 text-[11px] text-destructive\">\n {\n (\n (switchOrg.error ||\n acceptInvitation.error ||\n joinByDomain.error) as Error\n ).message\n }\n </div>\n )}\n </>\n )}\n\n {mode === \"create\" && (\n <form\n onSubmit={async (e) => {\n e.preventDefault();\n const name = newName.trim();\n if (!name) return;\n try {\n await createOrg.mutateAsync(name);\n setOpen(false);\n } catch {\n /* error surfaced via createOrg.error */\n }\n }}\n className=\"px-2 py-1.5\"\n >\n <div className=\"px-0.5 pb-1 text-[10px] uppercase tracking-wide text-muted-foreground\">\n New organization\n </div>\n <input\n autoFocus\n value={newName}\n onChange={(e) => setNewName(e.target.value)}\n placeholder=\"Organization name\"\n disabled={createOrg.isPending}\n className=\"w-full rounded-md border border-input bg-background px-2 py-1.5 text-xs outline-none focus:ring-2 focus:ring-ring disabled:opacity-50\"\n />\n {createOrg.error && (\n <div className=\"pt-1 text-[11px] text-destructive\">\n {(createOrg.error as Error).message}\n </div>\n )}\n <div className=\"flex items-center gap-1.5 pt-1.5\">\n <button\n type=\"button\"\n onClick={() => setMode(\"list\")}\n disabled={createOrg.isPending}\n className=\"flex-1 rounded-md px-2 py-1 text-xs text-muted-foreground hover:bg-accent disabled:opacity-50 cursor-pointer\"\n >\n Cancel\n </button>\n <button\n type=\"submit\"\n disabled={createOrg.isPending || !newName.trim()}\n className=\"flex-1 rounded-md bg-primary px-2 py-1 text-xs font-medium text-primary-foreground hover:opacity-90 disabled:opacity-50 cursor-pointer\"\n >\n {createOrg.isPending ? (\n <IconLoader2 className=\"mx-auto h-3 w-3 animate-spin\" />\n ) : (\n \"Create\"\n )}\n </button>\n </div>\n </form>\n )}\n\n {mode === \"invite\" && (\n <form\n onSubmit={async (e) => {\n e.preventDefault();\n const email = inviteEmail.trim();\n if (!email) return;\n try {\n await inviteMember.mutateAsync(email);\n setInviteEmail(\"\");\n setMode(\"list\");\n } catch {\n /* error surfaced via inviteMember.error */\n }\n }}\n className=\"px-2 py-1.5\"\n >\n <div className=\"px-0.5 pb-1 text-[10px] uppercase tracking-wide text-muted-foreground\">\n Invite to {org.orgName}\n </div>\n <input\n autoFocus\n type=\"email\"\n value={inviteEmail}\n onChange={(e) => setInviteEmail(e.target.value)}\n placeholder=\"teammate@company.com\"\n disabled={inviteMember.isPending}\n className=\"w-full rounded-md border border-input bg-background px-2 py-1.5 text-xs outline-none focus:ring-2 focus:ring-ring disabled:opacity-50\"\n />\n {inviteMember.error && (\n <div className=\"pt-1 text-[11px] text-destructive\">\n {(inviteMember.error as Error).message}\n </div>\n )}\n <div className=\"flex items-center gap-1.5 pt-1.5\">\n <button\n type=\"button\"\n onClick={() => setMode(\"list\")}\n disabled={inviteMember.isPending}\n className=\"flex-1 rounded-md px-2 py-1 text-xs text-muted-foreground hover:bg-accent disabled:opacity-50 cursor-pointer\"\n >\n Cancel\n </button>\n <button\n type=\"submit\"\n disabled={inviteMember.isPending || !inviteEmail.trim()}\n className=\"flex-1 rounded-md bg-primary px-2 py-1 text-xs font-medium text-primary-foreground hover:opacity-90 disabled:opacity-50 cursor-pointer\"\n >\n {inviteMember.isPending ? (\n <IconLoader2 className=\"mx-auto h-3 w-3 animate-spin\" />\n ) : (\n \"Send invite\"\n )}\n </button>\n </div>\n </form>\n )}\n </PopoverPrimitive.Content>\n </PopoverPrimitive.Portal>\n </PopoverPrimitive.Root>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"OrgSwitcher.js","sourceRoot":"","sources":["../../../src/client/org/OrgSwitcher.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,gBAAgB,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EACL,YAAY,EACZ,SAAS,EACT,WAAW,EACX,UAAU,EACV,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,YAAY,GACb,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,MAAM,EACN,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,mBAAmB,EACnB,eAAe,GAChB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAgBjD,SAAS,sBAAsB,CAAC,KAAgC;IAC9D,IAAI,CAAC,KAAK;QAAE,OAAO,UAAU,CAAC;IAC9B,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC;IAC3C,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;IACrD,IAAI,CAAC,OAAO;QAAE,OAAO,UAAU,CAAC;IAChC,OAAO,OAAO;SACX,KAAK,CAAC,GAAG,CAAC;SACV,MAAM,CAAC,OAAO,CAAC;SACf,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,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Ac,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAC/C,WAAW,EAAC,sBAAsB,EAClC,QAAQ,EAAE,YAAY,CAAC,SAAS,EAChC,SAAS,EAAC,uIAAuI,GACjJ,EACD,YAAY,CAAC,KAAK,IAAI,CACrB,cAAK,SAAS,EAAC,mCAAmC,YAC9C,YAAY,CAAC,KAAe,CAAC,OAAO,GAClC,CACP,EACD,eAAK,SAAS,EAAC,kCAAkC,aAC/C,iBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,EAC9B,QAAQ,EAAE,YAAY,CAAC,SAAS,EAChC,SAAS,EAAC,8GAA8G,uBAGjH,EACT,iBACE,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAE,YAAY,CAAC,SAAS,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,EACvD,SAAS,EAAC,wIAAwI,YAEjJ,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC,CACxB,KAAC,WAAW,IAAC,SAAS,EAAC,8BAA8B,GAAG,CACzD,CAAC,CAAC,CAAC,CACF,aAAa,CACd,GACM,IACL,IACD,CACR,IACwB,GACH,IACJ,CACzB,CAAC;AACJ,CAAC","sourcesContent":["import { useState } from \"react\";\nimport { useNavigate } from \"react-router\";\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\";\nimport {\n IconBuilding,\n IconCheck,\n IconLoader2,\n IconLogout,\n IconPlus,\n IconSelector,\n IconSettings,\n IconUser,\n IconUserPlus,\n} from \"@tabler/icons-react\";\nimport {\n useOrg,\n useSwitchOrg,\n useCreateOrg,\n useInviteMember,\n useAcceptInvitation,\n useJoinByDomain,\n} from \"./hooks.js\";\nimport { agentNativePath } from \"../api-path.js\";\n\nexport interface OrgSwitcherProps {\n className?: string;\n /** Hide entirely when the user only belongs to one org. Default: false. */\n hideWhenSingle?: boolean;\n /** Keep the switcher's button height reserved while org state is loading. */\n reserveSpace?: boolean;\n /**\n * Where the \"Workspace settings\" item navigates to. Defaults to `/team`,\n * which every framework template mounts via the shared `TeamPage`.\n * Templates that mount the settings page elsewhere can override.\n */\n settingsPath?: string;\n}\n\nfunction personalLabelFromEmail(email: string | null | undefined): string {\n if (!email) return \"Personal\";\n const local = email.split(\"@\")[0] ?? email;\n const cleaned = local.replace(/[._-]+/g, \" \").trim();\n if (!cleaned) return \"Personal\";\n return cleaned\n .split(\" \")\n .filter(Boolean)\n .map((w) => w.charAt(0).toUpperCase() + w.slice(1))\n .join(\" \");\n}\n\ntype Mode = \"list\" | \"create\" | \"invite\";\n\nconst POPOVER_CONTENT_CLASS =\n \"z-50 min-w-[14rem] rounded-md border border-border bg-popover py-1 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\";\n\nconst ITEM_CLASS =\n \"flex w-full items-center gap-2 px-2.5 py-1.5 text-xs text-foreground hover:bg-accent focus-visible:bg-accent focus:outline-none disabled:opacity-50 disabled:pointer-events-none\";\n\nconst SECTION_LABEL_CLASS =\n \"px-2.5 pt-1 pb-0.5 text-[10px] uppercase tracking-wide text-muted-foreground\";\n\nfunction workspaceSettingsPath(path: string): string {\n return `${path.replace(/#.*$/, \"\")}#workspace-settings`;\n}\n\n/**\n * Compact org switcher button. Shows the active org (or \"Personal\" when the\n * user has none); opens a popover with the user's other orgs, pending\n * invitations, inline forms to create a new org / invite a teammate, and a\n * sign-out item. Renders nothing in dev / no-auth mode.\n */\nexport function OrgSwitcher({\n className,\n hideWhenSingle,\n reserveSpace,\n settingsPath = \"/team\",\n}: OrgSwitcherProps) {\n const { data: org, isLoading } = useOrg();\n const switchOrg = useSwitchOrg();\n const createOrg = useCreateOrg();\n const inviteMember = useInviteMember();\n const acceptInvitation = useAcceptInvitation();\n const joinByDomain = useJoinByDomain();\n const navigate = useNavigate();\n const [open, setOpen] = useState(false);\n const [mode, setMode] = useState<Mode>(\"list\");\n const [newName, setNewName] = useState(\"\");\n const [inviteEmail, setInviteEmail] = useState(\"\");\n const [signingOut, setSigningOut] = useState(false);\n const [joiningOrgId, setJoiningOrgId] = useState<string | null>(null);\n\n const handleOpenChange = (next: boolean) => {\n setOpen(next);\n if (!next) {\n setMode(\"list\");\n setNewName(\"\");\n setInviteEmail(\"\");\n }\n };\n\n const handleSignOut = async () => {\n if (signingOut) return;\n setSigningOut(true);\n try {\n await fetch(agentNativePath(\"/_agent-native/auth/logout\"), {\n method: \"POST\",\n credentials: \"include\",\n });\n } catch {\n /* fall through to reload — server may already have cleared the cookie */\n }\n window.location.reload();\n };\n\n if (!org) {\n return reserveSpace && isLoading ? (\n <div aria-hidden=\"true\" className={`h-8 ${className ?? \"\"}`} />\n ) : null;\n }\n\n const orgs = org.orgs ?? [];\n const pendingInvitations = org.pendingInvitations ?? [];\n const domainMatches = org.domainMatches ?? [];\n const orgCount = orgs.length;\n const hasAny =\n orgCount > 0 || pendingInvitations.length > 0 || domainMatches.length > 0;\n if (!hasAny && !org.email) {\n return reserveSpace ? (\n <div aria-hidden=\"true\" className={`h-8 ${className ?? \"\"}`} />\n ) : null;\n }\n if (\n hideWhenSingle &&\n orgCount < 2 &&\n pendingInvitations.length === 0 &&\n domainMatches.length === 0\n ) {\n return reserveSpace ? (\n <div aria-hidden=\"true\" className={`h-8 ${className ?? \"\"}`} />\n ) : null;\n }\n\n const canInvite =\n !!org.orgId && (org.role === \"owner\" || org.role === \"admin\");\n\n const personalLabel = personalLabelFromEmail(org.email);\n const inOrg = !!org.orgId;\n const buttonLabel = org.orgName ?? \"Personal\";\n const ButtonIcon = inOrg ? IconBuilding : IconUser;\n\n return (\n <PopoverPrimitive.Root open={open} onOpenChange={handleOpenChange}>\n <PopoverPrimitive.Trigger asChild>\n <button\n type=\"button\"\n className={`flex w-full items-center gap-2 rounded-md border border-border/50 px-2.5 py-1.5 text-xs font-medium text-muted-foreground hover:bg-accent/50 hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring cursor-pointer ${className ?? \"\"}`}\n >\n <ButtonIcon className=\"h-3.5 w-3.5 shrink-0\" />\n <span className=\"truncate flex-1 text-left\">{buttonLabel}</span>\n <IconSelector className=\"h-3 w-3 shrink-0 opacity-50\" />\n </button>\n </PopoverPrimitive.Trigger>\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n side=\"top\"\n align=\"start\"\n sideOffset={6}\n collisionPadding={12}\n className={POPOVER_CONTENT_CLASS}\n onOpenAutoFocus={(e) => {\n // Don't auto-focus the first item — feels heavy on a switcher.\n if (mode === \"list\") e.preventDefault();\n }}\n >\n {mode === \"list\" && (\n <>\n {!inOrg && (\n <div\n className=\"flex w-full items-center gap-2 px-2.5 py-1.5 text-xs text-muted-foreground\"\n aria-disabled=\"true\"\n >\n <IconUser className=\"h-3.5 w-3.5 shrink-0\" />\n <span className=\"truncate flex-1 text-left\">\n Personal ({personalLabel})\n </span>\n </div>\n )}\n {orgs.length > 0 && (\n <div className={SECTION_LABEL_CLASS}>Organizations</div>\n )}\n {orgs.map((o) => (\n <button\n key={o.orgId}\n type=\"button\"\n onClick={async () => {\n if (o.orgId === org.orgId) {\n setOpen(false);\n return;\n }\n try {\n await switchOrg.mutateAsync(o.orgId);\n setOpen(false);\n } catch {\n /* error surfaced via switchOrg.error */\n }\n }}\n disabled={switchOrg.isPending}\n className={`${ITEM_CLASS} cursor-pointer`}\n >\n <IconBuilding className=\"h-3.5 w-3.5 shrink-0 text-muted-foreground\" />\n <span className=\"truncate flex-1 text-left\">{o.orgName}</span>\n {o.orgId === org.orgId && (\n <IconCheck className=\"h-3.5 w-3.5 shrink-0 text-muted-foreground\" />\n )}\n </button>\n ))}\n\n {pendingInvitations.length > 0 && (\n <>\n {orgs.length > 0 && <div className=\"my-1 h-px bg-border\" />}\n <div className={SECTION_LABEL_CLASS}>Invitations</div>\n {pendingInvitations.map((inv) => (\n <div\n key={inv.id}\n className=\"flex items-center gap-2 px-2.5 py-1.5 text-xs\"\n >\n <IconBuilding className=\"h-3.5 w-3.5 shrink-0 text-muted-foreground\" />\n <span className=\"truncate flex-1 text-foreground\">\n {inv.orgName}\n </span>\n <button\n type=\"button\"\n onClick={async () => {\n try {\n await acceptInvitation.mutateAsync(inv.id);\n setOpen(false);\n } catch {\n /* error surfaced via acceptInvitation.error */\n }\n }}\n disabled={acceptInvitation.isPending}\n className=\"rounded px-1.5 py-0.5 text-[11px] font-medium text-primary hover:bg-primary/10 disabled:opacity-50 cursor-pointer\"\n >\n {acceptInvitation.isPending ? (\n <IconLoader2 className=\"h-3 w-3 animate-spin\" />\n ) : (\n \"Join\"\n )}\n </button>\n </div>\n ))}\n </>\n )}\n\n {domainMatches.length > 0 && (\n <>\n {(orgs.length > 0 || pendingInvitations.length > 0) && (\n <div className=\"my-1 h-px bg-border\" />\n )}\n <div className={SECTION_LABEL_CLASS}>Join your team</div>\n {domainMatches.map((match) => {\n const isJoining =\n joinByDomain.isPending && joiningOrgId === match.orgId;\n return (\n <div\n key={match.orgId}\n className=\"flex items-center gap-2 px-2.5 py-1.5 text-xs\"\n >\n <IconBuilding className=\"h-3.5 w-3.5 shrink-0 text-muted-foreground\" />\n <span className=\"truncate flex-1 text-foreground\">\n {match.orgName}\n </span>\n <button\n type=\"button\"\n onClick={async () => {\n setJoiningOrgId(match.orgId);\n try {\n await joinByDomain.mutateAsync(match.orgId);\n setOpen(false);\n } catch {\n /* error surfaced via joinByDomain.error */\n } finally {\n setJoiningOrgId(null);\n }\n }}\n disabled={joinByDomain.isPending}\n className=\"rounded px-1.5 py-0.5 text-[11px] font-medium text-primary hover:bg-primary/10 disabled:opacity-50 cursor-pointer\"\n >\n {isJoining ? (\n <IconLoader2 className=\"h-3 w-3 animate-spin\" />\n ) : (\n \"Join\"\n )}\n </button>\n </div>\n );\n })}\n </>\n )}\n\n <div className=\"my-1 h-px bg-border\" />\n {inOrg && (\n <button\n type=\"button\"\n onClick={() => {\n setOpen(false);\n window.dispatchEvent(new CustomEvent(\"agent-panel:open\"));\n window.dispatchEvent(\n new CustomEvent(\"agent-panel:open-settings\", {\n detail: { section: \"workspace-settings\" },\n }),\n );\n navigate(workspaceSettingsPath(settingsPath));\n }}\n className={`${ITEM_CLASS} cursor-pointer`}\n >\n <IconSettings className=\"h-3.5 w-3.5 shrink-0 text-muted-foreground\" />\n <span className=\"flex-1 text-left\">Workspace settings</span>\n </button>\n )}\n <button\n type=\"button\"\n onClick={() => setMode(\"create\")}\n className={`${ITEM_CLASS} cursor-pointer`}\n >\n <IconPlus className=\"h-3.5 w-3.5 shrink-0 text-muted-foreground\" />\n <span className=\"flex-1 text-left\">Create organization</span>\n </button>\n {canInvite && (\n <button\n type=\"button\"\n onClick={() => setMode(\"invite\")}\n className={`${ITEM_CLASS} cursor-pointer`}\n >\n <IconUserPlus className=\"h-3.5 w-3.5 shrink-0 text-muted-foreground\" />\n <span className=\"flex-1 text-left\">Invite member</span>\n </button>\n )}\n\n <div className=\"my-1 h-px bg-border\" />\n <button\n type=\"button\"\n onClick={handleSignOut}\n disabled={signingOut}\n className={`${ITEM_CLASS} cursor-pointer`}\n >\n {signingOut ? (\n <IconLoader2 className=\"h-3.5 w-3.5 shrink-0 animate-spin text-muted-foreground\" />\n ) : (\n <IconLogout className=\"h-3.5 w-3.5 shrink-0 text-muted-foreground\" />\n )}\n <span className=\"flex-1 text-left\">\n Sign out\n {org.email ? (\n <span className=\"ml-1 text-muted-foreground\">\n ({org.email})\n </span>\n ) : null}\n </span>\n </button>\n\n {(switchOrg.error ||\n acceptInvitation.error ||\n joinByDomain.error) && (\n <div className=\"px-2.5 pt-1 text-[11px] text-destructive\">\n {\n (\n (switchOrg.error ||\n acceptInvitation.error ||\n joinByDomain.error) as Error\n ).message\n }\n </div>\n )}\n </>\n )}\n\n {mode === \"create\" && (\n <form\n onSubmit={async (e) => {\n e.preventDefault();\n const name = newName.trim();\n if (!name) return;\n try {\n await createOrg.mutateAsync(name);\n setOpen(false);\n } catch {\n /* error surfaced via createOrg.error */\n }\n }}\n className=\"px-2 py-1.5\"\n >\n <div className=\"px-0.5 pb-1 text-[10px] uppercase tracking-wide text-muted-foreground\">\n New organization\n </div>\n <input\n autoFocus\n value={newName}\n onChange={(e) => setNewName(e.target.value)}\n placeholder=\"Organization name\"\n disabled={createOrg.isPending}\n className=\"w-full rounded-md border border-input bg-background px-2 py-1.5 text-xs outline-none focus:ring-2 focus:ring-ring disabled:opacity-50\"\n />\n {createOrg.error && (\n <div className=\"pt-1 text-[11px] text-destructive\">\n {(createOrg.error as Error).message}\n </div>\n )}\n <div className=\"flex items-center gap-1.5 pt-1.5\">\n <button\n type=\"button\"\n onClick={() => setMode(\"list\")}\n disabled={createOrg.isPending}\n className=\"flex-1 rounded-md px-2 py-1 text-xs text-muted-foreground hover:bg-accent disabled:opacity-50 cursor-pointer\"\n >\n Cancel\n </button>\n <button\n type=\"submit\"\n disabled={createOrg.isPending || !newName.trim()}\n className=\"flex-1 rounded-md bg-primary px-2 py-1 text-xs font-medium text-primary-foreground hover:opacity-90 disabled:opacity-50 cursor-pointer\"\n >\n {createOrg.isPending ? (\n <IconLoader2 className=\"mx-auto h-3 w-3 animate-spin\" />\n ) : (\n \"Create\"\n )}\n </button>\n </div>\n </form>\n )}\n\n {mode === \"invite\" && (\n <form\n onSubmit={async (e) => {\n e.preventDefault();\n const email = inviteEmail.trim();\n if (!email) return;\n try {\n await inviteMember.mutateAsync(email);\n setInviteEmail(\"\");\n setMode(\"list\");\n } catch {\n /* error surfaced via inviteMember.error */\n }\n }}\n className=\"px-2 py-1.5\"\n >\n <div className=\"px-0.5 pb-1 text-[10px] uppercase tracking-wide text-muted-foreground\">\n Invite to {org.orgName}\n </div>\n <input\n autoFocus\n type=\"email\"\n value={inviteEmail}\n onChange={(e) => setInviteEmail(e.target.value)}\n placeholder=\"teammate@company.com\"\n disabled={inviteMember.isPending}\n className=\"w-full rounded-md border border-input bg-background px-2 py-1.5 text-xs outline-none focus:ring-2 focus:ring-ring disabled:opacity-50\"\n />\n {inviteMember.error && (\n <div className=\"pt-1 text-[11px] text-destructive\">\n {(inviteMember.error as Error).message}\n </div>\n )}\n <div className=\"flex items-center gap-1.5 pt-1.5\">\n <button\n type=\"button\"\n onClick={() => setMode(\"list\")}\n disabled={inviteMember.isPending}\n className=\"flex-1 rounded-md px-2 py-1 text-xs text-muted-foreground hover:bg-accent disabled:opacity-50 cursor-pointer\"\n >\n Cancel\n </button>\n <button\n type=\"submit\"\n disabled={inviteMember.isPending || !inviteEmail.trim()}\n className=\"flex-1 rounded-md bg-primary px-2 py-1 text-xs font-medium text-primary-foreground hover:opacity-90 disabled:opacity-50 cursor-pointer\"\n >\n {inviteMember.isPending ? (\n <IconLoader2 className=\"mx-auto h-3 w-3 animate-spin\" />\n ) : (\n \"Send invite\"\n )}\n </button>\n </div>\n </form>\n )}\n </PopoverPrimitive.Content>\n </PopoverPrimitive.Portal>\n </PopoverPrimitive.Root>\n );\n}\n"]}
|
|
@@ -3,6 +3,8 @@ export interface SettingsPanelProps {
|
|
|
3
3
|
onToggleDevMode: () => void;
|
|
4
4
|
showDevToggle: boolean;
|
|
5
5
|
devAppUrl?: string;
|
|
6
|
+
initialSection?: string | null;
|
|
7
|
+
sectionRequestKey?: number;
|
|
6
8
|
}
|
|
7
|
-
export declare function SettingsPanel({ isDevMode, onToggleDevMode, showDevToggle, devAppUrl, }: SettingsPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare function SettingsPanel({ isDevMode, onToggleDevMode, showDevToggle, devAppUrl, initialSection, sectionRequestKey, }: SettingsPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
8
10
|
//# sourceMappingURL=SettingsPanel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsPanel.d.ts","sourceRoot":"","sources":["../../../src/client/settings/SettingsPanel.tsx"],"names":[],"mappings":"AA2+CA,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,OAAO,CAAC;IACnB,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,aAAa,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"SettingsPanel.d.ts","sourceRoot":"","sources":["../../../src/client/settings/SettingsPanel.tsx"],"names":[],"mappings":"AA2+CA,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,OAAO,CAAC;IACnB,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,aAAa,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAyLD,wBAAgB,aAAa,CAAC,EAC5B,SAAS,EACT,eAAe,EACf,aAAa,EACb,SAAS,EACT,cAAc,EACd,iBAAiB,GAClB,EAAE,kBAAkB,2CAgWpB"}
|
|
@@ -627,6 +627,53 @@ function AgentLimitsSectionInner({ open, onToggle, }) {
|
|
|
627
627
|
saving ||
|
|
628
628
|
settings.maxIterations === settings.defaultMaxIterations, className: "h-8 rounded border border-border px-2.5 text-[10px] font-medium text-muted-foreground hover:bg-accent/40 hover:text-foreground disabled:opacity-40", children: "Reset" })] }), !settings.canUpdate && (_jsx("p", { className: "mt-2 text-[10px] text-muted-foreground", children: "Only organization owners and admins can change this limit." })), error && (_jsx("p", { className: "mt-2 text-[10px] text-destructive", children: error }))] }) })) : (_jsx("p", { className: "text-[10px] text-muted-foreground", children: "Agent limit settings are unavailable." })) }));
|
|
629
629
|
}
|
|
630
|
+
const SETTINGS_SECTION_IDS = new Set([
|
|
631
|
+
"account",
|
|
632
|
+
"llm",
|
|
633
|
+
"limits",
|
|
634
|
+
"voice",
|
|
635
|
+
"automations",
|
|
636
|
+
"secrets",
|
|
637
|
+
"hosting",
|
|
638
|
+
"database",
|
|
639
|
+
"uploads",
|
|
640
|
+
"auth",
|
|
641
|
+
"email",
|
|
642
|
+
"browser",
|
|
643
|
+
"background",
|
|
644
|
+
"integrations",
|
|
645
|
+
"usage",
|
|
646
|
+
"a2a",
|
|
647
|
+
]);
|
|
648
|
+
function normalizeSettingsSection(value) {
|
|
649
|
+
const normalized = value?.replace(/^#/, "").toLowerCase() ?? "";
|
|
650
|
+
if (!normalized)
|
|
651
|
+
return null;
|
|
652
|
+
if (normalized.startsWith("secrets"))
|
|
653
|
+
return "secrets";
|
|
654
|
+
if (normalized === "workspace" ||
|
|
655
|
+
normalized === "workspace-settings" ||
|
|
656
|
+
normalized === "organization" ||
|
|
657
|
+
normalized === "org") {
|
|
658
|
+
return "secrets";
|
|
659
|
+
}
|
|
660
|
+
if (normalized === "agent-engine")
|
|
661
|
+
return "llm";
|
|
662
|
+
if (normalized === "agent-limits" || normalized === "loop-settings") {
|
|
663
|
+
return "limits";
|
|
664
|
+
}
|
|
665
|
+
return SETTINGS_SECTION_IDS.has(normalized)
|
|
666
|
+
? normalized
|
|
667
|
+
: null;
|
|
668
|
+
}
|
|
669
|
+
function settingsSectionDomId(section) {
|
|
670
|
+
return `agent-settings-section-${section}`;
|
|
671
|
+
}
|
|
672
|
+
function initialOpenSection() {
|
|
673
|
+
if (typeof window === "undefined")
|
|
674
|
+
return "llm";
|
|
675
|
+
return normalizeSettingsSection(window.location.hash) ?? "llm";
|
|
676
|
+
}
|
|
630
677
|
const environmentOptions = [
|
|
631
678
|
{
|
|
632
679
|
value: "production",
|
|
@@ -673,7 +720,7 @@ function AccountSectionInner({ open, onToggle, }) {
|
|
|
673
720
|
};
|
|
674
721
|
return (_jsx(SettingsSection, { icon: _jsx(IconUserCircle, { size: 14 }), title: "Account", subtitle: "Your profile photo and signed-in identity.", open: open, onToggle: onToggle, children: _jsxs("div", { className: "flex items-center gap-3", children: [_jsx("div", { className: "flex h-12 w-12 shrink-0 items-center justify-center overflow-hidden rounded-full border border-border bg-accent text-[13px] font-semibold text-muted-foreground", children: avatarUrl ? (_jsx("img", { src: avatarUrl, alt: "", className: "h-full w-full object-cover" })) : (initials) }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("p", { className: "truncate text-[12px] font-medium text-foreground", children: isLoading ? "Loading..." : displayName }), email && (_jsx("p", { className: "truncate text-[11px] text-muted-foreground", children: email })), status === "saved" && (_jsx("p", { className: "mt-1 text-[11px] text-green-600 dark:text-green-400", children: "Photo updated" })), status === "error" && (_jsx("p", { className: "mt-1 text-[11px] text-destructive", children: "Could not update photo" }))] }), _jsx("input", { ref: fileInputRef, type: "file", accept: "image/*", className: "hidden", onChange: handleAvatarChange }), _jsx("button", { type: "button", disabled: !email || uploading, onClick: () => fileInputRef.current?.click(), className: "inline-flex h-8 shrink-0 items-center justify-center rounded-md border border-border bg-background px-3 text-[12px] font-medium text-foreground transition-colors hover:bg-accent/50 disabled:cursor-not-allowed disabled:opacity-50", children: uploading ? "Uploading..." : "Change photo" })] }) }));
|
|
675
722
|
}
|
|
676
|
-
export function SettingsPanel({ isDevMode, onToggleDevMode, showDevToggle, devAppUrl, }) {
|
|
723
|
+
export function SettingsPanel({ isDevMode, onToggleDevMode, showDevToggle, devAppUrl, initialSection, sectionRequestKey, }) {
|
|
677
724
|
const { status: builder, loading: builderLoading } = useBuilderStatus();
|
|
678
725
|
const connected = builder?.configured ?? false;
|
|
679
726
|
const connectUrl = builder?.connectUrl;
|
|
@@ -686,8 +733,29 @@ export function SettingsPanel({ isDevMode, onToggleDevMode, showDevToggle, devAp
|
|
|
686
733
|
// "API Keys & Connections" section renders at all.
|
|
687
734
|
const [focusSecretKey, setFocusSecretKey] = useState(undefined);
|
|
688
735
|
// Accordion: only one section open at a time (null = all closed)
|
|
689
|
-
const [openSection, setOpenSection] = useState(
|
|
736
|
+
const [openSection, setOpenSection] = useState(initialOpenSection);
|
|
690
737
|
const toggle = (id) => setOpenSection((prev) => (prev === id ? null : id));
|
|
738
|
+
const scrollSectionIntoView = useCallback((section) => {
|
|
739
|
+
window.requestAnimationFrame(() => {
|
|
740
|
+
document.getElementById(settingsSectionDomId(section))?.scrollIntoView({
|
|
741
|
+
block: "start",
|
|
742
|
+
behavior: "smooth",
|
|
743
|
+
});
|
|
744
|
+
});
|
|
745
|
+
}, []);
|
|
746
|
+
const openSettingsSection = useCallback((section, scroll = false) => {
|
|
747
|
+
setOpenSection(section);
|
|
748
|
+
if (scroll)
|
|
749
|
+
scrollSectionIntoView(section);
|
|
750
|
+
}, [scrollSectionIntoView]);
|
|
751
|
+
useEffect(() => {
|
|
752
|
+
const section = normalizeSettingsSection(initialSection);
|
|
753
|
+
if (!section)
|
|
754
|
+
return;
|
|
755
|
+
if (section !== "secrets")
|
|
756
|
+
setFocusSecretKey(undefined);
|
|
757
|
+
openSettingsSection(section, true);
|
|
758
|
+
}, [initialSection, sectionRequestKey, openSettingsSection]);
|
|
691
759
|
// Support `#secrets:<KEY>` hash fragments from the onboarding CTA — opens
|
|
692
760
|
// the section and focuses the matching input.
|
|
693
761
|
useEffect(() => {
|
|
@@ -695,28 +763,26 @@ export function SettingsPanel({ isDevMode, onToggleDevMode, showDevToggle, devAp
|
|
|
695
763
|
return;
|
|
696
764
|
const handleHash = () => {
|
|
697
765
|
const hash = window.location.hash?.replace(/^#/, "") ?? "";
|
|
766
|
+
const section = normalizeSettingsSection(hash);
|
|
767
|
+
if (!section)
|
|
768
|
+
return;
|
|
698
769
|
if (hash.startsWith("secrets:") || hash === "secrets") {
|
|
699
|
-
setOpenSection("secrets");
|
|
700
770
|
const key = hash.slice("secrets:".length);
|
|
701
771
|
setFocusSecretKey(key || undefined);
|
|
702
772
|
}
|
|
703
|
-
else
|
|
704
|
-
|
|
705
|
-
}
|
|
706
|
-
else if (hash === "agent-limits" ||
|
|
707
|
-
hash === "limits" ||
|
|
708
|
-
hash === "loop-settings") {
|
|
709
|
-
setOpenSection("limits");
|
|
773
|
+
else {
|
|
774
|
+
setFocusSecretKey(undefined);
|
|
710
775
|
}
|
|
776
|
+
openSettingsSection(section, true);
|
|
711
777
|
};
|
|
712
778
|
handleHash();
|
|
713
779
|
window.addEventListener("hashchange", handleHash);
|
|
714
780
|
return () => window.removeEventListener("hashchange", handleHash);
|
|
715
|
-
}, []);
|
|
781
|
+
}, [openSettingsSection]);
|
|
716
782
|
return (_jsxs("div", { className: "flex-1 min-h-0 overflow-y-auto p-3 space-y-2", style: { overflowY: "auto" }, children: [(showDevToggle || devAppUrl) && (_jsx("div", { className: "space-y-2 pb-2 border-b border-border mb-2", children: showDevToggle && (_jsx(SettingsSelect, { label: "Environment", labelAdornment: devAppUrl ? (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx("a", { href: devAppUrl, target: "_blank", rel: "noopener noreferrer", "aria-label": "Open app in new tab", className: "flex items-center text-muted-foreground hover:text-foreground", children: _jsx(IconExternalLink, { size: 14 }) }) }), _jsx(TooltipContent, { children: "Open app in new tab" })] })) : undefined, value: isDevMode ? "development" : "production", options: environmentOptions, onValueChange: (next) => {
|
|
717
783
|
const nextIsDev = next === "development";
|
|
718
784
|
if (nextIsDev !== isDevMode)
|
|
719
785
|
onToggleDevMode();
|
|
720
|
-
} })) })), _jsx(AccountSectionInner, { open: openSection === "account", onToggle: () => toggle("account") }), _jsx(LLMSectionInner, { builderFlow: builderFlow, builderLoading: builderLoading, connectUrl: connectUrl, connected: connected, orgName: orgName, envManaged: envManaged, credentialSource: credentialSource, open: openSection === "llm", onToggle: () => toggle("llm") }), _jsx(AgentLimitsSectionInner, { open: openSection === "limits", onToggle: () => toggle("limits") }), _jsx(SettingsSection, { icon: _jsx(IconMicrophone, { size: 14 }), title: "Voice Transcription", subtitle: "How the composer microphone turns your voice into text.", open: openSection === "voice", onToggle: () => toggle("voice"), children: _jsx(VoiceTranscriptionSection, {}) }), _jsx(SettingsSection, { icon: _jsx(IconBolt, { size: 14 }), title: "Automations", subtitle: "Event-triggered and scheduled automations.", open: openSection === "automations", onToggle: () => toggle("automations"), children: _jsx(AutomationsSection, {}) }), _jsx(SettingsSection, { icon: _jsx(IconKey, { size: 14 }), title: "API Keys & Connections", subtitle: "Service credentials and automation keys.", open: openSection === "secrets", onToggle: () => toggle("secrets"), children: _jsx(SecretsSection, { focusKey: focusSecretKey }) }), _jsx(SettingsSection, { icon: _jsx(IconCloud, { size: 14 }), title: "Hosting", subtitle: "Deploy your app to the cloud.", connected: connected, open: openSection === "hosting", onToggle: () => toggle("hosting"), children: _jsxs("div", { className: "space-y-2", children: [_jsx(UseBuilderCard, { builderFlow: builderFlow, connectUrl: connectUrl, connected: connected, orgName: orgName, envManaged: envManaged, credentialSource: credentialSource }), _jsx(ManualSetupCard, { hint: "Deploy manually to Netlify, Vercel, Cloudflare, or any Nitro-supported target.", docsUrl: "https://www.builder.io/c/docs/agent-native-deployment", dim: connected })] }) }), _jsx(SettingsSection, { icon: _jsx(IconDatabase, { size: 14 }), title: "Database", subtitle: "Connect a cloud database for persistent storage.", connected: connected, open: openSection === "database", onToggle: () => toggle("database"), children: _jsxs("div", { className: "space-y-2", children: [_jsx(UseBuilderCard, { builderFlow: builderFlow, connectUrl: connectUrl, connected: connected, orgName: orgName, envManaged: envManaged, credentialSource: credentialSource }), _jsx(ManualSetupCard, { hint: "Set DATABASE_URL in your .env to connect Neon, Supabase, Turso, or any Postgres/SQLite database.", docsUrl: "https://www.builder.io/c/docs/agent-native-database", dim: connected })] }) }), _jsx(SettingsSection, { icon: _jsx(IconUpload, { size: 14 }), title: "File uploads", subtitle: "Where user-uploaded files (avatars, chat attachments) are stored.", connected: connected, open: openSection === "uploads", onToggle: () => toggle("uploads"), children: _jsxs("div", { className: "space-y-2", children: [_jsx(UseBuilderCard, { builderFlow: builderFlow, connectUrl: connectUrl, connected: connected, orgName: orgName, envManaged: envManaged, credentialSource: credentialSource }), _jsx(ManualSetupCard, { hint: "Without a provider, files are stored as base64 in your database. Fine for dev, not recommended for production.", docsUrl: "https://www.builder.io/c/docs/agent-native-file-uploads", dim: connected })] }) }), _jsx(SettingsSection, { icon: _jsx(IconShield, { size: 14 }), title: "Authentication", subtitle: "Set up user authentication and access control.", connected: connected, open: openSection === "auth", onToggle: () => toggle("auth"), children: _jsxs("div", { className: "space-y-2", children: [_jsx(UseBuilderCard, { builderFlow: builderFlow, connectUrl: connectUrl, connected: connected, orgName: orgName, envManaged: envManaged, credentialSource: credentialSource }), _jsx(ManualSetupCard, { hint: "Configure Better Auth with BETTER_AUTH_SECRET and optional Google/GitHub OAuth providers.", docsUrl: "https://www.builder.io/c/docs/agent-native-authentication", dim: connected })] }) }), _jsx(EmailSectionInner, { open: openSection === "email", onToggle: () => toggle("email") }), _jsx(SettingsSection, { icon: _jsx(IconBrowser, { size: 14 }), title: "Browser Automation", subtitle: "Let agents control a real browser for web tasks.", connected: connected, open: openSection === "browser", onToggle: () => toggle("browser"), children: _jsx(UseBuilderCard, { builderFlow: builderFlow, connectUrl: connectUrl, connected: connected, orgName: orgName, envManaged: envManaged, credentialSource: credentialSource }) }), builderBranchesAvailable && (_jsx(SettingsSection, { icon: _jsx(IconGitBranch, { size: 14 }), title: "Background Agent", subtitle: "Make code changes from production mode via Builder.", connected: connected, open: openSection === "background", onToggle: () => toggle("background"), children: _jsx(UseBuilderCard, { builderFlow: builderFlow, connectUrl: connectUrl, connected: connected, orgName: orgName, envManaged: envManaged, credentialSource: credentialSource }) })), _jsx(SettingsSection, { icon: _jsx(IconPlugConnected, { size: 14 }), title: "Integrations", subtitle: "Connect messaging platforms and external services.", open: openSection === "integrations", onToggle: () => toggle("integrations"), children: _jsx(Suspense, { fallback: null, children: _jsx(IntegrationsPanel, {}) }) }), _jsx(SettingsSection, { icon: _jsx(IconCoin, { size: 14 }), title: "Usage", subtitle: "Track token consumption and estimated cost \u2014 broken down by chat, automations, and background jobs.", open: openSection === "usage", onToggle: () => toggle("usage"), children: _jsx(UsageSection, {}) }), _jsx(SettingsSection, { icon: _jsx(IconTopologyRing2, { size: 14 }), title: "Connected Agents (A2A)", subtitle: "Manage remote agents connected via the A2A protocol.", open: openSection === "a2a", onToggle: () => toggle("a2a"), children: _jsx(AgentsSection, {}) })] }));
|
|
786
|
+
} })) })), _jsx(AccountSectionInner, { open: openSection === "account", onToggle: () => toggle("account") }), _jsx(LLMSectionInner, { builderFlow: builderFlow, builderLoading: builderLoading, connectUrl: connectUrl, connected: connected, orgName: orgName, envManaged: envManaged, credentialSource: credentialSource, open: openSection === "llm", onToggle: () => toggle("llm") }), _jsx(AgentLimitsSectionInner, { open: openSection === "limits", onToggle: () => toggle("limits") }), _jsx(SettingsSection, { icon: _jsx(IconMicrophone, { size: 14 }), title: "Voice Transcription", subtitle: "How the composer microphone turns your voice into text.", open: openSection === "voice", onToggle: () => toggle("voice"), children: _jsx(VoiceTranscriptionSection, {}) }), _jsx(SettingsSection, { icon: _jsx(IconBolt, { size: 14 }), title: "Automations", subtitle: "Event-triggered and scheduled automations.", open: openSection === "automations", onToggle: () => toggle("automations"), children: _jsx(AutomationsSection, {}) }), _jsx(SettingsSection, { id: settingsSectionDomId("secrets"), icon: _jsx(IconKey, { size: 14 }), title: "API Keys & Connections", subtitle: "Service credentials and automation keys.", open: openSection === "secrets", onToggle: () => toggle("secrets"), children: _jsx(SecretsSection, { focusKey: focusSecretKey }) }), _jsx(SettingsSection, { icon: _jsx(IconCloud, { size: 14 }), title: "Hosting", subtitle: "Deploy your app to the cloud.", connected: connected, open: openSection === "hosting", onToggle: () => toggle("hosting"), children: _jsxs("div", { className: "space-y-2", children: [_jsx(UseBuilderCard, { builderFlow: builderFlow, connectUrl: connectUrl, connected: connected, orgName: orgName, envManaged: envManaged, credentialSource: credentialSource }), _jsx(ManualSetupCard, { hint: "Deploy manually to Netlify, Vercel, Cloudflare, or any Nitro-supported target.", docsUrl: "https://www.builder.io/c/docs/agent-native-deployment", dim: connected })] }) }), _jsx(SettingsSection, { icon: _jsx(IconDatabase, { size: 14 }), title: "Database", subtitle: "Connect a cloud database for persistent storage.", connected: connected, open: openSection === "database", onToggle: () => toggle("database"), children: _jsxs("div", { className: "space-y-2", children: [_jsx(UseBuilderCard, { builderFlow: builderFlow, connectUrl: connectUrl, connected: connected, orgName: orgName, envManaged: envManaged, credentialSource: credentialSource }), _jsx(ManualSetupCard, { hint: "Set DATABASE_URL in your .env to connect Neon, Supabase, Turso, or any Postgres/SQLite database.", docsUrl: "https://www.builder.io/c/docs/agent-native-database", dim: connected })] }) }), _jsx(SettingsSection, { icon: _jsx(IconUpload, { size: 14 }), title: "File uploads", subtitle: "Where user-uploaded files (avatars, chat attachments) are stored.", connected: connected, open: openSection === "uploads", onToggle: () => toggle("uploads"), children: _jsxs("div", { className: "space-y-2", children: [_jsx(UseBuilderCard, { builderFlow: builderFlow, connectUrl: connectUrl, connected: connected, orgName: orgName, envManaged: envManaged, credentialSource: credentialSource }), _jsx(ManualSetupCard, { hint: "Without a provider, files are stored as base64 in your database. Fine for dev, not recommended for production.", docsUrl: "https://www.builder.io/c/docs/agent-native-file-uploads", dim: connected })] }) }), _jsx(SettingsSection, { icon: _jsx(IconShield, { size: 14 }), title: "Authentication", subtitle: "Set up user authentication and access control.", connected: connected, open: openSection === "auth", onToggle: () => toggle("auth"), children: _jsxs("div", { className: "space-y-2", children: [_jsx(UseBuilderCard, { builderFlow: builderFlow, connectUrl: connectUrl, connected: connected, orgName: orgName, envManaged: envManaged, credentialSource: credentialSource }), _jsx(ManualSetupCard, { hint: "Configure Better Auth with BETTER_AUTH_SECRET and optional Google/GitHub OAuth providers.", docsUrl: "https://www.builder.io/c/docs/agent-native-authentication", dim: connected })] }) }), _jsx(EmailSectionInner, { open: openSection === "email", onToggle: () => toggle("email") }), _jsx(SettingsSection, { icon: _jsx(IconBrowser, { size: 14 }), title: "Browser Automation", subtitle: "Let agents control a real browser for web tasks.", connected: connected, open: openSection === "browser", onToggle: () => toggle("browser"), children: _jsx(UseBuilderCard, { builderFlow: builderFlow, connectUrl: connectUrl, connected: connected, orgName: orgName, envManaged: envManaged, credentialSource: credentialSource }) }), builderBranchesAvailable && (_jsx(SettingsSection, { icon: _jsx(IconGitBranch, { size: 14 }), title: "Background Agent", subtitle: "Make code changes from production mode via Builder.", connected: connected, open: openSection === "background", onToggle: () => toggle("background"), children: _jsx(UseBuilderCard, { builderFlow: builderFlow, connectUrl: connectUrl, connected: connected, orgName: orgName, envManaged: envManaged, credentialSource: credentialSource }) })), _jsx(SettingsSection, { icon: _jsx(IconPlugConnected, { size: 14 }), title: "Integrations", subtitle: "Connect messaging platforms and external services.", open: openSection === "integrations", onToggle: () => toggle("integrations"), children: _jsx(Suspense, { fallback: null, children: _jsx(IntegrationsPanel, {}) }) }), _jsx(SettingsSection, { icon: _jsx(IconCoin, { size: 14 }), title: "Usage", subtitle: "Track token consumption and estimated cost \u2014 broken down by chat, automations, and background jobs.", open: openSection === "usage", onToggle: () => toggle("usage"), children: _jsx(UsageSection, {}) }), _jsx(SettingsSection, { icon: _jsx(IconTopologyRing2, { size: 14 }), title: "Connected Agents (A2A)", subtitle: "Manage remote agents connected via the A2A protocol.", open: openSection === "a2a", onToggle: () => toggle("a2a"), children: _jsx(AgentsSection, {}) })] }));
|
|
721
787
|
}
|
|
722
788
|
//# sourceMappingURL=SettingsPanel.js.map
|