@voltro/cli 0.2.2 → 0.4.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 (77) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/THIRD-PARTY-NOTICES.md +234 -1
  3. package/bin/voltro.mjs +71 -1
  4. package/dist/apiBuild-CvtQeBMs.js +190 -0
  5. package/dist/apiBuild-DQBNqNZ8.js +2 -0
  6. package/dist/bin.js +2 -2
  7. package/dist/{commands-DQy4812j.js → commands-DhyBIs1O.js} +2381 -1768
  8. package/dist/{dev--jHe1vcu.js → dev-CQxbrpDz.js} +1677 -1626
  9. package/dist/dev-DYjGqPGD.js +2 -0
  10. package/dist/index.d.ts +2 -0
  11. package/dist/index.js +1 -1
  12. package/dist/serveCommand-BZzUJIyo.js +1077 -0
  13. package/dist/serveEntry.js +2 -2
  14. package/package.json +22 -19
  15. package/templates/AGENTS.core.md +61 -0
  16. package/templates/AGENTS.md +61 -0
  17. package/templates/agent-docs/_manifest.json +4 -4
  18. package/templates/agent-docs/ai.md +28 -0
  19. package/templates/agent-docs/authentication.md +5 -2
  20. package/templates/agent-docs/cli.md +98 -0
  21. package/templates/agent-docs/data.md +193 -3
  22. package/templates/agent-docs/database/advancedqueries.md +29 -0
  23. package/templates/agent-docs/database/querying.md +2 -0
  24. package/templates/agent-docs/deployment.md +3 -1
  25. package/templates/agent-docs/internationalization.md +237 -2
  26. package/templates/agent-docs/observability.md +9 -0
  27. package/templates/agent-docs/plugins.md +2 -2
  28. package/templates/agent-docs/reference.md +76 -0
  29. package/templates/agent-docs/schema-driven-ui.md +551 -2
  30. package/templates/agent-docs/templates/apibackends.md +10 -8
  31. package/templates/agent-docs/templates/overview.md +1 -1
  32. package/templates/agent-docs/testing.md +177 -3
  33. package/templates/apps/api-ai/package.json +7 -7
  34. package/templates/apps/api-auth/package.json +8 -8
  35. package/templates/apps/api-backend/package.json +7 -7
  36. package/templates/apps/api-backend-deactivation/package.json +7 -7
  37. package/templates/apps/api-backend-mail/package.json +8 -8
  38. package/templates/apps/api-backend-mariadb/package.json +9 -9
  39. package/templates/apps/api-backend-storage/package.json +8 -8
  40. package/templates/apps/api-data-advanced/package.json +8 -8
  41. package/templates/apps/api-durable/package.json +8 -8
  42. package/templates/apps/api-feature-flags/package.json +9 -9
  43. package/templates/apps/api-governance/package.json +8 -8
  44. package/templates/apps/api-kv/package.json +8 -8
  45. package/templates/apps/api-moderation/package.json +8 -8
  46. package/templates/apps/api-observability/package.json +8 -8
  47. package/templates/apps/api-ratelimit/package.json +8 -8
  48. package/templates/apps/api-rbac/README.md +9 -4
  49. package/templates/apps/api-rbac/mutations/notes.create.mutation.server.ts +1 -1
  50. package/templates/apps/api-rbac/mutations/notes.create.mutation.ts +6 -6
  51. package/templates/apps/api-rbac/package.json +8 -8
  52. package/templates/apps/api-rbac/tests/notes.create.test.ts +8 -8
  53. package/templates/apps/api-rest/package.json +7 -7
  54. package/templates/apps/api-saas/package.json +11 -11
  55. package/templates/apps/api-search/package.json +8 -8
  56. package/templates/apps/api-versioning/package.json +8 -8
  57. package/templates/apps/api-webhooks/package.json +8 -8
  58. package/templates/apps/changelog/package.json +6 -6
  59. package/templates/apps/edge-functions/package.json +2 -2
  60. package/templates/apps/frontend-admin/package.json +8 -8
  61. package/templates/apps/frontend-app/package.json +8 -8
  62. package/templates/apps/frontend-blank/package.json +7 -7
  63. package/templates/apps/frontend-contact/package.json +7 -7
  64. package/templates/apps/frontend-dashboard/package.json +7 -7
  65. package/templates/apps/frontend-docs/package.json +7 -7
  66. package/templates/apps/frontend-i18n/package.json +6 -6
  67. package/templates/apps/frontend-landing/package.json +7 -7
  68. package/templates/apps/frontend-spa/package.json +7 -7
  69. package/templates/apps/frontend-ssr/package.json +7 -7
  70. package/templates/apps/frontend-ssr-api/package.json +8 -8
  71. package/templates/apps/frontend-static-blog/package.json +6 -6
  72. package/templates/baselines/compose/docker/api.Dockerfile +10 -5
  73. package/templates/baselines/compose-mariadb/docker/api.Dockerfile +10 -5
  74. package/dist/apiBuild-OpZROja5.js +0 -2
  75. package/dist/apiBuild-o70rjpVJ.js +0 -184
  76. package/dist/dev-BKkZglQV.js +0 -2
  77. package/dist/serveCommand-93rRdEp0.js +0 -1077
@@ -21,10 +21,15 @@ The web side of a Voltro app talks to API apps through React hooks. Data hooks a
21
21
  | [`useMutation`](/docs/reference/hooks-data) | Run an atomic write (`*.mutation.ts`). |
22
22
  | [`useAction`](/docs/reference/hooks-data) | Run a unary non-transactional action (`*.action.ts`). |
23
23
  | [`useWorkflow`](/docs/reference/hooks-data) | Start, cancel, resume, or signal a durable workflow (`*.workflow.tsx`). |
24
+ | [`useWorkflowSignal`](/docs/reference/hooks-data) | Focused signal sender, for approval buttons that don't also start workflows. |
25
+ | [`useWorkflowUpdate`](/docs/reference/hooks-data) | Focused tracked update — waits for the workflow handler's result. |
24
26
  | [`useWorkflowRun`](/docs/reference/hooks-data) | Subscribe to one workflow run's reactive status row. |
25
27
  | [`useWorkflowRuns`](/docs/reference/hooks-data) | Subscribe to a bounded/filterable workflow run list. |
26
28
  | [`useWorkflowRunSteps`](/docs/reference/hooks-data) | Subscribe to one run's checkpointed step timeline. |
27
29
  | [`useWorkflowRunEvents`](/docs/reference/hooks-data) | Subscribe to one run's lifecycle/timer/signal event timeline. |
30
+ | [`useWorkflowDomainEvents`](/docs/reference/hooks-data) | Subscribe to the domain events a workflow emitted (the business-event timeline). |
31
+ | [`useWorkflowEventDeliveries`](/docs/reference/hooks-data) | Subscribe to delivery attempts/outcomes for those emitted events. |
32
+ | [`useWorkflowRunState`](/docs/ui/reactive-components) | Aggregates run + steps + events into one `{ status, currentStep, waitingFor, … }` plus cancel/resume/signal/update. |
28
33
  | [`useAgentStream`](/docs/reference/hooks-data) | Consume a one-shot element stream (`*.stream.ts`). |
29
34
  | [`useAgent`](/docs/reference/hooks-data) | Convenience wrapper for transient AI streams. |
30
35
 
@@ -44,6 +49,51 @@ The web side of a Voltro app talks to API apps through React hooks. Data hooks a
44
49
  |---|---|
45
50
  | [`useServerRequest`](/docs/reference/hooks-server) | Request snapshot during SSR and hydration-sensitive client code. |
46
51
 
52
+ ## Schema-driven UI Hooks
53
+
54
+ The headless primitives that derive UI from a descriptor's Schema. **Reach for
55
+ these before hand-rolling a form, a table, or a picker** — full guide in
56
+ [Schema-driven UI](/docs/ui/overview).
57
+
58
+ | Hook | Purpose |
59
+ |---|---|
60
+ | [`useFormBinding`](/docs/ui/forms-and-tables) | Bind a form to a MUTATION — fields + validation from its input Schema; a server `ValidationError({ field })` routes to that field. |
61
+ | [`useDataTable`](/docs/ui/forms-and-tables) | Bind a table to a QUERY — live rows, columns derived from the output Schema, sort/filter/pagination. |
62
+ | [`useQueryFilters`](/docs/ui/forms-and-tables) | Filter controls derived from a query's INPUT Schema (the read-side mirror of a form). |
63
+ | [`useQueryField`](/docs/ui/forms-and-tables) | Query-bound picker — a debounced search term drives a live subscription. |
64
+ | [`useFormSkeleton`](/docs/ui/client-utilities/use-skeletons) / [`useTableSkeleton`](/docs/ui/client-utilities/use-skeletons) | Placeholders shaped like the REAL data, from the same Schema. |
65
+ | [`useAsyncValidation`](/docs/ui/client-utilities/use-async-validation) | Live server-side validation (uniqueness, cross-row) over a query binding. |
66
+ | [`useDebounced`](/docs/ui/client-utilities/use-debounced) | Debounce a value (search, filter, validation input). |
67
+ | [`useRecord`](/docs/ui/client-utilities/use-record) | One live record from a "get" query, normalized (array → first row). |
68
+
69
+ ## Files, Permissions, and Client Utilities
70
+
71
+ | Hook | Purpose |
72
+ |---|---|
73
+ | [`useUpload`](/docs/plugins/storage) | File upload with progress + cancel, on every storage provider. Not base64 → action. |
74
+ | [`useCan`](/docs/ui/client-utilities/use-can) | Scope/RBAC UI gate, over `<PermissionProvider>`. Lives in `@voltro/client` — scopes are a framework concept, so gating a button needs no rbac dependency. |
75
+ | [`useCanAny`](/docs/ui/client-utilities/use-permissions) | OR variant of `useCan` — true when the subject holds AT LEAST ONE of the required scopes. |
76
+ | [`usePermissions`](/docs/ui/client-utilities/use-permissions) / `<PermissionProvider>` | The current subject's scope set, fed once from your session query — the source `useCan` reads. Gates UI on the SAME scope strings the server checks. |
77
+ | [`useResourceCan`](/docs/ui/client-utilities/use-permissions) / `useResourceCans` | Per-RESOURCE (ReBAC) gate, reactive — one resource or many in a single subscription. |
78
+ | [`useDerived`](/docs/ui/client-utilities/use-derived) | Dependency-tracked derived value from reactive sources. Replaces hand-maintained `useMemo` dep arrays. |
79
+ | [`useWindowedSubscription`](/docs/ui/client-utilities/use-windowed-subscription) | Subscribe to the VISIBLE window of a huge list, not the whole table. |
80
+ | [`useOutbox`](/docs/ui/client-utilities/use-outbox) | Queue mutations offline, replay in order on reconnect. |
81
+ | [`useUndoLog`](/docs/ui/client-utilities/use-undo) / `useUndo` | Client controller for the server-persisted undo stack. |
82
+ | [`usePreview`](/docs/ui/client-utilities/use-preview) | Mutation dry-run — run the real handler in a rolled-back transaction. |
83
+ | [`useProvenance`](/docs/ui/client-utilities/use-provenance) | "Why is this value here?" — lineage lookup for a field. |
84
+ | [`useOnRpcError`](/docs/ui/client-utilities/use-on-rpc-error) / `reportClientError` | Subscribe to the rpc error bus; report a client error to the server. |
85
+ | [`useTracking`](/docs/ui/client-utilities/use-tracking) | Fire mount/unmount + interaction tracking events. |
86
+ | [`useCapabilityManifest`](/docs/ui/client-utilities/use-capability-manifest) | The api's capability manifest (procedures + tables + schemas), fetched once. |
87
+ | [`useRefreshSubscriptions`](/docs/ui/client-utilities/use-refresh-subscriptions) | Force-refresh live subscriptions (e.g. after an out-of-band change). |
88
+
89
+ ## AI Hooks
90
+
91
+ | Hook | Purpose |
92
+ |---|---|
93
+ | [`useAgentChat`](/docs/ui/reactive-components) | Full chat surface over an `*.agent.tsx` (messages + send + streaming). |
94
+ | [`useResumableAgentStream`](/docs/ai/streaming) | Agent stream that survives reload/reconnect. |
95
+ | [`useDataCopilot`](/docs/ai/data-copilot) | Bind a data-copilot action by api name + tag. |
96
+
47
97
  ## Where To Read Next
48
98
 
49
99
  - [Data hooks](/docs/reference/hooks-data)
@@ -255,6 +305,32 @@ Events include lifecycle changes, timers, signals, and updates recorded by the w
255
305
 
256
306
  `useWorkflowEvents(apiName, runId)` is a shorter alias for the same hook.
257
307
 
308
+ ## `useWorkflowDomainEvents(apiName, filters?, options?)`
309
+
310
+ Subscribes to the **domain events** an app emitted through `ctx.events.emit(...)` — the business-event log behind [event triggers](/docs/workflows/event-triggers), not one run's internal timeline.
311
+
312
+ ```tsx
313
+ const { events } = useWorkflowDomainEvents('app', { name: 'order.paid', limit: 50 })
314
+ ```
315
+
316
+ Both filters are optional: `name` narrows to one event name, `limit` defaults to `100` and is clamped to `500` by the server. Rows arrive newest-first (by `occurredAt`), and each carries `id`, `name`, `payload`, `source`, `subject`, `traceId`, and `occurredAt`. The third argument is the standard `SubscriptionOptions` (e.g. `{ skip }`).
317
+
318
+ Alongside `events`, the hook returns the normal subscription fields (`data`, `error`, `revision`, …).
319
+
320
+ ## `useWorkflowEventDeliveries(apiName, eventId)`
321
+
322
+ Subscribes to the **fan-out** of one emitted domain event: one row per trigger the event was routed to, so you can see which workflows a single `emit(...)` actually started.
323
+
324
+ ```tsx
325
+ const { deliveries } = useWorkflowEventDeliveries('app', selectedEvent?.id)
326
+
327
+ deliveries.map((d) => `${d.workflowName}: ${d.status}`)
328
+ ```
329
+
330
+ The subscription is skipped while `eventId` is `undefined`, so it pairs directly with a row selected out of `useWorkflowDomainEvents`. Rows are ordered oldest-first and carry `eventId`, `eventName`, `triggerId`, `workflowName`, `executionId`, `idempotencyKey`, `skipped`, `errorMessage`, `createdAt`, `completedAt`, and a `status` of `'starting'`, `'started'`, `'skipped'`, or `'failed'`.
331
+
332
+ A `skipped` delivery is the normal outcome when a trigger's `filter` returned false or its `idempotencyKey` had already been seen — it is not a failure. `errorMessage` is set only on `'failed'`.
333
+
258
334
  ## `useAgentStream(apiName, rpcTag)`
259
335
 
260
336
  Consumes a `defineStream` RPC. Despite the name, this hook is not limited to AI agents; it handles any one-shot element stream.