@agent-native/core 0.22.33 → 0.22.35
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/client/extensions/ExtensionViewer.d.ts.map +1 -1
- package/dist/client/extensions/ExtensionViewer.js +26 -1
- package/dist/client/extensions/ExtensionViewer.js.map +1 -1
- package/dist/client/extensions/ExtensionViewer.spec.d.ts +2 -0
- package/dist/client/extensions/ExtensionViewer.spec.d.ts.map +1 -0
- package/dist/client/extensions/ExtensionViewer.spec.js +94 -0
- package/dist/client/extensions/ExtensionViewer.spec.js.map +1 -0
- package/dist/deploy/build.d.ts.map +1 -1
- package/dist/deploy/build.js +5 -50
- package/dist/deploy/build.js.map +1 -1
- package/dist/mcp/build-server.d.ts +8 -0
- package/dist/mcp/build-server.d.ts.map +1 -1
- package/dist/mcp/build-server.js +44 -7
- 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 +19 -0
- package/dist/mcp/embed-app.js.map +1 -1
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +13 -1
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/stdio.d.ts.map +1 -1
- package/dist/mcp/stdio.js +9 -2
- package/dist/mcp/stdio.js.map +1 -1
- package/dist/server/auth-marketing.d.ts +14 -0
- package/dist/server/auth-marketing.d.ts.map +1 -0
- package/dist/server/auth-marketing.js +268 -0
- package/dist/server/auth-marketing.js.map +1 -0
- package/dist/server/auth.d.ts.map +1 -1
- package/dist/server/auth.js +34 -25
- package/dist/server/auth.js.map +1 -1
- package/dist/server/embed-route.d.ts.map +1 -1
- package/dist/server/embed-route.js +39 -1
- package/dist/server/embed-route.js.map +1 -1
- package/dist/server/onboarding-html.d.ts +6 -0
- package/dist/server/onboarding-html.d.ts.map +1 -1
- package/dist/server/onboarding-html.js +6 -1
- package/dist/server/onboarding-html.js.map +1 -1
- package/dist/server/ssr-handler.d.ts +0 -1
- package/dist/server/ssr-handler.d.ts.map +1 -1
- package/dist/server/ssr-handler.js +6 -7
- package/dist/server/ssr-handler.js.map +1 -1
- package/docs/content/actions.md +1 -1
- package/docs/content/external-agents.md +30 -13
- package/docs/content/mcp-protocol.md +18 -1
- package/package.json +1 -1
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
export const BUILT_IN_AUTH_MARKETING = {
|
|
2
|
+
analytics: {
|
|
3
|
+
appName: "Agent-Native Analytics",
|
|
4
|
+
tagline: "Your AI agent queries your data sources, builds dashboards, and answers business questions alongside you.",
|
|
5
|
+
features: [
|
|
6
|
+
"Ask any question and get answers from BigQuery, HubSpot, Jira, and more",
|
|
7
|
+
"Agent-built dashboards that pull live data from all your sources",
|
|
8
|
+
"Saved analyses the agent can re-run on demand with fresh numbers",
|
|
9
|
+
],
|
|
10
|
+
},
|
|
11
|
+
brain: {
|
|
12
|
+
appName: "Agent-Native Brain",
|
|
13
|
+
tagline: "A company memory layer where raw conversations become reviewed, searchable institutional knowledge.",
|
|
14
|
+
features: [
|
|
15
|
+
"Import transcripts, notes, Slack exports, and Granola summaries",
|
|
16
|
+
"Validate every fact against exact source quotes",
|
|
17
|
+
"Review company-wide knowledge through proposal workflows",
|
|
18
|
+
],
|
|
19
|
+
},
|
|
20
|
+
calendar: {
|
|
21
|
+
appName: "Agent-Native Calendar",
|
|
22
|
+
tagline: "Your AI agent schedules, reschedules, and manages your calendar so you never have to.",
|
|
23
|
+
features: [
|
|
24
|
+
"Finds open slots and books meetings on your behalf",
|
|
25
|
+
"Manages availability and booking links automatically",
|
|
26
|
+
"Answers schedule questions and resolves conflicts instantly",
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
calls: {
|
|
30
|
+
appName: "Agent-Native Calls",
|
|
31
|
+
tagline: "Your AI agent transcribes, summarizes, and surfaces key moments from every conversation.",
|
|
32
|
+
features: [
|
|
33
|
+
"Automatic recaps, action items, and next steps after every call",
|
|
34
|
+
"Smart trackers that detect competitor mentions, objections, and custom topics",
|
|
35
|
+
"Shareable snippets for the exact moment that matters",
|
|
36
|
+
],
|
|
37
|
+
},
|
|
38
|
+
clips: {
|
|
39
|
+
appName: "Agent-Native Clips",
|
|
40
|
+
tagline: "Your AI agent transcribes, summarizes, and searches everything you record alongside you.",
|
|
41
|
+
features: [
|
|
42
|
+
"One-click screen recording with automatic titles, summaries, and chapters",
|
|
43
|
+
"Calendar-synced meeting notes with live transcripts and action items",
|
|
44
|
+
"One searchable library across recordings, meetings, and dictations",
|
|
45
|
+
],
|
|
46
|
+
},
|
|
47
|
+
code: {
|
|
48
|
+
appName: "Agent-Native Code",
|
|
49
|
+
tagline: "A customizable local Agent-Native Code UI for long-running coding sessions, slash commands, and migration goals.",
|
|
50
|
+
features: [
|
|
51
|
+
"Start and resume local coding sessions",
|
|
52
|
+
"Use the same transcript store as the CLI and Desktop",
|
|
53
|
+
"Customize the UI while reusing the agent-native run harness",
|
|
54
|
+
],
|
|
55
|
+
},
|
|
56
|
+
content: {
|
|
57
|
+
appName: "Agent-Native Content",
|
|
58
|
+
tagline: "Your AI agent creates, edits, and organizes documents alongside you in a Notion-like workspace.",
|
|
59
|
+
features: [
|
|
60
|
+
"Create and restructure entire document trees from a single prompt",
|
|
61
|
+
"Surgical edits that sync live to your editor via real-time collaboration",
|
|
62
|
+
"Search, summarize, and cross-reference documents instantly",
|
|
63
|
+
],
|
|
64
|
+
},
|
|
65
|
+
design: {
|
|
66
|
+
appName: "Agent-Native Design",
|
|
67
|
+
tagline: "Design and prototype by describing what you want. The AI agent turns your ideas into interactive, fully responsive designs in seconds.",
|
|
68
|
+
features: [
|
|
69
|
+
"Create polished prototypes just by describing them",
|
|
70
|
+
"Build and apply design systems to keep everything on-brand",
|
|
71
|
+
"Export your work or share it with a link",
|
|
72
|
+
],
|
|
73
|
+
},
|
|
74
|
+
dispatch: {
|
|
75
|
+
appName: "Agent-Native Dispatch",
|
|
76
|
+
tagline: "Your AI agent manages secrets, orchestrates other agents, and routes messages across your workspace.",
|
|
77
|
+
features: [
|
|
78
|
+
"Centralized vault for secrets with granular per-app grants",
|
|
79
|
+
"Cross-agent orchestration and delegation to specialist apps",
|
|
80
|
+
"Slack and Telegram routing with approval workflows",
|
|
81
|
+
],
|
|
82
|
+
},
|
|
83
|
+
forms: {
|
|
84
|
+
appName: "Agent-Native Forms",
|
|
85
|
+
tagline: "Your AI agent builds, publishes, and analyzes forms alongside you.",
|
|
86
|
+
features: [
|
|
87
|
+
"Create complete forms from a single sentence",
|
|
88
|
+
"Instant publishing with shareable links and captcha",
|
|
89
|
+
"Response summaries, exports, and trend analysis on demand",
|
|
90
|
+
],
|
|
91
|
+
},
|
|
92
|
+
images: {
|
|
93
|
+
appName: "Agent-Native Images",
|
|
94
|
+
tagline: "Your AI agent creates, refines, and organizes on-brand images alongside you.",
|
|
95
|
+
features: [
|
|
96
|
+
"Build reusable brand image libraries from logos, product shots, and references",
|
|
97
|
+
"Generate heroes, diagrams, slide art, and product visuals from a prompt",
|
|
98
|
+
"Audit prompts, references, outputs, and refinements across every run",
|
|
99
|
+
],
|
|
100
|
+
},
|
|
101
|
+
mail: {
|
|
102
|
+
appName: "Agent-Native Mail",
|
|
103
|
+
tagline: "Your AI agent reads, drafts, and organizes email alongside you.",
|
|
104
|
+
features: [
|
|
105
|
+
"Replies that match your tone and style",
|
|
106
|
+
"Multi-account Gmail in a single unified inbox",
|
|
107
|
+
"Autonomous triage, archiving, and follow-ups",
|
|
108
|
+
],
|
|
109
|
+
runLocalCommand: "npx @agent-native/core create my-mail-app --template mail",
|
|
110
|
+
},
|
|
111
|
+
"meeting-notes": {
|
|
112
|
+
appName: "Agent-Native Meeting Notes",
|
|
113
|
+
tagline: "Your AI agent transcribes, enhances, and organizes your meeting notes while you focus on the conversation.",
|
|
114
|
+
features: [
|
|
115
|
+
"AI-enhanced meeting notes that merge raw notes with transcripts",
|
|
116
|
+
"Smart contact and company tracking from meeting attendees",
|
|
117
|
+
"Reusable templates for consistent note formatting",
|
|
118
|
+
],
|
|
119
|
+
},
|
|
120
|
+
migration: {
|
|
121
|
+
appName: "Migration Workbench",
|
|
122
|
+
tagline: "Move existing apps to agent-native with assessment, human approval, and deterministic verification.",
|
|
123
|
+
features: [
|
|
124
|
+
"Inventory routes, components, behavior, and content before touching output",
|
|
125
|
+
"Approve plans before generated writes begin",
|
|
126
|
+
"Verify output with structured migration reports",
|
|
127
|
+
],
|
|
128
|
+
},
|
|
129
|
+
recruiting: {
|
|
130
|
+
appName: "Agent-Native Recruiting",
|
|
131
|
+
tagline: "Your AI agent screens candidates, manages pipelines, and keeps your hiring on track.",
|
|
132
|
+
features: [
|
|
133
|
+
"AI resume analysis and candidate comparison",
|
|
134
|
+
"Pipeline management with automated stage progression",
|
|
135
|
+
"Scorecard tracking and overdue feedback alerts",
|
|
136
|
+
],
|
|
137
|
+
},
|
|
138
|
+
scheduling: {
|
|
139
|
+
appName: "Agent-Native Scheduling",
|
|
140
|
+
tagline: "Your AI agent manages availability, books meetings, and handles rescheduling alongside you.",
|
|
141
|
+
features: [
|
|
142
|
+
"Automatic round-robin and team scheduling across hosts",
|
|
143
|
+
"Smart availability management with conflict detection",
|
|
144
|
+
"Autonomous rescheduling, reminders, and follow-ups",
|
|
145
|
+
],
|
|
146
|
+
},
|
|
147
|
+
slides: {
|
|
148
|
+
appName: "Agent-Native Slides",
|
|
149
|
+
tagline: "Your AI agent builds, edits, and refines presentations alongside you.",
|
|
150
|
+
features: [
|
|
151
|
+
"Generate entire decks from a single prompt",
|
|
152
|
+
"Surgical slide edits while you present or review",
|
|
153
|
+
"Real-time collaboration between you and the agent",
|
|
154
|
+
],
|
|
155
|
+
},
|
|
156
|
+
starter: {
|
|
157
|
+
appName: "Blank app",
|
|
158
|
+
tagline: "Build an agent-native app where the AI agent and UI share state, actions, and context.",
|
|
159
|
+
features: [
|
|
160
|
+
"Define once, use everywhere: actions work as agent tools and API endpoints",
|
|
161
|
+
"The agent always knows what you are looking at and can act on it",
|
|
162
|
+
"Modify your app's own code, routes, and styles through conversation",
|
|
163
|
+
],
|
|
164
|
+
},
|
|
165
|
+
videos: {
|
|
166
|
+
appName: "Agent-Native Videos",
|
|
167
|
+
tagline: "Your AI agent builds, animates, and refines programmatic videos alongside you.",
|
|
168
|
+
features: [
|
|
169
|
+
"Generate animated components and compositions from a description",
|
|
170
|
+
"Fine-tune tracks, keyframes, and easing without touching code",
|
|
171
|
+
"Camera moves, interactive elements, and effects the agent wires for you",
|
|
172
|
+
],
|
|
173
|
+
},
|
|
174
|
+
voice: {
|
|
175
|
+
appName: "Agent-Native Voice",
|
|
176
|
+
tagline: "Speak to type anywhere with context-aware formatting, snippets, and custom vocabulary.",
|
|
177
|
+
features: [
|
|
178
|
+
"Push-to-talk or hands-free dictation with Whisper transcription",
|
|
179
|
+
"Context-aware style presets for formal, casual, and excited tones",
|
|
180
|
+
"Text expansion snippets and custom dictionary for tricky words",
|
|
181
|
+
],
|
|
182
|
+
},
|
|
183
|
+
};
|
|
184
|
+
const SLUG_ALIASES = {
|
|
185
|
+
"agent-native": "",
|
|
186
|
+
"blank-app": "starter",
|
|
187
|
+
"migration-goal-surface": "migration",
|
|
188
|
+
video: "videos",
|
|
189
|
+
};
|
|
190
|
+
function cloneMarketing(marketing) {
|
|
191
|
+
return {
|
|
192
|
+
...marketing,
|
|
193
|
+
features: marketing.features ? [...marketing.features] : undefined,
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
function normalizeSlug(value) {
|
|
197
|
+
if (!value)
|
|
198
|
+
return undefined;
|
|
199
|
+
let slug = value.trim().toLowerCase();
|
|
200
|
+
if (!slug)
|
|
201
|
+
return undefined;
|
|
202
|
+
slug = slug.replace(/^@agent-native\//, "");
|
|
203
|
+
slug = slug
|
|
204
|
+
.replace(/&/g, " and ")
|
|
205
|
+
.replace(/[^a-z0-9]+/g, "-")
|
|
206
|
+
.replace(/^-+|-+$/g, "");
|
|
207
|
+
slug = slug.replace(/^agent-native-/, "");
|
|
208
|
+
slug = SLUG_ALIASES[slug] ?? slug;
|
|
209
|
+
if (!slug)
|
|
210
|
+
return undefined;
|
|
211
|
+
return BUILT_IN_AUTH_MARKETING[slug] ? slug : undefined;
|
|
212
|
+
}
|
|
213
|
+
function slugFromUrl(value) {
|
|
214
|
+
if (!value)
|
|
215
|
+
return undefined;
|
|
216
|
+
try {
|
|
217
|
+
const url = new URL(value);
|
|
218
|
+
return slugFromHost(url.host) ?? slugFromPath(url.pathname);
|
|
219
|
+
}
|
|
220
|
+
catch {
|
|
221
|
+
return undefined;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
function slugFromHost(value) {
|
|
225
|
+
if (!value)
|
|
226
|
+
return undefined;
|
|
227
|
+
const host = value.split(",")[0]?.trim().split(":")[0]?.toLowerCase();
|
|
228
|
+
if (!host)
|
|
229
|
+
return undefined;
|
|
230
|
+
if (host.endsWith(".agent-native.com")) {
|
|
231
|
+
return normalizeSlug(host.slice(0, -".agent-native.com".length));
|
|
232
|
+
}
|
|
233
|
+
return undefined;
|
|
234
|
+
}
|
|
235
|
+
function slugFromPath(value) {
|
|
236
|
+
if (!value)
|
|
237
|
+
return undefined;
|
|
238
|
+
const firstSegment = value.split("?")[0]?.split("/").filter(Boolean)[0];
|
|
239
|
+
return normalizeSlug(firstSegment);
|
|
240
|
+
}
|
|
241
|
+
function candidateSlugs(opts = {}) {
|
|
242
|
+
const env = process.env;
|
|
243
|
+
const candidates = [
|
|
244
|
+
opts.requestHost ? slugFromHost(opts.requestHost) : undefined,
|
|
245
|
+
opts.requestPath ? slugFromPath(opts.requestPath) : undefined,
|
|
246
|
+
normalizeSlug(env.AGENT_NATIVE_TEMPLATE),
|
|
247
|
+
normalizeSlug(env.APP_NAME),
|
|
248
|
+
normalizeSlug(env.npm_package_name),
|
|
249
|
+
slugFromPath(env.APP_BASE_PATH),
|
|
250
|
+
slugFromPath(env.VITE_APP_BASE_PATH),
|
|
251
|
+
slugFromUrl(env.APP_URL),
|
|
252
|
+
slugFromUrl(env.BETTER_AUTH_URL),
|
|
253
|
+
slugFromUrl(env.VITE_BETTER_AUTH_URL),
|
|
254
|
+
slugFromUrl(env.URL),
|
|
255
|
+
slugFromUrl(env.DEPLOY_URL),
|
|
256
|
+
slugFromUrl(env.DEPLOY_PRIME_URL),
|
|
257
|
+
];
|
|
258
|
+
return candidates.filter((slug) => !!slug);
|
|
259
|
+
}
|
|
260
|
+
export function resolveBuiltInAuthMarketing(opts = {}) {
|
|
261
|
+
for (const slug of candidateSlugs(opts)) {
|
|
262
|
+
const marketing = BUILT_IN_AUTH_MARKETING[slug];
|
|
263
|
+
if (marketing)
|
|
264
|
+
return cloneMarketing(marketing);
|
|
265
|
+
}
|
|
266
|
+
return undefined;
|
|
267
|
+
}
|
|
268
|
+
//# sourceMappingURL=auth-marketing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-marketing.js","sourceRoot":"","sources":["../../src/server/auth-marketing.ts"],"names":[],"mappings":"AAaA,MAAM,CAAC,MAAM,uBAAuB,GAAyC;IAC3E,SAAS,EAAE;QACT,OAAO,EAAE,wBAAwB;QACjC,OAAO,EACL,2GAA2G;QAC7G,QAAQ,EAAE;YACR,yEAAyE;YACzE,kEAAkE;YAClE,kEAAkE;SACnE;KACF;IACD,KAAK,EAAE;QACL,OAAO,EAAE,oBAAoB;QAC7B,OAAO,EACL,qGAAqG;QACvG,QAAQ,EAAE;YACR,iEAAiE;YACjE,iDAAiD;YACjD,0DAA0D;SAC3D;KACF;IACD,QAAQ,EAAE;QACR,OAAO,EAAE,uBAAuB;QAChC,OAAO,EACL,uFAAuF;QACzF,QAAQ,EAAE;YACR,oDAAoD;YACpD,sDAAsD;YACtD,6DAA6D;SAC9D;KACF;IACD,KAAK,EAAE;QACL,OAAO,EAAE,oBAAoB;QAC7B,OAAO,EACL,0FAA0F;QAC5F,QAAQ,EAAE;YACR,iEAAiE;YACjE,+EAA+E;YAC/E,sDAAsD;SACvD;KACF;IACD,KAAK,EAAE;QACL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AAC,GAAG,CAAC,gBAAgB,CAAC;QACnC,YAAY,CAAC,GAAG,CAAC,aAAa,CAAC;QAC/B,YAAY,CAAC,GAAG,CAAC,kBAAkB,CAAC;QACpC,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC;QACxB,WAAW,CAAC,GAAG,CAAC,eAAe,CAAC;QAChC,WAAW,CAAC,GAAG,CAAC,oBAAoB,CAAC;QACrC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC;QACpB,WAAW,CAAC,GAAG,CAAC,UAAU,CAAC;QAC3B,WAAW,CAAC,GAAG,CAAC,gBAAgB,CAAC;KAClC,CAAC;IAEF,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,IAAI,EAAkB,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AAC7D,CAAC;AAED,MAAM,UAAU,2BAA2B,CACzC,OAA2C,EAAE;IAE7C,KAAK,MAAM,IAAI,IAAI,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC;QACxC,MAAM,SAAS,GAAG,uBAAuB,CAAC,IAAI,CAAC,CAAC;QAChD,IAAI,SAAS;YAAE,OAAO,cAAc,CAAC,SAAS,CAAC,CAAC;IAClD,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["export interface AuthMarketingContent {\n appName: string;\n tagline: string;\n description?: string;\n features?: string[];\n runLocalCommand?: string;\n}\n\nexport interface ResolveBuiltInAuthMarketingOptions {\n requestHost?: string;\n requestPath?: string;\n}\n\nexport const BUILT_IN_AUTH_MARKETING: Record<string, AuthMarketingContent> = {\n analytics: {\n appName: \"Agent-Native Analytics\",\n tagline:\n \"Your AI agent queries your data sources, builds dashboards, and answers business questions alongside you.\",\n features: [\n \"Ask any question and get answers from BigQuery, HubSpot, Jira, and more\",\n \"Agent-built dashboards that pull live data from all your sources\",\n \"Saved analyses the agent can re-run on demand with fresh numbers\",\n ],\n },\n brain: {\n appName: \"Agent-Native Brain\",\n tagline:\n \"A company memory layer where raw conversations become reviewed, searchable institutional knowledge.\",\n features: [\n \"Import transcripts, notes, Slack exports, and Granola summaries\",\n \"Validate every fact against exact source quotes\",\n \"Review company-wide knowledge through proposal workflows\",\n ],\n },\n calendar: {\n appName: \"Agent-Native Calendar\",\n tagline:\n \"Your AI agent schedules, reschedules, and manages your calendar so you never have to.\",\n features: [\n \"Finds open slots and books meetings on your behalf\",\n \"Manages availability and booking links automatically\",\n \"Answers schedule questions and resolves conflicts instantly\",\n ],\n },\n calls: {\n appName: \"Agent-Native Calls\",\n tagline:\n \"Your AI agent transcribes, summarizes, and surfaces key moments from every conversation.\",\n features: [\n \"Automatic recaps, action items, and next steps after every call\",\n \"Smart trackers that detect competitor mentions, objections, and custom topics\",\n \"Shareable snippets for the exact moment that matters\",\n ],\n },\n clips: {\n appName: \"Agent-Native Clips\",\n tagline:\n \"Your AI agent transcribes, summarizes, and searches everything you record alongside you.\",\n features: [\n \"One-click screen recording with automatic titles, summaries, and chapters\",\n \"Calendar-synced meeting notes with live transcripts and action items\",\n \"One searchable library across recordings, meetings, and dictations\",\n ],\n },\n code: {\n appName: \"Agent-Native Code\",\n tagline:\n \"A customizable local Agent-Native Code UI for long-running coding sessions, slash commands, and migration goals.\",\n features: [\n \"Start and resume local coding sessions\",\n \"Use the same transcript store as the CLI and Desktop\",\n \"Customize the UI while reusing the agent-native run harness\",\n ],\n },\n content: {\n appName: \"Agent-Native Content\",\n tagline:\n \"Your AI agent creates, edits, and organizes documents alongside you in a Notion-like workspace.\",\n features: [\n \"Create and restructure entire document trees from a single prompt\",\n \"Surgical edits that sync live to your editor via real-time collaboration\",\n \"Search, summarize, and cross-reference documents instantly\",\n ],\n },\n design: {\n appName: \"Agent-Native Design\",\n tagline:\n \"Design and prototype by describing what you want. The AI agent turns your ideas into interactive, fully responsive designs in seconds.\",\n features: [\n \"Create polished prototypes just by describing them\",\n \"Build and apply design systems to keep everything on-brand\",\n \"Export your work or share it with a link\",\n ],\n },\n dispatch: {\n appName: \"Agent-Native Dispatch\",\n tagline:\n \"Your AI agent manages secrets, orchestrates other agents, and routes messages across your workspace.\",\n features: [\n \"Centralized vault for secrets with granular per-app grants\",\n \"Cross-agent orchestration and delegation to specialist apps\",\n \"Slack and Telegram routing with approval workflows\",\n ],\n },\n forms: {\n appName: \"Agent-Native Forms\",\n tagline:\n \"Your AI agent builds, publishes, and analyzes forms alongside you.\",\n features: [\n \"Create complete forms from a single sentence\",\n \"Instant publishing with shareable links and captcha\",\n \"Response summaries, exports, and trend analysis on demand\",\n ],\n },\n images: {\n appName: \"Agent-Native Images\",\n tagline:\n \"Your AI agent creates, refines, and organizes on-brand images alongside you.\",\n features: [\n \"Build reusable brand image libraries from logos, product shots, and references\",\n \"Generate heroes, diagrams, slide art, and product visuals from a prompt\",\n \"Audit prompts, references, outputs, and refinements across every run\",\n ],\n },\n mail: {\n appName: \"Agent-Native Mail\",\n tagline: \"Your AI agent reads, drafts, and organizes email alongside you.\",\n features: [\n \"Replies that match your tone and style\",\n \"Multi-account Gmail in a single unified inbox\",\n \"Autonomous triage, archiving, and follow-ups\",\n ],\n runLocalCommand:\n \"npx @agent-native/core create my-mail-app --template mail\",\n },\n \"meeting-notes\": {\n appName: \"Agent-Native Meeting Notes\",\n tagline:\n \"Your AI agent transcribes, enhances, and organizes your meeting notes while you focus on the conversation.\",\n features: [\n \"AI-enhanced meeting notes that merge raw notes with transcripts\",\n \"Smart contact and company tracking from meeting attendees\",\n \"Reusable templates for consistent note formatting\",\n ],\n },\n migration: {\n appName: \"Migration Workbench\",\n tagline:\n \"Move existing apps to agent-native with assessment, human approval, and deterministic verification.\",\n features: [\n \"Inventory routes, components, behavior, and content before touching output\",\n \"Approve plans before generated writes begin\",\n \"Verify output with structured migration reports\",\n ],\n },\n recruiting: {\n appName: \"Agent-Native Recruiting\",\n tagline:\n \"Your AI agent screens candidates, manages pipelines, and keeps your hiring on track.\",\n features: [\n \"AI resume analysis and candidate comparison\",\n \"Pipeline management with automated stage progression\",\n \"Scorecard tracking and overdue feedback alerts\",\n ],\n },\n scheduling: {\n appName: \"Agent-Native Scheduling\",\n tagline:\n \"Your AI agent manages availability, books meetings, and handles rescheduling alongside you.\",\n features: [\n \"Automatic round-robin and team scheduling across hosts\",\n \"Smart availability management with conflict detection\",\n \"Autonomous rescheduling, reminders, and follow-ups\",\n ],\n },\n slides: {\n appName: \"Agent-Native Slides\",\n tagline:\n \"Your AI agent builds, edits, and refines presentations alongside you.\",\n features: [\n \"Generate entire decks from a single prompt\",\n \"Surgical slide edits while you present or review\",\n \"Real-time collaboration between you and the agent\",\n ],\n },\n starter: {\n appName: \"Blank app\",\n tagline:\n \"Build an agent-native app where the AI agent and UI share state, actions, and context.\",\n features: [\n \"Define once, use everywhere: actions work as agent tools and API endpoints\",\n \"The agent always knows what you are looking at and can act on it\",\n \"Modify your app's own code, routes, and styles through conversation\",\n ],\n },\n videos: {\n appName: \"Agent-Native Videos\",\n tagline:\n \"Your AI agent builds, animates, and refines programmatic videos alongside you.\",\n features: [\n \"Generate animated components and compositions from a description\",\n \"Fine-tune tracks, keyframes, and easing without touching code\",\n \"Camera moves, interactive elements, and effects the agent wires for you\",\n ],\n },\n voice: {\n appName: \"Agent-Native Voice\",\n tagline:\n \"Speak to type anywhere with context-aware formatting, snippets, and custom vocabulary.\",\n features: [\n \"Push-to-talk or hands-free dictation with Whisper transcription\",\n \"Context-aware style presets for formal, casual, and excited tones\",\n \"Text expansion snippets and custom dictionary for tricky words\",\n ],\n },\n};\n\nconst SLUG_ALIASES: Record<string, string> = {\n \"agent-native\": \"\",\n \"blank-app\": \"starter\",\n \"migration-goal-surface\": \"migration\",\n video: \"videos\",\n};\n\nfunction cloneMarketing(marketing: AuthMarketingContent): AuthMarketingContent {\n return {\n ...marketing,\n features: marketing.features ? [...marketing.features] : undefined,\n };\n}\n\nfunction normalizeSlug(value: string | undefined): string | undefined {\n if (!value) return undefined;\n let slug = value.trim().toLowerCase();\n if (!slug) return undefined;\n\n slug = slug.replace(/^@agent-native\\//, \"\");\n slug = slug\n .replace(/&/g, \" and \")\n .replace(/[^a-z0-9]+/g, \"-\")\n .replace(/^-+|-+$/g, \"\");\n slug = slug.replace(/^agent-native-/, \"\");\n slug = SLUG_ALIASES[slug] ?? slug;\n if (!slug) return undefined;\n return BUILT_IN_AUTH_MARKETING[slug] ? slug : undefined;\n}\n\nfunction slugFromUrl(value: string | undefined): string | undefined {\n if (!value) return undefined;\n try {\n const url = new URL(value);\n return slugFromHost(url.host) ?? slugFromPath(url.pathname);\n } catch {\n return undefined;\n }\n}\n\nfunction slugFromHost(value: string | undefined): string | undefined {\n if (!value) return undefined;\n const host = value.split(\",\")[0]?.trim().split(\":\")[0]?.toLowerCase();\n if (!host) return undefined;\n if (host.endsWith(\".agent-native.com\")) {\n return normalizeSlug(host.slice(0, -\".agent-native.com\".length));\n }\n return undefined;\n}\n\nfunction slugFromPath(value: string | undefined): string | undefined {\n if (!value) return undefined;\n const firstSegment = value.split(\"?\")[0]?.split(\"/\").filter(Boolean)[0];\n return normalizeSlug(firstSegment);\n}\n\nfunction candidateSlugs(\n opts: ResolveBuiltInAuthMarketingOptions = {},\n): string[] {\n const env = process.env;\n const candidates = [\n opts.requestHost ? slugFromHost(opts.requestHost) : undefined,\n opts.requestPath ? slugFromPath(opts.requestPath) : undefined,\n normalizeSlug(env.AGENT_NATIVE_TEMPLATE),\n normalizeSlug(env.APP_NAME),\n normalizeSlug(env.npm_package_name),\n slugFromPath(env.APP_BASE_PATH),\n slugFromPath(env.VITE_APP_BASE_PATH),\n slugFromUrl(env.APP_URL),\n slugFromUrl(env.BETTER_AUTH_URL),\n slugFromUrl(env.VITE_BETTER_AUTH_URL),\n slugFromUrl(env.URL),\n slugFromUrl(env.DEPLOY_URL),\n slugFromUrl(env.DEPLOY_PRIME_URL),\n ];\n\n return candidates.filter((slug): slug is string => !!slug);\n}\n\nexport function resolveBuiltInAuthMarketing(\n opts: ResolveBuiltInAuthMarketingOptions = {},\n): AuthMarketingContent | undefined {\n for (const slug of candidateSlugs(opts)) {\n const marketing = BUILT_IN_AUTH_MARKETING[slug];\n if (marketing) return cloneMarketing(marketing);\n }\n return undefined;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/server/auth.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAyChE,KAAK,KAAK,GAAG,SAAS,CAAC;AAQvB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/server/auth.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAyChE,KAAK,KAAK,GAAG,SAAS,CAAC;AAQvB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAUlE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAwB5D,OAAO,EAIL,KAAK,oBAAoB,EAC1B,MAAM,qCAAqC,CAAC;AAc7C;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC;AAMD,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mFAAmF;IACnF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oEAAoE;IACpE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kEAAkE;IAClE,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,WAAW;IAC1B,mDAAmD;IACnD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;I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AAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAmBD,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,QAWd;AAED,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,2BAA2B,QAOnC;AAmGD;;;;;;GAMG;AACH,wBAAsB,YAAY,CAChC,KAAK,EAAE,OAAO,GACb,OAAO,CAAC,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC,CAG5C;AA+mBD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAY5E;AAgID,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAS7E;AA66CD;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,aAAa,CACjC,GAAG,EAAE,KAAK,EACV,OAAO,GAAE,WAAgB,GACxB,OAAO,CAAC,OAAO,CAAC,CAuLlB;AAMD;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI,CAEzE"}
|
package/dist/server/auth.js
CHANGED
|
@@ -40,7 +40,7 @@ function toWebRequest(event) {
|
|
|
40
40
|
import { getDbExec, isPostgres, intType, retryOnDdlRace, } from "../db/client.js";
|
|
41
41
|
import { getBetterAuth, getBetterAuthSync } from "./better-auth-instance.js";
|
|
42
42
|
import { getAllowedCorsOrigin, readCorsAllowedOrigins, } from "./cors-origins.js";
|
|
43
|
-
import { getOnboardingHtml, getResetPasswordHtml } from "./onboarding-html.js";
|
|
43
|
+
import { getOnboardingHtml, getResetPasswordHtml, } from "./onboarding-html.js";
|
|
44
44
|
import { readBody } from "../server/h3-helpers.js";
|
|
45
45
|
import { readDesktopSso, writeDesktopSso, clearDesktopSso, } from "./desktop-sso.js";
|
|
46
46
|
import { isElectron as isElectronRequest, getAppBasePath, getAppUrl, encodeOAuthState, decodeOAuthState, createOAuthSession, oauthCallbackResponse, oauthErrorPage, resolveOAuthRedirectUri, isAllowedOAuthRedirectUri, } from "./google-oauth.js";
|
|
@@ -594,6 +594,32 @@ export async function getSessionEmail(token) {
|
|
|
594
594
|
let customGetSession = null;
|
|
595
595
|
let _authGuardConfig = null;
|
|
596
596
|
const _genericGoogleOAuthRoutesEnabled = new WeakMap();
|
|
597
|
+
function getRequestHost(event) {
|
|
598
|
+
return (getHeader(event, "x-forwarded-host") ??
|
|
599
|
+
getHeader(event, "host") ??
|
|
600
|
+
undefined);
|
|
601
|
+
}
|
|
602
|
+
function getOnboardingHtmlOptions(options, event, rawPath) {
|
|
603
|
+
return {
|
|
604
|
+
googleOnly: options.googleOnly,
|
|
605
|
+
marketing: options.marketing,
|
|
606
|
+
googleSignInNotice: options.googleSignInNotice,
|
|
607
|
+
googleAuthMode: options.googleAuthMode,
|
|
608
|
+
requestHost: event ? getRequestHost(event) : undefined,
|
|
609
|
+
requestPath: rawPath,
|
|
610
|
+
};
|
|
611
|
+
}
|
|
612
|
+
function getAuthOnboardingHtml(options, event, rawPath) {
|
|
613
|
+
return getOnboardingHtml(getOnboardingHtmlOptions(options, event, rawPath));
|
|
614
|
+
}
|
|
615
|
+
function getOnboardingLoginHtmlConfig(options) {
|
|
616
|
+
if (options.loginHtml)
|
|
617
|
+
return { loginHtml: options.loginHtml };
|
|
618
|
+
return {
|
|
619
|
+
loginHtml: getAuthOnboardingHtml(options),
|
|
620
|
+
getLoginHtml: (event, rawPath) => getAuthOnboardingHtml(options, event, rawPath),
|
|
621
|
+
};
|
|
622
|
+
}
|
|
597
623
|
function resolveWorkspaceAppAudience(options = {}) {
|
|
598
624
|
return normalizeWorkspaceAppAudience(options.workspaceAppAudience ?? workspaceAppAudienceFromEnv());
|
|
599
625
|
}
|
|
@@ -2558,15 +2584,9 @@ async function mountBetterAuthRoutes(app, options) {
|
|
|
2558
2584
|
}));
|
|
2559
2585
|
// Auth guard — stored both in framework middleware registry AND in
|
|
2560
2586
|
// _authGuardFn so the server middleware can enforce it on ALL routes.
|
|
2561
|
-
const
|
|
2562
|
-
getOnboardingHtml({
|
|
2563
|
-
googleOnly: options.googleOnly,
|
|
2564
|
-
marketing: options.marketing,
|
|
2565
|
-
googleSignInNotice: options.googleSignInNotice,
|
|
2566
|
-
googleAuthMode: options.googleAuthMode,
|
|
2567
|
-
});
|
|
2587
|
+
const loginHtmlConfig = getOnboardingLoginHtmlConfig(options);
|
|
2568
2588
|
_authGuardConfig = {
|
|
2569
|
-
|
|
2589
|
+
...loginHtmlConfig,
|
|
2570
2590
|
publicPaths,
|
|
2571
2591
|
workspaceAppAudience,
|
|
2572
2592
|
workspaceAppPublicPaths: workspaceAppRouteAccess.publicPaths,
|
|
@@ -2778,14 +2798,9 @@ export async function autoMountAuth(app, options = {}) {
|
|
|
2778
2798
|
options.loginHtml ||
|
|
2779
2799
|
options.marketing ||
|
|
2780
2800
|
options.googleSignInNotice) {
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
googleOnly: options.googleOnly,
|
|
2785
|
-
marketing: options.marketing,
|
|
2786
|
-
googleSignInNotice: options.googleSignInNotice,
|
|
2787
|
-
googleAuthMode: options.googleAuthMode,
|
|
2788
|
-
});
|
|
2801
|
+
const loginHtmlConfig = getOnboardingLoginHtmlConfig(options);
|
|
2802
|
+
_authGuardConfig.loginHtml = loginHtmlConfig.loginHtml;
|
|
2803
|
+
_authGuardConfig.getLoginHtml = loginHtmlConfig.getLoginHtml;
|
|
2789
2804
|
}
|
|
2790
2805
|
if (options.publicPaths) {
|
|
2791
2806
|
_authGuardConfig.publicPaths = [
|
|
@@ -2893,15 +2908,9 @@ export async function autoMountAuth(app, options = {}) {
|
|
|
2893
2908
|
// CRITICAL: Even if Better Auth fails, register the auth guard so
|
|
2894
2909
|
// unauthenticated users can't access the app. They'll see the login
|
|
2895
2910
|
// page but won't be able to sign in until the DB is available.
|
|
2896
|
-
const
|
|
2897
|
-
getOnboardingHtml({
|
|
2898
|
-
googleOnly: options.googleOnly,
|
|
2899
|
-
marketing: options.marketing,
|
|
2900
|
-
googleSignInNotice: options.googleSignInNotice,
|
|
2901
|
-
googleAuthMode: options.googleAuthMode,
|
|
2902
|
-
});
|
|
2911
|
+
const loginHtmlConfig = getOnboardingLoginHtmlConfig(options);
|
|
2903
2912
|
_authGuardConfig = {
|
|
2904
|
-
|
|
2913
|
+
...loginHtmlConfig,
|
|
2905
2914
|
publicPaths,
|
|
2906
2915
|
workspaceAppAudience,
|
|
2907
2916
|
workspaceAppPublicPaths: workspaceAppRouteAccess.publicPaths,
|