@agent-native/core 0.72.3 → 0.73.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 +38 -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 +6 -6
- package/corpus/core/src/a2a/client.ts +7 -3
- package/corpus/core/src/agent/durable-background.ts +25 -12
- package/corpus/core/src/cli/create.ts +1 -1
- package/corpus/core/src/cli/skills.ts +450 -19
- package/corpus/core/src/client/api-path.ts +28 -0
- package/corpus/core/src/client/embed-auth.ts +26 -0
- package/corpus/core/src/client/mcp-app-host.ts +6 -0
- package/corpus/core/src/client/mcp-apps/McpAppRenderer.tsx +227 -33
- package/corpus/core/src/client/resources/use-mcp-servers.ts +1 -0
- package/corpus/core/src/client/settings/DemoModeSection.tsx +3 -1
- package/corpus/core/src/demo/fetch-interceptor.ts +1 -1
- package/corpus/core/src/embedding/agent.ts +6 -1
- package/corpus/core/src/embedding/bridge.ts +34 -1
- package/corpus/core/src/mcp/build-server.ts +38 -10
- package/corpus/core/src/mcp/embed-app.ts +120 -45
- package/corpus/core/src/mcp/index.ts +5 -0
- package/corpus/core/src/mcp/org-directory.ts +70 -11
- package/corpus/core/src/mcp/server.ts +14 -0
- package/corpus/core/src/mcp-client/config.ts +12 -0
- package/corpus/core/src/mcp-client/index.ts +2 -0
- package/corpus/core/src/mcp-client/manager.ts +268 -9
- package/corpus/core/src/mcp-client/remote-store.ts +154 -0
- package/corpus/core/src/mcp-client/routes.ts +2 -0
- package/corpus/core/src/server/agent-chat-plugin.ts +8 -0
- package/corpus/core/src/server/auth.ts +7 -0
- package/corpus/core/src/server/index.ts +1 -0
- package/corpus/core/src/server/onboarding-html.ts +95 -9
- package/corpus/core/src/shared/mcp-embed-headers.ts +44 -3
- 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/core/src/vite/client.ts +53 -0
- package/corpus/templates/analytics/actions/update-dashboard.ts +3 -4
- package/corpus/templates/analytics/app/components/dashboard/SqlChart.tsx +144 -40
- 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-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 +256 -44
- 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 +287 -42
- package/corpus/templates/assets/.agents/skills/a2a-assets/SKILL.md +17 -10
- package/corpus/templates/assets/.agents/skills/asset-generation/SKILL.md +15 -6
- package/corpus/templates/assets/AGENTS.md +7 -5
- package/corpus/templates/assets/actions/generate-asset.ts +161 -0
- package/corpus/templates/assets/actions/list-assets.ts +4 -2
- package/corpus/templates/assets/actions/open-asset-picker.ts +84 -3
- package/corpus/templates/assets/app/routes/library.tsx +243 -40
- 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/player/player-controls.tsx +62 -32
- package/corpus/templates/clips/app/lib/capture-install-options.ts +39 -5
- 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-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/desktop/src-tauri/src/native_speech.rs +9 -0
- package/corpus/templates/clips/server/lib/public-agent-context.ts +67 -24
- package/corpus/templates/design/AGENTS.md +10 -5
- package/corpus/templates/design/actions/connect-assets-mcp.ts +131 -0
- package/corpus/templates/design/actions/insert-asset.ts +219 -0
- package/corpus/templates/design/actions/view-screen.ts +3 -1
- package/corpus/templates/design/app/components/editor/PromptDialog.tsx +1 -1
- package/corpus/templates/design/app/pages/DesignEditor.tsx +53 -0
- package/corpus/templates/design/server/plugins/agent-chat.ts +5 -1
- package/corpus/templates/design/server/plugins/assets-mcp.ts +60 -0
- package/corpus/templates/mail/server/plugins/auth.ts +4 -1
- package/corpus/templates/plan/app/pages/PlansPage.tsx +271 -197
- package/corpus/templates/plan/server/plan-content.ts +45 -2
- package/dist/a2a/client.d.ts +1 -0
- package/dist/a2a/client.d.ts.map +1 -1
- package/dist/a2a/client.js +5 -3
- package/dist/a2a/client.js.map +1 -1
- 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 +24 -11
- package/dist/agent/durable-background.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/api-path.d.ts.map +1 -1
- package/dist/client/api-path.js +27 -0
- package/dist/client/api-path.js.map +1 -1
- package/dist/client/embed-auth.d.ts.map +1 -1
- package/dist/client/embed-auth.js +27 -0
- package/dist/client/embed-auth.js.map +1 -1
- package/dist/client/mcp-app-host.d.ts.map +1 -1
- package/dist/client/mcp-app-host.js +5 -0
- package/dist/client/mcp-app-host.js.map +1 -1
- package/dist/client/mcp-apps/McpAppRenderer.d.ts +1 -0
- package/dist/client/mcp-apps/McpAppRenderer.d.ts.map +1 -1
- package/dist/client/mcp-apps/McpAppRenderer.js +179 -33
- package/dist/client/mcp-apps/McpAppRenderer.js.map +1 -1
- package/dist/client/resources/use-mcp-servers.d.ts +1 -0
- package/dist/client/resources/use-mcp-servers.d.ts.map +1 -1
- package/dist/client/resources/use-mcp-servers.js.map +1 -1
- package/dist/client/settings/DemoModeSection.d.ts.map +1 -1
- package/dist/client/settings/DemoModeSection.js +3 -1
- package/dist/client/settings/DemoModeSection.js.map +1 -1
- package/dist/demo/fetch-interceptor.js +1 -1
- package/dist/demo/fetch-interceptor.js.map +1 -1
- package/dist/embedding/agent.d.ts +1 -1
- package/dist/embedding/agent.d.ts.map +1 -1
- package/dist/embedding/agent.js +1 -1
- package/dist/embedding/agent.js.map +1 -1
- package/dist/embedding/bridge.d.ts.map +1 -1
- package/dist/embedding/bridge.js +27 -1
- package/dist/embedding/bridge.js.map +1 -1
- package/dist/extensions/schema.d.ts +2 -2
- package/dist/mcp/build-server.d.ts +2 -0
- package/dist/mcp/build-server.d.ts.map +1 -1
- package/dist/mcp/build-server.js +32 -9
- package/dist/mcp/build-server.js.map +1 -1
- package/dist/mcp/embed-app.d.ts.map +1 -1
- package/dist/mcp/embed-app.js +120 -45
- package/dist/mcp/embed-app.js.map +1 -1
- package/dist/mcp/index.d.ts +1 -0
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +1 -0
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/org-directory.d.ts +1 -0
- package/dist/mcp/org-directory.d.ts.map +1 -1
- package/dist/mcp/org-directory.js +59 -11
- package/dist/mcp/org-directory.js.map +1 -1
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +9 -0
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp-client/config.d.ts +12 -0
- package/dist/mcp-client/config.d.ts.map +1 -1
- package/dist/mcp-client/config.js.map +1 -1
- package/dist/mcp-client/index.d.ts +1 -1
- package/dist/mcp-client/index.d.ts.map +1 -1
- package/dist/mcp-client/index.js +1 -1
- package/dist/mcp-client/index.js.map +1 -1
- package/dist/mcp-client/manager.d.ts +2 -0
- package/dist/mcp-client/manager.d.ts.map +1 -1
- package/dist/mcp-client/manager.js +201 -9
- package/dist/mcp-client/manager.js.map +1 -1
- package/dist/mcp-client/remote-store.d.ts +27 -0
- package/dist/mcp-client/remote-store.d.ts.map +1 -1
- package/dist/mcp-client/remote-store.js +105 -0
- package/dist/mcp-client/remote-store.js.map +1 -1
- package/dist/mcp-client/routes.d.ts +1 -0
- package/dist/mcp-client/routes.d.ts.map +1 -1
- package/dist/mcp-client/routes.js +1 -0
- package/dist/mcp-client/routes.js.map +1 -1
- package/dist/provider-api/actions/github-repo-files.d.ts +2 -2
- package/dist/provider-api/actions/query-staged-dataset.d.ts +3 -3
- package/dist/provider-api/corpus-jobs.d.ts +8 -8
- package/dist/server/agent-chat-plugin.d.ts +2 -0
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +8 -0
- 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/index.d.ts +1 -1
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +1 -1
- package/dist/server/index.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/shared/mcp-embed-headers.d.ts +3 -1
- package/dist/shared/mcp-embed-headers.d.ts.map +1 -1
- package/dist/shared/mcp-embed-headers.js +40 -3
- package/dist/shared/mcp-embed-headers.js.map +1 -1
- package/dist/sharing/actions/list-resource-shares.d.ts +1 -1
- package/dist/sharing/actions/set-resource-visibility.d.ts +2 -2
- package/dist/sharing/actions/share-resource.d.ts +1 -1
- package/dist/sharing/schema.d.ts +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/dist/vite/client.d.ts.map +1 -1
- package/dist/vite/client.js +44 -0
- package/dist/vite/client.js.map +1 -1
- package/docs/content/skills-guide.md +14 -0
- package/docs/content/template-clips.md +7 -1
- package/package.json +6 -6
- 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
|
@@ -55,6 +55,36 @@ function withAppBasePath(path: string): string {
|
|
|
55
55
|
return `${basePath}${cleanPath}`;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
+
const AGENT_NATIVE_TERMS_URL = "https://www.agent-native.com/terms";
|
|
59
|
+
const AGENT_NATIVE_PRIVACY_URL = "https://www.agent-native.com/privacy";
|
|
60
|
+
|
|
61
|
+
export interface SignupLegalNoticeOptions {
|
|
62
|
+
termsUrl: string;
|
|
63
|
+
privacyUrl: string;
|
|
64
|
+
termsLabel?: string;
|
|
65
|
+
privacyLabel?: string;
|
|
66
|
+
prefix?: string;
|
|
67
|
+
connector?: string;
|
|
68
|
+
suffix?: string;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function normalizeRequestHostname(host: string | undefined): string {
|
|
72
|
+
const firstHost = host?.split(",")[0]?.trim().toLowerCase() ?? "";
|
|
73
|
+
if (!firstHost) return "";
|
|
74
|
+
if (firstHost.startsWith("[")) {
|
|
75
|
+
const close = firstHost.indexOf("]");
|
|
76
|
+
return close > 0 ? firstHost.slice(1, close) : firstHost;
|
|
77
|
+
}
|
|
78
|
+
return firstHost.replace(/:\d+$/, "");
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function isAgentNativeHostedHost(host: string | undefined): boolean {
|
|
82
|
+
const hostname = normalizeRequestHostname(host);
|
|
83
|
+
return (
|
|
84
|
+
hostname === "agent-native.com" || hostname.endsWith(".agent-native.com")
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
|
|
58
88
|
export interface OnboardingHtmlOptions {
|
|
59
89
|
/**
|
|
60
90
|
* Hide email/password forms and show ONLY the Google sign-in button.
|
|
@@ -93,6 +123,12 @@ export interface OnboardingHtmlOptions {
|
|
|
93
123
|
continueLabel?: string;
|
|
94
124
|
cancelLabel?: string;
|
|
95
125
|
};
|
|
126
|
+
/**
|
|
127
|
+
* Optional email signup legal copy. Builder-hosted `*.agent-native.com`
|
|
128
|
+
* deployments get the Agent Native links automatically; self-hosted and
|
|
129
|
+
* custom-domain apps must opt in with their own URLs.
|
|
130
|
+
*/
|
|
131
|
+
signupLegalNotice?: SignupLegalNoticeOptions | false;
|
|
96
132
|
/**
|
|
97
133
|
* Google sign-in flow: `'popup'`, `'redirect'`, or `'auto'` (default).
|
|
98
134
|
* Falls back to `GOOGLE_AUTH_MODE` env var, then `'auto'`. Builder web
|
|
@@ -139,6 +175,21 @@ export function getOnboardingHtml(opts: OnboardingHtmlOptions = {}): string {
|
|
|
139
175
|
.replace(/</g, "<")
|
|
140
176
|
.replace(/>/g, ">")
|
|
141
177
|
.replace(/"/g, """);
|
|
178
|
+
const hostedSignupLegalNotice: SignupLegalNoticeOptions | undefined =
|
|
179
|
+
opts.signupLegalNotice === undefined &&
|
|
180
|
+
isAgentNativeHostedHost(opts.requestHost)
|
|
181
|
+
? {
|
|
182
|
+
termsUrl: AGENT_NATIVE_TERMS_URL,
|
|
183
|
+
privacyUrl: AGENT_NATIVE_PRIVACY_URL,
|
|
184
|
+
}
|
|
185
|
+
: undefined;
|
|
186
|
+
const signupLegalNotice =
|
|
187
|
+
opts.signupLegalNotice === false
|
|
188
|
+
? undefined
|
|
189
|
+
: (opts.signupLegalNotice ?? hostedSignupLegalNotice);
|
|
190
|
+
const signupLegalNoteHtml = signupLegalNotice
|
|
191
|
+
? ` <p class="legal-note">${esc(signupLegalNotice.prefix ?? "By signing up, you accept our")} <a href="${esc(signupLegalNotice.termsUrl)}" target="_blank" rel="noreferrer">${esc(signupLegalNotice.termsLabel ?? "Terms")}</a> ${esc(signupLegalNotice.connector ?? "and")} <a href="${esc(signupLegalNotice.privacyUrl)}" target="_blank" rel="noreferrer">${esc(signupLegalNotice.privacyLabel ?? "Privacy Policy")}</a>${esc(signupLegalNotice.suffix ?? ".")}</p>`
|
|
192
|
+
: "";
|
|
142
193
|
const googleSignInNotice = opts.googleSignInNotice;
|
|
143
194
|
const googleNoticeBodyParts = googleSignInNotice
|
|
144
195
|
? (Array.isArray(googleSignInNotice.body)
|
|
@@ -177,11 +228,16 @@ export function getOnboardingHtml(opts: OnboardingHtmlOptions = {}): string {
|
|
|
177
228
|
aria-describedby="google-preflight-copy"
|
|
178
229
|
tabindex="-1"
|
|
179
230
|
>
|
|
180
|
-
<
|
|
181
|
-
|
|
182
|
-
<
|
|
183
|
-
|
|
231
|
+
<button type="button" class="google-preflight-close" aria-label="Close Google sign-in choices" onclick="__anHideGoogleNotice()">×</button>
|
|
232
|
+
<div class="google-preflight-main">
|
|
233
|
+
<span class="google-preflight-icon" aria-hidden="true">
|
|
234
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10.24 3.957l-8.422 14.06a1.989 1.989 0 0 0 1.7 2.983h16.845a1.989 1.989 0 0 0 1.7 -2.983l-8.423 -14.06a1.989 1.989 0 0 0 -3.4 0z"/><path d="M12 9v4"/><path d="M12 16h.01"/></svg>
|
|
235
|
+
</span>
|
|
236
|
+
<div class="google-preflight-text">
|
|
237
|
+
<p class="google-preflight-title" id="google-preflight-title">${esc(googleSignInNotice.title)}</p>
|
|
184
238
|
${googleNoticeBodyHtml}
|
|
239
|
+
</div>
|
|
240
|
+
</div>
|
|
185
241
|
<div class="google-preflight-actions">
|
|
186
242
|
<button type="button" class="btn-primary" id="google-preflight-continue" onclick="__anAcceptGoogleNotice()">${esc(googleSignInNotice.continueLabel ?? "Continue")}</button>
|
|
187
243
|
${googleNoticeRunLocalHtml}
|
|
@@ -707,6 +763,19 @@ ${
|
|
|
707
763
|
cursor: pointer;
|
|
708
764
|
}
|
|
709
765
|
.btn-secondary:hover { color: #bbb; border-color: rgba(255,255,255,0.2); }
|
|
766
|
+
.legal-note {
|
|
767
|
+
margin-top: 0.625rem;
|
|
768
|
+
color: #666;
|
|
769
|
+
font-size: 0.6875rem;
|
|
770
|
+
line-height: 1.45;
|
|
771
|
+
text-align: center;
|
|
772
|
+
}
|
|
773
|
+
.legal-note a {
|
|
774
|
+
color: #777;
|
|
775
|
+
text-decoration: underline;
|
|
776
|
+
text-underline-offset: 2px;
|
|
777
|
+
}
|
|
778
|
+
.legal-note a:hover { color: #aaa; }
|
|
710
779
|
.msg { margin-top: 0.75rem; font-size: 0.8125rem; display: none; }
|
|
711
780
|
.msg.error { color: #f87171; }
|
|
712
781
|
.msg.success { color: #33C4FF; }
|
|
@@ -898,25 +967,40 @@ ${
|
|
|
898
967
|
border-left: 1px solid rgba(255,255,255,0.12);
|
|
899
968
|
border-top: 1px solid rgba(255,255,255,0.12);
|
|
900
969
|
}
|
|
901
|
-
.google-preflight-
|
|
970
|
+
.google-preflight-main {
|
|
902
971
|
display: flex;
|
|
903
972
|
align-items: flex-start;
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
margin-bottom: 0.375rem;
|
|
973
|
+
gap: 0.625rem;
|
|
974
|
+
padding-right: 1.25rem;
|
|
907
975
|
}
|
|
976
|
+
.google-preflight-icon {
|
|
977
|
+
display: inline-flex;
|
|
978
|
+
align-items: center;
|
|
979
|
+
justify-content: center;
|
|
980
|
+
flex: none;
|
|
981
|
+
width: 1.75rem;
|
|
982
|
+
height: 1.75rem;
|
|
983
|
+
border-radius: 7px;
|
|
984
|
+
background: rgba(245,158,11,0.15);
|
|
985
|
+
color: #fcd34d;
|
|
986
|
+
}
|
|
987
|
+
.google-preflight-icon svg { width: 1rem; height: 1rem; }
|
|
988
|
+
.google-preflight-text { min-width: 0; }
|
|
908
989
|
.google-preflight-title {
|
|
909
990
|
color: #fff;
|
|
910
991
|
font-size: 0.8125rem;
|
|
911
992
|
font-weight: 600;
|
|
993
|
+
margin-bottom: 0.25rem;
|
|
912
994
|
}
|
|
913
995
|
.google-preflight-close {
|
|
996
|
+
position: absolute;
|
|
997
|
+
top: 0.5rem;
|
|
998
|
+
right: 0.5rem;
|
|
914
999
|
display: inline-flex;
|
|
915
1000
|
align-items: center;
|
|
916
1001
|
justify-content: center;
|
|
917
1002
|
width: 1.5rem;
|
|
918
1003
|
height: 1.5rem;
|
|
919
|
-
margin: -0.25rem -0.25rem 0 0;
|
|
920
1004
|
background: transparent;
|
|
921
1005
|
border: none;
|
|
922
1006
|
border-radius: 999px;
|
|
@@ -942,6 +1026,7 @@ ${
|
|
|
942
1026
|
flex: 1;
|
|
943
1027
|
width: auto;
|
|
944
1028
|
margin-top: 0;
|
|
1029
|
+
white-space: nowrap;
|
|
945
1030
|
}
|
|
946
1031
|
.google-preflight-command {
|
|
947
1032
|
margin-top: 0.75rem;
|
|
@@ -1039,6 +1124,7 @@ ${
|
|
|
1039
1124
|
<label for="s-pass2">Confirm password</label>
|
|
1040
1125
|
<input id="s-pass2" type="password" autocomplete="new-password" placeholder="Confirm password" required minlength="8" />
|
|
1041
1126
|
<button type="submit">Create account</button>
|
|
1127
|
+
${signupLegalNoteHtml}
|
|
1042
1128
|
<p class="msg" id="s-msg"></p>
|
|
1043
1129
|
</form>
|
|
1044
1130
|
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
export const MCP_EMBED_CORS_ALLOW_HEADERS =
|
|
2
|
-
"Content-Type,Authorization,X-Requested-With,X-Request-Source,X-Agent-Native-CSRF,X-User-Timezone,X-Agent-Native-Embed-Target,X-Agent-Native-Embed-Transplant";
|
|
2
|
+
"Content-Type,Authorization,X-Requested-With,X-Request-Source,X-Agent-Native-CSRF,X-Agent-Native-Frontend,X-User-Timezone,X-Agent-Native-Embed-Target,X-Agent-Native-Embed-Transplant";
|
|
3
3
|
export const EMBED_TRANSPLANT_HEADER = "x-agent-native-embed-transplant";
|
|
4
4
|
|
|
5
5
|
const CLAUDE_MCP_CONTENT_HOST_RE = /^[a-f0-9]{32}\.claudemcpcontent\.com$/i;
|
|
6
6
|
const CHATGPT_MCP_SANDBOX_HOST_RE =
|
|
7
7
|
/^(?:[^.]+\.)?web-sandbox\.oaiusercontent\.com$/i;
|
|
8
|
+
const AGENT_NATIVE_FIRST_PARTY_APP_HOST_SUFFIX = ".agent-native.com";
|
|
9
|
+
const MCP_PRODUCT_HOST_ORIGINS = new Set([
|
|
10
|
+
"https://chat.openai.com",
|
|
11
|
+
"https://chatgpt.com",
|
|
12
|
+
"https://claude.ai",
|
|
13
|
+
]);
|
|
8
14
|
|
|
9
15
|
export function isLocalMcpEmbedOrigin(
|
|
10
16
|
origin: string | null | undefined,
|
|
@@ -50,6 +56,37 @@ export function isChatGptMcpSandboxOrigin(
|
|
|
50
56
|
}
|
|
51
57
|
}
|
|
52
58
|
|
|
59
|
+
export function isMcpProductHostOrigin(
|
|
60
|
+
origin: string | null | undefined,
|
|
61
|
+
): boolean {
|
|
62
|
+
if (!origin) return false;
|
|
63
|
+
try {
|
|
64
|
+
return MCP_PRODUCT_HOST_ORIGINS.has(new URL(origin).origin);
|
|
65
|
+
} catch {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export function isAgentNativeFirstPartyAppOrigin(
|
|
71
|
+
origin: string | null | undefined,
|
|
72
|
+
): boolean {
|
|
73
|
+
if (!origin) return false;
|
|
74
|
+
try {
|
|
75
|
+
const url = new URL(origin);
|
|
76
|
+
const hostname = url.hostname.toLowerCase();
|
|
77
|
+
return (
|
|
78
|
+
url.protocol === "https:" &&
|
|
79
|
+
!url.username &&
|
|
80
|
+
!url.password &&
|
|
81
|
+
!url.port &&
|
|
82
|
+
hostname.endsWith(AGENT_NATIVE_FIRST_PARTY_APP_HOST_SUFFIX) &&
|
|
83
|
+
hostname.length > AGENT_NATIVE_FIRST_PARTY_APP_HOST_SUFFIX.length
|
|
84
|
+
);
|
|
85
|
+
} catch {
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
53
90
|
export function isMcpEmbedCorsOrigin(
|
|
54
91
|
origin: string | null | undefined,
|
|
55
92
|
): boolean {
|
|
@@ -57,7 +94,9 @@ export function isMcpEmbedCorsOrigin(
|
|
|
57
94
|
origin === "null" ||
|
|
58
95
|
isLocalMcpEmbedOrigin(origin) ||
|
|
59
96
|
isClaudeMcpContentOrigin(origin) ||
|
|
60
|
-
isChatGptMcpSandboxOrigin(origin)
|
|
97
|
+
isChatGptMcpSandboxOrigin(origin) ||
|
|
98
|
+
isMcpProductHostOrigin(origin) ||
|
|
99
|
+
isAgentNativeFirstPartyAppOrigin(origin)
|
|
61
100
|
);
|
|
62
101
|
}
|
|
63
102
|
|
|
@@ -67,7 +106,9 @@ export function shouldAllowMcpEmbedCredentials(
|
|
|
67
106
|
return (
|
|
68
107
|
origin !== "null" &&
|
|
69
108
|
!isClaudeMcpContentOrigin(origin) &&
|
|
70
|
-
!isChatGptMcpSandboxOrigin(origin)
|
|
109
|
+
!isChatGptMcpSandboxOrigin(origin) &&
|
|
110
|
+
!isMcpProductHostOrigin(origin) &&
|
|
111
|
+
!isAgentNativeFirstPartyAppOrigin(origin)
|
|
71
112
|
);
|
|
72
113
|
}
|
|
73
114
|
|
|
@@ -38,6 +38,10 @@ Read these local package docs before implementing advanced Agent Native
|
|
|
38
38
|
features. Prefer this app's own `AGENTS.md` and `.agents/skills/` for
|
|
39
39
|
app-specific rules, then use the corpus for reusable framework/template
|
|
40
40
|
patterns.
|
|
41
|
+
After updating `@agent-native/core`, run `pnpm skills:update` or
|
|
42
|
+
`npx @agent-native/core@latest skills update scaffold --project` from the app
|
|
43
|
+
root to refresh framework-provided `.agents/skills` and repair `CLAUDE.md` /
|
|
44
|
+
`.claude/skills` compatibility links.
|
|
41
45
|
|
|
42
46
|
### Database Code
|
|
43
47
|
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
"start": "agent-native start",
|
|
9
9
|
"typecheck": "agent-native typecheck",
|
|
10
10
|
"action": "agent-native action",
|
|
11
|
-
"script": "agent-native script"
|
|
11
|
+
"script": "agent-native script",
|
|
12
|
+
"skills:update": "agent-native skills update scaffold --project"
|
|
12
13
|
},
|
|
13
14
|
"dependencies": {
|
|
14
15
|
"@agent-native/core": "latest",
|
|
@@ -38,6 +38,10 @@ first-party template patterns ships in `node_modules/@agent-native/core/corpus`.
|
|
|
38
38
|
Read these local package docs before implementing advanced Agent Native
|
|
39
39
|
features. Prefer this app's own `AGENTS.md` for app-specific rules, then use
|
|
40
40
|
the corpus for reusable framework/template patterns.
|
|
41
|
+
After updating `@agent-native/core`, run `pnpm skills:update` or
|
|
42
|
+
`npx @agent-native/core@latest skills update scaffold --project` from the app
|
|
43
|
+
root to refresh framework-provided `.agents/skills` and repair `CLAUDE.md` /
|
|
44
|
+
`.claude/skills` compatibility links.
|
|
41
45
|
|
|
42
46
|
## Actions
|
|
43
47
|
|
|
@@ -27,6 +27,10 @@ first-party template patterns ships in `node_modules/@agent-native/core/corpus`.
|
|
|
27
27
|
Use package docs for framework APIs, the package corpus for reusable
|
|
28
28
|
framework/template patterns, and `packages/shared/AGENTS.md` plus
|
|
29
29
|
`packages/shared/.agents/skills/` for workspace-specific conventions.
|
|
30
|
+
After updating `@agent-native/core`, run `pnpm skills:update` or
|
|
31
|
+
`npx @agent-native/core@latest skills update scaffold --project` from the
|
|
32
|
+
workspace root to refresh framework-provided shared skills and repair
|
|
33
|
+
`CLAUDE.md` / `.claude/skills` compatibility links.
|
|
30
34
|
|
|
31
35
|
## Core Agent Rule
|
|
32
36
|
|
|
@@ -35,6 +35,10 @@ the shared package (`@{{APP_NAME}}/shared`).
|
|
|
35
35
|
|
|
36
36
|
The workspace root also links `.agents/skills` to the shared package so coding
|
|
37
37
|
agents launched from the root can discover the same workspace-wide skills.
|
|
38
|
+
Run `pnpm skills:update` (or
|
|
39
|
+
`npx @agent-native/core@latest skills update scaffold --project`) after updating
|
|
40
|
+
`@agent-native/core` to refresh framework-provided shared skills and repair
|
|
41
|
+
Claude compatibility links.
|
|
38
42
|
|
|
39
43
|
Runtime-editable global resources live in Dispatch, not in `packages/shared`.
|
|
40
44
|
Use Dispatch **Resources** for company context and guardrails that admins should
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
"build": "pnpm -r build",
|
|
8
8
|
"typecheck": "pnpm -r typecheck",
|
|
9
9
|
"repair:workspace-org": "tsx scripts/repair-workspace-org.ts",
|
|
10
|
+
"skills:update": "agent-native skills update scaffold --project",
|
|
10
11
|
"fmt:check": "prettier --check .",
|
|
11
12
|
"lint": "pnpm fmt:check"
|
|
12
13
|
},
|
|
@@ -954,6 +954,52 @@ const VITE_RUNTIME_PATH_PREFIXES = [
|
|
|
954
954
|
"/src/",
|
|
955
955
|
];
|
|
956
956
|
|
|
957
|
+
const EMBED_DEV_STATIC_ASSET_PATH_PREFIXES = [
|
|
958
|
+
...VITE_RUNTIME_PATH_PREFIXES,
|
|
959
|
+
"/assets/",
|
|
960
|
+
"/library-presets/",
|
|
961
|
+
];
|
|
962
|
+
|
|
963
|
+
const EMBED_DEV_STATIC_ASSET_PATHS = new Set([
|
|
964
|
+
"/favicon.ico",
|
|
965
|
+
"/favicon.svg",
|
|
966
|
+
"/manifest.json",
|
|
967
|
+
]);
|
|
968
|
+
|
|
969
|
+
function mountedPathCandidates(
|
|
970
|
+
reqUrl: string | undefined,
|
|
971
|
+
base: string | undefined,
|
|
972
|
+
): string[] {
|
|
973
|
+
if (!reqUrl) return [];
|
|
974
|
+
let pathname: string;
|
|
975
|
+
try {
|
|
976
|
+
pathname = new URL(reqUrl, "http://agent-native.local").pathname;
|
|
977
|
+
} catch {
|
|
978
|
+
return [];
|
|
979
|
+
}
|
|
980
|
+
if (base && base !== "/") {
|
|
981
|
+
const normalizedBase = base.endsWith("/") ? base : `${base}/`;
|
|
982
|
+
if (pathname.startsWith(normalizedBase)) {
|
|
983
|
+
return [pathname.slice(normalizedBase.length - 1) || "/"];
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
return [pathname];
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
function isEmbedDevStaticAssetRequest(
|
|
990
|
+
reqUrl: string | undefined,
|
|
991
|
+
base: string | undefined,
|
|
992
|
+
): boolean {
|
|
993
|
+
return mountedPathCandidates(reqUrl, base).some((pathname) => {
|
|
994
|
+
if (EMBED_DEV_STATIC_ASSET_PATHS.has(pathname)) return true;
|
|
995
|
+
if (/^\/icon-[^/]+\.svg$/i.test(pathname)) return true;
|
|
996
|
+
if (/^\/agent-native-[^/]+\.svg$/i.test(pathname)) return true;
|
|
997
|
+
return EMBED_DEV_STATIC_ASSET_PATH_PREFIXES.some((prefix) =>
|
|
998
|
+
pathname.startsWith(prefix),
|
|
999
|
+
);
|
|
1000
|
+
});
|
|
1001
|
+
}
|
|
1002
|
+
|
|
957
1003
|
function cookieValue(req: IncomingMessage, name: string): string | undefined {
|
|
958
1004
|
const header = req.headers.cookie;
|
|
959
1005
|
if (typeof header !== "string" || !header) return undefined;
|
|
@@ -1166,6 +1212,13 @@ function embedDevFrameHeaders(): Plugin {
|
|
|
1166
1212
|
configureServer(server) {
|
|
1167
1213
|
server.middlewares.use((req, res, next) => {
|
|
1168
1214
|
const origin = String(req.headers.origin ?? "");
|
|
1215
|
+
if (isEmbedDevStaticAssetRequest(req.url, server.config?.base)) {
|
|
1216
|
+
for (const [name, value] of Object.entries(
|
|
1217
|
+
MCP_EMBED_STATIC_ASSET_HEADERS,
|
|
1218
|
+
)) {
|
|
1219
|
+
res.setHeader(name, value);
|
|
1220
|
+
}
|
|
1221
|
+
}
|
|
1169
1222
|
if (isMcpEmbedCorsOrigin(origin)) {
|
|
1170
1223
|
res.setHeader("Access-Control-Allow-Origin", origin);
|
|
1171
1224
|
res.setHeader("Vary", "Origin");
|
|
@@ -265,9 +265,8 @@ function validateDashboardConfig(
|
|
|
265
265
|
if (!p || typeof p !== "object") {
|
|
266
266
|
return `panel[${i}] must be an object`;
|
|
267
267
|
}
|
|
268
|
-
// Section panels are pure layout dividers
|
|
269
|
-
//
|
|
270
|
-
// grid renders them.
|
|
268
|
+
// Section panels are pure layout dividers, so source and sql are optional.
|
|
269
|
+
// Width stays required for backward-compatible dashboard payloads.
|
|
271
270
|
const isSection = p.chartType === "section";
|
|
272
271
|
const required = isSection
|
|
273
272
|
? (["id", "title", "chartType", "width"] as const)
|
|
@@ -276,7 +275,7 @@ function validateDashboardConfig(
|
|
|
276
275
|
const v = p[field];
|
|
277
276
|
if (field === "width") {
|
|
278
277
|
if (!isValidColumnCount(v)) {
|
|
279
|
-
return `panel[${i}].width must be an integer between 1 and 6 (
|
|
278
|
+
return `panel[${i}].width must be an integer between 1 and 6 (legacy layout field)`;
|
|
280
279
|
}
|
|
281
280
|
continue;
|
|
282
281
|
}
|