@agent-native/core 0.72.4 → 0.74.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/corpus/README.md +1 -1
- package/corpus/core/CHANGELOG.md +67 -0
- package/corpus/core/docs/content/skills-guide.md +14 -0
- package/corpus/core/docs/content/template-clips.md +7 -1
- package/corpus/core/package.json +1 -1
- package/corpus/core/src/agent/durable-background.ts +35 -12
- package/corpus/core/src/agent/production-agent.ts +55 -8
- package/corpus/core/src/cli/create.ts +1 -1
- package/corpus/core/src/cli/skills.ts +450 -19
- package/corpus/core/src/client/ConnectBuilderCard.tsx +7 -7
- package/corpus/core/src/client/NewWorkspaceAppFlow.tsx +1 -1
- package/corpus/core/src/client/blocks/library/AnnotatedCodeBlock.tsx +33 -18
- package/corpus/core/src/client/blocks/library/annotation-rail.tsx +3 -4
- package/corpus/core/src/client/components/CodeRequiredDialog.tsx +5 -8
- package/corpus/core/src/server/agent-chat-plugin.ts +7 -7
- package/corpus/core/src/server/auth.ts +7 -0
- package/corpus/core/src/server/onboarding-html.ts +95 -9
- package/corpus/core/src/server/self-dispatch.ts +8 -1
- package/corpus/core/src/templates/default/AGENTS.md +4 -0
- package/corpus/core/src/templates/default/package.json +2 -1
- package/corpus/core/src/templates/headless/AGENTS.md +4 -0
- package/corpus/core/src/templates/headless/package.json +1 -0
- package/corpus/core/src/templates/workspace-root/AGENTS.md +4 -0
- package/corpus/core/src/templates/workspace-root/README.md +4 -0
- package/corpus/core/src/templates/workspace-root/package.json +1 -0
- package/corpus/templates/analytics/actions/compose-dashboard.ts +34 -0
- package/corpus/templates/analytics/actions/install-dashboard-template.ts +51 -3
- package/corpus/templates/analytics/actions/update-dashboard.ts +3 -4
- package/corpus/templates/analytics/app/components/dashboard/SqlChart.tsx +175 -48
- package/corpus/templates/analytics/app/global.css +15 -13
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/PanelEditorDialog.tsx +9 -32
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/SqlChartCard.tsx +0 -26
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/index.tsx +0 -23
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/pivot.ts +65 -2
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/types.ts +3 -4
- package/corpus/templates/analytics/changelog/2026-06-24-dashboard-charts-now-fill-sparse-template-time-series-suppor.md +6 -0
- package/corpus/templates/analytics/changelog/2026-06-24-dashboard-filters-now-apply-consistently-to-first-party-traf.md +6 -0
- package/corpus/templates/analytics/changelog/2026-06-24-dashboard-rows-now-auto-fit-panels-so-one-two-or-three-chart.md +6 -0
- package/corpus/templates/analytics/changelog/2026-06-24-dashboard-traffic-tables-now-show-top-urls-and-shared-clips-.md +6 -0
- package/corpus/templates/analytics/changelog/2026-06-24-first-party-signup-and-pageview-panels-now-honor-dashboard-filters.md +5 -0
- package/corpus/templates/analytics/changelog/2026-06-24-first-party-template-dashboards-now-include-repeat-users-ret.md +6 -0
- package/corpus/templates/analytics/changelog/2026-06-24-retention-charts-now-break-out-1-day-and-7-day-return-rates-.md +6 -0
- package/corpus/templates/analytics/seeds/dashboards/agent-native-templates-first-party.json +330 -49
- package/corpus/templates/analytics/server/lib/dashboard-catalog.ts +7 -2
- package/corpus/templates/analytics/server/lib/first-party-analytics.ts +35 -8
- package/corpus/templates/analytics/server/lib/first-party-metric-catalog.ts +337 -45
- package/corpus/templates/calendar/changelog/2026-06-23-added-a-heads-up-explaining-google-s-app-not-verified-screen.md +1 -1
- package/corpus/templates/calendar/server/plugins/auth.ts +12 -0
- package/corpus/templates/clips/.agents/skills/recording/SKILL.md +7 -7
- package/corpus/templates/clips/AGENTS.md +6 -2
- package/corpus/templates/clips/app/components/capture-install-options.tsx +20 -4
- package/corpus/templates/clips/app/components/library/library-layout.tsx +7 -0
- package/corpus/templates/clips/app/components/player/player-controls.tsx +62 -32
- package/corpus/templates/clips/app/lib/capture-install-options.ts +39 -5
- package/corpus/templates/clips/app/routes/_app.settings._index.tsx +786 -323
- package/corpus/templates/clips/app/routes/download.tsx +2 -2
- package/corpus/templates/clips/app/routes/share.$shareId.tsx +1 -1
- package/corpus/templates/clips/changelog/2026-06-24-inline-slack-playback-controls-no-longer-shift-when-adjustin.md +6 -0
- package/corpus/templates/clips/changelog/2026-06-24-settings-now-puts-what-s-new-in-a-compact-sidebar-prioritize.md +6 -0
- package/corpus/templates/clips/changelog/2026-06-24-shared-clips-now-expose-their-full-console-log-stream-all-le.md +6 -0
- package/corpus/templates/clips/changelog/2026-06-24-shared-clips-now-expose-their-full-fetch-xhr-network-request.md +6 -0
- package/corpus/templates/clips/changelog/2026-06-24-the-chrome-extension-option-now-only-appears-on-supported-hosts.md +5 -0
- package/corpus/templates/clips/chrome-extension/STORE_DRAFT.md +13 -8
- package/corpus/templates/clips/chrome-extension/public/manifest.json +1 -1
- package/corpus/templates/clips/chrome-extension/scripts/package.ts +15 -2
- package/corpus/templates/clips/chrome-extension/src/overlay.css +4 -25
- package/corpus/templates/clips/chrome-extension/src/overlay.ts +1 -3
- package/corpus/templates/clips/server/lib/public-agent-context.ts +67 -24
- package/corpus/templates/mail/server/plugins/auth.ts +4 -1
- package/corpus/templates/plan/app/pages/PlansPage.tsx +271 -197
- package/corpus/templates/plan/changelog/2026-06-24-annotated-code-callouts-now-use-numbered-gutter-markers-that.md +6 -0
- package/corpus/templates/plan/server/plan-content.ts +45 -2
- package/dist/agent/durable-background.d.ts +9 -4
- package/dist/agent/durable-background.d.ts.map +1 -1
- package/dist/agent/durable-background.js +34 -11
- package/dist/agent/durable-background.js.map +1 -1
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +52 -8
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/cli/create.js +1 -1
- package/dist/cli/create.js.map +1 -1
- package/dist/cli/skills.d.ts.map +1 -1
- package/dist/cli/skills.js +361 -19
- package/dist/cli/skills.js.map +1 -1
- package/dist/client/ConnectBuilderCard.d.ts.map +1 -1
- package/dist/client/ConnectBuilderCard.js +6 -6
- package/dist/client/ConnectBuilderCard.js.map +1 -1
- package/dist/client/NewWorkspaceAppFlow.js +1 -1
- package/dist/client/NewWorkspaceAppFlow.js.map +1 -1
- package/dist/client/blocks/library/AnnotatedCodeBlock.d.ts.map +1 -1
- package/dist/client/blocks/library/AnnotatedCodeBlock.js +14 -10
- package/dist/client/blocks/library/AnnotatedCodeBlock.js.map +1 -1
- package/dist/client/blocks/library/annotation-rail.d.ts +3 -4
- package/dist/client/blocks/library/annotation-rail.d.ts.map +1 -1
- package/dist/client/blocks/library/annotation-rail.js +3 -4
- package/dist/client/blocks/library/annotation-rail.js.map +1 -1
- package/dist/client/components/CodeRequiredDialog.d.ts.map +1 -1
- package/dist/client/components/CodeRequiredDialog.js +2 -1
- package/dist/client/components/CodeRequiredDialog.js.map +1 -1
- package/dist/server/agent-chat-plugin.js +7 -7
- package/dist/server/agent-chat-plugin.js.map +1 -1
- package/dist/server/auth.d.ts +7 -0
- package/dist/server/auth.d.ts.map +1 -1
- package/dist/server/auth.js +1 -0
- package/dist/server/auth.js.map +1 -1
- package/dist/server/onboarding-html.d.ts +15 -0
- package/dist/server/onboarding-html.d.ts.map +1 -1
- package/dist/server/onboarding-html.js +73 -9
- package/dist/server/onboarding-html.js.map +1 -1
- package/dist/server/self-dispatch.d.ts.map +1 -1
- package/dist/server/self-dispatch.js +5 -1
- package/dist/server/self-dispatch.js.map +1 -1
- package/dist/templates/default/AGENTS.md +4 -0
- package/dist/templates/default/package.json +2 -1
- package/dist/templates/headless/AGENTS.md +4 -0
- package/dist/templates/headless/package.json +1 -0
- package/dist/templates/workspace-root/AGENTS.md +4 -0
- package/dist/templates/workspace-root/README.md +4 -0
- package/dist/templates/workspace-root/package.json +1 -0
- package/docs/content/skills-guide.md +14 -0
- package/docs/content/template-clips.md +7 -1
- package/package.json +1 -1
- package/src/templates/default/AGENTS.md +4 -0
- package/src/templates/default/package.json +2 -1
- package/src/templates/headless/AGENTS.md +4 -0
- package/src/templates/headless/package.json +1 -0
- package/src/templates/workspace-root/AGENTS.md +4 -0
- package/src/templates/workspace-root/README.md +4 -0
- package/src/templates/workspace-root/package.json +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeRequiredDialog.js","sourceRoot":"","sources":["../../../src/client/components/CodeRequiredDialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EACL,iBAAiB,EACjB,QAAQ,EACR,gBAAgB,EAChB,KAAK,EACL,WAAW,GACZ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,gCAAgC,EAAE,MAAM,iCAAiC,CAAC;AAEnF,MAAM,oBAAoB,GAAG,uCAAuC,CAAC;AASrE,SAAS,mBAAmB;IAC1B,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAClD,MAAM,CAAC,oBAAoB,EAAE,uBAAuB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACxE,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAC;IAElE,SAAS,CAAC,GAAG,EAAE;QACb,KAAK,CAAC,eAAe,CAAC,+BAA+B,CAAC,CAAC;aACpD,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;aACrC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE;YACb,IAAI,IAAI,EAAE,CAAC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AAM;QACf,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,QAAQ;KACzB;IACD,MAAM,EAAE;QACN,SAAS,EAAE,MAAM;QACjB,OAAO,EAAE,MAAM;QACf,YAAY,EAAE,KAAK;QACnB,MAAM,EAAE,qBAAqB;QAC7B,UAAU,EAAE,SAAS;QACrB,OAAO,EAAE,MAAM;QACf,aAAa,EAAE,QAAQ;QACvB,GAAG,EAAE,KAAK;KACX;IACD,UAAU,EAAE;QACV,QAAQ,EAAE,MAAM;QAChB,KAAK,EAAE,SAAS;QAChB,cAAc,EAAE,MAAM;QACtB,SAAS,EAAE,WAAW;KACvB;CACF,CAAC","sourcesContent":["import { useEffect, useCallback, useState } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport {\n IconPackageExport,\n IconCode,\n IconExternalLink,\n IconX,\n IconLoader2,\n} from \"@tabler/icons-react\";\nimport { agentNativePath } from \"../api-path.js\";\nimport { trackEvent } from \"../analytics.js\";\nimport { withBuilderConnectTrackingParams } from \"../settings/useBuilderStatus.js\";\n\nconst DESKTOP_DOWNLOAD_URL = \"https://www.agent-native.com/download\";\n\nexport interface CodeRequiredDialogProps {\n open: boolean;\n onClose: () => void;\n /** Label describing the feature that requires code changes */\n featureLabel?: string;\n}\n\nfunction useBuilderConnected() {\n const [connected, setConnected] = useState(false);\n const [cloudAgentsAvailable, setCloudAgentsAvailable] = useState(false);\n const [connectUrl, setConnectUrl] = useState<string | null>(null);\n\n useEffect(() => {\n fetch(agentNativePath(\"/_agent-native/builder/status\"))\n .then((r) => (r.ok ? r.json() : null))\n .then((data) => {\n if (data) {\n setConnected(!!data.configured);\n setCloudAgentsAvailable(!!data.builderEnabled);\n setConnectUrl(data.cliAuthUrl || data.connectUrl || null);\n }\n })\n .catch(() => {});\n }, []);\n\n return { connected, cloudAgentsAvailable, connectUrl };\n}\n\n/**\n * Modal shown when a user tries to use a code-requiring feature where local\n * source access is unavailable. Offers two paths: Agent Native Desktop or the\n * Builder.io agent.\n * Uses inline styles (no Radix/Tailwind dependency).\n */\nexport function CodeRequiredDialog({\n open,\n onClose,\n featureLabel,\n}: CodeRequiredDialogProps) {\n const {\n connected: builderConnected,\n cloudAgentsAvailable,\n connectUrl,\n } = useBuilderConnected();\n const [submitting, setSubmitting] = useState(false);\n const [branchUrl, setBranchUrl] = useState<string | null>(null);\n const [error, setError] = useState<string | null>(null);\n const builderHref = withBuilderConnectTrackingParams(\n connectUrl || agentNativePath(\"/_agent-native/builder/connect\"),\n { source: \"code_required_dialog\", flow: \"background_agent\" },\n );\n\n const handleKeyDown = useCallback(\n (e: KeyboardEvent) => {\n if (e.key === \"Escape\") onClose();\n },\n [onClose],\n );\n\n useEffect(() => {\n if (open) {\n document.addEventListener(\"keydown\", handleKeyDown);\n return () => document.removeEventListener(\"keydown\", handleKeyDown);\n }\n }, [open, handleKeyDown]);\n\n useEffect(() => {\n if (open) {\n setSubmitting(false);\n setBranchUrl(null);\n setError(null);\n }\n }, [open]);\n\n const handleBuilderAgent = async () => {\n if (!builderConnected) {\n // Open settings tab\n window.dispatchEvent(new Event(\"agent-panel:open-settings\"));\n onClose();\n return;\n }\n\n setSubmitting(true);\n setError(null);\n try {\n const res = await fetch(\n agentNativePath(\"/_agent-native/builder/agents-run\"),\n {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n userMessage:\n featureLabel || \"Make the requested code changes to this app\",\n }),\n },\n );\n if (!res.ok) {\n const body = await res.json().catch(() => ({}));\n throw new Error(body?.error || `Failed (${res.status})`);\n }\n const data = await res.json();\n setBranchUrl(data.url || null);\n } catch (err: any) {\n setError(err?.message || \"Failed to create branch\");\n } finally {\n setSubmitting(false);\n }\n };\n\n if (!open || typeof document === \"undefined\") return null;\n\n return createPortal(\n <div style={s.backdrop} onClick={onClose}>\n <div\n style={s.dialog}\n onClick={(e) => e.stopPropagation()}\n role=\"dialog\"\n aria-modal=\"true\"\n >\n {/* Header */}\n <div style={s.header}>\n <div style={s.iconWrap}>\n <IconPackageExport size={20} />\n </div>\n <div>\n <h2 style={s.title}>Code changes required</h2>\n <p style={s.subtitle}>\n {featureLabel\n ? `\"${featureLabel}\" creates or modifies source code, which needs Desktop or Builder from this surface.`\n : \"This action creates or modifies source code, which needs Desktop or Builder from this surface.\"}\n </p>\n </div>\n </div>\n\n {/* Options */}\n <div style={s.options}>\n <a\n href={DESKTOP_DOWNLOAD_URL}\n target=\"_blank\"\n rel=\"noreferrer\"\n style={{ ...s.optionCard, ...s.optionLink }}\n onMouseEnter={(e) =>\n Object.assign(e.currentTarget.style, s.optionCardHover)\n }\n onMouseLeave={(e) =>\n Object.assign(e.currentTarget.style, { borderColor: \"#e5e7eb\" })\n }\n >\n <div style={s.optionIcon}>\n <IconCode size={24} />\n </div>\n <div style={s.optionText}>\n <span style={s.optionTitle}>Use Agent Native Desktop</span>\n <span style={s.optionDesc}>\n Open the project in the desktop app to enable source edits and\n CLI access.\n </span>\n </div>\n </a>\n\n {builderConnected && cloudAgentsAvailable ? (\n <button\n style={{\n ...s.optionCard,\n ...(submitting\n ? { opacity: 0.7, pointerEvents: \"none\" as const }\n : {}),\n }}\n onMouseEnter={(e) =>\n Object.assign(e.currentTarget.style, s.optionCardHover)\n }\n onMouseLeave={(e) =>\n Object.assign(e.currentTarget.style, { borderColor: \"#e5e7eb\" })\n }\n onClick={handleBuilderAgent}\n >\n <div style={s.optionIcon}>\n {submitting ? (\n <IconLoader2\n size={24}\n style={{ animation: \"spin 1s linear infinite\" }}\n />\n ) : (\n <IconExternalLink size={24} />\n )}\n </div>\n <div style={s.optionText}>\n <span style={s.optionTitle}>Use Builder.io Agent</span>\n <span style={s.optionDesc}>\n Let our cloud agent make the changes for you. You'll get a\n link to preview and deploy.\n </span>\n </div>\n </button>\n ) : builderConnected ? (\n <div\n style={{\n ...s.optionCard,\n cursor: \"default\",\n opacity: 0.85,\n }}\n >\n <div style={s.optionIcon}>\n <IconExternalLink size={24} />\n </div>\n <div style={s.optionText}>\n <span style={s.optionTitle}>\n Builder Cloud Agents coming soon\n </span>\n <span style={s.optionDesc}>\n You don't have access yet. Use the desktop app or your local\n clone for this code change.\n </span>\n </div>\n <span style={s.badge}>Coming soon</span>\n </div>\n ) : (\n <a\n href={builderHref}\n target=\"_blank\"\n rel=\"noreferrer\"\n onClick={() => {\n trackEvent(\"builder connect clicked\", {\n feature: \"builder\",\n stage: \"client\",\n source: \"code_required_dialog\",\n flow: \"background_agent\",\n connect_url_kind: connectUrl ? \"provided\" : \"default\",\n });\n }}\n style={{ ...s.optionCard, ...s.optionLink }}\n onMouseEnter={(e) =>\n Object.assign(e.currentTarget.style, s.optionCardHover)\n }\n onMouseLeave={(e) =>\n Object.assign(e.currentTarget.style, {\n borderColor: \"#e5e7eb\",\n })\n }\n >\n <div style={s.optionIcon}>\n <IconExternalLink size={24} />\n </div>\n <div style={s.optionText}>\n <span style={s.optionTitle}>Connect Builder.io</span>\n <span style={s.optionDesc}>\n Connect Builder to enable cloud-based code changes from this\n app.\n </span>\n </div>\n {!connectUrl && <span style={s.badge}>Setup required</span>}\n </a>\n )}\n </div>\n\n {/* Branch result */}\n {branchUrl && (\n <div style={s.result}>\n <span style={{ fontSize: 13, fontWeight: 600 }}>\n Branch created\n </span>\n <a\n href={branchUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n style={s.resultLink}\n >\n {branchUrl}\n </a>\n </div>\n )}\n\n {error && (\n <p style={{ color: \"#ef4444\", fontSize: 12, marginTop: 12 }}>\n {error}\n </p>\n )}\n\n {/* Close */}\n <button style={s.closeButton} onClick={onClose} aria-label=\"Close\">\n <IconX size={16} />\n </button>\n </div>\n </div>,\n document.body,\n );\n}\n\nconst s: Record<string, React.CSSProperties> = {\n backdrop: {\n position: \"fixed\",\n inset: 0,\n background: \"rgba(0, 0, 0, 0.5)\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n zIndex: 99999,\n padding: \"16px\",\n },\n dialog: {\n position: \"relative\",\n background: \"#fff\",\n borderRadius: \"12px\",\n maxWidth: \"460px\",\n width: \"100%\",\n padding: \"24px\",\n boxShadow:\n \"0 20px 25px -5px rgba(0,0,0,.1), 0 8px 10px -6px rgba(0,0,0,.1)\",\n fontFamily:\n '-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif',\n color: \"#111827\",\n },\n header: {\n display: \"flex\",\n gap: \"14px\",\n alignItems: \"flex-start\",\n marginBottom: \"20px\",\n },\n iconWrap: {\n flexShrink: 0,\n width: \"40px\",\n height: \"40px\",\n borderRadius: \"10px\",\n background: \"#f3f4f6\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n color: \"#6b7280\",\n },\n title: {\n margin: 0,\n fontSize: \"16px\",\n fontWeight: 600,\n lineHeight: \"1.4\",\n },\n subtitle: {\n margin: \"4px 0 0\",\n fontSize: \"13px\",\n color: \"#6b7280\",\n lineHeight: \"1.5\",\n },\n options: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"10px\",\n },\n optionCard: {\n position: \"relative\",\n display: \"flex\",\n alignItems: \"flex-start\",\n gap: \"14px\",\n padding: \"14px\",\n border: \"1px solid #e5e7eb\",\n borderRadius: \"10px\",\n background: \"transparent\",\n cursor: \"pointer\",\n textAlign: \"left\",\n width: \"100%\",\n fontSize: \"inherit\",\n fontFamily: \"inherit\",\n color: \"inherit\",\n },\n optionCardHover: {\n borderColor: \"#a5b4fc\",\n },\n optionLink: {\n textDecoration: \"none\",\n boxSizing: \"border-box\",\n },\n optionIcon: {\n flexShrink: 0,\n color: \"#00B5FF\",\n marginTop: \"2px\",\n },\n optionText: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"2px\",\n },\n optionTitle: {\n fontSize: \"14px\",\n fontWeight: 600,\n },\n optionDesc: {\n fontSize: \"12px\",\n color: \"#6b7280\",\n lineHeight: \"1.5\",\n },\n badge: {\n position: \"absolute\",\n top: \"10px\",\n right: \"10px\",\n fontSize: \"10px\",\n fontWeight: 600,\n color: \"#00B5FF\",\n background: \"#e0f2fe\",\n padding: \"2px 8px\",\n borderRadius: \"99px\",\n textTransform: \"uppercase\",\n letterSpacing: \"0.5px\",\n },\n closeButton: {\n position: \"absolute\",\n top: \"12px\",\n right: \"12px\",\n background: \"transparent\",\n border: \"none\",\n cursor: \"pointer\",\n padding: \"6px\",\n borderRadius: \"6px\",\n color: \"#9ca3af\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n },\n result: {\n marginTop: \"16px\",\n padding: \"12px\",\n borderRadius: \"8px\",\n border: \"1px solid #22c55e40\",\n background: \"#f0fdf4\",\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"4px\",\n },\n resultLink: {\n fontSize: \"12px\",\n color: \"#00B5FF\",\n textDecoration: \"none\",\n wordBreak: \"break-all\",\n },\n};\n"]}
|
|
1
|
+
{"version":3,"file":"CodeRequiredDialog.js","sourceRoot":"","sources":["../../../src/client/components/CodeRequiredDialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EACL,iBAAiB,EACjB,QAAQ,EACR,gBAAgB,EAChB,KAAK,EACL,WAAW,GACZ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,gCAAgC,EAAE,MAAM,iCAAiC,CAAC;AAEnF,MAAM,oBAAoB,GAAG,uCAAuC,CAAC;AACrE,MAAM,2BAA2B,GAC/B,kHAAkH,CAAC;AASrH,SAAS,mBAAmB;IAC1B,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAClD,MAAM,CAAC,oBAAoB,EAAE,uBAAuB,CAAC,GAAG,QAAQ,CAAC,KAAK,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EAAE,GAAG;QACf,KAAK,EAAE,SAAS;QAChB,UAAU,EAAE,SAAS;QACrB,OAAO,EAAE,SAAS;QAClB,YAAY,EAAE,MAAM;QACpB,aAAa,EAAE,WAAW;QAC1B,aAAa,EAAE,OAAO;KACvB;IACD,WAAW,EAAE;QACX,QAAQ,EAAE,UAAU;QACpB,GAAG,EAAE,MAAM;QACX,KAAK,EAAE,MAAM;QACb,UAAU,EAAE,aAAa;QACzB,MAAM,EAAE,MAAM;QACd,MAAM,EAAE,SAAS;QACjB,OAAO,EAAE,KAAK;QACd,YAAY,EAAE,KAAK;QACnB,KAAK,EAAE,SAAS;QAChB,OAAO,EAAE,MAAM;QACf,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,QAAQ;KACzB;IACD,MAAM,EAAE;QACN,SAAS,EAAE,MAAM;QACjB,OAAO,EAAE,MAAM;QACf,YAAY,EAAE,KAAK;QACnB,MAAM,EAAE,qBAAqB;QAC7B,UAAU,EAAE,SAAS;QACrB,OAAO,EAAE,MAAM;QACf,aAAa,EAAE,QAAQ;QACvB,GAAG,EAAE,KAAK;KACX;IACD,UAAU,EAAE;QACV,QAAQ,EAAE,MAAM;QAChB,KAAK,EAAE,SAAS;QAChB,cAAc,EAAE,MAAM;QACtB,SAAS,EAAE,WAAW;KACvB;CACF,CAAC","sourcesContent":["import { useEffect, useCallback, useState } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport {\n IconPackageExport,\n IconCode,\n IconExternalLink,\n IconX,\n IconLoader2,\n} from \"@tabler/icons-react\";\nimport { agentNativePath } from \"../api-path.js\";\nimport { trackEvent } from \"../analytics.js\";\nimport { withBuilderConnectTrackingParams } from \"../settings/useBuilderStatus.js\";\n\nconst DESKTOP_DOWNLOAD_URL = \"https://www.agent-native.com/download\";\nconst CODE_CHANGE_FALLBACK_DETAIL =\n \"Edit locally or use Builder.io to edit this code in the cloud and continue customizing the app any way you like.\";\n\nexport interface CodeRequiredDialogProps {\n open: boolean;\n onClose: () => void;\n /** Label describing the feature that requires code changes */\n featureLabel?: string;\n}\n\nfunction useBuilderConnected() {\n const [connected, setConnected] = useState(false);\n const [cloudAgentsAvailable, setCloudAgentsAvailable] = useState(false);\n const [connectUrl, setConnectUrl] = useState<string | null>(null);\n\n useEffect(() => {\n fetch(agentNativePath(\"/_agent-native/builder/status\"))\n .then((r) => (r.ok ? r.json() : null))\n .then((data) => {\n if (data) {\n setConnected(!!data.configured);\n setCloudAgentsAvailable(!!data.builderEnabled);\n setConnectUrl(data.cliAuthUrl || data.connectUrl || null);\n }\n })\n .catch(() => {});\n }, []);\n\n return { connected, cloudAgentsAvailable, connectUrl };\n}\n\n/**\n * Modal shown when a user tries to use a code-requiring feature where local\n * source access is unavailable. Offers two paths: Agent Native Desktop or the\n * Builder.io agent.\n * Uses inline styles (no Radix/Tailwind dependency).\n */\nexport function CodeRequiredDialog({\n open,\n onClose,\n featureLabel,\n}: CodeRequiredDialogProps) {\n const {\n connected: builderConnected,\n cloudAgentsAvailable,\n connectUrl,\n } = useBuilderConnected();\n const [submitting, setSubmitting] = useState(false);\n const [branchUrl, setBranchUrl] = useState<string | null>(null);\n const [error, setError] = useState<string | null>(null);\n const builderHref = withBuilderConnectTrackingParams(\n connectUrl || agentNativePath(\"/_agent-native/builder/connect\"),\n { source: \"code_required_dialog\", flow: \"background_agent\" },\n );\n\n const handleKeyDown = useCallback(\n (e: KeyboardEvent) => {\n if (e.key === \"Escape\") onClose();\n },\n [onClose],\n );\n\n useEffect(() => {\n if (open) {\n document.addEventListener(\"keydown\", handleKeyDown);\n return () => document.removeEventListener(\"keydown\", handleKeyDown);\n }\n }, [open, handleKeyDown]);\n\n useEffect(() => {\n if (open) {\n setSubmitting(false);\n setBranchUrl(null);\n setError(null);\n }\n }, [open]);\n\n const handleBuilderAgent = async () => {\n if (!builderConnected) {\n // Open settings tab\n window.dispatchEvent(new Event(\"agent-panel:open-settings\"));\n onClose();\n return;\n }\n\n setSubmitting(true);\n setError(null);\n try {\n const res = await fetch(\n agentNativePath(\"/_agent-native/builder/agents-run\"),\n {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n userMessage:\n featureLabel || \"Make the requested code changes to this app\",\n }),\n },\n );\n if (!res.ok) {\n const body = await res.json().catch(() => ({}));\n throw new Error(body?.error || `Failed (${res.status})`);\n }\n const data = await res.json();\n setBranchUrl(data.url || null);\n } catch (err: any) {\n setError(err?.message || \"Failed to create branch\");\n } finally {\n setSubmitting(false);\n }\n };\n\n if (!open || typeof document === \"undefined\") return null;\n\n return createPortal(\n <div style={s.backdrop} onClick={onClose}>\n <div\n style={s.dialog}\n onClick={(e) => e.stopPropagation()}\n role=\"dialog\"\n aria-modal=\"true\"\n >\n {/* Header */}\n <div style={s.header}>\n <div style={s.iconWrap}>\n <IconPackageExport size={20} />\n </div>\n <div>\n <h2 style={s.title}>Code changes required</h2>\n <p style={s.subtitle}>\n {featureLabel\n ? `\"${featureLabel}\" creates or modifies source code, which needs Desktop or Builder from this surface.`\n : \"This action creates or modifies source code, which needs Desktop or Builder from this surface.\"}\n </p>\n </div>\n </div>\n\n {/* Options */}\n <div style={s.options}>\n <a\n href={DESKTOP_DOWNLOAD_URL}\n target=\"_blank\"\n rel=\"noreferrer\"\n style={{ ...s.optionCard, ...s.optionLink }}\n onMouseEnter={(e) =>\n Object.assign(e.currentTarget.style, s.optionCardHover)\n }\n onMouseLeave={(e) =>\n Object.assign(e.currentTarget.style, { borderColor: \"#e5e7eb\" })\n }\n >\n <div style={s.optionIcon}>\n <IconCode size={24} />\n </div>\n <div style={s.optionText}>\n <span style={s.optionTitle}>Use Agent Native Desktop</span>\n <span style={s.optionDesc}>\n Open the project in the desktop app to enable source edits and\n CLI access.\n </span>\n </div>\n </a>\n\n {builderConnected && cloudAgentsAvailable ? (\n <button\n style={{\n ...s.optionCard,\n ...(submitting\n ? { opacity: 0.7, pointerEvents: \"none\" as const }\n : {}),\n }}\n onMouseEnter={(e) =>\n Object.assign(e.currentTarget.style, s.optionCardHover)\n }\n onMouseLeave={(e) =>\n Object.assign(e.currentTarget.style, { borderColor: \"#e5e7eb\" })\n }\n onClick={handleBuilderAgent}\n >\n <div style={s.optionIcon}>\n {submitting ? (\n <IconLoader2\n size={24}\n style={{ animation: \"spin 1s linear infinite\" }}\n />\n ) : (\n <IconExternalLink size={24} />\n )}\n </div>\n <div style={s.optionText}>\n <span style={s.optionTitle}>Use Builder.io Agent</span>\n <span style={s.optionDesc}>\n Let our cloud agent make the changes for you. You'll get a\n link to preview and deploy.\n </span>\n </div>\n </button>\n ) : builderConnected ? (\n <div\n style={{\n ...s.optionCard,\n cursor: \"default\",\n opacity: 0.85,\n }}\n >\n <div style={s.optionIcon}>\n <IconExternalLink size={24} />\n </div>\n <div style={s.optionText}>\n <span style={s.optionTitle}>This requires a code change</span>\n <span style={s.optionDesc}>{CODE_CHANGE_FALLBACK_DETAIL}</span>\n </div>\n <span style={s.badge}>Code change</span>\n </div>\n ) : (\n <a\n href={builderHref}\n target=\"_blank\"\n rel=\"noreferrer\"\n onClick={() => {\n trackEvent(\"builder connect clicked\", {\n feature: \"builder\",\n stage: \"client\",\n source: \"code_required_dialog\",\n flow: \"background_agent\",\n connect_url_kind: connectUrl ? \"provided\" : \"default\",\n });\n }}\n style={{ ...s.optionCard, ...s.optionLink }}\n onMouseEnter={(e) =>\n Object.assign(e.currentTarget.style, s.optionCardHover)\n }\n onMouseLeave={(e) =>\n Object.assign(e.currentTarget.style, {\n borderColor: \"#e5e7eb\",\n })\n }\n >\n <div style={s.optionIcon}>\n <IconExternalLink size={24} />\n </div>\n <div style={s.optionText}>\n <span style={s.optionTitle}>Connect Builder.io</span>\n <span style={s.optionDesc}>\n Connect Builder to enable cloud-based code changes from this\n app.\n </span>\n </div>\n {!connectUrl && <span style={s.badge}>Setup required</span>}\n </a>\n )}\n </div>\n\n {/* Branch result */}\n {branchUrl && (\n <div style={s.result}>\n <span style={{ fontSize: 13, fontWeight: 600 }}>\n Branch created\n </span>\n <a\n href={branchUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n style={s.resultLink}\n >\n {branchUrl}\n </a>\n </div>\n )}\n\n {error && (\n <p style={{ color: \"#ef4444\", fontSize: 12, marginTop: 12 }}>\n {error}\n </p>\n )}\n\n {/* Close */}\n <button style={s.closeButton} onClick={onClose} aria-label=\"Close\">\n <IconX size={16} />\n </button>\n </div>\n </div>,\n document.body,\n );\n}\n\nconst s: Record<string, React.CSSProperties> = {\n backdrop: {\n position: \"fixed\",\n inset: 0,\n background: \"rgba(0, 0, 0, 0.5)\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n zIndex: 99999,\n padding: \"16px\",\n },\n dialog: {\n position: \"relative\",\n background: \"#fff\",\n borderRadius: \"12px\",\n maxWidth: \"460px\",\n width: \"100%\",\n padding: \"24px\",\n boxShadow:\n \"0 20px 25px -5px rgba(0,0,0,.1), 0 8px 10px -6px rgba(0,0,0,.1)\",\n fontFamily:\n '-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif',\n color: \"#111827\",\n },\n header: {\n display: \"flex\",\n gap: \"14px\",\n alignItems: \"flex-start\",\n marginBottom: \"20px\",\n },\n iconWrap: {\n flexShrink: 0,\n width: \"40px\",\n height: \"40px\",\n borderRadius: \"10px\",\n background: \"#f3f4f6\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n color: \"#6b7280\",\n },\n title: {\n margin: 0,\n fontSize: \"16px\",\n fontWeight: 600,\n lineHeight: \"1.4\",\n },\n subtitle: {\n margin: \"4px 0 0\",\n fontSize: \"13px\",\n color: \"#6b7280\",\n lineHeight: \"1.5\",\n },\n options: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"10px\",\n },\n optionCard: {\n position: \"relative\",\n display: \"flex\",\n alignItems: \"flex-start\",\n gap: \"14px\",\n padding: \"14px\",\n border: \"1px solid #e5e7eb\",\n borderRadius: \"10px\",\n background: \"transparent\",\n cursor: \"pointer\",\n textAlign: \"left\",\n width: \"100%\",\n fontSize: \"inherit\",\n fontFamily: \"inherit\",\n color: \"inherit\",\n },\n optionCardHover: {\n borderColor: \"#a5b4fc\",\n },\n optionLink: {\n textDecoration: \"none\",\n boxSizing: \"border-box\",\n },\n optionIcon: {\n flexShrink: 0,\n color: \"#00B5FF\",\n marginTop: \"2px\",\n },\n optionText: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"2px\",\n },\n optionTitle: {\n fontSize: \"14px\",\n fontWeight: 600,\n },\n optionDesc: {\n fontSize: \"12px\",\n color: \"#6b7280\",\n lineHeight: \"1.5\",\n },\n badge: {\n position: \"absolute\",\n top: \"10px\",\n right: \"10px\",\n fontSize: \"10px\",\n fontWeight: 600,\n color: \"#00B5FF\",\n background: \"#e0f2fe\",\n padding: \"2px 8px\",\n borderRadius: \"99px\",\n textTransform: \"uppercase\",\n letterSpacing: \"0.5px\",\n },\n closeButton: {\n position: \"absolute\",\n top: \"12px\",\n right: \"12px\",\n background: \"transparent\",\n border: \"none\",\n cursor: \"pointer\",\n padding: \"6px\",\n borderRadius: \"6px\",\n color: \"#9ca3af\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n },\n result: {\n marginTop: \"16px\",\n padding: \"12px\",\n borderRadius: \"8px\",\n border: \"1px solid #22c55e40\",\n background: \"#f0fdf4\",\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"4px\",\n },\n resultLink: {\n fontSize: \"12px\",\n color: \"#00B5FF\",\n textDecoration: \"none\",\n wordBreak: \"break-all\",\n },\n};\n"]}
|
|
@@ -1553,7 +1553,7 @@ function createBuilderBrowserTool(deps) {
|
|
|
1553
1553
|
const entries = {
|
|
1554
1554
|
"connect-builder": {
|
|
1555
1555
|
tool: {
|
|
1556
|
-
description: `Render a Builder.io card inline in the chat. Call this as the first step (no code exploration or planning needed) when the user asks to modify the APP'S OWN SOURCE CODE: add a feature, change the UI chrome, edit a React component, add a route, add an integration, fix a bug in the app itself, or anything else that requires source-file edits while in hosted/production mode. ${extensionRequestGuidance}Do NOT call this for content the app is meant to produce — creating a video, generating a design, drafting an email, building a slide deck, making a dashboard, etc. — those run through the app's own domain actions, not Builder. Do NOT mention 'click Send to Builder' in your response unless this card is already in the conversation. If Builder is connected and Builder Cloud Agents are available, the card shows a 'Send to Builder' button that hands the work off to Builder's cloud agent and returns a branch URL. If \`builderEnabled\` is false, the card shows
|
|
1556
|
+
description: `Render a Builder.io card inline in the chat. Call this as the first step (no code exploration or planning needed) when the user asks to modify the APP'S OWN SOURCE CODE: add a feature, change the UI chrome, edit a React component, add a route, add an integration, fix a bug in the app itself, or anything else that requires source-file edits while in hosted/production mode. ${extensionRequestGuidance}Do NOT call this for content the app is meant to produce — creating a video, generating a design, drafting an email, building a slide deck, making a dashboard, etc. — those run through the app's own domain actions, not Builder. Do NOT mention 'click Send to Builder' in your response unless this card is already in the conversation. The tool result includes \`builderEnabled\`; treat \`true\` as "Builder Cloud Agents can take the code-change handoff" and \`false\` as "this still needs a code change, but no Builder Cloud Agent can run here." If Builder is connected and Builder Cloud Agents are available, the card shows a 'Send to Builder' button that hands the work off to Builder's cloud agent and returns a branch URL. If \`builderEnabled\` is false, the card still renders but shows the code-change fallback: "This requires a code change. Edit locally or use Builder.io to edit this code in the cloud and continue customizing the app any way you like." Never tell the user to enable Builder Cloud Agents in Builder org settings or beta settings, and do not claim the Builder card has everything, is pre-loaded for handoff, or can run the cloud agent when \`builderEnabled\` is false. When you call this for a code-change request, pass the user's request verbatim as the \`prompt\` arg so the card can forward it to Builder unchanged when cloud agents are available.`,
|
|
1557
1557
|
parameters: {
|
|
1558
1558
|
type: "object",
|
|
1559
1559
|
properties: {
|
|
@@ -2035,7 +2035,7 @@ If the user says yes, call \`manage-jobs\` (action: "create") with the original
|
|
|
2035
2035
|
Do NOT add this offer for one-shot work: lookups (find Alice, what's the schema, who reported X), single drafts/replies, navigation requests, or any task whose value is in the moment. Skip it when the prompt is already explicitly recurring (the user said "every morning…" — you'd be asking what they already told you). One short sentence at most; do not turn it into a list of cadence options.`,
|
|
2036
2036
|
builder: `### Connecting Builder.io
|
|
2037
2037
|
|
|
2038
|
-
When the user asks to connect Builder.io or you hit a "Builder not configured" error, call the \`connect-builder\` tool. It renders a
|
|
2038
|
+
When the user asks to connect Builder.io or you hit a "Builder not configured" error, call the \`connect-builder\` tool. It renders a Connect/code-change card inline — do NOT write out multi-step setup instructions yourself. Inspect the returned \`builderEnabled\` flag: \`true\` means Builder Cloud Agents can take the code-change handoff, while \`false\` means this requires a code change and the user should edit locally or use Builder.io to edit this code in the cloud and continue customizing the app any way they like. If Builder Cloud Agents are not available for this workspace, never send the user to Builder org settings or beta settings.`,
|
|
2039
2039
|
browser: `### Browser Automation
|
|
2040
2040
|
|
|
2041
2041
|
You can activate a real Chrome browser via Builder.io for tasks that need full page rendering:
|
|
@@ -2207,14 +2207,14 @@ ${extensionConnectBuilderGuard}
|
|
|
2207
2207
|
In Act mode, when the user asks you to change the UI, modify code, add a feature, fix a bug in the app itself, change styles, add a hook, create a component, add a route, add an integration, or anything else that requires editing source files — you MUST take exactly these steps, in order:
|
|
2208
2208
|
|
|
2209
2209
|
1. Briefly acknowledge the user's specific request in their own terms — one short clause naming what they asked for (e.g. "Got it — wider subject lines in the email list."). Do NOT restate the request verbatim, do NOT add a generic preamble, and do NOT promise outcomes. Skip this step entirely if the user already knows you're handing off (e.g. they said "send this to Builder").
|
|
2210
|
-
2. Call the \`connect-builder\` tool, passing the user's full request verbatim as the \`prompt\` argument. This renders an inline card. If Builder is connected and \`builderEnabled\` is true, the card hands the prompt off to Builder's cloud agent on one click and returns a branch URL. If Builder is not connected, it shows the Connect Builder flow. If \`builderEnabled\` is false, it shows a
|
|
2211
|
-
3. After the card renders, inspect the tool result and write one sentence that frames the next click around what the user just asked — not as a Builder pitch.
|
|
2210
|
+
2. Call the \`connect-builder\` tool, passing the user's full request verbatim as the \`prompt\` argument. This renders an inline card. The returned \`builderEnabled\` flag is authoritative: \`true\` means Builder Cloud Agents can take the code-change handoff; \`false\` means this still requires a code change, but no Builder Cloud Agent can run from this workspace. If Builder is connected and \`builderEnabled\` is true, the card hands the prompt off to Builder's cloud agent on one click and returns a branch URL. If Builder is not connected and \`builderEnabled\` is true, it shows the Connect Builder flow. If \`builderEnabled\` is false, it still shows the card, but as a code-change fallback instead of a runnable cloud handoff.
|
|
2211
|
+
3. After the card renders, inspect the tool result and write one sentence that frames the next click around what the user just asked — not as a Builder pitch. If \`builderEnabled\` is true and the card can send, say something like "Click Send to Builder and it'll wire that up for you." If the user needs to connect first, say something like "Connect Builder once and it'll handle this and future changes." If \`builderEnabled\` is false, say: "This requires a code change. Edit locally or use Builder.io to edit this code in the cloud and continue customizing the app any way you like." Do NOT say "click Send to Builder", mention a branch URL, say the card is pre-loaded, or imply a Builder Cloud Agent can run when \`builderEnabled\` is false.
|
|
2212
2212
|
|
|
2213
|
-
When \`builderEnabled\` is false, Builder Cloud Agents are not self-serve from Builder org settings. Do NOT tell the user to go to Builder org settings, beta features, "Cloud Agents", or "AI Agents" to enable them. The only allowed guidance is the card's
|
|
2213
|
+
When \`builderEnabled\` is false, Builder Cloud Agents are not self-serve from Builder org settings. Do NOT tell the user to go to Builder org settings, beta features, "Cloud Agents", or "AI Agents" to enable them. The only allowed guidance is the card's code-change fallback: edit locally, use Agent Native Desktop, or use Builder.io to edit this code in the cloud and continue customizing the app any way you like.
|
|
2214
2214
|
|
|
2215
2215
|
**Act-mode handoff — do exactly this:** The moment a code change is requested, call \`connect-builder\` with the user's verbatim request, then write one sentence framing the next click. That is the whole job: Builder plans and edits in its own sandbox, so the planning, file-mapping, and code all happen there, not here. Keep your turn to the call plus that one sentence — skip code exploration, implementation plans, \`resources\` writes of specs, and sub-agents (they have no code-editing tools either). You don't need filesystem access to recommend Builder, so don't reach for it or list tools you lack.
|
|
2216
2216
|
|
|
2217
|
-
Builder Cloud Agents are the recommended path when
|
|
2217
|
+
Builder Cloud Agents are the recommended path when \`builderEnabled\` is true because they are one-click and run in the cloud. Local dev, Agent Native Desktop, and Builder.io cloud editing are the fallback when \`builderEnabled\` is false.
|
|
2218
2218
|
${FRAMEWORK_CORE}`;
|
|
2219
2219
|
const DEV_FRAMEWORK_PROMPT = `## Agent-Native Framework — Development Mode
|
|
2220
2220
|
|
|
@@ -2254,7 +2254,7 @@ ${extensionInstructionsCompact}
|
|
|
2254
2254
|
|
|
2255
2255
|
### Code Changes — Call \`connect-builder\`
|
|
2256
2256
|
|
|
2257
|
-
In Act mode, when a request genuinely needs a source-code edit (per the rules above), do this in order: (1) briefly acknowledge the user's specific ask in their own terms — one short clause, no preamble — then (2) call \`connect-builder\` with the user's request as the \`prompt\`, then (3) write one sentence framing the next click around what they asked for, not a Builder pitch. Do NOT write code, list files, make plans, or spawn sub-agents. Mention \`npx agent-native create <app-name>\`, Agent Native Desktop, or the
|
|
2257
|
+
In Act mode, when a request genuinely needs a source-code edit (per the rules above), do this in order: (1) briefly acknowledge the user's specific ask in their own terms — one short clause, no preamble — then (2) call \`connect-builder\` with the user's request as the \`prompt\`, then (3) inspect \`builderEnabled\` in the result and write one sentence framing the next click around what they asked for, not a Builder pitch. When \`builderEnabled\` is true, Builder Cloud Agents can take the handoff; when \`builderEnabled\` is false, say this requires a code change and they can edit locally or use Builder.io to edit this code in the cloud and continue customizing the app any way they like. Do NOT write code, list files, make plans, or spawn sub-agents. Mention \`npx agent-native create <app-name>\`, Agent Native Desktop, or the code-change fallback when Builder Cloud Agents aren't available. Never tell users to enable Builder Cloud Agents from Builder org settings, beta features, "Cloud Agents", or "AI Agents"; they are not self-serve there.
|
|
2258
2258
|
${FRAMEWORK_CORE_COMPACT}`;
|
|
2259
2259
|
const DEV_FRAMEWORK_PROMPT_COMPACT = `## Agent-Native Framework — Development Mode
|
|
2260
2260
|
|