@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
@@ -10,6 +10,7 @@ import {
10
10
 
11
11
  const JOB_TABLE = "analytics_bigquery_backfill_jobs";
12
12
  const LEASE_MS = 5 * 60 * 1000;
13
+ const DEDICATED_LEASE_MS = 24 * 60 * 60 * 1000;
13
14
  const ERROR_RETRY_MS = 5 * 60 * 1000;
14
15
  const DEFAULT_BATCH_SIZE = 250;
15
16
  const MAX_BATCH_SIZE = 750;
@@ -191,6 +192,75 @@ export async function getFirstPartyAnalyticsBigQueryBackfillJob(
191
192
  return row ? rowToJob(row) : null;
192
193
  }
193
194
 
195
+ export async function acquireDedicatedFirstPartyAnalyticsBackfillLease(
196
+ scope: FirstPartyAnalyticsScope,
197
+ table: string,
198
+ ): Promise<() => Promise<void>> {
199
+ if (!scope.orgId) {
200
+ throw new Error("Dedicated BigQuery backfill requires an organization");
201
+ }
202
+ const id = jobId(scope.orgId);
203
+ const token = randomUUID();
204
+ const now = new Date().toISOString();
205
+ const leaseExpiresAt = new Date(
206
+ Date.now() + DEDICATED_LEASE_MS,
207
+ ).toISOString();
208
+ const claimed = await executor().execute({
209
+ sql: `UPDATE ${JOB_TABLE}
210
+ SET status = 'running', lease_token = ?, lease_expires_at = ?,
211
+ updated_at = ?
212
+ WHERE id = ? AND table_ref = ?
213
+ AND (status = 'pending'
214
+ OR (status = 'running' AND lease_expires_at IS NOT NULL
215
+ AND lease_expires_at <= ?))`,
216
+ args: [token, leaseExpiresAt, now, id, table, now],
217
+ timeoutMs: 5_000,
218
+ maxAttempts: 1,
219
+ });
220
+ if (claimed.rowsAffected !== 1) {
221
+ const job = await getFirstPartyAnalyticsBigQueryBackfillJob(scope);
222
+ if (!job) {
223
+ throw new Error(
224
+ "Prepare the organization before starting the dedicated BigQuery backfill",
225
+ );
226
+ }
227
+ if (job.table !== table) {
228
+ throw new Error(
229
+ `BigQuery backfill already targets ${job.table}; the dedicated worker requested ${table}`,
230
+ );
231
+ }
232
+ if (job.status === "completed") {
233
+ throw new Error(
234
+ "The durable BigQuery backfill is already completed; do not run the dedicated worker again",
235
+ );
236
+ }
237
+ throw new Error(
238
+ "Another BigQuery backfill worker owns the durable lease; wait for it to stop before retrying",
239
+ );
240
+ }
241
+
242
+ let released = false;
243
+ return async () => {
244
+ if (released) return;
245
+ const releasedAt = new Date().toISOString();
246
+ const result = await executor().execute({
247
+ sql: `UPDATE ${JOB_TABLE}
248
+ SET status = 'pending', lease_token = NULL,
249
+ lease_expires_at = NULL, next_run_at = ?, updated_at = ?
250
+ WHERE id = ? AND lease_token = ?`,
251
+ args: [leaseExpiresAt, releasedAt, id, token],
252
+ timeoutMs: 5_000,
253
+ maxAttempts: 1,
254
+ });
255
+ if (result.rowsAffected !== 1) {
256
+ throw new Error(
257
+ "The dedicated BigQuery backfill lost its durable lease before release",
258
+ );
259
+ }
260
+ released = true;
261
+ };
262
+ }
263
+
194
264
  export async function queueFirstPartyAnalyticsBigQueryBackfill(
195
265
  scope: FirstPartyAnalyticsScope,
196
266
  table: string,
@@ -75,6 +75,16 @@ const FIRST_PARTY_QUERY_TABLES = [
75
75
  const BACKEND_CONFIG_CACHE_TTL_MS = 30_000;
76
76
  const MAX_BACKFILL_BATCH_SIZE = 750;
77
77
  const MAX_INSERT_BATCH_SIZE = 200;
78
+ const MAX_DEDICATED_INSERT_BATCH_SIZE = 500;
79
+ const MAX_DEDICATED_INSERT_CONCURRENCY = 4;
80
+ const MAX_INSERT_REQUEST_BYTES = 8 * 1024 * 1024;
81
+
82
+ export interface FirstPartyAnalyticsInsertOptions {
83
+ /** Maximum rows in one BigQuery insertAll request. */
84
+ maxRowsPerRequest?: number;
85
+ /** Maximum insertAll requests in flight for a dedicated backfill worker. */
86
+ maxConcurrentRequests?: number;
87
+ }
78
88
 
79
89
  const backendConfigCache = new Map<
80
90
  string,
@@ -224,7 +234,7 @@ const FIRST_PARTY_ANALYTICS_RAW_SCHEMA = [
224
234
  ["org_id", "STRING"],
225
235
  ] as const;
226
236
 
227
- const FIRST_PARTY_ANALYTICS_BACKFILL_COLUMNS = [
237
+ export const FIRST_PARTY_ANALYTICS_BACKFILL_COLUMNS = [
228
238
  "id",
229
239
  "public_key_id",
230
240
  "event_name",
@@ -352,9 +362,114 @@ async function insertBatch(
352
362
  }
353
363
  }
354
364
 
365
+ function boundedInsertOption(
366
+ value: number | undefined,
367
+ fallback: number,
368
+ maximum: number,
369
+ name: string,
370
+ ): number {
371
+ if (value === undefined) return fallback;
372
+ if (!Number.isInteger(value) || value < 1) {
373
+ throw new Error(`${name} must be a positive integer`);
374
+ }
375
+ return Math.min(value, maximum);
376
+ }
377
+
378
+ async function insertPayloadRows(
379
+ table: BigQueryTableRef,
380
+ token: string,
381
+ payloadRows: Record<string, unknown>[],
382
+ options: FirstPartyAnalyticsInsertOptions = {},
383
+ ): Promise<void> {
384
+ const maxRowsPerRequest = boundedInsertOption(
385
+ options.maxRowsPerRequest,
386
+ MAX_INSERT_BATCH_SIZE,
387
+ MAX_DEDICATED_INSERT_BATCH_SIZE,
388
+ "maxRowsPerRequest",
389
+ );
390
+ const maxConcurrentRequests = boundedInsertOption(
391
+ options.maxConcurrentRequests,
392
+ 1,
393
+ MAX_DEDICATED_INSERT_CONCURRENCY,
394
+ "maxConcurrentRequests",
395
+ );
396
+ const batches: Record<string, unknown>[][] = [];
397
+ const encoder = new TextEncoder();
398
+ let currentBatch: Record<string, unknown>[] = [];
399
+ let currentBytes = 2;
400
+ for (const row of payloadRows) {
401
+ const rowBytes = encoder.encode(
402
+ JSON.stringify({
403
+ insertId: typeof row.id === "string" ? row.id : undefined,
404
+ json: row,
405
+ }),
406
+ ).byteLength;
407
+ if (rowBytes + 2 > MAX_INSERT_REQUEST_BYTES) {
408
+ throw new Error(
409
+ "A first-party Analytics row exceeds the BigQuery request limit",
410
+ );
411
+ }
412
+ if (
413
+ currentBatch.length > 0 &&
414
+ (currentBatch.length >= maxRowsPerRequest ||
415
+ currentBytes + rowBytes + 1 > MAX_INSERT_REQUEST_BYTES)
416
+ ) {
417
+ batches.push(currentBatch);
418
+ currentBatch = [];
419
+ currentBytes = 2;
420
+ }
421
+ currentBatch.push(row);
422
+ currentBytes += rowBytes + 1;
423
+ }
424
+ if (currentBatch.length > 0) batches.push(currentBatch);
425
+
426
+ let nextBatch = 0;
427
+ const worker = async (): Promise<void> => {
428
+ while (true) {
429
+ const batchIndex = nextBatch;
430
+ nextBatch += 1;
431
+ const batch = batches[batchIndex];
432
+ if (!batch) return;
433
+ await insertBatch(table, token, batch);
434
+ }
435
+ };
436
+
437
+ await Promise.all(
438
+ Array.from(
439
+ { length: Math.min(maxConcurrentRequests, batches.length) },
440
+ () => worker(),
441
+ ),
442
+ );
443
+ }
444
+
445
+ /**
446
+ * Create a long-lived inserter for a dedicated backfill process. The table is
447
+ * resolved once, while the token is refreshed through the existing scoped
448
+ * resolver for every page so a multi-hour run does not use an expired token.
449
+ */
450
+ export async function createFirstPartyAnalyticsInserter(
451
+ configuredTable?: string | null,
452
+ options: FirstPartyAnalyticsInsertOptions = {},
453
+ ): Promise<
454
+ (
455
+ rows: Array<FirstPartyAnalyticsEventRow | Record<string, unknown>>,
456
+ ) => Promise<number>
457
+ > {
458
+ requireRequestCredentialContext("GOOGLE_APPLICATION_CREDENTIALS_JSON");
459
+ const table = await getFirstPartyAnalyticsTable(configuredTable);
460
+ return async (rows) => {
461
+ if (!rows.length) return 0;
462
+ const token = await getAccessToken();
463
+ const payloadRows = rows.map(firstPartyEventRowToBigQuery);
464
+ await insertPayloadRows(table, token, payloadRows, options);
465
+ return payloadRows.length;
466
+ };
467
+ }
468
+
355
469
  export async function insertFirstPartyAnalyticsRows(
356
470
  rows: Array<FirstPartyAnalyticsEventRow | Record<string, unknown>>,
357
471
  configuredTable?: string | null,
472
+ options: FirstPartyAnalyticsInsertOptions = {},
358
473
  ): Promise<number> {
359
474
  if (!rows.length) return 0;
360
475
  requireRequestCredentialContext("GOOGLE_APPLICATION_CREDENTIALS_JSON");
@@ -363,17 +478,7 @@ export async function insertFirstPartyAnalyticsRows(
363
478
  getAccessToken(),
364
479
  ]);
365
480
  const payloadRows = rows.map(firstPartyEventRowToBigQuery);
366
- for (
367
- let offset = 0;
368
- offset < payloadRows.length;
369
- offset += MAX_INSERT_BATCH_SIZE
370
- ) {
371
- await insertBatch(
372
- table,
373
- token,
374
- payloadRows.slice(offset, offset + MAX_INSERT_BATCH_SIZE),
375
- );
376
- }
481
+ await insertPayloadRows(table, token, payloadRows, options);
377
482
  return payloadRows.length;
378
483
  }
379
484
 
@@ -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
@@ -81,6 +81,13 @@ or other file-like payloads, design the upload path in the same change:
81
81
  provider upload first, then URL/id/blob handle in SQL. Do not add base64/binary
82
82
  columns or stuff files into `application_state`.
83
83
 
84
+ If the feature adds a server-side dependency carrying a native binary or heavy
85
+ runtime — headless browser, ffmpeg, image/video processing, ML runtime — read
86
+ the `performance` skill §9 before adding it. A deployed app has one `/*` page
87
+ function that every visitor's cache miss wakes, and it ships whatever the server
88
+ bundle depends on. Run that work from a background function or a job so the page
89
+ function never carries the weight.
90
+
84
91
  **If the action produces or lists a navigable resource**, add a `link` builder that returns `{ url: buildDeepLink({ app, view, params }), label }`. External coding agents and MCP hosts (Claude / ChatGPT / Claude Code / Cowork / Codex, over MCP/A2A) then surface an "Open in … →" deep link that drops the user back into the running UI focused on the record — for free. If a compatible MCP host should render an inline review/edit surface, also add `mcpApp` with `embedApp()` so the action embeds the real React app route instead of a one-off HTML UI. The `link` builder and `mcpApp` metadata must be pure and synchronous (no I/O). Any external-agent read/ingest action must be `http: { method: "GET" }` + `readOnly: true` + `publicAgent: { expose: true, readOnly: true, requiresAuth: true }`. See the `external-agents` skill.
85
92
 
86
93
  ### 3. Skills / Instructions
@@ -195,4 +202,6 @@ TL;DR: declare the vocabulary once with `defineAppRoles({ appId, roles, defaultR
195
202
  - **create-skill** — How to create skills for new patterns (area 3 in detail)
196
203
  - **storing-data** — Where to store the feature's data
197
204
  - **real-time-sync** — How the UI stays in sync when the agent writes data
205
+ - **performance** — Query/load cost, and (§9) cold-start artifact size when a
206
+ feature adds a server-side dependency
198
207
  - **internationalization** — How to update localized UI copy and catalogs
@@ -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
@@ -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
@@ -81,6 +81,13 @@ or other file-like payloads, design the upload path in the same change:
81
81
  provider upload first, then URL/id/blob handle in SQL. Do not add base64/binary
82
82
  columns or stuff files into `application_state`.
83
83
 
84
+ If the feature adds a server-side dependency carrying a native binary or heavy
85
+ runtime — headless browser, ffmpeg, image/video processing, ML runtime — read
86
+ the `performance` skill §9 before adding it. A deployed app has one `/*` page
87
+ function that every visitor's cache miss wakes, and it ships whatever the server
88
+ bundle depends on. Run that work from a background function or a job so the page
89
+ function never carries the weight.
90
+
84
91
  **If the action produces or lists a navigable resource**, add a `link` builder that returns `{ url: buildDeepLink({ app, view, params }), label }`. External coding agents and MCP hosts (Claude / ChatGPT / Claude Code / Cowork / Codex, over MCP/A2A) then surface an "Open in … →" deep link that drops the user back into the running UI focused on the record — for free. If a compatible MCP host should render an inline review/edit surface, also add `mcpApp` with `embedApp()` so the action embeds the real React app route instead of a one-off HTML UI. The `link` builder and `mcpApp` metadata must be pure and synchronous (no I/O). Any external-agent read/ingest action must be `http: { method: "GET" }` + `readOnly: true` + `publicAgent: { expose: true, readOnly: true, requiresAuth: true }`. See the `external-agents` skill.
85
92
 
86
93
  ### 3. Skills / Instructions
@@ -195,4 +202,6 @@ TL;DR: declare the vocabulary once with `defineAppRoles({ appId, roles, defaultR
195
202
  - **create-skill** — How to create skills for new patterns (area 3 in detail)
196
203
  - **storing-data** — Where to store the feature's data
197
204
  - **real-time-sync** — How the UI stays in sync when the agent writes data
205
+ - **performance** — Query/load cost, and (§9) cold-start artifact size when a
206
+ feature adds a server-side dependency
198
207
  - **internationalization** — How to update localized UI copy and catalogs
@@ -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
@@ -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