@voltro/cli 0.30.0 → 0.30.1

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 (78) hide show
  1. package/CHANGELOG.md +71 -0
  2. package/dist/apiBuild-Ca6Sq5jy.js +2 -0
  3. package/dist/{apiBuild-BceikpQf.js → apiBuild-DmkzRyv7.js} +2 -2
  4. package/dist/bin.js +3 -3
  5. package/dist/{checkCommand-BMr-X48w.js → checkCommand-C4konUy9.js} +422 -298
  6. package/dist/checkCommand-DHD0aBeR.js +2 -0
  7. package/dist/{commands-D4Y1-Nlu.js → commands-BkJft9K2.js} +1609 -1607
  8. package/dist/{dbCommand-C7hbl5pk.js → dbCommand-qn__kLEt.js} +1 -1
  9. package/dist/dbCommand-wfGi3FgG.js +2 -0
  10. package/dist/{dev-DmnkH-wr.js → dev-C_NPcLDp.js} +1266 -1250
  11. package/dist/{dev-Cr-teYsz.js → dev-DXhhZ7-f.js} +1 -1
  12. package/dist/frameworkTableAssembly-Bn_c4Mnl.js +2 -0
  13. package/dist/{frameworkTableAssembly-BzAajuUv.js → frameworkTableAssembly-Cpgn2e88.js} +128 -130
  14. package/dist/index.js +1 -1
  15. package/dist/{inspectMetrics-BeJdP_3b.js → inspectMetrics-CkB2J0Zn.js} +2 -0
  16. package/dist/{sdkgen-CqpOq_fy.js → sdkgen-wsWLrq4l.js} +1 -1
  17. package/dist/{serveCommand-Ciq_wIY8.js → serveCommand-HtI4X5kj.js} +14 -14
  18. package/dist/serveEntry.js +2 -2
  19. package/dist/{start-ocqB1seX.js → start-egkbpugc.js} +177 -175
  20. package/dist/startEntry.js +2 -2
  21. package/package.json +17 -17
  22. package/templates/AGENTS.md +1 -1
  23. package/templates/agent-docs/_index.md +1 -1
  24. package/templates/agent-docs/cli.md +27 -0
  25. package/templates/agent-docs/routing.md +14 -0
  26. package/templates/agent-docs/whats-new.md +36 -342
  27. package/templates/agent-docs/workflows.md +2 -0
  28. package/templates/apps/api-ai/package.json +7 -7
  29. package/templates/apps/api-auth/package.json +8 -8
  30. package/templates/apps/api-backend/package.json +7 -7
  31. package/templates/apps/api-backend-deactivation/package.json +7 -7
  32. package/templates/apps/api-backend-mail/package.json +8 -8
  33. package/templates/apps/api-backend-mariadb/package.json +9 -9
  34. package/templates/apps/api-backend-sqlite/package.json +8 -8
  35. package/templates/apps/api-backend-storage/package.json +8 -8
  36. package/templates/apps/api-cms/package.json +10 -10
  37. package/templates/apps/api-collab/package.json +8 -8
  38. package/templates/apps/api-data-advanced/package.json +8 -8
  39. package/templates/apps/api-durable/package.json +8 -8
  40. package/templates/apps/api-feature-flags/package.json +9 -9
  41. package/templates/apps/api-governance/package.json +8 -8
  42. package/templates/apps/api-kv/package.json +8 -8
  43. package/templates/apps/api-moderation/package.json +8 -8
  44. package/templates/apps/api-observability/package.json +8 -8
  45. package/templates/apps/api-ratelimit/package.json +8 -8
  46. package/templates/apps/api-rbac/package.json +8 -8
  47. package/templates/apps/api-rest/package.json +7 -7
  48. package/templates/apps/api-saas/package.json +11 -11
  49. package/templates/apps/api-saas-starter/package.json +10 -10
  50. package/templates/apps/api-search/package.json +8 -8
  51. package/templates/apps/api-status/package.json +8 -8
  52. package/templates/apps/api-versioning/package.json +8 -8
  53. package/templates/apps/api-webhooks/package.json +9 -9
  54. package/templates/apps/changelog/package.json +6 -6
  55. package/templates/apps/edge-functions/package.json +2 -2
  56. package/templates/apps/frontend-admin/package.json +8 -8
  57. package/templates/apps/frontend-app/package.json +8 -8
  58. package/templates/apps/frontend-auth/package.json +8 -8
  59. package/templates/apps/frontend-blank/package.json +7 -7
  60. package/templates/apps/frontend-cms/package.json +9 -9
  61. package/templates/apps/frontend-collab/package.json +9 -9
  62. package/templates/apps/frontend-contact/package.json +7 -7
  63. package/templates/apps/frontend-dashboard/package.json +7 -7
  64. package/templates/apps/frontend-docs/package.json +7 -7
  65. package/templates/apps/frontend-i18n/package.json +6 -6
  66. package/templates/apps/frontend-landing/package.json +7 -7
  67. package/templates/apps/frontend-portal/package.json +8 -8
  68. package/templates/apps/frontend-saas/package.json +8 -8
  69. package/templates/apps/frontend-spa/package.json +7 -7
  70. package/templates/apps/frontend-ssr/package.json +7 -7
  71. package/templates/apps/frontend-ssr-api/package.json +8 -8
  72. package/templates/apps/frontend-static-blog/package.json +6 -6
  73. package/templates/apps/frontend-status/package.json +8 -8
  74. package/templates/apps/mobile-app/package.json +2 -2
  75. package/dist/apiBuild-CxvR1Dwt.js +0 -2
  76. package/dist/checkCommand-BOk9y264.js +0 -2
  77. package/dist/dbCommand-D8nhyppR.js +0 -2
  78. package/dist/frameworkTableAssembly-DU0aOxjL.js +0 -2
@@ -1,3 +1,3 @@
1
1
  import "./seedRunner-Bqxgp7HZ.js";
2
- import { c as e, h as t, u as n } from "./dev-DmnkH-wr.js";
2
+ import { c as e, h as t, u as n } from "./dev-C_NPcLDp.js";
3
3
  export { e as loadApiConfig, n as loadDiscovered, t as walk };
@@ -0,0 +1,2 @@
1
+ import { t as e } from "./frameworkTableAssembly-Cpgn2e88.js";
2
+ export { e as assembleFrameworkTables };
@@ -1,153 +1,153 @@
1
1
  import { n as e } from "./appModuleLoader-C9r9mxZt.js";
2
- import { D as t, a as n, j as r, k as i, p as a } from "./fileConventions-Cof68_BL.js";
3
- import { basename as o, join as s } from "node:path";
4
- import { pathToFileURL as c } from "node:url";
5
- import { Effect as l } from "effect";
6
- import { promises as u } from "node:fs";
7
- import { _voltroConnectionGrantsTable as d, _voltroConnectionsTable as f, _voltroScheduleClaimsTable as p, _voltroScheduleRunsTable as m, _voltroTracesTable as h, _voltroUndoLogTable as ee, _voltroWakeupsTable as te, _voltroWorkflowEventDeliveriesTable as ne, _voltroWorkflowEventsTable as re, outboxAttemptsTable as ie, outboxTable as ae, undoCaptureEnabled as oe } from "@voltro/runtime";
8
- import { SqlClient as g } from "@effect/sql";
9
- import { _voltroWorkflowAdmissionsTable as se, _voltroWorkflowPausesTable as ce, _voltroWorkflowPendingTable as le, _voltroWorkflowRunEventsTable as ue, _voltroWorkflowRunStepsTable as de, _voltroWorkflowRunsTable as fe, _voltroWorkflowStartContextsTable as pe, _voltroWorkflowWatermarksTable as me } from "@voltro/workflow";
10
- import { agentMessagesTable as he, agentThreadsTable as _, aiBudgetTable as v, aiInferencesTable as y, aiUsageTable as b, isAgentDescriptor as x, isAgentExecutor as S, resolveToolModuleHandlers as C } from "@voltro/ai";
11
- import { _voltroApiKeysTable as w, _voltroCdcOffsetsTable as T, _voltroIdempotencyTable as E, _voltroKvTable as D, _voltroMigrationPlansTable as O, _voltroMigrationsTable as k, _voltroMssqlCdcOffsetsTable as A, _voltroSeedsTable as j, lt as M } from "@voltro/database";
12
- import { _voltroWebhookDeliveriesTable as N, _voltroWebhookTargetsTable as P } from "@voltro/plugin-webhooks/mixin";
13
- import { _voltroStorageBlobsTable as F, _voltroStorageGrantsTable as I, _voltroStorageRefsTable as L, _voltroStorageUsageTable as R } from "@voltro/plugin-storage";
14
- import { defineAction as ge, defineMutation as _e, defineQuery as ve } from "@voltro/protocol";
2
+ import { D as t, a as n, j as r, k as i } from "./fileConventions-Cof68_BL.js";
3
+ import { basename as a, join as o } from "node:path";
4
+ import { pathToFileURL as s } from "node:url";
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";
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";
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
+ import { _voltroWebhookDeliveriesTable as j, _voltroWebhookTargetsTable as M } from "@voltro/plugin-webhooks/mixin";
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";
15
15
  //#region src/frameworkTables.ts
16
16
  var ye = [
17
17
  {
18
- table: k,
18
+ table: D,
19
19
  when: "always"
20
20
  },
21
21
  {
22
- table: j,
22
+ table: k,
23
23
  when: "always"
24
24
  },
25
25
  {
26
- table: O,
26
+ table: E,
27
27
  when: "always"
28
28
  },
29
29
  {
30
- table: fe,
30
+ table: pe,
31
31
  when: "workflows"
32
32
  },
33
33
  {
34
- table: de,
34
+ table: fe,
35
35
  when: "workflows"
36
36
  },
37
37
  {
38
- table: ue,
38
+ table: de,
39
39
  when: "workflows"
40
40
  },
41
41
  {
42
- table: pe,
42
+ table: me,
43
43
  when: "workflows"
44
44
  },
45
45
  {
46
- table: le,
46
+ table: ue,
47
47
  when: "workflows"
48
48
  },
49
49
  {
50
- table: se,
50
+ table: ce,
51
51
  when: "workflows"
52
52
  },
53
53
  {
54
- table: ce,
54
+ table: le,
55
55
  when: "workflows"
56
56
  },
57
57
  {
58
- table: me,
58
+ table: he,
59
59
  when: "workflows"
60
60
  },
61
61
  {
62
- table: re,
62
+ table: ie,
63
63
  when: "workflows"
64
64
  },
65
65
  {
66
- table: ne,
66
+ table: re,
67
67
  when: "workflows"
68
68
  },
69
69
  {
70
- table: m,
70
+ table: p,
71
71
  when: "schedules"
72
72
  },
73
73
  {
74
- table: p,
74
+ table: f,
75
75
  when: "schedules"
76
76
  },
77
77
  {
78
- table: P,
78
+ table: M,
79
79
  when: "webhooks"
80
80
  },
81
81
  {
82
- table: N,
82
+ table: j,
83
83
  when: "webhooks"
84
84
  },
85
85
  {
86
- table: h,
86
+ table: ee,
87
87
  when: "traces"
88
88
  },
89
89
  {
90
- table: ee,
90
+ table: te,
91
91
  when: "undo"
92
92
  },
93
93
  {
94
- table: ae,
95
- when: "outbox"
94
+ table: oe,
95
+ when: "always"
96
96
  },
97
97
  {
98
- table: ie,
99
- when: "outbox"
98
+ table: ae,
99
+ when: "always"
100
100
  },
101
101
  {
102
- table: f,
102
+ table: d,
103
103
  when: "connections"
104
104
  },
105
105
  {
106
- table: d,
106
+ table: u,
107
107
  when: "connections"
108
108
  },
109
109
  {
110
- table: te,
110
+ table: ne,
111
111
  when: "always"
112
112
  },
113
113
  {
114
- table: L,
114
+ table: F,
115
115
  when: "always"
116
116
  },
117
117
  {
118
- table: I,
118
+ table: P,
119
119
  when: "always"
120
120
  },
121
121
  {
122
- table: F,
122
+ table: N,
123
123
  when: "always"
124
124
  },
125
125
  {
126
- table: R,
126
+ table: I,
127
127
  when: "always"
128
128
  },
129
129
  {
130
- table: E,
130
+ table: w,
131
131
  when: "always"
132
132
  },
133
133
  {
134
- table: w,
134
+ table: S,
135
135
  when: "always"
136
136
  },
137
137
  {
138
- table: D,
138
+ table: T,
139
139
  when: "always"
140
140
  }
141
- ], z = (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 === "outbox" && e.outbox === !0 || t.when === "connections" && e.connections === !0).map((e) => e.table);
143
- return e.cdc === !0 && t.push(e.cdcDialect === "mssql" ? A : T), t;
144
- }, B = (e) => {
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);
143
+ return e.cdc === !0 && t.push(e.cdcDialect === "mssql" ? O : C), t;
144
+ }, z = (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
147
  }, be = (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 : `${B(e.name)}.${t.name}`, Se = (e, t, n) => {
150
+ }, xe = (e, t) => t.name.includes(".") ? t.name : `${z(e.name)}.${t.name}`, Se = (e, t, n) => {
151
151
  switch (e) {
152
152
  case "query": return ve({
153
153
  name: t,
@@ -162,14 +162,14 @@ var ye = [
162
162
  output: n.output,
163
163
  ...n.error === void 0 ? {} : { error: n.error }
164
164
  });
165
- case "action": return ge({
165
+ case "action": return L({
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) => l.suspend(() => {
172
+ }, Ce = (e) => (t, n) => c.suspend(() => {
173
173
  let r = { request: {
174
174
  subject: n.request.subject,
175
175
  traceId: n.request.traceId
@@ -194,7 +194,7 @@ var ye = [
194
194
  }
195
195
  }
196
196
  return t;
197
- }, V = (e, t, n = /* @__PURE__ */ new Set()) => {
197
+ }, Te = (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,35 +206,35 @@ var ye = [
206
206
  }
207
207
  }
208
208
  return i;
209
- }, H = "_voltro_plugin_migrations", Te = () => l.gen(function* () {
210
- yield* (yield* g.SqlClient).unsafe(`
211
- CREATE TABLE IF NOT EXISTS ${H} (
209
+ }, B = "_voltro_plugin_migrations", Ee = () => c.gen(function* () {
210
+ yield* (yield* m.SqlClient).unsafe(`
211
+ CREATE TABLE IF NOT EXISTS ${B} (
212
212
  id TEXT PRIMARY KEY,
213
213
  plugin_name TEXT NOT NULL,
214
214
  migration_id TEXT NOT NULL,
215
215
  description TEXT,
216
216
  applied_at TEXT NOT NULL
217
217
  );
218
- `).pipe(l.orDie);
219
- }), Ee = (e, t) => `${B(e)}__${t}`, De = () => l.gen(function* () {
220
- let e = yield* g.SqlClient, t = yield* e`SELECT id FROM ${e(H)}`.pipe(l.orDie);
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);
221
221
  return new Set(t.map((e) => e.id));
222
- }), Oe = (e) => l.gen(function* () {
223
- let t = yield* g.SqlClient, n = (/* @__PURE__ */ new Date()).toISOString();
222
+ }), ke = (e) => c.gen(function* () {
223
+ let t = yield* m.SqlClient, n = (/* @__PURE__ */ new Date()).toISOString();
224
224
  yield* t`
225
- INSERT INTO ${t(H)} (id, plugin_name, migration_id, description, applied_at)
225
+ INSERT INTO ${t(B)} (id, plugin_name, migration_id, description, applied_at)
226
226
  VALUES (${e.key}, ${e.pluginName}, ${e.migration.id}, ${e.migration.description ?? null}, ${n})
227
- `.pipe(l.orDie);
228
- }), ke = (e) => l.gen(function* () {
227
+ `.pipe(c.orDie);
228
+ }), Ae = (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* Te();
235
- let n = yield* De(), r = [];
234
+ yield* Ee();
235
+ let n = yield* Oe(), r = [];
236
236
  for (let { plugin: e, migration: i } of t) {
237
- let t = Ee(e.name, i.id), a = Date.now();
237
+ let t = De(e.name, i.id), a = Date.now();
238
238
  if (n.has(t)) {
239
239
  r.push({
240
240
  pluginName: e.name,
@@ -244,9 +244,9 @@ var ye = [
244
244
  });
245
245
  continue;
246
246
  }
247
- let o = yield* g.SqlClient;
247
+ let o = yield* m.SqlClient;
248
248
  try {
249
- yield* i.up(o).pipe(l.mapError((e) => e)), yield* Oe({
249
+ yield* i.up(o).pipe(c.mapError((e) => e)), yield* ke({
250
250
  key: t,
251
251
  pluginName: e.name,
252
252
  migration: i
@@ -263,28 +263,28 @@ var ye = [
263
263
  status: "failed",
264
264
  durationMs: Date.now() - a,
265
265
  error: t
266
- }), yield* l.fail(/* @__PURE__ */ Error(`Plugin migration failed: ${e.name} ${i.id} — ${t instanceof Error ? t.message : String(t)}`));
266
+ }), yield* c.fail(/* @__PURE__ */ Error(`Plugin migration failed: ${e.name} ${i.id} — ${t instanceof Error ? t.message : String(t)}`));
267
267
  }
268
268
  }
269
269
  return r;
270
- }), Ae = (e) => e.filter((e) => e.extendSchema && (e.extendSchema.tables?.length ?? 0) + (e.extendSchema.migrations?.length ?? 0) > 0).map((e) => ({
270
+ }), je = (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: B(e.name),
272
+ pluginAlias: z(e.name),
273
273
  tables: e.extendSchema.tables?.length ?? 0,
274
274
  migrations: e.extendSchema.migrations?.length ?? 0
275
- })), je = (e) => e.flatMap((e) => e.extendSchema?.tables ?? []), U = /(?<!\.server)\.agent\.tsx?$/, Me = /\.agent\.server\.tsx?$/, W = /\.tool\.tsx?$/, Ne = async (t, n) => {
275
+ })), Me = (e) => e.flatMap((e) => e.extendSchema?.tables ?? []), V = /(?<!\.server)\.agent\.tsx?$/, Ne = /\.agent\.server\.tsx?$/, H = /\.tool\.tsx?$/, Pe = async (t, n) => {
276
276
  let r = 0;
277
- for (let i of t) if (W.test(i)) try {
277
+ for (let i of t) if (H.test(i)) try {
278
278
  let t = await e(i);
279
- r += C(t);
279
+ r += x(t);
280
280
  } catch (e) {
281
281
  n.warn("tool: failed to import — handler not wired", { file: i }, e);
282
282
  }
283
283
  return r;
284
- }, Pe = (e) => e.replace(/\.agent\.(tsx?)$/, ".agent.server.$1"), Fe = async (t, n) => {
284
+ }, Fe = (e) => e.replace(/\.agent\.(tsx?)$/, ".agent.server.$1"), Ie = async (t, n) => {
285
285
  let r = [], i = /* @__PURE__ */ new Set();
286
286
  for (let a of t) {
287
- if (!U.test(a)) continue;
287
+ if (!V.test(a)) continue;
288
288
  let t;
289
289
  try {
290
290
  t = await e(a);
@@ -292,7 +292,7 @@ var ye = [
292
292
  n.warn("agent: failed to import descriptor", { file: a }, e);
293
293
  continue;
294
294
  }
295
- let o = Object.values(t).find(x);
295
+ let o = Object.values(t).find(y);
296
296
  if (o === void 0) {
297
297
  n.warn("agent: no defineAgent() descriptor export found", { file: a });
298
298
  continue;
@@ -304,7 +304,7 @@ var ye = [
304
304
  });
305
305
  continue;
306
306
  }
307
- let s = Pe(a), c;
307
+ let s = Fe(a), c;
308
308
  try {
309
309
  c = await e(s);
310
310
  } catch (e) {
@@ -316,7 +316,7 @@ var ye = [
316
316
  continue;
317
317
  }
318
318
  let l = c.default;
319
- if (!S(l)) {
319
+ if (!b(l)) {
320
320
  n.warn("agent: executor file must default-export defineAgentExecutor(descriptor, {...})", {
321
321
  file: s,
322
322
  name: o.name
@@ -331,7 +331,7 @@ var ye = [
331
331
  });
332
332
  }
333
333
  return { agents: r };
334
- }, G = /\.connection\.tsx?$/, Ie = (e) => e.replace(G, ""), Le = async (t, n) => {
334
+ }, U = /\.connection\.tsx?$/, Le = (e) => e.replace(U, ""), Re = async (t, n) => {
335
335
  let r = [], i = /* @__PURE__ */ new Map();
336
336
  for (let a of t) {
337
337
  let t;
@@ -374,26 +374,26 @@ 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) => Ie(o(e.file)))
377
+ files: r.map((e) => Le(a(e.file)))
378
378
  }), r;
379
- }, K = (e) => typeof e.attributes["framework.kind"] == "string" && e.attributes["framework.kind"].startsWith("subscription."), q = (e) => {
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;
381
381
  for (let t in e.attributes) {
382
382
  let n = e.attributes[t];
383
383
  if (typeof n == "string" && n.includes("_voltro_traces")) return !0;
384
384
  }
385
385
  return !1;
386
- }, Re = (e) => typeof e.attributes["framework.kind"] == "string" && e.attributes["framework.kind"].startsWith("subscription"), ze = 1e3, Be = 500, Ve = 50, J = class {
386
+ }, ze = (e) => typeof e.attributes["framework.kind"] == "string" && e.attributes["framework.kind"].startsWith("subscription"), Be = 1e3, Ve = 500, He = 50, K = class {
387
387
  capacity;
388
388
  buffer = [];
389
- constructor(e = ze) {
389
+ constructor(e = Be) {
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 ?? Be, 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 ?? Ve, 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 ?? Ve, r = e.onlyErrors ?? !1, i = /* @__PURE__ */ new Map();
404
+ let t = e.since ?? 0, n = e.maxTraces ?? He, 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(K), c = s.length > 0 || t.some(Re), 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(ze), 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,34 +437,34 @@ var ye = [
437
437
  clear() {
438
438
  this.buffer = [];
439
439
  }
440
- }, Y = null, He = () => (Y === null && (Y = new J()), Y), Ue = /* @__PURE__ */ new Set([
440
+ }, q = null, Ue = () => (q === null && (q = new K()), q), We = /* @__PURE__ */ new Set([
441
441
  "off",
442
442
  "errors",
443
443
  "interesting",
444
444
  "all"
445
- ]), X = (e, t, n, r) => {
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
- }, We = (e) => e !== void 0 && [
448
+ }, Ge = (e) => e !== void 0 && [
449
449
  "1",
450
450
  "true",
451
451
  "yes",
452
452
  "on"
453
- ].includes(e.toLowerCase()), Ge = (e) => {
453
+ ].includes(e.toLowerCase()), Y = (e) => {
454
454
  let t = Number(e);
455
455
  return Number.isFinite(t) && t > 0 ? t : 24;
456
- }, Z = (e = process.env) => {
457
- let t = (e.VOLTRO_TRACING_BUFFER ?? "").toLowerCase() === "off", n = X(e.VOLTRO_TRACING_SAMPLE, 1, 0, 1), r = (e.VOLTRO_TRACING_PERSIST ?? "").toLowerCase(), i = e.NODE_ENV === "production" ? "off" : "interesting";
456
+ }, X = (e = process.env) => {
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: Ue.has(r) ? r : n <= 0 ? "off" : i,
459
+ mode: We.has(r) ? r : n <= 0 ? "off" : i,
460
460
  sampleRate: n,
461
- slowMs: X(e.VOLTRO_TRACING_SLOW_MS, 500, 0, 2 ** 53 - 1),
462
- ttlHours: Ge(e.VOLTRO_TRACING_TTL_HOURS),
463
- persistDelivery: We(e.VOLTRO_TRACING_PERSIST_DELIVERY),
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),
464
464
  bufferDisabled: t
465
465
  };
466
- }, Q = (e = process.env) => {
467
- let t = Z(e);
466
+ }, Z = (e = process.env) => {
467
+ let t = X(e);
468
468
  return !t.bufferDisabled && t.mode !== "off";
469
469
  }, Ke = (e, t) => {
470
470
  if (t >= 1) return !0;
@@ -473,7 +473,7 @@ var ye = [
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
475
  }, qe = (e, t) => {
476
- if (t.mode === "off" || q(e) || K(e) && !t.persistDelivery) return !1;
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;
@@ -493,7 +493,7 @@ var ye = [
493
493
  return i !== void 0 && r - i < e ? !1 : (t.set(n, r), !0);
494
494
  };
495
495
  }, Xe = (e) => {
496
- let { store: t, log: n } = e, r = e.policy ?? Z();
496
+ let { store: t, log: n } = e, r = e.policy ?? X();
497
497
  n.info(Je(r));
498
498
  let i = Ye(), a = [], o = () => {};
499
499
  if (r.mode !== "off") {
@@ -541,7 +541,7 @@ var ye = [
541
541
  let n = await t.query({
542
542
  table: "_voltro_traces",
543
543
  order: [],
544
- predicate: M("startedAt", e),
544
+ predicate: A("startedAt", e),
545
545
  projection: ["id"],
546
546
  skip: void 0,
547
547
  take: c
@@ -565,28 +565,27 @@ var ye = [
565
565
  for (let e of a) clearInterval(e);
566
566
  }
567
567
  };
568
- }, Ze = async (e) => {
569
- let o = !1, c = !1, l = !1, d = !1, f = !1, p = !1, m = async (e) => {
570
- let h = await u.readdir(e, { withFileTypes: !0 }).catch(() => []);
571
- for (let u of h) if (u.isDirectory()) {
572
- if (u.name === "node_modules" || u.name === "dist" || u.name === ".framework" || u.name.startsWith(".")) continue;
573
- await m(s(e, u.name));
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));
574
574
  } else {
575
- let e = u.name;
576
- (r.test(e) || t.test(e)) && (o = !0), n.test(e) && (c = !0), i.test(e) && (l = !0), U.test(e) && (d = !0), a.test(e) && (f = !0), G.test(e) && (p = !0);
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);
577
577
  }
578
578
  };
579
- return await m(e), {
580
- workflows: o,
581
- schedules: c,
582
- webhooks: l,
583
- agents: d,
584
- outbox: f,
585
- connections: p
579
+ return await f(e), {
580
+ workflows: a,
581
+ schedules: s,
582
+ webhooks: c,
583
+ agents: u,
584
+ connections: d
586
585
  };
587
- }, Qe = async (e) => {
586
+ }, Ze = async (e) => {
588
587
  try {
589
- return (await import(c(s(e, "app.config.ts")).href)).default?.plugins ?? [];
588
+ return (await import(s(o(e, "app.config.ts")).href)).default?.plugins ?? [];
590
589
  } catch {
591
590
  return [];
592
591
  }
@@ -594,22 +593,21 @@ var ye = [
594
593
  let t = /* @__PURE__ */ new Map(), n = (e) => {
595
594
  e?.tableName && !t.has(e.tableName) && t.set(e.tableName, e);
596
595
  };
597
- for (let t of z({
596
+ for (let t of R({
598
597
  workflows: e.mix.workflows,
599
598
  schedules: e.mix.schedules,
600
599
  webhooks: e.mix.webhooks,
601
- traces: Q(),
600
+ traces: Z(),
602
601
  cdc: e.cdc,
603
602
  ...e.cdcDialect ? { cdcDialect: e.cdcDialect } : {},
604
- undo: oe(),
605
- outbox: e.mix.outbox,
603
+ undo: se(),
606
604
  connections: e.mix.connections
607
605
  })) n(t);
608
- e.mix.agents && (n(_), n(he), n(b), n(v)), e.mix.workflows && n(y);
609
- for (let t of je(e.plugins)) 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);
610
608
  return [...t.values()];
611
- }, $e = async (e) => {
612
- let t = await Ze(e.root), n = await Qe(e.root), r = (process.env.DB_DIALECT ?? "postgres").toLowerCase(), i = r === "mariadb" ? "mariadb" : r === "mssql" ? "mssql" : void 0;
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;
613
611
  return $({
614
612
  mix: t,
615
613
  plugins: n,
@@ -618,4 +616,4 @@ var ye = [
618
616
  });
619
617
  };
620
618
  //#endregion
621
- export { V as _, J as a, be as b, G as c, Me as d, W as f, Ae as g, ke as h, Q as i, Le as l, Ne as m, $ as n, He as o, Fe as p, Xe as r, q as s, $e as t, U as u, we as v, z as x, B as y };
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 };
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-D4Y1-Nlu.js";
1
+ import { a as e, i as t, n, o as r, r as i, t as a } from "./commands-BkJft9K2.js";
2
2
  //#region src/index.ts
3
3
  var o = "framework";
4
4
  //#endregion
@@ -3204,6 +3204,7 @@ import {
3204
3204
  descriptor: ne,
3205
3205
  params: f.params,
3206
3206
  pathname: u,
3207
+ search: d,
3207
3208
  segmentLoaderData: k,
3208
3209
  requestContext: re,
3209
3210
  ...ie
@@ -3277,6 +3278,7 @@ import {
3277
3278
  descriptor: ne,
3278
3279
  params: f.params,
3279
3280
  pathname: u,
3281
+ search: d,
3280
3282
  loaderData: P.loaderData,
3281
3283
  segmentLoaderData: P.segmentLoaderData,
3282
3284
  requestContext: re,
@@ -520,7 +520,7 @@ let package = Package(
520
520
  await o.mkdir(t(e), { recursive: !0 }), await o.writeFile(e, i.content, "utf8");
521
521
  }
522
522
  }, ie = async (e) => {
523
- let { offlineManifest: t } = await import("./checkCommand-BOk9y264.js"), { manifest: n } = await t(e);
523
+ let { offlineManifest: t } = await import("./checkCommand-DHD0aBeR.js"), { manifest: n } = await t(e);
524
524
  return n;
525
525
  }, ae = async (e) => {
526
526
  let t = ne(await (e.manifestProvider ?? ie)(e.root), {