@marktiderman/genesis-cli 1.26.0 → 1.27.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.
@@ -18,7 +18,7 @@
18
18
  "dependencies": {
19
19
  "@expo/metro-runtime": "~58.0.15",
20
20
  "@expo/ui": "~58.0.23",
21
- "@hookform/resolvers": "^6.0.0",
21
+ "@hookform/resolvers": "^7.0.1",
22
22
  "@marktiderman/genesis-chat": "workspace:^",
23
23
  "@marktiderman/genesis-core": "workspace:^",
24
24
  "@marktiderman/genesis-design-system": "workspace:^",
@@ -32,14 +32,14 @@
32
32
  "@marktiderman/genesis-support": "workspace:^",
33
33
  "@marktiderman/genesis-ui-native": "workspace:^",
34
34
  "@react-native-async-storage/async-storage": "2.2.0",
35
- "@react-native-community/datetimepicker": "9.2.2",
35
+ "@react-native-community/datetimepicker": "9.3.0",
36
36
  "@react-native-community/netinfo": "12.0.1",
37
- "@sentry/react-native": "~8.32.0",
37
+ "@sentry/react-native": "~8.34.0",
38
38
  "@shopify/flash-list": "2.3.3",
39
39
  "@supabase/supabase-js": "^2.118.0",
40
- "@tanstack/query-async-storage-persister": "5.105.0",
41
- "@tanstack/query-persist-client-core": "5.105.0",
42
- "@tanstack/react-query": "5.105.0",
40
+ "@tanstack/query-async-storage-persister": "5.107.1",
41
+ "@tanstack/query-persist-client-core": "5.107.1",
42
+ "@tanstack/react-query": "5.107.1",
43
43
  "clsx": "^2.1.1",
44
44
  "expo": "~58.0.19",
45
45
  "expo-apple-authentication": "~58.0.2",
package/dist/vite.js CHANGED
@@ -284,8 +284,11 @@ var init_model = __esm({
284
284
  });
285
285
 
286
286
  // src/introspect/postgres.ts
287
- function where(sql, scope) {
288
- return "schemas" in scope ? sql`n.nspname = any(${scope.schemas})` : sql`c.oid = any(${scope.oids}::oid[])`;
287
+ function where(scope) {
288
+ return "schemas" in scope ? { condition: "n.nspname = any(array(select jsonb_array_elements_text($1::text::jsonb)))", param: JSON.stringify(scope.schemas) } : { condition: "c.oid = any(array(select jsonb_array_elements_text($1::text::jsonb)::oid))", param: JSON.stringify(scope.oids) };
289
+ }
290
+ async function read(sql, text, param) {
291
+ return [...await sql.unsafe(text, [param])];
289
292
  }
290
293
  function linkOf(columns, refColumns, refUnique = []) {
291
294
  if (columns.length === 1) return 0;
@@ -294,7 +297,8 @@ function linkOf(columns, refColumns, refUnique = []) {
294
297
  return own.length === 1 && refUnique[own[0]] === true ? own[0] : -1;
295
298
  }
296
299
  async function readRelations(sql, scope, into) {
297
- const columns = await sql`
300
+ const { condition, param } = where(scope);
301
+ const columns = await read(sql, `
298
302
  select c.oid::text as oid, c.relkind::text as relkind, n.nspname as schema, c.relname as table,
299
303
  obj_description(c.oid, 'pg_class') as table_comment,
300
304
  a.attnum::int as attnum,
@@ -313,17 +317,17 @@ async function readRelations(sql, scope, into) {
313
317
  join pg_attribute a on a.attrelid = c.oid and a.attnum > 0 and not a.attisdropped
314
318
  join pg_type t on t.oid = a.atttypid
315
319
  where c.relkind in ('r', 'p', 'v', 'm', 'f')
316
- and ${where(sql, scope)}
317
- order by n.nspname, c.relname, a.attnum`;
318
- const keys = await sql`
320
+ and ${condition}
321
+ order by n.nspname, c.relname, a.attnum`, param);
322
+ const keys = await read(sql, `
319
323
  select c.oid::text as oid, array_agg(k.attnum::int order by k.ord) as columns
320
324
  from pg_constraint con
321
325
  join pg_class c on c.oid = con.conrelid
322
326
  join pg_namespace n on n.oid = c.relnamespace
323
327
  cross join lateral unnest(con.conkey) with ordinality as k(attnum, ord)
324
- where con.contype = 'p' and ${where(sql, scope)}
325
- group by c.oid`;
326
- const links = await sql`
328
+ where con.contype = 'p' and ${condition}
329
+ group by c.oid`, param);
330
+ const links = await read(sql, `
327
331
  select c.oid::text as oid, con.conkey::int[] as attnums,
328
332
  array(select a.attname::text from unnest(con.conkey) with ordinality k(attnum, ord)
329
333
  join pg_attribute a on a.attrelid = c.oid and a.attnum = k.attnum order by k.ord) as columns,
@@ -340,9 +344,9 @@ async function readRelations(sql, scope, into) {
340
344
  join pg_class rc on rc.oid = con.confrelid
341
345
  join pg_namespace rn on rn.oid = rc.relnamespace
342
346
  where con.contype = 'f'
343
- and ${where(sql, scope)}
344
- order by con.conname`;
345
- const checks = await sql`
347
+ and ${condition}
348
+ order by con.conname`, param);
349
+ const checks = await read(sql, `
346
350
  select c.oid::text as oid, con.conkey[1]::int as attnum, a.attname as column,
347
351
  pg_get_constraintdef(con.oid) as definition
348
352
  from pg_constraint con
@@ -350,9 +354,9 @@ async function readRelations(sql, scope, into) {
350
354
  join pg_namespace n on n.oid = c.relnamespace
351
355
  join pg_attribute a on a.attrelid = c.oid and a.attnum = con.conkey[1]
352
356
  where con.contype = 'c' and array_length(con.conkey, 1) = 1
353
- and ${where(sql, scope)}
354
- order by con.conname`;
355
- const views = await sql`
357
+ and ${condition}
358
+ order by con.conname`, param);
359
+ const views = await read(sql, `
356
360
  select c.oid::text as oid, r.ev_action::text as ev_action
357
361
  from pg_class c
358
362
  join pg_namespace n on n.oid = c.relnamespace
@@ -360,7 +364,7 @@ async function readRelations(sql, scope, into) {
360
364
  where c.relkind = 'v'
361
365
  and (pg_relation_is_updatable(c.oid, false) & 20) = 20
362
366
  and not exists (select 1 from pg_rewrite o where o.ev_class = c.oid and o.rulename <> '_RETURN')
363
- and ${where(sql, scope)}`;
367
+ and ${condition}`, param);
364
368
  const added = [];
365
369
  for (const row of columns) {
366
370
  let relation = into.get(row.oid);
@@ -3815,7 +3819,7 @@ function createTrail(ctx) {
3815
3819
  declared = null;
3816
3820
  }
3817
3821
  const byPath = new Map(ctx.files.map((f) => [f.absolutePath, f]));
3818
- const read2 = (abs) => byPath.get(abs) ?? readSource(abs);
3822
+ const read3 = (abs) => byPath.get(abs) ?? readSource(abs);
3819
3823
  const importsCache = /* @__PURE__ */ new Map();
3820
3824
  const importsOf = (file) => {
3821
3825
  const hit = importsCache.get(file.absolutePath);
@@ -3892,7 +3896,7 @@ function createTrail(ctx) {
3892
3896
  cut.add(abs);
3893
3897
  continue;
3894
3898
  }
3895
- const target = read2(abs);
3899
+ const target = read3(abs);
3896
3900
  if (!target) {
3897
3901
  unknown = true;
3898
3902
  continue;
@@ -6553,7 +6557,7 @@ function sourceSchemas(source) {
6553
6557
  return schemas?.length ? schemas : null;
6554
6558
  }
6555
6559
  var lf = (text) => text.replace(/\r\n/g, "\n");
6556
- async function checkContracts(ctx, read2 = postgresContract) {
6560
+ async function checkContracts(ctx, read3 = postgresContract) {
6557
6561
  const settings = ctx.config.contracts;
6558
6562
  if (!settings) return;
6559
6563
  const out = settings.out ?? DEFAULT_CONTRACT_OUT;
@@ -6577,7 +6581,7 @@ async function checkContracts(ctx, read2 = postgresContract) {
6577
6581
  }
6578
6582
  let expected;
6579
6583
  try {
6580
- expected = lf((await read2(url, schemas)).content);
6584
+ expected = lf((await read3(url, schemas)).content);
6581
6585
  } catch (err) {
6582
6586
  const generation = err.name === "EmitError";
6583
6587
  const message = err.message.split("\n")[0];
@@ -6595,7 +6599,7 @@ async function checkContracts(ctx, read2 = postgresContract) {
6595
6599
  }
6596
6600
  }
6597
6601
  var GENESIS_DOCS = "https://github.com/marktiderman/genesis/blob/main/docs";
6598
- var read = (file) => existsSync(file) ? readFileSync(file, "utf8") : null;
6602
+ var read2 = (file) => existsSync(file) ? readFileSync(file, "utf8") : null;
6599
6603
  var CORE = [
6600
6604
  {
6601
6605
  need: "anything, before building it",
@@ -6725,7 +6729,7 @@ function packageGuides(root, packages) {
6725
6729
  const guides = [];
6726
6730
  for (const p of packages) {
6727
6731
  const stable = p.local ? path21.join(p.dir, "SKILL.md") : stableGuidePath(root, p);
6728
- const text = stable === null ? null : read(stable);
6732
+ const text = stable === null ? null : read2(stable);
6729
6733
  if (stable === null || text === null) continue;
6730
6734
  const description = skillDescription(text);
6731
6735
  const at = description.indexOf("Load before");
@@ -6824,8 +6828,8 @@ function claudeState(root) {
6824
6828
  function agentGuideState(root, packages, agentsFile = "AGENTS.md") {
6825
6829
  const rows = primitivesCatalog(packages);
6826
6830
  const guides = packageGuides(root, packages);
6827
- const skill = read(path21.join(root, SKILL_PATH))?.replace(/\r\n/g, "\n") ?? null;
6828
- const block = currentAgentsBlock(read(path21.join(root, agentsFile)));
6831
+ const skill = read2(path21.join(root, SKILL_PATH))?.replace(/\r\n/g, "\n") ?? null;
6832
+ const block = currentAgentsBlock(read2(path21.join(root, agentsFile)));
6829
6833
  return {
6830
6834
  skill: skill === null ? "missing" : skill === renderSkill(rows, guides) ? "ok" : "stale",
6831
6835
  agents: block === null || block === "broken" ? block ?? "missing" : block === renderAgentsBlock(rows, guides) ? "ok" : "stale",