@pikku/addon-console 0.12.45 → 0.12.46

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 (147) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/.pikku/addon/agent/index.d.ts +1 -1
  3. package/dist/.pikku/addon/agent/index.js +1 -1
  4. package/dist/.pikku/addon/agent/pikku-agent-map.gen.d.ts +1 -1
  5. package/dist/.pikku/addon/agent/pikku-agent-types.gen.d.ts +42 -1
  6. package/dist/.pikku/addon/agent/pikku-agent-types.gen.d.ts.map +1 -1
  7. package/dist/.pikku/addon/agent/pikku-agent-types.gen.js +41 -0
  8. package/dist/.pikku/addon/agent/pikku-agent-types.gen.js.map +1 -1
  9. package/dist/.pikku/addon/agent/pikku-model-aliases.gen.js +1 -1
  10. package/dist/.pikku/addon/agent/pikku-scorer-names.gen.d.ts +1 -1
  11. package/dist/.pikku/addon/auth/auth.types.d.ts +1 -1
  12. package/dist/.pikku/addon/auth/auth.types.js +1 -1
  13. package/dist/.pikku/addon/auth/index.d.ts +1 -1
  14. package/dist/.pikku/addon/auth/index.js +1 -1
  15. package/dist/.pikku/addon/auth/pikku-auth-types.gen.d.ts +2 -19
  16. package/dist/.pikku/addon/auth/pikku-auth-types.gen.d.ts.map +1 -1
  17. package/dist/.pikku/addon/auth/pikku-auth-types.gen.js +2 -19
  18. package/dist/.pikku/addon/auth/pikku-auth-types.gen.js.map +1 -1
  19. package/dist/.pikku/addon/channel/index.d.ts +1 -1
  20. package/dist/.pikku/addon/channel/index.js +1 -1
  21. package/dist/.pikku/addon/channel/pikku-channel-types.gen.d.ts +8 -18
  22. package/dist/.pikku/addon/channel/pikku-channel-types.gen.d.ts.map +1 -1
  23. package/dist/.pikku/addon/channel/pikku-channel-types.gen.js +7 -1
  24. package/dist/.pikku/addon/channel/pikku-channel-types.gen.js.map +1 -1
  25. package/dist/.pikku/addon/error/index.d.ts +1 -1
  26. package/dist/.pikku/addon/error/index.js +1 -1
  27. package/dist/.pikku/addon/error/pikku-error-types.gen.d.ts +1 -1
  28. package/dist/.pikku/addon/error/pikku-error-types.gen.js +1 -1
  29. package/dist/.pikku/addon/function/index.d.ts +1 -1
  30. package/dist/.pikku/addon/function/index.js +1 -1
  31. package/dist/.pikku/addon/function/pikku-function-types.gen.d.ts +36 -37
  32. package/dist/.pikku/addon/function/pikku-function-types.gen.d.ts.map +1 -1
  33. package/dist/.pikku/addon/function/pikku-function-types.gen.js +21 -9
  34. package/dist/.pikku/addon/function/pikku-function-types.gen.js.map +1 -1
  35. package/dist/.pikku/addon/function/pikku-functions-meta-verbose.gen.json +14 -14
  36. package/dist/.pikku/addon/function/pikku-functions-meta.gen.js +1 -1
  37. package/dist/.pikku/addon/function/pikku-functions-meta.gen.json +14 -14
  38. package/dist/.pikku/addon/function/pikku-functions.gen.js +1 -1
  39. package/dist/.pikku/addon/http/index.d.ts +1 -1
  40. package/dist/.pikku/addon/http/index.js +1 -1
  41. package/dist/.pikku/addon/http/pikku-http-types.gen.d.ts +3 -1
  42. package/dist/.pikku/addon/http/pikku-http-types.gen.d.ts.map +1 -1
  43. package/dist/.pikku/addon/http/pikku-http-types.gen.js +1 -1
  44. package/dist/.pikku/addon/http/pikku-http-types.gen.js.map +1 -1
  45. package/dist/.pikku/addon/mcp/index.d.ts +1 -1
  46. package/dist/.pikku/addon/mcp/index.js +1 -1
  47. package/dist/.pikku/addon/mcp/pikku-mcp-types.gen.d.ts +7 -1
  48. package/dist/.pikku/addon/mcp/pikku-mcp-types.gen.d.ts.map +1 -1
  49. package/dist/.pikku/addon/mcp/pikku-mcp-types.gen.js +1 -1
  50. package/dist/.pikku/addon/mcp/pikku-mcp-types.gen.js.map +1 -1
  51. package/dist/.pikku/addon/middleware/index.d.ts +1 -1
  52. package/dist/.pikku/addon/middleware/index.js +1 -1
  53. package/dist/.pikku/addon/middleware/pikku-middleware-types.gen.d.ts +33 -24
  54. package/dist/.pikku/addon/middleware/pikku-middleware-types.gen.d.ts.map +1 -1
  55. package/dist/.pikku/addon/middleware/pikku-middleware-types.gen.js +29 -24
  56. package/dist/.pikku/addon/middleware/pikku-middleware-types.gen.js.map +1 -1
  57. package/dist/.pikku/addon/permissions/pikku-permissions.gen.d.ts +1 -1
  58. package/dist/.pikku/addon/permissions/pikku-permissions.gen.js +1 -1
  59. package/dist/.pikku/addon/pikku-bootstrap-scenarios.gen.d.ts +1 -1
  60. package/dist/.pikku/addon/pikku-bootstrap-scenarios.gen.js +1 -1
  61. package/dist/.pikku/addon/pikku-bootstrap.gen.d.ts +1 -1
  62. package/dist/.pikku/addon/pikku-bootstrap.gen.js +1 -1
  63. package/dist/.pikku/addon/pikku-package.gen.js +1 -1
  64. package/dist/.pikku/addon/pikku-services.gen.d.ts +1 -1
  65. package/dist/.pikku/addon/rpc/pikku-rpc-wirings-map.gen.d.ts +2 -2
  66. package/dist/.pikku/addon/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +2 -2
  67. package/dist/.pikku/addon/rpc/pikku-rpc-wirings-map.remote.gen.d.ts +2 -2
  68. package/dist/.pikku/addon/rpc/pikku-rpc-wirings-meta.internal.gen.js +1 -1
  69. package/dist/.pikku/addon/scenarios/index.d.ts +1 -1
  70. package/dist/.pikku/addon/scenarios/index.js +1 -1
  71. package/dist/.pikku/addon/scenarios/pikku-personas.gen.d.ts +4 -0
  72. package/dist/.pikku/addon/scenarios/pikku-personas.gen.d.ts.map +1 -1
  73. package/dist/.pikku/addon/scenarios/pikku-personas.gen.js +1 -1
  74. package/dist/.pikku/addon/scenarios/pikku-personas.gen.js.map +1 -1
  75. package/dist/.pikku/addon/scenarios/pikku-scenario-functions-meta.gen.js +1 -1
  76. package/dist/.pikku/addon/scenarios/pikku-scenario-functions.gen.d.ts +1 -1
  77. package/dist/.pikku/addon/scenarios/pikku-scenario-types.gen.d.ts +13 -1
  78. package/dist/.pikku/addon/scenarios/pikku-scenario-types.gen.d.ts.map +1 -1
  79. package/dist/.pikku/addon/scenarios/pikku-scenario-types.gen.js +4 -0
  80. package/dist/.pikku/addon/scenarios/pikku-scenario-types.gen.js.map +1 -1
  81. package/dist/.pikku/addon/scenarios/pikku-scenario-wirings-meta.gen.js +1 -1
  82. package/dist/.pikku/addon/scenarios/pikku-scenario-wirings.gen.d.ts +1 -1
  83. package/dist/.pikku/addon/scenarios/schemas/register.gen.d.ts +1 -1
  84. package/dist/.pikku/addon/scenarios/schemas/register.gen.js +1 -1
  85. package/dist/.pikku/addon/schemas/register.gen.js +1 -1
  86. package/dist/.pikku/addon/schemas/schemas/AddonMetaPage.schema.json +1 -1
  87. package/dist/.pikku/addon/schemas/schemas/AddonPackageInfo.schema.json +1 -1
  88. package/dist/.pikku/addon/schemas/schemas/AllMeta.schema.json +1 -1
  89. package/dist/.pikku/addon/schemas/schemas/GetFunctionsMetaOutput.schema.json +1 -1
  90. package/dist/.pikku/addon/schemas/schemas/GetWorkflowMetaByIdOutput.schema.json +1 -1
  91. package/dist/.pikku/addon/schemas/schemas/UpdateFunctionConfigInput.schema.json +1 -1
  92. package/dist/.pikku/addon/scopes/index.d.ts +1 -1
  93. package/dist/.pikku/addon/scopes/index.js +1 -1
  94. package/dist/.pikku/addon/scopes/pikku-personas.gen.js +1 -1
  95. package/dist/.pikku/addon/scopes/pikku-roles.gen.d.ts +1 -1
  96. package/dist/.pikku/addon/scopes/pikku-scope-types.gen.d.ts +1 -1
  97. package/dist/.pikku/addon/scopes/pikku-scope-types.gen.js +1 -1
  98. package/dist/.pikku/addon/scopes/pikku-scopes.gen.d.ts +1 -1
  99. package/dist/.pikku/addon/secrets/index.d.ts +1 -1
  100. package/dist/.pikku/addon/secrets/index.js +1 -1
  101. package/dist/.pikku/addon/secrets/pikku-secret-types.gen.d.ts +1 -1
  102. package/dist/.pikku/addon/secrets/pikku-secret-types.gen.js +1 -1
  103. package/dist/.pikku/addon/secrets/pikku-secrets.gen.d.ts +9 -1
  104. package/dist/.pikku/addon/secrets/pikku-secrets.gen.d.ts.map +1 -1
  105. package/dist/.pikku/addon/secrets/pikku-secrets.gen.js +5 -1
  106. package/dist/.pikku/addon/secrets/pikku-secrets.gen.js.map +1 -1
  107. package/dist/.pikku/addon/services/pikku-meta-service.gen.d.ts +1 -1
  108. package/dist/.pikku/addon/services/pikku-meta-service.gen.js +1 -1
  109. package/dist/.pikku/addon/setup/index.d.ts +1 -1
  110. package/dist/.pikku/addon/setup/index.js +1 -1
  111. package/dist/.pikku/addon/setup/pikku-addon-setup-types.gen.d.ts +1 -1
  112. package/dist/.pikku/addon/setup/pikku-addon-setup-types.gen.js +1 -1
  113. package/dist/.pikku/addon/setup/pikku-setup-types.gen.d.ts +7 -19
  114. package/dist/.pikku/addon/setup/pikku-setup-types.gen.d.ts.map +1 -1
  115. package/dist/.pikku/addon/setup/pikku-setup-types.gen.js +11 -19
  116. package/dist/.pikku/addon/setup/pikku-setup-types.gen.js.map +1 -1
  117. package/dist/.pikku/addon/trigger/index.d.ts +1 -1
  118. package/dist/.pikku/addon/trigger/index.js +1 -1
  119. package/dist/.pikku/addon/trigger/pikku-trigger-types.gen.d.ts +1 -1
  120. package/dist/.pikku/addon/trigger/pikku-trigger-types.gen.js +1 -1
  121. package/dist/.pikku/addon/variables/index.d.ts +1 -1
  122. package/dist/.pikku/addon/variables/index.js +1 -1
  123. package/dist/.pikku/addon/variables/pikku-variable-types.gen.d.ts +1 -1
  124. package/dist/.pikku/addon/variables/pikku-variable-types.gen.js +1 -1
  125. package/dist/.pikku/addon/variables/pikku-variables.gen.d.ts +9 -1
  126. package/dist/.pikku/addon/variables/pikku-variables.gen.d.ts.map +1 -1
  127. package/dist/.pikku/addon/variables/pikku-variables.gen.js +5 -1
  128. package/dist/.pikku/addon/variables/pikku-variables.gen.js.map +1 -1
  129. package/dist/.pikku/addon/workflow/index.d.ts +1 -1
  130. package/dist/.pikku/addon/workflow/index.js +1 -1
  131. package/dist/.pikku/addon/workflow/pikku-scenario-step-map.gen.d.ts +1 -1
  132. package/dist/.pikku/addon/workflow/pikku-workflow-map.gen.d.ts +1 -1
  133. package/dist/.pikku/addon/workflow/pikku-workflow-types.gen.d.ts +29 -1
  134. package/dist/.pikku/addon/workflow/pikku-workflow-types.gen.d.ts.map +1 -1
  135. package/dist/.pikku/addon/workflow/pikku-workflow-types.gen.js +8 -1
  136. package/dist/.pikku/addon/workflow/pikku-workflow-types.gen.js.map +1 -1
  137. package/dist/.pikku/addon/workflow/pikku-workflow-wirings-meta.gen.js +1 -1
  138. package/dist/.pikku/addon/workflow/pikku-workflow-wirings.gen.d.ts +1 -1
  139. package/dist/.pikku/addon/workflow/pikku-workflow-wirings.gen.js +1 -1
  140. package/dist/src/functions/update-agent-config.function.d.ts +1 -1
  141. package/dist/src/functions/update-agent-config.function.d.ts.map +1 -1
  142. package/dist/src/functions/update-function-config.function.d.ts +1 -1
  143. package/dist/src/functions/update-function-config.function.d.ts.map +1 -1
  144. package/dist/src/services.js +1 -1
  145. package/dist/src/services.js.map +1 -1
  146. package/dist/types/application-types.d.ts +1 -1
  147. package/package.json +3 -2
@@ -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" }, "asserts": { "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 or Then" }, "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.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": ["given", "when", "then"], "description": "Which Gherkin-style keyword the reporter prefixes this step with.\n\nEvery step takes one. A scenario is read by people deciding whether it describes the behaviour they wanted, and a step that says only what it does without saying whether it is setup, action or claim is the one nobody can check — which is also why PKU680 can tell a scenario that never asserts." }, "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" }, "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" }, "approvers": { "$ref": "#/definitions/WorkflowApprovalApprovers", "description": "Who may answer the gate, when the default was not used" }, "approverScope": { "type": "string", "description": "Scope the decider must hold, when one was required" } }, "required": ["type", "reason"], "additionalProperties": false, "description": "Approval step metadata (workflow.approval())" }, "WorkflowApprovalApprovers": { "type": "string", "enum": ["any", "owner", "not-initiator"], "description": "Who is allowed to answer an approval gate, relative to the user who started the run.\n\n- `any` — anyone the approve entrypoint lets through. The gate is a pause for a decision, not an authorization boundary.\n- `owner` — only the user who started the run, so a gate can be used to confirm an action against the same person who requested it.\n- `not-initiator` — anyone *except* the user who started the run: four-eyes. A run with no recorded initiator has nobody to exclude, so this degrades to requiring a signed-in decider." }, "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
+ { "$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" }, "asserts": { "type": "boolean" }, "skip": { "type": "string" }, "actors": { "type": "array", "items": { "type": "string" } }, "pikkuFuncId": { "type": "string" }, "packageName": { "type": "string" }, "title": { "type": "string", "description": "A human name for this wiring, shown wherever it is listed rather than called." }, "tags": { "type": "array", "items": { "type": "string" }, "description": "Filters this wiring in and out of a build — see the `tags` option on `pikku all`. It has no effect at runtime." }, "summary": { "type": "string", "description": "A one-line description for listings, where the full `description` is too long." }, "description": { "type": "string", "description": "What this does, for whoever is reading the wiring rather than writing it." }, "errors": { "type": "array", "items": { "type": "string" }, "description": "Names of error classes this may throw, so each one's registered status is used instead of a 500." }, "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 or Then" }, "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.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": ["given", "when", "then"], "description": "Which Gherkin-style keyword the reporter prefixes this step with.\n\nEvery step takes one. A scenario is read by people deciding whether it describes the behaviour they wanted, and a step that says only what it does without saying whether it is setup, action or claim is the one nobody can check — which is also why PKU680 can tell a scenario that never asserts." }, "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" }, "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" }, "approvers": { "$ref": "#/definitions/WorkflowApprovalApprovers", "description": "Who may answer the gate, when the default was not used" }, "approverScope": { "type": "string", "description": "Scope the decider must hold, when one was required" } }, "required": ["type", "reason"], "additionalProperties": false, "description": "Approval step metadata (workflow.approval())" }, "WorkflowApprovalApprovers": { "type": "string", "enum": ["any", "owner", "not-initiator"], "description": "Who is allowed to answer an approval gate, relative to the user who started the run.\n\n- `any` — anyone the approve entrypoint lets through. The gate is a pause for a decision, not an authorization boundary.\n- `owner` — only the user who started the run, so a gate can be used to confirm an action against the same person who requested it.\n- `not-initiator` — anyone *except* the user who started the run: four-eyes. A run with no recorded initiator has nobody to exclude, so this degrades to requiring a signed-in decider." }, "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": "object", "properties": { "sourceFile": { "type": "string" }, "exportedName": { "type": "string" }, "changes": { "$ref": "#/definitions/FunctionConfigChanges" } }, "required": ["sourceFile", "exportedName", "changes"], "additionalProperties": false, "definitions": { "FunctionConfigChanges": { "type": "object", "properties": { "title": { "type": ["string", "null"] }, "description": { "type": ["string", "null"] }, "summary": { "type": ["string", "null"] }, "tags": { "anyOf": [{ "type": "array", "items": { "type": "string" } }, { "type": "null" }] }, "errors": { "anyOf": [{ "type": "array", "items": { "type": "string" } }, { "type": "null" }] }, "expose": { "type": ["boolean", "null"] }, "remote": { "type": ["boolean", "null"] }, "mcp": { "type": ["boolean", "null"] }, "readonly": { "type": ["boolean", "null"] }, "approvalRequired": { "type": ["boolean", "null"] } }, "additionalProperties": false } } }
1
+ { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "sourceFile": { "type": "string" }, "exportedName": { "type": "string" }, "changes": { "$ref": "#/definitions/FunctionConfigChanges" } }, "required": ["sourceFile", "exportedName", "changes"], "additionalProperties": false, "definitions": { "FunctionConfigChanges": { "type": "object", "properties": { "title": { "type": ["string", "null"] }, "description": { "type": ["string", "null"] }, "summary": { "type": ["string", "null"] }, "tags": { "anyOf": [{ "type": "array", "items": { "type": "string" } }, { "type": "null" }] }, "errors": { "anyOf": [{ "type": "array", "items": { "type": "string" } }, { "type": "null" }] }, "expose": { "type": ["boolean", "null"] }, "remote": { "type": ["boolean", "null"] }, "mcp": { "type": ["boolean", "null"] }, "readonly": { "type": ["boolean", "null"] }, "approvalRequired": { "type": ["boolean", "null"] }, "permissions": { "anyOf": [{ "type": "object", "additionalProperties": { "anyOf": [{ "$ref": "#/definitions/SymbolRef" }, { "type": "array", "items": { "$ref": "#/definitions/SymbolRef" } }] } }, { "type": "null" }] } }, "additionalProperties": false }, "SymbolRef": { "type": "object", "properties": { "name": { "type": "string" }, "from": { "type": "string" } }, "required": ["name", "from"], "additionalProperties": false, "description": "A value that is written as a bare identifier rather than a literal, plus the module it has to be imported from. The caller supplies `from` because the source file alone cannot say where a symbol that is not there yet lives." } } }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.112
2
+ * This file was generated by @pikku/cli@0.12.118
3
3
  */
4
4
  /**
5
5
  * Subpath entry — `#pikku/scopes` resolves here.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.112
2
+ * This file was generated by @pikku/cli@0.12.118
3
3
  */
4
4
  /**
5
5
  * Subpath entry — `#pikku/scopes` resolves here.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.112
2
+ * This file was generated by @pikku/cli@0.12.118
3
3
  */
4
4
  /**
5
5
  * This file was generated by the @pikku/cli
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.112
2
+ * This file was generated by @pikku/cli@0.12.118
3
3
  */
4
4
  /**
5
5
  * This file was generated by the @pikku/cli
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.112
2
+ * This file was generated by @pikku/cli@0.12.118
3
3
  */
4
4
  export { defineScope } from '@pikku/core/scope';
5
5
  export { defineSystemRole } from '@pikku/core/role';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.112
2
+ * This file was generated by @pikku/cli@0.12.118
3
3
  */
4
4
  export { defineScope } from '@pikku/core/scope';
5
5
  export { defineSystemRole } from '@pikku/core/role';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.112
2
+ * This file was generated by @pikku/cli@0.12.118
3
3
  */
4
4
  /**
5
5
  * This file was generated by the @pikku/cli
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.112
2
+ * This file was generated by @pikku/cli@0.12.118
3
3
  */
4
4
  /**
5
5
  * Subpath entry — `#pikku/secrets` resolves here.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.112
2
+ * This file was generated by @pikku/cli@0.12.118
3
3
  */
4
4
  /**
5
5
  * Subpath entry — `#pikku/secrets` resolves here.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.112
2
+ * This file was generated by @pikku/cli@0.12.118
3
3
  */
4
4
  export { defineSecret } from '@pikku/core/secret';
5
5
  //# sourceMappingURL=pikku-secret-types.gen.d.ts.map
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.112
2
+ * This file was generated by @pikku/cli@0.12.118
3
3
  */
4
4
  export { defineSecret } from '@pikku/core/secret';
5
5
  //# sourceMappingURL=pikku-secret-types.gen.js.map
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.112
2
+ * This file was generated by @pikku/cli@0.12.118
3
3
  */
4
4
  import { TypedSecretService as CoreTypedSecretService } from '@pikku/core/services';
5
5
  import type { SecretService } from '@pikku/core/services';
@@ -11,7 +11,15 @@ import type { SecretService } from '@pikku/core/services';
11
11
  * sidecar is not part of `#pikku/secrets`.
12
12
  */
13
13
  import './pikku-secrets-meta.gen.json';
14
+ /**
15
+ * Every secret this project declares with `defineSecret`, keyed by name. It is
16
+ * what gives `secrets.getSecret('NAME')` a real type.
17
+ */
14
18
  export type CredentialsMap = {};
19
+ /**
20
+ * The `secrets` service as this project sees it: `getSecret('NAME')` resolves
21
+ * the value's type from `CredentialsMap` instead of returning `unknown`.
22
+ */
15
23
  export declare class TypedSecretService extends CoreTypedSecretService<CredentialsMap> {
16
24
  constructor(secrets: SecretService);
17
25
  }
@@ -1 +1 @@
1
- {"version":3,"file":"pikku-secrets.gen.d.ts","sourceRoot":"","sources":["../../../../.pikku/addon/secrets/pikku-secrets.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,kBAAkB,IAAI,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AAEnF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACzD;;;;;;GAMG;AACH,OAAO,+BAA+B,CAAsB;AAE5D,MAAM,MAAM,cAAc,GAAG,EAE5B,CAAA;AAMD,qBAAa,kBAAmB,SAAQ,sBAAsB,CAAC,cAAc,CAAC;gBAChE,OAAO,EAAE,aAAa;CAGnC"}
1
+ {"version":3,"file":"pikku-secrets.gen.d.ts","sourceRoot":"","sources":["../../../../.pikku/addon/secrets/pikku-secrets.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,kBAAkB,IAAI,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AAEnF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACzD;;;;;;GAMG;AACH,OAAO,+BAA+B,CAAsB;AAE5D;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,EAE5B,CAAA;AAMD;;;GAGG;AACH,qBAAa,kBAAmB,SAAQ,sBAAsB,CAAC,cAAc,CAAC;gBAChE,OAAO,EAAE,aAAa;CAGnC"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.112
2
+ * This file was generated by @pikku/cli@0.12.118
3
3
  */
4
4
  import { TypedSecretService as CoreTypedSecretService } from '@pikku/core/services';
5
5
  /**
@@ -11,6 +11,10 @@ import { TypedSecretService as CoreTypedSecretService } from '@pikku/core/servic
11
11
  */
12
12
  import './pikku-secrets-meta.gen.json' with { type: 'json' };
13
13
  const CREDENTIALS_META = {};
14
+ /**
15
+ * The `secrets` service as this project sees it: `getSecret('NAME')` resolves
16
+ * the value's type from `CredentialsMap` instead of returning `unknown`.
17
+ */
14
18
  export class TypedSecretService extends CoreTypedSecretService {
15
19
  constructor(secrets) {
16
20
  super(secrets, CREDENTIALS_META);
@@ -1 +1 @@
1
- {"version":3,"file":"pikku-secrets.gen.js","sourceRoot":"","sources":["../../../../.pikku/addon/secrets/pikku-secrets.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,kBAAkB,IAAI,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AAGnF;;;;;;GAMG;AACH,OAAO,+BAA+B,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AAM5D,MAAM,gBAAgB,GAAmC,EAExD,CAAA;AAED,MAAM,OAAO,kBAAmB,SAAQ,sBAAsC;IAC5E,YAAY,OAAsB;QAChC,KAAK,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAA;IAClC,CAAC;CACF"}
1
+ {"version":3,"file":"pikku-secrets.gen.js","sourceRoot":"","sources":["../../../../.pikku/addon/secrets/pikku-secrets.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,kBAAkB,IAAI,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AAGnF;;;;;;GAMG;AACH,OAAO,+BAA+B,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AAU5D,MAAM,gBAAgB,GAAmC,EAExD,CAAA;AAED;;;GAGG;AACH,MAAM,OAAO,kBAAmB,SAAQ,sBAAsC;IAC5E,YAAY,OAAsB;QAChC,KAAK,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAA;IAClC,CAAC;CACF"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.112
2
+ * This file was generated by @pikku/cli@0.12.118
3
3
  */
4
4
  import { LocalMetaService } from '@pikku/core/services/local-meta';
5
5
  export declare class PikkuMetaService extends LocalMetaService {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.112
2
+ * This file was generated by @pikku/cli@0.12.118
3
3
  */
4
4
  import { LocalMetaService } from '@pikku/core/services/local-meta';
5
5
  export class PikkuMetaService extends LocalMetaService {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.112
2
+ * This file was generated by @pikku/cli@0.12.118
3
3
  */
4
4
  /**
5
5
  * Subpath entry — `#pikku/setup` resolves here.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.112
2
+ * This file was generated by @pikku/cli@0.12.118
3
3
  */
4
4
  /**
5
5
  * Subpath entry — `#pikku/setup` resolves here.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.112
2
+ * This file was generated by @pikku/cli@0.12.118
3
3
  */
4
4
  /**
5
5
  * Addon package types for pikkuAddonConfig and pikkuAddonServices
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.112
2
+ * This file was generated by @pikku/cli@0.12.118
3
3
  */
4
4
  /**
5
5
  * Addon package types for pikkuAddonConfig and pikkuAddonServices
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.112
2
+ * This file was generated by @pikku/cli@0.12.118
3
3
  */
4
4
  /**
5
5
  * Config and service factory definitions, declared once per application
@@ -8,6 +8,10 @@ import { CreateWireServices } from '@pikku/core/types';
8
8
  import type { SingletonServices } from '../function/pikku-function-types.gen.js';
9
9
  import type { Config } from '../../../types/application-types.d.js';
10
10
  import type { RequiredSingletonServices, RequiredWireServices } from '../pikku-services.gen.js';
11
+ /**
12
+ * This project's own config — whatever `createConfig` returns. Every singleton
13
+ * service is built from it.
14
+ */
11
15
  export type { Config };
12
16
  /**
13
17
  * Creates a Pikku config factory.
@@ -16,15 +20,7 @@ export type { Config };
16
20
  * @param func - Config factory function that returns your application's config
17
21
  * @returns The config factory function
18
22
  *
19
- * @example
20
- * ```typescript
21
- * export const createConfig = pikkuConfig(async () => {
22
- * return {
23
- * apiUrl: process.env.API_URL || 'http://localhost:3000',
24
- * dbUrl: process.env.DATABASE_URL
25
- * }
26
- * })
27
- * ```
23
+ * @example snippet: pikkuConfig
28
24
  */
29
25
  export declare const pikkuConfig: (func: (variables?: any, ...args: any[]) => Promise<Config>) => (variables?: any, ...args: any[]) => Promise<Config>;
30
26
  /**
@@ -53,15 +49,7 @@ export declare const pikkuServices: (func: (config: Config, existingServices: Pa
53
49
  * @param func - Wire services factory function
54
50
  * @returns The wire services factory function
55
51
  *
56
- * @example
57
- * ```typescript
58
- * export const createWireServices = pikkuWireServices(async (services, wire) => {
59
- * const session = await wire.session?.get()
60
- * return {
61
- * userCache: new UserCache(session?.userId)
62
- * }
63
- * })
64
- * ```
52
+ * @example snippet: shopWireServices
65
53
  */
66
54
  export declare const pikkuWireServices: (func: (services: SingletonServices, wire: any) => Promise<RequiredWireServices>) => CreateWireServices;
67
55
  //# sourceMappingURL=pikku-setup-types.gen.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pikku-setup-types.gen.d.ts","sourceRoot":"","sources":["../../../../.pikku/addon/setup/pikku-setup-types.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;GAEG;AAGH,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AACtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAA;AAChF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uCAAuC,CAAA;AACnE,OAAO,KAAK,EAAE,yBAAyB,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AAC/F,YAAY,EAAE,MAAM,EAAE,CAAA;AAEtB;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,WAAW,GACtB,MAAM,CAAC,SAAS,CAAC,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,MAAM,CAAC,kBAAvC,GAAG,WAAW,GAAG,EAAE,KAAK,OAAO,CAAC,MAAM,CAClD,CAAA;AAET;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,aAAa,GACxB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,OAAO,CAAC,iBAAiB,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,yBAAyB,EAAE,MAAM,CAAC,CAAC,CAAC,MAEnH,QAAQ,MAAM,EAAE,mBAAkB,OAAO,CAAC,iBAAiB,CAAM,uCAoBhF,CAAA;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,iBAAiB,GAC5B,MAAM,CACJ,QAAQ,EAAE,iBAAiB,EAC3B,IAAI,EAAE,GAAG,KACN,OAAO,CAAC,oBAAoB,CAAC,KACjC,kBAIF,CAAA"}
1
+ {"version":3,"file":"pikku-setup-types.gen.d.ts","sourceRoot":"","sources":["../../../../.pikku/addon/setup/pikku-setup-types.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;GAEG;AAGH,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AACtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAA;AAChF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uCAAuC,CAAA;AACnE,OAAO,KAAK,EAAE,yBAAyB,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AAC/F;;;GAGG;AACH,YAAY,EAAE,MAAM,EAAE,CAAA;AAEtB;;;;;;;;GAQG;AACH,eAAO,MAAM,WAAW,GACtB,MAAM,CAAC,SAAS,CAAC,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,MAAM,CAAC,kBAAvC,GAAG,WAAW,GAAG,EAAE,KAAK,OAAO,CAAC,MAAM,CAClD,CAAA;AAET;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,aAAa,GACxB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,OAAO,CAAC,iBAAiB,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,yBAAyB,EAAE,MAAM,CAAC,CAAC,CAAC,MAEnH,QAAQ,MAAM,EAAE,mBAAkB,OAAO,CAAC,iBAAiB,CAAM,uCAgChF,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,GAC5B,MAAM,CACJ,QAAQ,EAAE,iBAAiB,EAC3B,IAAI,EAAE,GAAG,KACN,OAAO,CAAC,oBAAoB,CAAC,KACjC,kBAIF,CAAA"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.112
2
+ * This file was generated by @pikku/cli@0.12.118
3
3
  */
4
4
  /**
5
5
  * Config and service factory definitions, declared once per application
@@ -12,15 +12,7 @@ import { pikkuState as __pikkuState } from '@pikku/core/state';
12
12
  * @param func - Config factory function that returns your application's config
13
13
  * @returns The config factory function
14
14
  *
15
- * @example
16
- * ```typescript
17
- * export const createConfig = pikkuConfig(async () => {
18
- * return {
19
- * apiUrl: process.env.API_URL || 'http://localhost:3000',
20
- * dbUrl: process.env.DATABASE_URL
21
- * }
22
- * })
23
- * ```
15
+ * @example snippet: pikkuConfig
24
16
  */
25
17
  export const pikkuConfig = (func) => func;
26
18
  /**
@@ -45,6 +37,14 @@ export const pikkuServices = (func) => {
45
37
  return async (config, existingServices = {}) => {
46
38
  const createdServices = await func(config, existingServices);
47
39
  const services = { ...existingServices, ...createdServices };
40
+ const allowedToShadow = new Set([]);
41
+ const shadowed = Object.keys(createdServices).filter((name) => !allowedToShadow.has(name) &&
42
+ existingServices[name] !== undefined &&
43
+ existingServices[name] !== createdServices[name]);
44
+ if (shadowed.length > 0) {
45
+ ;
46
+ services.logger?.warn?.(`createSingletonServices returned its own ${shadowed.join(', ')}, discarding what the host passed in. A host only passes a service it has already configured — a \`secrets\` holding this deployment's values, a \`kysely\` bound to its database — so the replacement starts empty and fails later somewhere unrelated. Write \`existingServices.<name> ?? new Own...\` to take the host's when there is one and still work standalone, or list the name under \`allowShadowedServices\` in pikku.config.json if replacing it is deliberate.`);
47
+ }
48
48
  const authFactory = __pikkuState(null, 'package', 'authFactory');
49
49
  if (authFactory) {
50
50
  let authInstance;
@@ -70,15 +70,7 @@ export const pikkuServices = (func) => {
70
70
  * @param func - Wire services factory function
71
71
  * @returns The wire services factory function
72
72
  *
73
- * @example
74
- * ```typescript
75
- * export const createWireServices = pikkuWireServices(async (services, wire) => {
76
- * const session = await wire.session?.get()
77
- * return {
78
- * userCache: new UserCache(session?.userId)
79
- * }
80
- * })
81
- * ```
73
+ * @example snippet: shopWireServices
82
74
  */
83
75
  export const pikkuWireServices = (func) => {
84
76
  const factories = __pikkuState(null, 'package', 'factories');
@@ -1 +1 @@
1
- {"version":3,"file":"pikku-setup-types.gen.js","sourceRoot":"","sources":["../../../../.pikku/addon/setup/pikku-setup-types.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;GAEG;AAEH,OAAO,EAAE,UAAU,IAAI,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAO9D;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CACzB,IAA0D,EAC1D,EAAE,CAAC,IAAI,CAAA;AAET;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAC3B,IAAiI,EACjI,EAAE;IACF,OAAO,KAAK,EAAE,MAAc,EAAE,mBAA+C,EAAE,EAAE,EAAE;QACjF,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAA;QAC5D,MAAM,QAAQ,GAAG,EAAE,GAAG,gBAAgB,EAAE,GAAG,eAAe,EAAE,CAAA;QAC5D,MAAM,WAAW,GAAG,YAAY,CAAC,IAAI,EAAE,SAAS,EAAE,aAAa,CAAC,CAAA;QAChE,IAAI,WAAW,EAAE,CAAC;YAChB,IAAI,YAA0C,CAC7C;YAAC,QAAgB,CAAC,IAAI,GAAG,GAAG,EAAE;gBAC7B,YAAY,KAAK,OAAO,CAAC,OAAO,EAAE;qBAC/B,IAAI,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,QAAe,CAAC,CAAC;qBACxC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;oBACf,YAAY,GAAG,SAAS,CAAA;oBACxB,MAAM,KAAK,CAAA;gBACb,CAAC,CAAC,CAAA;gBACJ,OAAO,YAAY,CAAA;YACrB,CAAC,CAAA;QACH,CAAC;QACD,MAAM,QAAQ,GAAG,QAAqC,CAAA;QACtD,YAAY,CAAC,IAAI,EAAE,SAAS,EAAE,mBAAmB,EAAE,QAAe,CAAC,CAAA;QACnE,OAAO,QAAQ,CAAA;IACjB,CAAC,CAAA;AACH,CAAC,CAAA;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,IAGkC,EACd,EAAE;IACtB,MAAM,SAAS,GAAG,YAAY,CAAC,IAAI,EAAE,SAAS,EAAE,WAAW,CAAC,CAAA;IAC5D,YAAY,CAAC,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,EAAE,GAAG,SAAS,EAAE,kBAAkB,EAAE,IAAW,EAAE,CAAC,CAAA;IAC7F,OAAO,IAAqC,CAAA;AAC9C,CAAC,CAAA"}
1
+ {"version":3,"file":"pikku-setup-types.gen.js","sourceRoot":"","sources":["../../../../.pikku/addon/setup/pikku-setup-types.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;GAEG;AAEH,OAAO,EAAE,UAAU,IAAI,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAW9D;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CACzB,IAA0D,EAC1D,EAAE,CAAC,IAAI,CAAA;AAET;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAC3B,IAAiI,EACjI,EAAE;IACF,OAAO,KAAK,EAAE,MAAc,EAAE,mBAA+C,EAAE,EAAE,EAAE;QACjF,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAA;QAC5D,MAAM,QAAQ,GAAG,EAAE,GAAG,gBAAgB,EAAE,GAAG,eAAe,EAAE,CAAA;QAC5D,MAAM,eAAe,GAAG,IAAI,GAAG,CAAS,EAAE,CAAC,CAAA;QAC3C,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,MAAM,CAClD,CAAC,IAAI,EAAE,EAAE,CACP,CAAC,eAAe,CAAC,GAAG,CAAC,IAAI,CAAC;YACzB,gBAAwB,CAAC,IAAI,CAAC,KAAK,SAAS;YAC5C,gBAAwB,CAAC,IAAI,CAAC,KAAM,eAAuB,CAAC,IAAI,CAAC,CACrE,CAAA;QACD,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACxB,CAAC;YAAC,QAAgB,CAAC,MAAM,EAAE,IAAI,EAAE,CAC/B,4CAA4C,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,+cAA+c,CAC/gB,CAAA;QACH,CAAC;QACD,MAAM,WAAW,GAAG,YAAY,CAAC,IAAI,EAAE,SAAS,EAAE,aAAa,CAAC,CAAA;QAChE,IAAI,WAAW,EAAE,CAAC;YAChB,IAAI,YAA0C,CAC7C;YAAC,QAAgB,CAAC,IAAI,GAAG,GAAG,EAAE;gBAC7B,YAAY,KAAK,OAAO,CAAC,OAAO,EAAE;qBAC/B,IAAI,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,QAAe,CAAC,CAAC;qBACxC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;oBACf,YAAY,GAAG,SAAS,CAAA;oBACxB,MAAM,KAAK,CAAA;gBACb,CAAC,CAAC,CAAA;gBACJ,OAAO,YAAY,CAAA;YACrB,CAAC,CAAA;QACH,CAAC;QACD,MAAM,QAAQ,GAAG,QAAqC,CAAA;QACtD,YAAY,CAAC,IAAI,EAAE,SAAS,EAAE,mBAAmB,EAAE,QAAe,CAAC,CAAA;QACnE,OAAO,QAAQ,CAAA;IACjB,CAAC,CAAA;AACH,CAAC,CAAA;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,IAGkC,EACd,EAAE;IACtB,MAAM,SAAS,GAAG,YAAY,CAAC,IAAI,EAAE,SAAS,EAAE,WAAW,CAAC,CAAA;IAC5D,YAAY,CAAC,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,EAAE,GAAG,SAAS,EAAE,kBAAkB,EAAE,IAAW,EAAE,CAAC,CAAA;IAC7F,OAAO,IAAqC,CAAA;AAC9C,CAAC,CAAA"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.112
2
+ * This file was generated by @pikku/cli@0.12.118
3
3
  */
4
4
  /**
5
5
  * Subpath entry — `#pikku/trigger` resolves here.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.112
2
+ * This file was generated by @pikku/cli@0.12.118
3
3
  */
4
4
  /**
5
5
  * Subpath entry — `#pikku/trigger` resolves here.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.112
2
+ * This file was generated by @pikku/cli@0.12.118
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.112
2
+ * This file was generated by @pikku/cli@0.12.118
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.112
2
+ * This file was generated by @pikku/cli@0.12.118
3
3
  */
4
4
  /**
5
5
  * Subpath entry — `#pikku/variables` resolves here.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.112
2
+ * This file was generated by @pikku/cli@0.12.118
3
3
  */
4
4
  /**
5
5
  * Subpath entry — `#pikku/variables` resolves here.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.112
2
+ * This file was generated by @pikku/cli@0.12.118
3
3
  */
4
4
  export { defineVariable } from '@pikku/core/variable';
5
5
  //# sourceMappingURL=pikku-variable-types.gen.d.ts.map
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.112
2
+ * This file was generated by @pikku/cli@0.12.118
3
3
  */
4
4
  export { defineVariable } from '@pikku/core/variable';
5
5
  //# sourceMappingURL=pikku-variable-types.gen.js.map
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.112
2
+ * This file was generated by @pikku/cli@0.12.118
3
3
  */
4
4
  import { TypedVariablesService as CoreTypedVariablesService } from '@pikku/core/services';
5
5
  import type { VariablesService } from '@pikku/core/services';
@@ -11,8 +11,16 @@ import type { VariablesService } from '@pikku/core/services';
11
11
  * sidecar is not part of `#pikku/variables`.
12
12
  */
13
13
  import './pikku-variables-meta.gen.json';
14
+ /**
15
+ * Every variable this project declares with `defineVariable`, keyed by name. It
16
+ * is what gives `variables.get('NAME')` a real type.
17
+ */
14
18
  export interface VariablesMap {
15
19
  }
20
+ /**
21
+ * The `variables` service as this project sees it: `get('NAME')` resolves the
22
+ * value's type from `VariablesMap` instead of returning `unknown`.
23
+ */
16
24
  export declare class TypedVariablesService extends CoreTypedVariablesService<VariablesMap> {
17
25
  constructor(variables: VariablesService);
18
26
  }
@@ -1 +1 @@
1
- {"version":3,"file":"pikku-variables.gen.d.ts","sourceRoot":"","sources":["../../../../.pikku/addon/variables/pikku-variables.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EACL,qBAAqB,IAAI,yBAAyB,EAEnD,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAC5D;;;;;;GAMG;AACH,OAAO,iCAAiC,CAAsB;AAE9D,MAAM,WAAW,YAAY;CAE5B;AAMD,qBAAa,qBAAsB,SAAQ,yBAAyB,CAAC,YAAY,CAAC;gBACpE,SAAS,EAAE,gBAAgB;CAGxC"}
1
+ {"version":3,"file":"pikku-variables.gen.d.ts","sourceRoot":"","sources":["../../../../.pikku/addon/variables/pikku-variables.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EACL,qBAAqB,IAAI,yBAAyB,EAEnD,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAC5D;;;;;;GAMG;AACH,OAAO,iCAAiC,CAAsB;AAE9D;;;GAGG;AACH,MAAM,WAAW,YAAY;CAE5B;AAMD;;;GAGG;AACH,qBAAa,qBAAsB,SAAQ,yBAAyB,CAAC,YAAY,CAAC;gBACpE,SAAS,EAAE,gBAAgB;CAGxC"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.112
2
+ * This file was generated by @pikku/cli@0.12.118
3
3
  */
4
4
  import { TypedVariablesService as CoreTypedVariablesService, } from '@pikku/core/services';
5
5
  /**
@@ -11,6 +11,10 @@ import { TypedVariablesService as CoreTypedVariablesService, } from '@pikku/core
11
11
  */
12
12
  import './pikku-variables-meta.gen.json' with { type: 'json' };
13
13
  const TYPED_VARIABLES_META = {};
14
+ /**
15
+ * The `variables` service as this project sees it: `get('NAME')` resolves the
16
+ * value's type from `VariablesMap` instead of returning `unknown`.
17
+ */
14
18
  export class TypedVariablesService extends CoreTypedVariablesService {
15
19
  constructor(variables) {
16
20
  super(variables, TYPED_VARIABLES_META);
@@ -1 +1 @@
1
- {"version":3,"file":"pikku-variables.gen.js","sourceRoot":"","sources":["../../../../.pikku/addon/variables/pikku-variables.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EACL,qBAAqB,IAAI,yBAAyB,GAEnD,MAAM,sBAAsB,CAAA;AAE7B;;;;;;GAMG;AACH,OAAO,iCAAiC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AAM9D,MAAM,oBAAoB,GAAiC,EAE1D,CAAA;AAED,MAAM,OAAO,qBAAsB,SAAQ,yBAAuC;IAChF,YAAY,SAA2B;QACrC,KAAK,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAA;IACxC,CAAC;CACF"}
1
+ {"version":3,"file":"pikku-variables.gen.js","sourceRoot":"","sources":["../../../../.pikku/addon/variables/pikku-variables.gen.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EACL,qBAAqB,IAAI,yBAAyB,GAEnD,MAAM,sBAAsB,CAAA;AAE7B;;;;;;GAMG;AACH,OAAO,iCAAiC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AAU9D,MAAM,oBAAoB,GAAiC,EAE1D,CAAA;AAED;;;GAGG;AACH,MAAM,OAAO,qBAAsB,SAAQ,yBAAuC;IAChF,YAAY,SAA2B;QACrC,KAAK,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAA;IACxC,CAAC;CACF"}