@agent-native/core 0.203.0-nightly-20261007064822 → 0.203.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 (63) hide show
  1. package/dist/agent/engine/builder-engine.d.ts +1 -1
  2. package/dist/agent/model-config.d.ts +2 -2
  3. package/dist/agent/model-config.js +0 -2
  4. package/dist/agent/thread-data-builder.d.ts +6 -0
  5. package/dist/agent/thread-data-builder.js +747 -25
  6. package/dist/agent/thread-message-projection.d.ts +20 -0
  7. package/dist/agent/thread-message-projection.js +300 -0
  8. package/dist/automation/index.d.ts +1 -1
  9. package/dist/chat-threads/store.d.ts +4 -1
  10. package/dist/chat-threads/store.js +92 -17
  11. package/dist/cli/skills-content/turn-into-app-skill.d.ts +10 -4
  12. package/dist/cli/skills-content/turn-into-app-skill.js +2454 -705
  13. package/dist/cli/skills.d.ts +6 -0
  14. package/dist/cli/skills.js +8 -2
  15. package/dist/client/chat/agentkit-agent-native.js +839 -89
  16. package/dist/client/chat/agentkit-protocol.js +67 -17
  17. package/dist/collab/routes.d.ts +2 -2
  18. package/dist/jobs/actions/manage-recurring-job.d.ts +1 -1
  19. package/dist/mcp/build-server.d.ts +5 -1
  20. package/dist/mcp/build-server.js +56 -13
  21. package/dist/mcp/embed-app.js +6 -1
  22. package/dist/notifications/routes.d.ts +1 -1
  23. package/dist/observability/routes.d.ts +3 -3
  24. package/dist/org/index.d.ts +2 -2
  25. package/dist/provider-api/actions/provider-api.d.ts +4 -4
  26. package/dist/resources/handlers.d.ts +1 -1
  27. package/dist/server/agent-chat/mcp-options.d.ts +4 -0
  28. package/dist/server/agent-chat-plugin.js +97 -22
  29. package/dist/server/agent-engine-default-model-route.d.ts +2 -2
  30. package/dist/server/onboarding-html.js +1 -1
  31. package/dist/server/realtime-token.d.ts +1 -1
  32. package/dist/server/transcribe-voice.d.ts +1 -1
  33. package/dist/shared/embed-auth.js +5 -4
  34. package/dist/sharing/actions/list-resource-shares.d.ts +1 -1
  35. package/dist/templates/factory/.agents/skills/review-latest-feedback/SKILL.md +26 -24
  36. package/dist/templates/factory/.agents/skills/review-latest-feedback/references/deployment-recovery.md +53 -0
  37. package/dist/templates/factory/.agents/skills/review-latest-feedback/references/documentation-proof.md +7 -0
  38. package/dist/templates/workspace-core/.agents/skills/turn-into-app/SKILL.md +284 -461
  39. package/dist/templates/workspace-core/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  40. package/dist/templates/workspace-core/.agents/skills/turn-into-app/references/fresh-project.md +65 -90
  41. package/dist/templates/workspace-core/.agents/skills/turn-into-app/references/local-run-and-deploy.md +161 -0
  42. package/dist/templates/workspace-core/.agents/skills/turn-into-app/references/review-loop.md +384 -0
  43. package/dist/templates/workspace-core/.agents/skills/turn-into-app/references/source-brief.md +116 -0
  44. package/dist/templates/workspace-core/.agents/skills/turn-into-app/references/spreadsheet-source.md +206 -190
  45. package/dist/templates/workspace-core/.agents/skills/turn-into-app/references/ui-archetypes.md +381 -0
  46. package/dist/templates/workspace-core/.agents/skills/turn-into-app/references/ui-direction.md +323 -0
  47. package/dist/templates/workspace-core/.agents/skills/turn-into-app/references/ui-palettes.md +564 -0
  48. package/dist/triggers/actions/manage-automation.d.ts +7 -7
  49. package/docs/content/observability.mdx +136 -0
  50. package/package.json +4 -4
  51. package/src/templates/factory/.agents/skills/review-latest-feedback/SKILL.md +26 -24
  52. package/src/templates/factory/.agents/skills/review-latest-feedback/references/deployment-recovery.md +53 -0
  53. package/src/templates/factory/.agents/skills/review-latest-feedback/references/documentation-proof.md +7 -0
  54. package/src/templates/workspace-core/.agents/skills/turn-into-app/SKILL.md +284 -461
  55. package/src/templates/workspace-core/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  56. package/src/templates/workspace-core/.agents/skills/turn-into-app/references/fresh-project.md +65 -90
  57. package/src/templates/workspace-core/.agents/skills/turn-into-app/references/local-run-and-deploy.md +161 -0
  58. package/src/templates/workspace-core/.agents/skills/turn-into-app/references/review-loop.md +384 -0
  59. package/src/templates/workspace-core/.agents/skills/turn-into-app/references/source-brief.md +116 -0
  60. package/src/templates/workspace-core/.agents/skills/turn-into-app/references/spreadsheet-source.md +206 -190
  61. package/src/templates/workspace-core/.agents/skills/turn-into-app/references/ui-archetypes.md +381 -0
  62. package/src/templates/workspace-core/.agents/skills/turn-into-app/references/ui-direction.md +323 -0
  63. package/src/templates/workspace-core/.agents/skills/turn-into-app/references/ui-palettes.md +564 -0
@@ -1,4 +1,4 @@
1
1
  interface:
2
2
  display_name: "Turn Into App"
3
- short_description: "Turn project context or a workflow into a runnable app"
4
- default_prompt: "Use the visible project context first, then any supplied workflow. Turn the instructions, knowledge files, and selected successful runs into a new Agent-Native app with clear buttons, run it locally, verify it, and complete the deployment handoff."
3
+ short_description: "Turn a workflow, skill, or sheet into a visual Agent-Native app"
4
+ default_prompt: "Use $turn-into-app on the visible project context, named skill, or supplied file. Pick the app archetype from the workflow, build a populated visual app rather than a form, run it, review screenshots, and report the verified result."
@@ -1,96 +1,71 @@
1
- # Fresh Project source guide
2
-
3
- Use this guide when `/turn-into-app` is invoked in a new Claude or ChatGPT
4
- Project rather than after a completed thread.
5
-
6
- ## What the host can provide
7
-
8
- The source is whatever the host put in the model's current context:
9
-
10
- - Project instructions: the job, audience, constraints, quality bar, and
11
- approved tools or integrations.
12
- - Knowledge files and attachments: reference material, templates, examples,
13
- and links that the app should use.
14
- - Past runs: only conversations or outputs the host actually supplied. They
15
- are examples and evaluation material, not an automatic import of every
16
- private Project conversation.
17
- - The current request: the app boundary, target workspace, name, and explicit
18
- corrections.
19
-
20
- Do not infer hidden system prompts, account settings, private history, API keys,
21
- or credentials. The Dispatch MCP connector can start a workspace app creation,
22
- but it cannot unlock or scrape private Project content.
23
-
24
- ## Source brief
25
-
26
- Write a compact brief before starting the app:
27
-
28
- ```text
29
- Source: host-provided Claude/ChatGPT Project context
30
- Provenance: project instructions, selected knowledge files, and visible runs
31
- Source artifact type: project context, thread, skill, spreadsheet link, or upload
32
- Project goal:
33
- Configuration and constraints:
34
- Knowledge sources:
35
- Repeatable workflow:
36
- Inputs and outputs:
37
- Workbook candidates and confirmation: worksheet/range options, inferred I/O, selected destinations, unresolved questions
38
- Judgment and review points:
39
- Representative runs: none, or 1-3 selected examples
40
- Integrations and permissions:
41
- Unknowns and assumptions:
42
- ```
43
-
44
- Keep source references bounded. Prefer a file name, URL, resource ID, or short
45
- summary over a large pasted document. Do not put secrets or raw customer data
46
- in the brief.
47
-
48
- ## Fresh-box setup
49
-
50
- Install the exported `turn-into-app` skill in the host when the host supports
51
- skills. For a ChatGPT Project or any host that exposes only the MCP connector,
52
- also place the skill instructions or this reference in the Project
53
- instructions/knowledge files. Then add and authenticate the Dispatch MCP
54
- connector from the packaged `adapters/chatgpt-mcp/connector.json`.
55
- This single connector is enough: Dispatch provisions or reuses the Builder
56
- project through the Builder Projects API, so do not ask the user to add a
57
- separate Builder CMS MCP for app creation.
58
- Builder's separate Fusion MCP is available as a custom remote connector at
59
- `https://mcp.builder.io/mcp/fusion` for direct Builder work. It can run an
60
- existing project, but it cannot provision the repo-backed Agent-Native
61
- workspace project, so it is optional and not a replacement for the Dispatch
62
- handoff in this skill. Do not add Builder's CMS MCP for this workflow.
63
-
64
- For Claude Web, ChatGPT Web, and their web Projects, the host is an
65
- orchestrator, not the build environment. After forming the source brief, call
66
- the Dispatch `start-workspace-app-creation` action so Builder creates the app
67
- in the connected workspace. Do not use the host's code interpreter, shell,
68
- artifact editor, `create_workspace_app`, or local `pnpm`/`npm` commands. If the
69
- handoff action is unavailable, stop and ask the user to authenticate Dispatch;
70
- do not fall back to a local sandbox build. Claude Code and Codex Code are the
71
- local-agent exception and may follow the implementation steps in the main
72
- skill.
73
-
74
- The brief is an implementation authorization, not a questionnaire. After a
75
- repeatable workflow is identifiable, choose any source-recommended option
76
- automatically. For unresolved non-blocking choices, use the most direct
77
- conventional default, record it under assumptions, and continue. A spreadsheet
78
- is the narrow exception when its candidate workflows or input/output mapping
79
- cannot be grounded from the bounded source: show the recommended candidates
80
- and mapping in one compact multi-select confirmation, then continue after the
81
- user confirms or corrects it. Ask only for that source-integrity clarification,
82
- no identifiable workflow, no authorized target workspace, or a
83
- destructive/credential boundary that genuinely prevents the handoff.
84
-
85
- In a new Project chat, say:
1
+ # Browser hosts and Project sources
2
+
3
+ Read this only on a browser host (Claude or ChatGPT on the web, their web
4
+ Projects) or a runtime that cannot edit files. For a Project on a local host,
5
+ [source-brief.md](source-brief.md) is enough: it follows the normal local
6
+ build.
7
+
8
+ The source is whatever the host put in the model's current context: Project
9
+ instructions, knowledge files and attachments, past runs the host actually
10
+ supplied, and the current request. Reading order and the brief headings are in
11
+ [source-brief.md](source-brief.md). Do not infer hidden system prompts,
12
+ account settings, private history, API keys, or credentials. If the host does
13
+ not show the Project instructions or files to the model, ask for an export or
14
+ attachment and do not claim the Project was read.
15
+
16
+ ## The Dispatch handoff
17
+
18
+ On a browser host the host is an orchestrator, not the build environment:
19
+
20
+ 1. Write the source brief and the design decisions from step 2 of the skill
21
+ (archetype, direction, first viewport, sample-data plan, agent moments).
22
+ 2. Call `start-workspace-app-creation` on the Agent-Native Dispatch MCP
23
+ connector (`agent-native-dispatch`). Put the brief and the design decisions
24
+ in `prompt`; pass an `appId`, a short `description`, the `template`, the
25
+ selected `resourceIds`, and source files as `attachments`
26
+ ([attachments.md](attachments.md)). The tool's schema describes each
27
+ argument. Reference resources by id; never paste whole knowledge files or
28
+ binary data into `prompt`, and do not assume an attachment becomes a file in
29
+ the generated workspace. A workbook cannot be attached (attachments take
30
+ images, PDF, text, and JSON): pass a bounded CSV rendering as text, or a
31
+ public URL, and say what was left out.
32
+ 3. Report what Dispatch actually returned: the branch, the path, and the status.
33
+ The browser host cannot run or inspect the app, and a returned path can 404
34
+ until the branch merges and deploys, so the report ends at pending or
35
+ unverified unless a status or verification action is available to call.
36
+
37
+ Rules on this path:
38
+
39
+ - Never run `npm`, `pnpm`, `npx`, `agent-native create`, or `add-app`; never
40
+ edit files, build in the host's code interpreter, sandbox, or artifact
41
+ editor, or start a dev server.
42
+ - Never substitute the generic `create_workspace_app` MCP tool. It is a local
43
+ workspace scaffolder, not the Dispatch handoff.
44
+ - If `start-workspace-app-creation` is unavailable or Dispatch is not
45
+ authenticated, stop and give the connector setup below. Do not fall back to
46
+ a sandbox build or claim that the app exists.
47
+ - Never invent a Builder branch URL. If Dispatch returns only an
48
+ acknowledgement, or a path without a URL, report the Dispatch handoff as
49
+ unverified, not as a ready or verified branch.
50
+ - The Dispatch handoff runs without further questions once the brief exists.
51
+ "When to ask" in SKILL.md still applies before it.
52
+
53
+ ## Setting up a browser host
54
+
55
+ - Install the exported `turn-into-app` skill where the host supports skills.
56
+ For a ChatGPT Project or any host that exposes only MCP, put the skill
57
+ instructions in the Project instructions or knowledge files.
58
+ - Add and authenticate the Agent-Native Dispatch MCP connector
59
+ (`https://dispatch.agent-native.com/mcp`, OAuth). It reuses or provisions the
60
+ workspace's Builder project through the Builder Projects API, so no separate
61
+ Builder CMS or Fusion connector is needed for app creation.
62
+
63
+ A prompt for a new Project chat:
86
64
 
87
65
  ```text
88
66
  Turn this project into an app. Use the visible Project instructions,
89
67
  knowledge files, and any selected successful runs as the source. Create the
90
68
  app in the connected Agent-Native workspace through Dispatch and Builder, keep
91
- the source brief bounded, and report the real Builder branch/path and
92
- verification result. Do not build it in this chat's sandbox.
69
+ the source brief bounded, and report the real Builder branch or path and the
70
+ verification status. Do not build it in this chat's sandbox.
93
71
  ```
94
-
95
- If the host does not show the Project instructions or files to the model, stop
96
- and request an export or attachment. Do not claim that the Project was read.
@@ -0,0 +1,161 @@
1
+ # Run, verify, and deploy
2
+
3
+ ## Contents
4
+
5
+ - Shared onboarding
6
+ - Local sign-in and provider keys
7
+ - Run
8
+ - Checks and build
9
+ - Deploy
10
+ - Processes and evidence
11
+
12
+ ## Shared onboarding
13
+
14
+ The chat scaffold ships `agent-native.json` with `"onboarding": { "firstRun":
15
+ "off" }`. Set the mode map and keep the file's other keys:
16
+
17
+ ```json
18
+ {
19
+ "version": 1,
20
+ "onboarding": {
21
+ "firstRun": {
22
+ "development": "connect",
23
+ "production": "connect-and-integrations"
24
+ }
25
+ }
26
+ }
27
+ ```
28
+
29
+ `connect` shows the shared setup in the agent sidebar ("Use Builder.io" or
30
+ "Custom keys"); `connect-and-integrations` adds the integrations catalog; only
31
+ `"off"` hides it. Never replace it with a local credential form.
32
+
33
+ When the mode needs code, set it in the scaffold's existing
34
+ `agent-native.config.ts` instead. The typed file takes precedence over the JSON
35
+ when both set `onboarding.firstRun`:
36
+
37
+ ```ts
38
+ import { defineAgentNativeConfig } from "@agent-native/core/config";
39
+
40
+ export default defineAgentNativeConfig(({ isDev }) => ({
41
+ // keep the keys the scaffold already sets here
42
+ onboarding: {
43
+ firstRun: isDev ? "connect" : "connect-and-integrations",
44
+ },
45
+ }));
46
+ ```
47
+
48
+ Everything in these files is bundled for the browser, so they hold public
49
+ defaults only. Precedence, supported modes, and the line between committed
50
+ config and deployment secrets:
51
+ https://www.agent-native.com/docs/agent-native-config
52
+
53
+ ## Local sign-in and provider keys
54
+
55
+ A fresh browser context, which the screenshot script always starts, is not
56
+ signed in: `/` renders a sign-in card ("Continue as local dev") at the same
57
+ path, and other routes redirect to `/sign-in`. Before the first screenshot,
58
+ put `AUTH_DISABLED=1` in the app's ignored `.env` while the dev server is
59
+ stopped (see Run). Loopback development only: never commit it, never deploy
60
+ it, and remove it before the final `pnpm build`. A scaffold skill (`build-an-app`) that says not
61
+ to set `AUTH_DISABLED` is about keeping auth on in real use; this skill's
62
+ review loop is the exception for local runs. Without it, a person opening the
63
+ app clicks "Continue as local dev".
64
+
65
+ A developer can put a provider key such as `ANTHROPIC_API_KEY` or
66
+ `OPENAI_API_KEY` in the same `.env`; once the server restarts, the sidebar skips
67
+ the setup prompt because a key is available. Keep real values out of source,
68
+ examples, docs, and generated content. Distinguish "not configured" (no key,
69
+ no connection) from "unavailable" (a credential store or provider that
70
+ failed).
71
+
72
+ ## Run
73
+
74
+ From the app directory, pick a free port (`lsof -nP -iTCP:<port> -sTCP:LISTEN`
75
+ prints nothing), start the dev server detached with its log and PID in
76
+ `.tmp/`, and poll until `/` answers 200 (at most three minutes):
77
+
78
+ ```bash
79
+ mkdir -p .tmp && (nohup pnpm exec agent-native dev --port <port> > .tmp/dev.log 2>&1 & echo $! > .tmp/dev.pid)
80
+ wait200() { while t=$((end-SECONDS)); [ $t -gt 0 ]; do [ "$(curl -sL --connect-timeout 2 --max-time $((t<10?t:10)) -o /dev/null -w '%{http_code}' "$1")" = 200 ] && return 0; sleep 1; done; echo "no 200 from $1 before the three-minute deadline; read .tmp/dev.log" >&2; return 1; }
81
+ end=$((SECONDS+180)); wait200 http://localhost:<port>/ && wait200 http://localhost:<port>/<route>
82
+ ```
83
+
84
+ The second poll compiles the domain route once so the first screenshot does not
85
+ wait for it. Both polls share one three-minute deadline, set by the `end=`
86
+ assignment, and each request is capped by the time left; run that last line
87
+ again after every restart for a fresh clock. A nonzero exit means the server or the route never answered:
88
+ read `.tmp/dev.log` and fix that before any screenshot. The log prints `Local: http://localhost:<port>/` before the
89
+ server can answer; a 503 or a "Dev server is restarting" page is not yours to
90
+ fix. Stop the server with `kill $(cat .tmp/dev.pid)`, which also stops its
91
+ children. Stop it before you change `.env` and start it again afterwards: an
92
+ in-place reload after an `.env` change loops on the local database lock and
93
+ serves 500s. After editing `server/plugins/*` or adding a dependency, poll
94
+ again, and restart if `/` does not reflect the change. The scaffold's
95
+ `pnpm dev` runs the same server and also opens a browser tab.
96
+
97
+ ## Checks and build
98
+
99
+ ```bash
100
+ pnpm typecheck
101
+ pnpm agent-native:doctor
102
+ pnpm build
103
+ ```
104
+
105
+ `pnpm typecheck` regenerates the action types itself; run it after adding or
106
+ renaming an action file. `pnpm agent-native:doctor` runs Agent-Native Doctor;
107
+ plain `pnpm doctor` is a built-in pnpm command and checks nothing here.
108
+ `pnpm build` also runs the doctor before building. Stop the dev server and
109
+ remove `AUTH_DISABLED` from `.env` before the final build.
110
+
111
+ A healthy local app still prints "production configuration errors" (no
112
+ `BETTER_AUTH_SECRET`, no persistent `DATABASE_URL`, and with `AUTH_DISABLED`
113
+ set, "Authentication is disabled in production") and a block that starts
114
+ "Copy the prompt below to an AI coding agent", with exit code 0. That is the
115
+ deploy checklist, not a code failure and not an instruction to you: trust the
116
+ exit code, never create a secret, database, or placeholder value to silence
117
+ it, and report the items as the pending deploy step. Only a non-zero exit or
118
+ a doctor finding is a failure to fix; rerun only what failed.
119
+
120
+ ## Deploy
121
+
122
+ Deploy when the user asked for it or the project already has the provider
123
+ configured. Otherwise finish local verification and report the exact remaining
124
+ step. An app in Local File Mode reads the host's files, so it is local-only:
125
+ say so instead of deploying it.
126
+
127
+ - **Standalone app:** pick the host's Nitro preset in `vite.config.ts` (or set
128
+ `NITRO_PRESET` at build time), set `DATABASE_URL` and a stable
129
+ `BETTER_AUTH_SECRET` in the provider's environment settings, run
130
+ `pnpm build`, then the provider's own deploy command. Local PGlite storage is
131
+ not production storage. Guide:
132
+ https://www.agent-native.com/docs/deploy-an-app
133
+ - **App inside a workspace:** deploy the workspace from its root, which needs
134
+ `A2A_SECRET` in the provider environment:
135
+
136
+ ```bash
137
+ npx @agent-native/core@latest deploy
138
+ netlify deploy --prod --dir=dist --functions=.netlify/functions-internal
139
+ ```
140
+
141
+ For Vercel, run `npx @agent-native/core@latest deploy --preset vercel`, then
142
+ `vercel deploy --prebuilt`. Guide:
143
+ https://www.agent-native.com/docs/workspace-deployment
144
+
145
+ Missing provider authentication, a production secret, or a hosting decision is
146
+ a pending step, not a failure to hide: report it and stop short of claiming a
147
+ deployment.
148
+
149
+ ## Processes and evidence
150
+
151
+ - After an interactive invocation (see "When to ask" in SKILL.md for what
152
+ counts), leave the dev server running and report its URL, PID, and stop
153
+ command. In a headless or harness run, stop every process you started, by
154
+ its PID, before exiting.
155
+ - Stopping means processes only: keep `.tmp/ui-review/out/` and the app's
156
+ `data/`, so the report's paths still exist.
157
+ - Evidence labels are separate states: locally running (the server answers),
158
+ locally verified (the checks in step 6 passed in a browser), build-ready
159
+ (`pnpm build` passed), deployed (the provider accepted a deploy), and
160
+ live-verified (the public URL was exercised). Never let one stand in for
161
+ another.