@pikku/cli 0.12.68 → 0.12.70

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 (106) hide show
  1. package/cli.schema.json +1 -1
  2. package/console-app/assets/{index-CttM2Aiz.js → index-BY60UXB6.js} +132 -132
  3. package/console-app/index.html +2 -2
  4. package/dist/.pikku/agent/pikku-agent-types.gen.d.ts +1 -1
  5. package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +1 -1
  6. package/dist/.pikku/channel/pikku-channel-types.gen.js +1 -1
  7. package/dist/.pikku/cli/pikku-cli-channel.js +7 -12
  8. package/dist/.pikku/cli/pikku-cli-client.gen.d.ts +1 -1
  9. package/dist/.pikku/cli/pikku-cli-client.gen.js +1 -1
  10. package/dist/.pikku/cli/pikku-cli-contracts-meta.gen.d.ts +1 -1
  11. package/dist/.pikku/cli/pikku-cli-contracts-meta.gen.js +1 -1
  12. package/dist/.pikku/cli/pikku-cli-types.gen.d.ts +1 -1
  13. package/dist/.pikku/cli/pikku-cli-types.gen.js +1 -1
  14. package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.js +1 -1
  15. package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.json +23 -30
  16. package/dist/.pikku/cli/pikku-cli-wirings.gen.d.ts +1 -1
  17. package/dist/.pikku/cli/pikku-cli-wirings.gen.js +1 -1
  18. package/dist/.pikku/cli/pikku-cli.gen.d.ts +1 -1
  19. package/dist/.pikku/cli/pikku-cli.gen.js +1 -1
  20. package/dist/.pikku/console/pikku-node-types.gen.d.ts +1 -1
  21. package/dist/.pikku/function/pikku-function-types.gen.d.ts +1 -1
  22. package/dist/.pikku/function/pikku-function-types.gen.js +1 -1
  23. package/dist/.pikku/function/pikku-functions-meta.gen.js +1 -1
  24. package/dist/.pikku/function/pikku-functions-meta.gen.json +39 -54
  25. package/dist/.pikku/function/pikku-functions.gen.js +1 -3
  26. package/dist/.pikku/http/pikku-http-types.gen.d.ts +1 -1
  27. package/dist/.pikku/http/pikku-http-types.gen.js +1 -1
  28. package/dist/.pikku/http/pikku-http-wirings-meta.gen.js +1 -1
  29. package/dist/.pikku/http/pikku-http-wirings.gen.d.ts +1 -1
  30. package/dist/.pikku/http/pikku-http-wirings.gen.js +1 -1
  31. package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts +1 -1
  32. package/dist/.pikku/mcp/pikku-mcp-types.gen.js +1 -1
  33. package/dist/.pikku/pikku-bootstrap.gen.d.ts +1 -1
  34. package/dist/.pikku/pikku-bootstrap.gen.js +1 -1
  35. package/dist/.pikku/pikku-meta-service.gen.d.ts +1 -1
  36. package/dist/.pikku/pikku-meta-service.gen.js +1 -1
  37. package/dist/.pikku/pikku-services.gen.d.ts +4 -2
  38. package/dist/.pikku/pikku-services.gen.js +2 -0
  39. package/dist/.pikku/pikku-types.gen.d.ts +1 -1
  40. package/dist/.pikku/pikku-types.gen.js +1 -1
  41. package/dist/.pikku/queue/pikku-queue-types.gen.d.ts +1 -1
  42. package/dist/.pikku/queue/pikku-queue-types.gen.js +1 -1
  43. package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.js +1 -1
  44. package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.d.ts +1 -1
  45. package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.js +1 -1
  46. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +1 -1
  47. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.json +2 -3
  48. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts +1 -1
  49. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +1 -1
  50. package/dist/.pikku/schemas/register.gen.js +5 -7
  51. package/dist/.pikku/schemas/schemas/DevInput.schema.json +1 -1
  52. package/dist/.pikku/schemas/schemas/PikkuCLIConfig.schema.json +1 -1
  53. package/dist/.pikku/schemas/schemas/ScenarioRunInput.schema.json +1 -0
  54. package/dist/.pikku/schemas/schemas/ServeInput.schema.json +1 -1
  55. package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts +1 -1
  56. package/dist/.pikku/secrets/pikku-secret-types.gen.js +1 -1
  57. package/dist/.pikku/secrets/pikku-secrets.gen.d.ts +1 -1
  58. package/dist/.pikku/secrets/pikku-secrets.gen.js +1 -1
  59. package/dist/.pikku/trigger/pikku-trigger-types.gen.d.ts +1 -1
  60. package/dist/.pikku/trigger/pikku-trigger-types.gen.js +1 -1
  61. package/dist/.pikku/variables/pikku-variable-types.gen.d.ts +1 -1
  62. package/dist/.pikku/variables/pikku-variable-types.gen.js +1 -1
  63. package/dist/.pikku/variables/pikku-variables.gen.d.ts +1 -1
  64. package/dist/.pikku/variables/pikku-variables.gen.js +1 -1
  65. package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +4 -4
  66. package/dist/.pikku/workflow/pikku-workflow-types.gen.js +2 -2
  67. package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +1 -1
  68. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +1 -1
  69. package/dist/bin/pikku-bin.mjs +2 -2
  70. package/dist/bin/pikku.js +1 -1
  71. package/dist/src/cli.wiring.js +23 -30
  72. package/dist/src/functions/commands/all.js +14 -1
  73. package/dist/src/functions/commands/bun-coverage-loader.d.ts +11 -0
  74. package/dist/src/functions/commands/bun-coverage-loader.js +42 -0
  75. package/dist/src/functions/commands/dev.d.ts +6 -3
  76. package/dist/src/functions/commands/dev.js +26 -9
  77. package/dist/src/functions/commands/{user-flow.d.ts → scenario.d.ts} +5 -2
  78. package/dist/src/functions/commands/{user-flow.js → scenario.js} +73 -32
  79. package/dist/src/functions/commands/serve-console.d.ts +2 -3
  80. package/dist/src/functions/commands/serve-console.js +5 -51
  81. package/dist/src/functions/commands/serve.d.ts +3 -3
  82. package/dist/src/functions/commands/serve.js +15 -7
  83. package/dist/src/functions/commands/start-coverage.d.ts +13 -0
  84. package/dist/src/functions/commands/start-coverage.js +26 -0
  85. package/dist/src/functions/commands/watch.js +2 -1
  86. package/dist/src/functions/wirings/workflow/pikku-command-workflow.js +6 -5
  87. package/dist/src/functions/wirings/workflow/serialize-scenario-actors.d.ts +2 -0
  88. package/dist/src/functions/wirings/workflow/serialize-scenario-actors.js +29 -0
  89. package/dist/src/functions/wirings/workflow/serialize-workflow-types.js +4 -4
  90. package/dist/src/services.js +14 -1
  91. package/dist/src/utils/file-writer.d.ts +1 -0
  92. package/dist/src/utils/file-writer.js +9 -0
  93. package/dist/src/utils/meta-diff.d.ts +32 -0
  94. package/dist/src/utils/meta-diff.js +144 -0
  95. package/dist/src/utils/pikku-cli-config.js +2 -2
  96. package/dist/src/utils/serialize-schemas.js +1 -1
  97. package/dist/src/utils/strip-verbose-meta.js +3 -0
  98. package/dist/tsconfig.tsbuildinfo +1 -1
  99. package/package.json +8 -6
  100. package/dist/.pikku/schemas/schemas/ConsoleCommandInput.schema.json +0 -1
  101. package/dist/.pikku/schemas/schemas/UserFlowRunInput.schema.json +0 -1
  102. package/dist/src/functions/commands/console.d.ts +0 -13
  103. package/dist/src/functions/commands/console.js +0 -122
  104. package/dist/src/functions/wirings/workflow/serialize-user-flow-actors.d.ts +0 -8
  105. package/dist/src/functions/wirings/workflow/serialize-user-flow-actors.js +0 -36
  106. /package/dist/.pikku/schemas/schemas/{UserFlowListInput.schema.json → ScenarioListInput.schema.json} +0 -0
@@ -108,23 +108,23 @@ export function pikkuWorkflowComplexFunc(func: any) {
108
108
  }
109
109
 
110
110
  /**
111
- * A user flow: a complex workflow that drives the app the way users do.
111
+ * A scenario: a complex workflow that drives the app the way users do.
112
112
  * Steps run as actors over the REAL transport — \`workflow.do(step, rpc,
113
113
  * data, { actor: actors.yasser })\` — so flows double as e2e tests and
114
114
  * staged/production health checks (no state reset; scope what you create).
115
115
  */
116
- export function pikkuUserFlow<
116
+ export function pikkuScenario<
117
117
  InputSchema extends StandardSchemaV1 | undefined = undefined,
118
118
  OutputSchema extends StandardSchemaV1 | undefined = undefined
119
119
  >(
120
120
  config: PikkuWorkflowConfigWithSchema<InputSchema, OutputSchema>
121
121
  ): PikkuFunctionConfig<InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown, OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown, 'workflow', PikkuFunctionWorkflow<InputSchema extends StandardSchemaV1 ? InferSchemaOutput<InputSchema> : unknown, OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown>, InputSchema, OutputSchema>
122
- export function pikkuUserFlow<In, Out = unknown>(
122
+ export function pikkuScenario<In, Out = unknown>(
123
123
  func:
124
124
  | PikkuFunctionWorkflow<In, Out>
125
125
  | PikkuFunctionConfig<In, Out, 'workflow', PikkuFunctionWorkflow<In, Out>>
126
126
  ): PikkuFunctionConfig<In, Out, 'workflow'>
127
- export function pikkuUserFlow(func: any) {
127
+ export function pikkuScenario(func: any) {
128
128
  return typeof func === 'function' ? { func } : func
129
129
  }
130
130
 
@@ -10,6 +10,7 @@ import { CLILoggerForwarder } from './services/cli-logger-forwarder.service.js';
10
10
  import { existsSync } from 'fs';
11
11
  import { readFile, writeFile } from 'fs/promises';
12
12
  import { loadManifest } from './utils/contract-versions.js';
13
+ import { getTsWriteGeneration } from './utils/file-writer.js';
13
14
  import { join } from 'path';
14
15
  import { NodeBundler } from './deploy/bundler/node-bundler.js';
15
16
  import { BunBundler } from './deploy/bundler/bun-bundler.js';
@@ -142,6 +143,8 @@ export const createSingletonServices = async (config) => {
142
143
  // Store unfiltered state
143
144
  let unfilteredState = preloadedInspectorState;
144
145
  let unfilteredStateIsSetupOnly = false;
146
+ let inspectedTsGeneration;
147
+ let inspectorInvalidated = false;
145
148
  const getInspectorState = async (refresh = false, setupOnly = false, bootstrapMode = false) => {
146
149
  // In bootstrap mode, return a minimal "zero state" with core types
147
150
  // This allows bootstrap to run immediately without inspecting the codebase
@@ -184,7 +187,10 @@ export const createSingletonServices = async (config) => {
184
187
  // inspection (setupOnly=false) is now requested — setupOnly skips
185
188
  // visitRoutes so variables/secrets/etc. are absent from that cache.
186
189
  if (!unfilteredState ||
187
- (refresh && !preloadedInspectorState) ||
190
+ (refresh &&
191
+ !preloadedInspectorState &&
192
+ (inspectorInvalidated ||
193
+ getTsWriteGeneration() !== inspectedTsGeneration)) ||
188
194
  (unfilteredStateIsSetupOnly && !setupOnly && !preloadedInspectorState)) {
189
195
  // Run inspector WITHOUT filters to get full state
190
196
  const wiringFiles = (await Promise.all(srcDirectories.map((dir) => glob(`${path.join(rootDir, dir)}/**/*.ts`, {
@@ -223,6 +229,7 @@ export const createSingletonServices = async (config) => {
223
229
  const oldProgram = unfilteredState?.program ?? undefined;
224
230
  const inspectStart = Date.now();
225
231
  unfilteredStateIsSetupOnly = setupOnly;
232
+ const tsGenerationAtInspect = getTsWriteGeneration();
226
233
  unfilteredState = await inspect(logger, wiringFiles, {
227
234
  setupOnly,
228
235
  rootDir,
@@ -256,6 +263,8 @@ export const createSingletonServices = async (config) => {
256
263
  manifest,
257
264
  });
258
265
  logger.debug(`Inspector took ${Date.now() - inspectStart}ms`);
266
+ inspectedTsGeneration = tsGenerationAtInspect;
267
+ inspectorInvalidated = false;
259
268
  if ('diagnostics' in unfilteredState &&
260
269
  unfilteredState.diagnostics.length > 0) {
261
270
  processDiagnostics(unfilteredState.diagnostics, config.lint);
@@ -277,6 +286,9 @@ export const createSingletonServices = async (config) => {
277
286
  const filteredState = filterInspectorState(unfilteredState, filters, logger);
278
287
  return filteredState;
279
288
  };
289
+ const invalidateInspectorState = () => {
290
+ inspectorInvalidated = true;
291
+ };
280
292
  const workflowService = new InMemoryWorkflowService();
281
293
  // Resolve the runtime ONCE here, then inject runtime-specific implementations.
282
294
  // Keeping the check in this single place avoids `typeof Bun` branches leaking
@@ -289,6 +301,7 @@ export const createSingletonServices = async (config) => {
289
301
  secrets: new LocalSecretService(variables),
290
302
  audit: new NoopAuditService(),
291
303
  getInspectorState,
304
+ invalidateInspectorState,
292
305
  workflowService,
293
306
  bundler: isBun ? new BunBundler() : new NodeBundler(),
294
307
  devServerRunner: isBun ? new BunServerRunner() : new NodeServerRunner(),
@@ -1,5 +1,6 @@
1
1
  import type { CLILogger } from '../services/cli-logger.service.js';
2
2
  export declare const DO_NOT_MODIFY_COMMENT: string;
3
+ export declare const getTsWriteGeneration: () => number;
3
4
  export declare const writeFileInDir: (logger: CLILogger, path: string, content: string, { ignoreModifyComment, logWrite, }?: {
4
5
  ignoreModifyComment?: boolean;
5
6
  logWrite?: boolean;
@@ -6,6 +6,9 @@ export const DO_NOT_MODIFY_COMMENT = `/**
6
6
  * This file was generated by @pikku/cli@${getCLIVersion()}
7
7
  */
8
8
  `;
9
+ let tsWriteGeneration = 0;
10
+ const TS_FILE_REGEX = /\.[mc]?tsx?$/;
11
+ export const getTsWriteGeneration = () => tsWriteGeneration;
9
12
  export const writeFileInDir = async (logger, path, content, { ignoreModifyComment = false, logWrite = true, } = {}) => {
10
13
  if (path.includes('.json')) {
11
14
  ignoreModifyComment = true;
@@ -34,6 +37,9 @@ export const writeFileInDir = async (logger, path, content, { ignoreModifyCommen
34
37
  if (existingContent !== content) {
35
38
  await mkdir(dirname(path), { recursive: true });
36
39
  await writeFile(path, content, 'utf-8');
40
+ if (TS_FILE_REGEX.test(path)) {
41
+ tsWriteGeneration++;
42
+ }
37
43
  if (logWrite) {
38
44
  logger.debug({ message: `✓ File written to ${path}`, type: 'success' });
39
45
  }
@@ -56,6 +62,9 @@ export const removeFileInDir = async (logger, path, { logRemove = true } = {}) =
56
62
  // Check if file exists before attempting removal
57
63
  if (existsSync(path)) {
58
64
  await rm(path, { force: true });
65
+ if (TS_FILE_REGEX.test(path)) {
66
+ tsWriteGeneration++;
67
+ }
59
68
  if (logRemove) {
60
69
  logger.debug({ message: `✓ File removed at ${path}`, type: 'success' });
61
70
  }
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Structural diff of the generated `.pikku` meta between two points in time —
3
+ * used by `pikku all --diff` to report what a codegen run added/removed/changed
4
+ * (functions, wirings, workflows, emails, …). The snapshot is a plain in-memory
5
+ * copy of the meta files, so diffing is a couple of small JSON reads, not a
6
+ * second inspection pass. Only user-visible buildable surfaces are included;
7
+ * plumbing (secrets/variables/middleware/permissions) is intentionally omitted.
8
+ */
9
+ export type MetaDiffCategoryName = 'functions' | 'http' | 'workflow' | 'email' | 'scheduler' | 'queue' | 'channel' | 'trigger' | 'mcp' | 'agent';
10
+ export interface MetaDiffEntry {
11
+ id: string;
12
+ status: 'added' | 'removed' | 'modified';
13
+ }
14
+ export interface MetaDiffCategory {
15
+ added: number;
16
+ removed: number;
17
+ modified: number;
18
+ entries: MetaDiffEntry[];
19
+ }
20
+ export interface MetaDiff {
21
+ totals: {
22
+ added: number;
23
+ removed: number;
24
+ modified: number;
25
+ };
26
+ categories: Partial<Record<MetaDiffCategoryName, MetaDiffCategory>>;
27
+ }
28
+ export type MetaSnapshot = Partial<Record<MetaDiffCategoryName, Record<string, unknown>>>;
29
+ /** Read the current meta from disk into an in-memory snapshot. */
30
+ export declare function readMetaSnapshot(outDir: string): MetaSnapshot;
31
+ /** Diff two snapshots; only changed ids and non-empty categories are returned. */
32
+ export declare function computeMetaDiff(before: MetaSnapshot, after: MetaSnapshot): MetaDiff;
@@ -0,0 +1,144 @@
1
+ import { existsSync, readFileSync, readdirSync } from 'fs';
2
+ import { join } from 'path';
3
+ // Single-file categories: one JSON file whose top-level keys are the ids
4
+ // (http is nested `{ method: { route: meta } }` and flattened to `method route`).
5
+ const SINGLE_FILE = {
6
+ functions: 'function/pikku-functions-meta.gen.json',
7
+ http: 'http/pikku-http-wirings-meta.gen.json',
8
+ email: 'email/pikku-emails-meta.gen.json',
9
+ scheduler: 'scheduler/pikku-schedulers-wirings-meta.gen.json',
10
+ queue: 'queue/pikku-queue-workers-wirings-meta.gen.json',
11
+ channel: 'channel/pikku-channels-meta.gen.json',
12
+ trigger: 'trigger/pikku-trigger-meta.gen.json',
13
+ mcp: 'mcp/pikku-mcp-wirings-meta.gen.json',
14
+ agent: 'agent/pikku-agent-wirings-meta.gen.json',
15
+ };
16
+ // A few meta files wrap their real entities under a single key rather than
17
+ // keying them at the top level — unwrap to that map so ids are the entities.
18
+ const UNWRAP = {
19
+ email: 'templates',
20
+ agent: 'agentsMeta',
21
+ };
22
+ // Workflows (incl. userflows/scenarios) are written one file per workflow under
23
+ // this dir; the file basename (sans `.gen.json`) is the id, `-verbose` excluded.
24
+ const WORKFLOW_META_DIR = 'workflow/meta';
25
+ function readJson(path) {
26
+ if (!existsSync(path))
27
+ return {};
28
+ try {
29
+ const parsed = JSON.parse(readFileSync(path, 'utf-8'));
30
+ if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed))
31
+ return {};
32
+ return parsed;
33
+ }
34
+ catch {
35
+ return {};
36
+ }
37
+ }
38
+ function readSingle(outDir, category, relPath) {
39
+ let raw = readJson(join(outDir, relPath));
40
+ const unwrapKey = UNWRAP[category];
41
+ if (unwrapKey) {
42
+ const inner = raw[unwrapKey];
43
+ raw = inner && typeof inner === 'object' && !Array.isArray(inner) ? inner : {};
44
+ }
45
+ if (category !== 'http')
46
+ return raw;
47
+ const flat = {};
48
+ for (const [method, routes] of Object.entries(raw)) {
49
+ if (routes && typeof routes === 'object' && !Array.isArray(routes)) {
50
+ for (const [route, meta] of Object.entries(routes)) {
51
+ flat[`${method.toUpperCase()} ${route}`] = meta;
52
+ }
53
+ }
54
+ }
55
+ return flat;
56
+ }
57
+ function readWorkflows(outDir) {
58
+ const dir = join(outDir, WORKFLOW_META_DIR);
59
+ if (!existsSync(dir))
60
+ return {};
61
+ const out = {};
62
+ for (const file of readdirSync(dir)) {
63
+ if (!file.endsWith('.gen.json') || file.endsWith('-verbose.gen.json'))
64
+ continue;
65
+ out[file.slice(0, -'.gen.json'.length)] = readJson(join(dir, file));
66
+ }
67
+ return out;
68
+ }
69
+ /** Read the current meta from disk into an in-memory snapshot. */
70
+ export function readMetaSnapshot(outDir) {
71
+ if (!outDir || !existsSync(outDir))
72
+ return {};
73
+ const snap = {};
74
+ for (const [category, relPath] of Object.entries(SINGLE_FILE)) {
75
+ snap[category] = readSingle(outDir, category, relPath);
76
+ }
77
+ snap.workflow = readWorkflows(outDir);
78
+ return snap;
79
+ }
80
+ // Volatile fields that vary by absolute path / environment but aren't a
81
+ // meaningful structural change — excluded from equality (matches StateDiffService).
82
+ const NORMALIZE_IGNORE = new Set(['sourceFile']);
83
+ function normalize(value) {
84
+ if (Array.isArray(value))
85
+ return value.map(normalize);
86
+ if (value && typeof value === 'object') {
87
+ const out = {};
88
+ for (const key of Object.keys(value).sort()) {
89
+ if (NORMALIZE_IGNORE.has(key))
90
+ continue;
91
+ out[key] = normalize(value[key]);
92
+ }
93
+ return out;
94
+ }
95
+ return value;
96
+ }
97
+ function equal(a, b) {
98
+ return JSON.stringify(normalize(a)) === JSON.stringify(normalize(b));
99
+ }
100
+ /** Diff two snapshots; only changed ids and non-empty categories are returned. */
101
+ export function computeMetaDiff(before, after) {
102
+ const categories = {};
103
+ const totals = { added: 0, removed: 0, modified: 0 };
104
+ const names = new Set([
105
+ ...Object.keys(before),
106
+ ...Object.keys(after),
107
+ ]);
108
+ for (const name of names) {
109
+ const o = before[name] ?? {};
110
+ const a = after[name] ?? {};
111
+ const ids = new Set([...Object.keys(o), ...Object.keys(a)]);
112
+ const entries = [];
113
+ let added = 0;
114
+ let removed = 0;
115
+ let modified = 0;
116
+ for (const id of ids) {
117
+ const inO = id in o;
118
+ const inA = id in a;
119
+ if (inA && !inO) {
120
+ entries.push({ id, status: 'added' });
121
+ added++;
122
+ }
123
+ else if (inO && !inA) {
124
+ entries.push({ id, status: 'removed' });
125
+ removed++;
126
+ }
127
+ else if (!equal(o[id], a[id])) {
128
+ entries.push({ id, status: 'modified' });
129
+ modified++;
130
+ }
131
+ }
132
+ if (entries.length === 0)
133
+ continue;
134
+ entries.sort((x, y) => {
135
+ const order = { added: 0, modified: 1, removed: 2 };
136
+ return order[x.status] - order[y.status] || x.id.localeCompare(y.id);
137
+ });
138
+ categories[name] = { added, removed, modified, entries };
139
+ totals.added += added;
140
+ totals.removed += removed;
141
+ totals.modified += modified;
142
+ }
143
+ return { totals, categories };
144
+ }
@@ -306,8 +306,8 @@ const _getPikkuCLIConfig = async (logger, configFile = undefined, requiredFields
306
306
  if (!result.workflowMetaDir) {
307
307
  result.workflowMetaDir = join(workflowDir, 'meta');
308
308
  }
309
- if (!result.userFlowActorsFile) {
310
- result.userFlowActorsFile = join(workflowDir, 'pikku-user-flow-actors.gen.ts');
309
+ if (!result.scenarioActorsFile) {
310
+ result.scenarioActorsFile = join(workflowDir, 'pikku-scenario-actors.gen.ts');
311
311
  }
312
312
  // Services
313
313
  if (!result.servicesFile) {
@@ -8,8 +8,8 @@ function toValidIdentifier(name) {
8
8
  return result;
9
9
  }
10
10
  export async function saveSchemas(logger, schemaParentDir, schemas, requiredSchemas, supportsImportAttributes, packageName) {
11
- await writeFileInDir(logger, `${schemaParentDir}/register.gen.ts`, 'export const empty = null;');
12
11
  if (requiredSchemas.size === 0) {
12
+ await writeFileInDir(logger, `${schemaParentDir}/register.gen.ts`, 'export const empty = null;');
13
13
  logger.info(`• Skipping schemas since none found.\x1b[0m`);
14
14
  return;
15
15
  }
@@ -30,6 +30,9 @@ const VERBOSE_FIELDS = new Set([
30
30
  'wires',
31
31
  'sourceFile',
32
32
  'exportedName',
33
+ 'bodySourceFile',
34
+ 'bodyStart',
35
+ 'bodyEnd',
33
36
  ]);
34
37
  /**
35
38
  * Fields that are verbose only at the node level (workflow nodes)
@@ -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/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/user-flow.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-user-flow-actors.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","../src/utils/tsc-check.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"}
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/bun-coverage-loader.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/scenario.ts","../src/functions/commands/serve-console.ts","../src/functions/commands/serve.ts","../src/functions/commands/skills.ts","../src/functions/commands/start-coverage.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-scenario-actors.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/meta-diff.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","../src/utils/tsc-check.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.68",
3
+ "version": "0.12.70",
4
4
  "author": "yasser.fadl@gmail.com",
5
5
  "license": "BUSL-1.1",
6
6
  "imports": {
@@ -27,15 +27,15 @@
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.14",
31
- "@pikku/bun-server": "^0.12.2",
32
- "@pikku/core": "^0.12.51",
30
+ "@pikku/better-auth": "^0.12.15",
31
+ "@pikku/bun-server": "^0.12.4",
32
+ "@pikku/core": "^0.12.53",
33
33
  "@pikku/deploy-cloudflare": "^0.12.8",
34
34
  "@pikku/fetch": "^0.12.6",
35
- "@pikku/inspector": "^0.12.35",
35
+ "@pikku/inspector": "^0.12.37",
36
36
  "@pikku/kysely": "^0.13.0",
37
37
  "@pikku/kysely-node-sqlite": "^0.12.3",
38
- "@pikku/node-http-server": "^0.12.4",
38
+ "@pikku/node-http-server": "^0.12.5",
39
39
  "@pikku/openapi-parser": "^0.12.11",
40
40
  "@pikku/schedule": "^0.12.3",
41
41
  "@pikku/ws": "^0.12.3",
@@ -44,6 +44,7 @@
44
44
  "chalk": "^5.6.2",
45
45
  "chokidar": "^4.0.3",
46
46
  "esbuild": "~0.27.0",
47
+ "istanbul-lib-instrument": "^6.0.3",
47
48
  "open": "^10.2.0",
48
49
  "openapi-types": "^12.1.3",
49
50
  "path-to-regexp": "^8.3.0",
@@ -58,6 +59,7 @@
58
59
  "zod-to-ts": "^2.1.0"
59
60
  },
60
61
  "devDependencies": {
62
+ "@types/istanbul-lib-instrument": "^1.7.7",
61
63
  "@types/node": "^24.11.0",
62
64
  "@types/pg": "^8.11.0",
63
65
  "@types/ws": "^8"
@@ -1 +0,0 @@
1
- { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "port": { "type": "string" }, "open": { "type": "string" }, "hmr": { "type": "boolean" } }, "additionalProperties": false, "definitions": {} }
@@ -1 +0,0 @@
1
- { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "environment": { "type": "string" }, "flows": { "type": "string" }, "tags": { "type": "string" } }, "required": ["environment"], "additionalProperties": false, "definitions": {} }
@@ -1,13 +0,0 @@
1
- export declare const consoleCommand: import("#pikku").PikkuFunctionConfig<{
2
- port?: string;
3
- open?: string;
4
- hmr?: boolean;
5
- }, void, "rpc" | "session", import("#pikku").PikkuFunctionSessionless<{
6
- port?: string;
7
- open?: string;
8
- hmr?: boolean;
9
- }, void, "rpc" | "session", import("#pikku").Services> | import("#pikku").PikkuFunction<{
10
- port?: string;
11
- open?: string;
12
- hmr?: boolean;
13
- }, void, "rpc" | "session", import("#pikku").Services>, undefined, undefined>;
@@ -1,122 +0,0 @@
1
- import { createServer } from 'http';
2
- import { readFile, stat } from 'fs/promises';
3
- import { join, extname } from 'path';
4
- import { fileURLToPath } from 'url';
5
- import { pikkuSessionlessFunc } from '#pikku';
6
- import chokidar from 'chokidar';
7
- import open from 'open';
8
- import { pikkuDevReloader } from '@pikku/core/dev';
9
- const MIME_TYPES = {
10
- '.html': 'text/html',
11
- '.js': 'application/javascript',
12
- '.css': 'text/css',
13
- '.json': 'application/json',
14
- '.png': 'image/png',
15
- '.svg': 'image/svg+xml',
16
- '.ico': 'image/x-icon',
17
- '.webmanifest': 'application/manifest+json',
18
- '.woff': 'font/woff',
19
- '.woff2': 'font/woff2',
20
- '.ttf': 'font/ttf',
21
- '.map': 'application/json',
22
- };
23
- export const consoleCommand = pikkuSessionlessFunc({
24
- remote: true,
25
- func: async ({ logger, config }, { port, open: openBrowser, hmr }, { rpc }) => {
26
- const watchDirectories = [
27
- ...new Set([config.emailTemplatesDir, ...config.srcDirectories].filter(Boolean)),
28
- ];
29
- if (!config.scaffold?.console) {
30
- logger.error('Console is not enabled. Add { "scaffold": { "console": "auth" } } to your pikku.config.json (the console requires an authenticated session — set up Better Auth)');
31
- return;
32
- }
33
- const consoleDir = join(fileURLToPath(import.meta.url), '..', '..', '..', '..', '..', 'console-app');
34
- const resolvedPort = parseInt(port || '51442', 10);
35
- try {
36
- await stat(consoleDir);
37
- }
38
- catch {
39
- logger.error('Console app not found. Please rebuild @pikku/cli with the console app bundled.');
40
- return;
41
- }
42
- const server = createServer(async (req, res) => {
43
- const url = new URL(req.url || '/', `http://localhost:${resolvedPort}`);
44
- let filePath = join(consoleDir, url.pathname);
45
- try {
46
- const fileStat = await stat(filePath);
47
- if (fileStat.isDirectory()) {
48
- filePath = join(filePath, 'index.html');
49
- }
50
- }
51
- catch {
52
- filePath = join(consoleDir, 'index.html');
53
- }
54
- try {
55
- const content = await readFile(filePath);
56
- const ext = extname(filePath);
57
- const contentType = MIME_TYPES[ext] || 'application/octet-stream';
58
- res.writeHead(200, { 'Content-Type': contentType });
59
- res.end(content);
60
- }
61
- catch {
62
- res.writeHead(404, { 'Content-Type': 'text/plain' });
63
- res.end('Not Found');
64
- }
65
- });
66
- server.listen(resolvedPort, () => {
67
- logger.info(`Pikku Console running at http://localhost:${resolvedPort}`);
68
- if (openBrowser === 'true') {
69
- open(`http://localhost:${resolvedPort}`);
70
- }
71
- });
72
- if (hmr) {
73
- await pikkuDevReloader({
74
- srcDirectories: watchDirectories,
75
- logger,
76
- });
77
- }
78
- const configWatcher = chokidar.watch(watchDirectories, {
79
- ignoreInitial: true,
80
- ignored: /.*\.gen\.tsx?/,
81
- });
82
- let watcher = new chokidar.FSWatcher({});
83
- const generatorWatcher = () => {
84
- watcher.close();
85
- logger.info(`• Watching directories: \n - ${watchDirectories.join('\n - ')}`);
86
- watcher = chokidar.watch(watchDirectories, {
87
- ignoreInitial: true,
88
- ignored: /.*\.gen\.ts/,
89
- });
90
- watcher.on('ready', async () => {
91
- const handle = async () => {
92
- try {
93
- const start = Date.now();
94
- await rpc.invoke('all');
95
- logger.info({
96
- message: `✓ Generated in ${Date.now() - start}ms`,
97
- type: 'timing',
98
- });
99
- }
100
- catch (err) {
101
- console.error(err);
102
- logger.error('Error running watch');
103
- }
104
- };
105
- await handle();
106
- let timeout;
107
- const deduped = (_file) => {
108
- if (timeout) {
109
- clearTimeout(timeout);
110
- }
111
- timeout = setTimeout(handle, 10);
112
- };
113
- watcher.on('change', deduped);
114
- watcher.on('add', deduped);
115
- watcher.on('unlink', deduped);
116
- });
117
- };
118
- configWatcher.on('ready', generatorWatcher);
119
- configWatcher.on('change', generatorWatcher);
120
- await new Promise(() => { });
121
- },
122
- });