@pikku/cli 0.12.92 → 0.12.96

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 (196) hide show
  1. package/console-app/assets/{index-DDpIMCpy.js → index-CeQodYfg.js} +151 -149
  2. package/console-app/assets/{index-D0HG8q0B.css → index-CyYHTGWZ.css} +1 -1
  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.d.ts +13 -15
  8. package/dist/.pikku/cli/pikku-cli-channel.js +72 -3
  9. package/dist/.pikku/cli/pikku-cli-client.gen.d.ts +14 -4
  10. package/dist/.pikku/cli/pikku-cli-client.gen.js +20 -10
  11. package/dist/.pikku/cli/pikku-cli-contracts-meta.gen.d.ts +1 -1
  12. package/dist/.pikku/cli/pikku-cli-contracts-meta.gen.js +1 -1
  13. package/dist/.pikku/cli/pikku-cli-types.gen.d.ts +1 -1
  14. package/dist/.pikku/cli/pikku-cli-types.gen.js +1 -1
  15. package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.js +1 -1
  16. package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.json +156 -2
  17. package/dist/.pikku/cli/pikku-cli-wirings.gen.d.ts +1 -1
  18. package/dist/.pikku/cli/pikku-cli-wirings.gen.js +1 -1
  19. package/dist/.pikku/cli/pikku-cli.gen.d.ts +1 -1
  20. package/dist/.pikku/cli/pikku-cli.gen.js +1 -1
  21. package/dist/.pikku/console/pikku-node-types.gen.d.ts +1 -1
  22. package/dist/.pikku/function/pikku-function-types.gen.d.ts +55 -20
  23. package/dist/.pikku/function/pikku-function-types.gen.js +27 -1
  24. package/dist/.pikku/function/pikku-functions-meta.gen.js +1 -1
  25. package/dist/.pikku/function/pikku-functions-meta.gen.json +176 -13
  26. package/dist/.pikku/function/pikku-functions.gen.js +11 -1
  27. package/dist/.pikku/http/pikku-http-types.gen.d.ts +1 -1
  28. package/dist/.pikku/http/pikku-http-types.gen.js +1 -1
  29. package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts +1 -1
  30. package/dist/.pikku/mcp/pikku-mcp-types.gen.js +1 -1
  31. package/dist/.pikku/pikku-bootstrap-scenarios.gen.d.ts +1 -1
  32. package/dist/.pikku/pikku-bootstrap-scenarios.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 +1 -1
  38. package/dist/.pikku/pikku-types.gen.d.ts +1 -1
  39. package/dist/.pikku/pikku-types.gen.js +1 -1
  40. package/dist/.pikku/queue/pikku-queue-types.gen.d.ts +1 -1
  41. package/dist/.pikku/queue/pikku-queue-types.gen.js +1 -1
  42. package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.js +1 -1
  43. package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.d.ts +1 -1
  44. package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.js +1 -1
  45. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +1 -1
  46. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.json +9 -0
  47. package/dist/.pikku/scenarios/pikku-scenario-functions-meta.gen.js +1 -1
  48. package/dist/.pikku/scenarios/pikku-scenario-functions.gen.d.ts +1 -1
  49. package/dist/.pikku/scenarios/pikku-scenario-wirings-meta.gen.js +1 -1
  50. package/dist/.pikku/scenarios/pikku-scenario-wirings.gen.d.ts +1 -1
  51. package/dist/.pikku/scenarios/schemas/register.gen.d.ts +1 -1
  52. package/dist/.pikku/scenarios/schemas/register.gen.js +1 -1
  53. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts +1 -1
  54. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +1 -1
  55. package/dist/.pikku/schemas/register.gen.js +21 -3
  56. package/dist/.pikku/schemas/schemas/KnowledgeIndexInput.schema.json +1 -0
  57. package/dist/.pikku/schemas/schemas/KnowledgeIndexOutput.schema.json +1 -0
  58. package/dist/.pikku/schemas/schemas/KnowledgeValidateInput.schema.json +1 -0
  59. package/dist/.pikku/schemas/schemas/KnowledgeValidateOutput.schema.json +1 -0
  60. package/dist/.pikku/schemas/schemas/PersonaRunInput.schema.json +1 -0
  61. package/dist/.pikku/schemas/schemas/PersonaSyncInput.schema.json +1 -0
  62. package/dist/.pikku/schemas/schemas/PikkuCLIConfig.schema.json +1 -1
  63. package/dist/.pikku/schemas/schemas/PikkuPersonasInput.schema.json +1 -0
  64. package/dist/.pikku/schemas/schemas/PikkuRolesInput.schema.json +1 -0
  65. package/dist/.pikku/schemas/schemas/RolesAuditInput.schema.json +1 -0
  66. package/dist/.pikku/schemas/schemas/RolesPruneInput.schema.json +1 -0
  67. package/dist/.pikku/scopes/pikku-personas-meta.gen.json +1 -0
  68. package/dist/.pikku/scopes/pikku-personas.gen.d.ts +36 -0
  69. package/dist/.pikku/scopes/pikku-personas.gen.js +17 -0
  70. package/dist/.pikku/scopes/pikku-roles-meta.gen.json +1 -0
  71. package/dist/.pikku/scopes/pikku-roles.gen.d.ts +30 -0
  72. package/dist/.pikku/scopes/pikku-roles.gen.js +18 -0
  73. package/dist/.pikku/scopes/pikku-scope-types.gen.d.ts +4 -2
  74. package/dist/.pikku/scopes/pikku-scope-types.gen.js +3 -2
  75. package/dist/.pikku/scopes/pikku-scopes.gen.d.ts +1 -1
  76. package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts +2 -2
  77. package/dist/.pikku/secrets/pikku-secret-types.gen.js +2 -2
  78. package/dist/.pikku/secrets/pikku-secrets.gen.d.ts +1 -1
  79. package/dist/.pikku/secrets/pikku-secrets.gen.js +1 -1
  80. package/dist/.pikku/trigger/pikku-trigger-types.gen.d.ts +1 -1
  81. package/dist/.pikku/trigger/pikku-trigger-types.gen.js +1 -1
  82. package/dist/.pikku/variables/pikku-variable-types.gen.d.ts +2 -2
  83. package/dist/.pikku/variables/pikku-variable-types.gen.js +2 -2
  84. package/dist/.pikku/variables/pikku-variables.gen.d.ts +1 -1
  85. package/dist/.pikku/variables/pikku-variables.gen.js +1 -1
  86. package/dist/.pikku/workflow/meta/allWorkflow.gen.json +27 -3
  87. package/dist/.pikku/workflow/pikku-personas.gen.d.ts +15 -0
  88. package/dist/.pikku/workflow/pikku-personas.gen.js +17 -0
  89. package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +96 -19
  90. package/dist/.pikku/workflow/pikku-workflow-types.gen.js +22 -2
  91. package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +1 -1
  92. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +1 -1
  93. package/dist/bin/pikku-bin.mjs +2 -2
  94. package/dist/bin/pikku.js +0 -0
  95. package/dist/src/cli.wiring.js +124 -2
  96. package/dist/src/deploy/analyzer/analyzer.js +14 -0
  97. package/dist/src/deploy/analyzer/manifest.d.ts +11 -0
  98. package/dist/src/fabric/functions/validate.function.js +20 -11
  99. package/dist/src/functions/commands/bootstrap.js +3 -0
  100. package/dist/src/functions/commands/dev-ai-runner.d.ts +16 -4
  101. package/dist/src/functions/commands/dev-ai-runner.js +63 -29
  102. package/dist/src/functions/commands/dev.js +9 -4
  103. package/dist/src/functions/commands/enable.js +15 -19
  104. package/dist/src/functions/commands/{scenario-environment.d.ts → environment.d.ts} +9 -6
  105. package/dist/src/functions/commands/{scenario-environment.js → environment.js} +5 -4
  106. package/dist/src/functions/commands/knowledge-index.d.ts +30 -0
  107. package/dist/src/functions/commands/knowledge-index.js +11 -0
  108. package/dist/src/functions/commands/knowledge-validate.d.ts +33 -0
  109. package/dist/src/functions/commands/knowledge-validate.js +11 -0
  110. package/dist/src/functions/commands/new-addon.d.ts +18 -0
  111. package/dist/src/functions/commands/new-addon.js +52 -36
  112. package/dist/src/functions/commands/persona-sync.d.ts +33 -0
  113. package/dist/src/functions/commands/persona-sync.js +151 -0
  114. package/dist/src/functions/commands/persona.d.ts +58 -0
  115. package/dist/src/functions/commands/persona.js +217 -0
  116. package/dist/src/functions/commands/roles-audit.d.ts +1 -0
  117. package/dist/src/functions/commands/roles-audit.js +37 -0
  118. package/dist/src/functions/commands/roles-prune.d.ts +16 -0
  119. package/dist/src/functions/commands/roles-prune.js +52 -0
  120. package/dist/src/functions/commands/roles-shared.d.ts +40 -0
  121. package/dist/src/functions/commands/roles-shared.js +77 -0
  122. package/dist/src/functions/commands/scenario-browser.d.ts +3 -3
  123. package/dist/src/functions/commands/scenario-browser.js +1 -1
  124. package/dist/src/functions/commands/scenario-ladder.d.ts +44 -2
  125. package/dist/src/functions/commands/scenario-ladder.js +51 -2
  126. package/dist/src/functions/commands/scenario.d.ts +7 -0
  127. package/dist/src/functions/commands/scenario.js +79 -17
  128. package/dist/src/functions/commands/scopes-shared.d.ts +8 -0
  129. package/dist/src/functions/commands/scopes-shared.js +1 -1
  130. package/dist/src/functions/commands/serve.js +7 -3
  131. package/dist/src/functions/commands/virtual-user-formatter.d.ts +30 -0
  132. package/dist/src/functions/commands/virtual-user-formatter.js +65 -0
  133. package/dist/src/functions/db/local-db.js +38 -1
  134. package/dist/src/functions/knowledge/render.d.ts +3 -0
  135. package/dist/src/functions/knowledge/render.js +66 -0
  136. package/dist/src/functions/knowledge/schemas.d.ts +51 -0
  137. package/dist/src/functions/knowledge/schemas.js +25 -0
  138. package/dist/src/functions/validate/workspace-validate.js +1 -1
  139. package/dist/src/functions/wirings/ai-agent/pikku-command-public-agent.js +2 -1
  140. package/dist/src/functions/wirings/ai-agent/serialize-public-agent.js +1 -0
  141. package/dist/src/functions/wirings/auth/serialize-auth-gen.d.ts +2 -2
  142. package/dist/src/functions/wirings/auth/serialize-auth-gen.js +8 -8
  143. package/dist/src/functions/wirings/cli/serialize-channel-cli-client.d.ts +7 -3
  144. package/dist/src/functions/wirings/cli/serialize-channel-cli-client.js +32 -18
  145. package/dist/src/functions/wirings/cli/serialize-channel-cli.js +63 -6
  146. package/dist/src/functions/wirings/console/serialize-console-functions.js +4 -7
  147. package/dist/src/functions/wirings/credentials/serialize-credentials-types.js +8 -1
  148. package/dist/src/functions/wirings/functions/serialize-function-types.js +88 -28
  149. package/dist/src/functions/wirings/middleware/serialize-middleware-imports.js +25 -9
  150. package/dist/src/functions/wirings/package/serialize-package-types.js +5 -3
  151. package/dist/src/functions/wirings/personas/pikku-command-personas.d.ts +7 -0
  152. package/dist/src/functions/wirings/personas/pikku-command-personas.js +43 -0
  153. package/dist/src/functions/wirings/personas/serialize-personas-types.d.ts +18 -0
  154. package/dist/src/functions/wirings/personas/serialize-personas-types.js +76 -0
  155. package/dist/src/functions/wirings/realtime/pikku-command-events-scaffold.js +2 -1
  156. package/dist/src/functions/wirings/roles/pikku-command-roles.d.ts +7 -0
  157. package/dist/src/functions/wirings/roles/pikku-command-roles.js +33 -0
  158. package/dist/src/functions/wirings/roles/serialize-roles-types.d.ts +14 -0
  159. package/dist/src/functions/wirings/roles/serialize-roles-types.js +55 -0
  160. package/dist/src/functions/wirings/rpc/pikku-command-public-rpc.js +2 -1
  161. package/dist/src/functions/wirings/scenarios/register-scenario-instrumentation.d.ts +3 -3
  162. package/dist/src/functions/wirings/scenarios/register-scenario-instrumentation.js +3 -3
  163. package/dist/src/functions/wirings/scopes/serialize-scopes-types.d.ts +1 -1
  164. package/dist/src/functions/wirings/scopes/serialize-scopes-types.js +1 -1
  165. package/dist/src/functions/wirings/secrets/serialize-secrets-types.js +10 -3
  166. package/dist/src/functions/wirings/user-admin/pikku-command-user-admin-functions.js +2 -1
  167. package/dist/src/functions/wirings/user-admin/serialize-user-admin-functions.js +2 -2
  168. package/dist/src/functions/wirings/variables/serialize-variables-types.js +8 -1
  169. package/dist/src/functions/wirings/workflow/pikku-command-workflow-routes.js +2 -1
  170. package/dist/src/functions/wirings/workflow/pikku-command-workflow.js +13 -13
  171. package/dist/src/functions/wirings/workflow/serialize-personas.d.ts +10 -0
  172. package/dist/src/functions/wirings/workflow/serialize-personas.js +46 -0
  173. package/dist/src/functions/wirings/workflow/serialize-scenario-step-map.js +11 -2
  174. package/dist/src/functions/wirings/workflow/serialize-workflow-types.js +165 -29
  175. package/dist/src/functions/workflows/all.workflow.js +7 -1
  176. package/dist/src/server/content-signing-jwt.d.ts +13 -0
  177. package/dist/src/server/content-signing-jwt.js +51 -0
  178. package/dist/src/server/dev-server-runner.interface.d.ts +10 -2
  179. package/dist/src/server/node-server-runner.d.ts +2 -2
  180. package/dist/src/server/node-server-runner.js +2 -1
  181. package/dist/src/services.d.ts +3 -1
  182. package/dist/src/services.js +2 -1
  183. package/dist/src/utils/pikku-cli-config.js +45 -2
  184. package/dist/src/utils/resolve-personas.d.ts +32 -0
  185. package/dist/src/utils/resolve-personas.js +46 -0
  186. package/dist/src/utils/resolve-scaffold-feature.d.ts +19 -0
  187. package/dist/src/utils/resolve-scaffold-feature.js +49 -0
  188. package/dist/tsconfig.tsbuildinfo +1 -1
  189. package/package.json +17 -13
  190. package/dist/.pikku/schemas/schemas/ScenarioRunInput.schema.json +0 -1
  191. package/dist/.pikku/workflow/pikku-scenario-actors.gen.d.ts +0 -19
  192. package/dist/.pikku/workflow/pikku-scenario-actors.gen.js +0 -17
  193. package/dist/src/functions/wirings/workflow/serialize-scenario-actors.d.ts +0 -2
  194. package/dist/src/functions/wirings/workflow/serialize-scenario-actors.js +0 -40
  195. package/dist/src/utils/resolve-scenario-actors.d.ts +0 -23
  196. package/dist/src/utils/resolve-scenario-actors.js +0 -74
@@ -21,8 +21,8 @@
21
21
  }
22
22
  } catch (e) {}
23
23
  </script>
24
- <script type="module" crossorigin src="/console/assets/index-DDpIMCpy.js"></script>
25
- <link rel="stylesheet" crossorigin href="/console/assets/index-D0HG8q0B.css">
24
+ <script type="module" crossorigin src="/console/assets/index-CeQodYfg.js"></script>
25
+ <link rel="stylesheet" crossorigin href="/console/assets/index-CyYHTGWZ.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.92
2
+ * This file was generated by @pikku/cli@0.12.96
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.92
2
+ * This file was generated by @pikku/cli@0.12.96
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.92
2
+ * This file was generated by @pikku/cli@0.12.96
3
3
  */
4
4
  /**
5
5
  * Channel-specific type definitions for tree-shaking optimization
@@ -1,3 +1,4 @@
1
+ import { type RawCLIFrame } from '@pikku/core/cli/channel';
1
2
  export declare const cliHelp: import("../function/pikku-function-types.gen.js").PikkuFunctionConfig<{
2
3
  args?: string[];
3
4
  }, {
@@ -11,22 +12,19 @@ export declare const cliHelp: import("../function/pikku-function-types.gen.js").
11
12
  }, {
12
13
  help: string;
13
14
  }, "rpc" | "session", import("../function/pikku-function-types.gen.js").WiredServices>, undefined, undefined>;
15
+ /**
16
+ * Raw entry point: the client forwards argv untouched and this side owns
17
+ * parsing, so a client binary never carries the command tree and its version
18
+ * is free to drift from the server's.
19
+ *
20
+ * Progressive output is streamed on the same channel rather than returned,
21
+ * and the terminating control frame carries the exit code so the client
22
+ * process can exit non-zero.
23
+ */
14
24
  export declare const cliRaw: import("../function/pikku-function-types.gen.js").PikkuFunctionConfig<{
15
25
  args: string[];
16
- }, {
17
- help?: string;
18
- result?: unknown;
19
- error?: string;
20
- }, "rpc" | "session", import("../function/pikku-function-types.gen.js").PikkuFunctionSessionless<{
26
+ }, RawCLIFrame, "rpc" | "session", import("../function/pikku-function-types.gen.js").PikkuFunctionSessionless<{
21
27
  args: string[];
22
- }, {
23
- help?: string;
24
- result?: unknown;
25
- error?: string;
26
- }, "rpc" | "session", import("../function/pikku-function-types.gen.js").WiredServices> | import("../function/pikku-function-types.gen.js").PikkuFunction<{
28
+ }, RawCLIFrame, "rpc" | "session", import("../function/pikku-function-types.gen.js").WiredServices> | import("../function/pikku-function-types.gen.js").PikkuFunction<{
27
29
  args: string[];
28
- }, {
29
- help?: string;
30
- result?: unknown;
31
- error?: string;
32
- }, "rpc" | "session", import("../function/pikku-function-types.gen.js").WiredServices>, undefined, undefined>;
30
+ }, RawCLIFrame, "rpc" | "session", import("../function/pikku-function-types.gen.js").WiredServices>, undefined, undefined>;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.92
2
+ * This file was generated by @pikku/cli@0.12.96
3
3
  */
4
4
  /**
5
5
  * WebSocket channel backend for 'pikku' CLI commands
@@ -32,9 +32,16 @@ import { dbReset } from '../../src/functions/commands/db-reset.js';
32
32
  import { dbAudit } from '../../src/functions/commands/db-audit.js';
33
33
  import { scopesAudit } from '../../src/functions/commands/scopes-audit.js';
34
34
  import { scopesPrune } from '../../src/functions/commands/scopes-prune.js';
35
+ import { rolesAudit } from '../../src/functions/commands/roles-audit.js';
36
+ import { rolesPrune } from '../../src/functions/commands/roles-prune.js';
37
+ import { knowledgeValidate } from '../../src/functions/commands/knowledge-validate.js';
38
+ import { knowledgeIndex } from '../../src/functions/commands/knowledge-index.js';
35
39
  import { workspaceValidate } from '../../src/functions/commands/workspace-validate.js';
36
40
  import { scenarioRun } from '../../src/functions/commands/scenario.js';
37
41
  import { scenarioList } from '../../src/functions/commands/scenario.js';
42
+ import { personaRun } from '../../src/functions/commands/persona.js';
43
+ import { personaSync } from '../../src/functions/commands/persona-sync.js';
44
+ import { personaList } from '../../src/functions/commands/persona.js';
38
45
  import { FabricValidate } from '../../src/fabric/functions/validate.function.js';
39
46
  import { FabricSmoke } from '../../src/fabric/functions/smoke.function.js';
40
47
  import { FabricLogin } from '../../src/fabric/functions/login.function.js';
@@ -148,14 +155,48 @@ export const cliHelp = pikkuSessionlessFunc({
148
155
  return { help: helpText };
149
156
  },
150
157
  });
158
+ /**
159
+ * Raw entry point: the client forwards argv untouched and this side owns
160
+ * parsing, so a client binary never carries the command tree and its version
161
+ * is free to drift from the server's.
162
+ *
163
+ * Progressive output is streamed on the same channel rather than returned,
164
+ * and the terminating control frame carries the exit code so the client
165
+ * process can exit non-zero.
166
+ */
151
167
  export const cliRaw = pikkuSessionlessFunc({
152
168
  auth: false,
153
- func: async (services, data) => {
154
- return handleRawCLI({
169
+ func: async (services, data, { channel, session }) => {
170
+ const { help, result, error, exitCode, commandId } = await handleRawCLI({
155
171
  programName: 'pikku',
156
172
  args: data.args,
157
173
  singletonServices: services,
174
+ createWireServices: pikkuState(null, 'package', 'factories')?.createWireServices,
175
+ // The connection authenticated during its upgrade — commands run as it.
176
+ session,
177
+ // The socket the command arrived on, so `channel.remote(...)` inside a
178
+ // command reaches the client that invoked it.
179
+ transport: channel,
180
+ onOutput: (output, commandId) => channel?.send({ action: 'cli-output', commandId, data: output }),
158
181
  });
182
+ // A failed parse carries both: the error says what was wrong, the help
183
+ // says what was available. The error goes last so it is the line still on
184
+ // screen after the help text has scrolled past.
185
+ if (help !== undefined) {
186
+ await channel?.send({ action: 'cli-help', help });
187
+ if (error !== undefined) {
188
+ await channel?.send({ action: 'cli-error', error });
189
+ }
190
+ }
191
+ else if (error !== undefined) {
192
+ await channel?.send({ action: 'cli-error', error });
193
+ }
194
+ else if (result !== undefined) {
195
+ await channel?.send({ action: 'cli-result', commandId, result });
196
+ }
197
+ // Returned rather than sent so the runtime tags it with the routing key,
198
+ // and so the terminal frame cannot be emitted before the ones above it.
199
+ return { action: 'cli-control', event: 'complete', exitCode };
159
200
  },
160
201
  });
161
202
  wireChannel({
@@ -264,6 +305,22 @@ wireChannel({
264
305
  func: scopesPrune,
265
306
  middleware: [cliCloseOnComplete],
266
307
  },
308
+ 'roles.audit': {
309
+ func: rolesAudit,
310
+ middleware: [cliCloseOnComplete],
311
+ },
312
+ 'roles.prune': {
313
+ func: rolesPrune,
314
+ middleware: [cliCloseOnComplete],
315
+ },
316
+ 'knowledge.validate': {
317
+ func: knowledgeValidate,
318
+ middleware: [cliCloseOnComplete],
319
+ },
320
+ 'knowledge.index': {
321
+ func: knowledgeIndex,
322
+ middleware: [cliCloseOnComplete],
323
+ },
267
324
  'workspace.validate': {
268
325
  func: workspaceValidate,
269
326
  middleware: [cliCloseOnComplete],
@@ -276,6 +333,18 @@ wireChannel({
276
333
  func: scenarioList,
277
334
  middleware: [cliCloseOnComplete],
278
335
  },
336
+ 'persona.run': {
337
+ func: personaRun,
338
+ middleware: [cliCloseOnComplete],
339
+ },
340
+ 'persona.sync': {
341
+ func: personaSync,
342
+ middleware: [cliCloseOnComplete],
343
+ },
344
+ 'persona.list': {
345
+ func: personaList,
346
+ middleware: [cliCloseOnComplete],
347
+ },
279
348
  'fabric.validate': {
280
349
  func: FabricValidate,
281
350
  middleware: [cliCloseOnComplete],
@@ -1,10 +1,20 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.92
2
+ * This file was generated by @pikku/cli@0.12.96
3
3
  */
4
- import '../pikku-bootstrap.gen.js';
4
+ import type { Capabilities } from '@pikku/core/channel';
5
5
  /**
6
6
  * Pikku CLI Client (via WebSocket Channel)
7
- * Executes CLI commands over a WebSocket connection
7
+ *
8
+ * Forwards argv to the server untouched — the command tree is never parsed
9
+ * here, so this client stays valid as the server's commands change. Renderers
10
+ * are matched by the command id the server reports; anything it doesn't
11
+ * recognise falls back to JSON.
12
+ *
13
+ * `capabilities` are the functions this client agrees to run on the server's
14
+ * behalf (a git sha, a local path). It is an allowlist, not a convenience —
15
+ * nothing outside it is reachable from the server. A bare function is
16
+ * unclassified and so needs approval before every call; write
17
+ * `{ execute, needsApproval: false }` for one that may run unattended.
8
18
  */
9
- export declare function PikkuCLIClient(ws: WebSocket, args?: string[]): Promise<void>;
19
+ export declare function PikkuCLIClient(ws: WebSocket, args?: string[], capabilities?: Capabilities): Promise<number>;
10
20
  export default PikkuCLIClient;
@@ -1,24 +1,33 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.92
2
+ * This file was generated by @pikku/cli@0.12.96
3
3
  */
4
- import { executeCLIViaChannel } from '@pikku/core/cli/channel';
4
+ import { executeRawCLIViaChannel } from '@pikku/core/cli/channel';
5
5
  import { CorePikkuWebsocket } from '@pikku/websocket';
6
- import '../pikku-bootstrap.gen.js';
7
6
  import { defaultCLIRenderer } from '../../src/services.js';
8
7
  /**
9
8
  * Pikku CLI Client (via WebSocket Channel)
10
- * Executes CLI commands over a WebSocket connection
9
+ *
10
+ * Forwards argv to the server untouched — the command tree is never parsed
11
+ * here, so this client stays valid as the server's commands change. Renderers
12
+ * are matched by the command id the server reports; anything it doesn't
13
+ * recognise falls back to JSON.
14
+ *
15
+ * `capabilities` are the functions this client agrees to run on the server's
16
+ * behalf (a git sha, a local path). It is an allowlist, not a convenience —
17
+ * nothing outside it is reachable from the server. A bare function is
18
+ * unclassified and so needs approval before every call; write
19
+ * `{ execute, needsApproval: false }` for one that may run unattended.
11
20
  */
12
- export async function PikkuCLIClient(ws, args) {
21
+ export async function PikkuCLIClient(ws, args, capabilities = {}) {
13
22
  // Create Pikku WebSocket wrapper
14
23
  const pikkuWS = new CorePikkuWebsocket(ws);
15
24
  // Register renderers for CLI commands
16
25
  const renderers = {};
17
- await executeCLIViaChannel({
18
- programName: 'pikku',
26
+ return executeRawCLIViaChannel({
19
27
  pikkuWS,
20
28
  args,
21
29
  renderers,
30
+ capabilities,
22
31
  defaultRenderer: defaultCLIRenderer,
23
32
  });
24
33
  }
@@ -65,9 +74,10 @@ if (import.meta.url === `file://${process.argv[1]}`) {
65
74
  else {
66
75
  ws = new WebSocket(url);
67
76
  }
68
- PikkuCLIClient(ws, process.argv.slice(2)).catch(error => {
77
+ PikkuCLIClient(ws, process.argv.slice(2))
78
+ .then((exitCode) => process.exit(exitCode))
79
+ .catch(error => {
69
80
  console.error('Fatal channel CLI error:', error);
70
- // TODO: We get an error code even when it exists cleanly, investigate
71
- // process.exit(1)
81
+ process.exit(1);
72
82
  });
73
83
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.92
2
+ * This file was generated by @pikku/cli@0.12.96
3
3
  */
4
4
  import contractsMeta from './pikku-cli-contracts-meta.gen.json';
5
5
  export default contractsMeta;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.92
2
+ * This file was generated by @pikku/cli@0.12.96
3
3
  */
4
4
  import contractsMeta from './pikku-cli-contracts-meta.gen.json' with { type: 'json' };
5
5
  export default contractsMeta;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.92
2
+ * This file was generated by @pikku/cli@0.12.96
3
3
  */
4
4
  /**
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.92
2
+ * This file was generated by @pikku/cli@0.12.96
3
3
  */
4
4
  /**
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.92
2
+ * This file was generated by @pikku/cli@0.12.96
3
3
  */
4
4
  import { pikkuState } from '@pikku/core/internal';
5
5
  import metaData from './pikku-cli-wirings-meta.gen.json' with { type: 'json' };
@@ -304,6 +304,59 @@
304
304
  }
305
305
  }
306
306
  },
307
+ "roles": {
308
+ "pikkuFuncId": "",
309
+ "positionals": [],
310
+ "options": {},
311
+ "description": "Inspect and maintain the roles declared with defineSystemRole",
312
+ "subcommands": {
313
+ "audit": {
314
+ "pikkuFuncId": "rolesAudit",
315
+ "positionals": [],
316
+ "options": {},
317
+ "description": "Report system roles in the database that are no longer declared in code, and how many people hold them"
318
+ },
319
+ "prune": {
320
+ "pikkuFuncId": "rolesPrune",
321
+ "positionals": [],
322
+ "options": {
323
+ "yes": {
324
+ "description": "Actually delete. Without it, prune only reports the blast radius",
325
+ "short": "y",
326
+ "default": false
327
+ }
328
+ },
329
+ "description": "Remove system roles that are no longer declared in code, cascading them out of every user grant"
330
+ }
331
+ }
332
+ },
333
+ "knowledge": {
334
+ "pikkuFuncId": "",
335
+ "positionals": [],
336
+ "options": {},
337
+ "description": "Inspect and maintain the knowledge base — what this app is, in the language its users use",
338
+ "subcommands": {
339
+ "validate": {
340
+ "pikkuFuncId": "knowledgeValidate",
341
+ "positionals": [],
342
+ "options": {},
343
+ "renderName": "renderKnowledgeValidate",
344
+ "description": "Check the knowledge base against the app-project profile, including every resource: reference"
345
+ },
346
+ "index": {
347
+ "pikkuFuncId": "knowledgeIndex",
348
+ "positionals": [],
349
+ "options": {
350
+ "check": {
351
+ "description": "Report stale indexes without writing anything, for use as a CI gate",
352
+ "default": false
353
+ }
354
+ },
355
+ "renderName": "renderKnowledgeIndex",
356
+ "description": "Refresh every index.md so each section lists the notes actually in it"
357
+ }
358
+ }
359
+ },
307
360
  "workspace": {
308
361
  "pikkuFuncId": "",
309
362
  "positionals": [],
@@ -353,9 +406,22 @@
353
406
  "default": false
354
407
  },
355
408
  "browser": {
356
- "description": "Run scenarios with browser steps. --no-browser skips them (they are reported as skipped, not failed)",
409
+ "description": "Shorthand for --run default when false: takes the server-side path instead of driving a browser",
357
410
  "default": true
358
411
  },
412
+ "run": {
413
+ "description": "Which surface every actor drives the system through: 'browser' (as a human), 'cli' (over the websocket), or 'default' (server-side, the fast path)",
414
+ "default": "default",
415
+ "choices": [
416
+ "cli",
417
+ "browser",
418
+ "default"
419
+ ]
420
+ },
421
+ "strict": {
422
+ "description": "Fail rather than pass a `then` that has no witness for --run, i.e. an assertion nobody checked on the surface its prose claims",
423
+ "default": false
424
+ },
359
425
  "spawn": {
360
426
  "description": "Start `pikku dev` on the environment's apiUrl for the run and stop it afterwards. Without it, the environment must already be serving",
361
427
  "default": false
@@ -375,7 +441,7 @@
375
441
  "description": "Override the environment's appUrl for this run (the frontend browser steps navigate against)"
376
442
  }
377
443
  },
378
- "description": "Run scenarios against a configured environment (scenarios.environments in pikku.config.json). Actor secret comes from SCENARIO_ACTOR_SECRET.",
444
+ "description": "Run scenarios against a configured environment (environments in pikku.config.json). Actor secret comes from SCENARIO_ACTOR_SECRET.",
379
445
  "parameters": "<environment>"
380
446
  },
381
447
  "list": {
@@ -386,6 +452,90 @@
386
452
  }
387
453
  }
388
454
  },
455
+ "persona": {
456
+ "pikkuFuncId": "",
457
+ "positionals": [],
458
+ "options": {},
459
+ "description": "The people this app is for, and running one against a real stage",
460
+ "subcommands": {
461
+ "run": {
462
+ "pikkuFuncId": "personaRun",
463
+ "positionals": [
464
+ {
465
+ "name": "environment",
466
+ "required": true
467
+ },
468
+ {
469
+ "name": "persona",
470
+ "required": true
471
+ }
472
+ ],
473
+ "options": {
474
+ "disposition": {
475
+ "description": "How they behave: realistic (default), careless, newcomer, stale, auditor, adversarial",
476
+ "short": "d"
477
+ },
478
+ "goals": {
479
+ "description": "Comma-separated goals in your own words, run alongside the persona's own and the ones derived from scenarios"
480
+ },
481
+ "steps": {
482
+ "description": "Model turns before it stops (default 40)"
483
+ },
484
+ "mutations": {
485
+ "description": "Non-read calls before it stops"
486
+ },
487
+ "duration": {
488
+ "description": "Wall clock before it stops, e.g. '30m'"
489
+ },
490
+ "seed": {
491
+ "description": "Replay a previous run — the same seed schedules the same run"
492
+ },
493
+ "model": {
494
+ "description": "Model they think with. Defaults to scenarios.model in pikku.config.json"
495
+ },
496
+ "allowApproval": {
497
+ "description": "Offer the endpoints the app marked as needing a human’s approval. Off by default: those are the ones that spend money"
498
+ },
499
+ "skipRoleCheck": {
500
+ "description": "Start without verifying the declared roles against the stage. For a target whose auth reports roles somewhere pikku cannot read — findings from an unverified run may be seed drift rather than product bugs"
501
+ },
502
+ "apiUrl": {
503
+ "description": "Override the environment's apiUrl for this run — for a target that only exists at run time, such as a freshly deployed sandbox"
504
+ },
505
+ "out": {
506
+ "description": "Write the whole run — every step, response and finding — as JSON to this path"
507
+ }
508
+ },
509
+ "description": "Sign in as a declared persona and work the API in character against a configured environment. Not a test runner: it asserts nothing and reports what came back that should not have. The sign-in secret comes from SCENARIO_ACTOR_SECRET.",
510
+ "parameters": "<environment> <persona>"
511
+ },
512
+ "sync": {
513
+ "pikkuFuncId": "personaSync",
514
+ "positionals": [
515
+ {
516
+ "name": "environment",
517
+ "required": true
518
+ }
519
+ ],
520
+ "options": {
521
+ "dryRun": {
522
+ "description": "Report who would be provisioned, with which roles, and why anyone was skipped — without touching anything"
523
+ },
524
+ "apiUrl": {
525
+ "description": "Override the environment's apiUrl — for a target that only exists at run time, such as a freshly deployed sandbox"
526
+ }
527
+ },
528
+ "description": "Provision the declared personas into an environment: create each account and apply the roles it declares. Additive — it never revokes. Needs both the environment's API (to sign in) and its database (to write the grants), and the sign-in secret from SCENARIO_ACTOR_SECRET.",
529
+ "parameters": "<environment>"
530
+ },
531
+ "list": {
532
+ "pikkuFuncId": "personaList",
533
+ "positionals": [],
534
+ "options": {},
535
+ "description": "List the declared personas — who each one is, what they may do, and what they are trying to get done"
536
+ }
537
+ }
538
+ },
389
539
  "fabric": {
390
540
  "pikkuFuncId": "",
391
541
  "positionals": [],
@@ -1679,6 +1829,10 @@
1679
1829
  "description": "Fail the build on critical diagnostics. Always on; accepted for symmetry with --fail-on-error/--fail-on-warn.",
1680
1830
  "default": true
1681
1831
  },
1832
+ "strictMeta": {
1833
+ "description": "Fail the build when an AI agent's tool has no description. Without one the model is offered the tool under its own name, so this is a quality gate rather than a correctness one — hence off by default. A 'title' does not satisfy it.",
1834
+ "default": false
1835
+ },
1682
1836
  "tsc": {
1683
1837
  "description": "After codegen, run a real tsc --noEmit over the project's tsconfig and fail on type errors. Prints full diagnostics with code frames. Off by default.",
1684
1838
  "default": false
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.92
2
+ * This file was generated by @pikku/cli@0.12.96
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.92
2
+ * This file was generated by @pikku/cli@0.12.96
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.92
2
+ * This file was generated by @pikku/cli@0.12.96
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.92
2
+ * This file was generated by @pikku/cli@0.12.96
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.92
2
+ * This file was generated by @pikku/cli@0.12.96
3
3
  */
4
4
  import type { FlattenedRPCMap } from '../rpc/pikku-rpc-wirings-map.internal.gen.js';
5
5
  export type NodeCategory = never;