@pikku/cli 0.12.59 → 0.12.62

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 (72) hide show
  1. package/dist/.pikku/agent/pikku-agent-types.gen.d.ts +1 -1
  2. package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +1 -1
  3. package/dist/.pikku/channel/pikku-channel-types.gen.js +1 -1
  4. package/dist/.pikku/cli/pikku-cli-channel.js +6 -1
  5. package/dist/.pikku/cli/pikku-cli-client.gen.d.ts +1 -1
  6. package/dist/.pikku/cli/pikku-cli-client.gen.js +1 -1
  7. package/dist/.pikku/cli/pikku-cli-contracts-meta.gen.d.ts +1 -1
  8. package/dist/.pikku/cli/pikku-cli-contracts-meta.gen.js +1 -1
  9. package/dist/.pikku/cli/pikku-cli-types.gen.d.ts +1 -1
  10. package/dist/.pikku/cli/pikku-cli-types.gen.js +1 -1
  11. package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.js +1 -1
  12. package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.json +11 -0
  13. package/dist/.pikku/cli/pikku-cli-wirings.gen.d.ts +1 -1
  14. package/dist/.pikku/cli/pikku-cli-wirings.gen.js +1 -1
  15. package/dist/.pikku/cli/pikku-cli.gen.d.ts +1 -1
  16. package/dist/.pikku/cli/pikku-cli.gen.js +1 -1
  17. package/dist/.pikku/console/pikku-node-types.gen.d.ts +1 -1
  18. package/dist/.pikku/function/pikku-function-types.gen.d.ts +1 -1
  19. package/dist/.pikku/function/pikku-function-types.gen.js +1 -1
  20. package/dist/.pikku/function/pikku-functions-meta.gen.js +1 -1
  21. package/dist/.pikku/function/pikku-functions-meta.gen.json +18 -1
  22. package/dist/.pikku/function/pikku-functions.gen.js +1 -1
  23. package/dist/.pikku/http/pikku-http-types.gen.d.ts +1 -1
  24. package/dist/.pikku/http/pikku-http-types.gen.js +1 -1
  25. package/dist/.pikku/http/pikku-http-wirings-meta.gen.js +1 -1
  26. package/dist/.pikku/http/pikku-http-wirings.gen.d.ts +1 -1
  27. package/dist/.pikku/http/pikku-http-wirings.gen.js +1 -1
  28. package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts +1 -1
  29. package/dist/.pikku/mcp/pikku-mcp-types.gen.js +1 -1
  30. package/dist/.pikku/pikku-bootstrap.gen.d.ts +1 -1
  31. package/dist/.pikku/pikku-bootstrap.gen.js +1 -1
  32. package/dist/.pikku/pikku-meta-service.gen.d.ts +1 -1
  33. package/dist/.pikku/pikku-meta-service.gen.js +1 -1
  34. package/dist/.pikku/pikku-services.gen.d.ts +1 -1
  35. package/dist/.pikku/pikku-types.gen.d.ts +1 -1
  36. package/dist/.pikku/pikku-types.gen.js +1 -1
  37. package/dist/.pikku/queue/pikku-queue-types.gen.d.ts +1 -1
  38. package/dist/.pikku/queue/pikku-queue-types.gen.js +1 -1
  39. package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.js +1 -1
  40. package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.d.ts +1 -1
  41. package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.js +1 -1
  42. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +1 -1
  43. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.json +1 -0
  44. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts +1 -1
  45. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +1 -1
  46. package/dist/.pikku/schemas/register.gen.js +1 -1
  47. package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts +1 -1
  48. package/dist/.pikku/secrets/pikku-secret-types.gen.js +1 -1
  49. package/dist/.pikku/secrets/pikku-secrets.gen.d.ts +1 -1
  50. package/dist/.pikku/secrets/pikku-secrets.gen.js +1 -1
  51. package/dist/.pikku/trigger/pikku-trigger-types.gen.d.ts +1 -1
  52. package/dist/.pikku/trigger/pikku-trigger-types.gen.js +1 -1
  53. package/dist/.pikku/variables/pikku-variable-types.gen.d.ts +1 -1
  54. package/dist/.pikku/variables/pikku-variable-types.gen.js +1 -1
  55. package/dist/.pikku/variables/pikku-variables.gen.d.ts +1 -1
  56. package/dist/.pikku/variables/pikku-variables.gen.js +1 -1
  57. package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +1 -1
  58. package/dist/.pikku/workflow/pikku-workflow-types.gen.js +1 -1
  59. package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +1 -1
  60. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +1 -1
  61. package/dist/bin/pikku-bin.mjs +2 -2
  62. package/dist/src/cli.wiring.js +11 -0
  63. package/dist/src/fabric/functions/validate.function.js +107 -0
  64. package/dist/src/functions/commands/audit.d.ts +5 -0
  65. package/dist/src/functions/commands/audit.js +165 -0
  66. package/dist/src/functions/workflows/all.workflow.js +4 -0
  67. package/dist/src/services.d.ts +1 -0
  68. package/dist/src/utils/assert-single-core-version.d.ts +14 -0
  69. package/dist/src/utils/assert-single-core-version.js +80 -0
  70. package/dist/tsconfig.tsbuildinfo +1 -1
  71. package/package.json +17 -17
  72. package/skills/pikku-audit/SKILL.md +168 -0
@@ -353,6 +353,113 @@ export async function runValidate(startDir = process.cwd()) {
353
353
  }
354
354
  }
355
355
  }
356
+ // ── undeclared dependencies ────────────────────────────────────────────
357
+ // Every external module imported from a package's src/ must be declared in
358
+ // that package's own dependencies/devDependencies/peerDependencies. An
359
+ // undeclared import still type-checks locally (tsconfig `paths` or root
360
+ // workspace hoisting resolve it), but the deploy bundle (esbuild / Bun.build)
361
+ // resolves per-package and fails with "Could not resolve <pkg>. Maybe you
362
+ // need to bun install?" — aborting the deploy. Catch that class here.
363
+ {
364
+ const NODE_BUILTINS = new Set([
365
+ 'assert', 'async_hooks', 'buffer', 'child_process', 'cluster', 'console',
366
+ 'constants', 'crypto', 'dgram', 'dns', 'domain', 'events', 'fs', 'http',
367
+ 'http2', 'https', 'inspector', 'module', 'net', 'os', 'path', 'perf_hooks',
368
+ 'process', 'punycode', 'querystring', 'readline', 'repl', 'stream',
369
+ 'string_decoder', 'timers', 'tls', 'tty', 'url', 'util', 'v8', 'vm',
370
+ 'worker_threads', 'zlib',
371
+ ]);
372
+ const pkgNameOf = (spec) => spec.startsWith('@') ? spec.split('/').slice(0, 2).join('/') : spec.split('/')[0];
373
+ const wsDirs = [];
374
+ for (const group of ['packages', 'apps', 'backends']) {
375
+ const groupDir = join(root, group);
376
+ if (!existsSync(groupDir))
377
+ continue;
378
+ try {
379
+ for (const d of await readdir(groupDir, { withFileTypes: true })) {
380
+ if (d.isDirectory() && existsSync(join(groupDir, d.name, 'package.json'))) {
381
+ wsDirs.push(join(groupDir, d.name));
382
+ }
383
+ }
384
+ }
385
+ catch {
386
+ // ignore
387
+ }
388
+ }
389
+ // Workspace package names resolve via the monorepo, not npm — never "missing".
390
+ const wsNames = new Set();
391
+ for (const dir of wsDirs) {
392
+ const p = await readJsonSafe(join(dir, 'package.json'));
393
+ if (p?.name)
394
+ wsNames.add(p.name);
395
+ }
396
+ for (const dir of wsDirs) {
397
+ const pkg = await readJsonSafe(join(dir, 'package.json'));
398
+ if (!pkg)
399
+ continue;
400
+ const declared = new Set([
401
+ ...Object.keys(pkg.dependencies ?? {}),
402
+ ...Object.keys(pkg.devDependencies ?? {}),
403
+ ...Object.keys(pkg.peerDependencies ?? {}),
404
+ ...Object.keys(pkg.optionalDependencies ?? {}),
405
+ ]);
406
+ // tsconfig `paths` keys (e.g. "@/*") are internal aliases, not packages.
407
+ const tsconfig = await readJsonSafe(join(dir, 'tsconfig.json'));
408
+ const aliasPrefixes = Object.keys(tsconfig?.compilerOptions?.paths ?? {}).map((k) => k.replace(/\*$/, ''));
409
+ const used = new Map();
410
+ for (const file of await listSourceFiles(join(dir, 'src'))) {
411
+ if (/\.gen\.(ts|tsx)$/.test(file))
412
+ continue;
413
+ const txt = await readTextSafe(file);
414
+ if (!txt)
415
+ continue;
416
+ const re = /(?:from|import|require)\s*\(?\s*['"]([^'".#][^'"]*)['"]/g;
417
+ let m;
418
+ while ((m = re.exec(txt))) {
419
+ const spec = m[1];
420
+ if (spec.startsWith('node:') ||
421
+ spec.startsWith('@/') ||
422
+ spec.startsWith('~') ||
423
+ spec.startsWith('virtual:') ||
424
+ spec.includes('${')) {
425
+ continue;
426
+ }
427
+ if (aliasPrefixes.some((a) => spec === a.replace(/\/$/, '') || spec.startsWith(a))) {
428
+ continue;
429
+ }
430
+ const name = pkgNameOf(spec);
431
+ if (NODE_BUILTINS.has(name) || name === pkg.name || wsNames.has(name))
432
+ continue;
433
+ if (!used.has(name))
434
+ used.set(name, file);
435
+ }
436
+ }
437
+ const missing = [...used.keys()].filter((n) => !declared.has(n)).sort();
438
+ if (missing.length) {
439
+ e(`undeclared-deps-${(pkg.name ?? dir).replace(/[@/]/g, '-')}`, `${pkg.name ?? dir} imports undeclared package(s): ${missing.join(', ')} — the deploy bundle cannot resolve them`, join(dir, 'package.json'), lines(`Add the missing package(s) to ${pkg.name ?? 'this package'}'s dependencies, e.g.:`, ...missing.map((n) => ` "${n}": "<version>"`), 'then reinstall. They import-resolve locally via tsconfig paths / root', 'hoisting, but esbuild/Bun.build resolves each package independently.'));
440
+ }
441
+ // @pikku/browser pins `puppeteer-core` to the exact version that
442
+ // @cloudflare/puppeteer forks, so headless rendering behaves identically
443
+ // locally and on Cloudflare Browser Rendering. A project using it must pin
444
+ // that same version, or its local/sandbox output diverges from deploy.
445
+ // (puppeteer-core, not puppeteer, so nothing ever downloads a Chromium.)
446
+ const usesBrowser = !!pkg.dependencies?.['@pikku/browser'] ||
447
+ !!pkg.devDependencies?.['@pikku/browser'];
448
+ if (usesBrowser) {
449
+ const browserPkg = await readJsonSafe(join(root, 'node_modules', '@pikku', 'browser', 'package.json'));
450
+ const required = browserPkg?.peerDependencies?.['puppeteer-core'];
451
+ const projectPin = pkg.dependencies?.['puppeteer-core'] ??
452
+ pkg.devDependencies?.['puppeteer-core'];
453
+ const slug = (pkg.name ?? dir).replace(/[@/]/g, '-');
454
+ if (required && !projectPin) {
455
+ w(`browser-puppeteer-missing-${slug}`, `${pkg.name ?? dir} depends on @pikku/browser but declares no puppeteer-core — LocalBrowserService will throw at runtime (local/sandbox/server rendering)`, join(dir, 'package.json'), `Add "puppeteer-core": "${required}" to run headless rendering off Cloudflare.`);
456
+ }
457
+ else if (required && projectPin && projectPin !== required) {
458
+ e(`browser-puppeteer-version-${slug}`, `${pkg.name ?? dir} pins puppeteer-core "${projectPin}" but @pikku/browser requires "${required}" — local rendering would diverge from Cloudflare Browser Rendering, which forks that exact version`, join(dir, 'package.json'), lines(`Set "puppeteer-core": "${required}" so headless rendering behaves`, 'identically locally and on deploy. Bump it in lockstep with', '@pikku/browser (which tracks @cloudflare/puppeteer) when it changes.'));
459
+ }
460
+ }
461
+ }
462
+ }
356
463
  // ── packages/functions/ ────────────────────────────────────────────────
357
464
  const fnDir = join(root, 'packages', 'functions');
358
465
  const functionsSdkPkgName = (await readJsonSafe(join(root, 'packages', 'functions-sdk', 'package.json')))?.name;
@@ -0,0 +1,5 @@
1
+ type AuditInput = {
2
+ outdated?: boolean;
3
+ };
4
+ export declare const pikkuAudit: import("#pikku").PikkuFunctionConfig<AuditInput, void, "rpc" | "session", import("#pikku").PikkuFunctionSessionless<AuditInput, void, "rpc" | "session", import("#pikku").Services> | import("#pikku").PikkuFunction<AuditInput, void, "rpc" | "session", import("#pikku").Services>, undefined, undefined>;
5
+ export {};
@@ -0,0 +1,165 @@
1
+ import { existsSync, mkdirSync, writeFileSync } from 'node:fs';
2
+ import { dirname, join } from 'node:path';
3
+ import { spawnSync } from 'node:child_process';
4
+ import { pikkuSessionlessFunc } from '#pikku';
5
+ const SCHEMA_VERSION = 1;
6
+ const SEVERITY_ORDER = ['critical', 'high', 'moderate', 'low', 'info'];
7
+ const stripAnsi = (s) => s.replace(/\x1b\[[0-9;]*m/g, '');
8
+ // Walk up from startDir to the nearest workspace root — the dir whose lockfile
9
+ // the package manager audits. Falls back to startDir.
10
+ function findProjectRoot(startDir) {
11
+ let dir = startDir;
12
+ for (let i = 0; i < 12; i++) {
13
+ if (existsSync(join(dir, 'bun.lock')) || existsSync(join(dir, 'bun.lockb')))
14
+ return { root: dir, pm: 'bun' };
15
+ if (existsSync(join(dir, 'pnpm-lock.yaml')))
16
+ return { root: dir, pm: 'pnpm' };
17
+ if (existsSync(join(dir, 'yarn.lock')))
18
+ return { root: dir, pm: 'yarn' };
19
+ if (existsSync(join(dir, 'package-lock.json')))
20
+ return { root: dir, pm: 'npm' };
21
+ const parent = dirname(dir);
22
+ if (parent === dir)
23
+ break;
24
+ dir = parent;
25
+ }
26
+ return { root: startDir, pm: 'unknown' };
27
+ }
28
+ function runBun(args, cwd) {
29
+ const res = spawnSync('bun', args, {
30
+ cwd,
31
+ encoding: 'utf8',
32
+ maxBuffer: 32 * 1024 * 1024,
33
+ env: { ...process.env, NO_COLOR: '1' },
34
+ });
35
+ // bun audit exits non-zero when advisories are found — the payload is still on
36
+ // stdout, so read it regardless of exit code.
37
+ return res.stdout || '';
38
+ }
39
+ function normaliseSeverity(sev) {
40
+ const s = String(sev ?? '').toLowerCase();
41
+ return SEVERITY_ORDER.includes(s) ? s : 'info';
42
+ }
43
+ // bun audit --json → { "<pkg>": [ { id, url, title, severity, vulnerable_versions, cwe[], cvss:{score} } ] }
44
+ function parseBunAudit(raw) {
45
+ const issues = [];
46
+ let obj;
47
+ try {
48
+ const start = raw.indexOf('{');
49
+ obj = start >= 0 ? JSON.parse(raw.slice(start)) : {};
50
+ }
51
+ catch {
52
+ return issues;
53
+ }
54
+ const map = obj && typeof obj.advisories === 'object' && obj.advisories ? obj.advisories : obj;
55
+ if (!map || typeof map !== 'object')
56
+ return issues;
57
+ for (const [pkg, list] of Object.entries(map)) {
58
+ const advisories = Array.isArray(list) ? list : [list];
59
+ for (const a of advisories) {
60
+ if (!a || typeof a !== 'object')
61
+ continue;
62
+ issues.push({
63
+ package: a.module_name || a.name || pkg,
64
+ severity: normaliseSeverity(a.severity),
65
+ title: String(a.title || a.overview || 'Vulnerability').slice(0, 300),
66
+ advisoryId: a.id != null ? String(a.id) : a.github_advisory_id || '',
67
+ url: a.url || a.advisory || '',
68
+ vulnerableVersions: a.vulnerable_versions || a.vulnerableVersions || '',
69
+ cwe: Array.isArray(a.cwe) ? a.cwe : a.cwe ? [String(a.cwe)] : [],
70
+ cvssScore: a.cvss && typeof a.cvss.score === 'number' && a.cvss.score > 0 ? a.cvss.score : null,
71
+ recommendedVersion: null,
72
+ });
73
+ }
74
+ }
75
+ return issues;
76
+ }
77
+ function semverLevel(current, latest) {
78
+ const c = String(current).replace(/^[^\d]*/, '').split('.').map((n) => parseInt(n, 10));
79
+ const l = String(latest).replace(/^[^\d]*/, '').split('.').map((n) => parseInt(n, 10));
80
+ if (Number.isNaN(c[0]) || Number.isNaN(l[0]))
81
+ return 'unknown';
82
+ if (l[0] > c[0])
83
+ return 'major';
84
+ if ((l[1] || 0) > (c[1] || 0))
85
+ return 'minor';
86
+ if ((l[2] || 0) > (c[2] || 0))
87
+ return 'patch';
88
+ return 'unknown';
89
+ }
90
+ // bun outdated has no --json; it prints a table: | Package | Current | Update | Latest |
91
+ function parseBunOutdated(raw) {
92
+ const updates = [];
93
+ const seen = new Set();
94
+ for (const line of stripAnsi(raw).split('\n')) {
95
+ if (!line.includes('|'))
96
+ continue;
97
+ const cells = line.split('|').map((c) => c.trim()).filter((c) => c.length > 0);
98
+ if (cells.length !== 4)
99
+ continue;
100
+ const [pkg, current, , latest] = cells;
101
+ if (pkg === 'Package' || /^-+$/.test(pkg))
102
+ continue;
103
+ if (!/^\d/.test(current) || !/^\d/.test(latest))
104
+ continue;
105
+ if (seen.has(pkg))
106
+ continue;
107
+ seen.add(pkg);
108
+ updates.push({ package: pkg, current, latest, level: semverLevel(current, latest) });
109
+ }
110
+ return updates;
111
+ }
112
+ function summarise(tool, issues, updates, note) {
113
+ issues.sort((a, b) => SEVERITY_ORDER.indexOf(a.severity) - SEVERITY_ORDER.indexOf(b.severity));
114
+ const count = (arr, key, val) => arr.filter((x) => x[key] === val).length;
115
+ return {
116
+ schemaVersion: SCHEMA_VERSION,
117
+ tool,
118
+ generatedAt: new Date().toISOString(),
119
+ ...(note ? { note } : {}),
120
+ issues,
121
+ updates,
122
+ summary: {
123
+ totalIssues: issues.length,
124
+ critical: count(issues, 'severity', 'critical'),
125
+ high: count(issues, 'severity', 'high'),
126
+ moderate: count(issues, 'severity', 'moderate'),
127
+ low: count(issues, 'severity', 'low'),
128
+ totalUpdates: updates.length,
129
+ major: count(updates, 'level', 'major'),
130
+ minor: count(updates, 'level', 'minor'),
131
+ patch: count(updates, 'level', 'patch'),
132
+ },
133
+ };
134
+ }
135
+ export const pikkuAudit = pikkuSessionlessFunc({
136
+ func: async ({ logger, config }, input) => {
137
+ const includeOutdated = input?.outdated === true;
138
+ const { root, pm } = findProjectRoot(config.rootDir);
139
+ let report;
140
+ if (pm === 'bun') {
141
+ const issues = parseBunAudit(runBun(['audit', '--json'], root));
142
+ const updates = includeOutdated ? parseBunOutdated(runBun(['outdated'], root)) : [];
143
+ const latestByPkg = new Map(updates.map((u) => [u.package, u.latest]));
144
+ for (const i of issues)
145
+ i.recommendedVersion = latestByPkg.get(i.package) ?? null;
146
+ report = summarise('bun', issues, updates);
147
+ }
148
+ else {
149
+ report = summarise(pm, [], [], `Security audit is not yet supported for the '${pm}' package manager — only bun is implemented.`);
150
+ }
151
+ const outFile = join(config.outDir, 'audit.json');
152
+ mkdirSync(dirname(outFile), { recursive: true });
153
+ writeFileSync(outFile, JSON.stringify(report, null, 2));
154
+ const { summary } = report;
155
+ if (report.note) {
156
+ logger.info(`pikku audit — ${report.note}`);
157
+ }
158
+ else {
159
+ logger.info(`pikku audit — ${summary.totalIssues} advisory(ies)` +
160
+ ` (${summary.critical} critical, ${summary.high} high, ${summary.moderate} moderate, ${summary.low} low)` +
161
+ (includeOutdated ? `, ${summary.totalUpdates} available update(s)` : ''));
162
+ }
163
+ logger.info(` → ${outFile}`);
164
+ },
165
+ });
@@ -1,5 +1,6 @@
1
1
  import { existsSync } from 'fs';
2
2
  import { pikkuWorkflowComplexFunc } from '#pikku/workflow/pikku-workflow-types.gen.js';
3
+ import { assertSingleCoreVersion } from '../../utils/assert-single-core-version.js';
3
4
  const scaffoldFiles = (config) => {
4
5
  const files = [];
5
6
  if (config.scaffold?.rpc && config.publicRpcFile)
@@ -24,6 +25,9 @@ const scaffoldFiles = (config) => {
24
25
  export const allWorkflow = pikkuWorkflowComplexFunc({
25
26
  title: 'Pikku All',
26
27
  func: async ({ logger, config, getInspectorState }, _data, { workflow }) => {
28
+ // Preflight: a split @pikku/core install silently breaks wiring registration
29
+ // (workflows/RPCs "disappear"), so refuse to codegen against it.
30
+ await assertSingleCoreVersion(config.rootDir, logger);
27
31
  const allImports = [];
28
32
  let typesDeclarationFileExists = true;
29
33
  if (!existsSync(config.outDir)) {
@@ -11,6 +11,7 @@ export declare const defaultCLIRenderer: import("@pikku/core/cli").CorePikkuCLIR
11
11
  logLevel?: LogLevel;
12
12
  secrets?: {};
13
13
  workflow?: import("@pikku/core/workflow").WorkflowServiceConfig;
14
+ postgres?: import("@pikku/core").PostgresConfig;
14
15
  }>, import("@pikku/core").CoreUserSession>;
15
16
  export declare const createConfig: CreateConfig<Config, [PikkuCLIConfig]>;
16
17
  /**
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Fail the build when more than one @pikku/core version is installed.
3
+ *
4
+ * A split @pikku/core means two separate module instances — and therefore two
5
+ * separate pikkuState registries — at runtime. Wirings (workflows, RPCs, queue
6
+ * workers, middleware) register into whichever copy the wiring files import,
7
+ * while the runner may read the other, so they silently fail to resolve (the
8
+ * classic symptom being `WorkflowNotFoundError` for a workflow that is plainly
9
+ * registered). Distinct versions are the reliable signal: package managers dedupe
10
+ * identical versions to one physical copy, so >1 version guarantees a split.
11
+ */
12
+ export declare function assertSingleCoreVersion(rootDir: string, logger: {
13
+ warn: (message: string) => void;
14
+ }): Promise<void>;
@@ -0,0 +1,80 @@
1
+ import { readFile } from 'node:fs/promises';
2
+ import { realpathSync } from 'node:fs';
3
+ import path from 'node:path';
4
+ import { glob } from 'tinyglobby';
5
+ import { ErrorCode } from '@pikku/inspector';
6
+ // Bounded globs (no unbounded `**`) covering the real @pikku/core copies each
7
+ // package manager keeps: hoisted root, bun (.bun), pnpm (.pnpm), and one level
8
+ // of npm/yarn nesting (both plain and scoped dependents).
9
+ const PATTERNS = [
10
+ '@pikku/core/package.json',
11
+ '.bun/@pikku+core@*/node_modules/@pikku/core/package.json',
12
+ '.pnpm/@pikku+core@*/node_modules/@pikku/core/package.json',
13
+ '*/node_modules/@pikku/core/package.json',
14
+ '@*/*/node_modules/@pikku/core/package.json',
15
+ ];
16
+ /**
17
+ * Fail the build when more than one @pikku/core version is installed.
18
+ *
19
+ * A split @pikku/core means two separate module instances — and therefore two
20
+ * separate pikkuState registries — at runtime. Wirings (workflows, RPCs, queue
21
+ * workers, middleware) register into whichever copy the wiring files import,
22
+ * while the runner may read the other, so they silently fail to resolve (the
23
+ * classic symptom being `WorkflowNotFoundError` for a workflow that is plainly
24
+ * registered). Distinct versions are the reliable signal: package managers dedupe
25
+ * identical versions to one physical copy, so >1 version guarantees a split.
26
+ */
27
+ export async function assertSingleCoreVersion(rootDir, logger) {
28
+ const nodeModules = path.join(path.resolve(rootDir), 'node_modules');
29
+ const found = await glob(PATTERNS, {
30
+ cwd: nodeModules,
31
+ absolute: true,
32
+ onlyFiles: true,
33
+ }).catch(() => []);
34
+ // Dedupe by real path (symlinks/hoisting surface the same copy many times),
35
+ // then map each physical copy to its version.
36
+ const byRealPath = new Map();
37
+ for (const pkgJsonPath of found) {
38
+ let real;
39
+ try {
40
+ real = realpathSync(pkgJsonPath);
41
+ }
42
+ catch {
43
+ real = pkgJsonPath;
44
+ }
45
+ if (byRealPath.has(real))
46
+ continue;
47
+ const raw = await readFile(pkgJsonPath, 'utf-8').catch(() => '');
48
+ if (!raw)
49
+ continue;
50
+ try {
51
+ const { version } = JSON.parse(raw);
52
+ if (typeof version === 'string')
53
+ byRealPath.set(real, version);
54
+ }
55
+ catch {
56
+ // Unparseable package.json can't contribute a version — skip it.
57
+ }
58
+ }
59
+ const versions = new Set(byRealPath.values());
60
+ if (versions.size <= 1)
61
+ return;
62
+ const found_ = [...byRealPath.entries()]
63
+ .sort((a, b) => a[1].localeCompare(b[1]))
64
+ .map(([p, v]) => ` ${v} ${path.dirname(p)}`)
65
+ .join('\n');
66
+ const message = `[${ErrorCode.DUPLICATE_CORE_VERSION}] Multiple @pikku/core versions installed: ${[...versions].sort().join(', ')}.\n` +
67
+ `A split @pikku/core means two separate pikkuState registries at runtime — wirings\n` +
68
+ `(workflows, RPCs, queue workers, middleware) register into one copy while the runner\n` +
69
+ `reads another, so they silently fail to resolve (e.g. WorkflowNotFoundError, missing\n` +
70
+ `RPCs). Every @pikku/* package must resolve to a single @pikku/core.\n\n` +
71
+ `Found:\n${found_}\n\n` +
72
+ `Fix: align all @pikku/* dependencies to the same release (bump them together), or pin\n` +
73
+ `@pikku/core via your package manager's overrides/resolutions, then reinstall so a\n` +
74
+ `single copy is deduped. Set PIKKU_ALLOW_DUPLICATE_CORE=1 to downgrade this to a warning.`;
75
+ if (process.env?.PIKKU_ALLOW_DUPLICATE_CORE) {
76
+ logger.warn(message);
77
+ return;
78
+ }
79
+ throw new Error(message);
80
+ }
@@ -1 +1 @@
1
- {"root":["../bin/pikku.ts","../src/cli.wiring.ts","../src/services.ts","../src/deploy/build-pipeline.ts","../src/deploy/provider-adapter.ts","../src/deploy/server-entry.ts","../src/deploy/analyzer/analyzer.ts","../src/deploy/analyzer/index.ts","../src/deploy/analyzer/manifest.ts","../src/deploy/bundler/bun-bundler.ts","../src/deploy/bundler/bundler.interface.ts","../src/deploy/bundler/bundler.ts","../src/deploy/bundler/dep-extractor.ts","../src/deploy/bundler/index.ts","../src/deploy/bundler/node-bundler.ts","../src/deploy/bundler/types.ts","../src/deploy/codegen/index.ts","../src/deploy/codegen/per-unit-codegen.ts","../src/deploy/plan/executor.ts","../src/deploy/plan/formatter.ts","../src/deploy/plan/index.ts","../src/deploy/plan/planner.ts","../src/deploy/plan/provider.ts","../src/deploy/plan/types.ts","../src/fabric/fabric-commands.ts","../src/fabric/functions/add.function.ts","../src/fabric/functions/addon-verify.function.ts","../src/fabric/functions/db-schema.function.ts","../src/fabric/functions/deploy-list.function.ts","../src/fabric/functions/deploy-units.function.ts","../src/fabric/functions/deploy.function.ts","../src/fabric/functions/domains-add.function.ts","../src/fabric/functions/domains-list.function.ts","../src/fabric/functions/domains-remove.function.ts","../src/fabric/functions/errors.function.ts","../src/fabric/functions/init.function.ts","../src/fabric/functions/link.function.ts","../src/fabric/functions/llm-key.function.ts","../src/fabric/functions/login.function.ts","../src/fabric/functions/logs.function.ts","../src/fabric/functions/metrics.function.ts","../src/fabric/functions/publish.function.ts","../src/fabric/functions/rollback.function.ts","../src/fabric/functions/secrets-list.function.ts","../src/fabric/functions/secrets-set.function.ts","../src/fabric/functions/smoke.function.ts","../src/fabric/functions/status.function.ts","../src/fabric/functions/trace.function.ts","../src/fabric/functions/validate.function.ts","../src/fabric/lib/config.ts","../src/fabric/lib/console-url.ts","../src/fabric/lib/git.ts","../src/fabric/lib/http.ts","../src/fabric/lib/not-implemented.ts","../src/fabric/lib/output.ts","../src/fabric/lib/prompt.ts","../src/fabric/lib/stage.ts","../src/fabric/sdk/http-map.gen.d.ts","../src/fabric/sdk/pikku-fetch.gen.ts","../src/fabric/sdk/pikku-rpc.gen.ts","../src/fabric/sdk/rpc-map.gen.d.ts","../src/functions/commands/all.ts","../src/functions/commands/binary.ts","../src/functions/commands/bootstrap.ts","../src/functions/commands/console.ts","../src/functions/commands/db-audit.ts","../src/functions/commands/db-generate.ts","../src/functions/commands/db-migrate.ts","../src/functions/commands/db-reset.ts","../src/functions/commands/db-seed.ts","../src/functions/commands/db-shared.ts","../src/functions/commands/deploy-apply.ts","../src/functions/commands/deploy-info.ts","../src/functions/commands/deploy-plan.ts","../src/functions/commands/dev-ai-runner.ts","../src/functions/commands/dev.ts","../src/functions/commands/emails-init.ts","../src/functions/commands/enable.ts","../src/functions/commands/info.ts","../src/functions/commands/load-user-project.ts","../src/functions/commands/login.ts","../src/functions/commands/meta.ts","../src/functions/commands/new-addon.ts","../src/functions/commands/new-function.ts","../src/functions/commands/new-middleware.ts","../src/functions/commands/new-permission.ts","../src/functions/commands/new-wiring.ts","../src/functions/commands/pikku-command-bootstrap.ts","../src/functions/commands/pikku-command-summary.ts","../src/functions/commands/serve-console.ts","../src/functions/commands/serve.ts","../src/functions/commands/skills.ts","../src/functions/commands/tests-coverage.ts","../src/functions/commands/tests-init.ts","../src/functions/commands/versions-check.ts","../src/functions/commands/versions-init.ts","../src/functions/commands/versions-update.ts","../src/functions/commands/watch.ts","../src/functions/commands/workspace-validate.ts","../src/functions/db/annotation-parser.ts","../src/functions/db/better-auth-schema.ts","../src/functions/db/coercion-plugin.ts","../src/functions/db/db-codegen.ts","../src/functions/db/db-introspector.ts","../src/functions/db/db-migrator.ts","../src/functions/db/local-db.ts","../src/functions/db/zod-codegen.ts","../src/functions/db/postgres/pglite-kysely.ts","../src/functions/db/postgres/postgres-introspector.ts","../src/functions/db/postgres/postgres-migrator.ts","../src/functions/db/sqlite/seed.ts","../src/functions/db/sqlite/sqlite-introspector.ts","../src/functions/db/sqlite/sqlite-kysely.ts","../src/functions/db/sqlite/sqlite-migrator.ts","../src/functions/db/sqlite/sqlite-runtime-bun.ts","../src/functions/db/sqlite/sqlite-runtime-node.ts","../src/functions/db/sqlite/sqlite-runtime.ts","../src/functions/runtimes/fetch/index.ts","../src/functions/runtimes/nextjs/pikku-command-nextjs.ts","../src/functions/runtimes/nextjs/serialize-nextjs-backend-worker-rpc-wrapper.ts","../src/functions/runtimes/nextjs/serialize-nextjs-backend-wrapper.ts","../src/functions/runtimes/nextjs/serialize-nextjs-http-wrapper.ts","../src/functions/runtimes/tanstack-start/pikku-command-tanstack-start.ts","../src/functions/runtimes/tanstack-start/serialize-tanstack-start-shim.ts","../src/functions/runtimes/websocket/pikku-command-websocket-typed.ts","../src/functions/runtimes/websocket/serialize-websocket-wrapper.ts","../src/functions/validate/workspace-validate.ts","../src/functions/wirings/ai-agent/pikku-command-ai-agent-types.ts","../src/functions/wirings/ai-agent/pikku-command-ai-agent.ts","../src/functions/wirings/ai-agent/pikku-command-public-agent.ts","../src/functions/wirings/ai-agent/serialize-agent-map.ts","../src/functions/wirings/ai-agent/serialize-ai-agent-types.ts","../src/functions/wirings/ai-agent/serialize-public-agent.ts","../src/functions/wirings/auth/pikku-command-auth.ts","../src/functions/wirings/auth/serialize-auth-gen.ts","../src/functions/wirings/auth/serialize-auth-meta.ts","../src/functions/wirings/auth/serialize-auth-types.ts","../src/functions/wirings/channels/pikku-channels.ts","../src/functions/wirings/channels/pikku-command-channel-types.ts","../src/functions/wirings/channels/pikku-command-channels-map.ts","../src/functions/wirings/channels/pikku-command-channels.ts","../src/functions/wirings/channels/serialize-channel-types.ts","../src/functions/wirings/channels/serialize-typed-channel-map.ts","../src/functions/wirings/cli/pikku-command-cli-entry.ts","../src/functions/wirings/cli/pikku-command-cli-types.ts","../src/functions/wirings/cli/pikku-command-cli.ts","../src/functions/wirings/cli/serialize-channel-cli-client.ts","../src/functions/wirings/cli/serialize-channel-cli.ts","../src/functions/wirings/cli/serialize-cli-types.ts","../src/functions/wirings/cli/serialize-local-cli-bootstrap.ts","../src/functions/wirings/console/pikku-command-console-functions.ts","../src/functions/wirings/console/pikku-command-node-types.ts","../src/functions/wirings/console/pikku-command-nodes-meta.ts","../src/functions/wirings/console/serialize-console-functions.ts","../src/functions/wirings/console/serialize-node-types.ts","../src/functions/wirings/credentials/pikku-command-credentials.ts","../src/functions/wirings/credentials/serialize-credentials-types.ts","../src/functions/wirings/emails/pikku-command-emails.ts","../src/functions/wirings/emails/serialize-emails.ts","../src/functions/wirings/functions/pikku-command-addon-types.ts","../src/functions/wirings/functions/pikku-command-function-types-split.ts","../src/functions/wirings/functions/pikku-command-function-types.ts","../src/functions/wirings/functions/pikku-command-functions.ts","../src/functions/wirings/functions/pikku-command-services.ts","../src/functions/wirings/functions/schemas.ts","../src/functions/wirings/functions/serialize-addon-refs.ts","../src/functions/wirings/functions/serialize-addon-types.ts","../src/functions/wirings/functions/serialize-function-imports.ts","../src/functions/wirings/functions/serialize-function-types.ts","../src/functions/wirings/functions/serialize-pikku-types-hub.ts","../src/functions/wirings/gateway/pikku-command-gateway.ts","../src/functions/wirings/gateway/serialize-gateway-meta.ts","../src/functions/wirings/http/pikku-command-http-map.ts","../src/functions/wirings/http/pikku-command-http-routes.ts","../src/functions/wirings/http/pikku-command-http-types.ts","../src/functions/wirings/http/pikku-command-openapi.ts","../src/functions/wirings/http/pikku-http-routes.ts","../src/functions/wirings/http/serialize-fetch-wrapper.ts","../src/functions/wirings/http/serialize-http-types.ts","../src/functions/wirings/http/serialize-typed-http-map.ts","../src/functions/wirings/mcp/pikku-command-mcp-json.ts","../src/functions/wirings/mcp/pikku-command-mcp-types.ts","../src/functions/wirings/mcp/pikku-command-mcp.ts","../src/functions/wirings/mcp/serialize-mcp-types.ts","../src/functions/wirings/middleware/pikku-command-middleware.ts","../src/functions/wirings/middleware/serialize-middleware-imports.ts","../src/functions/wirings/package/pikku-command-package-types.ts","../src/functions/wirings/package/pikku-command-package.ts","../src/functions/wirings/package/serialize-package-types.ts","../src/functions/wirings/package/serialize-package.ts","../src/functions/wirings/permissions/pikku-command-permissions.ts","../src/functions/wirings/permissions/serialize-permissions-imports.ts","../src/functions/wirings/queue/pikku-command-queue-map.ts","../src/functions/wirings/queue/pikku-command-queue-service.ts","../src/functions/wirings/queue/pikku-command-queue-types.ts","../src/functions/wirings/queue/pikku-command-queue.ts","../src/functions/wirings/queue/pikku-queue-map.ts","../src/functions/wirings/queue/pikku-queue.ts","../src/functions/wirings/queue/serialize-queue-map.ts","../src/functions/wirings/queue/serialize-queue-meta.ts","../src/functions/wirings/queue/serialize-queue-types.ts","../src/functions/wirings/queue/serialize-queue-wrapper.ts","../src/functions/wirings/realtime/pikku-command-events-scaffold.ts","../src/functions/wirings/realtime/pikku-command-realtime.ts","../src/functions/wirings/realtime/serialize-events-scaffold.ts","../src/functions/wirings/realtime/serialize-realtime-client.ts","../src/functions/wirings/rpc/pikku-command-public-rpc.ts","../src/functions/wirings/rpc/pikku-command-react-query.ts","../src/functions/wirings/rpc/pikku-command-remote-rpc.ts","../src/functions/wirings/rpc/pikku-command-rpc-client.ts","../src/functions/wirings/rpc/pikku-command-rpc-map.ts","../src/functions/wirings/rpc/pikku-command-rpc.ts","../src/functions/wirings/rpc/serialize-public-rpc.ts","../src/functions/wirings/rpc/serialize-react-query-hooks.ts","../src/functions/wirings/rpc/serialize-remote-rpc.ts","../src/functions/wirings/rpc/serialize-rpc-wrapper.ts","../src/functions/wirings/rpc/serialize-typed-rpc-map.ts","../src/functions/wirings/scheduler/pikku-command-scheduler-types.ts","../src/functions/wirings/scheduler/pikku-command-scheduler.ts","../src/functions/wirings/scheduler/serialize-scheduler-meta.ts","../src/functions/wirings/scheduler/serialize-scheduler-types.ts","../src/functions/wirings/secrets/pikku-command-secrets.ts","../src/functions/wirings/secrets/serialize-secrets-types.ts","../src/functions/wirings/triggers/pikku-command-trigger-types.ts","../src/functions/wirings/triggers/pikku-command-trigger.ts","../src/functions/wirings/triggers/serialize-trigger-meta.ts","../src/functions/wirings/triggers/serialize-trigger-types.ts","../src/functions/wirings/variables/pikku-command-variables.ts","../src/functions/wirings/variables/serialize-variables-types.ts","../src/functions/wirings/workflow/pikku-command-workflow-routes.ts","../src/functions/wirings/workflow/pikku-command-workflow.ts","../src/functions/wirings/workflow/serialize-workflow-bootstrap-map.ts","../src/functions/wirings/workflow/serialize-workflow-map.ts","../src/functions/wirings/workflow/serialize-workflow-meta.ts","../src/functions/wirings/workflow/serialize-workflow-registration.ts","../src/functions/wirings/workflow/serialize-workflow-routes.ts","../src/functions/wirings/workflow/serialize-workflow-types.ts","../src/functions/workflows/all.workflow.ts","../src/middleware/log-command-info-and-time.ts","../src/scaffold/rpc-remote.gen.ts","../src/server/bun-server-runner.ts","../src/server/dev-server-runner.interface.ts","../src/server/node-server-runner.ts","../src/services/cli-logger-forwarder.service.ts","../src/services/cli-logger.service.ts","../src/utils/check-required-types.ts","../src/utils/cli-session.ts","../src/utils/command-summary.ts","../src/utils/contract-versions.ts","../src/utils/detect-better-auth.ts","../src/utils/device-auth.ts","../src/utils/file-import-path.ts","../src/utils/file-imports-serializer.ts","../src/utils/file-writer.ts","../src/utils/generate-bootstrap-file.ts","../src/utils/get-cli-version.ts","../src/utils/parse-cli-filters.ts","../src/utils/pikku-cli-config.ts","../src/utils/pikku-files-and-methods.ts","../src/utils/serialize-import-map.ts","../src/utils/serialize-meta-ts.ts","../src/utils/serialize-schemas.ts","../src/utils/strip-verbose-meta.ts","../.pikku/pikku-bootstrap.gen.ts","../.pikku/pikku-meta-service.gen.ts","../.pikku/pikku-services.gen.ts","../.pikku/pikku-types.gen.ts","../.pikku/agent/pikku-agent-map.gen.d.ts","../.pikku/agent/pikku-agent-types.gen.ts","../.pikku/channel/pikku-channel-types.gen.ts","../.pikku/cli/pikku-cli-channel.ts","../.pikku/cli/pikku-cli-client.gen.ts","../.pikku/cli/pikku-cli-contracts-meta.gen.ts","../.pikku/cli/pikku-cli-types.gen.ts","../.pikku/cli/pikku-cli-wirings-meta.gen.ts","../.pikku/cli/pikku-cli-wirings.gen.ts","../.pikku/cli/pikku-cli.gen.ts","../.pikku/console/pikku-node-types.gen.ts","../.pikku/function/pikku-function-types.gen.ts","../.pikku/function/pikku-functions-meta.gen.ts","../.pikku/function/pikku-functions.gen.ts","../.pikku/http/pikku-http-types.gen.ts","../.pikku/http/pikku-http-wirings-map.gen.d.ts","../.pikku/http/pikku-http-wirings-meta.gen.ts","../.pikku/http/pikku-http-wirings.gen.ts","../.pikku/mcp/pikku-mcp-types.gen.ts","../.pikku/node/pikku-node-types.gen.ts","../.pikku/queue/pikku-queue-types.gen.ts","../.pikku/queue/pikku-queue-workers-wirings-map.gen.d.ts","../.pikku/queue/pikku-queue-workers-wirings-meta.gen.ts","../.pikku/queue/pikku-queue-workers-wirings.gen.ts","../.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts","../.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts","../.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.ts","../.pikku/scheduler/pikku-scheduler-types.gen.ts","../.pikku/schemas/register.gen.ts","../.pikku/secrets/pikku-secret-types.gen.ts","../.pikku/secrets/pikku-secrets.gen.ts","../.pikku/trigger/pikku-trigger-types.gen.ts","../.pikku/variables/pikku-variable-types.gen.ts","../.pikku/variables/pikku-variables.gen.ts","../.pikku/workflow/pikku-workflow-map.gen.d.ts","../.pikku/workflow/pikku-workflow-types.gen.ts","../.pikku/workflow/pikku-workflow-wirings-meta.gen.ts","../.pikku/workflow/pikku-workflow-wirings.gen.ts","../types/application-types.d.ts","../types/bun-sqlite.d.ts","../types/config.d.ts"],"version":"5.9.3"}
1
+ {"root":["../bin/pikku.ts","../src/cli.wiring.ts","../src/services.ts","../src/deploy/build-pipeline.ts","../src/deploy/provider-adapter.ts","../src/deploy/server-entry.ts","../src/deploy/analyzer/analyzer.ts","../src/deploy/analyzer/index.ts","../src/deploy/analyzer/manifest.ts","../src/deploy/bundler/bun-bundler.ts","../src/deploy/bundler/bundler.interface.ts","../src/deploy/bundler/bundler.ts","../src/deploy/bundler/dep-extractor.ts","../src/deploy/bundler/index.ts","../src/deploy/bundler/node-bundler.ts","../src/deploy/bundler/types.ts","../src/deploy/codegen/index.ts","../src/deploy/codegen/per-unit-codegen.ts","../src/deploy/plan/executor.ts","../src/deploy/plan/formatter.ts","../src/deploy/plan/index.ts","../src/deploy/plan/planner.ts","../src/deploy/plan/provider.ts","../src/deploy/plan/types.ts","../src/fabric/fabric-commands.ts","../src/fabric/functions/add.function.ts","../src/fabric/functions/addon-verify.function.ts","../src/fabric/functions/db-schema.function.ts","../src/fabric/functions/deploy-list.function.ts","../src/fabric/functions/deploy-units.function.ts","../src/fabric/functions/deploy.function.ts","../src/fabric/functions/domains-add.function.ts","../src/fabric/functions/domains-list.function.ts","../src/fabric/functions/domains-remove.function.ts","../src/fabric/functions/errors.function.ts","../src/fabric/functions/init.function.ts","../src/fabric/functions/link.function.ts","../src/fabric/functions/llm-key.function.ts","../src/fabric/functions/login.function.ts","../src/fabric/functions/logs.function.ts","../src/fabric/functions/metrics.function.ts","../src/fabric/functions/publish.function.ts","../src/fabric/functions/rollback.function.ts","../src/fabric/functions/secrets-list.function.ts","../src/fabric/functions/secrets-set.function.ts","../src/fabric/functions/smoke.function.ts","../src/fabric/functions/status.function.ts","../src/fabric/functions/trace.function.ts","../src/fabric/functions/validate.function.ts","../src/fabric/lib/config.ts","../src/fabric/lib/console-url.ts","../src/fabric/lib/git.ts","../src/fabric/lib/http.ts","../src/fabric/lib/not-implemented.ts","../src/fabric/lib/output.ts","../src/fabric/lib/prompt.ts","../src/fabric/lib/stage.ts","../src/fabric/sdk/http-map.gen.d.ts","../src/fabric/sdk/pikku-fetch.gen.ts","../src/fabric/sdk/pikku-rpc.gen.ts","../src/fabric/sdk/rpc-map.gen.d.ts","../src/functions/commands/all.ts","../src/functions/commands/audit.ts","../src/functions/commands/binary.ts","../src/functions/commands/bootstrap.ts","../src/functions/commands/console.ts","../src/functions/commands/db-audit.ts","../src/functions/commands/db-generate.ts","../src/functions/commands/db-migrate.ts","../src/functions/commands/db-reset.ts","../src/functions/commands/db-seed.ts","../src/functions/commands/db-shared.ts","../src/functions/commands/deploy-apply.ts","../src/functions/commands/deploy-info.ts","../src/functions/commands/deploy-plan.ts","../src/functions/commands/dev-ai-runner.ts","../src/functions/commands/dev.ts","../src/functions/commands/emails-init.ts","../src/functions/commands/enable.ts","../src/functions/commands/info.ts","../src/functions/commands/load-user-project.ts","../src/functions/commands/login.ts","../src/functions/commands/meta.ts","../src/functions/commands/new-addon.ts","../src/functions/commands/new-function.ts","../src/functions/commands/new-middleware.ts","../src/functions/commands/new-permission.ts","../src/functions/commands/new-wiring.ts","../src/functions/commands/pikku-command-bootstrap.ts","../src/functions/commands/pikku-command-summary.ts","../src/functions/commands/serve-console.ts","../src/functions/commands/serve.ts","../src/functions/commands/skills.ts","../src/functions/commands/tests-coverage.ts","../src/functions/commands/tests-init.ts","../src/functions/commands/versions-check.ts","../src/functions/commands/versions-init.ts","../src/functions/commands/versions-update.ts","../src/functions/commands/watch.ts","../src/functions/commands/workspace-validate.ts","../src/functions/db/annotation-parser.ts","../src/functions/db/better-auth-schema.ts","../src/functions/db/coercion-plugin.ts","../src/functions/db/db-codegen.ts","../src/functions/db/db-introspector.ts","../src/functions/db/db-migrator.ts","../src/functions/db/local-db.ts","../src/functions/db/zod-codegen.ts","../src/functions/db/postgres/pglite-kysely.ts","../src/functions/db/postgres/postgres-introspector.ts","../src/functions/db/postgres/postgres-migrator.ts","../src/functions/db/sqlite/seed.ts","../src/functions/db/sqlite/sqlite-introspector.ts","../src/functions/db/sqlite/sqlite-kysely.ts","../src/functions/db/sqlite/sqlite-migrator.ts","../src/functions/db/sqlite/sqlite-runtime-bun.ts","../src/functions/db/sqlite/sqlite-runtime-node.ts","../src/functions/db/sqlite/sqlite-runtime.ts","../src/functions/runtimes/fetch/index.ts","../src/functions/runtimes/nextjs/pikku-command-nextjs.ts","../src/functions/runtimes/nextjs/serialize-nextjs-backend-worker-rpc-wrapper.ts","../src/functions/runtimes/nextjs/serialize-nextjs-backend-wrapper.ts","../src/functions/runtimes/nextjs/serialize-nextjs-http-wrapper.ts","../src/functions/runtimes/tanstack-start/pikku-command-tanstack-start.ts","../src/functions/runtimes/tanstack-start/serialize-tanstack-start-shim.ts","../src/functions/runtimes/websocket/pikku-command-websocket-typed.ts","../src/functions/runtimes/websocket/serialize-websocket-wrapper.ts","../src/functions/validate/workspace-validate.ts","../src/functions/wirings/ai-agent/pikku-command-ai-agent-types.ts","../src/functions/wirings/ai-agent/pikku-command-ai-agent.ts","../src/functions/wirings/ai-agent/pikku-command-public-agent.ts","../src/functions/wirings/ai-agent/serialize-agent-map.ts","../src/functions/wirings/ai-agent/serialize-ai-agent-types.ts","../src/functions/wirings/ai-agent/serialize-public-agent.ts","../src/functions/wirings/auth/pikku-command-auth.ts","../src/functions/wirings/auth/serialize-auth-gen.ts","../src/functions/wirings/auth/serialize-auth-meta.ts","../src/functions/wirings/auth/serialize-auth-types.ts","../src/functions/wirings/channels/pikku-channels.ts","../src/functions/wirings/channels/pikku-command-channel-types.ts","../src/functions/wirings/channels/pikku-command-channels-map.ts","../src/functions/wirings/channels/pikku-command-channels.ts","../src/functions/wirings/channels/serialize-channel-types.ts","../src/functions/wirings/channels/serialize-typed-channel-map.ts","../src/functions/wirings/cli/pikku-command-cli-entry.ts","../src/functions/wirings/cli/pikku-command-cli-types.ts","../src/functions/wirings/cli/pikku-command-cli.ts","../src/functions/wirings/cli/serialize-channel-cli-client.ts","../src/functions/wirings/cli/serialize-channel-cli.ts","../src/functions/wirings/cli/serialize-cli-types.ts","../src/functions/wirings/cli/serialize-local-cli-bootstrap.ts","../src/functions/wirings/console/pikku-command-console-functions.ts","../src/functions/wirings/console/pikku-command-node-types.ts","../src/functions/wirings/console/pikku-command-nodes-meta.ts","../src/functions/wirings/console/serialize-console-functions.ts","../src/functions/wirings/console/serialize-node-types.ts","../src/functions/wirings/credentials/pikku-command-credentials.ts","../src/functions/wirings/credentials/serialize-credentials-types.ts","../src/functions/wirings/emails/pikku-command-emails.ts","../src/functions/wirings/emails/serialize-emails.ts","../src/functions/wirings/functions/pikku-command-addon-types.ts","../src/functions/wirings/functions/pikku-command-function-types-split.ts","../src/functions/wirings/functions/pikku-command-function-types.ts","../src/functions/wirings/functions/pikku-command-functions.ts","../src/functions/wirings/functions/pikku-command-services.ts","../src/functions/wirings/functions/schemas.ts","../src/functions/wirings/functions/serialize-addon-refs.ts","../src/functions/wirings/functions/serialize-addon-types.ts","../src/functions/wirings/functions/serialize-function-imports.ts","../src/functions/wirings/functions/serialize-function-types.ts","../src/functions/wirings/functions/serialize-pikku-types-hub.ts","../src/functions/wirings/gateway/pikku-command-gateway.ts","../src/functions/wirings/gateway/serialize-gateway-meta.ts","../src/functions/wirings/http/pikku-command-http-map.ts","../src/functions/wirings/http/pikku-command-http-routes.ts","../src/functions/wirings/http/pikku-command-http-types.ts","../src/functions/wirings/http/pikku-command-openapi.ts","../src/functions/wirings/http/pikku-http-routes.ts","../src/functions/wirings/http/serialize-fetch-wrapper.ts","../src/functions/wirings/http/serialize-http-types.ts","../src/functions/wirings/http/serialize-typed-http-map.ts","../src/functions/wirings/mcp/pikku-command-mcp-json.ts","../src/functions/wirings/mcp/pikku-command-mcp-types.ts","../src/functions/wirings/mcp/pikku-command-mcp.ts","../src/functions/wirings/mcp/serialize-mcp-types.ts","../src/functions/wirings/middleware/pikku-command-middleware.ts","../src/functions/wirings/middleware/serialize-middleware-imports.ts","../src/functions/wirings/package/pikku-command-package-types.ts","../src/functions/wirings/package/pikku-command-package.ts","../src/functions/wirings/package/serialize-package-types.ts","../src/functions/wirings/package/serialize-package.ts","../src/functions/wirings/permissions/pikku-command-permissions.ts","../src/functions/wirings/permissions/serialize-permissions-imports.ts","../src/functions/wirings/queue/pikku-command-queue-map.ts","../src/functions/wirings/queue/pikku-command-queue-service.ts","../src/functions/wirings/queue/pikku-command-queue-types.ts","../src/functions/wirings/queue/pikku-command-queue.ts","../src/functions/wirings/queue/pikku-queue-map.ts","../src/functions/wirings/queue/pikku-queue.ts","../src/functions/wirings/queue/serialize-queue-map.ts","../src/functions/wirings/queue/serialize-queue-meta.ts","../src/functions/wirings/queue/serialize-queue-types.ts","../src/functions/wirings/queue/serialize-queue-wrapper.ts","../src/functions/wirings/realtime/pikku-command-events-scaffold.ts","../src/functions/wirings/realtime/pikku-command-realtime.ts","../src/functions/wirings/realtime/serialize-events-scaffold.ts","../src/functions/wirings/realtime/serialize-realtime-client.ts","../src/functions/wirings/rpc/pikku-command-public-rpc.ts","../src/functions/wirings/rpc/pikku-command-react-query.ts","../src/functions/wirings/rpc/pikku-command-remote-rpc.ts","../src/functions/wirings/rpc/pikku-command-rpc-client.ts","../src/functions/wirings/rpc/pikku-command-rpc-map.ts","../src/functions/wirings/rpc/pikku-command-rpc.ts","../src/functions/wirings/rpc/serialize-public-rpc.ts","../src/functions/wirings/rpc/serialize-react-query-hooks.ts","../src/functions/wirings/rpc/serialize-remote-rpc.ts","../src/functions/wirings/rpc/serialize-rpc-wrapper.ts","../src/functions/wirings/rpc/serialize-typed-rpc-map.ts","../src/functions/wirings/scheduler/pikku-command-scheduler-types.ts","../src/functions/wirings/scheduler/pikku-command-scheduler.ts","../src/functions/wirings/scheduler/serialize-scheduler-meta.ts","../src/functions/wirings/scheduler/serialize-scheduler-types.ts","../src/functions/wirings/secrets/pikku-command-secrets.ts","../src/functions/wirings/secrets/serialize-secrets-types.ts","../src/functions/wirings/triggers/pikku-command-trigger-types.ts","../src/functions/wirings/triggers/pikku-command-trigger.ts","../src/functions/wirings/triggers/serialize-trigger-meta.ts","../src/functions/wirings/triggers/serialize-trigger-types.ts","../src/functions/wirings/variables/pikku-command-variables.ts","../src/functions/wirings/variables/serialize-variables-types.ts","../src/functions/wirings/workflow/pikku-command-workflow-routes.ts","../src/functions/wirings/workflow/pikku-command-workflow.ts","../src/functions/wirings/workflow/serialize-workflow-bootstrap-map.ts","../src/functions/wirings/workflow/serialize-workflow-map.ts","../src/functions/wirings/workflow/serialize-workflow-meta.ts","../src/functions/wirings/workflow/serialize-workflow-registration.ts","../src/functions/wirings/workflow/serialize-workflow-routes.ts","../src/functions/wirings/workflow/serialize-workflow-types.ts","../src/functions/workflows/all.workflow.ts","../src/middleware/log-command-info-and-time.ts","../src/scaffold/rpc-remote.gen.ts","../src/server/bun-server-runner.ts","../src/server/dev-server-runner.interface.ts","../src/server/node-server-runner.ts","../src/services/cli-logger-forwarder.service.ts","../src/services/cli-logger.service.ts","../src/utils/assert-single-core-version.ts","../src/utils/check-required-types.ts","../src/utils/cli-session.ts","../src/utils/command-summary.ts","../src/utils/contract-versions.ts","../src/utils/detect-better-auth.ts","../src/utils/device-auth.ts","../src/utils/file-import-path.ts","../src/utils/file-imports-serializer.ts","../src/utils/file-writer.ts","../src/utils/generate-bootstrap-file.ts","../src/utils/get-cli-version.ts","../src/utils/parse-cli-filters.ts","../src/utils/pikku-cli-config.ts","../src/utils/pikku-files-and-methods.ts","../src/utils/serialize-import-map.ts","../src/utils/serialize-meta-ts.ts","../src/utils/serialize-schemas.ts","../src/utils/strip-verbose-meta.ts","../.pikku/pikku-bootstrap.gen.ts","../.pikku/pikku-meta-service.gen.ts","../.pikku/pikku-services.gen.ts","../.pikku/pikku-types.gen.ts","../.pikku/agent/pikku-agent-map.gen.d.ts","../.pikku/agent/pikku-agent-types.gen.ts","../.pikku/channel/pikku-channel-types.gen.ts","../.pikku/cli/pikku-cli-channel.ts","../.pikku/cli/pikku-cli-client.gen.ts","../.pikku/cli/pikku-cli-contracts-meta.gen.ts","../.pikku/cli/pikku-cli-types.gen.ts","../.pikku/cli/pikku-cli-wirings-meta.gen.ts","../.pikku/cli/pikku-cli-wirings.gen.ts","../.pikku/cli/pikku-cli.gen.ts","../.pikku/console/pikku-node-types.gen.ts","../.pikku/function/pikku-function-types.gen.ts","../.pikku/function/pikku-functions-meta.gen.ts","../.pikku/function/pikku-functions.gen.ts","../.pikku/http/pikku-http-types.gen.ts","../.pikku/http/pikku-http-wirings-map.gen.d.ts","../.pikku/http/pikku-http-wirings-meta.gen.ts","../.pikku/http/pikku-http-wirings.gen.ts","../.pikku/mcp/pikku-mcp-types.gen.ts","../.pikku/node/pikku-node-types.gen.ts","../.pikku/queue/pikku-queue-types.gen.ts","../.pikku/queue/pikku-queue-workers-wirings-map.gen.d.ts","../.pikku/queue/pikku-queue-workers-wirings-meta.gen.ts","../.pikku/queue/pikku-queue-workers-wirings.gen.ts","../.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts","../.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts","../.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.ts","../.pikku/scheduler/pikku-scheduler-types.gen.ts","../.pikku/schemas/register.gen.ts","../.pikku/secrets/pikku-secret-types.gen.ts","../.pikku/secrets/pikku-secrets.gen.ts","../.pikku/trigger/pikku-trigger-types.gen.ts","../.pikku/variables/pikku-variable-types.gen.ts","../.pikku/variables/pikku-variables.gen.ts","../.pikku/workflow/pikku-workflow-map.gen.d.ts","../.pikku/workflow/pikku-workflow-types.gen.ts","../.pikku/workflow/pikku-workflow-wirings-meta.gen.ts","../.pikku/workflow/pikku-workflow-wirings.gen.ts","../types/application-types.d.ts","../types/bun-sqlite.d.ts","../types/config.d.ts"],"version":"6.0.3"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pikku/cli",
3
- "version": "0.12.59",
3
+ "version": "0.12.62",
4
4
  "author": "yasser.fadl@gmail.com",
5
5
  "license": "BUSL-1.1",
6
6
  "imports": {
@@ -27,18 +27,18 @@
27
27
  "dependencies": {
28
28
  "@electric-sql/pglite": "^0.5.1",
29
29
  "@openapi-contrib/json-schema-to-openapi-schema": "^4.3.1",
30
- "@pikku/better-auth": "^0.12.12",
31
- "@pikku/bun-server": "^0.12.1",
32
- "@pikku/core": "^0.12.42",
33
- "@pikku/deploy-cloudflare": "^0.12.6",
34
- "@pikku/fetch": "^0.12.5",
35
- "@pikku/inspector": "^0.12.29",
36
- "@pikku/kysely": "^0.12.18",
37
- "@pikku/kysely-node-sqlite": "^0.12.2",
38
- "@pikku/node-http-server": "^0.12.3",
39
- "@pikku/openapi-parser": "^0.12.10",
40
- "@pikku/schedule": "^0.12.0",
41
- "@pikku/ws": "^0.12.2",
30
+ "@pikku/better-auth": "^0.12.13",
31
+ "@pikku/bun-server": "^0.12.2",
32
+ "@pikku/core": "^0.12.45",
33
+ "@pikku/deploy-cloudflare": "^0.12.8",
34
+ "@pikku/fetch": "^0.12.6",
35
+ "@pikku/inspector": "^0.12.31",
36
+ "@pikku/kysely": "^0.13.0",
37
+ "@pikku/kysely-node-sqlite": "^0.12.3",
38
+ "@pikku/node-http-server": "^0.12.4",
39
+ "@pikku/openapi-parser": "^0.12.11",
40
+ "@pikku/schedule": "^0.12.3",
41
+ "@pikku/ws": "^0.12.3",
42
42
  "@types/cookie": "^1.0.0",
43
43
  "@types/json-schema": "^7.0.15",
44
44
  "chalk": "^5.6.2",
@@ -49,13 +49,13 @@
49
49
  "path-to-regexp": "^8.3.0",
50
50
  "pg": "^8.13.0",
51
51
  "tinyglobby": "^0.2.12",
52
- "ts-json-schema-generator": "^2.5.0",
52
+ "ts-json-schema-generator": "2.9.1-next.16",
53
53
  "tsx": "^4.21.0",
54
- "typescript": "^5.9",
54
+ "typescript": "^6.0.3",
55
55
  "ws": "^8.18.0",
56
56
  "yaml": "^2.8.2",
57
57
  "zod": "^4.3.6",
58
- "zod-to-ts": "^2.0.0"
58
+ "zod-to-ts": "^2.1.0"
59
59
  },
60
60
  "devDependencies": {
61
61
  "@types/node": "^24.11.0",
@@ -69,7 +69,7 @@
69
69
  "cli.schema.json"
70
70
  ],
71
71
  "engines": {
72
- "node": ">=18"
72
+ "node": ">=22"
73
73
  },
74
74
  "exports": {
75
75
  ".": "./dist/bin/pikku.js"