@agent-native/core 0.80.1 → 0.80.4

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.
Files changed (59) hide show
  1. package/corpus/README.md +1 -1
  2. package/corpus/core/CHANGELOG.md +65 -0
  3. package/corpus/core/package.json +1 -1
  4. package/corpus/core/src/action.ts +11 -0
  5. package/corpus/core/src/agent/production-agent.ts +3 -0
  6. package/corpus/core/src/cli/plan-local.ts +445 -108
  7. package/corpus/core/src/cli/skills.ts +14 -5
  8. package/corpus/core/src/mcp/build-server.ts +1 -1
  9. package/corpus/core/src/mcp/embed-app.ts +35 -1
  10. package/corpus/core/src/server/action-routes.ts +14 -0
  11. package/corpus/core/src/vite/client.ts +15 -1
  12. package/corpus/templates/clips/app/components/player/timestamped-comment-button.tsx +162 -0
  13. package/corpus/templates/clips/app/i18n/ar-SA.ts +4 -0
  14. package/corpus/templates/clips/app/i18n/de-DE.ts +4 -0
  15. package/corpus/templates/clips/app/i18n/en-US.ts +4 -0
  16. package/corpus/templates/clips/app/i18n/es-ES.ts +4 -0
  17. package/corpus/templates/clips/app/i18n/fr-FR.ts +4 -0
  18. package/corpus/templates/clips/app/i18n/hi-IN.ts +4 -0
  19. package/corpus/templates/clips/app/i18n/ja-JP.ts +4 -0
  20. package/corpus/templates/clips/app/i18n/ko-KR.ts +4 -0
  21. package/corpus/templates/clips/app/i18n/pt-BR.ts +4 -0
  22. package/corpus/templates/clips/app/i18n/zh-CN.ts +4 -0
  23. package/corpus/templates/clips/app/i18n/zh-TW.ts +4 -0
  24. package/corpus/templates/clips/app/routes/r.$recordingId.tsx +42 -18
  25. package/corpus/templates/plan/.agents/skills/visual-plan/references/local-files.md +14 -5
  26. package/corpus/templates/plan/.agents/skills/visual-recap/references/local-files.md +14 -5
  27. package/corpus/templates/plan/actions/validate-local-plan-source.ts +118 -0
  28. package/corpus/templates/plan/server/lib/plan-connector-catalog.ts +1 -0
  29. package/corpus/templates/plan/server/lib/public-action-paths.ts +1 -0
  30. package/dist/action.d.ts +8 -0
  31. package/dist/action.d.ts.map +1 -1
  32. package/dist/action.js +3 -0
  33. package/dist/action.js.map +1 -1
  34. package/dist/agent/production-agent.d.ts +3 -0
  35. package/dist/agent/production-agent.d.ts.map +1 -1
  36. package/dist/agent/production-agent.js.map +1 -1
  37. package/dist/cli/plan-local.d.ts +30 -0
  38. package/dist/cli/plan-local.d.ts.map +1 -1
  39. package/dist/cli/plan-local.js +281 -56
  40. package/dist/cli/plan-local.js.map +1 -1
  41. package/dist/cli/skills.d.ts +1 -1
  42. package/dist/cli/skills.d.ts.map +1 -1
  43. package/dist/cli/skills.js +14 -5
  44. package/dist/cli/skills.js.map +1 -1
  45. package/dist/collab/routes.d.ts +1 -1
  46. package/dist/mcp/build-server.js +1 -1
  47. package/dist/mcp/build-server.js.map +1 -1
  48. package/dist/mcp/embed-app.d.ts.map +1 -1
  49. package/dist/mcp/embed-app.js +35 -1
  50. package/dist/mcp/embed-app.js.map +1 -1
  51. package/dist/resources/handlers.d.ts +1 -1
  52. package/dist/server/action-routes.d.ts.map +1 -1
  53. package/dist/server/action-routes.js +14 -0
  54. package/dist/server/action-routes.js.map +1 -1
  55. package/dist/server/transcribe-voice.d.ts +1 -1
  56. package/dist/vite/client.d.ts.map +1 -1
  57. package/dist/vite/client.js +12 -1
  58. package/dist/vite/client.js.map +1 -1
  59. package/package.json +1 -1
package/corpus/README.md CHANGED
@@ -28,4 +28,4 @@ rg -n "defineAction|useActionQuery" node_modules/@agent-native/core/corpus
28
28
  ## Generated Counts
29
29
 
30
30
  - core files: 2044
31
- - template files: 4557
31
+ - template files: 4559
@@ -1,5 +1,70 @@
1
1
  # @agent-native/core
2
2
 
3
+ ## 0.80.4
4
+
5
+ ### Patch Changes
6
+
7
+ - fa56720: Fix video playback failing in workspace dev mode. When a browser requested video bytes (range/streaming requests), the dev server was stripping the app base path prefix before Nitro's media handler could run, causing Vite to return an error page instead of the video.
8
+
9
+ ## 0.80.3
10
+
11
+ ### Patch Changes
12
+
13
+ - 995dd3b: Add an opt-in `maxBodyBytes` option to `defineAction`. When set, the action
14
+ HTTP route rejects oversize requests with 413 based on the declared
15
+ `Content-Length` BEFORE buffering or parsing the body.
16
+
17
+ This closes a gap for public, no-auth POST actions: previously the router parsed
18
+ the full JSON body before any in-`run()` size check, so a large anonymous
19
+ request could force parse work on an unauthenticated route. The check is
20
+ runtime-agnostic (header only), so it works on both the web-`Request.json()` and
21
+ Node `readBody` paths, and is unset by default so existing actions are
22
+ unaffected. The Plan template's public `validate-local-plan-source` action opts
23
+ in.
24
+
25
+ - 995dd3b: Make `plan local verify` validate plan content against the real renderer
26
+ schema, and stop `plan local check` from reporting false greens.
27
+
28
+ Previously both headless commands could pass a plan the renderer later rejects:
29
+ `check` ran a hand-rolled regex lint (a subset of the schema that never
30
+ inspected blocks authored as JSON inside a container's `tabs={[…]}` /
31
+ `columns={[…]}` array), and `verify` only checked bridge/CORS transport, never
32
+ the content. The plan then got stuck on "Loading plan" when rendered.
33
+
34
+ Now:
35
+ - `verify` POSTs the MDX folder to the Plan app's new, public, no-DB
36
+ `validate-local-plan-source` action, which runs the renderer's own
37
+ `parsePlanMdxFolder` + `planContentSchema`. Its verdict gates `verify`'s
38
+ `ok`, and rejected plans surface the renderer's exact schema-path issue
39
+ (e.g. `blocks[1].data.tabs[0].blocks[0].data.items[0].id`). When the endpoint
40
+ is unavailable (older/unreachable Plan app), `verify` degrades to the
41
+ transport checks and warns that content was not validated, rather than
42
+ hard-failing.
43
+ - `check` now recurses into nested `tabs` block arrays so the common
44
+ nested-checklist / question-form / missing-`id` case is caught offline, and
45
+ it no longer reports `validation: "passed"`. It reports a clearly-scoped
46
+ `lint-passed` with a note pointing to `verify` for authoritative validation.
47
+
48
+ ## 0.80.2
49
+
50
+ ### Patch Changes
51
+
52
+ - 7b44f20: Fix MCP App embeds never becoming visible in ChatGPT/Codex (stuck on "Loading
53
+ app", then the fallback panel). Two shell bugs in the inline-embed render path:
54
+ 1. `launchEmbed` called `setMessage("Loading app")` before the dedupe check, so
55
+ the constant `openai:set_globals`-driven relaunches wiped the just-mounted
56
+ iframe out of the stage on every cycle — the app rendered and was instantly
57
+ blanked, never reaching its ready handshake. The loading message now only
58
+ shows when no frame is mounted.
59
+ 2. The `openai:set_globals` handler re-synced unconditionally, and the sync
60
+ itself called `notifyHostHeight()`/`sendHostContext()`, which the host
61
+ reflected back as another `set_globals` — an infinite feedback storm that
62
+ starved the host into its sad-face placeholder. `syncOpenAiBridge` now
63
+ short-circuits when the relevant globals (tool input, open URLs, display
64
+ mode, theme, locale) are unchanged.
65
+
66
+ Bumps the embed shell version so hosts refetch the fixed shell.
67
+
3
68
  ## 0.80.1
4
69
 
5
70
  ### Patch Changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-native/core",
3
- "version": "0.80.1",
3
+ "version": "0.80.4",
4
4
  "description": "Framework for agent-native application development — where AI agents and UI share SQL state, actions, and context",
5
5
  "homepage": "https://github.com/BuilderIO/agent-native#readme",
6
6
  "bugs": {
@@ -326,6 +326,10 @@ interface DefineActionWithSchema<
326
326
  * Defaults to true. Set to false only for metadata/read actions that safely
327
327
  * handle `ctx.userEmail` / `getRequestUserEmail()` being undefined. */
328
328
  requiresAuth?: boolean;
329
+ /** Max HTTP request body in bytes. When set, the route 413s on the declared
330
+ * `Content-Length` before parsing. Use for public, no-auth POST actions;
331
+ * unset = no route-level cap. */
332
+ maxBodyBytes?: number;
329
333
  /** Whether this action is exposed to the agent — the in-app assistant and the
330
334
  * app's MCP/A2A tool surfaces — as a callable tool. **Default-allow opt-out**:
331
335
  * `undefined` / `true` expose it; only an explicit `false` hides it from every
@@ -439,6 +443,9 @@ interface DefineActionWithParams<
439
443
  /** Whether the HTTP/frontend action route must have an authenticated owner.
440
444
  * Defaults to true. See the schema overload above. */
441
445
  requiresAuth?: boolean;
446
+ /** Max HTTP request body in bytes; 413s on `Content-Length` before parsing.
447
+ * See the schema overload above. */
448
+ maxBodyBytes?: number;
442
449
  /** Whether this action is exposed to the agent as a callable tool. Only an
443
450
  * explicit `false` hides it from every agent tool list while keeping it
444
451
  * frontend/HTTP-callable. See the schema overload above and actions.md. */
@@ -504,6 +511,7 @@ export interface ActionDefinition<TInput, TReturn> {
504
511
  readonly tool: import("./agent/types.js").ActionTool;
505
512
  readonly http?: ActionHttpConfig | false;
506
513
  readonly requiresAuth?: boolean;
514
+ readonly maxBodyBytes?: number;
507
515
  readonly agentTool?: boolean;
508
516
  readonly readOnly?: boolean;
509
517
  readonly parallelSafe?: boolean;
@@ -724,6 +732,9 @@ export function defineAction(options: any) {
724
732
  ...(typeof options.requiresAuth === "boolean"
725
733
  ? { requiresAuth: options.requiresAuth }
726
734
  : {}),
735
+ ...(typeof options.maxBodyBytes === "number"
736
+ ? { maxBodyBytes: options.maxBodyBytes }
737
+ : {}),
727
738
  ...(typeof agentTool === "boolean" ? { agentTool } : {}),
728
739
  ...(typeof readOnly === "boolean" ? { readOnly } : {}),
729
740
  ...(typeof parallelSafe === "boolean" ? { parallelSafe } : {}),
@@ -534,6 +534,9 @@ export interface ActionEntry {
534
534
  * Defaults to true; false lets safe metadata/read actions run with
535
535
  * `ctx.userEmail` undefined when auth resolution returns 401/403. */
536
536
  requiresAuth?: boolean;
537
+ /** Max HTTP request body in bytes; the route 413s on `Content-Length` before
538
+ * parsing. For public, no-auth POST actions. */
539
+ maxBodyBytes?: number;
537
540
  /** Whether the action is exposed to the agent as a callable tool. Only an
538
541
  * explicit `false` hides it from every agent tool surface (in-app assistant,
539
542
  * MCP, A2A, job/trigger runners) while leaving it frontend/HTTP-callable.