@pikku/cli 0.12.42 → 0.12.44

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 (113) hide show
  1. package/cli.schema.json +1 -1
  2. package/console-app/assets/index-CRLT8CXr.js +254 -0
  3. package/console-app/assets/index-DwyRdRuZ.css +1 -0
  4. package/console-app/index.html +2 -2
  5. package/dist/.pikku/agent/pikku-agent-types.gen.d.ts +1 -1
  6. package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +1 -1
  7. package/dist/.pikku/channel/pikku-channel-types.gen.js +1 -1
  8. package/dist/.pikku/cli/pikku-cli-channel.js +11 -1
  9. package/dist/.pikku/cli/pikku-cli-client.gen.d.ts +10 -0
  10. package/dist/.pikku/cli/pikku-cli-client.gen.js +73 -0
  11. package/dist/.pikku/cli/pikku-cli-types.gen.d.ts +1 -1
  12. package/dist/.pikku/cli/pikku-cli-types.gen.js +1 -1
  13. package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.js +1 -1
  14. package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.json +56 -26
  15. package/dist/.pikku/cli/pikku-cli-wirings.gen.d.ts +1 -1
  16. package/dist/.pikku/cli/pikku-cli-wirings.gen.js +1 -1
  17. package/dist/.pikku/cli/pikku-cli.gen.d.ts +1 -1
  18. package/dist/.pikku/cli/pikku-cli.gen.js +1 -1
  19. package/dist/.pikku/console/pikku-node-types.gen.d.ts +1 -1
  20. package/dist/.pikku/function/pikku-function-types.gen.d.ts +2 -2
  21. package/dist/.pikku/function/pikku-function-types.gen.js +3 -2
  22. package/dist/.pikku/function/pikku-functions-meta.gen.js +1 -1
  23. package/dist/.pikku/function/pikku-functions-meta.gen.json +134 -96
  24. package/dist/.pikku/function/pikku-functions.gen.js +1 -1
  25. package/dist/.pikku/http/pikku-http-types.gen.d.ts +1 -1
  26. package/dist/.pikku/http/pikku-http-types.gen.js +1 -1
  27. package/dist/.pikku/http/pikku-http-wirings-meta.gen.js +1 -1
  28. package/dist/.pikku/http/pikku-http-wirings.gen.d.ts +1 -1
  29. package/dist/.pikku/http/pikku-http-wirings.gen.js +1 -1
  30. package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts +1 -1
  31. package/dist/.pikku/mcp/pikku-mcp-types.gen.js +1 -1
  32. package/dist/.pikku/pikku-bootstrap.gen.d.ts +1 -1
  33. package/dist/.pikku/pikku-bootstrap.gen.js +1 -1
  34. package/dist/.pikku/pikku-meta-service.gen.d.ts +1 -1
  35. package/dist/.pikku/pikku-meta-service.gen.js +1 -1
  36. package/dist/.pikku/pikku-services.gen.d.ts +2 -2
  37. package/dist/.pikku/pikku-types.gen.d.ts +1 -1
  38. package/dist/.pikku/pikku-types.gen.js +1 -1
  39. package/dist/.pikku/queue/pikku-queue-types.gen.d.ts +1 -1
  40. package/dist/.pikku/queue/pikku-queue-types.gen.js +1 -1
  41. package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.js +1 -1
  42. package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.d.ts +1 -1
  43. package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.js +1 -1
  44. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +1 -1
  45. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.json +4 -2
  46. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts +1 -1
  47. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +1 -1
  48. package/dist/.pikku/schemas/register.gen.js +13 -5
  49. package/dist/.pikku/schemas/schemas/DeployApplyInput.schema.json +1 -1
  50. package/dist/.pikku/schemas/schemas/DeployPlanInput.schema.json +1 -1
  51. package/dist/.pikku/schemas/schemas/FabricAddInput.schema.json +1 -0
  52. package/dist/.pikku/schemas/schemas/FabricAddOutput.schema.json +1 -0
  53. package/dist/.pikku/schemas/schemas/FabricPublishInput.schema.json +1 -0
  54. package/dist/.pikku/schemas/schemas/FabricPublishOutput.schema.json +1 -0
  55. package/dist/.pikku/schemas/schemas/PikkuCLIConfig.schema.json +1 -1
  56. package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts +1 -1
  57. package/dist/.pikku/secrets/pikku-secret-types.gen.js +1 -1
  58. package/dist/.pikku/secrets/pikku-secrets.gen.d.ts +1 -1
  59. package/dist/.pikku/secrets/pikku-secrets.gen.js +1 -1
  60. package/dist/.pikku/trigger/pikku-trigger-types.gen.d.ts +1 -1
  61. package/dist/.pikku/trigger/pikku-trigger-types.gen.js +1 -1
  62. package/dist/.pikku/variables/pikku-variable-types.gen.d.ts +1 -1
  63. package/dist/.pikku/variables/pikku-variable-types.gen.js +1 -1
  64. package/dist/.pikku/variables/pikku-variables.gen.d.ts +1 -1
  65. package/dist/.pikku/variables/pikku-variables.gen.js +1 -1
  66. package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +1 -1
  67. package/dist/.pikku/workflow/pikku-workflow-types.gen.js +1 -1
  68. package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +1 -1
  69. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +1 -1
  70. package/dist/bin/pikku-bin.mjs +2 -2
  71. package/dist/src/cli.wiring.js +12 -0
  72. package/dist/src/deploy/build-pipeline.d.ts +2 -0
  73. package/dist/src/deploy/build-pipeline.js +7 -1
  74. package/dist/src/deploy/bundler/bundler.d.ts +2 -0
  75. package/dist/src/deploy/bundler/bundler.js +8 -5
  76. package/dist/src/fabric/fabric-commands.d.ts +61 -3
  77. package/dist/src/fabric/fabric-commands.js +27 -1
  78. package/dist/src/fabric/functions/add.function.d.ts +50 -0
  79. package/dist/src/fabric/functions/add.function.js +144 -0
  80. package/dist/src/fabric/functions/publish.function.d.ts +45 -0
  81. package/dist/src/fabric/functions/publish.function.js +85 -0
  82. package/dist/src/fabric/functions/validate-core.d.ts +1 -1
  83. package/dist/src/fabric/functions/validate.function.d.ts +4 -4
  84. package/dist/src/fabric/functions/validate.function.js +119 -0
  85. package/dist/src/functions/commands/deploy-apply.d.ts +3 -0
  86. package/dist/src/functions/commands/deploy-apply.js +1 -0
  87. package/dist/src/functions/commands/deploy-plan.d.ts +3 -0
  88. package/dist/src/functions/commands/deploy-plan.js +1 -0
  89. package/dist/src/functions/commands/pikku-command-summary.js +3 -2
  90. package/dist/src/functions/commands/versions-update.js +10 -4
  91. package/dist/src/functions/commands/workspace-validate.d.ts +3 -3
  92. package/dist/src/functions/db/better-auth-schema.js +15 -2
  93. package/dist/src/functions/db/sqlite/sqlite-kysely.js +11 -3
  94. package/dist/src/functions/validate/workspace-validate.d.ts +2 -2
  95. package/dist/src/functions/validate/workspace-validate.js +4 -0
  96. package/dist/src/functions/wirings/auth/pikku-command-auth.js +6 -1
  97. package/dist/src/functions/wirings/auth/serialize-auth-gen.d.ts +4 -1
  98. package/dist/src/functions/wirings/auth/serialize-auth-gen.js +36 -12
  99. package/dist/src/functions/wirings/emails/pikku-command-emails.js +48 -19
  100. package/dist/src/functions/wirings/functions/pikku-command-services.js +5 -4
  101. package/dist/src/functions/wirings/functions/serialize-function-types.js +3 -2
  102. package/dist/src/scaffold/rpc-remote.gen.js +1 -1
  103. package/dist/src/services/cli-logger-forwarder.service.d.ts +4 -1
  104. package/dist/src/services/cli-logger-forwarder.service.js +20 -2
  105. package/dist/src/services/cli-logger.service.d.ts +16 -2
  106. package/dist/src/services/cli-logger.service.js +33 -5
  107. package/dist/src/services.d.ts +6 -1
  108. package/dist/src/services.js +13 -12
  109. package/dist/tsconfig.tsbuildinfo +1 -1
  110. package/package.json +4 -4
  111. package/skills/pikku-emails/SKILL.md +157 -0
  112. package/console-app/assets/index-D9Z9rySK.js +0 -233
  113. package/console-app/assets/index-DwUzVI5k.css +0 -1
@@ -21,8 +21,8 @@
21
21
  }
22
22
  } catch (e) {}
23
23
  </script>
24
- <script type="module" crossorigin src="/assets/index-D9Z9rySK.js"></script>
25
- <link rel="stylesheet" crossorigin href="/assets/index-DwUzVI5k.css">
24
+ <script type="module" crossorigin src="/assets/index-CRLT8CXr.js"></script>
25
+ <link rel="stylesheet" crossorigin href="/assets/index-DwyRdRuZ.css">
26
26
  </head>
27
27
  <body>
28
28
  <div id="root"></div>
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.42
2
+ * This file was generated by @pikku/cli@0.12.44
3
3
  */
4
4
  import { CoreAIAgent, PikkuAIMiddlewareHooks } from '@pikku/core/ai-agent';
5
5
  import type { PikkuPermission, PikkuMiddleware, Services, PikkuFunctionConfig } from '../function/pikku-function-types.gen.js';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.42
2
+ * This file was generated by @pikku/cli@0.12.44
3
3
  */
4
4
  /**
5
5
  * Channel-specific type definitions for tree-shaking optimization
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.42
2
+ * This file was generated by @pikku/cli@0.12.44
3
3
  */
4
4
  /**
5
5
  * Channel-specific type definitions for tree-shaking optimization
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.42
2
+ * This file was generated by @pikku/cli@0.12.44
3
3
  */
4
4
  /**
5
5
  * WebSocket channel backend for 'pikku' CLI commands
@@ -31,6 +31,8 @@ import { FabricSmoke } from '../../src/fabric/functions/smoke.function.js';
31
31
  import { FabricLogin } from '../../src/fabric/functions/login.function.js';
32
32
  import { FabricInit } from '../../src/fabric/functions/init.function.js';
33
33
  import { FabricLink } from '../../src/fabric/functions/link.function.js';
34
+ import { FabricPublish } from '../../src/fabric/functions/publish.function.js';
35
+ import { FabricAdd } from '../../src/fabric/functions/add.function.js';
34
36
  import { FabricDeployPlan } from '../../src/fabric/functions/deploy.function.js';
35
37
  import { FabricDeployApply } from '../../src/fabric/functions/deploy.function.js';
36
38
  import { FabricDeployList } from '../../src/fabric/functions/deploy-list.function.js';
@@ -245,6 +247,14 @@ wireChannel({
245
247
  func: FabricLink,
246
248
  middleware: [cliCloseOnComplete],
247
249
  },
250
+ 'fabric.addon.publish': {
251
+ func: FabricPublish,
252
+ middleware: [cliCloseOnComplete],
253
+ },
254
+ 'fabric.addon.add': {
255
+ func: FabricAdd,
256
+ middleware: [cliCloseOnComplete],
257
+ },
248
258
  'fabric.deploy.plan': {
249
259
  func: FabricDeployPlan,
250
260
  middleware: [cliCloseOnComplete],
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file was generated by @pikku/cli@0.12.44
3
+ */
4
+ import '../pikku-bootstrap.gen.js';
5
+ /**
6
+ * Pikku CLI Client (via WebSocket Channel)
7
+ * Executes CLI commands over a WebSocket connection
8
+ */
9
+ export declare function PikkuCLIClient(ws: WebSocket, args?: string[]): Promise<void>;
10
+ export default PikkuCLIClient;
@@ -0,0 +1,73 @@
1
+ /**
2
+ * This file was generated by @pikku/cli@0.12.44
3
+ */
4
+ import { executeCLIViaChannel } from '@pikku/core/cli/channel';
5
+ import { CorePikkuWebsocket } from '@pikku/websocket';
6
+ import '../pikku-bootstrap.gen.js';
7
+ import { defaultCLIRenderer } from '../../src/services.js';
8
+ /**
9
+ * Pikku CLI Client (via WebSocket Channel)
10
+ * Executes CLI commands over a WebSocket connection
11
+ */
12
+ export async function PikkuCLIClient(ws, args) {
13
+ // Create Pikku WebSocket wrapper
14
+ const pikkuWS = new CorePikkuWebsocket(ws);
15
+ // Register renderers for CLI commands
16
+ const renderers = {};
17
+ await executeCLIViaChannel({
18
+ programName: 'pikku',
19
+ pikkuWS,
20
+ args,
21
+ renderers,
22
+ defaultRenderer: defaultCLIRenderer,
23
+ });
24
+ }
25
+ // Export as default for easy importing
26
+ export default PikkuCLIClient;
27
+ // For direct execution (if this file is run directly)
28
+ if (import.meta.url === `file://${process.argv[1]}`) {
29
+ const url = process.env.PIKKU_WS_URL || 'ws://localhost:4002/cli/pikku';
30
+ // Attach credentials so the channel authenticates like any other pikku client.
31
+ // A machine API key (PIKKU_API_KEY -> x-api-key) takes precedence; otherwise
32
+ // the human session token saved by `pikku login` (~/.pikku/session.json ->
33
+ // Authorization: Bearer) is used. This block only runs under Node (direct
34
+ // execution), so reading the session file and using the 'ws' headers option
35
+ // is safe — the browser WebSocket cannot set custom headers anyway.
36
+ const headers = {};
37
+ if (process.env.PIKKU_API_KEY) {
38
+ headers['x-api-key'] = process.env.PIKKU_API_KEY;
39
+ }
40
+ else {
41
+ try {
42
+ const { homedir } = await import('os');
43
+ const { readFileSync } = await import('fs');
44
+ const { join } = await import('path');
45
+ const store = JSON.parse(readFileSync(join(homedir(), '.pikku', 'session.json'), 'utf8'));
46
+ const token = store.current
47
+ ? store.sessions?.[store.current]?.accessToken
48
+ : undefined;
49
+ if (token) {
50
+ headers['authorization'] = `Bearer ${token}`;
51
+ }
52
+ }
53
+ catch {
54
+ // No saved session — connect unauthenticated (the server may reject).
55
+ }
56
+ }
57
+ const hasAuth = Object.keys(headers).length > 0;
58
+ // Custom headers require the Node 'ws' module — the global/browser WebSocket
59
+ // cannot set them — so prefer 'ws' whenever we have credentials to send.
60
+ let ws;
61
+ if (hasAuth || typeof WebSocket === 'undefined') {
62
+ const wsModule = await import('ws');
63
+ ws = new wsModule.default(url, { headers });
64
+ }
65
+ else {
66
+ ws = new WebSocket(url);
67
+ }
68
+ PikkuCLIClient(ws, process.argv.slice(2)).catch(error => {
69
+ console.error('Fatal channel CLI error:', error);
70
+ // TODO: We get an error code even when it exists cleanly, investigate
71
+ // process.exit(1)
72
+ });
73
+ }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.42
2
+ * This file was generated by @pikku/cli@0.12.44
3
3
  */
4
4
  /**
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.42
2
+ * This file was generated by @pikku/cli@0.12.44
3
3
  */
4
4
  /**
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.42
2
+ * This file was generated by @pikku/cli@0.12.44
3
3
  */
4
4
  import { pikkuState } from '@pikku/core/internal';
5
5
  import metaData from './pikku-cli-wirings-meta.gen.json' with { type: 'json' };
@@ -336,6 +336,49 @@
336
336
  },
337
337
  "description": "Register the current git repo as a fabric project and queue an initial deploy"
338
338
  },
339
+ "addon": {
340
+ "pikkuFuncId": "",
341
+ "positionals": [],
342
+ "options": {},
343
+ "description": "Publish and install Fabric community-registry addons",
344
+ "subcommands": {
345
+ "publish": {
346
+ "pikkuFuncId": "FabricPublish",
347
+ "positionals": [
348
+ {
349
+ "name": "dir",
350
+ "required": false
351
+ }
352
+ ],
353
+ "options": {
354
+ "apiUrl": {
355
+ "description": "Override the fabric-api URL for this call"
356
+ }
357
+ },
358
+ "parameters": "[dir]",
359
+ "description": "Publish the addon in this directory to the community registry (pack + upload)"
360
+ },
361
+ "add": {
362
+ "pikkuFuncId": "FabricAdd",
363
+ "positionals": [
364
+ {
365
+ "name": "id",
366
+ "required": true
367
+ }
368
+ ],
369
+ "options": {
370
+ "dir": {
371
+ "description": "Addon dir (overrides pikku.config.json addons.addonDir, default addons/)"
372
+ },
373
+ "apiUrl": {
374
+ "description": "Override the fabric-api URL for this call"
375
+ }
376
+ },
377
+ "parameters": "<id>",
378
+ "description": "Install an addon from the community registry into addons/ (shadcn-style)"
379
+ }
380
+ }
381
+ },
339
382
  "deploy": {
340
383
  "pikkuFuncId": "",
341
384
  "positionals": [],
@@ -1410,6 +1453,18 @@
1410
1453
  "default": false,
1411
1454
  "short": "j"
1412
1455
  },
1456
+ "failOnError": {
1457
+ "description": "Fail the build on error-severity diagnostics (e.g. data-classification leaks). Default: only critical diagnostics fail.",
1458
+ "default": false
1459
+ },
1460
+ "failOnWarn": {
1461
+ "description": "Fail the build on warn-severity diagnostics (implies --fail-on-error).",
1462
+ "default": false
1463
+ },
1464
+ "failOnCritical": {
1465
+ "description": "Fail the build on critical diagnostics. Always on; accepted for symmetry with --fail-on-error/--fail-on-warn.",
1466
+ "default": true
1467
+ },
1413
1468
  "userSessionType": {
1414
1469
  "description": "Specify which UserSession type to use (when multiple exist)"
1415
1470
  },
@@ -1439,32 +1494,7 @@
1439
1494
  "exportedName": "defaultCLIRenderer",
1440
1495
  "services": {
1441
1496
  "optimized": true,
1442
- "services": [
1443
- "workflowService",
1444
- "logger",
1445
- "getInspectorState",
1446
- "schema",
1447
- "jwt",
1448
- "config",
1449
- "variables",
1450
- "secrets",
1451
- "queueService",
1452
- "eventHub",
1453
- "schedulerService",
1454
- "deploymentService",
1455
- "aiStorage",
1456
- "content",
1457
- "aiAgentRunner",
1458
- "aiRunState",
1459
- "agentRunService",
1460
- "workflowRunService",
1461
- "credentialService",
1462
- "emailService",
1463
- "metaService",
1464
- "audit",
1465
- "auditLog",
1466
- "sessionStore"
1467
- ]
1497
+ "services": []
1468
1498
  },
1469
1499
  "filePath": "/home/runner/work/pikku/pikku/packages/cli/src/services.ts"
1470
1500
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.42
2
+ * This file was generated by @pikku/cli@0.12.44
3
3
  */
4
4
  import '../../src/cli.wiring.js';
5
5
  import '../../src/services.js';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.42
2
+ * This file was generated by @pikku/cli@0.12.44
3
3
  */
4
4
  /* The files with an wireCLI function call */
5
5
  import '../../src/cli.wiring.js';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.42
2
+ * This file was generated by @pikku/cli@0.12.44
3
3
  */
4
4
  import '../pikku-bootstrap.gen.js';
5
5
  export declare function PikkuCLI(args: string[]): Promise<void>;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.42
2
+ * This file was generated by @pikku/cli@0.12.44
3
3
  */
4
4
  import { executeCLI, CLIError } from '@pikku/core/cli';
5
5
  import { createConfig as createConfig } from '../../src/services.js';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.42
2
+ * This file was generated by @pikku/cli@0.12.44
3
3
  */
4
4
  import type { FlattenedRPCMap } from '../rpc/pikku-rpc-wirings-map.internal.gen.js';
5
5
  export type NodeCategory = never;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.42
2
+ * This file was generated by @pikku/cli@0.12.44
3
3
  */
4
4
  /**
5
5
  * Core function, middleware, and permission types for all wirings
@@ -419,7 +419,7 @@ export declare const pikkuConfig: (func: (variables?: any, ...args: any[]) => Pr
419
419
  * })
420
420
  * ```
421
421
  */
422
- export declare const pikkuServices: (func: (config: Config, existingServices: Partial<SingletonServices>) => Promise<Omit<RequiredSingletonServices, "auth">>) => (config: Config, existingServices?: Partial<SingletonServices>) => Promise<RequiredSingletonServices>;
422
+ export declare const pikkuServices: (func: (config: Config, existingServices: Partial<SingletonServices>) => Promise<Partial<Omit<RequiredSingletonServices, "auth">>>) => (config: Config, existingServices?: Partial<SingletonServices>) => Promise<RequiredSingletonServices>;
423
423
  /**
424
424
  * Creates a Pikku wire services factory.
425
425
  * Use this to define services that are created per-request/session.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.42
2
+ * This file was generated by @pikku/cli@0.12.44
3
3
  */
4
4
  /**
5
5
  * Core function, middleware, and permission types for all wirings
@@ -230,7 +230,8 @@ export const pikkuConfig = (func) => func;
230
230
  */
231
231
  export const pikkuServices = (func) => {
232
232
  return async (config, existingServices = {}) => {
233
- const services = await func(config, existingServices);
233
+ const createdServices = await func(config, existingServices);
234
+ const services = { ...existingServices, ...createdServices };
234
235
  const authFactory = __pikkuState(null, 'package', 'authFactory');
235
236
  if (authFactory) {
236
237
  let authInstance;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.42
2
+ * This file was generated by @pikku/cli@0.12.44
3
3
  */
4
4
  import { pikkuState } from '@pikku/core/internal';
5
5
  import metaData from './pikku-functions-meta.gen.json' with { type: 'json' };