@voltro/cli 0.36.0 → 0.38.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 (126) hide show
  1. package/CHANGELOG.md +182 -0
  2. package/dist/{apiBuild-DiE9zcj6.js → apiBuild-CvacV4zA.js} +2 -2
  3. package/dist/apiBuild-ttSDDOGp.js +2 -0
  4. package/dist/{baselineCommand-DIttzO8A.js → baselineCommand-C6NMt-oa.js} +1 -4
  5. package/dist/baselineCommand-Cfw2Afwm.js +2 -0
  6. package/dist/bin.js +1 -1
  7. package/dist/bootRefusal-pgvDxlrU.js +7 -0
  8. package/dist/{build-DBe6c7qC.js → build-_LoTC1s0.js} +31 -31
  9. package/dist/{checkCommand-BhG0gmUD.js → checkCommand-Pjk5sBl2.js} +3 -3
  10. package/dist/{checkCommand-BTA6P3Yr.js → checkCommand-wibtQx-N.js} +1 -1
  11. package/dist/{cloudCmd-Cvv5HGaZ.js → cloudCmd-NQSwe_Qk.js} +1 -1
  12. package/dist/{codegen-CYM3Zqrf.js → codegen-GYYcdpCg.js} +2 -2
  13. package/dist/codegen-uYrrDzQv.js +2 -0
  14. package/dist/{codegenCommand-DH-8ZXzR.js → codegenCommand-C60m_LCp.js} +2 -2
  15. package/dist/{codemodRunner-DjQGrdmg.js → codemodRunner-CXgQ-ecJ.js} +339 -167
  16. package/dist/{commands-Bp7utV-7.js → commands-DaZVi9wi.js} +74 -73
  17. package/dist/{dashboardCommand-D5Jwjmr1.js → dashboardCommand-Dxy_kmoW.js} +3 -3
  18. package/dist/{dataCommand-DnCm0B2C.js → dataCommand-D6-Ha2lf.js} +2 -2
  19. package/dist/{dbCommand-O8HA63s2.js → dbCommand-C4UW8cVN.js} +353 -351
  20. package/dist/dbCommand-CC-qNzpz.js +2 -0
  21. package/dist/{dev-BSFTgCQ5.js → dev-CAOoXOkc.js} +1 -1
  22. package/dist/{dev-Dc4cpmRl.js → dev-E7Eo5GHc.js} +262 -261
  23. package/dist/doctorCommand-Cjl8Yii8.js +2 -0
  24. package/dist/{doctorCommand-CNFtt3nR.js → doctorCommand-gmDyALFL.js} +10 -10
  25. package/dist/{dormancyCommand-6F6NsJKf.js → dormancyCommand-CE6wG8lj.js} +1 -1
  26. package/dist/{embeddingsCommand-DRRdneJD.js → embeddingsCommand-C3uAuf6N.js} +1 -1
  27. package/dist/{envCommand-TZzcyqZ-.js → envCommand-DzuWh8ya.js} +19 -19
  28. package/dist/{evolveCommand-iU35TPjT.js → evolveCommand-DPLqcYb2.js} +2 -2
  29. package/dist/index.js +2 -2
  30. package/dist/{infoCommand-unqisJGp.js → infoCommand-CmczGj_l.js} +1 -1
  31. package/dist/inspectGateHint-BF6608UT.js +4 -0
  32. package/dist/{metaCommands-7MJfZ5cf.js → metaCommands-CIoQNlaQ.js} +1 -1
  33. package/dist/{migrate-BV7I-ZHZ.js → migrate-RwgUWXfc.js} +1 -1
  34. package/dist/{privacyCommand-C-Df56U_.js → privacyCommand-XejDMvmu.js} +4 -3
  35. package/dist/{probeCommand-CZfaaUOZ.js → probeCommand-BPEpwT32.js} +40 -39
  36. package/dist/{projectScaffold-DmzEKHib.js → projectScaffold-CxgtJvlb.js} +1 -1
  37. package/dist/{projectScaffold-LMMtaavR.js → projectScaffold-DDgWbNLe.js} +2 -2
  38. package/dist/{runtimeTrace-D5LJ_N55.js → runtimeTrace-6jfznSzr.js} +1 -1
  39. package/dist/{sdkgen-82xVuvbt.js → sdkgen-CEJZZQUA.js} +1 -1
  40. package/dist/serveCommand-DNRF2nDI.js +2 -0
  41. package/dist/{serveCommand-VVGcIMIw.js → serveCommand-DnY4VS3D.js} +541 -540
  42. package/dist/serveEntry.js +1 -1
  43. package/dist/{start-BgN62boB.js → start-CidwCcjl.js} +1 -1
  44. package/dist/{start-T4VesWiM.js → start-RCh6qKFe.js} +24 -24
  45. package/dist/startEntry.js +1 -1
  46. package/dist/startup.d.ts +40 -1
  47. package/dist/startup.js +2 -2
  48. package/dist/startupRunner-CEqQq7ax.js +108 -0
  49. package/dist/subcommandNames-CKG5Dz3a.js +27 -0
  50. package/dist/{templates-De8IR5-c.js → templates-BR-fb4SP.js} +1 -4
  51. package/dist/{test-CI6iDsYc.js → test-DIQ0jlkQ.js} +1 -1
  52. package/dist/updateCommand-B0J_T9Vs.js +2 -0
  53. package/dist/{updateCommand-CwnUK_mf.js → updateCommand-CmksX7m_.js} +1 -1
  54. package/dist/{webDev-Dybxew86.js → webDev-BKdD7c_a.js} +689 -691
  55. package/dist/webDev-CcJfdSjl2.js +2 -0
  56. package/dist/{webhooksCommand-di1CJVzu.js → webhooksCommand-BHeaF1ZJ.js} +1 -1
  57. package/package.json +35 -17
  58. package/templates/AGENTS.md +1 -1
  59. package/templates/agent-docs/_index.md +1 -1
  60. package/templates/agent-docs/cli.md +16 -0
  61. package/templates/agent-docs/data.md +30 -0
  62. package/templates/agent-docs/plugins/audit.md +50 -0
  63. package/templates/agent-docs/plugins/auth.md +4 -6
  64. package/templates/agent-docs/reference.md +3 -2
  65. package/templates/agent-docs/whats-new.md +59 -35
  66. package/templates/apps/api-ai/package.json +7 -7
  67. package/templates/apps/api-auth/package.json +8 -8
  68. package/templates/apps/api-backend/package.json +7 -7
  69. package/templates/apps/api-backend-deactivation/package.json +7 -7
  70. package/templates/apps/api-backend-mail/package.json +8 -8
  71. package/templates/apps/api-backend-mariadb/package.json +9 -9
  72. package/templates/apps/api-backend-sqlite/package.json +8 -8
  73. package/templates/apps/api-backend-storage/package.json +8 -8
  74. package/templates/apps/api-cms/package.json +10 -10
  75. package/templates/apps/api-cms/tests/content.write.test.ts +16 -2
  76. package/templates/apps/api-collab/mutations/documents.setBody.mutation.server.ts +11 -5
  77. package/templates/apps/api-collab/package.json +8 -8
  78. package/templates/apps/api-collab/tests/documents.setBody.test.ts +8 -2
  79. package/templates/apps/api-data-advanced/package.json +8 -8
  80. package/templates/apps/api-durable/package.json +8 -8
  81. package/templates/apps/api-feature-flags/package.json +9 -9
  82. package/templates/apps/api-governance/package.json +8 -8
  83. package/templates/apps/api-kv/package.json +8 -8
  84. package/templates/apps/api-moderation/package.json +8 -8
  85. package/templates/apps/api-observability/package.json +8 -8
  86. package/templates/apps/api-ratelimit/package.json +8 -8
  87. package/templates/apps/api-rbac/package.json +8 -8
  88. package/templates/apps/api-rest/package.json +7 -7
  89. package/templates/apps/api-saas/package.json +11 -11
  90. package/templates/apps/api-saas-starter/package.json +10 -10
  91. package/templates/apps/api-search/package.json +8 -8
  92. package/templates/apps/api-status/package.json +8 -8
  93. package/templates/apps/api-versioning/mutations/documents.update.mutation.server.ts +7 -5
  94. package/templates/apps/api-versioning/package.json +8 -8
  95. package/templates/apps/api-webhooks/package.json +9 -9
  96. package/templates/apps/changelog/package.json +6 -6
  97. package/templates/apps/edge-functions/package.json +2 -2
  98. package/templates/apps/frontend-admin/package.json +8 -8
  99. package/templates/apps/frontend-app/package.json +9 -9
  100. package/templates/apps/frontend-auth/package.json +8 -8
  101. package/templates/apps/frontend-blank/package.json +7 -7
  102. package/templates/apps/frontend-cms/package.json +9 -9
  103. package/templates/apps/frontend-collab/package.json +10 -10
  104. package/templates/apps/frontend-contact/package.json +7 -7
  105. package/templates/apps/frontend-dashboard/package.json +7 -7
  106. package/templates/apps/frontend-docs/package.json +7 -7
  107. package/templates/apps/frontend-i18n/package.json +6 -6
  108. package/templates/apps/frontend-landing/package.json +7 -7
  109. package/templates/apps/frontend-portal/package.json +8 -8
  110. package/templates/apps/frontend-saas/package.json +8 -8
  111. package/templates/apps/frontend-spa/package.json +7 -7
  112. package/templates/apps/frontend-ssr/package.json +7 -7
  113. package/templates/apps/frontend-ssr-api/package.json +8 -8
  114. package/templates/apps/frontend-static-blog/package.json +6 -6
  115. package/templates/apps/frontend-status/package.json +8 -8
  116. package/templates/apps/mobile-app/package.json +3 -3
  117. package/templates/patches/@effect__cluster@0.60.0.patch +51 -3
  118. package/dist/apiBuild-ZEZnCXn2.js +0 -2
  119. package/dist/baselineCommand-C2ClWZN3.js +0 -2
  120. package/dist/codegen-ChBi_hVa.js +0 -2
  121. package/dist/dbCommand-DS4b97Is.js +0 -2
  122. package/dist/doctorCommand-BYffQc0s.js +0 -2
  123. package/dist/serveCommand-CEBVP36A.js +0 -2
  124. package/dist/startupRunner-DPGFchOa.js +0 -71
  125. package/dist/updateCommand-CSBXVsYq.js +0 -2
  126. package/dist/webDev-BcykISYQ2.js +0 -2
@@ -1,5 +1,29 @@
1
+ diff --git a/dist/cjs/Sharding.js b/dist/cjs/Sharding.js
2
+ index ffd9f07626d9efbf77b8186ce7a8330bf62566eb..4573677ba76c821d7062295c7c606904ab20e2af 100644
3
+ --- a/dist/cjs/Sharding.js
4
+ +++ b/dist/cjs/Sharding.js
5
+ @@ -125,7 +125,18 @@ const make = /*#__PURE__*/Effect.gen(function* () {
6
+ fiber: "releaseShard",
7
+ runner: selfAddress,
8
+ shardId
9
+ - }))), Effect.eventually, FiberMap.run(releaseShardsMap, shardId, {
10
+ + }))), // PATCHED (voltro): was `Effect.eventually` — retry until success with NO
11
+ + // delay. A shard that cannot be released (storage unreachable, DB down)
12
+ + // therefore spun a fiber at full speed, logging at DEBUG level where nobody
13
+ + // reads it. Same semantics — keep trying until it succeeds — with backoff.
14
+ + //
15
+ + // `union` takes the MINIMUM of the two delays, so this CAPS at 5s rather
16
+ + // than compounding: 100ms, 200ms, 400ms … 5s, 5s, 5s. Both schedules recur
17
+ + // forever, and a union continues while either does, so the retry is still
18
+ + // unbounded in ATTEMPTS — which is what shard release needs. The defect was
19
+ + // the missing delay, not the persistence.
20
+ + Effect.retry(Schedule.exponential(100).pipe(Schedule.union(Schedule.spaced(5000)))),
21
+ + FiberMap.run(releaseShardsMap, shardId, {
22
+ onlyIfMissing: true
23
+ })));
24
+ const releaseShards = Effect.gen(function* () {
1
25
  diff --git a/dist/cjs/SqlMessageStorage.js b/dist/cjs/SqlMessageStorage.js
2
- index 77ebad1d2e940b73a494bf9ab0ad7e008daddf82..5e268da7b7923f454b7293eff2ee79326b3cf588 100644
26
+ index 77ebad1d2e940b73a494bf9ab0ad7e008daddf82..9fa66974a5f7977449778304c48cb7b1b1e72ee9 100644
3
27
  --- a/dist/cjs/SqlMessageStorage.js
4
28
  +++ b/dist/cjs/SqlMessageStorage.js
5
29
  @@ -41,7 +41,11 @@ const make = exports.make = /*#__PURE__*/Effect.fnUntraced(function* (options) {
@@ -84,8 +108,32 @@ index 9c6defd9723112761eb49ca1e189fd6cc4187ae7..e82351709c76d206df68a8aa46c4740b
84
108
  ON target.shard_id = source.shard_id
85
109
  WHEN MATCHED AND (target.address = source.address OR DATEDIFF(SECOND, target.acquired_at, ${sqlNow}) > ${expiresSeconds}) THEN
86
110
  UPDATE SET address = source.address, acquired_at = source.acquired_at
111
+ diff --git a/dist/esm/Sharding.js b/dist/esm/Sharding.js
112
+ index c973ed72595ddc9a90229ede2a14a3f571a54af5..0ff7d7347c63ab270520410375ca07709457ace3 100644
113
+ --- a/dist/esm/Sharding.js
114
+ +++ b/dist/esm/Sharding.js
115
+ @@ -117,7 +117,18 @@ const make = /*#__PURE__*/Effect.gen(function* () {
116
+ fiber: "releaseShard",
117
+ runner: selfAddress,
118
+ shardId
119
+ - }))), Effect.eventually, FiberMap.run(releaseShardsMap, shardId, {
120
+ + }))), // PATCHED (voltro): was `Effect.eventually` — retry until success with NO
121
+ + // delay. A shard that cannot be released (storage unreachable, DB down)
122
+ + // therefore spun a fiber at full speed, logging at DEBUG level where nobody
123
+ + // reads it. Same semantics — keep trying until it succeeds — with backoff.
124
+ + //
125
+ + // `union` takes the MINIMUM of the two delays, so this CAPS at 5s rather
126
+ + // than compounding: 100ms, 200ms, 400ms … 5s, 5s, 5s. Both schedules recur
127
+ + // forever, and a union continues while either does, so the retry is still
128
+ + // unbounded in ATTEMPTS — which is what shard release needs. The defect was
129
+ + // the missing delay, not the persistence.
130
+ + Effect.retry(Schedule.exponential(100).pipe(Schedule.union(Schedule.spaced(5000)))),
131
+ + FiberMap.run(releaseShardsMap, shardId, {
132
+ onlyIfMissing: true
133
+ })));
134
+ const releaseShards = Effect.gen(function* () {
87
135
  diff --git a/dist/esm/SqlMessageStorage.js b/dist/esm/SqlMessageStorage.js
88
- index e41d91033992bb890bebb1a16a5ac9e6657a9c41..5ac3181298a020b4e748fc6433ec6f4aba9540b4 100644
136
+ index e41d91033992bb890bebb1a16a5ac9e6657a9c41..2e0c02d7bda6f2040894d4636f5deea94ae15843 100644
89
137
  --- a/dist/esm/SqlMessageStorage.js
90
138
  +++ b/dist/esm/SqlMessageStorage.js
91
139
  @@ -33,7 +33,11 @@ export const make = /*#__PURE__*/Effect.fnUntraced(function* (options) {
@@ -171,7 +219,7 @@ index d4c94fe72c8ff589c0a8f12ff80bac41614a2096..8f6ee6b12f7892916cbd17d18e66d4be
171
219
  WHEN MATCHED AND (target.address = source.address OR DATEDIFF(SECOND, target.acquired_at, ${sqlNow}) > ${expiresSeconds}) THEN
172
220
  UPDATE SET address = source.address, acquired_at = source.acquired_at
173
221
  diff --git a/src/SqlMessageStorage.ts b/src/SqlMessageStorage.ts
174
- index 4326c3832b425548dac135493a4a6cbec0856f63..430474fe47549170592fa32d5b0dcac61f75c39d 100644
222
+ index 4326c3832b425548dac135493a4a6cbec0856f63..4f83bf02f24e8e8021954353ae28b82c987f8483 100644
175
223
  --- a/src/SqlMessageStorage.ts
176
224
  +++ b/src/SqlMessageStorage.ts
177
225
  @@ -52,8 +52,12 @@ export const make = Effect.fnUntraced(function*(options?: {
@@ -1,2 +0,0 @@
1
- import { c as e, l as t } from "./apiBuild-DiE9zcj6.js";
2
- export { e as runApiBuild, t as runServeBundleBuild };
@@ -1,2 +0,0 @@
1
- import { o as e } from "./baselineCommand-DIttzO8A.js";
2
- export { e as runBaselineCommand };
@@ -1,2 +0,0 @@
1
- import { t as e } from "./codegen-CYM3Zqrf.js";
2
- export { e as checkRpcGroupFreshness };
@@ -1,2 +0,0 @@
1
- import { s as e } from "./dbCommand-O8HA63s2.js";
2
- export { e as runDbCommand };
@@ -1,2 +0,0 @@
1
- import { v as e, y as t } from "./doctorCommand-CNFtt3nR.js";
2
- export { e as runDoctorCommand, t as runServePreflight };
@@ -1,2 +0,0 @@
1
- import { n as e } from "./serveCommand-VVGcIMIw.js";
2
- export { e as runServeDispatch };
@@ -1,71 +0,0 @@
1
- import { n as e } from "./appModuleLoader-C9r9mxZt.js";
2
- import { basename as t } from "node:path";
3
- import { publishServerError as n } from "@voltro/protocol";
4
- //#region src/startupRunner.ts
5
- var r = (e) => e.replace(/\.startup\.tsx?$/, ""), i = async (n, i) => {
6
- let a = [];
7
- for (let o of n) {
8
- let n;
9
- try {
10
- n = await e(o);
11
- } catch (e) {
12
- i.warn("startup: failed to import", { file: o }, e);
13
- continue;
14
- }
15
- let s = n.default;
16
- if (typeof s != "function") {
17
- i.warn("startup: no default-export function", { file: o });
18
- continue;
19
- }
20
- a.push({
21
- file: o,
22
- id: r(t(o)),
23
- fn: s
24
- });
25
- }
26
- return a;
27
- }, a = async (e, t, r) => {
28
- let i = [];
29
- for (let a of e) {
30
- let e = r.child(`startup:${a.id}`), o = {
31
- store: t,
32
- log: e,
33
- id: a.id,
34
- onShutdown: (e) => {
35
- i.push({
36
- id: a.id,
37
- cb: e
38
- });
39
- }
40
- };
41
- try {
42
- let t = a.fn(o);
43
- t instanceof Promise && await Promise.race([t.catch((t) => {
44
- e.warn("startup: function rejected", {}, t), n({
45
- error: t,
46
- source: "startup",
47
- name: a.id
48
- });
49
- }), new Promise((e) => setTimeout(e, 2e3))]), e.info("startup: registered");
50
- } catch (t) {
51
- e.warn("startup: synchronous error during boot", {}, t), n({
52
- error: t,
53
- source: "startup",
54
- name: a.id
55
- });
56
- }
57
- }
58
- return { shutdown: async () => {
59
- for (let e = i.length - 1; e >= 0; e--) {
60
- let { id: t, cb: n } = i[e], a = r.child(`startup:${t}`);
61
- try {
62
- let e = n();
63
- e instanceof Promise && await Promise.race([e, new Promise((e) => setTimeout(e, 5e3))]);
64
- } catch (e) {
65
- a.warn("startup: teardown threw", {}, e);
66
- }
67
- }
68
- } };
69
- };
70
- //#endregion
71
- export { a as n, i as t };
@@ -1,2 +0,0 @@
1
- import { f as e, p as t } from "./updateCommand-CwnUK_mf.js";
2
- export { e as runApplyCodemods, t as runUpdateCommand };
@@ -1,2 +0,0 @@
1
- import { _ as e } from "./webDev-Dybxew86.js";
2
- export { e as tryRunWebServe };