@agent-native/core 0.146.7 → 0.147.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 (167) hide show
  1. package/corpus/README.md +1 -1
  2. package/corpus/templates/analytics/.agents/skills/turn-into-app/SKILL.md +18 -6
  3. package/corpus/templates/analytics/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
  4. package/corpus/templates/analytics/DEVELOPING.md +59 -0
  5. package/corpus/templates/analytics/app/routes/status.$slug.tsx +4 -2
  6. package/corpus/templates/analytics/package.json +1 -0
  7. package/corpus/templates/analytics/scripts/first-party-analytics-bigquery-backfill.ts +889 -0
  8. package/corpus/templates/analytics/server/jobs/analytics-bigquery-backfill.ts +70 -0
  9. package/corpus/templates/analytics/server/lib/first-party-analytics-backend.ts +117 -12
  10. package/corpus/templates/assets/.agents/skills/turn-into-app/SKILL.md +18 -6
  11. package/corpus/templates/assets/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
  12. package/corpus/templates/brain/.agents/skills/adding-a-feature/SKILL.md +9 -0
  13. package/corpus/templates/brain/.agents/skills/turn-into-app/SKILL.md +18 -6
  14. package/corpus/templates/brain/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
  15. package/corpus/templates/calendar/.agents/skills/turn-into-app/SKILL.md +18 -6
  16. package/corpus/templates/calendar/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
  17. package/corpus/templates/chat/.agents/skills/adding-a-feature/SKILL.md +9 -0
  18. package/corpus/templates/chat/.agents/skills/turn-into-app/SKILL.md +18 -6
  19. package/corpus/templates/chat/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
  20. package/corpus/templates/clips/.agents/skills/turn-into-app/SKILL.md +18 -6
  21. package/corpus/templates/clips/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
  22. package/corpus/templates/clips/app/routes/r.$recordingId.tsx +16 -4
  23. package/corpus/templates/clips/app/routes/share.meeting.$meetingId.tsx +14 -5
  24. package/corpus/templates/clips/package.json +1 -0
  25. package/corpus/templates/clips/react-router.config.ts +7 -0
  26. package/corpus/templates/clips/server/plugins/auth.ts +6 -1
  27. package/corpus/templates/clips/shared/prerendered-public-paths.ts +21 -0
  28. package/corpus/templates/clips/shared/share-meta.ts +8 -3
  29. package/corpus/templates/content/.agents/skills/turn-into-app/SKILL.md +18 -6
  30. package/corpus/templates/content/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
  31. package/corpus/templates/crm/.agents/skills/turn-into-app/SKILL.md +18 -6
  32. package/corpus/templates/crm/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
  33. package/corpus/templates/design/.agents/skills/turn-into-app/SKILL.md +18 -6
  34. package/corpus/templates/design/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
  35. package/corpus/templates/dispatch/.agents/skills/turn-into-app/SKILL.md +18 -6
  36. package/corpus/templates/dispatch/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
  37. package/corpus/templates/dispatch/app/chat-first-pages.ts +747 -0
  38. package/corpus/templates/dispatch/app/i18n-data.ts +181 -0
  39. package/corpus/templates/dispatch/app/routes/settings.tsx +62 -1
  40. package/corpus/templates/dispatch/changelog/2026-08-08-chat-first-navigation-keeps-conversations-central-while-open.md +6 -0
  41. package/corpus/templates/factory/.agents/skills/adding-a-feature/SKILL.md +9 -0
  42. package/corpus/templates/factory/.agents/skills/turn-into-app/SKILL.md +18 -6
  43. package/corpus/templates/factory/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
  44. package/corpus/templates/factory/actions/run-factory-automation.ts +1 -0
  45. package/corpus/templates/factory/app/routes/factory.tsx +108 -76
  46. package/corpus/templates/factory/changelog/2026-08-08-scheduler-health-moves-to-settings.md +6 -0
  47. package/corpus/templates/factory/netlify.toml +1 -1
  48. package/corpus/templates/forms/.agents/skills/turn-into-app/SKILL.md +18 -6
  49. package/corpus/templates/forms/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
  50. package/corpus/templates/macros/.agents/skills/turn-into-app/SKILL.md +18 -6
  51. package/corpus/templates/macros/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
  52. package/corpus/templates/mail/.agents/skills/turn-into-app/SKILL.md +18 -6
  53. package/corpus/templates/mail/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
  54. package/corpus/templates/plan/.agents/skills/adding-a-feature/SKILL.md +9 -0
  55. package/corpus/templates/plan/.agents/skills/turn-into-app/SKILL.md +18 -6
  56. package/corpus/templates/plan/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
  57. package/corpus/templates/plan/app/lib/plan-document-title.ts +3 -1
  58. package/corpus/templates/plan/app/root.tsx +1 -0
  59. package/corpus/templates/slides/.agents/skills/turn-into-app/SKILL.md +18 -6
  60. package/corpus/templates/slides/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
  61. package/corpus/templates/tasks/.agents/skills/adding-a-feature/SKILL.md +9 -0
  62. package/corpus/templates/tasks/.agents/skills/turn-into-app/SKILL.md +18 -6
  63. package/corpus/templates/tasks/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
  64. package/dist/agent/engine/builder-engine.d.ts +11 -1
  65. package/dist/agent/engine/builder-engine.js +11 -4
  66. package/dist/chat-threads/store.d.ts +2 -0
  67. package/dist/chat-threads/store.js +1 -1
  68. package/dist/cli/agent-plugin.d.ts +5 -2
  69. package/dist/cli/agent-plugin.js +17 -9
  70. package/dist/cli/code-agent-executor.js +25 -5
  71. package/dist/cli/code-agent-mcp-config.d.ts +21 -0
  72. package/dist/cli/code-agent-mcp-config.js +103 -0
  73. package/dist/client/NewWorkspaceAppFlow.js +4 -1
  74. package/dist/client/agent-chat/index.d.ts +4 -1
  75. package/dist/client/agent-chat/index.js +4 -1
  76. package/dist/client/agent-page/AgentTabsPage.d.ts +1 -0
  77. package/dist/client/agent-page/AgentTabsPage.js +4 -3
  78. package/dist/client/app-providers.d.ts +3 -1
  79. package/dist/client/app-providers.js +50 -5
  80. package/dist/client/chat/runtime.js +63 -0
  81. package/dist/client/chat-first/agents-pane.d.ts +2 -0
  82. package/dist/client/chat-first/agents-pane.js +6 -0
  83. package/dist/client/chat-first/app-pane.d.ts +2 -0
  84. package/dist/client/chat-first/app-pane.js +6 -0
  85. package/dist/client/chat-first/apps-rail.d.ts +2 -0
  86. package/dist/client/chat-first/apps-rail.js +103 -0
  87. package/dist/client/chat-first/browser-pane.d.ts +2 -0
  88. package/dist/client/chat-first/browser-pane.js +64 -0
  89. package/dist/client/chat-first/chat-history.d.ts +12 -0
  90. package/dist/client/chat-first/chat-history.js +10 -0
  91. package/dist/client/chat-first/copy.d.ts +2 -0
  92. package/dist/client/chat-first/copy.js +117 -0
  93. package/dist/client/chat-first/index.d.ts +13 -0
  94. package/dist/client/chat-first/index.js +12 -0
  95. package/dist/client/chat-first/primary-nav.d.ts +8 -0
  96. package/dist/client/chat-first/primary-nav.js +6 -0
  97. package/dist/client/chat-first/session-watch-pane.d.ts +2 -0
  98. package/dist/client/chat-first/session-watch-pane.js +9 -0
  99. package/dist/client/chat-first/surface-panel.d.ts +9 -0
  100. package/dist/client/chat-first/surface-panel.js +9 -0
  101. package/dist/client/chat-first/surface-tabs.d.ts +9 -0
  102. package/dist/client/chat-first/surface-tabs.js +74 -0
  103. package/dist/client/chat-first/types.d.ts +74 -0
  104. package/dist/client/chat-first/types.js +1 -0
  105. package/dist/client/chat-first-agent-activity.d.ts +11 -0
  106. package/dist/client/chat-first-agent-activity.js +51 -0
  107. package/dist/client/chat-first-surface-panel-toggle.d.ts +5 -0
  108. package/dist/client/chat-first-surface-panel-toggle.js +6 -0
  109. package/dist/client/chat-first.d.ts +208 -0
  110. package/dist/client/chat-first.js +816 -0
  111. package/dist/client/extensions/ExtensionViewer.js +8 -1
  112. package/dist/client/resources/McpIntegrationDialog.js +3 -2
  113. package/dist/client/resources/McpServerDetail.js +6 -11
  114. package/dist/client/resources/index.d.ts +1 -0
  115. package/dist/client/resources/index.js +1 -0
  116. package/dist/client/resources/use-mcp-servers.d.ts +20 -0
  117. package/dist/client/resources/use-mcp-servers.js +82 -46
  118. package/dist/client/settings/index.d.ts +1 -0
  119. package/dist/client/settings/index.js +1 -0
  120. package/dist/collab/awareness.d.ts +2 -2
  121. package/dist/collab/routes.d.ts +1 -1
  122. package/dist/jobs/background-automation-runner.js +19 -2
  123. package/dist/jobs/scheduler-health.d.ts +20 -0
  124. package/dist/jobs/scheduler-health.js +86 -1
  125. package/dist/jobs/scheduler.js +38 -1
  126. package/dist/mcp-client/routes.d.ts +3 -0
  127. package/dist/mcp-client/routes.js +14 -0
  128. package/dist/notifications/routes.d.ts +1 -1
  129. package/dist/provider-api/actions/provider-api.d.ts +2 -2
  130. package/dist/server/agents-bundle.d.ts +2 -0
  131. package/dist/server/agents-bundle.js +31 -2
  132. package/dist/server/credential-provider.d.ts +8 -2
  133. package/dist/server/credential-provider.js +13 -9
  134. package/dist/shared/chat-first-app-creation.d.ts +19 -0
  135. package/dist/shared/chat-first-app-creation.js +75 -0
  136. package/dist/shared/document-title.d.ts +7 -0
  137. package/dist/shared/document-title.js +29 -0
  138. package/dist/shared/index.d.ts +2 -0
  139. package/dist/shared/index.js +2 -0
  140. package/dist/styles/chat-history-list.css +16 -0
  141. package/dist/templates/chat/.agents/skills/adding-a-feature/SKILL.md +9 -0
  142. package/dist/templates/chat/.agents/skills/turn-into-app/SKILL.md +18 -6
  143. package/dist/templates/chat/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
  144. package/dist/templates/default/.agents/skills/adding-a-feature/SKILL.md +9 -0
  145. package/dist/templates/default/.agents/skills/turn-into-app/SKILL.md +18 -6
  146. package/dist/templates/default/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
  147. package/dist/templates/default/react-router.config.ts +18 -0
  148. package/dist/templates/headless/.agents/skills/turn-into-app/SKILL.md +18 -6
  149. package/dist/templates/headless/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
  150. package/dist/templates/workspace-core/.agents/skills/adding-a-feature/SKILL.md +9 -0
  151. package/dist/templates/workspace-core/.agents/skills/turn-into-app/SKILL.md +18 -6
  152. package/dist/templates/workspace-core/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
  153. package/dist/templates/workspace-core/.agents/skills/workspace-conventions/SKILL.md +7 -0
  154. package/package.json +4 -3
  155. package/src/templates/chat/.agents/skills/adding-a-feature/SKILL.md +9 -0
  156. package/src/templates/chat/.agents/skills/turn-into-app/SKILL.md +18 -6
  157. package/src/templates/chat/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
  158. package/src/templates/default/.agents/skills/adding-a-feature/SKILL.md +9 -0
  159. package/src/templates/default/.agents/skills/turn-into-app/SKILL.md +18 -6
  160. package/src/templates/default/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
  161. package/src/templates/default/react-router.config.ts +18 -0
  162. package/src/templates/headless/.agents/skills/turn-into-app/SKILL.md +18 -6
  163. package/src/templates/headless/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
  164. package/src/templates/workspace-core/.agents/skills/adding-a-feature/SKILL.md +9 -0
  165. package/src/templates/workspace-core/.agents/skills/turn-into-app/SKILL.md +18 -6
  166. package/src/templates/workspace-core/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
  167. package/src/templates/workspace-core/.agents/skills/workspace-conventions/SKILL.md +7 -0
package/corpus/README.md CHANGED
@@ -31,4 +31,4 @@ rg -n "defineAction|useActionQuery" node_modules/@agent-native/core/corpus
31
31
 
32
32
  ## Generated Counts
33
33
 
34
- - template files: 7921
34
+ - template files: 7926
@@ -3,8 +3,9 @@ name: turn-into-app
3
3
  description: >-
4
4
  Turn visible project context, a proven thread, skill, or workflow into a
5
5
  runnable Agent-Native app with simple buttons, visible agent steps, preview,
6
- and deployment handoff. Use when a user invokes `/turn-into-app` or asks to
7
- make a workflow into an app, including from Claude or ChatGPT on the web.
6
+ and deployment handoff. Use when a user invokes `/turn-into-app`,
7
+ `/make-into-app`, or asks to make a workflow into an app, including from
8
+ Claude or ChatGPT on the web.
8
9
  user-invocable: true
9
10
  scope: both
10
11
  metadata:
@@ -38,6 +39,15 @@ The build location depends on the host. Treat this as a hard routing rule:
38
39
  workspace, follow the local implementation steps below. The local agent may
39
40
  scaffold, edit, run, and verify the app there.
40
41
 
42
+ Once the source brief is sufficient to identify a repeatable workflow, the
43
+ handoff is non-interactive. Do not ask the user for visual, product, copy,
44
+ layout, template, integration, or implementation choices that can be resolved
45
+ from the source. Select the source's recommended option; otherwise choose the
46
+ most direct conventional default and record the assumption for later review.
47
+ Only stop for a genuine hard blocker such as missing authorization, a
48
+ destructive external action, an ambiguous target workspace, or no identifiable
49
+ workflow at all.
50
+
41
51
  ## Default behavior
42
52
 
43
53
  For a local code-agent runtime this is an end-to-end build skill, not a request
@@ -104,14 +114,16 @@ before creating the app. Read the host-provided context in this order:
104
114
  Record the brief with these headings before handoff: source and provenance,
105
115
  project goal, configuration and constraints, knowledge sources, repeatable
106
116
  workflow, inputs and outputs, judgment and review points, representative runs,
107
- integrations and permissions, and unknowns. This is the compact contract for
117
+ integrations and permissions, and unknowns and assumptions. This is the compact contract for
108
118
  the app. It keeps the new app useful without pretending that hidden Project
109
119
  history was imported. See [the fresh Project reference](references/fresh-project.md)
110
120
  for the host setup and brief template.
111
121
 
112
- If the visible Project context has no concrete repeatable job, ask for one
113
- focused clarification or a representative artifact. Do not fall back to a
114
- generic “what app do you want to make?” builder.
122
+ If the visible Project context has no concrete repeatable job and no primary
123
+ goal can be inferred, ask for one focused clarification or a representative
124
+ artifact. Otherwise use the project's primary goal and source conventions; do
125
+ not ask a questionnaire and do not fall back to a generic “what app do you
126
+ want to make?” builder.
115
127
 
116
128
  ## Source selection guard
117
129
 
@@ -36,7 +36,7 @@ Inputs and outputs:
36
36
  Judgment and review points:
37
37
  Representative runs: none, or 1-3 selected examples
38
38
  Integrations and permissions:
39
- Unknowns and follow-up:
39
+ Unknowns and assumptions:
40
40
  ```
41
41
 
42
42
  Keep source references bounded. Prefer a file name, URL, resource ID, or short
@@ -69,6 +69,13 @@ do not fall back to a local sandbox build. Claude Code and Codex Code are the
69
69
  local-agent exception and may follow the implementation steps in the main
70
70
  skill.
71
71
 
72
+ The brief is an implementation authorization, not a questionnaire. After a
73
+ repeatable workflow is identifiable, choose any source-recommended option
74
+ automatically. For unresolved non-blocking choices, use the most direct
75
+ conventional default, record it under assumptions, and continue. Ask only when
76
+ there is no identifiable workflow, no authorized target workspace, or a
77
+ destructive/credential boundary genuinely prevents the handoff.
78
+
72
79
  In a new Project chat, say:
73
80
 
74
81
  ```text
@@ -183,6 +183,65 @@ Conventions:
183
183
  - Use `fatal()` for required arg validation
184
184
  - `helpers.ts` loads `dotenv/config` so env vars are available
185
185
 
186
+ ### Dedicated first-party Analytics backfill
187
+
188
+ `backfill:first-party-bigquery` is a resumable, bounded Neon-to-BigQuery worker
189
+ for an explicitly selected organization. It is dry-run by default. It uses the
190
+ scoped credential resolver, fixed high-water marks, separate organization and
191
+ legacy-owner cursors, atomic local checkpoints, a local lock, and a durable
192
+ database lease shared with the shipped worker. The tuple-paging indexes are
193
+ installed by the additive analytics migration. It does not change the Analytics
194
+ sink or perform cutover.
195
+
196
+ ```bash
197
+ pnpm backfill:first-party-bigquery \
198
+ --owner-email=<owner-email> \
199
+ --org-id=<org-id>
200
+ ```
201
+
202
+ Production execution requires both `--execute` and the explicit
203
+ `AGENT_NATIVE_ANALYTICS_BIGQUERY_BACKFILL_ALLOW=1` environment gate. Start with a bounded
204
+ `--max-batches` budget and increase concurrency only after checking database
205
+ health between runs. The dedicated worker claims the durable migration-job
206
+ lease, so the shipped worker and another operator using a different checkpoint
207
+ path cannot copy the same job concurrently. A crashed dedicated worker leaves
208
+ that lease to expire before the shipped worker can resume it.
209
+
210
+ ```bash
211
+ AGENT_NATIVE_ANALYTICS_BIGQUERY_BACKFILL_ALLOW=1 pnpm backfill:first-party-bigquery \
212
+ --execute \
213
+ --owner-email=<owner-email> \
214
+ --org-id=<org-id> \
215
+ --batch-size=1000 \
216
+ --concurrency=2 \
217
+ --max-batches=100
218
+ ```
219
+
220
+ The checkpoint file contains cursors and counts, not event payloads or
221
+ credentials. A short page triggers a fresh high-water check so rows written
222
+ while the worker is running are included. A partial BigQuery acknowledgement
223
+ does not advance the cursor; retry it promptly, or run an insertId-deduplication
224
+ or `MERGE` pass on the target table before finalizing.
225
+
226
+ Before finalization, quiesce the source event writes and verify the final
227
+ high-water marks. The `--owner-email` and `--org-id` values are trusted operator
228
+ inputs, so execution is limited to the approved production operator and the
229
+ two explicit environment gates. Then use the separate `--finalize` command
230
+ with both gates below. The command rechecks the source high-water marks before
231
+ marking the durable job complete; the normal migration action's approval gate
232
+ still controls cutover:
233
+
234
+ ```bash
235
+ AGENT_NATIVE_ANALYTICS_BIGQUERY_BACKFILL_FINALIZE_ALLOW=1 \
236
+ AGENT_NATIVE_ANALYTICS_BIGQUERY_BACKFILL_QUIESCENT=1 \
237
+ pnpm backfill:first-party-bigquery \
238
+ --finalize \
239
+ --owner-email=<owner-email> \
240
+ --org-id=<org-id>
241
+ ```
242
+
243
+ Do not delete a lock file until the owning process has been verified stopped.
244
+
186
245
  ## TypeScript Everywhere
187
246
 
188
247
  All code in this project must be TypeScript (`.ts`). Never create `.js`, `.cjs`, or `.mjs` files. Node 22+ runs `.ts` files natively, so no compilation step is needed for scripts. Use ESM imports (`import`), not CommonJS (`require`).
@@ -1,4 +1,5 @@
1
1
  import { useActionQuery } from "@agent-native/core/client/hooks";
2
+ import { normalizeDocumentTitle } from "@agent-native/core/shared";
2
3
  import { IconActivity } from "@tabler/icons-react";
3
4
  import { useMemo } from "react";
4
5
  import { data, useLoaderData, useParams } from "react-router";
@@ -43,15 +44,16 @@ export const meta: MetaFunction<typeof loader> = ({ loaderData }) => {
43
44
  { name: "robots", content: "noindex" },
44
45
  ];
45
46
  }
47
+ const pageTitle = normalizeDocumentTitle(page.title, "Status page");
46
48
  const description =
47
49
  page.description ||
48
50
  (page.overall === "operational"
49
51
  ? "All systems operational."
50
52
  : "Current service status.");
51
53
  return [
52
- { title: `${page.title} · Status` },
54
+ { title: `${pageTitle} · Status` },
53
55
  { name: "description", content: description },
54
- { property: "og:title", content: `${page.title} · Status` },
56
+ { property: "og:title", content: `${pageTitle} · Status` },
55
57
  { property: "og:description", content: description },
56
58
  { property: "og:type", content: "website" },
57
59
  ];
@@ -11,6 +11,7 @@
11
11
  "format.fix": "oxfmt --write .",
12
12
  "typecheck": "agent-native typecheck",
13
13
  "migrate:production": "tsx scripts/migrate-production.ts",
14
+ "backfill:first-party-bigquery": "tsx scripts/first-party-analytics-bigquery-backfill.ts",
14
15
  "action": "agent-native action",
15
16
  "script": "agent-native script"
16
17
  },