@agent-native/core 0.56.0 → 0.57.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.
Files changed (48) hide show
  1. package/README.md +9 -7
  2. package/dist/cli/plan-local.d.ts.map +1 -1
  3. package/dist/cli/plan-local.js +66 -10
  4. package/dist/cli/plan-local.js.map +1 -1
  5. package/dist/cli/skills.d.ts +2 -2
  6. package/dist/cli/skills.d.ts.map +1 -1
  7. package/dist/cli/skills.js +13 -5
  8. package/dist/cli/skills.js.map +1 -1
  9. package/dist/client/AssistantChat.d.ts +8 -0
  10. package/dist/client/AssistantChat.d.ts.map +1 -1
  11. package/dist/client/AssistantChat.js +24 -4
  12. package/dist/client/AssistantChat.js.map +1 -1
  13. package/dist/client/agent-chat-adapter.d.ts.map +1 -1
  14. package/dist/client/agent-chat-adapter.js +39 -4
  15. package/dist/client/agent-chat-adapter.js.map +1 -1
  16. package/dist/client/chat/index.d.ts +1 -1
  17. package/dist/client/chat/index.d.ts.map +1 -1
  18. package/dist/client/chat/index.js +1 -0
  19. package/dist/client/chat/index.js.map +1 -1
  20. package/dist/client/chat/runtime.d.ts +93 -0
  21. package/dist/client/chat/runtime.d.ts.map +1 -1
  22. package/dist/client/chat/runtime.js +934 -1
  23. package/dist/client/chat/runtime.js.map +1 -1
  24. package/dist/client/index.d.ts +1 -1
  25. package/dist/client/index.d.ts.map +1 -1
  26. package/dist/client/index.js +1 -0
  27. package/dist/client/index.js.map +1 -1
  28. package/dist/deploy/build.d.ts.map +1 -1
  29. package/dist/deploy/build.js +14 -0
  30. package/dist/deploy/build.js.map +1 -1
  31. package/dist/mcp/build-server.d.ts.map +1 -1
  32. package/dist/mcp/build-server.js +48 -3
  33. package/dist/mcp/build-server.js.map +1 -1
  34. package/docs/content/actions.md +5 -1
  35. package/docs/content/agent-surfaces.md +258 -0
  36. package/docs/content/components.md +38 -17
  37. package/docs/content/drop-in-agent.md +10 -5
  38. package/docs/content/embedding-sdk.md +4 -0
  39. package/docs/content/external-agents.md +1 -0
  40. package/docs/content/getting-started.md +2 -0
  41. package/docs/content/key-concepts.md +3 -2
  42. package/docs/content/mcp-apps.md +1 -1
  43. package/docs/content/native-chat-ui.md +69 -22
  44. package/docs/content/plan-plugin.md +27 -1
  45. package/docs/content/pure-agent-apps.md +2 -1
  46. package/docs/content/using-your-agent.md +1 -0
  47. package/docs/content/what-is-agent-native.md +3 -2
  48. package/package.json +4 -2
package/README.md CHANGED
@@ -19,7 +19,7 @@ The agent and the UI are equal citizens of the same system. Every action works b
19
19
  - **Three shapes** — Build the same agent as a headless API, a rich chat experience, or a full application where agent and UI stay in sync.
20
20
  - **Apps that improve themselves** — Your apps get better on their own. The agent can add features, fix bugs, and refine the UI over time.
21
21
  - **Any database, any host** — Any SQL database Drizzle supports. Any hosting target Nitro supports. No lock-in.
22
- - **Bring the agent surface you need** — MCP-compatible hosts can call your apps, coding agents can install skills, native chat renders reusable app outputs, and AG-UI-style adapters can connect external runtimes to Agent-Native UI primitives over time.
22
+ - **Bring the agent surface you need** — MCP-compatible hosts can call your apps, coding agents can install skills, native chat renders reusable app outputs, and BYO agent runtimes can stream into the Agent-Native chat shell.
23
23
 
24
24
  ## The framework for agent-native apps
25
25
 
@@ -50,13 +50,15 @@ export default defineAction({
50
50
 
51
51
  Agent-Native primitives let you choose how much UI to put around an agent without rebuilding the agent contract:
52
52
 
53
- | Shape | What you ship | Same primitives underneath |
54
- | ------------- | --------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
55
- | **Headless** | Call the agent and actions from code, CLI, HTTP, MCP, or A2A. | `defineAction`, auth, skills, memory, jobs, observability |
56
- | **Rich chat** | A standalone or embedded chat with native tables, charts, approvals, setup flows, and tool results. | Shared chat runtime, action-declared native renderers, MCP Apps for external hosts |
57
- | **Whole app** | A full SaaS/product UI where chat can start central, move to the sidebar, and stay synced with app state. | SQL state, actions, context awareness, deep links, live sync |
53
+ | Shape | What you ship | Same primitives underneath |
54
+ | ------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
55
+ | **Headless** | Call the agent and actions from code, CLI, HTTP, MCP, or A2A. | `defineAction`, auth, skills, memory, jobs, observability |
56
+ | **Rich chat** | A standalone or embedded chat with native tables, charts, approvals, setup flows, and tool results. | Shared chat runtime, BYO runtime adapters, action-declared native renderers |
57
+ | **Whole app** | A full SaaS/product UI where chat can start central, move to the sidebar, and stay synced with app state. | SQL state, actions, context awareness, deep links, live sync |
58
58
 
59
- Protocols come with the framework instead of becoming separate integrations per feature. Today that means A2A, MCP, MCP Apps, standard remote MCP OAuth, MCP clients, HTTP/CLI action calls, native chat widgets, and deep links all hang off the same action surface. AG-UI is a natural adapter path for bring-your-own agent runtimes; ACP is best understood as the coding-agent/editor interoperability protocol, not the general BYO app-chat runtime.
59
+ Protocols come with the framework instead of becoming separate integrations per feature. Today that means A2A, MCP, MCP Apps, standard remote MCP OAuth, MCP clients, HTTP/CLI action calls, native chat widgets, `AgentChatRuntime` adapters, and deep links all hang off the same action surface. AG-UI is a natural future adapter path for bring-your-own agent runtimes; ACP is best understood as the coding-agent/editor interoperability protocol, not the general BYO app-chat runtime.
60
+
61
+ For the full decision guide — headless, rich chat on the built-in agent, rich chat on your own agent, embedded sidecar, or full app — see [Agent Surfaces](https://agent-native.com/docs/agent-surfaces).
60
62
 
61
63
  To connect Claude, ChatGPT, Codex, Cursor, OpenCode, GitHub Copilot / VS Code, or another MCP host to your hosted app, see the [External Agents guide](https://agent-native.com/docs/external-agents).
62
64
 
@@ -1 +1 @@
1
- {"version":3,"file":"plan-local.d.ts","sourceRoot":"","sources":["../../src/cli/plan-local.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAa,EAEX,KAAK,MAAM,EAEZ,MAAM,WAAW,CAAC;AAYnB,KAAK,aAAa,GAAG,MAAM,GAAG,OAAO,CAAC;AAEtC,KAAK,cAAc,GAAG;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,E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,CAAC;IACzB,OAAO,CAAC,EAAE,OAAO,KAAK,CAAC;CACxB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CA+EjC;AA0SD,wBAAsB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAmE3D"}
@@ -896,10 +896,27 @@ function isStaticNonEmptyStringLiteral(value) {
896
896
  return false;
897
897
  return trimmed.slice(1, -1).trim().length > 0;
898
898
  }
899
- function hasRequiredStaticId(objectSource) {
900
- const prop = readTopLevelObjectProperty(objectSource, "id");
899
+ function hasRequiredStaticString(objectSource, name) {
900
+ const prop = readTopLevelObjectProperty(objectSource, name);
901
901
  return prop ? isStaticNonEmptyStringLiteral(prop.value) : false;
902
902
  }
903
+ function hasRequiredStaticId(objectSource) {
904
+ return hasRequiredStaticString(objectSource, "id");
905
+ }
906
+ function hasRequiredEnumLiteral(objectSource, name, allowed) {
907
+ const prop = readTopLevelObjectProperty(objectSource, name);
908
+ if (!prop)
909
+ return false;
910
+ const trimmed = prop.value.trim();
911
+ const quote = trimmed[0];
912
+ if (quote !== '"' && quote !== "'" && quote !== "`")
913
+ return false;
914
+ if (!trimmed.endsWith(quote))
915
+ return false;
916
+ if (quote === "`" && /\$\{/.test(trimmed))
917
+ return false;
918
+ return allowed.includes(trimmed.slice(1, -1).trim());
919
+ }
903
920
  function lintChecklistShape(file, source, issues) {
904
921
  const scanSource = maskCodeRegions(source);
905
922
  const re = /<Checklist\b/g;
@@ -923,9 +940,13 @@ function lintChecklistShape(file, source, issues) {
923
940
  continue;
924
941
  }
925
942
  objects.forEach((item, index) => {
926
- if (hasRequiredStaticId(item.source))
927
- return;
928
- addValidationIssue(issues, file, source, start + items.start + item.start, `Checklist items[${index}].id is required by the Plan renderer schema; add a stable string id.`);
943
+ const base = start + items.start + item.start;
944
+ if (!hasRequiredStaticId(item.source)) {
945
+ addValidationIssue(issues, file, source, base, `Checklist items[${index}].id is required by the Plan renderer schema; add a stable string id.`);
946
+ }
947
+ if (!hasRequiredStaticString(item.source, "label")) {
948
+ addValidationIssue(issues, file, source, base, `Checklist items[${index}].label is required by the Plan renderer schema; add a non-empty string label.`);
949
+ }
929
950
  });
930
951
  }
931
952
  }
@@ -955,8 +976,19 @@ function lintQuestionFormShape(file, source, issues) {
955
976
  continue;
956
977
  }
957
978
  questionObjects.forEach((question, questionIndex) => {
979
+ const questionBase = start + questions.start + question.start;
958
980
  if (!hasRequiredStaticId(question.source)) {
959
- addValidationIssue(issues, file, source, start + questions.start + question.start, `${tag} questions[${questionIndex}].id is required by the Plan renderer schema; add a stable string id.`);
981
+ addValidationIssue(issues, file, source, questionBase, `${tag} questions[${questionIndex}].id is required by the Plan renderer schema; add a stable string id.`);
982
+ }
983
+ if (!hasRequiredStaticString(question.source, "title")) {
984
+ addValidationIssue(issues, file, source, questionBase, `${tag} questions[${questionIndex}].title is required by the Plan renderer schema; add a non-empty string title.`);
985
+ }
986
+ if (!hasRequiredEnumLiteral(question.source, "mode", [
987
+ "single",
988
+ "multi",
989
+ "freeform",
990
+ ])) {
991
+ addValidationIssue(issues, file, source, questionBase, `${tag} questions[${questionIndex}].mode is required by the Plan renderer schema; use "single", "multi", or "freeform".`);
960
992
  }
961
993
  const options = readTopLevelObjectProperty(question.source, "options");
962
994
  if (!options)
@@ -967,13 +999,17 @@ function lintQuestionFormShape(file, source, issues) {
967
999
  return;
968
1000
  }
969
1001
  optionObjects.forEach((option, optionIndex) => {
970
- if (hasRequiredStaticId(option.source))
971
- return;
972
- addValidationIssue(issues, file, source, start +
1002
+ const optionBase = start +
973
1003
  questions.start +
974
1004
  question.start +
975
1005
  options.valueStart +
976
- option.start, `${tag} questions[${questionIndex}].options[${optionIndex}].id is required by the Plan renderer schema; add a stable string id.`);
1006
+ option.start;
1007
+ if (!hasRequiredStaticId(option.source)) {
1008
+ addValidationIssue(issues, file, source, optionBase, `${tag} questions[${questionIndex}].options[${optionIndex}].id is required by the Plan renderer schema; add a stable string id.`);
1009
+ }
1010
+ if (!hasRequiredStaticString(option.source, "label")) {
1011
+ addValidationIssue(issues, file, source, optionBase, `${tag} questions[${questionIndex}].options[${optionIndex}].label is required by the Plan renderer schema; add a non-empty string label.`);
1012
+ }
977
1013
  });
978
1014
  });
979
1015
  }
@@ -1522,7 +1558,16 @@ async function runServe(args) {
1522
1558
  .filter(Boolean)
1523
1559
  .join("\n") + "\n");
1524
1560
  await new Promise((resolve) => {
1561
+ let stopped = false;
1562
+ const cleanup = () => {
1563
+ process.off("SIGINT", stop);
1564
+ process.off("SIGTERM", stop);
1565
+ };
1525
1566
  const stop = () => {
1567
+ if (stopped)
1568
+ return;
1569
+ stopped = true;
1570
+ cleanup();
1526
1571
  bridge.server.close(() => resolve());
1527
1572
  };
1528
1573
  process.once("SIGINT", stop);
@@ -1601,6 +1646,7 @@ const HELP = `agent-native plan — local Agent-Native Plan helpers
1601
1646
 
1602
1647
  Usage:
1603
1648
  agent-native plan blocks [--format reference|schema] [--app-url <url>] [--out <file>] [--json]
1649
+ agent-native plan serve --dir <folder> [--app-url <url>] [--kind plan|recap] [--open] [--port <port>] [--url-file <file>]
1604
1650
  agent-native plan local init --title <title> [--brief <text>] [--kind plan|recap] [--dir <folder>] [--force]
1605
1651
  agent-native plan local check --dir <folder>
1606
1652
  agent-native plan local serve --dir <folder> [--app-url <url>] [--kind plan|recap] [--open] [--port <port>] [--url-file <file>]
@@ -1632,6 +1678,7 @@ Safari may block the hosted HTTPS page from reading the HTTP localhost bridge.
1632
1678
  Use \`plan local verify\` for headless bridge/CORS diagnostics that exit cleanly.
1633
1679
  Use \`plan local preview\` for a local Plan dev server route. \`preview --out\` is
1634
1680
  a legacy/debug escape hatch that writes a standalone static HTML file.
1681
+ \`plan serve\` is kept as a compatibility alias for \`plan local serve\`.
1635
1682
  `;
1636
1683
  export async function runPlan(argv) {
1637
1684
  const [area, sub, ...rest] = argv;
@@ -1639,6 +1686,15 @@ export async function runPlan(argv) {
1639
1686
  await runBlocks(parseArgs(argv.slice(1)));
1640
1687
  return;
1641
1688
  }
1689
+ if (area === "serve") {
1690
+ const args = parseArgs(argv.slice(1));
1691
+ if (args.help === true || args.h === true) {
1692
+ process.stdout.write(HELP);
1693
+ return;
1694
+ }
1695
+ await runServe(args);
1696
+ return;
1697
+ }
1642
1698
  if (area !== "local") {
1643
1699
  // Bare `agent-native plan` / `plan help` / `plan --help` → show help on
1644
1700
  // stdout and exit 0 (informational, not an error).