@pikku/cli 0.12.93 → 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 (180) hide show
  1. package/console-app/assets/{index-CmAplHjZ.js → index-CeQodYfg.js} +149 -149
  2. package/console-app/assets/{index-BYj7ZbUU.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 +62 -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 +129 -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 +138 -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 +7 -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 +13 -3
  56. package/dist/.pikku/schemas/schemas/PersonaRunInput.schema.json +1 -0
  57. package/dist/.pikku/schemas/schemas/PersonaSyncInput.schema.json +1 -0
  58. package/dist/.pikku/schemas/schemas/PikkuCLIConfig.schema.json +1 -1
  59. package/dist/.pikku/schemas/schemas/PikkuPersonasInput.schema.json +1 -0
  60. package/dist/.pikku/schemas/schemas/PikkuRolesInput.schema.json +1 -0
  61. package/dist/.pikku/schemas/schemas/RolesAuditInput.schema.json +1 -0
  62. package/dist/.pikku/schemas/schemas/RolesPruneInput.schema.json +1 -0
  63. package/dist/.pikku/scopes/pikku-personas-meta.gen.json +1 -0
  64. package/dist/.pikku/scopes/pikku-personas.gen.d.ts +36 -0
  65. package/dist/.pikku/scopes/pikku-personas.gen.js +17 -0
  66. package/dist/.pikku/scopes/pikku-roles-meta.gen.json +1 -0
  67. package/dist/.pikku/scopes/pikku-roles.gen.d.ts +30 -0
  68. package/dist/.pikku/scopes/pikku-roles.gen.js +18 -0
  69. package/dist/.pikku/scopes/pikku-scope-types.gen.d.ts +4 -2
  70. package/dist/.pikku/scopes/pikku-scope-types.gen.js +3 -2
  71. package/dist/.pikku/scopes/pikku-scopes.gen.d.ts +1 -1
  72. package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts +2 -2
  73. package/dist/.pikku/secrets/pikku-secret-types.gen.js +2 -2
  74. package/dist/.pikku/secrets/pikku-secrets.gen.d.ts +1 -1
  75. package/dist/.pikku/secrets/pikku-secrets.gen.js +1 -1
  76. package/dist/.pikku/trigger/pikku-trigger-types.gen.d.ts +1 -1
  77. package/dist/.pikku/trigger/pikku-trigger-types.gen.js +1 -1
  78. package/dist/.pikku/variables/pikku-variable-types.gen.d.ts +2 -2
  79. package/dist/.pikku/variables/pikku-variable-types.gen.js +2 -2
  80. package/dist/.pikku/variables/pikku-variables.gen.d.ts +1 -1
  81. package/dist/.pikku/variables/pikku-variables.gen.js +1 -1
  82. package/dist/.pikku/workflow/meta/allWorkflow.gen.json +27 -3
  83. package/dist/.pikku/workflow/pikku-personas.gen.d.ts +15 -0
  84. package/dist/.pikku/workflow/pikku-personas.gen.js +17 -0
  85. package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +96 -19
  86. package/dist/.pikku/workflow/pikku-workflow-types.gen.js +22 -2
  87. package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +1 -1
  88. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +1 -1
  89. package/dist/bin/pikku-bin.mjs +2 -2
  90. package/dist/bin/pikku.js +0 -0
  91. package/dist/src/cli.wiring.js +101 -2
  92. package/dist/src/deploy/analyzer/analyzer.js +14 -0
  93. package/dist/src/deploy/analyzer/manifest.d.ts +11 -0
  94. package/dist/src/fabric/functions/validate.function.js +4 -4
  95. package/dist/src/functions/commands/bootstrap.js +3 -0
  96. package/dist/src/functions/commands/dev-ai-runner.d.ts +16 -4
  97. package/dist/src/functions/commands/dev-ai-runner.js +63 -29
  98. package/dist/src/functions/commands/dev.js +9 -4
  99. package/dist/src/functions/commands/enable.js +15 -19
  100. package/dist/src/functions/commands/{scenario-environment.d.ts → environment.d.ts} +9 -6
  101. package/dist/src/functions/commands/{scenario-environment.js → environment.js} +5 -4
  102. package/dist/src/functions/commands/new-addon.js +12 -12
  103. package/dist/src/functions/commands/persona-sync.d.ts +33 -0
  104. package/dist/src/functions/commands/persona-sync.js +151 -0
  105. package/dist/src/functions/commands/persona.d.ts +58 -0
  106. package/dist/src/functions/commands/persona.js +217 -0
  107. package/dist/src/functions/commands/roles-audit.d.ts +1 -0
  108. package/dist/src/functions/commands/roles-audit.js +37 -0
  109. package/dist/src/functions/commands/roles-prune.d.ts +16 -0
  110. package/dist/src/functions/commands/roles-prune.js +52 -0
  111. package/dist/src/functions/commands/roles-shared.d.ts +40 -0
  112. package/dist/src/functions/commands/roles-shared.js +77 -0
  113. package/dist/src/functions/commands/scenario-browser.d.ts +3 -3
  114. package/dist/src/functions/commands/scenario-browser.js +1 -1
  115. package/dist/src/functions/commands/scenario-ladder.d.ts +44 -2
  116. package/dist/src/functions/commands/scenario-ladder.js +51 -2
  117. package/dist/src/functions/commands/scenario.d.ts +7 -0
  118. package/dist/src/functions/commands/scenario.js +79 -17
  119. package/dist/src/functions/commands/scopes-shared.d.ts +8 -0
  120. package/dist/src/functions/commands/scopes-shared.js +1 -1
  121. package/dist/src/functions/commands/serve.js +7 -3
  122. package/dist/src/functions/commands/virtual-user-formatter.d.ts +30 -0
  123. package/dist/src/functions/commands/virtual-user-formatter.js +65 -0
  124. package/dist/src/functions/db/local-db.js +38 -1
  125. package/dist/src/functions/validate/workspace-validate.js +1 -1
  126. package/dist/src/functions/wirings/ai-agent/pikku-command-public-agent.js +2 -1
  127. package/dist/src/functions/wirings/ai-agent/serialize-public-agent.js +1 -0
  128. package/dist/src/functions/wirings/auth/serialize-auth-gen.d.ts +2 -2
  129. package/dist/src/functions/wirings/auth/serialize-auth-gen.js +8 -8
  130. package/dist/src/functions/wirings/cli/serialize-channel-cli-client.d.ts +7 -3
  131. package/dist/src/functions/wirings/cli/serialize-channel-cli-client.js +32 -18
  132. package/dist/src/functions/wirings/cli/serialize-channel-cli.js +63 -6
  133. package/dist/src/functions/wirings/console/serialize-console-functions.js +4 -7
  134. package/dist/src/functions/wirings/functions/serialize-function-types.js +88 -28
  135. package/dist/src/functions/wirings/middleware/serialize-middleware-imports.js +25 -9
  136. package/dist/src/functions/wirings/package/serialize-package-types.js +5 -3
  137. package/dist/src/functions/wirings/personas/pikku-command-personas.d.ts +7 -0
  138. package/dist/src/functions/wirings/personas/pikku-command-personas.js +43 -0
  139. package/dist/src/functions/wirings/personas/serialize-personas-types.d.ts +18 -0
  140. package/dist/src/functions/wirings/personas/serialize-personas-types.js +76 -0
  141. package/dist/src/functions/wirings/realtime/pikku-command-events-scaffold.js +2 -1
  142. package/dist/src/functions/wirings/roles/pikku-command-roles.d.ts +7 -0
  143. package/dist/src/functions/wirings/roles/pikku-command-roles.js +33 -0
  144. package/dist/src/functions/wirings/roles/serialize-roles-types.d.ts +14 -0
  145. package/dist/src/functions/wirings/roles/serialize-roles-types.js +55 -0
  146. package/dist/src/functions/wirings/rpc/pikku-command-public-rpc.js +2 -1
  147. package/dist/src/functions/wirings/scenarios/register-scenario-instrumentation.d.ts +3 -3
  148. package/dist/src/functions/wirings/scenarios/register-scenario-instrumentation.js +3 -3
  149. package/dist/src/functions/wirings/scopes/serialize-scopes-types.d.ts +1 -1
  150. package/dist/src/functions/wirings/scopes/serialize-scopes-types.js +1 -1
  151. package/dist/src/functions/wirings/user-admin/pikku-command-user-admin-functions.js +2 -1
  152. package/dist/src/functions/wirings/user-admin/serialize-user-admin-functions.js +2 -2
  153. package/dist/src/functions/wirings/workflow/pikku-command-workflow-routes.js +2 -1
  154. package/dist/src/functions/wirings/workflow/pikku-command-workflow.js +13 -13
  155. package/dist/src/functions/wirings/workflow/serialize-personas.d.ts +10 -0
  156. package/dist/src/functions/wirings/workflow/serialize-personas.js +46 -0
  157. package/dist/src/functions/wirings/workflow/serialize-scenario-step-map.js +11 -2
  158. package/dist/src/functions/wirings/workflow/serialize-workflow-types.js +165 -29
  159. package/dist/src/functions/workflows/all.workflow.js +7 -1
  160. package/dist/src/server/content-signing-jwt.d.ts +13 -0
  161. package/dist/src/server/content-signing-jwt.js +51 -0
  162. package/dist/src/server/dev-server-runner.interface.d.ts +10 -2
  163. package/dist/src/server/node-server-runner.d.ts +2 -2
  164. package/dist/src/server/node-server-runner.js +2 -1
  165. package/dist/src/services.d.ts +3 -1
  166. package/dist/src/services.js +2 -1
  167. package/dist/src/utils/pikku-cli-config.js +45 -2
  168. package/dist/src/utils/resolve-personas.d.ts +32 -0
  169. package/dist/src/utils/resolve-personas.js +46 -0
  170. package/dist/src/utils/resolve-scaffold-feature.d.ts +19 -0
  171. package/dist/src/utils/resolve-scaffold-feature.js +49 -0
  172. package/dist/tsconfig.tsbuildinfo +1 -1
  173. package/package.json +17 -14
  174. package/dist/.pikku/schemas/schemas/ScenarioRunInput.schema.json +0 -1
  175. package/dist/.pikku/workflow/pikku-scenario-actors.gen.d.ts +0 -19
  176. package/dist/.pikku/workflow/pikku-scenario-actors.gen.js +0 -17
  177. package/dist/src/functions/wirings/workflow/serialize-scenario-actors.d.ts +0 -2
  178. package/dist/src/functions/wirings/workflow/serialize-scenario-actors.js +0 -40
  179. package/dist/src/utils/resolve-scenario-actors.d.ts +0 -23
  180. package/dist/src/utils/resolve-scenario-actors.js +0 -74
@@ -1,40 +0,0 @@
1
- export const serializeScenarioActors = (actors, agentMapImportPath, rpcMapImportPath) => {
2
- return `/** Scenario actors declared in pikku.config.json (\`scenarios.actors\`) */
3
- import {
4
- createHttpScenarioActors,
5
- type HttpScenarioActorsConfig,
6
- type ScenarioActor,
7
- type ScenarioActorConfig,
8
- } from '@pikku/core/services'
9
- import type { AgentMap } from '${agentMapImportPath}'
10
- import type { FlattenedRPCMap } from '${rpcMapImportPath}'
11
-
12
- export const scenarioActorConfigs = ${JSON.stringify(actors, null, 2)} as const satisfies Record<string, ScenarioActorConfig>
13
-
14
- export type ScenarioActorName = keyof typeof scenarioActorConfigs
15
-
16
- /**
17
- * The same registry as a list, widened to \`ScenarioActorConfig\`. Iterating
18
- * \`scenarioActorConfigs\` directly yields the literal type of each entry, on
19
- * which an optional field an actor did not declare does not exist — so a seed
20
- * reading \`scopes\`/\`roles\` off every actor needs this instead.
21
- */
22
- export const scenarioActorList: ScenarioActorConfig[] = Object.values(
23
- scenarioActorConfigs
24
- )
25
-
26
- export type AgentName = keyof AgentMap & string
27
- export type TypedScenarioActors = Record<
28
- ScenarioActorName,
29
- ScenarioActor<AgentName, FlattenedRPCMap>
30
- >
31
-
32
- export const createScenarioActors = (
33
- options: Omit<HttpScenarioActorsConfig, 'actors'>
34
- ): TypedScenarioActors =>
35
- createHttpScenarioActors({
36
- ...options,
37
- actors: scenarioActorConfigs,
38
- }) as TypedScenarioActors
39
- `;
40
- };
@@ -1,23 +0,0 @@
1
- import type { PikkuCLIConfig } from '../../types/config.js';
2
- type ScenariosConfig = NonNullable<PikkuCLIConfig['scenarios']>;
3
- type ActorsConfig = NonNullable<ScenariosConfig['actors']>;
4
- type ActorConfig = ActorsConfig[string];
5
- /**
6
- * The actor registry a run actually sees: every declared actor, plus one
7
- * materialised actor for each persona nobody declared an actor for.
8
- *
9
- * A persona is the KIND of person (its `description`); an actor is one BODY
10
- * that signs in, with an email of its own. Most apps want exactly one body per
11
- * kind, so declaring the persona is enough — this fills in the actor. You only
12
- * write an actor by hand when a scenario needs TWO of the same kind, which is
13
- * what tenant-isolation and peer-sharing scenarios are made of.
14
- *
15
- * Every consumer must resolve through here rather than reading
16
- * `config.scenarios.actors` directly: codegen emits `scenarioActorConfigs` from
17
- * it (and `ScenarioActorName` is a `keyof` over that literal, so an actor missing
18
- * at codegen time can never be referenced in a typed step), while `scenario run`
19
- * builds the HTTP and Playwright actor maps from it. Those were already three
20
- * separate reads of the same field before personas existed.
21
- */
22
- export declare const resolveScenarioActors: (scenarios: ScenariosConfig | undefined) => ActorsConfig;
23
- export type { ActorConfig as ResolvedScenarioActorConfig };
@@ -1,74 +0,0 @@
1
- /** Domain for the email of an actor nobody declared. Synthetic either way. */
2
- const AUTO_ACTOR_EMAIL_DOMAIN = 'actors.local';
3
- /** `orgAdmin` → `org-admin`, so a derived email reads like an email. */
4
- const kebab = (key) => key
5
- .replace(/([a-z0-9])([A-Z])/g, '$1-$2')
6
- .replace(/[^a-zA-Z0-9]+/g, '-')
7
- .toLowerCase();
8
- /**
9
- * The actor registry a run actually sees: every declared actor, plus one
10
- * materialised actor for each persona nobody declared an actor for.
11
- *
12
- * A persona is the KIND of person (its `description`); an actor is one BODY
13
- * that signs in, with an email of its own. Most apps want exactly one body per
14
- * kind, so declaring the persona is enough — this fills in the actor. You only
15
- * write an actor by hand when a scenario needs TWO of the same kind, which is
16
- * what tenant-isolation and peer-sharing scenarios are made of.
17
- *
18
- * Every consumer must resolve through here rather than reading
19
- * `config.scenarios.actors` directly: codegen emits `scenarioActorConfigs` from
20
- * it (and `ScenarioActorName` is a `keyof` over that literal, so an actor missing
21
- * at codegen time can never be referenced in a typed step), while `scenario run`
22
- * builds the HTTP and Playwright actor maps from it. Those were already three
23
- * separate reads of the same field before personas existed.
24
- */
25
- export const resolveScenarioActors = (scenarios) => {
26
- const personas = scenarios?.personas ?? {};
27
- const declared = scenarios?.actors ?? {};
28
- const resolved = {};
29
- for (const [name, actor] of Object.entries(declared)) {
30
- // An actor named after a persona belongs to it without having to say so —
31
- // the common case is one body per kind and they share the obvious name.
32
- const persona = actor.persona ?? (personas[name] ? name : undefined);
33
- if (persona && !personas[persona]) {
34
- throw new Error(`Scenario actor '${name}' names persona '${persona}', which is not declared in scenarios.personas` +
35
- `${Object.keys(personas).length ? ` (declared: ${Object.keys(personas).join(', ')})` : ' (no personas are declared)'}`);
36
- }
37
- resolved[name] = persona ? { ...actor, persona } : actor;
38
- }
39
- const claimed = new Set(Object.values(resolved)
40
- .map((actor) => actor.persona)
41
- .filter((persona) => Boolean(persona)));
42
- for (const [persona, config] of Object.entries(personas)) {
43
- if (claimed.has(persona))
44
- continue;
45
- // A `system` persona is the app acting on its own. There is nobody to sign
46
- // in, so minting an actor for it would only produce a scenario that tries.
47
- // Declaring one by hand is still allowed — a service account is a body.
48
- if (config.kind === 'system')
49
- continue;
50
- resolved[persona] = {
51
- persona,
52
- email: `${kebab(persona)}@${AUTO_ACTOR_EMAIL_DOMAIN}`,
53
- };
54
- }
55
- assertDistinctEmails(resolved);
56
- return resolved;
57
- };
58
- /**
59
- * Two actors sharing an email are the same user row — sign-in keys on email
60
- * alone (see `HttpScenarioActors.signIn`). That silently collapses exactly the
61
- * scenarios a second body exists for: an isolation scenario whose two owners
62
- * are one user passes by construction and proves nothing.
63
- */
64
- const assertDistinctEmails = (actors) => {
65
- const byEmail = new Map();
66
- for (const [name, actor] of Object.entries(actors)) {
67
- const email = actor.email.toLowerCase();
68
- const owner = byEmail.get(email);
69
- if (owner) {
70
- throw new Error(`Scenario actors '${owner}' and '${name}' share the email '${actor.email}' — they would sign in as the same user`);
71
- }
72
- byEmail.set(email, name);
73
- }
74
- };