@agent-native/core 0.51.6 → 0.51.7

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.
@@ -67,14 +67,6 @@ The app has three primary surfaces you'll spend time in:
67
67
 
68
68
  The dictionary is seeded by asking the agent: "import our dbt definitions" or "pull the metrics from our Notion handbook" and it does the work.
69
69
 
70
- ## Why it's interesting
71
-
72
- Three things make Analytics a good showcase of the framework:
73
-
74
- 1. **The data dictionary keeps SQL grounded.** The agent consults the dictionary before writing any query, so it uses real warehouse column names and honors documented caveats. The dictionary is itself an agent-native resource — seeded and edited through the same chat interface that runs the queries.
75
- 2. **Multi-source, single action surface.** BigQuery, GA4, Mixpanel, Amplitude, HubSpot, Jira, and a dozen other sources are each a single action file. Adding a new connector is adding a file; the agent picks it up automatically with no registration step.
76
- 3. **Reusable workspace integrations.** When a workspace already has a provider connected (e.g. HubSpot), Analytics requests a grant instead of requiring a second copy of the same credentials. The Data Sources page shows workspace-level readiness alongside local-credential status.
77
-
78
70
  ## For developers
79
71
 
80
72
  The rest of this doc is for anyone forking the Analytics template or extending it.
@@ -83,12 +83,6 @@ Generate and pick brand media without leaving Codex, Claude Code, Claude, or Cha
83
83
 
84
84
  4. **Apply to code.** The chosen Media URL and `assetId` come back to the agent, which uses the URL directly in the code it writes (an `<img>` src, a download) or calls `export-asset`.
85
85
 
86
- ## Why it's interesting
87
-
88
- Most AI media tools treat brand consistency as a prompt-writing problem. Assets treats it as application state: references, folders, collections, style briefs, run history, descriptions, and saved assets live in SQL, while binary media lives in object storage or the local file-upload fallback during development.
89
-
90
- Because generation and library management are actions and chat workflows, the UI and the agent share the same operations. A user can start from the big prompt box, a library detail page, another app's chat, or an A2A request from Slides, and the same audit and lineage model is preserved. Once enabled, the provider path prefers Builder-managed image generation so teams do not need to paste model-provider keys into every app.
91
-
92
86
  ## For developers
93
87
 
94
88
  The rest of this doc is for anyone forking the Assets template or extending it.
@@ -79,14 +79,6 @@ For a public demo, the seeded corpus demonstrates product-decision recall,
79
79
  citation links, supersede behavior, review gating, redaction, personal-content
80
80
  exclusion, and honest not-found behavior without connecting a real workspace.
81
81
 
82
- ## Why it's interesting
83
-
84
- Three things make Brain a good showcase of the framework:
85
-
86
- 1. **No vector database required.** Brain uses SQL text search with agentic query expansion, so it stays portable across SQLite, Postgres, Neon, D1, and Turso without an additional service dependency. This demonstrates that semantic-enough retrieval can be built without embedding infrastructure.
87
- 2. **Human-in-the-loop distillation.** Raw captures don't become company knowledge automatically. High-confidence entries can auto-publish; sensitive or low-confidence ones queue as proposals for human review. The Review surface is a first-class part of the product, not a settings screen.
88
- 3. **Shared workspace integrations.** Brain sources resolve credentials from workspace grants first, not duplicated env vars. It's a live example of the grant pattern — one Slack token at workspace level, per-app access requests.
89
-
90
82
  ## For developers
91
83
 
92
84
  The rest of this section is for anyone forking or extending the Brain template.
@@ -61,14 +61,6 @@ Or just ask the agent: "Create a 15-minute intro booking link with a name field.
61
61
 
62
62
  The agent will query Google Calendar live for any schedule question — it never guesses.
63
63
 
64
- ## Why it's interesting
65
-
66
- Three things make Calendar a good showcase of the framework:
67
-
68
- 1. **Live API queries, no local sync.** Events live in Google Calendar; the app queries the API on demand rather than maintaining a local mirror. This avoids stale data and webhook infrastructure while still giving the agent full read/write access through actions.
69
- 2. **Booking links as a Calendly replacement.** The public booking page (`/book/{slug}`) is stateless to visitors — it queries availability live and creates a booking on submit. The `booking_link_shares` table wires into the framework sharing primitive so teammates can manage links collaboratively.
70
- 3. **Multi-account overlay.** Connecting a second Google account is an action call; the UI overlays events from all connected calendars in the same view. This pattern — one row per account in `oauth_tokens`, list action that fans out — is reusable for any multi-account integration.
71
-
72
64
  ## For developers
73
65
 
74
66
  The rest of this doc is for anyone forking the Calendar template or extending it.
@@ -51,14 +51,6 @@ Live demo: [clips.agent-native.com](https://clips.agent-native.com).
51
51
  - "Create action items from the last sales call."
52
52
  - "Clean up this dictation and turn it into a Linear ticket."
53
53
 
54
- ## Why it's interesting
55
-
56
- Three things make Clips a good showcase of what agent-native enables:
57
-
58
- 1. **The agent edits the transcript.** Fix a mis-transcribed word, generate chapter timestamps, pull quotes for a blog post — all in natural language, in the chat, with the UI updating live via polling.
59
- 2. **Context awareness on recordings.** When you're viewing a clip, the agent knows the clip id, the current playhead, and the selected transcript range. Ask "summarize from here to the end" and it understands what "here" means.
60
- 3. **Clips you own, not a vendor.** The recordings live in your storage, the transcripts live in your SQL, and the agent is yours. Fork the template, change how chapters get built, wire it to your own CDN — it's your code.
61
-
62
54
  ## For developers
63
55
 
64
56
  The rest of this doc is for anyone forking the Clips template or extending it.
@@ -86,20 +86,6 @@ SQL-backed sharing. See [Local File Mode](/docs/local-file-mode) for the
86
86
  standalone repo layout, configuration, custom MDX components, local
87
87
  `extensions/` widgets, and production safety guide.
88
88
 
89
- ## Why it's interesting
90
-
91
- Five things make Content a good showcase of the framework:
92
-
93
- 1. **Local MDX can be the source of truth.** Content can operate directly on
94
- repo files while keeping the same editor and action surface, which makes it
95
- feel like open-source Obsidian for MDX rather than a hosted-only doc store.
96
- 2. **Custom interactive blocks are just local code.** Docs can use workspace
97
- components such as tabs, calculators, or product-specific demos, and the
98
- agent can generate or edit those components alongside the MDX.
99
- 3. **Agent and editor share one Yjs document.** The same CRDT that prevents conflicts between two simultaneous human typists is what the agent writes through via `edit-document`. There is no separate AI path — the diff appears live in every open browser tab.
100
- 4. **Notion sync as a two-way bridge.** Rather than replacing Notion, the template treats it as a peer: pull, push, bidirectional comment sync, conflict detection, and content-hash deduplication are all first-class. It demonstrates how agent-native apps can round-trip with external systems without losing their SQL-backed canonical form.
101
- 5. **Inline databases alongside prose.** The `content_databases` / `content_database_items` / `document_property_definitions` stack shows how structured tabular data can live inside an agent-native document without needing a separate app or a custom Airtable integration.
102
-
103
89
  ## For developers
104
90
 
105
91
  The rest of this doc is for anyone forking the Content template or extending it.
@@ -41,12 +41,6 @@ Live demo: [design.agent-native.com](https://design.agent-native.com).
41
41
  - "Export this prototype as a ZIP once the final variant is selected."
42
42
  - "Turn this HTML into a stronger pricing page without changing the brand colors."
43
43
 
44
- ## Why it's interesting
45
-
46
- Design is useful because the agent edits an artifact that is already close to shippable web UI. There is no separate "AI mockup" format to translate later: the preview, the editable source, and the exported artifact all come from the same HTML.
47
-
48
- The template is also a good example of agent-native ownership. The app stores designs in SQL, exposes template operations as actions, and lets you fork the whole workflow when your team needs a different renderer, exporter, or design-system model.
49
-
50
44
  ## For developers
51
45
 
52
46
  The rest of this doc is for anyone forking the Design template or extending it.
@@ -49,16 +49,6 @@ Live demo: [forms.agent-native.com](https://forms.agent-native.com).
49
49
  - "Summarize this week's submissions and group them by customer segment."
50
50
  - "Make this form shorter without losing the fields we need for routing."
51
51
 
52
- ## Why it's interesting
53
-
54
- Three things make Forms a good showcase of the framework:
55
-
56
- 1. **Single SQL record, two editors.** The form's `fields` JSON column is the source of truth for both the visual builder and the agent. Ask the agent to add a field and the builder re-renders — no sync step, no separate "AI draft" state.
57
- 2. **Public and private surfaces from one schema.** The same form row serves authenticated editors (full field + settings access) and anonymous respondents (public fill page with secrets stripped). `toPublicFormSettings` handles the split at the action layer.
58
- 3. **Integrations as settings, not infrastructure.** Slack, Discord, Google Sheets, and webhook destinations are stored as JSON in the form's settings column and executed server-side at submission time — adding a new integration type is an action-layer change, not a schema migration.
59
-
60
- See [What is agent-native?](/docs/what-is-agent-native) for the broader framework model.
61
-
62
52
  ## For developers
63
53
 
64
54
  ### Scaffolding
@@ -82,14 +82,6 @@ If you select text and hit Cmd+I, that selection travels with your next message
82
82
  | `G A` | Go to Archive |
83
83
  | `Esc` | Close thread / clear search |
84
84
 
85
- ## Why it's interesting
86
-
87
- Three things make Mail a good showcase of the framework:
88
-
89
- 1. **Gmail as a view, not a copy.** Email lives in Gmail; the app is a fast keyboard-first view on top. Actions like `list-emails` and `search-emails` query the Gmail API live rather than maintaining a local sync — demonstrating how agent-native apps can wrap external services without duplicating state.
90
- 2. **Shared compose state between the agent and the UI.** Each draft tab is an `application_state` entry at `compose-{id}`. The agent can create, edit, or close drafts via `manage-draft`; the UI reads the same entry and renders it live. No separate draft format, no polling — same row.
91
- 3. **Queued-draft review.** Teammates or Slack users can ask the agent to prepare an email on behalf of an org member. The draft sits in the `queued_email_drafts` SQL table until the owner reviews and explicitly sends — demonstrating how agent-native apps can keep humans in the loop for consequential, irreversible actions.
92
-
93
85
  ## For developers
94
86
 
95
87
  The rest of this doc is for anyone forking the Mail template or extending it.
@@ -298,6 +298,186 @@ Actions in `templates/plan/actions/`:
298
298
  - **Prototype** — `convert-visual-plan-to-prototype`, `create-prototype-plan`
299
299
  - **Context & navigation** — `view-screen`, `navigate`
300
300
 
301
+ ### Custom MDX blocks {#custom-mdx-blocks}
302
+
303
+ Plans source files are MDX, but the app does not render arbitrary imported JSX
304
+ components. A custom MDX tag must be registered as a Plan block so the server can
305
+ parse and serialize it, the browser can render and edit it, and the agent can
306
+ see it in the block vocabulary returned by `get-plan-blocks`.
307
+
308
+ A registered block has three surfaces:
309
+
310
+ - A React-free schema and MDX config, safe for server and agent code.
311
+ - A normalized runtime type/schema entry in `shared/plan-content.ts`.
312
+ - A browser block spec with `Read` and optional `Edit` React components.
313
+
314
+ Keep the block `type` and MDX `tag` stable. The `type` is stored in normalized
315
+ plan JSON; the `tag` is the component name in `plan.mdx`. The registry handles
316
+ the base MDX attributes `id`, `title`, `summary`, and `editable`, so do not
317
+ repeat them in `toAttrs`.
318
+
319
+ 1. Add a shared config for the data shape and MDX round trip.
320
+
321
+ ```ts
322
+ // templates/plan/shared/risk-card.config.ts
323
+ import { z } from "zod";
324
+ import {
325
+ markdown,
326
+ type BlockMdxConfig,
327
+ } from "@agent-native/core/blocks/server";
328
+
329
+ export type RiskCardSeverity = "low" | "medium" | "high";
330
+
331
+ export interface RiskCardData {
332
+ severity?: RiskCardSeverity;
333
+ body: string;
334
+ }
335
+
336
+ const severities = new Set(["low", "medium", "high"]);
337
+
338
+ export const riskCardSchema = z.object({
339
+ severity: z.enum(["low", "medium", "high"]).optional(),
340
+ body: markdown(z.string().trim().min(1).max(10_000)),
341
+ }) as z.ZodType<RiskCardData>;
342
+
343
+ export const riskCardMdx: BlockMdxConfig<RiskCardData> = {
344
+ tag: "RiskCard",
345
+ childrenField: "body",
346
+ toAttrs: (data) => ({
347
+ severity: data.severity,
348
+ }),
349
+ fromAttrs: (attrs, children) => {
350
+ const severity = attrs.string("severity");
351
+
352
+ return {
353
+ severity: severities.has(severity ?? "")
354
+ ? (severity as RiskCardSeverity)
355
+ : undefined,
356
+ body: children,
357
+ };
358
+ },
359
+ };
360
+ ```
361
+
362
+ 2. Extend the normalized Plan content model in
363
+ `templates/plan/shared/plan-content.ts`.
364
+
365
+ Add the new `type` to `PlanBlockType`, add a matching block interface to the
366
+ `PlanBlock` union, and add the same data shape to `planBlockSchema`. This keeps
367
+ database saves, source imports, and `update-block` patches validating the custom
368
+ block instead of rejecting it as an unknown type.
369
+
370
+ 3. Register the React-free server spec in
371
+ `templates/plan/shared/plan-block-registry.ts`.
372
+
373
+ ```ts
374
+ import {
375
+ BlockRegistry,
376
+ defineBlock,
377
+ registerLibraryBlockConfigs,
378
+ registerBlocks,
379
+ } from "@agent-native/core/blocks/server";
380
+ import {
381
+ riskCardMdx,
382
+ riskCardSchema,
383
+ type RiskCardData,
384
+ } from "./risk-card.config.js";
385
+
386
+ const ServerReadStub = () => null;
387
+
388
+ const riskCardServerBlock = defineBlock<RiskCardData>({
389
+ type: "risk-card",
390
+ schema: riskCardSchema,
391
+ mdx: riskCardMdx,
392
+ Read: ServerReadStub,
393
+ placement: ["block"],
394
+ label: "Risk card",
395
+ description: "A markdown risk note with a low, medium, or high severity.",
396
+ });
397
+
398
+ export function registerPlanBlocks(registry: BlockRegistry): void {
399
+ registerLibraryBlockConfigs(registry, {
400
+ overrides: PLAN_SERVER_LIBRARY_OVERRIDES,
401
+ });
402
+ registerBlocks(registry, [riskCardServerBlock]);
403
+ }
404
+ ```
405
+
406
+ 4. Register the browser spec in
407
+ `templates/plan/app/components/plan/planBlocks.tsx`.
408
+
409
+ ```tsx
410
+ import {
411
+ defineBlock,
412
+ registerLibraryBlocks,
413
+ registerBlocks,
414
+ type BlockReadProps,
415
+ } from "@agent-native/core/blocks";
416
+ import {
417
+ riskCardMdx,
418
+ riskCardSchema,
419
+ type RiskCardData,
420
+ } from "@shared/risk-card.config";
421
+
422
+ function RiskCardBlock({ data, blockId, ctx }: BlockReadProps<RiskCardData>) {
423
+ return (
424
+ <section
425
+ className="rounded-md border border-border bg-card p-4"
426
+ data-block-id={blockId}
427
+ data-severity={data.severity}
428
+ >
429
+ <div className="mb-2 text-xs font-semibold uppercase text-muted-foreground">
430
+ {data.severity ?? "risk"}
431
+ </div>
432
+ {ctx.renderMarkdown?.(data.body) ?? (
433
+ <p className="whitespace-pre-wrap text-sm">{data.body}</p>
434
+ )}
435
+ </section>
436
+ );
437
+ }
438
+
439
+ const riskCardBlock = defineBlock<RiskCardData>({
440
+ type: "risk-card",
441
+ schema: riskCardSchema,
442
+ mdx: riskCardMdx,
443
+ Read: RiskCardBlock,
444
+ placement: ["block"],
445
+ editSurface: "panel",
446
+ label: "Risk card",
447
+ description: "A markdown risk note with a low, medium, or high severity.",
448
+ empty: () => ({ severity: "medium", body: "Describe the risk." }),
449
+ });
450
+
451
+ registerLibraryBlocks(planBlockRegistry, {
452
+ overrides: PLAN_LIBRARY_OVERRIDES,
453
+ });
454
+ registerBlocks(planBlockRegistry, [riskCardBlock]);
455
+ ```
456
+
457
+ With that in place, Plan MDX can use:
458
+
459
+ ```mdx
460
+ <RiskCard id="risk-auth" severity="high">
461
+
462
+ Token refresh failures can strand active reviewer sessions.
463
+
464
+ </RiskCard>
465
+ ```
466
+
467
+ The server registry makes this source importable/exportable, and the client
468
+ registry makes it render in `PlanBlockView`. If the block should be generated by
469
+ agents, keep `label`, `description`, `placement`, and `empty` precise; those
470
+ fields flow into the live block vocabulary.
471
+
472
+ When overriding an existing block, register the override after the shared
473
+ library registration. Last registration wins for both `type` and MDX `tag`.
474
+
475
+ After adding a block, run focused Plan tests:
476
+
477
+ ```bash
478
+ pnpm --filter plan test -- plan-mdx plan-block-registry
479
+ ```
480
+
301
481
  ### Route map
302
482
 
303
483
  - `app/routes/plans.$id.tsx` — plan editor / review surface
@@ -54,14 +54,6 @@ When you open the app:
54
54
 
55
55
  Select text on a slide and hit Cmd+I to focus the agent with that selection — it'll act only on what you selected.
56
56
 
57
- ## Why it's interesting
58
-
59
- Three things make Slides a good showcase of the framework:
60
-
61
- 1. **Streamed, parallel generation.** The agent fires parallel `add-slide` calls so you see the deck assemble in real time — one slide at a time — rather than waiting for a full batch. That pattern works for any content type that benefits from progressive rendering.
62
- 2. **Agent and editor share one document.** The same Yjs CRDT that lets two humans type concurrently is what the agent writes through via `update-slide --find/--replace`. There is no separate "AI-only" edit path.
63
- 3. **Multi-modal source ingestion.** PPTX, DOCX, Google Docs, PDFs, URLs, and GitHub repos all feed through the same `import-*` action surface. Adding a new source format is a single action file; the agent picks it up immediately.
64
-
65
57
  ## For developers
66
58
 
67
59
  The rest of this doc is for anyone forking the Slides template or extending it.
@@ -52,14 +52,6 @@ When you open the studio:
52
52
 
53
53
  If you select a track in the timeline and hit Cmd+I, the agent picks up that selection — "make this one snappier" just works.
54
54
 
55
- ## Why it's interesting
56
-
57
- Three things make the Video template a good showcase of the framework:
58
-
59
- 1. **Code as the authoring format.** Each composition is a React component, so the agent can write entirely new animation types — not just adjust parameters. The template demonstrates that an agent-native app can treat source code as a first-class editable artifact rather than a fixed runtime.
60
- 2. **Track-based animation as structured data.** Animations are `AnimationTrack` rows (start, end, easing, animated props) rather than hardcoded frame checks. This makes AI edits ("shift this track 10 frames later") reliable and composable without touching render logic.
61
- 3. **SQL + localStorage fusion.** User-created compositions persist in SQL; per-session tweaks (easing experiments, parameter knobs) persist in localStorage and deep-merge on load. This two-layer approach shows how to keep the agent's durable state separate from ephemeral in-session exploration.
62
-
63
55
  ## For developers
64
56
 
65
57
  The rest of this doc is for anyone forking the Video template or extending it. This template is more code-forward than the others — every composition is a React component and every animation is data on a track.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-native/core",
3
- "version": "0.51.6",
3
+ "version": "0.51.7",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": ">=22"
@@ -108,6 +108,8 @@
108
108
  "./usage": "./dist/usage/store.js",
109
109
  "./connections": "./dist/connections/index.js",
110
110
  "./provider-api": "./dist/provider-api/index.js",
111
+ "./provider-api/corpus-jobs": "./dist/provider-api/corpus-jobs.js",
112
+ "./provider-api/corpus-jobs-store": "./dist/provider-api/corpus-jobs-store.js",
111
113
  "./provider-api/staging": "./dist/provider-api/staging.js",
112
114
  "./provider-api/staged-datasets-store": "./dist/provider-api/staged-datasets-store.js",
113
115
  "./provider-api/staged-datasets-aggregate": "./dist/provider-api/staged-datasets-aggregate.js",