@voltro/cli 0.30.1 → 0.31.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 (124) hide show
  1. package/CHANGELOG.md +163 -0
  2. package/dist/apiBuild-BOqL1dlg.js +2 -0
  3. package/dist/{apiBuild-DmkzRyv7.js → apiBuild-CLPt-pX6.js} +2 -2
  4. package/dist/appGraph-CvQCte0z.js +2 -0
  5. package/dist/appGraph-gQ_6GkQQ.js +110 -0
  6. package/dist/bin.js +3 -3
  7. package/dist/checkCommand-ClRvH_SN.js +2 -0
  8. package/dist/{checkCommand-C4konUy9.js → checkCommand-D7r6_pk7.js} +439 -530
  9. package/dist/{commands-BkJft9K2.js → commands-CNVVv03h.js} +1941 -1880
  10. package/dist/{dbCommand-qn__kLEt.js → dbCommand-BH8GAYuf.js} +76 -19
  11. package/dist/dbCommand-BwQ_Jl98.js +2 -0
  12. package/dist/{dev-DXhhZ7-f.js → dev-DOZVMVfi.js} +1 -1
  13. package/dist/{dev-C_NPcLDp.js → dev-DdQEn2Ia.js} +1986 -1967
  14. package/dist/{frameworkTableAssembly-Cpgn2e88.js → frameworkTableAssembly-BwIrO5nv.js} +122 -103
  15. package/dist/frameworkTableAssembly-D-EebUQX.js +2 -0
  16. package/dist/index.js +1 -1
  17. package/dist/{inspectMetrics-CkB2J0Zn.js → inspectMetrics-BeEAnjqw.js} +774 -527
  18. package/dist/{sdkgen-wsWLrq4l.js → sdkgen-v9WV8zRi.js} +1 -1
  19. package/dist/{serveCommand-HtI4X5kj.js → serveCommand-KsKXXWn4.js} +294 -293
  20. package/dist/serveEntry.js +2 -2
  21. package/dist/{start-egkbpugc.js → start-CI2QdKy9.js} +351 -346
  22. package/dist/startEntry.js +2 -2
  23. package/package.json +17 -17
  24. package/templates/AGENTS.md +43 -43
  25. package/templates/agent-docs/_index.md +43 -43
  26. package/templates/agent-docs/_manifest.json +84 -42
  27. package/templates/agent-docs/cli.md +4 -2
  28. package/templates/agent-docs/database/migrations.md +14 -1
  29. package/templates/agent-docs/internationalization.md +54 -3
  30. package/templates/agent-docs/plugins/ai-flows.md +148 -0
  31. package/templates/agent-docs/plugins/analytics-postgres.md +90 -0
  32. package/templates/agent-docs/plugins/atlassian.md +378 -0
  33. package/templates/agent-docs/plugins/audit.md +324 -0
  34. package/templates/agent-docs/plugins/auth-auth0.md +92 -0
  35. package/templates/agent-docs/plugins/auth-clerk.md +90 -0
  36. package/templates/agent-docs/plugins/auth-kinde.md +88 -0
  37. package/templates/agent-docs/plugins/auth-oidc.md +95 -0
  38. package/templates/agent-docs/plugins/auth-supabase.md +103 -0
  39. package/templates/agent-docs/plugins/auth-workos.md +105 -0
  40. package/templates/agent-docs/plugins/auth.md +227 -0
  41. package/templates/agent-docs/plugins/billing.md +324 -0
  42. package/templates/agent-docs/plugins/broadcast.md +144 -0
  43. package/templates/agent-docs/plugins/cdc-out.md +116 -0
  44. package/templates/agent-docs/plugins/clickhouse.md +91 -0
  45. package/templates/agent-docs/plugins/datadog.md +105 -0
  46. package/templates/agent-docs/plugins/deactivation.md +114 -0
  47. package/templates/agent-docs/plugins/duckdb.md +82 -0
  48. package/templates/agent-docs/plugins/flags.md +146 -0
  49. package/templates/agent-docs/plugins/governance.md +143 -0
  50. package/templates/agent-docs/plugins/licensing.md +74 -0
  51. package/templates/agent-docs/plugins/logship.md +56 -0
  52. package/templates/agent-docs/plugins/mail.md +334 -0
  53. package/templates/agent-docs/plugins/moderation.md +65 -0
  54. package/templates/agent-docs/plugins/multitenancy.md +99 -0
  55. package/templates/agent-docs/plugins/notifications.md +252 -0
  56. package/templates/agent-docs/plugins/openapi.md +94 -0
  57. package/templates/agent-docs/plugins/postgis.md +140 -0
  58. package/templates/agent-docs/plugins/posthog.md +91 -0
  59. package/templates/agent-docs/plugins/presence.md +115 -0
  60. package/templates/agent-docs/plugins/prometheus.md +124 -0
  61. package/templates/agent-docs/plugins/ratelimit.md +274 -0
  62. package/templates/agent-docs/plugins/rbac.md +270 -0
  63. package/templates/agent-docs/plugins/scim.md +63 -0
  64. package/templates/agent-docs/plugins/search.md +116 -0
  65. package/templates/agent-docs/plugins/sentry.md +192 -0
  66. package/templates/agent-docs/plugins/soft-delete.md +72 -0
  67. package/templates/agent-docs/plugins/sso-saml.md +132 -0
  68. package/templates/agent-docs/plugins/storage.md +709 -0
  69. package/templates/agent-docs/plugins/tinybird.md +92 -0
  70. package/templates/agent-docs/plugins/versioning.md +226 -0
  71. package/templates/agent-docs/plugins/webhooks.md +585 -0
  72. package/templates/agent-docs/security.md +12 -1
  73. package/templates/agent-docs/whats-new.md +81 -37
  74. package/templates/apps/api-ai/package.json +7 -7
  75. package/templates/apps/api-auth/package.json +8 -8
  76. package/templates/apps/api-backend/package.json +7 -7
  77. package/templates/apps/api-backend-deactivation/package.json +7 -7
  78. package/templates/apps/api-backend-mail/package.json +8 -8
  79. package/templates/apps/api-backend-mariadb/package.json +9 -9
  80. package/templates/apps/api-backend-sqlite/package.json +8 -8
  81. package/templates/apps/api-backend-storage/package.json +8 -8
  82. package/templates/apps/api-cms/package.json +10 -10
  83. package/templates/apps/api-collab/package.json +8 -8
  84. package/templates/apps/api-data-advanced/package.json +8 -8
  85. package/templates/apps/api-durable/package.json +8 -8
  86. package/templates/apps/api-feature-flags/package.json +9 -9
  87. package/templates/apps/api-governance/package.json +8 -8
  88. package/templates/apps/api-kv/package.json +8 -8
  89. package/templates/apps/api-moderation/package.json +8 -8
  90. package/templates/apps/api-observability/package.json +8 -8
  91. package/templates/apps/api-ratelimit/package.json +8 -8
  92. package/templates/apps/api-rbac/package.json +8 -8
  93. package/templates/apps/api-rest/package.json +7 -7
  94. package/templates/apps/api-saas/package.json +11 -11
  95. package/templates/apps/api-saas-starter/package.json +10 -10
  96. package/templates/apps/api-search/package.json +8 -8
  97. package/templates/apps/api-status/package.json +8 -8
  98. package/templates/apps/api-versioning/package.json +8 -8
  99. package/templates/apps/api-webhooks/package.json +9 -9
  100. package/templates/apps/changelog/package.json +6 -6
  101. package/templates/apps/edge-functions/package.json +2 -2
  102. package/templates/apps/frontend-admin/package.json +8 -8
  103. package/templates/apps/frontend-app/package.json +8 -8
  104. package/templates/apps/frontend-auth/package.json +8 -8
  105. package/templates/apps/frontend-blank/package.json +7 -7
  106. package/templates/apps/frontend-cms/package.json +9 -9
  107. package/templates/apps/frontend-collab/package.json +9 -9
  108. package/templates/apps/frontend-contact/package.json +7 -7
  109. package/templates/apps/frontend-dashboard/package.json +7 -7
  110. package/templates/apps/frontend-docs/package.json +7 -7
  111. package/templates/apps/frontend-i18n/package.json +6 -6
  112. package/templates/apps/frontend-landing/package.json +7 -7
  113. package/templates/apps/frontend-portal/package.json +8 -8
  114. package/templates/apps/frontend-saas/package.json +8 -8
  115. package/templates/apps/frontend-spa/package.json +7 -7
  116. package/templates/apps/frontend-ssr/package.json +7 -7
  117. package/templates/apps/frontend-ssr-api/package.json +8 -8
  118. package/templates/apps/frontend-static-blog/package.json +6 -6
  119. package/templates/apps/frontend-status/package.json +8 -8
  120. package/templates/apps/mobile-app/package.json +2 -2
  121. package/dist/apiBuild-Ca6Sq5jy.js +0 -2
  122. package/dist/checkCommand-DHD0aBeR.js +0 -2
  123. package/dist/dbCommand-wfGi3FgG.js +0 -2
  124. package/dist/frameworkTableAssembly-Bn_c4Mnl.js +0 -2
@@ -3,17 +3,17 @@ import { D as t, a as n, j as r, k as i } from "./fileConventions-Cof68_BL.js";
3
3
  import { basename as a, join as o } from "node:path";
4
4
  import { pathToFileURL as s } from "node:url";
5
5
  import { Effect as c } from "effect";
6
- import { promises as l } from "node:fs";
7
- import { _voltroConnectionGrantsTable as u, _voltroConnectionsTable as d, _voltroScheduleClaimsTable as f, _voltroScheduleRunsTable as p, _voltroTracesTable as ee, _voltroUndoLogTable as te, _voltroWakeupsTable as ne, _voltroWorkflowEventDeliveriesTable as re, _voltroWorkflowEventsTable as ie, outboxAttemptsTable as ae, outboxTable as oe, undoCaptureEnabled as se } from "@voltro/runtime";
6
+ import { existsSync as l, promises as u } from "node:fs";
7
+ import { _voltroConnectionGrantsTable as d, _voltroConnectionsTable as f, _voltroScheduleClaimsTable as p, _voltroScheduleRunsTable as ee, _voltroTracesTable as te, _voltroUndoLogTable as ne, _voltroWakeupsTable as re, _voltroWorkflowEventDeliveriesTable as ie, _voltroWorkflowEventsTable as ae, outboxAttemptsTable as oe, outboxTable as se, undoCaptureEnabled as ce } from "@voltro/runtime";
8
8
  import { SqlClient as m } from "@effect/sql";
9
- import { _voltroWorkflowAdmissionsTable as ce, _voltroWorkflowPausesTable as le, _voltroWorkflowPendingTable as ue, _voltroWorkflowRunEventsTable as de, _voltroWorkflowRunStepsTable as fe, _voltroWorkflowRunsTable as pe, _voltroWorkflowStartContextsTable as me, _voltroWorkflowWatermarksTable as he } from "@voltro/workflow";
10
- import { agentMessagesTable as ge, agentThreadsTable as h, aiBudgetTable as g, aiInferencesTable as _, aiUsageTable as v, isAgentDescriptor as y, isAgentExecutor as b, resolveToolModuleHandlers as x } from "@voltro/ai";
9
+ import { _voltroWorkflowAdmissionsTable as le, _voltroWorkflowPausesTable as ue, _voltroWorkflowPendingTable as de, _voltroWorkflowRunEventsTable as fe, _voltroWorkflowRunStepsTable as pe, _voltroWorkflowRunsTable as me, _voltroWorkflowStartContextsTable as he, _voltroWorkflowWatermarksTable as ge } from "@voltro/workflow";
10
+ import { agentMessagesTable as _e, agentThreadsTable as h, aiBudgetTable as g, aiInferencesTable as _, aiUsageTable as v, isAgentDescriptor as y, isAgentExecutor as b, resolveToolModuleHandlers as x } from "@voltro/ai";
11
11
  import { _voltroApiKeysTable as S, _voltroCdcOffsetsTable as C, _voltroIdempotencyTable as w, _voltroKvTable as T, _voltroMigrationPlansTable as E, _voltroMigrationsTable as D, _voltroMssqlCdcOffsetsTable as O, _voltroSeedsTable as k, lt as A } from "@voltro/database";
12
12
  import { _voltroWebhookDeliveriesTable as j, _voltroWebhookTargetsTable as M } from "@voltro/plugin-webhooks/mixin";
13
13
  import { _voltroStorageBlobsTable as N, _voltroStorageGrantsTable as P, _voltroStorageRefsTable as F, _voltroStorageUsageTable as I } from "@voltro/plugin-storage";
14
- import { defineAction as L, defineMutation as _e, defineQuery as ve } from "@voltro/protocol";
14
+ import { defineAction as ve, defineMutation as ye, defineQuery as be } from "@voltro/protocol";
15
15
  //#region src/frameworkTables.ts
16
- var ye = [
16
+ var xe = [
17
17
  {
18
18
  table: D,
19
19
  when: "always"
@@ -27,51 +27,51 @@ var ye = [
27
27
  when: "always"
28
28
  },
29
29
  {
30
- table: pe,
30
+ table: me,
31
31
  when: "workflows"
32
32
  },
33
33
  {
34
- table: fe,
34
+ table: pe,
35
35
  when: "workflows"
36
36
  },
37
37
  {
38
- table: de,
38
+ table: fe,
39
39
  when: "workflows"
40
40
  },
41
41
  {
42
- table: me,
42
+ table: he,
43
43
  when: "workflows"
44
44
  },
45
45
  {
46
- table: ue,
46
+ table: de,
47
47
  when: "workflows"
48
48
  },
49
49
  {
50
- table: ce,
50
+ table: le,
51
51
  when: "workflows"
52
52
  },
53
53
  {
54
- table: le,
54
+ table: ue,
55
55
  when: "workflows"
56
56
  },
57
57
  {
58
- table: he,
58
+ table: ge,
59
59
  when: "workflows"
60
60
  },
61
61
  {
62
- table: ie,
62
+ table: ae,
63
63
  when: "workflows"
64
64
  },
65
65
  {
66
- table: re,
66
+ table: ie,
67
67
  when: "workflows"
68
68
  },
69
69
  {
70
- table: p,
70
+ table: ee,
71
71
  when: "schedules"
72
72
  },
73
73
  {
74
- table: f,
74
+ table: p,
75
75
  when: "schedules"
76
76
  },
77
77
  {
@@ -83,31 +83,31 @@ var ye = [
83
83
  when: "webhooks"
84
84
  },
85
85
  {
86
- table: ee,
86
+ table: te,
87
87
  when: "traces"
88
88
  },
89
89
  {
90
- table: te,
90
+ table: ne,
91
91
  when: "undo"
92
92
  },
93
93
  {
94
- table: oe,
94
+ table: se,
95
95
  when: "always"
96
96
  },
97
97
  {
98
- table: ae,
98
+ table: oe,
99
99
  when: "always"
100
100
  },
101
101
  {
102
- table: d,
102
+ table: f,
103
103
  when: "connections"
104
104
  },
105
105
  {
106
- table: u,
106
+ table: d,
107
107
  when: "connections"
108
108
  },
109
109
  {
110
- table: ne,
110
+ table: re,
111
111
  when: "always"
112
112
  },
113
113
  {
@@ -138,54 +138,54 @@ var ye = [
138
138
  table: T,
139
139
  when: "always"
140
140
  }
141
- ], R = (e) => {
142
- let t = ye.filter((t) => t.when === "always" || t.when === "workflows" && e.workflows || t.when === "schedules" && e.schedules || t.when === "webhooks" && e.webhooks || t.when === "traces" && e.traces || t.when === "undo" && e.undo === !0 || t.when === "connections" && e.connections === !0).map((e) => e.table);
141
+ ], L = (e) => {
142
+ let t = xe.filter((t) => t.when === "always" || t.when === "workflows" && e.workflows || t.when === "schedules" && e.schedules || t.when === "webhooks" && e.webhooks || t.when === "traces" && e.traces || t.when === "undo" && e.undo === !0 || t.when === "connections" && e.connections === !0).map((e) => e.table);
143
143
  return e.cdc === !0 && t.push(e.cdcDialect === "mssql" ? O : C), t;
144
- }, z = (e) => {
144
+ }, R = (e) => {
145
145
  let t = e.startsWith("@") ? e.replace(/^@[^/]+\//, "") : e;
146
146
  return (t.startsWith("plugin-") ? t.slice(7) : t).replace(/-([a-zA-Z0-9])/g, (e, t) => t.toUpperCase());
147
- }, be = (e) => {
147
+ }, Se = (e) => {
148
148
  let t = e.startsWith("@") ? e.replace(/^@[^/]+\//, "") : e;
149
149
  return (t.startsWith("plugin-") ? t.slice(7) : t).replace(/#/g, "--").replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
150
- }, xe = (e, t) => t.name.includes(".") ? t.name : `${z(e.name)}.${t.name}`, Se = (e, t, n) => {
150
+ }, Ce = (e, t) => t.name.includes(".") ? t.name : `${R(e.name)}.${t.name}`, we = (e, t, n) => {
151
151
  switch (e) {
152
- case "query": return ve({
152
+ case "query": return be({
153
153
  name: t,
154
154
  input: n.input,
155
155
  output: n.output,
156
156
  ...n.error === void 0 ? {} : { error: n.error },
157
157
  ...n.source === void 0 ? {} : { source: n.source }
158
158
  });
159
- case "mutation": return _e({
159
+ case "mutation": return ye({
160
160
  name: t,
161
161
  input: n.input,
162
162
  output: n.output,
163
163
  ...n.error === void 0 ? {} : { error: n.error }
164
164
  });
165
- case "action": return L({
165
+ case "action": return ve({
166
166
  name: t,
167
167
  input: n.input,
168
168
  output: n.output,
169
169
  ...n.error === void 0 ? {} : { error: n.error }
170
170
  });
171
171
  }
172
- }, Ce = (e) => (t, n) => c.suspend(() => {
172
+ }, Te = (e) => (t, n) => c.suspend(() => {
173
173
  let r = { request: {
174
174
  subject: n.request.subject,
175
175
  traceId: n.request.traceId
176
176
  } };
177
177
  return e.execute(t, r);
178
- }), we = (e) => {
178
+ }), Ee = (e) => {
179
179
  let t = [];
180
180
  for (let n of e) {
181
181
  let e = n.routes ?? [];
182
182
  for (let r of e) {
183
- let e = xe(n, r), i = Se(r.kind, e, r);
183
+ let e = Ce(n, r), i = we(r.kind, e, r);
184
184
  t.push({
185
185
  kind: r.kind,
186
186
  file: `plugin:${n.name}`,
187
187
  descriptor: i,
188
- executor: Ce(r),
188
+ executor: Te(r),
189
189
  plugin: {
190
190
  name: n.name,
191
191
  version: n.version
@@ -194,7 +194,7 @@ var ye = [
194
194
  }
195
195
  }
196
196
  return t;
197
- }, Te = (e, t, n = /* @__PURE__ */ new Set()) => {
197
+ }, De = (e, t, n = /* @__PURE__ */ new Set()) => {
198
198
  let r = /* @__PURE__ */ new Map();
199
199
  for (let e of t) r.set(e, "user-route");
200
200
  let i = [];
@@ -206,9 +206,9 @@ var ye = [
206
206
  }
207
207
  }
208
208
  return i;
209
- }, B = "_voltro_plugin_migrations", Ee = () => c.gen(function* () {
209
+ }, z = "_voltro_plugin_migrations", B = () => c.gen(function* () {
210
210
  yield* (yield* m.SqlClient).unsafe(`
211
- CREATE TABLE IF NOT EXISTS ${B} (
211
+ CREATE TABLE IF NOT EXISTS ${z} (
212
212
  id TEXT PRIMARY KEY,
213
213
  plugin_name TEXT NOT NULL,
214
214
  migration_id TEXT NOT NULL,
@@ -216,25 +216,25 @@ var ye = [
216
216
  applied_at TEXT NOT NULL
217
217
  );
218
218
  `).pipe(c.orDie);
219
- }), De = (e, t) => `${z(e)}__${t}`, Oe = () => c.gen(function* () {
220
- let e = yield* m.SqlClient, t = yield* e`SELECT id FROM ${e(B)}`.pipe(c.orDie);
219
+ }), Oe = (e, t) => `${R(e)}__${t}`, ke = () => c.gen(function* () {
220
+ let e = yield* m.SqlClient, t = yield* e`SELECT id FROM ${e(z)}`.pipe(c.orDie);
221
221
  return new Set(t.map((e) => e.id));
222
- }), ke = (e) => c.gen(function* () {
222
+ }), Ae = (e) => c.gen(function* () {
223
223
  let t = yield* m.SqlClient, n = (/* @__PURE__ */ new Date()).toISOString();
224
224
  yield* t`
225
- INSERT INTO ${t(B)} (id, plugin_name, migration_id, description, applied_at)
225
+ INSERT INTO ${t(z)} (id, plugin_name, migration_id, description, applied_at)
226
226
  VALUES (${e.key}, ${e.pluginName}, ${e.migration.id}, ${e.migration.description ?? null}, ${n})
227
227
  `.pipe(c.orDie);
228
- }), Ae = (e) => c.gen(function* () {
228
+ }), je = (e) => c.gen(function* () {
229
229
  let t = e.flatMap((e) => (e.extendSchema?.migrations ?? []).map((t) => ({
230
230
  plugin: e,
231
231
  migration: t
232
232
  })));
233
233
  if (t.length === 0) return [];
234
- yield* Ee();
235
- let n = yield* Oe(), r = [];
234
+ yield* B();
235
+ let n = yield* ke(), r = [];
236
236
  for (let { plugin: e, migration: i } of t) {
237
- let t = De(e.name, i.id), a = Date.now();
237
+ let t = Oe(e.name, i.id), a = Date.now();
238
238
  if (n.has(t)) {
239
239
  r.push({
240
240
  pluginName: e.name,
@@ -246,7 +246,7 @@ var ye = [
246
246
  }
247
247
  let o = yield* m.SqlClient;
248
248
  try {
249
- yield* i.up(o).pipe(c.mapError((e) => e)), yield* ke({
249
+ yield* i.up(o).pipe(c.mapError((e) => e)), yield* Ae({
250
250
  key: t,
251
251
  pluginName: e.name,
252
252
  migration: i
@@ -267,12 +267,12 @@ var ye = [
267
267
  }
268
268
  }
269
269
  return r;
270
- }), je = (e) => e.filter((e) => e.extendSchema && (e.extendSchema.tables?.length ?? 0) + (e.extendSchema.migrations?.length ?? 0) > 0).map((e) => ({
270
+ }), Me = (e) => e.filter((e) => e.extendSchema && (e.extendSchema.tables?.length ?? 0) + (e.extendSchema.migrations?.length ?? 0) > 0).map((e) => ({
271
271
  pluginName: e.name,
272
- pluginAlias: z(e.name),
272
+ pluginAlias: R(e.name),
273
273
  tables: e.extendSchema.tables?.length ?? 0,
274
274
  migrations: e.extendSchema.migrations?.length ?? 0
275
- })), Me = (e) => e.flatMap((e) => e.extendSchema?.tables ?? []), V = /(?<!\.server)\.agent\.tsx?$/, Ne = /\.agent\.server\.tsx?$/, H = /\.tool\.tsx?$/, Pe = async (t, n) => {
275
+ })), Ne = (e) => e.flatMap((e) => e.extendSchema?.tables ?? []), V = /(?<!\.server)\.agent\.tsx?$/, Pe = /\.agent\.server\.tsx?$/, H = /\.tool\.tsx?$/, Fe = async (t, n) => {
276
276
  let r = 0;
277
277
  for (let i of t) if (H.test(i)) try {
278
278
  let t = await e(i);
@@ -281,7 +281,7 @@ var ye = [
281
281
  n.warn("tool: failed to import — handler not wired", { file: i }, e);
282
282
  }
283
283
  return r;
284
- }, Fe = (e) => e.replace(/\.agent\.(tsx?)$/, ".agent.server.$1"), Ie = async (t, n) => {
284
+ }, Ie = (e) => e.replace(/\.agent\.(tsx?)$/, ".agent.server.$1"), Le = async (t, n) => {
285
285
  let r = [], i = /* @__PURE__ */ new Set();
286
286
  for (let a of t) {
287
287
  if (!V.test(a)) continue;
@@ -304,7 +304,7 @@ var ye = [
304
304
  });
305
305
  continue;
306
306
  }
307
- let s = Fe(a), c;
307
+ let s = Ie(a), c;
308
308
  try {
309
309
  c = await e(s);
310
310
  } catch (e) {
@@ -331,7 +331,7 @@ var ye = [
331
331
  });
332
332
  }
333
333
  return { agents: r };
334
- }, U = /\.connection\.tsx?$/, Le = (e) => e.replace(U, ""), Re = async (t, n) => {
334
+ }, U = /\.connection\.tsx?$/, Re = (e) => e.replace(U, ""), ze = async (t, n) => {
335
335
  let r = [], i = /* @__PURE__ */ new Map();
336
336
  for (let a of t) {
337
337
  let t;
@@ -374,7 +374,7 @@ var ye = [
374
374
  }
375
375
  return r.length > 0 && n.info("discovered connections", {
376
376
  connections: r.map((e) => `${e.definition.id} (${e.definition.kind})`),
377
- files: r.map((e) => Le(a(e.file)))
377
+ files: r.map((e) => Re(a(e.file)))
378
378
  }), r;
379
379
  }, W = (e) => typeof e.attributes["framework.kind"] == "string" && e.attributes["framework.kind"].startsWith("subscription."), G = (e) => {
380
380
  if (e.name.includes("_voltro_traces")) return !0;
@@ -383,17 +383,17 @@ var ye = [
383
383
  if (typeof n == "string" && n.includes("_voltro_traces")) return !0;
384
384
  }
385
385
  return !1;
386
- }, ze = (e) => typeof e.attributes["framework.kind"] == "string" && e.attributes["framework.kind"].startsWith("subscription"), Be = 1e3, Ve = 500, He = 50, K = class {
386
+ }, Be = (e) => typeof e.attributes["framework.kind"] == "string" && e.attributes["framework.kind"].startsWith("subscription"), Ve = 1e3, He = 500, Ue = 50, K = class {
387
387
  capacity;
388
388
  buffer = [];
389
- constructor(e = Be) {
389
+ constructor(e = Ve) {
390
390
  this.capacity = e;
391
391
  }
392
392
  append(e) {
393
393
  this.buffer.push(e), this.buffer.length > this.capacity && this.buffer.shift();
394
394
  }
395
395
  query(e = {}) {
396
- let t = e.since ?? 0, n = e.until ?? Date.now(), r = Math.min(e.max ?? Ve, this.capacity), i = e.traceId, a = e.minDurationMs, o = e.status, s = e.name?.toLowerCase(), c = [];
396
+ let t = e.since ?? 0, n = e.until ?? Date.now(), r = Math.min(e.max ?? He, this.capacity), i = e.traceId, a = e.minDurationMs, o = e.status, s = e.name?.toLowerCase(), c = [];
397
397
  for (let e = this.buffer.length - 1; e >= 0 && c.length < r; e--) {
398
398
  let r = this.buffer[e];
399
399
  r.startMs < t || r.startMs > n || i !== void 0 && r.traceId !== i || a !== void 0 && r.durationMs < a || o !== void 0 && r.status !== o || s !== void 0 && !r.name.toLowerCase().includes(s) || c.push(r);
@@ -401,7 +401,7 @@ var ye = [
401
401
  return c.reverse();
402
402
  }
403
403
  queryGrouped(e = {}) {
404
- let t = e.since ?? 0, n = e.maxTraces ?? He, r = e.onlyErrors ?? !1, i = /* @__PURE__ */ new Map();
404
+ let t = e.since ?? 0, n = e.maxTraces ?? Ue, r = e.onlyErrors ?? !1, i = /* @__PURE__ */ new Map();
405
405
  for (let e of this.buffer) {
406
406
  if (e.startMs < t) continue;
407
407
  let n = i.get(e.traceId);
@@ -412,7 +412,7 @@ var ye = [
412
412
  t.sort((e, t) => e.startMs - t.startMs);
413
413
  let n = t.some((e) => e.status === "error");
414
414
  if (r && !n) continue;
415
- let i = t[0].startMs, o = t.reduce((e, t) => t.endMs > e ? t.endMs : e, i), s = t.filter(W), c = s.length > 0 || t.some(ze), l = s.reduce((e, t) => e === void 0 || t.startMs > e.startMs ? t : e, void 0);
415
+ let i = t[0].startMs, o = t.reduce((e, t) => t.endMs > e ? t.endMs : e, i), s = t.filter(W), c = s.length > 0 || t.some(Be), l = s.reduce((e, t) => e === void 0 || t.startMs > e.startMs ? t : e, void 0);
416
416
  a.push({
417
417
  traceId: e,
418
418
  rootName: t[0].name,
@@ -437,7 +437,7 @@ var ye = [
437
437
  clear() {
438
438
  this.buffer = [];
439
439
  }
440
- }, q = null, Ue = () => (q === null && (q = new K()), q), We = /* @__PURE__ */ new Set([
440
+ }, q = null, We = () => (q === null && (q = new K()), q), Ge = /* @__PURE__ */ new Set([
441
441
  "off",
442
442
  "errors",
443
443
  "interesting",
@@ -445,61 +445,61 @@ var ye = [
445
445
  ]), J = (e, t, n, r) => {
446
446
  let i = Number(e);
447
447
  return Number.isFinite(i) ? Math.min(r, Math.max(n, i)) : t;
448
- }, Ge = (e) => e !== void 0 && [
448
+ }, Ke = (e) => e !== void 0 && [
449
449
  "1",
450
450
  "true",
451
451
  "yes",
452
452
  "on"
453
- ].includes(e.toLowerCase()), Y = (e) => {
453
+ ].includes(e.toLowerCase()), qe = (e) => {
454
454
  let t = Number(e);
455
455
  return Number.isFinite(t) && t > 0 ? t : 24;
456
- }, X = (e = process.env) => {
456
+ }, Y = (e = process.env) => {
457
457
  let t = (e.VOLTRO_TRACING_BUFFER ?? "").toLowerCase() === "off", n = J(e.VOLTRO_TRACING_SAMPLE, 1, 0, 1), r = (e.VOLTRO_TRACING_PERSIST ?? "").toLowerCase(), i = e.NODE_ENV === "production" ? "off" : "interesting";
458
458
  return {
459
- mode: We.has(r) ? r : n <= 0 ? "off" : i,
459
+ mode: Ge.has(r) ? r : n <= 0 ? "off" : i,
460
460
  sampleRate: n,
461
461
  slowMs: J(e.VOLTRO_TRACING_SLOW_MS, 500, 0, 2 ** 53 - 1),
462
- ttlHours: Y(e.VOLTRO_TRACING_TTL_HOURS),
463
- persistDelivery: Ge(e.VOLTRO_TRACING_PERSIST_DELIVERY),
462
+ ttlHours: qe(e.VOLTRO_TRACING_TTL_HOURS),
463
+ persistDelivery: Ke(e.VOLTRO_TRACING_PERSIST_DELIVERY),
464
464
  bufferDisabled: t
465
465
  };
466
- }, Z = (e = process.env) => {
467
- let t = X(e);
466
+ }, X = (e = process.env) => {
467
+ let t = Y(e);
468
468
  return !t.bufferDisabled && t.mode !== "off";
469
- }, Ke = (e, t) => {
469
+ }, Je = (e, t) => {
470
470
  if (t >= 1) return !0;
471
471
  if (t <= 0) return !1;
472
472
  let n = 2166136261;
473
473
  for (let t = 0; t < e.length; t++) n ^= e.charCodeAt(t), n = Math.imul(n, 16777619);
474
474
  return (n >>> 0) % 1e3 < t * 1e3;
475
- }, qe = (e, t) => {
475
+ }, Ye = (e, t) => {
476
476
  if (t.mode === "off" || G(e) || W(e) && !t.persistDelivery) return !1;
477
477
  let n = e.status === "error";
478
478
  if (t.mode === "errors") return n;
479
479
  if (n) return !0;
480
- if (!Ke(e.traceId, t.sampleRate)) return !1;
480
+ if (!Je(e.traceId, t.sampleRate)) return !1;
481
481
  if (t.mode === "all") return !0;
482
482
  let r = e.parentSpanId === null || e.parentSpanId === void 0 || e.parentSpanId === "", i = typeof e.durationMs == "number" && e.durationMs >= t.slowMs;
483
483
  return r || i;
484
- }, Je = (e) => {
484
+ }, Xe = (e) => {
485
485
  if (e.bufferDisabled) return "durable traces: OFF (VOLTRO_TRACING_BUFFER=off)";
486
486
  if (e.mode === "off") return "durable traces: OFF — _voltro_traces not created (prod default; set VOLTRO_TRACING_PERSIST=interesting to enable, or use OTLP)";
487
487
  let t = e.mode === "interesting" ? ` (errors + slow≥${e.slowMs}ms + roots)` : e.mode === "errors" ? " (errors only)" : "";
488
488
  return `durable traces: mode=${e.mode}${t}` + (e.sampleRate < 1 ? ` · sample=${e.sampleRate}` : "") + (e.persistDelivery ? " · +delivery" : "") + ` · ttl=${e.ttlHours}h`;
489
- }, Ye = (e = 30 * 6e4) => {
489
+ }, Ze = (e = 30 * 6e4) => {
490
490
  let t = /* @__PURE__ */ new Map();
491
491
  return (n, r) => {
492
492
  let i = t.get(n);
493
493
  return i !== void 0 && r - i < e ? !1 : (t.set(n, r), !0);
494
494
  };
495
- }, Xe = (e) => {
496
- let { store: t, log: n } = e, r = e.policy ?? X();
497
- n.info(Je(r));
498
- let i = Ye(), a = [], o = () => {};
495
+ }, Qe = (e) => {
496
+ let { store: t, log: n } = e, r = e.policy ?? Y();
497
+ n.info(Xe(r));
498
+ let i = Ze(), a = [], o = () => {};
499
499
  if (r.mode !== "off") {
500
500
  let e = [], s = 0;
501
501
  o = (t) => {
502
- qe(t, r) && (e.length >= 5e3 && (e.shift(), s += 1, i("flush-drop", Date.now()) && (n.warn(`trace flush queue saturated — dropping durable spans (${s}+ since last warning). Durable inflow exceeds write throughput; reduce it with VOLTRO_TRACING_PERSIST=errors|interesting or VOLTRO_TRACING_SAMPLE<1.`), s = 0)), e.push(t));
502
+ Ye(t, r) && (e.length >= 5e3 && (e.shift(), s += 1, i("flush-drop", Date.now()) && (n.warn(`trace flush queue saturated — dropping durable spans (${s}+ since last warning). Durable inflow exceeds write throughput; reduce it with VOLTRO_TRACING_PERSIST=errors|interesting or VOLTRO_TRACING_SAMPLE<1.`), s = 0)), e.push(t));
503
503
  };
504
504
  let c = async () => {
505
505
  if (e.length === 0) return;
@@ -565,55 +565,74 @@ var ye = [
565
565
  for (let e of a) clearInterval(e);
566
566
  }
567
567
  };
568
- }, Q = async (e) => {
569
- let a = !1, s = !1, c = !1, u = !1, d = !1, f = async (e) => {
570
- let p = await l.readdir(e, { withFileTypes: !0 }).catch(() => []);
571
- for (let l of p) if (l.isDirectory()) {
572
- if (l.name === "node_modules" || l.name === "dist" || l.name === ".framework" || l.name.startsWith(".")) continue;
573
- await f(o(e, l.name));
568
+ }, Z = async (e) => {
569
+ let a = !1, s = !1, c = !1, l = !1, d = !1, f = async (e) => {
570
+ let p = await u.readdir(e, { withFileTypes: !0 }).catch(() => []);
571
+ for (let u of p) if (u.isDirectory()) {
572
+ if (u.name === "node_modules" || u.name === "dist" || u.name === ".framework" || u.name.startsWith(".")) continue;
573
+ await f(o(e, u.name));
574
574
  } else {
575
- let e = l.name;
576
- (r.test(e) || t.test(e)) && (a = !0), n.test(e) && (s = !0), i.test(e) && (c = !0), V.test(e) && (u = !0), U.test(e) && (d = !0);
575
+ let e = u.name;
576
+ (r.test(e) || t.test(e)) && (a = !0), n.test(e) && (s = !0), i.test(e) && (c = !0), V.test(e) && (l = !0), U.test(e) && (d = !0);
577
577
  }
578
578
  };
579
579
  return await f(e), {
580
580
  workflows: a,
581
581
  schedules: s,
582
582
  webhooks: c,
583
- agents: u,
583
+ agents: l,
584
584
  connections: d
585
585
  };
586
- }, Ze = async (e) => {
586
+ }, $e = async (e) => {
587
+ let t = o(e, "app.config.ts");
588
+ if (!l(t)) return { plugins: [] };
587
589
  try {
588
- return (await import(s(o(e, "app.config.ts")).href)).default?.plugins ?? [];
589
- } catch {
590
- return [];
590
+ return { plugins: (await import(s(t).href)).default?.plugins ?? [] };
591
+ } catch (e) {
592
+ return {
593
+ plugins: [],
594
+ error: e
595
+ };
596
+ }
597
+ }, Q = class extends Error {
598
+ root;
599
+ cause;
600
+ constructor(e, t) {
601
+ super(`app.config.ts could not be imported, so this app's plugin list is EMPTY and every plugin table is missing from the schema.
602
+
603
+ This is refused rather than continued: a plan computed without them does not merely omit them, it proposes DROPPING them, and the failure surfaces later as a pluginRef error naming an unrelated plugin.
604
+
605
+ The import ran at config-evaluation time — anything your config imports, directly or transitively, that does work when the module is first evaluated will reach here.
606
+
607
+ Cause: ${t instanceof Error ? t.message : String(t)}`), this.root = e, this.cause = t, this.name = "AppConfigLoadError";
591
608
  }
592
609
  }, $ = (e) => {
593
610
  let t = /* @__PURE__ */ new Map(), n = (e) => {
594
611
  e?.tableName && !t.has(e.tableName) && t.set(e.tableName, e);
595
612
  };
596
- for (let t of R({
613
+ for (let t of L({
597
614
  workflows: e.mix.workflows,
598
615
  schedules: e.mix.schedules,
599
616
  webhooks: e.mix.webhooks,
600
- traces: Z(),
617
+ traces: X(),
601
618
  cdc: e.cdc,
602
619
  ...e.cdcDialect ? { cdcDialect: e.cdcDialect } : {},
603
- undo: se(),
620
+ undo: ce(),
604
621
  connections: e.mix.connections
605
622
  })) n(t);
606
- e.mix.agents && (n(h), n(ge), n(v), n(g)), e.mix.workflows && n(_);
607
- for (let t of Me(e.plugins)) n(t);
623
+ e.mix.agents && (n(h), n(_e), n(v), n(g)), e.mix.workflows && n(_);
624
+ for (let t of Ne(e.plugins)) n(t);
608
625
  return [...t.values()];
609
- }, Qe = async (e) => {
610
- let t = await Q(e.root), n = await Ze(e.root), r = (process.env.DB_DIALECT ?? "postgres").toLowerCase(), i = r === "mariadb" ? "mariadb" : r === "mssql" ? "mssql" : void 0;
626
+ }, et = async (e) => {
627
+ let t = await Z(e.root), { plugins: n, error: r } = await $e(e.root);
628
+ if (r !== void 0) throw new Q(e.root, r);
629
+ let i = (process.env.DB_DIALECT ?? "postgres").toLowerCase(), a = i === "mariadb" ? "mariadb" : i === "mssql" ? "mssql" : void 0;
611
630
  return $({
612
631
  mix: t,
613
632
  plugins: n,
614
- cdc: e.cdc ?? (i !== void 0 && (process.env.CDC ?? "1") !== "0"),
615
- ...i ? { cdcDialect: i } : {}
633
+ cdc: e.cdc ?? (a !== void 0 && (process.env.CDC ?? "1") !== "0"),
634
+ ...a ? { cdcDialect: a } : {}
616
635
  });
617
636
  };
618
637
  //#endregion
619
- export { R as S, je as _, Z as a, z as b, G as c, V as d, Ne as f, Ae as g, Pe as h, Xe as i, U as l, Ie as m, $ as n, K as o, H as p, Q as r, Ue as s, Qe as t, Re as u, Te as v, be as x, we as y };
638
+ export { L as C, Se as S, je as _, Qe as a, Ee as b, We as c, ze as d, V as f, Fe as g, Le as h, Z as i, G as l, H as m, et as n, X as o, Pe as p, $ as r, K as s, Q as t, U as u, Me as v, R as x, De as y };
@@ -0,0 +1,2 @@
1
+ import { n as e } from "./frameworkTableAssembly-BwIrO5nv.js";
2
+ export { e as assembleFrameworkTables };
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as e, i as t, n, o as r, r as i, t as a } from "./commands-BkJft9K2.js";
1
+ import { a as e, i as t, n, o as r, r as i, t as a } from "./commands-CNVVv03h.js";
2
2
  //#region src/index.ts
3
3
  var o = "framework";
4
4
  //#endregion