@frontera-sdk/cli 1.52.39 → 1.52.41

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 (235) hide show
  1. package/README.md +9 -0
  2. package/package.json +6 -4
  3. package/src/adopt.ts +6 -2
  4. package/src/api/apps-api.ts +86 -4
  5. package/src/api/blueprint-authoring-api.ts +35 -11
  6. package/src/api/dataset-api.ts +29 -0
  7. package/src/api/governed-action-api.ts +90 -2
  8. package/src/api/platform-api.ts +87 -2
  9. package/src/api/workflow-api.ts +33 -2
  10. package/src/app-contract.ts +156 -0
  11. package/src/app-lock.ts +125 -0
  12. package/src/args.ts +14 -3
  13. package/src/auth-verify.ts +10 -0
  14. package/src/automation-template.ts +12 -1
  15. package/src/blueprint/action-rules.ts +516 -0
  16. package/src/blueprint/action-semantic-fit.ts +205 -0
  17. package/src/blueprint/compile.ts +51 -2
  18. package/src/blueprint/diff.ts +34 -2
  19. package/src/blueprint/metric-query.ts +215 -0
  20. package/src/blueprint/metric-rules.ts +122 -0
  21. package/src/blueprint/object-sets.ts +116 -0
  22. package/src/blueprint/ontology-edit-plan.ts +49 -5
  23. package/src/blueprint/projection.ts +24 -1
  24. package/src/blueprint/scaffold.ts +84 -42
  25. package/src/commands/action/available.ts +1 -1
  26. package/src/commands/action/criteria-refusal.ts +84 -0
  27. package/src/commands/action/decide.ts +5 -2
  28. package/src/commands/action/deploy.ts +13 -4
  29. package/src/commands/action/list.ts +134 -19
  30. package/src/commands/action/requests.ts +34 -6
  31. package/src/commands/action/submit.ts +28 -13
  32. package/src/commands/agent/draft-changes.ts +1 -1
  33. package/src/commands/agent/index-commands.ts +69 -7
  34. package/src/commands/agent/resolve.ts +2 -0
  35. package/src/commands/app/checks.ts +44 -0
  36. package/src/commands/app/deploy.ts +243 -60
  37. package/src/commands/app/deployments.ts +97 -0
  38. package/src/commands/app/dev.ts +103 -11
  39. package/src/commands/app/init.ts +36 -3
  40. package/src/commands/app/promote.ts +45 -19
  41. package/src/commands/app/pull.ts +3 -1
  42. package/src/commands/app/rollback.ts +46 -0
  43. package/src/commands/app/sdk.ts +54 -8
  44. package/src/commands/app/unpin.ts +27 -0
  45. package/src/commands/app/versions.ts +1 -1
  46. package/src/commands/automation/bindings.ts +4 -2
  47. package/src/commands/automation/build-entry.ts +4 -1
  48. package/src/commands/automation/index-commands.ts +3 -1
  49. package/src/commands/automation/pull.ts +6 -1
  50. package/src/commands/automation/run.ts +34 -9
  51. package/src/commands/blueprint/bind.ts +2 -1
  52. package/src/commands/blueprint/declarative.ts +332 -32
  53. package/src/commands/blueprint/editable.ts +3 -3
  54. package/src/commands/blueprint/get.ts +6 -2
  55. package/src/commands/blueprint/grants.ts +64 -10
  56. package/src/commands/blueprint/metric.ts +108 -0
  57. package/src/commands/blueprint/object-sets.ts +71 -0
  58. package/src/commands/blueprint/query.ts +155 -31
  59. package/src/commands/dataset/index-commands.ts +156 -7
  60. package/src/commands/knowledge/index-commands.ts +122 -20
  61. package/src/commands/local/check.ts +657 -44
  62. package/src/commands/local/data.ts +33 -12
  63. package/src/commands/local/dev.ts +876 -89
  64. package/src/commands/local/docs-mcp.ts +10 -18
  65. package/src/commands/local/index-commands.ts +300 -63
  66. package/src/commands/local/init.ts +18 -5
  67. package/src/commands/local/key.ts +0 -3
  68. package/src/commands/local/providers.ts +0 -7
  69. package/src/commands/local/remove.ts +116 -0
  70. package/src/commands/local/schema.ts +3 -4
  71. package/src/commands/local/sdk-refresh.ts +59 -0
  72. package/src/commands/local/snapshot.ts +100 -0
  73. package/src/commands/local/sync-request.ts +321 -14
  74. package/src/commands/local/sync.ts +103 -6
  75. package/src/commands/mcp/serve.ts +34 -0
  76. package/src/commands/registry.ts +54 -10
  77. package/src/commands/types.ts +29 -0
  78. package/src/commands/workflow/archive.ts +46 -0
  79. package/src/commands/workflow/get.ts +2 -1
  80. package/src/commands/workflow/index-commands.ts +5 -0
  81. package/src/commands/workflow/push.ts +49 -2
  82. package/src/commands/workflow/run.ts +65 -7
  83. package/src/commands/workflow/runs.ts +9 -6
  84. package/src/commands/workflow/webhook-test.ts +166 -0
  85. package/src/config.ts +43 -6
  86. package/src/dev-broker.ts +52 -0
  87. package/src/exit.ts +103 -4
  88. package/src/flag-help.ts +77 -17
  89. package/src/forge/claude-commands.ts +11 -6
  90. package/src/forge/claude-skills.ts +4 -4
  91. package/src/forge/touches.ts +15 -12
  92. package/src/function-outside-imports.ts +89 -0
  93. package/src/harness.ts +42 -24
  94. package/src/heal.ts +113 -2
  95. package/src/kit.ts +1 -1
  96. package/src/local/fix-words.ts +12 -0
  97. package/src/local/function-bundle-recovery.ts +775 -0
  98. package/src/local/local-actions.ts +103 -10
  99. package/src/local/local-agent-action-grants.ts +210 -0
  100. package/src/local/local-agent-checks.ts +232 -0
  101. package/src/local/local-agent-grants.ts +29 -7
  102. package/src/local/local-agent-lean-plugins.ts +68 -0
  103. package/src/local/local-agent-missing-tools.ts +68 -0
  104. package/src/local/local-agent-name.ts +27 -0
  105. package/src/local/local-app-code.ts +191 -0
  106. package/src/local/local-app-dev-files.ts +186 -0
  107. package/src/local/local-app-dev-session.ts +88 -0
  108. package/src/local/local-app-lock-install.ts +114 -0
  109. package/src/local/local-app-pulled.ts +167 -0
  110. package/src/local/local-app-restore.ts +111 -0
  111. package/src/local/local-app-runtime.ts +68 -0
  112. package/src/local/local-app-sdk-paths.ts +149 -0
  113. package/src/local/local-app-sdk.ts +509 -0
  114. package/src/local/local-applied.ts +212 -22
  115. package/src/local/local-apply-history.ts +84 -0
  116. package/src/local/local-apply-summary.ts +86 -0
  117. package/src/local/local-apply-watchdog.ts +95 -0
  118. package/src/local/local-apps.ts +181 -8
  119. package/src/local/local-blueprint-errors.ts +198 -0
  120. package/src/local/local-blueprint-outline.ts +31 -12
  121. package/src/local/local-blueprint-schemas.ts +582 -0
  122. package/src/local/local-build-inputs.ts +48 -0
  123. package/src/local/local-build-summary.ts +495 -28
  124. package/src/local/local-case-evidence.ts +120 -0
  125. package/src/local/local-case-not-run.ts +153 -0
  126. package/src/local/local-chat-apps.ts +93 -16
  127. package/src/local/local-check-inherited.ts +83 -0
  128. package/src/local/local-cities.ts +89 -0
  129. package/src/local/local-component-health.ts +119 -0
  130. package/src/local/local-control.ts +34 -7
  131. package/src/local/local-db-snapshot.ts +348 -0
  132. package/src/local/local-dev-references.ts +347 -36
  133. package/src/local/local-dev-sync.ts +141 -12
  134. package/src/local/local-docker.ts +35 -1
  135. package/src/local/local-docs-search.ts +1 -1
  136. package/src/local/local-docs.ts +281 -2
  137. package/src/local/local-empty-workflows.ts +92 -0
  138. package/src/local/local-env.ts +16 -1
  139. package/src/local/local-file-checks.ts +104 -0
  140. package/src/local/local-function-ids.ts +141 -0
  141. package/src/local/local-function-recovery.ts +141 -0
  142. package/src/local/local-function-state.ts +87 -0
  143. package/src/local/local-keys.ts +7 -5
  144. package/src/local/local-knowledge-documents.ts +1 -1
  145. package/src/local/local-knowledge-ingestion.ts +225 -0
  146. package/src/local/local-knowledge-uploads.ts +217 -0
  147. package/src/local/local-lessons.ts +1 -1
  148. package/src/local/local-library.ts +1 -1
  149. package/src/local/local-media-placeholders.ts +182 -0
  150. package/src/local/local-media-sets.ts +90 -10
  151. package/src/local/local-model-parameters.ts +89 -0
  152. package/src/local/local-object-sets.ts +18 -6
  153. package/src/local/local-operating.ts +35 -1
  154. package/src/local/local-org-settings.ts +206 -8
  155. package/src/local/local-orphans.ts +321 -0
  156. package/src/local/local-personas.ts +296 -0
  157. package/src/local/local-portability.ts +143 -18
  158. package/src/local/local-ports.ts +99 -7
  159. package/src/local/local-project-notices.ts +234 -0
  160. package/src/local/local-project-secrets.ts +133 -0
  161. package/src/local/local-project.ts +12 -0
  162. package/src/local/local-provider-refusal.ts +66 -0
  163. package/src/local/local-request-evidence.ts +112 -0
  164. package/src/local/local-runtime-health.ts +123 -0
  165. package/src/local/local-runtime-history.ts +50 -0
  166. package/src/local/local-runtime-target.ts +42 -0
  167. package/src/local/local-sample-data.ts +141 -0
  168. package/src/local/local-sample-remake.ts +138 -0
  169. package/src/local/local-scaffold.ts +336 -53
  170. package/src/local/local-schema-check.ts +148 -0
  171. package/src/local/local-schemas.ts +742 -25
  172. package/src/local/local-secret-carry.ts +107 -0
  173. package/src/local/local-secrets.ts +41 -11
  174. package/src/local/local-seed.ts +102 -26
  175. package/src/local/local-stand-ins.ts +3 -3
  176. package/src/local/local-state.ts +43 -2
  177. package/src/local/local-studio-server.ts +170 -7
  178. package/src/local/local-supervisor.ts +44 -6
  179. package/src/local/local-sync-merge.ts +1 -1
  180. package/src/local/local-sync-names.ts +2 -0
  181. package/src/local/local-sync-plan.ts +19 -8
  182. package/src/local/local-sync-push.ts +15 -12
  183. package/src/local/local-sync-refs.ts +49 -3
  184. package/src/local/local-sync-remote.ts +349 -38
  185. package/src/local/local-sync-snapshot.ts +18 -13
  186. package/src/local/local-synthetic-data.ts +2116 -99
  187. package/src/local/local-test-baseline.ts +113 -0
  188. package/src/local/local-test-cases.ts +76 -1
  189. package/src/local/local-test-runner.ts +582 -91
  190. package/src/local/local-test-runs.ts +13 -5
  191. package/src/local/local-vendored-sdk.ts +183 -0
  192. package/src/local/local-workflow-state.ts +16 -3
  193. package/src/local/local-workflow-tests.ts +482 -0
  194. package/src/local/local-workspace-grants.ts +81 -0
  195. package/src/main.ts +50 -9
  196. package/src/mcp/a11y-scan.ts +55 -0
  197. package/src/mcp/browser/ax-snapshot.ts +181 -0
  198. package/src/mcp/browser/credentials.ts +78 -0
  199. package/src/mcp/browser/frames.ts +336 -0
  200. package/src/mcp/browser/headless-session.ts +413 -0
  201. package/src/mcp/browser/headless-tab.ts +575 -0
  202. package/src/mcp/browser/keys.ts +70 -0
  203. package/src/mcp/browser/page-scripts.ts +129 -0
  204. package/src/mcp/browser/wait.ts +73 -0
  205. package/src/mcp/forge-link.ts +126 -0
  206. package/src/mcp/headless.ts +199 -0
  207. package/src/mcp/mcp-apps.ts +435 -0
  208. package/src/mcp/mcp-chat.ts +226 -0
  209. package/src/mcp/mcp-cli.ts +53 -0
  210. package/src/mcp/mcp-protocol.ts +122 -0
  211. package/src/mcp/mcp-runtime.ts +113 -0
  212. package/src/mcp/mcp-server.ts +108 -0
  213. package/src/mcp/mcp-traces.ts +409 -0
  214. package/src/mcp/page-observation.ts +193 -0
  215. package/src/mcp/tools/agent-tools.ts +700 -0
  216. package/src/mcp/tools/app-tools.ts +241 -0
  217. package/src/mcp/tools/browser-tools.ts +310 -0
  218. package/src/mcp/tools/docs-tools.ts +32 -0
  219. package/src/mcp/tools/project-tools.ts +205 -0
  220. package/src/mcp/tools/test-tools.ts +339 -0
  221. package/src/mcp/tools/workflow-tools.ts +611 -0
  222. package/src/output.ts +1 -1
  223. package/src/pack.ts +8 -3
  224. package/src/packaging.ts +1 -1
  225. package/src/project-bootstrap.ts +107 -4
  226. package/src/project-context.ts +18 -1
  227. package/src/project.ts +27 -2
  228. package/src/provenance.ts +25 -0
  229. package/src/render-evidence.ts +65 -7
  230. package/src/scopes.ts +1 -1
  231. package/src/template.ts +14 -8
  232. package/src/templates/next-app-files.ts +35 -6
  233. package/src/templates/next-skills.ts +61 -27
  234. package/src/vendor/kit-assets.json +6 -6
  235. package/src/vendor/sdk-sources.json +17 -14
@@ -21,6 +21,11 @@
21
21
  * unreadable skill.
22
22
  */
23
23
 
24
+ import vendored from '../vendor/sdk-sources.json'
25
+
26
+ /** The SDK release these skills describe: the one the scaffold pins (`^<version>`). */
27
+ const SDK_VERSION = vendored.sdkVersion
28
+
24
29
  interface Skill {
25
30
  name: string
26
31
  description: string
@@ -514,6 +519,14 @@ const actions: Skill = {
514
519
  "import { actionEffectOf, recordVersionOf } from '@frontera-sdk/blueprint/action-types'",
515
520
  '```',
516
521
  '',
522
+ `This skill describes \`@frontera-sdk/blueprint\` ${SDK_VERSION}, the release the scaffold pins`,
523
+ `(\`^${SDK_VERSION}\`). \`useAction\`'s \`available\`, \`reason\` and \`reasonText\` need that release or`,
524
+ 'later: an older install returns only `{ action, isLoading, error }`. `frontera local check` (its',
525
+ 'apps step) and `app_dev` warn when the installed SDK is older than this, or lacks what it exports,',
526
+ 'and name the upgrade. When the local runtime runs from a platform checkout (source mode), the App',
527
+ 'uses that checkout\'s SDK instead: `frontera app sdk use-local` packs it into `vendor/frontera-sdk/`',
528
+ '(`--npm` switches back).',
529
+ '',
517
530
  '## Rules',
518
531
  '',
519
532
  '- **Render controls from `useActions()`**, or `useAction(apiName)` for one — never from a',
@@ -521,6 +534,12 @@ const actions: Skill = {
521
534
  ' server knows which. A button that 403s on click is worse than one that was never drawn.',
522
535
  '- An empty discovery list in development is almost always permissions, not a bug: an Action is',
523
536
  ' hidden unless it is published, deployed, AND its invoke capability is held by your role.',
537
+ '- **Never disable a control without saying why.** `useAction(apiName)` returns `available` and,',
538
+ ' when it is false, `reasonText`: a sentence for the person, the platform\'s own when it may tell',
539
+ ' this caller (such as `capability_not_granted` or `not_deployed` in `reason`, with `next` saying',
540
+ ' what would fix it while you build), else a neutral "not available". Leave the control out, or',
541
+ ' keep it visible and show `reasonText` beside it or as its tooltip; a silently greyed-out button',
542
+ ' reads as a bug. Never show `next` to the App\'s users: it is for the person building it.',
524
543
  '- **A submit is not a write.** `useSubmitAction(action)` resolves when the Request is RECORDED;',
525
544
  ' dispatch happens on a background worker. A success toast in `onSuccess` claims something the',
526
545
  ' App does not know yet.',
@@ -534,9 +553,11 @@ const actions: Skill = {
534
553
  ' takes `{ requestId, decision, reason }`. Do not design a flow that assumes instant application.',
535
554
  ' For an approval with steps, the decision must also pass the current step of the request,',
536
555
  ' `request.approval.currentStage`, as `stage`.',
537
- '- Editing an existing record: pass `expectedVersion: recordVersionOf(instance.data)`, read from',
538
- ' `useObjectInstance` — a LIST row does not carry the version. Omitting it does not fail; the',
539
- ' compare-and-set is skipped and two people overwrite each other with no refusal and no evidence.',
556
+ '- Editing an existing record: pass `objectId` and `expectedVersion: recordVersionOf(instance.data)`,',
557
+ ' read from `useObjectInstance` — a LIST row does not carry the version. The platform fills the',
558
+ ' Action\'s key input and its `expectedVersion` input from these, so `input` holds only the change.',
559
+ ' An edit without the version is refused as stale; a key or version in `input` that disagrees with',
560
+ ' them is refused too.',
540
561
  '- Idempotency keys are minted per `mutate` call. That is the correct lifetime — a retried network',
541
562
  ' call cannot double-apply, a second click is a second intent — so do not supply your own.',
542
563
  '- Refresh reads when the request reaches a terminal APPLIED state, not when the submit resolves.',
@@ -545,14 +566,22 @@ const actions: Skill = {
545
566
  '',
546
567
  '```tsx',
547
568
  '// src/ui/approve-loan/approve-loan.tsx',
548
- "const { action } = useAction('ApproveLoan')",
569
+ "const { action, isLoading, reasonText } = useAction('ApproveLoan')",
549
570
  'const submit = useSubmitAction(action)',
550
571
  'const [requestId, setRequestId] = useState<string | null>(null)',
551
572
  'const request = useActionRequest(requestId)',
552
573
  'const effect = actionEffectOf(request.data)',
553
574
  '',
554
- '// Not drawn at all when the caller may not invoke it.',
555
- 'if (!action) return null',
575
+ 'if (isLoading) return null',
576
+ '// Kept visible, it says why it cannot be used (or return null to leave it out).',
577
+ 'if (!action) {',
578
+ ' return (',
579
+ ' <div>',
580
+ ' <Button disabled title={reasonText ?? undefined}>{copy.loan.approve}</Button>',
581
+ ' <p className="text-sm text-muted-foreground">{reasonText}</p>',
582
+ ' </div>',
583
+ ' )',
584
+ '}',
556
585
  '',
557
586
  'return (',
558
587
  ' <>',
@@ -1126,7 +1155,7 @@ const security: Skill = {
1126
1155
  '## Verification',
1127
1156
  '',
1128
1157
  '```bash',
1129
- 'frontera app deploy --no-promote',
1158
+ 'frontera app deploy',
1130
1159
  '```',
1131
1160
  '',
1132
1161
  'Open the preview URL and watch the browser console: a blocked request is a CSP declaration you',
@@ -1152,40 +1181,46 @@ const release: Skill = {
1152
1181
  '## Safe sequence',
1153
1182
  '',
1154
1183
  '1. `bun run check` — typecheck, tests, then the build. The build is the authoritative',
1155
- ' static-export compatibility check.',
1184
+ ' static-export compatibility check. `frontera app deploy` runs it too and records the result.',
1156
1185
  '2. Confirm `out/index.html` exists, along with every route you intended to export.',
1157
- '3. `frontera app deploy --no-promote` — publishes a version without moving the live pointer.',
1158
- '4. Open the returned preview URL. Check it embedded and at a narrow width, in both themes, and',
1159
- ' watch the console for blocked requests.',
1160
- '5. `frontera app promote <version>` — point live at it.',
1186
+ '3. `frontera app deploy` — uploads an immutable preview deployment with its own id and link,',
1187
+ ' and moves this branch\'s and this session\'s preview links to it. It never changes what users see.',
1188
+ '4. Open the returned preview URL (or render it). Check it embedded and at a narrow width, in both',
1189
+ ' themes, and watch the console for blocked requests.',
1190
+ '5. `frontera app promote <deployment>` — point production at it, once the required checks pass.',
1191
+ ' Promoting needs the promote permission; a coding agent leaves it to a person.',
1161
1192
  '',
1162
1193
  '```bash',
1163
- 'frontera app deploy --no-promote',
1194
+ 'frontera app deploy',
1164
1195
  '```',
1165
1196
  '',
1166
1197
  '```bash',
1167
- 'frontera app versions',
1198
+ 'frontera app deployments',
1168
1199
  '```',
1169
1200
  '',
1170
1201
  '## Rules',
1171
1202
  '',
1172
- '- Versions are immutable. Never reuse a version string for different bytes.',
1173
- '- Rollback is promoting an earlier version, not rebuilding one. That is the whole reason the old',
1174
- ' bytes are kept.',
1175
- '- Promote deliberately. A deploy that promotes by default turns every experiment into a release.',
1176
- '- `frontera app versions` shows runtime, routing, framework provenance, source commit and dirty',
1177
- ' status, sizes and the live pointer. The CLI-recorded provenance is metadata; the',
1178
- ' service-computed digest, file count, byte count and uploader are authoritative.',
1203
+ '- Deployments are immutable and get their own id. `--label 1.4.0` adds a release label,',
1204
+ ' unique per App; never reuse one for different bytes.',
1205
+ '- `frontera app deploy --prod` goes live in one step once the checks pass; `--prod --no-promote`',
1206
+ ' stages it for production without serving it.',
1207
+ '- Rollback moves a pointer, it never rebuilds: `frontera app rollback --reason "…"` returns',
1208
+ ' production to the previous production deployment and PINS it. Nothing promotes until',
1209
+ ' `frontera app rollback --undo` or an Unpin, so the next routine deploy cannot undo the rollback.',
1210
+ '- `frontera app deployments` shows each deployment\'s producer, session, branch, commit and',
1211
+ ' dirty status, render evidence and which link serves it. The CLI-recorded provenance is',
1212
+ ' metadata; the service-computed digest, file count, byte count and producer are authoritative.',
1179
1213
  '- Deploying from a dirty tree is recorded as dirty. Do not do it for a release you intend to',
1180
1214
  ' reproduce later.',
1181
- '- Customer CI runs the same two commands with credentials from the CI secret store, never from',
1215
+ '- Customer CI runs the same commands with credentials from the CI secret store, never from',
1182
1216
  ' the repository.',
1183
1217
  '- A schema-dependent change needs `bun run blueprint:types:check` in CI: the App can build',
1184
- ' perfectly against a contract the workspace no longer has.',
1218
+ ' perfectly against a contract the workspace no longer has. The platform checks the',
1219
+ ' deployment\'s Blueprint contract again before it goes live.',
1185
1220
  '',
1186
1221
  '## Red Flags — STOP',
1187
1222
  '',
1188
- '- Promoting a version nobody opened.',
1223
+ '- Promoting a deployment nobody opened.',
1189
1224
  '- Deploying without `bun run check`, or after only a typecheck.',
1190
1225
  '- Editing `out/` by hand.',
1191
1226
  '- Rebuilding to "roll back".',
@@ -1194,11 +1229,10 @@ const release: Skill = {
1194
1229
  '## Verification',
1195
1230
  '',
1196
1231
  '```bash',
1197
- 'frontera app versions',
1232
+ 'frontera app deployments',
1198
1233
  '```',
1199
1234
  '',
1200
- 'The live pointer must name the version you promoted, and its digest must match the deploy you',
1201
- 'previewed.',
1235
+ 'Production must name the deployment you promoted, and it must be the one you previewed.',
1202
1236
  '',
1203
1237
  '## Scope',
1204
1238
  '',