@pikku/addon-console 0.12.34 → 0.12.36

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 (123) hide show
  1. package/dist/.pikku/addon/pikku-addon-types.gen.d.ts +1 -1
  2. package/dist/.pikku/addon/pikku-addon-types.gen.js +1 -1
  3. package/dist/.pikku/addon/pikku-package.gen.js +1 -1
  4. package/dist/.pikku/agent/pikku-agent-map.gen.d.ts +1 -1
  5. package/dist/.pikku/agent/pikku-agent-types.gen.d.ts +1 -1
  6. package/dist/.pikku/auth/auth.types.d.ts +1 -1
  7. package/dist/.pikku/auth/auth.types.js +1 -1
  8. package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +1 -1
  9. package/dist/.pikku/channel/pikku-channel-types.gen.js +1 -1
  10. package/dist/.pikku/console/pikku-node-types.gen.d.ts +1 -1
  11. package/dist/.pikku/function/pikku-function-types.gen.d.ts +55 -20
  12. package/dist/.pikku/function/pikku-function-types.gen.d.ts.map +1 -1
  13. package/dist/.pikku/function/pikku-function-types.gen.js +27 -1
  14. package/dist/.pikku/function/pikku-function-types.gen.js.map +1 -1
  15. package/dist/.pikku/function/pikku-functions-meta-verbose.gen.json +2184 -0
  16. package/dist/.pikku/function/pikku-functions-meta.gen.js +1 -1
  17. package/dist/.pikku/function/pikku-functions-meta.gen.json +35 -27
  18. package/dist/.pikku/function/pikku-functions.gen.js +1 -1
  19. package/dist/.pikku/http/pikku-http-types.gen.d.ts +1 -1
  20. package/dist/.pikku/http/pikku-http-types.gen.js +1 -1
  21. package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts +1 -1
  22. package/dist/.pikku/mcp/pikku-mcp-types.gen.js +1 -1
  23. package/dist/.pikku/pikku-bootstrap-scenarios.gen.d.ts +1 -1
  24. package/dist/.pikku/pikku-bootstrap-scenarios.gen.js +1 -1
  25. package/dist/.pikku/pikku-bootstrap.gen.d.ts +1 -1
  26. package/dist/.pikku/pikku-bootstrap.gen.js +1 -1
  27. package/dist/.pikku/pikku-meta-service.gen.d.ts +1 -1
  28. package/dist/.pikku/pikku-meta-service.gen.js +1 -1
  29. package/dist/.pikku/pikku-services.gen.d.ts +1 -1
  30. package/dist/.pikku/pikku-types.gen.d.ts +1 -1
  31. package/dist/.pikku/pikku-types.gen.js +1 -1
  32. package/dist/.pikku/queue/pikku-queue-types.gen.d.ts +1 -1
  33. package/dist/.pikku/queue/pikku-queue-types.gen.js +1 -1
  34. package/dist/.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts +2 -1
  35. package/dist/.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +2 -1
  36. package/dist/.pikku/rpc/pikku-rpc-wirings-map.remote.gen.d.ts +2 -1
  37. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +1 -1
  38. package/dist/.pikku/scenarios/pikku-scenario-functions-meta.gen.js +1 -1
  39. package/dist/.pikku/scenarios/pikku-scenario-functions.gen.d.ts +1 -1
  40. package/dist/.pikku/scenarios/pikku-scenario-wirings-meta.gen.js +1 -1
  41. package/dist/.pikku/scenarios/pikku-scenario-wirings.gen.d.ts +1 -1
  42. package/dist/.pikku/scenarios/schemas/register.gen.d.ts +1 -1
  43. package/dist/.pikku/scenarios/schemas/register.gen.js +1 -1
  44. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts +1 -1
  45. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +1 -1
  46. package/dist/.pikku/schemas/register.gen.js +1 -1
  47. package/dist/.pikku/schemas/schemas/AddonMetaPage.schema.json +1 -1
  48. package/dist/.pikku/schemas/schemas/AddonPackageInfo.schema.json +1 -1
  49. package/dist/.pikku/schemas/schemas/AllMeta.schema.json +1 -1
  50. package/dist/.pikku/schemas/schemas/GetFunctionsMetaOutput.schema.json +1 -1
  51. package/dist/.pikku/schemas/schemas/GetWorkflowMetaByIdOutput.schema.json +1 -1
  52. package/dist/.pikku/schemas/schemas/ListWebhookDeliveriesOutput.schema.json +1 -1
  53. package/dist/.pikku/schemas/schemas/ScopeListRolesOutput.schema.json +1 -1
  54. package/dist/.pikku/schemas/schemas/SecurityAuditReport.schema.json +1 -1
  55. package/dist/.pikku/schemas/schemas/WebhookDeliveryWithAttempts.schema.json +1 -1
  56. package/dist/.pikku/scopes/pikku-personas-meta.gen.json +1 -0
  57. package/dist/.pikku/scopes/pikku-personas.gen.d.ts +37 -0
  58. package/dist/.pikku/scopes/pikku-personas.gen.d.ts.map +1 -0
  59. package/dist/.pikku/scopes/pikku-personas.gen.js +18 -0
  60. package/dist/.pikku/scopes/pikku-personas.gen.js.map +1 -0
  61. package/dist/.pikku/scopes/pikku-roles-meta.gen.json +1 -0
  62. package/dist/.pikku/scopes/pikku-roles.gen.d.ts +31 -0
  63. package/dist/.pikku/scopes/pikku-roles.gen.d.ts.map +1 -0
  64. package/dist/.pikku/scopes/pikku-roles.gen.js +19 -0
  65. package/dist/.pikku/scopes/pikku-roles.gen.js.map +1 -0
  66. package/dist/.pikku/scopes/pikku-scope-types.gen.d.ts +4 -2
  67. package/dist/.pikku/scopes/pikku-scope-types.gen.d.ts.map +1 -1
  68. package/dist/.pikku/scopes/pikku-scope-types.gen.js +3 -2
  69. package/dist/.pikku/scopes/pikku-scope-types.gen.js.map +1 -1
  70. package/dist/.pikku/scopes/pikku-scopes.gen.d.ts +1 -1
  71. package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts +2 -2
  72. package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts.map +1 -1
  73. package/dist/.pikku/secrets/pikku-secret-types.gen.js +2 -2
  74. package/dist/.pikku/secrets/pikku-secret-types.gen.js.map +1 -1
  75. package/dist/.pikku/secrets/pikku-secrets.gen.d.ts +1 -1
  76. package/dist/.pikku/secrets/pikku-secrets.gen.js +1 -1
  77. package/dist/.pikku/trigger/pikku-trigger-types.gen.d.ts +1 -1
  78. package/dist/.pikku/trigger/pikku-trigger-types.gen.js +1 -1
  79. package/dist/.pikku/variables/pikku-variable-types.gen.d.ts +2 -2
  80. package/dist/.pikku/variables/pikku-variable-types.gen.d.ts.map +1 -1
  81. package/dist/.pikku/variables/pikku-variable-types.gen.js +2 -2
  82. package/dist/.pikku/variables/pikku-variable-types.gen.js.map +1 -1
  83. package/dist/.pikku/variables/pikku-variables.gen.d.ts +1 -1
  84. package/dist/.pikku/variables/pikku-variables.gen.js +1 -1
  85. package/dist/.pikku/workflow/pikku-personas.gen.d.ts +16 -0
  86. package/dist/.pikku/workflow/pikku-personas.gen.d.ts.map +1 -0
  87. package/dist/.pikku/workflow/pikku-personas.gen.js +18 -0
  88. package/dist/.pikku/workflow/pikku-personas.gen.js.map +1 -0
  89. package/dist/.pikku/workflow/pikku-scenario-step-map.gen.d.ts +1 -1
  90. package/dist/.pikku/workflow/pikku-workflow-map.gen.d.ts +1 -1
  91. package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +96 -19
  92. package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts.map +1 -1
  93. package/dist/.pikku/workflow/pikku-workflow-types.gen.js +22 -2
  94. package/dist/.pikku/workflow/pikku-workflow-types.gen.js.map +1 -1
  95. package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +1 -1
  96. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.d.ts +1 -1
  97. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +1 -1
  98. package/dist/src/functions/get-agent-threads.function.d.ts.map +1 -1
  99. package/dist/src/functions/get-agent-threads.function.js +9 -2
  100. package/dist/src/functions/get-agent-threads.function.js.map +1 -1
  101. package/dist/src/functions/get-agent-threads.function.test.d.ts +2 -0
  102. package/dist/src/functions/get-agent-threads.function.test.d.ts.map +1 -0
  103. package/dist/src/functions/get-agent-threads.function.test.js +52 -0
  104. package/dist/src/functions/get-agent-threads.function.test.js.map +1 -0
  105. package/dist/src/functions/install-addon.function.d.ts.map +1 -1
  106. package/dist/src/functions/install-addon.function.js +3 -2
  107. package/dist/src/functions/install-addon.function.js.map +1 -1
  108. package/dist/src/functions/install-addon.function.test.d.ts +2 -0
  109. package/dist/src/functions/install-addon.function.test.d.ts.map +1 -0
  110. package/dist/src/functions/install-addon.function.test.js +28 -0
  111. package/dist/src/functions/install-addon.function.test.js.map +1 -0
  112. package/dist/src/functions/install-openapi-addon.function.d.ts.map +1 -1
  113. package/dist/src/functions/install-openapi-addon.function.js +2 -1
  114. package/dist/src/functions/install-openapi-addon.function.js.map +1 -1
  115. package/dist/src/scopes.js +3 -3
  116. package/dist/src/scopes.js.map +1 -1
  117. package/dist/src/services/wiring.service.d.ts +11 -6
  118. package/dist/src/services/wiring.service.d.ts.map +1 -1
  119. package/dist/src/services/wiring.service.js +5 -3
  120. package/dist/src/services/wiring.service.js.map +1 -1
  121. package/dist/src/services/wiring.service.test.js +2 -0
  122. package/dist/src/services/wiring.service.test.js.map +1 -1
  123. package/package.json +8 -8
@@ -1 +1 @@
1
- { "$schema": "http://json-schema.org/draft-07/schema#", "type": "array", "items": { "$ref": "#/definitions/FunctionMetaWithVersions" }, "definitions": { "FunctionMetaWithVersions": { "type": "object", "additionalProperties": false, "properties": { "version": { "type": "number" }, "versions": { "type": "array", "items": { "$ref": "#/definitions/FunctionVersionEntry" } }, "name": { "type": "string" }, "functionType": { "type": "string", "enum": ["user", "inline", "helper"] }, "funcWrapper": { "type": "string" }, "services": { "$ref": "#/definitions/FunctionServicesMeta" }, "wires": { "$ref": "#/definitions/FunctionWiresMeta" }, "inputs": { "anyOf": [{ "type": "array", "items": { "type": "string" } }, { "type": "null" }] }, "outputs": { "anyOf": [{ "type": "array", "items": { "type": "string" } }, { "type": "null" }] }, "middleware": { "type": "array", "items": { "$ref": "#/definitions/MiddlewareMetadata" } }, "permissions": { "type": "array", "items": { "$ref": "#/definitions/PermissionMetadata" } }, "isDirectFunction": { "type": "boolean" }, "sourceFile": { "type": "string" }, "exportedName": { "type": "string" }, "bodySourceFile": { "type": "string", "description": "File containing the handler body when it differs from sourceFile (imported handlers)" }, "bodyStart": { "type": "number", "description": "1-indexed first line of the handler body (verbose meta; coverage mapping)" }, "bodyEnd": { "type": "number", "description": "1-indexed last line of the handler body (verbose meta; coverage mapping)" }, "pikkuFuncId": { "type": "string" }, "packageName": { "type": "string" }, "title": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "summary": { "type": "string" }, "description": { "type": "string" }, "errors": { "type": "array", "items": { "type": "string" } }, "inputSchemaName": { "type": ["string", "null"] }, "outputSchemaName": { "type": ["string", "null"] }, "scopes": { "type": "array", "items": { "type": "string" }, "description": "Scopes the session must hold to run this function. All are required (AND)." }, "expose": { "type": "boolean" }, "remote": { "type": "boolean" }, "scenarioStep": { "type": "boolean", "description": "A step RPC: a name dispatched by a scenario run and refused everywhere else. It sits alongside `expose` (public) and `remote` as a kind of RPC rather than a separate concept — a step is invoked by name exactly as an RPC is, which is why a run records the step function in its `rpcName`. What makes it its own kind is that it is never network-callable: a step may drive a browser or assert against fixtures." }, "scenario": { "type": "boolean", "description": "The function behind a `pikkuScenario(...)` a scenario's own body, as opposed to the steps it calls. Marked for the same reason as `scenarioStep`: a scenario is only ever run by `pikku scenario run`, so it has to be held back from the app bootstrap and from every deployed unit." }, "mcp": { "type": "boolean" }, "readonly": { "type": "boolean" }, "deploy": { "type": "string", "enum": ["serverless", "server", "auto"] }, "sessionless": { "type": "boolean" }, "workflowQueued": { "type": "boolean", "description": "When true, workflow steps calling this function are dispatched via the queue. No queue service configured is a hard error." }, "workflowRetries": { "type": "number", "description": "Retry count when this function is used as a workflow step." }, "workflowTimeout": { "type": "string", "description": "Timeout when this function is used as a workflow step (e.g. '30s', '5m')." }, "scenarioStepBrowser": { "type": "boolean", "description": "Scenario steps only: this step drives a browser, so the runner must provision one and an actor is mandatory." }, "scenarioStepTemplate": { "type": "string", "description": "Scenario steps only: the prose a reporter renders, with `{placeholders}` filled from the step's recorded input." }, "approvalRequired": { "type": "boolean" }, "approvalDescription": { "type": "string" }, "implementationHash": { "type": "string" }, "contractHash": { "type": "string" }, "inputHash": { "type": "string" }, "outputHash": { "type": "string" } }, "required": ["inputSchemaName", "outputSchemaName", "pikkuFuncId"] }, "FunctionVersionEntry": { "type": "object", "properties": { "version": { "type": "number" }, "inputHash": { "type": "string" }, "outputHash": { "type": "string" } }, "required": ["version", "inputHash", "outputHash"], "additionalProperties": false }, "FunctionServicesMeta": { "type": "object", "properties": { "optimized": { "type": "boolean" }, "services": { "type": "array", "items": { "type": "string" } } }, "required": ["optimized", "services"], "additionalProperties": false }, "FunctionWiresMeta": { "type": "object", "properties": { "optimized": { "type": "boolean" }, "wires": { "type": "array", "items": { "type": "string" } } }, "required": ["optimized", "wires"], "additionalProperties": false }, "MiddlewareMetadata": { "anyOf": [{ "type": "object", "properties": { "type": { "type": "string", "const": "http" }, "route": { "type": "string" } }, "required": ["type", "route"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "tag" }, "tag": { "type": "string" } }, "required": ["type", "tag"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wire" }, "name": { "type": "string" }, "inline": { "type": "boolean" } }, "required": ["type", "name"], "additionalProperties": false }], "description": "Metadata for middleware at any level\n- type: 'http' = HTTP route middleware group (references httpGroup in pikkuState)\n- type: 'tag' = Tag-based middleware group (references tagGroup in pikkuState)\n- type: 'wire' = Wire-level individual middleware" }, "PermissionMetadata": { "type": "object", "properties": { "type": { "type": "string", "const": "wire" }, "name": { "type": "string" }, "inline": { "type": "boolean" } }, "required": ["type", "name"], "additionalProperties": false, "description": "A reference to a permission function a function declares, resolved by name. Used at filter time (e.g. listing agent tools) to run the session-only (pikkuAuth) predicates without request data. Permissions are function-scoped onlythere are no wire- or tag-level permission references." } } }
1
+ { "$schema": "http://json-schema.org/draft-07/schema#", "type": "array", "items": { "$ref": "#/definitions/FunctionMetaWithVersions" }, "definitions": { "FunctionMetaWithVersions": { "type": "object", "additionalProperties": false, "properties": { "version": { "type": "number" }, "versions": { "type": "array", "items": { "$ref": "#/definitions/FunctionVersionEntry" } }, "name": { "type": "string" }, "functionType": { "type": "string", "enum": ["user", "inline", "helper", "remote"], "description": "`remote`: a contract with no local body, answered by a connected client." }, "funcWrapper": { "type": "string" }, "services": { "$ref": "#/definitions/FunctionServicesMeta" }, "wires": { "$ref": "#/definitions/FunctionWiresMeta" }, "inputs": { "anyOf": [{ "type": "array", "items": { "type": "string" } }, { "type": "null" }] }, "outputs": { "anyOf": [{ "type": "array", "items": { "type": "string" } }, { "type": "null" }] }, "middleware": { "type": "array", "items": { "$ref": "#/definitions/MiddlewareMetadata" } }, "permissions": { "type": "array", "items": { "$ref": "#/definitions/PermissionMetadata" } }, "isDirectFunction": { "type": "boolean" }, "sourceFile": { "type": "string" }, "exportedName": { "type": "string" }, "bodySourceFile": { "type": "string", "description": "File containing the handler body when it differs from sourceFile (imported handlers)" }, "bodyStart": { "type": "number", "description": "1-indexed first line of the handler body (verbose meta; coverage mapping)" }, "bodyEnd": { "type": "number", "description": "1-indexed last line of the handler body (verbose meta; coverage mapping)" }, "pikkuFuncId": { "type": "string" }, "packageName": { "type": "string" }, "title": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "summary": { "type": "string" }, "description": { "type": "string" }, "errors": { "type": "array", "items": { "type": "string" } }, "inputSchemaName": { "type": ["string", "null"] }, "outputSchemaName": { "type": ["string", "null"] }, "scopes": { "type": "array", "items": { "type": "string" }, "description": "Scopes the session must hold to run this function. All are required (AND)." }, "expose": { "type": "boolean" }, "auth": { "type": "boolean", "description": "A sessionless function's own `auth: true`. `sessionless` carries the baseline a `pikkuFunc` always requires a session and this carries the tightening a `pikkuSessionlessFunc` applies to itself. Both are needed to know whether a function is gated without running it." }, "selfAuthenticated": { "type": "boolean", "description": "The author's declaration that this function authorizes callers in its own body. Carries no runtime effect — it records a gate codegen cannot see, so an audit is not left to guess whether a sessionless function is open." }, "remote": { "type": "boolean" }, "scenarioStep": { "type": "boolean", "description": "A step RPC: invoked by name only from a scenario run and refused everywhere else, so it is never network-callable." }, "scenario": { "type": "boolean", "description": "The body of a `pikkuScenario(...)`. Only ever run by `pikku scenario run`, so it is held back from the app bootstrap and from every deployed unit." }, "mcp": { "type": "boolean" }, "readonly": { "type": "boolean" }, "deploy": { "type": "string", "enum": ["serverless", "server", "auto"] }, "sessionless": { "type": "boolean" }, "workflowQueued": { "type": "boolean", "description": "When true, workflow steps calling this function are dispatched via the queue. No queue service configured is a hard error." }, "workflowRetries": { "type": "number", "description": "Retry count when this function is used as a workflow step." }, "workflowTimeout": { "type": "string", "description": "Timeout when this function is used as a workflow step (e.g. '30s', '5m')." }, "scenarioStepSurfaces": { "type": "array", "items": { "$ref": "#/definitions/ScenarioSurface" }, "description": "Scenario steps only: which surfaces this step declares a binding for.\n\nThe reporter derives coverage from this — a `then` with no binding for the surface the run targeted was never actually witnessed there, which is a gap worth counting rather than excusing." }, "scenarioStepKind": { "$ref": "#/definitions/ScenarioStepKind", "description": "Scenario steps only: who acts. Absent means `persona` — the ordinary step, and the only kind that existed before the other two.\n\nA `platform` or `addon` step is the app or a third-party system acting, and it must never reach a virtual user's catalogue. That is not tidiness: a virtual user that can invoke \"Stripe's webhook arrives\" can forge its own payment success, and every finding downstream of that is worthless." }, "scenarioStepAddon": { "type": "string", "description": "Addon steps only: the addon whose system acts — `wireAddon`'s `name`." }, "scenarioStepTemplate": { "type": "string", "description": "Scenario steps only: the prose a reporter renders, with `{placeholders}` filled from the step's recorded input." }, "secretBroker": { "type": "boolean", "description": "Keeps the full `SecretService`. Set by the inspector, read by the runner." }, "approvalRequired": { "type": "boolean" }, "approvalDescription": { "type": "string" }, "implementationHash": { "type": "string" }, "contractHash": { "type": "string" }, "inputHash": { "type": "string" }, "outputHash": { "type": "string" } }, "required": ["inputSchemaName", "outputSchemaName", "pikkuFuncId"] }, "FunctionVersionEntry": { "type": "object", "properties": { "version": { "type": "number" }, "inputHash": { "type": "string" }, "outputHash": { "type": "string" } }, "required": ["version", "inputHash", "outputHash"], "additionalProperties": false }, "FunctionServicesMeta": { "type": "object", "properties": { "optimized": { "type": "boolean" }, "services": { "type": "array", "items": { "type": "string" } } }, "required": ["optimized", "services"], "additionalProperties": false }, "FunctionWiresMeta": { "type": "object", "properties": { "optimized": { "type": "boolean" }, "wires": { "type": "array", "items": { "type": "string" } } }, "required": ["optimized", "wires"], "additionalProperties": false }, "MiddlewareMetadata": { "anyOf": [{ "type": "object", "properties": { "type": { "type": "string", "const": "http" }, "route": { "type": "string" } }, "required": ["type", "route"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "tag" }, "tag": { "type": "string" } }, "required": ["type", "tag"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wire" }, "name": { "type": "string" }, "inline": { "type": "boolean" } }, "required": ["type", "name"], "additionalProperties": false }] }, "PermissionMetadata": { "type": "object", "properties": { "type": { "type": "string", "const": "wire" }, "name": { "type": "string" }, "inline": { "type": "boolean" } }, "required": ["type", "name"], "additionalProperties": false, "description": "A reference to a permission function, resolved by name. Function-scoped only: there are no wire- or tag-level permission references." }, "ScenarioSurface": { "type": "string", "enum": ["browser", "cli", "default"], "description": "How an actor drives the system for one step.\n\nA step declares one implementation per surface it supports, and the runner picks between them — so the same ladder can run through a real browser, over the websocket, or entirely server-side.\n\n`default` is the floor: it is what every other surface falls back to, so it can never itself fall back." }, "ScenarioStepKind": { "type": "string", "enum": ["persona", "platform", "addon"], "description": "Who acts in a step.\n\n`persona` is a person driving the system through one of its surfaces — the ordinary `pikkuScenarioStep`. `platform` is the app acting on itself (\"the platform has expired the trial\"), and `addon` is a third-party system acting on it (\"Stripe's webhook arrives\"), contributed by the addon that wraps that service.\n\nThe three are separate declarations rather than a field on one, so the inspector verifies a step's kind by which function was called rather than by trusting a string literal and so an addon package exports only addon steps, which is checkable." } } }
@@ -1 +1 @@
1
- { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "name": { "type": "string" }, "steps": { "type": "array", "items": { "$ref": "#/definitions/WorkflowStepMeta" } }, "context": { "$ref": "#/definitions/WorkflowContext" }, "dsl": { "type": "boolean" }, "expose": { "type": "boolean" }, "scenario": { "type": "boolean" }, "skip": { "type": "string" }, "actors": { "type": "array", "items": { "type": "string" } }, "pikkuFuncId": { "type": "string" }, "packageName": { "type": "string" }, "title": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "summary": { "type": "string" }, "description": { "type": "string" }, "errors": { "type": "array", "items": { "type": "string" } }, "middleware": { "type": "array", "items": { "$ref": "#/definitions/MiddlewareMetadata" } }, "permissions": { "type": "array", "items": { "$ref": "#/definitions/PermissionMetadata" } } }, "required": ["name", "pikkuFuncId", "steps"], "definitions": { "WorkflowStepMeta": { "anyOf": [{ "$ref": "#/definitions/RpcStepMeta" }, { "$ref": "#/definitions/ScenarioStepMeta" }, { "$ref": "#/definitions/BranchStepMeta" }, { "$ref": "#/definitions/ParallelGroupStepMeta" }, { "$ref": "#/definitions/FanoutStepMeta" }, { "$ref": "#/definitions/ReturnStepMeta" }, { "$ref": "#/definitions/InlineStepMeta" }, { "$ref": "#/definitions/SleepStepMeta" }, { "$ref": "#/definitions/CancelStepMeta" }, { "$ref": "#/definitions/SuspendStepMeta" }, { "$ref": "#/definitions/ApprovalStepMeta" }, { "$ref": "#/definitions/SwitchStepMeta" }, { "$ref": "#/definitions/FilterStepMeta" }, { "$ref": "#/definitions/ArrayPredicateStepMeta" }, { "$ref": "#/definitions/SetStepMeta" }], "description": "Workflow step metadata (extracted by inspector)" }, "RpcStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "rpc", "description": "RPC form - generates queue worker" }, "stepName": { "type": "string", "description": "Cache key (stepName from workflow.do)" }, "rpcName": { "type": "string", "description": "RPC to invoke" }, "outputVar": { "type": "string", "description": "Output variable name (if assigned)" }, "inputs": { "anyOf": [{ "type": "object", "additionalProperties": { "$ref": "#/definitions/InputSource" } }, { "type": "string", "const": "passthrough" }], "description": "Input source mappings, or 'passthrough' when entire data is passed" }, "options": { "$ref": "#/definitions/WorkflowStepOptions", "description": "Step options" }, "actor": { "type": "string", "description": "Scenario actor name this step runs as ({ actor: actors.x })" }, "expectEventually": { "type": "boolean", "description": "True for workflow.expectEventually polling steps" } }, "required": ["type", "stepName", "rpcName"], "additionalProperties": false, "description": "RPC step metadata (base form)" }, "InputSource": { "anyOf": [{ "type": "object", "properties": { "from": { "type": "string", "const": "input" }, "path": { "type": "string" } }, "required": ["from", "path"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "outputVar" }, "name": { "type": "string" }, "path": { "type": "string" } }, "required": ["from", "name"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "item" }, "path": { "type": "string" } }, "required": ["from", "path"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "literal" }, "value": {} }, "required": ["from", "value"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "template" }, "parts": { "type": "array", "items": { "type": "string" } }, "expressions": { "type": "array", "items": { "$ref": "#/definitions/InputSource" } } }, "required": ["from", "parts", "expressions"], "additionalProperties": false }], "description": "Input source for step arguments in DSL workflows" }, "WorkflowStepOptions": { "type": "object", "properties": { "description": { "type": "string", "description": "Display name for logs/UI (optional, doesn't affect execution)" }, "retries": { "type": "number", "description": "Number of retry attempts for failed steps (only applies to local execution)" }, "retryDelay": { "type": ["string", "number"], "description": "Delay between retry attempts (e.g., '1s', '2s', '2min')" }, "onError": { "type": "string", "description": "RPC to invoke for compensation when this step fails after exhausting its retries. Mirrors a graph node's `onError`: the handler receives `{ error: { message } }` and the original error is still thrown, so the workflow fails — this is compensation, not recovery." }, "actor": { "$ref": "#/definitions/ScenarioActor", "description": "Run this step as an actor (scenarios). The RPC is sent through the actor's authenticated client over the REAL transport — never dispatched internally — so auth middleware and permissions are exercised end-to-end. The step is recorded durably like any RPC step." } }, "additionalProperties": false, "description": "Workflow step options" }, "ScenarioActor": { "type": "object", "properties": { "name": { "type": "string", "description": "Stable actor name (the key in pikku.config.json's actor registry)." }, "email": { "type": "string", "description": "The actor's user email — flows use it for invites/lookups." } }, "required": ["name", "email"], "additionalProperties": false, "description": "A synthetic user (a user row flagged `actor`) that workflow steps run as over the real transport" }, "ScenarioStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "scenarioStep" }, "stepName": { "type": "string", "description": "Cache key (first argument), ordinal-suffixed by the engine when repeated" }, "stepFunc": { "type": "string", "description": "Registered name of the step function being run" }, "phase": { "$ref": "#/definitions/ScenarioStepPhase", "description": "Which keyword the reporter prefixes — given/when/then, or none for `step`" }, "outputVar": { "type": "string", "description": "Output variable name (if assigned)" }, "inputs": { "anyOf": [{ "type": "object", "additionalProperties": { "$ref": "#/definitions/InputSource" } }, { "type": "string", "const": "passthrough" }], "description": "Input source mappings, or 'passthrough' when entire data is passed" }, "options": { "$ref": "#/definitions/WorkflowStepOptions", "description": "Step options" }, "actor": { "type": "string", "description": "Scenario actor name this step runs as ({ actor: actors.x })" }, "browser": { "type": "boolean", "description": "Mirrors the step function's `browser: true` declaration" } }, "required": ["type", "stepName", "stepFunc", "phase"], "additionalProperties": false, "description": "Scenario step metadata — a call to `scenario.step/given/when/then`.\n\nDistinct from RpcStepMeta on purpose: a step runs locally through runPikkuFunc and must never be treated as dispatchable on the queue/replay path, nor registered as a callable RPC (a browser-driving step must not be network-invocable)." }, "ScenarioStepPhase": { "type": "string", "enum": ["step", "given", "when", "then"], "description": "Which Gherkin-style keyword the reporter prefixes this step with. `step` renders no prefix at all." }, "BranchStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "branch" }, "branches": { "type": "array", "items": { "$ref": "#/definitions/BranchCase" }, "description": "Branches in order: first is \"if\", rest are \"else if\"" }, "elseSteps": { "type": "array", "items": { "$ref": "#/definitions/WorkflowStepMeta" }, "description": "Else branch steps (when no conditions match)" } }, "required": ["type", "branches"], "additionalProperties": false, "description": "Branch step metadata (if/else-if/else control flow)" }, "BranchCase": { "type": "object", "properties": { "condition": { "$ref": "#/definitions/Condition", "description": "Condition for this branch" }, "steps": { "type": "array", "items": { "$ref": "#/definitions/WorkflowStepMeta" }, "description": "Steps to execute when condition is true" } }, "required": ["condition", "steps"], "additionalProperties": false, "description": "A single branch in an if/else-if chain" }, "Condition": { "anyOf": [{ "$ref": "#/definitions/SimpleCondition" }, { "type": "object", "properties": { "type": { "type": "string", "const": "and" }, "conditions": { "type": "array", "items": { "$ref": "#/definitions/Condition" } } }, "required": ["type", "conditions"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "or" }, "conditions": { "type": "array", "items": { "$ref": "#/definitions/Condition" } } }, "required": ["type", "conditions"], "additionalProperties": false }], "description": "Nested condition structure supporting AND/OR operations" }, "SimpleCondition": { "type": "object", "properties": { "type": { "type": "string", "const": "simple" }, "expression": { "type": "string" } }, "required": ["type", "expression"], "additionalProperties": false, "description": "Simple condition expression (leaf node)" }, "ParallelGroupStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "parallel" }, "children": { "type": "array", "items": { "anyOf": [{ "$ref": "#/definitions/RpcStepMeta" }, { "$ref": "#/definitions/ScenarioStepMeta" }] }, "description": "Child steps to execute in parallel" } }, "required": ["type", "children"], "additionalProperties": false, "description": "Parallel group step metadata (Promise.all with multiple steps)" }, "FanoutStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "fanout" }, "stepName": { "type": "string", "description": "Step name for this fanout. Optional: a fanout is not itself a cached step, and node ids are step names — borrowing a body step's name would give the loop and that step the same id, collapsing one onto the other." }, "sourceVar": { "type": "string", "description": "Source array variable name" }, "itemVar": { "type": "string", "description": "Iterator variable name" }, "mode": { "type": "string", "enum": ["parallel", "sequential"], "description": "Execution mode" }, "body": { "type": "array", "items": { "anyOf": [{ "$ref": "#/definitions/RpcStepMeta" }, { "$ref": "#/definitions/SleepStepMeta" }, { "$ref": "#/definitions/SuspendStepMeta" }, { "$ref": "#/definitions/ScenarioStepMeta" }] }, "description": "Steps to execute inline per iteration, in order" }, "timeBetween": { "type": "string", "description": "Time between iterations (sequential mode only)" } }, "required": ["type", "sourceVar", "itemVar", "mode", "body"], "additionalProperties": false, "description": "Fanout step metadata (parallel or sequential iteration)" }, "SleepStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "sleep", "description": "Sleep step" }, "stepName": { "type": "string", "description": "Cache key (stepName from workflow.sleep)" }, "duration": { "type": ["string", "number"], "description": "Sleep duration" }, "expression": { "type": "string", "description": "Source text of a duration only known at runtime (e.g. a loop variable). The closure evaluates it, so it is legal DSL; it is kept separate from `duration` so regenerated code emits it raw rather than as a string literal, exactly as `expression` does on a set step." } }, "required": ["type", "stepName", "duration"], "additionalProperties": false, "description": "Sleep step metadata" }, "SuspendStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "suspend" }, "reason": { "type": "string", "description": "Reason string passed to workflow.suspend() — becomes the durable step key" } }, "required": ["type", "reason"], "additionalProperties": false, "description": "Suspend step metadata (workflow.suspend())" }, "ReturnStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "return" }, "outputs": { "type": "object", "additionalProperties": { "$ref": "#/definitions/OutputBinding" }, "description": "Output bindings" }, "spread": { "type": "array", "items": { "type": "string" }, "description": "Variables spread into the returned object (`return { ...r }`), or the sole returned variable (`return r`). Their fields are not enumerable statically, so they are recorded by name rather than expanded into `outputs`." } }, "required": ["type", "outputs"], "additionalProperties": false, "description": "Return step metadata (workflow output)" }, "OutputBinding": { "anyOf": [{ "type": "object", "properties": { "from": { "type": "string", "const": "outputVar" }, "name": { "type": "string" }, "path": { "type": "string" } }, "required": ["from", "name"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "stateVar" }, "name": { "type": "string" }, "path": { "type": "string" } }, "required": ["from", "name"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "input" }, "path": { "type": "string" } }, "required": ["from", "path"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "literal" }, "value": {} }, "required": ["from", "value"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "expression" }, "expression": { "type": "string" } }, "required": ["from", "expression"], "additionalProperties": false }], "description": "Output binding for return statements in DSL workflows" }, "InlineStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "inline", "description": "Inline form - local execution" }, "stepName": { "type": "string", "description": "Cache key (stepName from workflow.do)" }, "description": { "type": "string", "description": "Display name" }, "options": { "$ref": "#/definitions/WorkflowStepOptions", "description": "Step options" } }, "required": ["type", "stepName"], "additionalProperties": false, "description": "Inline step metadata (legacy support)" }, "CancelStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "cancel", "description": "Cancel step" }, "reason": { "type": "string", "description": "Optional cancellation reason" } }, "required": ["type"], "additionalProperties": false, "description": "Cancel step metadata" }, "ApprovalStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "approval" }, "reason": { "type": "string", "description": "Reason string passed to workflow.approval() — becomes the durable step key" }, "outputVar": { "type": "string", "description": "Output variable name (if assigned)" }, "expiry": { "type": ["string", "number"], "description": "Expiry duration, when one was given" } }, "required": ["type", "reason"], "additionalProperties": false, "description": "Approval step metadata (workflow.approval())" }, "SwitchStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "switch" }, "expression": { "type": "string", "description": "Expression being switched on" }, "cases": { "type": "array", "items": { "$ref": "#/definitions/SwitchCaseMeta" }, "description": "Case branches" }, "defaultSteps": { "type": "array", "items": { "$ref": "#/definitions/WorkflowStepMeta" }, "description": "Default case steps (optional)" } }, "required": ["type", "expression", "cases"], "additionalProperties": false, "description": "Switch step metadata (switch/case control flow)" }, "SwitchCaseMeta": { "type": "object", "properties": { "value": { "type": ["string", "number", "boolean", "null"], "description": "Case value (literal) or expression" }, "expression": { "type": "string", "description": "Case expression (for complex cases)" }, "steps": { "type": "array", "items": { "$ref": "#/definitions/WorkflowStepMeta" }, "description": "Steps to execute for this case" } }, "required": ["steps"], "additionalProperties": false, "description": "Switch case metadata" }, "FilterStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "filter" }, "sourceVar": { "type": "string", "description": "Source array variable name" }, "itemVar": { "type": "string", "description": "Iterator variable name" }, "condition": { "$ref": "#/definitions/Condition", "description": "Filter condition" }, "outputVar": { "type": "string", "description": "Output variable name (if assigned)" } }, "required": ["type", "sourceVar", "itemVar", "condition"], "additionalProperties": false, "description": "Filter step metadata (array.filter)" }, "ArrayPredicateStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "arrayPredicate" }, "mode": { "type": "string", "enum": ["some", "every"], "description": "Predicate mode" }, "sourceVar": { "type": "string", "description": "Source array variable name" }, "itemVar": { "type": "string", "description": "Iterator variable name" }, "condition": { "$ref": "#/definitions/Condition", "description": "Predicate condition" }, "outputVar": { "type": "string", "description": "Output variable name (if assigned)" } }, "required": ["type", "mode", "sourceVar", "itemVar", "condition"], "additionalProperties": false, "description": "Array predicate step metadata (array.some, array.every)" }, "SetStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "set", "description": "Set step" }, "variable": { "type": "string", "description": "Variable name to set (must be in context)" }, "value": { "description": "Literal value to assign. Mutually exclusive with `expression`." }, "expression": { "type": "string", "description": "Source text of a non-literal assignment (e.g. `count + 1`). Kept separate from `value` so regenerated code can emit it raw — a string `value` is a string literal, an `expression` is code." } }, "required": ["type", "variable"], "additionalProperties": false, "description": "Set step metadata (context variable assignment)" }, "WorkflowContext": { "type": "object", "additionalProperties": { "$ref": "#/definitions/ContextVariable" }, "description": "Workflow context - state variables with defaults and types" }, "ContextVariable": { "type": "object", "properties": { "type": { "type": "string", "enum": ["string", "number", "boolean", "object", "array"], "description": "Variable type" }, "default": { "description": "Default value" }, "description": { "type": "string", "description": "Description for UI/docs" } }, "required": ["type"], "additionalProperties": false, "description": "Context variable definition (serialized from Zod schema or type inference)" }, "MiddlewareMetadata": { "anyOf": [{ "type": "object", "properties": { "type": { "type": "string", "const": "http" }, "route": { "type": "string" } }, "required": ["type", "route"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "tag" }, "tag": { "type": "string" } }, "required": ["type", "tag"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wire" }, "name": { "type": "string" }, "inline": { "type": "boolean" } }, "required": ["type", "name"], "additionalProperties": false }], "description": "Metadata for middleware at any level\n- type: 'http' = HTTP route middleware group (references httpGroup in pikkuState)\n- type: 'tag' = Tag-based middleware group (references tagGroup in pikkuState)\n- type: 'wire' = Wire-level individual middleware" }, "PermissionMetadata": { "type": "object", "properties": { "type": { "type": "string", "const": "wire" }, "name": { "type": "string" }, "inline": { "type": "boolean" } }, "required": ["type", "name"], "additionalProperties": false, "description": "A reference to a permission function a function declares, resolved by name. Used at filter time (e.g. listing agent tools) to run the session-only (pikkuAuth) predicates without request data. Permissions are function-scoped only — there are no wire- or tag-level permission references." } } }
1
+ { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "name": { "type": "string" }, "steps": { "type": "array", "items": { "$ref": "#/definitions/WorkflowStepMeta" } }, "context": { "$ref": "#/definitions/WorkflowContext" }, "dsl": { "type": "boolean" }, "expose": { "type": "boolean" }, "scenario": { "type": "boolean" }, "skip": { "type": "string" }, "actors": { "type": "array", "items": { "type": "string" } }, "pikkuFuncId": { "type": "string" }, "packageName": { "type": "string" }, "title": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "summary": { "type": "string" }, "description": { "type": "string" }, "errors": { "type": "array", "items": { "type": "string" } }, "middleware": { "type": "array", "items": { "$ref": "#/definitions/MiddlewareMetadata" } }, "permissions": { "type": "array", "items": { "$ref": "#/definitions/PermissionMetadata" } } }, "required": ["name", "pikkuFuncId", "steps"], "definitions": { "WorkflowStepMeta": { "anyOf": [{ "$ref": "#/definitions/RpcStepMeta" }, { "$ref": "#/definitions/ScenarioStepMeta" }, { "$ref": "#/definitions/BranchStepMeta" }, { "$ref": "#/definitions/ParallelGroupStepMeta" }, { "$ref": "#/definitions/FanoutStepMeta" }, { "$ref": "#/definitions/ReturnStepMeta" }, { "$ref": "#/definitions/InlineStepMeta" }, { "$ref": "#/definitions/SleepStepMeta" }, { "$ref": "#/definitions/CancelStepMeta" }, { "$ref": "#/definitions/SuspendStepMeta" }, { "$ref": "#/definitions/ApprovalStepMeta" }, { "$ref": "#/definitions/SwitchStepMeta" }, { "$ref": "#/definitions/FilterStepMeta" }, { "$ref": "#/definitions/ArrayPredicateStepMeta" }, { "$ref": "#/definitions/SetStepMeta" }], "description": "Workflow step metadata (extracted by inspector)" }, "RpcStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "rpc", "description": "RPC form - generates queue worker" }, "stepName": { "type": "string", "description": "Cache key (stepName from workflow.do)" }, "rpcName": { "type": "string", "description": "RPC to invoke" }, "outputVar": { "type": "string", "description": "Output variable name (if assigned)" }, "inputs": { "anyOf": [{ "type": "object", "additionalProperties": { "$ref": "#/definitions/InputSource" } }, { "type": "string", "const": "passthrough" }], "description": "Input source mappings, or 'passthrough' when entire data is passed" }, "options": { "$ref": "#/definitions/WorkflowStepOptions", "description": "Step options" }, "actor": { "type": "string", "description": "Scenario actor name this step runs as ({ actor: actors.x })" }, "expectEventually": { "type": "boolean", "description": "True for workflow.expectEventually polling steps" } }, "required": ["type", "stepName", "rpcName"], "additionalProperties": false, "description": "RPC step metadata (base form)" }, "InputSource": { "anyOf": [{ "type": "object", "properties": { "from": { "type": "string", "const": "input" }, "path": { "type": "string" } }, "required": ["from", "path"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "outputVar" }, "name": { "type": "string" }, "path": { "type": "string" } }, "required": ["from", "name"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "item" }, "path": { "type": "string" } }, "required": ["from", "path"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "literal" }, "value": {} }, "required": ["from", "value"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "template" }, "parts": { "type": "array", "items": { "type": "string" } }, "expressions": { "type": "array", "items": { "$ref": "#/definitions/InputSource" } } }, "required": ["from", "parts", "expressions"], "additionalProperties": false }], "description": "Input source for step arguments in DSL workflows" }, "WorkflowStepOptions": { "type": "object", "properties": { "description": { "type": "string", "description": "Display name for logs/UI (optional, doesn't affect execution)" }, "retries": { "type": "number", "description": "Number of retry attempts for failed steps (only applies to local execution)" }, "retryDelay": { "type": ["string", "number"], "description": "Delay between retry attempts (e.g., '1s', '2s', '2min')" }, "onError": { "type": "string", "description": "RPC to invoke for compensation when this step fails after exhausting its retries. Mirrors a graph node's `onError`: the handler receives `{ error: { message } }` and the original error is still thrown, so the workflow fails — this is compensation, not recovery." }, "actor": { "$ref": "#/definitions/ScenarioPersona", "description": "Run this step as an actor (scenarios). The RPC is sent through the actor's authenticated client over the REAL transport — never dispatched internally — so auth middleware and permissions are exercised end-to-end. The step is recorded durably like any RPC step." } }, "additionalProperties": false, "description": "Workflow step options" }, "ScenarioPersona": { "type": "object", "properties": { "name": { "type": "string", "description": "The id it was declared under — what a step's `actor` slot names." }, "email": { "type": "string", "description": "Their address, computed from the id. Flows use it for invites/lookups." } }, "required": ["name", "email"], "additionalProperties": false, "description": "A declared person, signed in and acting over the real transport.\n\nThe runtime half of `definePersonas()`: sign-in materialises a user row flagged `actor: true`, and everything a step or a virtual user does goes through here." }, "ScenarioStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "scenarioStep" }, "stepName": { "type": "string", "description": "Cache key (first argument), ordinal-suffixed by the engine when repeated" }, "stepFunc": { "type": "string", "description": "Registered name of the step function being run" }, "phase": { "$ref": "#/definitions/ScenarioStepPhase", "description": "Which keyword the reporter prefixes — given/when/then, or none for `step`" }, "outputVar": { "type": "string", "description": "Output variable name (if assigned)" }, "inputs": { "anyOf": [{ "type": "object", "additionalProperties": { "$ref": "#/definitions/InputSource" } }, { "type": "string", "const": "passthrough" }], "description": "Input source mappings, or 'passthrough' when entire data is passed" }, "options": { "$ref": "#/definitions/WorkflowStepOptions", "description": "Step options" }, "actor": { "type": "string", "description": "Scenario actor name this step runs as ({ actor: actors.x })" }, "surfaces": { "type": "array", "items": { "$ref": "#/definitions/ScenarioSurface" }, "description": "Mirrors the surfaces the step function declares a binding for" } }, "required": ["type", "stepName", "stepFunc", "phase"], "additionalProperties": false, "description": "Scenario step metadata — a call to `scenario.step/given/when/then`.\n\nDistinct from RpcStepMeta on purpose: a step runs locally through runPikkuFunc and must never be treated as dispatchable on the queue/replay path, nor registered as a callable RPC (a browser-driving step must not be network-invocable)." }, "ScenarioStepPhase": { "type": "string", "enum": ["step", "given", "when", "then"], "description": "Which Gherkin-style keyword the reporter prefixes this step with. `step` renders no prefix at all." }, "ScenarioSurface": { "type": "string", "enum": ["browser", "cli", "default"], "description": "How an actor drives the system for one step.\n\nA step declares one implementation per surface it supports, and the runner picks between them — so the same ladder can run through a real browser, over the websocket, or entirely server-side.\n\n`default` is the floor: it is what every other surface falls back to, so it can never itself fall back." }, "BranchStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "branch" }, "branches": { "type": "array", "items": { "$ref": "#/definitions/BranchCase" }, "description": "Branches in order: first is \"if\", rest are \"else if\"" }, "elseSteps": { "type": "array", "items": { "$ref": "#/definitions/WorkflowStepMeta" }, "description": "Else branch steps (when no conditions match)" } }, "required": ["type", "branches"], "additionalProperties": false, "description": "Branch step metadata (if/else-if/else control flow)" }, "BranchCase": { "type": "object", "properties": { "condition": { "$ref": "#/definitions/Condition", "description": "Condition for this branch" }, "steps": { "type": "array", "items": { "$ref": "#/definitions/WorkflowStepMeta" }, "description": "Steps to execute when condition is true" } }, "required": ["condition", "steps"], "additionalProperties": false, "description": "A single branch in an if/else-if chain" }, "Condition": { "anyOf": [{ "$ref": "#/definitions/SimpleCondition" }, { "type": "object", "properties": { "type": { "type": "string", "const": "and" }, "conditions": { "type": "array", "items": { "$ref": "#/definitions/Condition" } } }, "required": ["type", "conditions"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "or" }, "conditions": { "type": "array", "items": { "$ref": "#/definitions/Condition" } } }, "required": ["type", "conditions"], "additionalProperties": false }], "description": "Nested condition structure supporting AND/OR operations" }, "SimpleCondition": { "type": "object", "properties": { "type": { "type": "string", "const": "simple" }, "expression": { "type": "string" } }, "required": ["type", "expression"], "additionalProperties": false, "description": "Simple condition expression (leaf node)" }, "ParallelGroupStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "parallel" }, "children": { "type": "array", "items": { "anyOf": [{ "$ref": "#/definitions/RpcStepMeta" }, { "$ref": "#/definitions/ScenarioStepMeta" }] }, "description": "Child steps to execute in parallel" } }, "required": ["type", "children"], "additionalProperties": false, "description": "Parallel group step metadata (Promise.all with multiple steps)" }, "FanoutStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "fanout" }, "stepName": { "type": "string", "description": "Step name for this fanout. Optional: a fanout is not itself a cached step, and node ids are step names — borrowing a body step's name would give the loop and that step the same id, collapsing one onto the other." }, "sourceVar": { "type": "string", "description": "Source array variable name" }, "itemVar": { "type": "string", "description": "Iterator variable name" }, "mode": { "type": "string", "enum": ["parallel", "sequential"], "description": "Execution mode" }, "body": { "type": "array", "items": { "anyOf": [{ "$ref": "#/definitions/RpcStepMeta" }, { "$ref": "#/definitions/SleepStepMeta" }, { "$ref": "#/definitions/SuspendStepMeta" }, { "$ref": "#/definitions/ScenarioStepMeta" }] }, "description": "Steps to execute inline per iteration, in order" }, "timeBetween": { "type": "string", "description": "Time between iterations (sequential mode only)" } }, "required": ["type", "sourceVar", "itemVar", "mode", "body"], "additionalProperties": false, "description": "Fanout step metadata (parallel or sequential iteration)" }, "SleepStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "sleep", "description": "Sleep step" }, "stepName": { "type": "string", "description": "Cache key (stepName from workflow.sleep)" }, "duration": { "type": ["string", "number"], "description": "Sleep duration" }, "expression": { "type": "string", "description": "Source text of a duration only known at runtime (e.g. a loop variable). The closure evaluates it, so it is legal DSL; it is kept separate from `duration` so regenerated code emits it raw rather than as a string literal, exactly as `expression` does on a set step." } }, "required": ["type", "stepName", "duration"], "additionalProperties": false, "description": "Sleep step metadata" }, "SuspendStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "suspend" }, "reason": { "type": "string", "description": "Reason string passed to workflow.suspend() — becomes the durable step key" } }, "required": ["type", "reason"], "additionalProperties": false, "description": "Suspend step metadata (workflow.suspend())" }, "ReturnStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "return" }, "outputs": { "type": "object", "additionalProperties": { "$ref": "#/definitions/OutputBinding" }, "description": "Output bindings" }, "spread": { "type": "array", "items": { "type": "string" }, "description": "Variables spread into the returned object (`return { ...r }`), or the sole returned variable (`return r`). Their fields are not enumerable statically, so they are recorded by name rather than expanded into `outputs`." } }, "required": ["type", "outputs"], "additionalProperties": false, "description": "Return step metadata (workflow output)" }, "OutputBinding": { "anyOf": [{ "type": "object", "properties": { "from": { "type": "string", "const": "outputVar" }, "name": { "type": "string" }, "path": { "type": "string" } }, "required": ["from", "name"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "stateVar" }, "name": { "type": "string" }, "path": { "type": "string" } }, "required": ["from", "name"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "input" }, "path": { "type": "string" } }, "required": ["from", "path"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "literal" }, "value": {} }, "required": ["from", "value"], "additionalProperties": false }, { "type": "object", "properties": { "from": { "type": "string", "const": "expression" }, "expression": { "type": "string" } }, "required": ["from", "expression"], "additionalProperties": false }], "description": "Output binding for return statements in DSL workflows" }, "InlineStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "inline", "description": "Inline form - local execution" }, "stepName": { "type": "string", "description": "Cache key (stepName from workflow.do)" }, "description": { "type": "string", "description": "Display name" }, "options": { "$ref": "#/definitions/WorkflowStepOptions", "description": "Step options" } }, "required": ["type", "stepName"], "additionalProperties": false, "description": "Inline step metadata (legacy support)" }, "CancelStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "cancel", "description": "Cancel step" }, "reason": { "type": "string", "description": "Optional cancellation reason" } }, "required": ["type"], "additionalProperties": false, "description": "Cancel step metadata" }, "ApprovalStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "approval" }, "reason": { "type": "string", "description": "Reason string passed to workflow.approval() — becomes the durable step key" }, "outputVar": { "type": "string", "description": "Output variable name (if assigned)" }, "expiry": { "type": ["string", "number"], "description": "Expiry duration, when one was given" } }, "required": ["type", "reason"], "additionalProperties": false, "description": "Approval step metadata (workflow.approval())" }, "SwitchStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "switch" }, "expression": { "type": "string", "description": "Expression being switched on" }, "cases": { "type": "array", "items": { "$ref": "#/definitions/SwitchCaseMeta" }, "description": "Case branches" }, "defaultSteps": { "type": "array", "items": { "$ref": "#/definitions/WorkflowStepMeta" }, "description": "Default case steps (optional)" } }, "required": ["type", "expression", "cases"], "additionalProperties": false, "description": "Switch step metadata (switch/case control flow)" }, "SwitchCaseMeta": { "type": "object", "properties": { "value": { "type": ["string", "number", "boolean", "null"], "description": "Case value (literal) or expression" }, "expression": { "type": "string", "description": "Case expression (for complex cases)" }, "steps": { "type": "array", "items": { "$ref": "#/definitions/WorkflowStepMeta" }, "description": "Steps to execute for this case" } }, "required": ["steps"], "additionalProperties": false, "description": "Switch case metadata" }, "FilterStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "filter" }, "sourceVar": { "type": "string", "description": "Source array variable name" }, "itemVar": { "type": "string", "description": "Iterator variable name" }, "condition": { "$ref": "#/definitions/Condition", "description": "Filter condition" }, "outputVar": { "type": "string", "description": "Output variable name (if assigned)" } }, "required": ["type", "sourceVar", "itemVar", "condition"], "additionalProperties": false, "description": "Filter step metadata (array.filter)" }, "ArrayPredicateStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "arrayPredicate" }, "mode": { "type": "string", "enum": ["some", "every"], "description": "Predicate mode" }, "sourceVar": { "type": "string", "description": "Source array variable name" }, "itemVar": { "type": "string", "description": "Iterator variable name" }, "condition": { "$ref": "#/definitions/Condition", "description": "Predicate condition" }, "outputVar": { "type": "string", "description": "Output variable name (if assigned)" } }, "required": ["type", "mode", "sourceVar", "itemVar", "condition"], "additionalProperties": false, "description": "Array predicate step metadata (array.some, array.every)" }, "SetStepMeta": { "type": "object", "properties": { "type": { "type": "string", "const": "set", "description": "Set step" }, "variable": { "type": "string", "description": "Variable name to set (must be in context)" }, "value": { "description": "Literal value to assign. Mutually exclusive with `expression`." }, "expression": { "type": "string", "description": "Source text of a non-literal assignment (e.g. `count + 1`). Kept separate from `value` so regenerated code can emit it raw — a string `value` is a string literal, an `expression` is code." } }, "required": ["type", "variable"], "additionalProperties": false, "description": "Set step metadata (context variable assignment)" }, "WorkflowContext": { "type": "object", "additionalProperties": { "$ref": "#/definitions/ContextVariable" } }, "ContextVariable": { "type": "object", "properties": { "type": { "type": "string", "enum": ["string", "number", "boolean", "object", "array"] }, "default": {}, "description": { "type": "string" } }, "required": ["type"], "additionalProperties": false }, "MiddlewareMetadata": { "anyOf": [{ "type": "object", "properties": { "type": { "type": "string", "const": "http" }, "route": { "type": "string" } }, "required": ["type", "route"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "tag" }, "tag": { "type": "string" } }, "required": ["type", "tag"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wire" }, "name": { "type": "string" }, "inline": { "type": "boolean" } }, "required": ["type", "name"], "additionalProperties": false }] }, "PermissionMetadata": { "type": "object", "properties": { "type": { "type": "string", "const": "wire" }, "name": { "type": "string" }, "inline": { "type": "boolean" } }, "required": ["type", "name"], "additionalProperties": false, "description": "A reference to a permission function, resolved by name. Function-scoped only: there are no wire- or tag-level permission references." } } }
@@ -1 +1 @@
1
- { "$schema": "http://json-schema.org/draft-07/schema#", "type": "array", "items": { "$ref": "#/definitions/WebhookDeliveryRecord" }, "definitions": { "WebhookDeliveryRecord": { "type": "object", "properties": { "deliveryId": { "type": "string" }, "organizationId": { "type": ["string", "null"] }, "url": { "type": "string" }, "event": { "type": ["string", "null"] }, "status": { "type": "string", "enum": ["pending", "delivered", "failed"] }, "attempts": { "type": "number" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "deliveredAt": { "anyOf": [{ "type": "string", "format": "date-time" }, { "type": "null" }] } }, "required": ["deliveryId", "organizationId", "url", "event", "status", "attempts", "createdAt", "updatedAt", "deliveredAt"], "additionalProperties": false, "description": "A persisted webhook delivery, as surfaced to the console." } } }
1
+ { "$schema": "http://json-schema.org/draft-07/schema#", "type": "array", "items": { "$ref": "#/definitions/WebhookDeliveryRecord" }, "definitions": { "WebhookDeliveryRecord": { "type": "object", "properties": { "deliveryId": { "type": "string" }, "organizationId": { "type": ["string", "null"] }, "url": { "type": "string" }, "event": { "type": ["string", "null"] }, "status": { "type": "string", "enum": ["pending", "delivered", "failed"] }, "attempts": { "type": "number" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "deliveredAt": { "anyOf": [{ "type": "string", "format": "date-time" }, { "type": "null" }] } }, "required": ["deliveryId", "organizationId", "url", "event", "status", "attempts", "createdAt", "updatedAt", "deliveredAt"], "additionalProperties": false } } }
@@ -1 +1 @@
1
- { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "roles": { "type": "array", "items": { "$ref": "#/definitions/Role" } } }, "required": ["roles"], "additionalProperties": false, "definitions": { "Role": { "type": "object", "properties": { "name": { "type": "string" }, "description": { "type": "string" }, "scopes": { "type": "array", "items": { "type": "string" } } }, "required": ["name", "scopes"], "additionalProperties": false, "description": "A role: a named, admin-composed bag of scopes." } } }
1
+ { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "roles": { "type": "array", "items": { "$ref": "#/definitions/Role" } } }, "required": ["roles"], "additionalProperties": false, "definitions": { "Role": { "type": "object", "properties": { "name": { "type": "string" }, "description": { "type": "string" }, "scopes": { "type": "array", "items": { "type": "string" } }, "system": { "type": "boolean", "description": "True when the role was declared in code with `defineSystemRole` rather than composed by an admin. System roles may be granted, but not renamed, re-scoped or deleted — see {@link ScopeService.syncSystemRoles } ." }, "declared": { "type": "boolean", "description": "False when a system role's declaration has been removed from code but its row survives: still held by whoever holds it, no longer offered for new grants, awaiting `pikku roles prune`." } }, "required": ["name", "scopes"], "additionalProperties": false } } }
@@ -1 +1 @@
1
- { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "schemaVersion": { "type": "number" }, "tool": { "type": "string" }, "generatedAt": { "type": "string" }, "note": { "type": "string" }, "issues": { "type": "array", "items": { "$ref": "#/definitions/SecurityAuditIssue" } }, "updates": { "type": "array", "items": { "$ref": "#/definitions/SecurityAuditUpdate" } }, "summary": { "$ref": "#/definitions/SecurityAuditSummary" } }, "required": ["schemaVersion", "tool", "generatedAt", "issues", "updates", "summary"], "additionalProperties": false, "definitions": { "SecurityAuditIssue": { "type": "object", "properties": { "package": { "type": "string" }, "severity": { "$ref": "#/definitions/SecuritySeverity" }, "title": { "type": "string" }, "advisoryId": { "type": "string" }, "url": { "type": "string" }, "vulnerableVersions": { "type": "string" }, "cwe": { "type": "array", "items": { "type": "string" } }, "cvssScore": { "type": ["number", "null"] }, "recommendedVersion": { "type": ["string", "null"] } }, "required": ["package", "severity", "title", "advisoryId", "url", "vulnerableVersions", "cwe", "cvssScore", "recommendedVersion"], "additionalProperties": false }, "SecuritySeverity": { "type": "string", "enum": ["critical", "high", "moderate", "low", "info"], "description": "Dependency security audit artifact — the shape of `.pikku/audit.json` written by `pikku audit`. Canonical home for the type shared by the CLI (writer), the console addon (reader), and the console UI (renderer)." }, "SecurityAuditUpdate": { "type": "object", "properties": { "package": { "type": "string" }, "current": { "type": "string" }, "latest": { "type": "string" }, "level": { "$ref": "#/definitions/SecurityUpdateLevel" } }, "required": ["package", "current", "latest", "level"], "additionalProperties": false }, "SecurityUpdateLevel": { "type": "string", "enum": ["major", "minor", "patch", "unknown"] }, "SecurityAuditSummary": { "type": "object", "properties": { "totalIssues": { "type": "number" }, "critical": { "type": "number" }, "high": { "type": "number" }, "moderate": { "type": "number" }, "low": { "type": "number" }, "totalUpdates": { "type": "number" }, "major": { "type": "number" }, "minor": { "type": "number" }, "patch": { "type": "number" } }, "required": ["totalIssues", "critical", "high", "moderate", "low", "totalUpdates", "major", "minor", "patch"], "additionalProperties": false } } }
1
+ { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "schemaVersion": { "type": "number" }, "tool": { "type": "string" }, "generatedAt": { "type": "string" }, "note": { "type": "string" }, "issues": { "type": "array", "items": { "$ref": "#/definitions/SecurityAuditIssue" } }, "updates": { "type": "array", "items": { "$ref": "#/definitions/SecurityAuditUpdate" } }, "summary": { "$ref": "#/definitions/SecurityAuditSummary" } }, "required": ["schemaVersion", "tool", "generatedAt", "issues", "updates", "summary"], "additionalProperties": false, "definitions": { "SecurityAuditIssue": { "type": "object", "properties": { "package": { "type": "string" }, "severity": { "$ref": "#/definitions/SecuritySeverity" }, "title": { "type": "string" }, "advisoryId": { "type": "string" }, "url": { "type": "string" }, "vulnerableVersions": { "type": "string" }, "cwe": { "type": "array", "items": { "type": "string" } }, "cvssScore": { "type": ["number", "null"] }, "recommendedVersion": { "type": ["string", "null"] } }, "required": ["package", "severity", "title", "advisoryId", "url", "vulnerableVersions", "cwe", "cvssScore", "recommendedVersion"], "additionalProperties": false }, "SecuritySeverity": { "type": "string", "enum": ["critical", "high", "moderate", "low", "info"], "description": "The shape of `.pikku/audit.json`. Shared by the CLI (writer), the console addon (reader) and the console UI (renderer)." }, "SecurityAuditUpdate": { "type": "object", "properties": { "package": { "type": "string" }, "current": { "type": "string" }, "latest": { "type": "string" }, "level": { "$ref": "#/definitions/SecurityUpdateLevel" } }, "required": ["package", "current", "latest", "level"], "additionalProperties": false }, "SecurityUpdateLevel": { "type": "string", "enum": ["major", "minor", "patch", "unknown"] }, "SecurityAuditSummary": { "type": "object", "properties": { "totalIssues": { "type": "number" }, "critical": { "type": "number" }, "high": { "type": "number" }, "moderate": { "type": "number" }, "low": { "type": "number" }, "totalUpdates": { "type": "number" }, "major": { "type": "number" }, "minor": { "type": "number" }, "patch": { "type": "number" } }, "required": ["totalIssues", "critical", "high", "moderate", "low", "totalUpdates", "major", "minor", "patch"], "additionalProperties": false } } }
@@ -1 +1 @@
1
- { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "delivery": { "$ref": "#/definitions/WebhookDeliveryRecord" }, "attempts": { "type": "array", "items": { "$ref": "#/definitions/WebhookAttemptRecord" } } }, "required": ["delivery", "attempts"], "additionalProperties": false, "description": "A delivery with its full attempt history.", "definitions": { "WebhookDeliveryRecord": { "type": "object", "properties": { "deliveryId": { "type": "string" }, "organizationId": { "type": ["string", "null"] }, "url": { "type": "string" }, "event": { "type": ["string", "null"] }, "status": { "type": "string", "enum": ["pending", "delivered", "failed"] }, "attempts": { "type": "number" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "deliveredAt": { "anyOf": [{ "type": "string", "format": "date-time" }, { "type": "null" }] } }, "required": ["deliveryId", "organizationId", "url", "event", "status", "attempts", "createdAt", "updatedAt", "deliveredAt"], "additionalProperties": false, "description": "A persisted webhook delivery, as surfaced to the console." }, "WebhookAttemptRecord": { "type": "object", "properties": { "attemptId": { "type": "string" }, "deliveryId": { "type": "string" }, "attemptNumber": { "type": "number" }, "statusCode": { "type": ["number", "null"] }, "responseBody": { "type": ["string", "null"] }, "error": { "type": ["string", "null"] }, "createdAt": { "type": "string", "format": "date-time" } }, "required": ["attemptId", "deliveryId", "attemptNumber", "statusCode", "responseBody", "error", "createdAt"], "additionalProperties": false, "description": "A single persisted delivery attempt." } } }
1
+ { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "delivery": { "$ref": "#/definitions/WebhookDeliveryRecord" }, "attempts": { "type": "array", "items": { "$ref": "#/definitions/WebhookAttemptRecord" } } }, "required": ["delivery", "attempts"], "additionalProperties": false, "definitions": { "WebhookDeliveryRecord": { "type": "object", "properties": { "deliveryId": { "type": "string" }, "organizationId": { "type": ["string", "null"] }, "url": { "type": "string" }, "event": { "type": ["string", "null"] }, "status": { "type": "string", "enum": ["pending", "delivered", "failed"] }, "attempts": { "type": "number" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "deliveredAt": { "anyOf": [{ "type": "string", "format": "date-time" }, { "type": "null" }] } }, "required": ["deliveryId", "organizationId", "url", "event", "status", "attempts", "createdAt", "updatedAt", "deliveredAt"], "additionalProperties": false }, "WebhookAttemptRecord": { "type": "object", "properties": { "attemptId": { "type": "string" }, "deliveryId": { "type": "string" }, "attemptNumber": { "type": "number" }, "statusCode": { "type": ["number", "null"] }, "responseBody": { "type": ["string", "null"] }, "error": { "type": ["string", "null"] }, "createdAt": { "type": "string", "format": "date-time" } }, "required": ["attemptId", "deliveryId", "attemptNumber", "statusCode", "responseBody", "error", "createdAt"], "additionalProperties": false } } }
@@ -0,0 +1,37 @@
1
+ import type { CorePersona, PersonaMeta, PersonasMeta } from '@pikku/core/persona';
2
+ import type { SystemRoleName } from './pikku-roles.gen.js';
3
+ /** Every declared persona. */
4
+ export type PersonaId = never;
5
+ /**
6
+ * The personas a virtual user can actually be.
7
+ *
8
+ * Excludes anyone whose only login is a provider account — driving a consent
9
+ * screen needs a human — and anyone declared `runnable: false`, who exists to
10
+ * be acted upon rather than to act.
11
+ */
12
+ export type RunnablePersonaId = never;
13
+ /** Every environment configured in pikku.config.json. */
14
+ export type EnvironmentName = never;
15
+ /**
16
+ * A persona whose roles are checked against `defineSystemRole` and whose
17
+ * environments are checked against the config.
18
+ *
19
+ * Omitting `environments` means every environment except the ones flagged
20
+ * `production: true`. Naming a production one additionally requires
21
+ * `disposition: 'accountable'`, which the type cannot express and `pikku`
22
+ * refuses at build time.
23
+ */
24
+ export type TypedPersona = Omit<CorePersona, 'roles' | 'environments'> & {
25
+ roles?: SystemRoleName[];
26
+ environments?: EnvironmentName[];
27
+ };
28
+ /**
29
+ * Declare the people who use this application.
30
+ *
31
+ * A persona while running is a virtual user; there is no second declaration.
32
+ */
33
+ export declare const definePersonas: (personas: Record<string, TypedPersona>) => void;
34
+ /** Declared personas, keyed by id. Read by the console and `pikku persona`. */
35
+ export declare const PERSONAS: PersonasMeta;
36
+ export declare const PERSONA_LIST: PersonaMeta[];
37
+ //# sourceMappingURL=pikku-personas.gen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pikku-personas.gen.d.ts","sourceRoot":"","sources":["../../../.pikku/scopes/pikku-personas.gen.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AACjF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAG1D,8BAA8B;AAC9B,MAAM,MAAM,SAAS,GAAG,KAAK,CAAA;AAE7B;;;;;;GAMG;AACH,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAA;AAErC,yDAAyD;AACzD,MAAM,MAAM,eAAe,GAAG,KAAK,CAAA;AAEnC;;;;;;;;GAQG;AACH,MAAM,MAAM,YAAY,GAAG,IAAI,CAAC,WAAW,EAAE,OAAO,GAAG,cAAc,CAAC,GAAG;IACvE,KAAK,CAAC,EAAE,cAAc,EAAE,CAAA;IACxB,YAAY,CAAC,EAAE,eAAe,EAAE,CAAA;CACjC,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,cAAc,GAAI,UAAU,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,KAAG,IAC1C,CAAA;AAE9B,+EAA+E;AAC/E,eAAO,MAAM,QAAQ,EAAE,YAAqD,CAAA;AAE5E,eAAO,MAAM,YAAY,EAAE,WAAW,EAA4B,CAAA"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * This file was generated by @pikku/cli@0.12.96
3
+ */
4
+ /**
5
+ * This file was generated by the @pikku/cli
6
+ */
7
+ import { definePersonas as definePersonasCore } from '@pikku/core/persona';
8
+ import definitions from './pikku-personas-meta.gen.json' with { type: 'json' };
9
+ /**
10
+ * Declare the people who use this application.
11
+ *
12
+ * A persona while running is a virtual user; there is no second declaration.
13
+ */
14
+ export const definePersonas = (personas) => definePersonasCore(personas);
15
+ /** Declared personas, keyed by id. Read by the console and `pikku persona`. */
16
+ export const PERSONAS = definitions;
17
+ export const PERSONA_LIST = Object.values(PERSONAS);
18
+ //# sourceMappingURL=pikku-personas.gen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pikku-personas.gen.js","sourceRoot":"","sources":["../../../.pikku/scopes/pikku-personas.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;GAEG;AACH,OAAO,EAAE,cAAc,IAAI,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAG1E,OAAO,WAAW,MAAM,gCAAgC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AA+B9E;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,QAAsC,EAAQ,EAAE,CAC7E,kBAAkB,CAAC,QAAQ,CAAC,CAAA;AAE9B,+EAA+E;AAC/E,MAAM,CAAC,MAAM,QAAQ,GAAiB,WAAsC,CAAA;AAE5E,MAAM,CAAC,MAAM,YAAY,GAAkB,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * This file was generated by @pikku/cli@0.12.96
3
+ */
4
+ /**
5
+ * This file was generated by the @pikku/cli
6
+ */
7
+ import type { SystemRole } from '@pikku/core/role';
8
+ /**
9
+ * Every role that ships with this application.
10
+ *
11
+ * Roles an admin composes in the console are not here and cannot be: they do
12
+ * not exist at build time, and can be deleted after it.
13
+ */
14
+ export type SystemRoleName = never;
15
+ /**
16
+ * The declared role set, for a ScopeService to sync into its store.
17
+ *
18
+ * Derived from the metadata sidecar rather than inlined, so the import above
19
+ * forces tsc to emit the .json alongside this file — an addon publishes only
20
+ * its compiled output, and a host reads that .json to merge the addon's roles
21
+ * into its own union.
22
+ *
23
+ * Additive on removal: a deleted declaration leaves an inert row rather than
24
+ * revoking everyone's grant on deploy. Use `pikku roles prune` to remove them.
25
+ */
26
+ export declare const SYSTEM_ROLES: SystemRole[];
27
+ /** Declared roles, keyed by name. Rendered by the console when granting. */
28
+ export declare const SYSTEM_ROLES_META: Record<string, SystemRole>;
29
+ /** Whether a role name is declared in code, and therefore not editable. */
30
+ export declare const isSystemRole: (name: string) => boolean;
31
+ //# sourceMappingURL=pikku-roles.gen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pikku-roles.gen.d.ts","sourceRoot":"","sources":["../../../.pikku/scopes/pikku-roles.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;GAEG;AACH,OAAO,KAAK,EAAE,UAAU,EAA6B,MAAM,kBAAkB,CAAA;AAI7E;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,CAAA;AAElC;;;;;;;;;;GAUG;AACH,eAAO,MAAM,YAAY,EAAE,UAAU,EAEpC,CAAA;AAED,4EAA4E;AAC5E,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAExD,CAAA;AAED,2EAA2E;AAC3E,eAAO,MAAM,YAAY,GAAI,MAAM,MAAM,KAAG,OACmB,CAAA"}
@@ -0,0 +1,19 @@
1
+ import { flattenSystemRoleDefinitions } from '@pikku/core/role';
2
+ import definitions from './pikku-roles-meta.gen.json' with { type: 'json' };
3
+ /**
4
+ * The declared role set, for a ScopeService to sync into its store.
5
+ *
6
+ * Derived from the metadata sidecar rather than inlined, so the import above
7
+ * forces tsc to emit the .json alongside this file — an addon publishes only
8
+ * its compiled output, and a host reads that .json to merge the addon's roles
9
+ * into its own union.
10
+ *
11
+ * Additive on removal: a deleted declaration leaves an inert row rather than
12
+ * revoking everyone's grant on deploy. Use `pikku roles prune` to remove them.
13
+ */
14
+ export const SYSTEM_ROLES = flattenSystemRoleDefinitions(Object.values(definitions));
15
+ /** Declared roles, keyed by name. Rendered by the console when granting. */
16
+ export const SYSTEM_ROLES_META = Object.fromEntries(SYSTEM_ROLES.map((role) => [role.name, role]));
17
+ /** Whether a role name is declared in code, and therefore not editable. */
18
+ export const isSystemRole = (name) => Object.prototype.hasOwnProperty.call(SYSTEM_ROLES_META, name);
19
+ //# sourceMappingURL=pikku-roles.gen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pikku-roles.gen.js","sourceRoot":"","sources":["../../../.pikku/scopes/pikku-roles.gen.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,4BAA4B,EAAE,MAAM,kBAAkB,CAAA;AAC/D,OAAO,WAAW,MAAM,6BAA6B,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AAU3E;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,YAAY,GAAiB,4BAA4B,CACpE,MAAM,CAAC,MAAM,CAAC,WAAwC,CAAC,CACxD,CAAA;AAED,4EAA4E;AAC5E,MAAM,CAAC,MAAM,iBAAiB,GAA+B,MAAM,CAAC,WAAW,CAC7E,YAAY,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAC9C,CAAA;AAED,2EAA2E;AAC3E,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,IAAY,EAAW,EAAE,CACpD,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,iBAAiB,EAAE,IAAI,CAAC,CAAA"}
@@ -1,6 +1,8 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.93
2
+ * This file was generated by @pikku/cli@0.12.96
3
3
  */
4
- export { wireScope } from '@pikku/core/scope';
4
+ export { defineScope } from '@pikku/core/scope';
5
5
  export type { CoreScopes, CoreScopeNode, FlatScope, ScopeDefinitionMeta, ScopeDefinitionsMeta } from '@pikku/core/scope';
6
+ export { defineSystemRole } from '@pikku/core/role';
7
+ export type { CoreSystemRole, CoreSystemRoles, SystemRole, SystemRoleDefinitionMeta, SystemRoleDefinitionsMeta } from '@pikku/core/role';
6
8
  //# sourceMappingURL=pikku-scope-types.gen.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pikku-scope-types.gen.d.ts","sourceRoot":"","sources":["../../../.pikku/scopes/pikku-scope-types.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,SAAS,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA"}
1
+ {"version":3,"file":"pikku-scope-types.gen.d.ts","sourceRoot":"","sources":["../../../.pikku/scopes/pikku-scope-types.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,SAAS,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AACxH,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AACnD,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,UAAU,EAAE,wBAAwB,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAA"}
@@ -1,5 +1,6 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.93
2
+ * This file was generated by @pikku/cli@0.12.96
3
3
  */
4
- export { wireScope } from '@pikku/core/scope';
4
+ export { defineScope } from '@pikku/core/scope';
5
+ export { defineSystemRole } from '@pikku/core/role';
5
6
  //# sourceMappingURL=pikku-scope-types.gen.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pikku-scope-types.gen.js","sourceRoot":"","sources":["../../../.pikku/scopes/pikku-scope-types.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA"}
1
+ {"version":3,"file":"pikku-scope-types.gen.js","sourceRoot":"","sources":["../../../.pikku/scopes/pikku-scope-types.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAE/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.93
2
+ * This file was generated by @pikku/cli@0.12.96
3
3
  */
4
4
  /**
5
5
  * This file was generated by the @pikku/cli
@@ -1,6 +1,6 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.93
2
+ * This file was generated by @pikku/cli@0.12.96
3
3
  */
4
- export { wireSecret } from '@pikku/core/secret';
4
+ export { defineSecret } from '@pikku/core/secret';
5
5
  export type { CoreSecret, SecretDefinitionMeta, SecretDefinitionsMeta } from '@pikku/core/secret';
6
6
  //# sourceMappingURL=pikku-secret-types.gen.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pikku-secret-types.gen.d.ts","sourceRoot":"","sources":["../../../.pikku/secrets/pikku-secret-types.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,YAAY,EAAE,UAAU,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA"}
1
+ {"version":3,"file":"pikku-secret-types.gen.d.ts","sourceRoot":"","sources":["../../../.pikku/secrets/pikku-secret-types.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACjD,YAAY,EAAE,UAAU,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.93
2
+ * This file was generated by @pikku/cli@0.12.96
3
3
  */
4
- export { wireSecret } from '@pikku/core/secret';
4
+ export { defineSecret } from '@pikku/core/secret';
5
5
  //# sourceMappingURL=pikku-secret-types.gen.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pikku-secret-types.gen.js","sourceRoot":"","sources":["../../../.pikku/secrets/pikku-secret-types.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA"}
1
+ {"version":3,"file":"pikku-secret-types.gen.js","sourceRoot":"","sources":["../../../.pikku/secrets/pikku-secret-types.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.93
2
+ * This file was generated by @pikku/cli@0.12.96
3
3
  */
4
4
  import { TypedSecretService as CoreTypedSecretService } from '@pikku/core/services';
5
5
  import type { SecretService } from '@pikku/core/services';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.93
2
+ * This file was generated by @pikku/cli@0.12.96
3
3
  */
4
4
  import { TypedSecretService as CoreTypedSecretService } from '@pikku/core/services';
5
5
  import secretsMeta from './pikku-secrets-meta.gen.json' with { type: 'json' };
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.93
2
+ * This file was generated by @pikku/cli@0.12.96
3
3
  */
4
4
  /**
5
5
  * Trigger-specific type definitions for tree-shaking optimization
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.93
2
+ * This file was generated by @pikku/cli@0.12.96
3
3
  */
4
4
  /**
5
5
  * Trigger-specific type definitions for tree-shaking optimization
@@ -1,6 +1,6 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.93
2
+ * This file was generated by @pikku/cli@0.12.96
3
3
  */
4
- export { wireVariable } from '@pikku/core/variable';
4
+ export { defineVariable } from '@pikku/core/variable';
5
5
  export type { CoreVariable, VariableDefinitionMeta, VariableDefinitionsMeta } from '@pikku/core/variable';
6
6
  //# sourceMappingURL=pikku-variable-types.gen.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pikku-variable-types.gen.d.ts","sourceRoot":"","sources":["../../../.pikku/variables/pikku-variable-types.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACnD,YAAY,EAAE,YAAY,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAA"}
1
+ {"version":3,"file":"pikku-variable-types.gen.d.ts","sourceRoot":"","sources":["../../../.pikku/variables/pikku-variable-types.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACrD,YAAY,EAAE,YAAY,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAA"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.93
2
+ * This file was generated by @pikku/cli@0.12.96
3
3
  */
4
- export { wireVariable } from '@pikku/core/variable';
4
+ export { defineVariable } from '@pikku/core/variable';
5
5
  //# sourceMappingURL=pikku-variable-types.gen.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pikku-variable-types.gen.js","sourceRoot":"","sources":["../../../.pikku/variables/pikku-variable-types.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA"}
1
+ {"version":3,"file":"pikku-variable-types.gen.js","sourceRoot":"","sources":["../../../.pikku/variables/pikku-variable-types.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.93
2
+ * This file was generated by @pikku/cli@0.12.96
3
3
  */
4
4
  import { TypedVariablesService as CoreTypedVariablesService } from '@pikku/core/services';
5
5
  import type { VariablesService } from '@pikku/core/services';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.93
2
+ * This file was generated by @pikku/cli@0.12.96
3
3
  */
4
4
  import { TypedVariablesService as CoreTypedVariablesService } from '@pikku/core/services';
5
5
  import variablesMeta from './pikku-variables-meta.gen.json' with { type: 'json' };
@@ -0,0 +1,16 @@
1
+ import type { HttpPersonasConfig, ScenarioPersona, ResolvedPersona } from '@pikku/core/services';
2
+ import type { AgentMap } from '../agent/pikku-agent-map.gen.d.js';
3
+ import type { FlattenedRPCMap } from '../rpc/pikku-rpc-wirings-map.gen.d.js';
4
+ export declare const personaConfigs: {};
5
+ export type PersonaName = keyof typeof personaConfigs;
6
+ /**
7
+ * The same personas as a list, widened to `ResolvedPersona`. Iterating
8
+ * `personaConfigs` directly yields the literal type of each entry, on which an
9
+ * optional field a persona did not declare does not exist — so a seed reading
10
+ * `roles` off every persona needs this instead.
11
+ */
12
+ export declare const personaList: ResolvedPersona[];
13
+ export type AgentName = keyof AgentMap & string;
14
+ export type TypedPersonas = Record<PersonaName, ScenarioPersona<AgentName, FlattenedRPCMap>>;
15
+ export declare const createPersonas: (options: Omit<HttpPersonasConfig, "personas">) => TypedPersonas;
16
+ //# sourceMappingURL=pikku-personas.gen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pikku-personas.gen.d.ts","sourceRoot":"","sources":["../../../.pikku/workflow/pikku-personas.gen.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,kBAAkB,EAClB,eAAe,EACf,eAAe,EAChB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAA;AACjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAA;AAE5E,eAAO,MAAM,cAAc,IAAwD,CAAA;AAEnF,MAAM,MAAM,WAAW,GAAG,MAAM,OAAO,cAAc,CAAA;AAErD;;;;;GAKG;AACH,eAAO,MAAM,WAAW,EAAE,eAAe,EAAkC,CAAA;AAE3E,MAAM,MAAM,SAAS,GAAG,MAAM,QAAQ,GAAG,MAAM,CAAA;AAC/C,MAAM,MAAM,aAAa,GAAG,MAAM,CAChC,WAAW,EACX,eAAe,CAAC,SAAS,EAAE,eAAe,CAAC,CAC5C,CAAA;AAED,eAAO,MAAM,cAAc,GACzB,SAAS,IAAI,CAAC,kBAAkB,EAAE,UAAU,CAAC,KAC5C,aAIkB,CAAA"}