@pikku/core 0.12.83 → 0.12.86
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.
- package/CHANGELOG.md +492 -0
- package/README.md +1 -1
- package/dist/bootstrap-compat/root.d.ts +20 -0
- package/dist/classification/column-form.d.ts +32 -0
- package/dist/classification/column-form.js +42 -0
- package/dist/classification/data-classification.d.ts +64 -0
- package/dist/classification/index.d.ts +13 -0
- package/dist/classification/index.js +2 -0
- package/dist/classification/secret-value.d.ts +56 -0
- package/dist/classification/secret-value.js +46 -0
- package/dist/crypto-utils.d.ts +1 -1
- package/dist/ecosystem/agent-scorer.d.ts +12 -0
- package/dist/ecosystem/agent-scorer.js +5 -0
- package/dist/ecosystem/agent.d.ts +21 -0
- package/dist/ecosystem/agent.js +6 -0
- package/dist/ecosystem/channel/local.d.ts +3 -0
- package/dist/ecosystem/channel/local.js +3 -0
- package/dist/ecosystem/channel/serverless.d.ts +9 -0
- package/dist/ecosystem/channel/serverless.js +1 -0
- package/dist/ecosystem/channel.d.ts +15 -0
- package/dist/ecosystem/channel.js +5 -0
- package/dist/ecosystem/cli/channel.d.ts +16 -0
- package/dist/ecosystem/cli/channel.js +2 -0
- package/dist/ecosystem/cli.d.ts +9 -0
- package/dist/ecosystem/cli.js +2 -0
- package/dist/ecosystem/credential.d.ts +10 -0
- package/dist/ecosystem/credential.js +1 -0
- package/dist/ecosystem/crypto-utils.d.ts +8 -0
- package/dist/ecosystem/crypto-utils.js +1 -0
- package/dist/ecosystem/dev.d.ts +9 -0
- package/dist/ecosystem/dev.js +2 -0
- package/dist/ecosystem/errors.d.ts +8 -0
- package/dist/ecosystem/errors.js +2 -0
- package/dist/ecosystem/function.d.ts +13 -0
- package/dist/ecosystem/function.js +2 -0
- package/dist/ecosystem/gateway.d.ts +1 -0
- package/dist/ecosystem/hmac.d.ts +1 -0
- package/dist/ecosystem/hmac.js +1 -0
- package/dist/ecosystem/http.d.ts +13 -0
- package/dist/ecosystem/http.js +5 -0
- package/dist/ecosystem/mcp.d.ts +3 -0
- package/dist/ecosystem/mcp.js +2 -0
- package/dist/ecosystem/middleware.d.ts +18 -0
- package/dist/ecosystem/middleware.js +7 -0
- package/dist/ecosystem/node-host-resolver.d.ts +1 -0
- package/dist/ecosystem/node-host-resolver.js +1 -0
- package/dist/ecosystem/node.d.ts +1 -0
- package/dist/ecosystem/oauth2.d.ts +1 -0
- package/dist/ecosystem/oauth2.js +1 -0
- package/dist/ecosystem/persona.d.ts +17 -0
- package/dist/ecosystem/persona.js +5 -0
- package/dist/ecosystem/queue.d.ts +13 -0
- package/dist/ecosystem/queue.js +4 -0
- package/dist/ecosystem/remote.d.ts +8 -0
- package/dist/ecosystem/remote.js +1 -0
- package/dist/ecosystem/role.d.ts +4 -0
- package/dist/ecosystem/role.js +2 -0
- package/dist/ecosystem/rpc.d.ts +6 -0
- package/dist/ecosystem/rpc.js +3 -0
- package/dist/ecosystem/safe-fetch.d.ts +7 -0
- package/dist/ecosystem/safe-fetch.js +1 -0
- package/dist/ecosystem/scenario.d.ts +21 -0
- package/dist/ecosystem/scenario.js +8 -0
- package/dist/ecosystem/scheduler.d.ts +3 -0
- package/dist/ecosystem/scheduler.js +2 -0
- package/dist/ecosystem/schema.d.ts +2 -0
- package/dist/ecosystem/schema.js +1 -0
- package/dist/ecosystem/scope.d.ts +5 -0
- package/dist/ecosystem/scope.js +3 -0
- package/dist/ecosystem/secret.d.ts +11 -0
- package/dist/ecosystem/secret.js +2 -0
- package/dist/ecosystem/services/istanbul-coverage.d.ts +1 -0
- package/dist/ecosystem/services/istanbul-coverage.js +1 -0
- package/dist/ecosystem/services/local-content-request-handler.d.ts +9 -0
- package/dist/ecosystem/services/local-content-request-handler.js +1 -0
- package/dist/ecosystem/services/local-content.d.ts +2 -0
- package/dist/ecosystem/services/local-content.js +1 -0
- package/dist/ecosystem/services/local-meta.d.ts +1 -0
- package/dist/ecosystem/services/local-meta.js +1 -0
- package/dist/ecosystem/services/v8-coverage.d.ts +1 -0
- package/dist/ecosystem/services/v8-coverage.js +1 -0
- package/dist/ecosystem/services.d.ts +36 -0
- package/dist/ecosystem/services.js +12 -0
- package/dist/ecosystem/testing.d.ts +7 -0
- package/dist/ecosystem/testing.js +1 -0
- package/dist/ecosystem/trigger.d.ts +2 -0
- package/dist/ecosystem/trigger.js +1 -0
- package/dist/ecosystem/types.d.ts +12 -0
- package/dist/ecosystem/types.js +6 -0
- package/dist/ecosystem/variable.d.ts +9 -0
- package/dist/ecosystem/variable.js +1 -0
- package/dist/ecosystem/virtual-user.d.ts +24 -0
- package/dist/ecosystem/virtual-user.js +8 -0
- package/dist/ecosystem/workflow.d.ts +20 -0
- package/dist/ecosystem/workflow.js +6 -0
- package/dist/errors/index.d.ts +8 -0
- package/dist/errors/index.js +1 -0
- package/dist/errors/serialized-error.d.ts +7 -0
- package/dist/errors/serialized-error.js +1 -0
- package/dist/function/function-meta.types.d.ts +139 -0
- package/dist/function/function-meta.types.js +1 -0
- package/dist/function/function-runner.d.ts +3 -2
- package/dist/function/function-runner.js +31 -11
- package/dist/function/functions.types.d.ts +10 -2
- package/dist/function/index.d.ts +8 -2
- package/dist/function/index.js +4 -1
- package/dist/function/pikku-request.d.ts +8 -0
- package/dist/function/pikku-request.js +15 -0
- package/dist/index.d.ts +8 -8
- package/dist/index.js +3 -3
- package/dist/middleware/auth-apikey.d.ts +2 -10
- package/dist/middleware/auth-apikey.js +1 -1
- package/dist/middleware/auth-bearer.d.ts +2 -10
- package/dist/middleware/auth-bearer.js +1 -1
- package/dist/middleware/auth-cookie.d.ts +2 -10
- package/dist/middleware/auth-cookie.js +1 -1
- package/dist/middleware/cors.d.ts +5 -11
- package/dist/middleware/cors.js +13 -6
- package/dist/middleware/index.d.ts +3 -0
- package/dist/middleware/index.js +1 -0
- package/dist/middleware/middleware-factories.d.ts +9 -0
- package/dist/middleware/middleware-factories.js +19 -0
- package/dist/middleware/middleware.types.d.ts +27 -0
- package/dist/middleware/middleware.types.js +1 -0
- package/dist/middleware/remote-auth.d.ts +1 -1
- package/dist/middleware/remote-auth.js +1 -1
- package/dist/middleware/telemetry.d.ts +4 -20
- package/dist/middleware/telemetry.js +1 -1
- package/dist/middleware-runner.d.ts +2 -1
- package/dist/pikku-state.d.ts +2 -1
- package/dist/services/{ai-run-state-service.d.ts → agent-run-state-service.d.ts} +5 -5
- package/dist/services/agent-run-state-service.js +1 -0
- package/dist/services/{ai-agent-runner-service.d.ts → agent-runner-service.d.ts} +12 -12
- package/dist/services/agent-runner-service.js +1 -0
- package/dist/services/{ai-storage-service.d.ts → agent-storage-service.d.ts} +7 -7
- package/dist/services/agent-storage-service.js +1 -0
- package/dist/services/audit-service.d.ts +1 -1
- package/dist/services/credential-wire-service.js +1 -1
- package/dist/services/email-service.d.ts +1 -1
- package/dist/services/file-scenario-run-store.d.ts +58 -0
- package/dist/services/file-scenario-run-store.js +214 -0
- package/dist/services/http-personas.d.ts +1 -1
- package/dist/services/http-personas.js +3 -3
- package/dist/services/{in-memory-ai-run-state-service.d.ts → in-memory-agent-run-state-service.d.ts} +5 -5
- package/dist/services/{in-memory-ai-run-state-service.js → in-memory-agent-run-state-service.js} +1 -1
- package/dist/services/in-memory-workflow-service.d.ts +1 -1
- package/dist/services/index.d.ts +9 -5
- package/dist/services/index.js +4 -1
- package/dist/services/local-secrets.d.ts +1 -1
- package/dist/services/local-secrets.js +1 -1
- package/dist/services/logger.d.ts +7 -7
- package/dist/services/meta-service.d.ts +5 -4
- package/dist/services/scoped-secret-service.d.ts +1 -1
- package/dist/services/secret-service.d.ts +1 -1
- package/dist/services/typed-secret-service.d.ts +16 -2
- package/dist/services/typed-secret-service.js +5 -0
- package/dist/services/webhook-service.d.ts +1 -1
- package/dist/services/workflow-service.d.ts +2 -1
- package/dist/testing/index.d.ts +1 -0
- package/dist/testing/index.js +1 -0
- package/dist/testing/service-tests/agent-run-service-tests.d.ts +1 -1
- package/dist/testing/service-tests/agent-run-service-tests.js +3 -3
- package/dist/testing/service-tests/agent-storage-service-tests.d.ts +3 -0
- package/dist/testing/service-tests/{ai-storage-service-tests.js → agent-storage-service-tests.js} +4 -4
- package/dist/testing/service-tests.d.ts +4 -4
- package/dist/testing/service-tests.js +4 -4
- package/dist/types/core.types.d.ts +37 -187
- package/dist/types/core.types.js +1 -19
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.js +1 -0
- package/dist/types/state.types.d.ts +8 -6
- package/dist/utils.d.ts +13 -0
- package/dist/utils.js +2 -0
- package/dist/wirings/actor-flow/run-conversation.d.ts +2 -2
- package/dist/wirings/addon/addon-runner.d.ts +17 -0
- package/dist/wirings/addon/addon-runner.js +150 -0
- package/dist/wirings/addon/index.d.ts +6 -0
- package/dist/wirings/addon/index.js +3 -0
- package/dist/wirings/addon/remote-addon-auth.d.ts +16 -0
- package/dist/wirings/addon/remote-addon-auth.js +39 -0
- package/dist/wirings/addon/wire-addon.d.ts +80 -0
- package/dist/wirings/addon/wire-addon.js +120 -0
- package/dist/wirings/addon/wire-remote-addon.d.ts +22 -0
- package/dist/wirings/addon/wire-remote-addon.js +11 -0
- package/dist/wirings/{ai-agent/ai-agent-agui.d.ts → agent/agent-agui.d.ts} +2 -2
- package/dist/wirings/{ai-agent/ai-agent-agui.js → agent/agent-agui.js} +1 -1
- package/dist/wirings/{ai-agent/ai-agent-finalize.d.ts → agent/agent-finalize.d.ts} +10 -10
- package/dist/wirings/{ai-agent/ai-agent-finalize.js → agent/agent-finalize.js} +7 -7
- package/dist/wirings/{ai-agent/ai-agent-helpers.d.ts → agent/agent-helpers.d.ts} +1 -1
- package/dist/wirings/{ai-agent/ai-agent-interrupt.d.ts → agent/agent-interrupt.d.ts} +4 -4
- package/dist/wirings/{ai-agent/ai-agent-interrupt.js → agent/agent-interrupt.js} +2 -2
- package/dist/wirings/{ai-agent/ai-agent-memory.d.ts → agent/agent-memory.d.ts} +14 -14
- package/dist/wirings/{ai-agent/ai-agent-memory.js → agent/agent-memory.js} +1 -1
- package/dist/wirings/{ai-agent/ai-agent-model-config.js → agent/agent-model-config.js} +1 -1
- package/dist/wirings/{ai-agent/ai-agent-prepare.d.ts → agent/agent-prepare.d.ts} +24 -24
- package/dist/wirings/{ai-agent/ai-agent-prepare.js → agent/agent-prepare.js} +17 -17
- package/dist/wirings/agent/agent-registry.d.ts +16 -0
- package/dist/wirings/{ai-agent/ai-agent-registry.js → agent/agent-registry.js} +9 -9
- package/dist/wirings/{ai-agent → agent}/agent-rpc.js +8 -8
- package/dist/wirings/agent/agent-runner.d.ts +7 -0
- package/dist/wirings/{ai-agent/ai-agent-runner.js → agent/agent-runner.js} +49 -50
- package/dist/wirings/{ai-agent/ai-agent-stream.d.ts → agent/agent-stream.d.ts} +15 -15
- package/dist/wirings/{ai-agent/ai-agent-stream.js → agent/agent-stream.js} +78 -78
- package/dist/wirings/{ai-agent/ai-agent-turn.d.ts → agent/agent-turn.d.ts} +5 -5
- package/dist/wirings/{ai-agent/ai-agent-turn.js → agent/agent-turn.js} +4 -4
- package/dist/wirings/agent/agent-utils.d.ts +14 -0
- package/dist/wirings/agent/agent-utils.js +17 -0
- package/dist/wirings/{ai-agent/ai-agent.types.d.ts → agent/agent.types.d.ts} +47 -46
- package/dist/wirings/agent/agent.types.js +1 -0
- package/dist/wirings/agent/index.d.ts +12 -0
- package/dist/wirings/agent/index.js +10 -0
- package/dist/wirings/{ai-agent → agent}/voice-input.d.ts +1 -1
- package/dist/wirings/{ai-agent → agent}/voice-input.js +5 -5
- package/dist/wirings/{ai-agent → agent}/voice-output.d.ts +2 -3
- package/dist/wirings/{ai-agent → agent}/voice-output.js +8 -8
- package/dist/wirings/{ai-scorer/ai-scorer-grade.d.ts → agent-scorer/agent-scorer-grade.d.ts} +3 -3
- package/dist/wirings/{ai-scorer/ai-scorer-grade.js → agent-scorer/agent-scorer-grade.js} +6 -6
- package/dist/wirings/agent-scorer/agent-scorer-judge.d.ts +30 -0
- package/dist/wirings/{ai-scorer/ai-scorer-judge.js → agent-scorer/agent-scorer-judge.js} +57 -5
- package/dist/wirings/{ai-scorer/ai-scorer-live.d.ts → agent-scorer/agent-scorer-live.d.ts} +1 -1
- package/dist/wirings/{ai-scorer/ai-scorer-live.js → agent-scorer/agent-scorer-live.js} +3 -3
- package/dist/wirings/{ai-scorer/ai-scorer-registry.d.ts → agent-scorer/agent-scorer-registry.d.ts} +6 -6
- package/dist/wirings/{ai-scorer/ai-scorer-registry.js → agent-scorer/agent-scorer-registry.js} +4 -4
- package/dist/wirings/{ai-scorer/ai-scorer-snapshots.d.ts → agent-scorer/agent-scorer-snapshots.d.ts} +1 -1
- package/dist/wirings/{ai-scorer/ai-scorer-worker.d.ts → agent-scorer/agent-scorer-worker.d.ts} +3 -3
- package/dist/wirings/{ai-scorer/ai-scorer-worker.js → agent-scorer/agent-scorer-worker.js} +9 -7
- package/dist/wirings/{ai-scorer/ai-scorer.d.ts → agent-scorer/agent-scorer.d.ts} +12 -6
- package/dist/wirings/{ai-scorer/ai-scorer.js → agent-scorer/agent-scorer.js} +4 -3
- package/dist/wirings/{ai-scorer/ai-scorer.types.d.ts → agent-scorer/agent-scorer.types.d.ts} +24 -4
- package/dist/wirings/agent-scorer/agent-scorer.types.js +4 -0
- package/dist/wirings/agent-scorer/index.d.ts +6 -0
- package/dist/wirings/agent-scorer/index.js +5 -0
- package/dist/wirings/channel/channel-common.d.ts +2 -1
- package/dist/wirings/channel/channel-middleware-runner.d.ts +2 -1
- package/dist/wirings/channel/channel-rpc.types.d.ts +2 -2
- package/dist/wirings/channel/channel.types.d.ts +1 -1
- package/dist/wirings/channel/serverless/index.d.ts +1 -0
- package/dist/wirings/cli/channel/index.d.ts +1 -1
- package/dist/wirings/cli/cli-runner.d.ts +2 -1
- package/dist/wirings/cli/cli-runner.js +4 -1
- package/dist/wirings/cli/cli.types.d.ts +21 -2
- package/dist/wirings/cli/command-parser.js +157 -23
- package/dist/wirings/gateway/gateway.types.d.ts +2 -1
- package/dist/wirings/http/http-runner.d.ts +1 -1
- package/dist/wirings/http/http-runner.js +1 -1
- package/dist/wirings/http/http.types.d.ts +2 -2
- package/dist/wirings/http/index.d.ts +1 -0
- package/dist/wirings/http/index.js +1 -0
- package/dist/wirings/http/pikku-fetch-http-request.js +1 -1
- package/dist/wirings/http/pikku-fetch-http-response.js +2 -2
- package/dist/wirings/mcp/mcp.types.d.ts +1 -1
- package/dist/wirings/persona/index.d.ts +1 -1
- package/dist/wirings/persona/index.js +1 -1
- package/dist/wirings/persona/persona.types.d.ts +14 -0
- package/dist/wirings/queue/queue.types.d.ts +1 -1
- package/dist/wirings/queue/signed-queue-service.d.ts +1 -1
- package/dist/wirings/rpc/index.d.ts +0 -6
- package/dist/wirings/rpc/index.js +0 -3
- package/dist/wirings/rpc/remote-addon-auth.d.ts +1 -1
- package/dist/wirings/rpc/remote-addon-auth.js +1 -1
- package/dist/wirings/rpc/rpc-runner.d.ts +1 -1
- package/dist/wirings/rpc/rpc-runner.js +4 -4
- package/dist/wirings/rpc/rpc-types.d.ts +1 -1
- package/dist/wirings/rpc/wire-addon.d.ts +1 -1
- package/dist/wirings/scheduler/scheduler.types.d.ts +2 -1
- package/dist/wirings/scope/index.d.ts +1 -0
- package/dist/wirings/scope/index.js +1 -0
- package/dist/wirings/secret/secret.types.d.ts +10 -0
- package/dist/wirings/secret/validate-secret-definitions.js +2 -0
- package/dist/wirings/variable/validate-variable-definitions.js +2 -0
- package/dist/wirings/variable/variable.types.d.ts +9 -0
- package/dist/wirings/virtual-user/index.d.ts +1 -1
- package/dist/wirings/virtual-user/index.js +1 -1
- package/dist/wirings/virtual-user/prepare-virtual-user-run.d.ts +1 -1
- package/dist/wirings/virtual-user/prepare-virtual-user-run.js +1 -1
- package/dist/wirings/virtual-user/virtual-user-agents.d.ts +1 -1
- package/dist/wirings/virtual-user/virtual-user-derive.d.ts +1 -1
- package/dist/wirings/workflow/graph/graph-node.d.ts +9 -2
- package/dist/wirings/workflow/graph/graph-node.js +2 -0
- package/dist/wirings/workflow/graph/graph-runner.d.ts +1 -0
- package/dist/wirings/workflow/graph/graph-runner.js +283 -31
- package/dist/wirings/workflow/graph/workflow-graph.types.d.ts +16 -1
- package/dist/wirings/workflow/index.d.ts +2 -0
- package/dist/wirings/workflow/index.js +1 -0
- package/dist/wirings/workflow/pikku-scenario-service.d.ts +14 -4
- package/dist/wirings/workflow/pikku-scenario-service.js +44 -16
- package/dist/wirings/workflow/pikku-workflow-service.d.ts +2 -1
- package/dist/wirings/workflow/pikku-workflow-service.js +3 -4
- package/dist/wirings/workflow/run-timeline.d.ts +2 -3
- package/dist/wirings/workflow/scenario-run.types.d.ts +171 -0
- package/dist/wirings/workflow/scenario-run.types.js +1 -0
- package/dist/wirings/workflow/scenario-step-guards.d.ts +1 -2
- package/dist/wirings/workflow/scenario-step-guards.js +0 -8
- package/dist/wirings/workflow/scenario-step.types.d.ts +27 -12
- package/dist/wirings/workflow/workflow-approval.js +2 -1
- package/dist/wirings/workflow/workflow-run-engine.types.d.ts +2 -1
- package/dist/wirings/workflow/workflow.types.d.ts +2 -1
- package/knowledge/decisions/index.md +2 -0
- package/knowledge/decisions/internals/{a-non-streaming-agent-run-registers-with-airunstate-too.md → a-non-streaming-agent-run-registers-with-agentrunstate-too.md} +6 -6
- package/knowledge/decisions/internals/a-resumed-agent-turn-is-as-interruptible-as-the-first.md +1 -1
- package/knowledge/decisions/internals/a-scenario-step-template-is-offered-unfilled.md +1 -1
- package/knowledge/decisions/internals/a-secret-that-fails-to-decrypt-fails-the-whole-read.md +1 -1
- package/knowledge/decisions/internals/a-virtual-user-run-is-not-a-workflow-and-not-a-queued-job.md +2 -2
- package/knowledge/decisions/internals/a-wall-clock-threshold-is-a-load-test-in-disguise.md +6 -6
- package/knowledge/decisions/internals/a-workflow-wire-is-built-from-the-run-not-from-the-rpc-service.md +1 -1
- package/knowledge/decisions/internals/actor-flow-drives-the-target-through-a-transport-seam.md +1 -1
- package/knowledge/decisions/internals/addon-singleton-services-are-cached-per-namespace-not-per-package.md +1 -1
- package/knowledge/decisions/internals/addon-workflow-names-are-prefixed-with-the-consumer-namespace.md +1 -1
- package/knowledge/decisions/internals/{ai-agent-agui-bridge-obeys-the-client-ordering-contract.md → agent-agui-bridge-obeys-the-client-ordering-contract.md} +5 -5
- package/knowledge/decisions/internals/{ai-agent-audio-chunks-carry-the-format-the-provider-returned.md → agent-audio-chunks-carry-the-format-the-provider-returned.md} +2 -2
- package/knowledge/decisions/internals/agent-context-waits-for-a-tool-result-still-being-written.md +1 -1
- package/knowledge/decisions/internals/{ai-agent-credential-suspensions-hide-the-tool-result.md → agent-credential-suspensions-hide-the-tool-result.md} +2 -2
- package/knowledge/decisions/internals/{ai-agent-delegate-and-supervise-hide-different-text.md → agent-delegate-and-supervise-hide-different-text.md} +4 -4
- package/knowledge/decisions/internals/{ai-agent-llm-tool-arguments-have-nulls-stripped.md → agent-llm-tool-arguments-have-nulls-stripped.md} +3 -3
- package/knowledge/decisions/internals/{ai-agent-model-config-stays-a-single-resolution-seam.md → agent-model-config-stays-a-single-resolution-seam.md} +3 -3
- package/knowledge/decisions/internals/{ai-agent-onerror-hooks-cannot-change-the-failure.md → agent-onerror-hooks-cannot-change-the-failure.md} +6 -6
- package/knowledge/decisions/internals/{ai-agent-runner-methods-must-keep-their-receiver.md → agent-runner-methods-must-keep-their-receiver.md} +4 -4
- package/knowledge/decisions/internals/agent-speech-travels-as-a-custom-agui-event.md +1 -1
- package/knowledge/decisions/internals/{ai-agent-stream-persistence-is-best-effort.md → agent-stream-persistence-is-best-effort.md} +4 -4
- package/knowledge/decisions/internals/{ai-agent-sub-agents-inherit-the-parent-context-block.md → agent-sub-agents-inherit-the-parent-context-block.md} +3 -3
- package/knowledge/decisions/internals/{ai-agent-tool-execute-failures-are-logged-unconditionally.md → agent-tool-execute-failures-are-logged-unconditionally.md} +3 -3
- package/knowledge/decisions/internals/{ai-agent-voice-input-transcribes-audio-parts-in-place.md → agent-voice-input-transcribes-audio-parts-in-place.md} +2 -2
- package/knowledge/decisions/internals/{ai-agent-working-memory-is-persisted-only-when-valid.md → agent-working-memory-is-persisted-only-when-valid.md} +2 -2
- package/knowledge/decisions/internals/an-addon-scope-root-loses-to-a-root-the-host-already-declares.md +1 -1
- package/knowledge/decisions/internals/an-agent-interrupt-is-not-a-failure.md +2 -2
- package/knowledge/decisions/internals/an-agent-run-owned-by-another-instance-says-so.md +3 -3
- package/knowledge/decisions/internals/an-agent-stream-send-must-return-the-inner-sends-promise.md +2 -2
- package/knowledge/decisions/internals/an-empty-text-part-is-omitted-from-an-agent-message.md +1 -1
- package/knowledge/decisions/internals/an-empty-transcript-is-not-recorded.md +1 -1
- package/knowledge/decisions/internals/channel-message-handlers-accept-three-config-shapes.md +1 -1
- package/knowledge/decisions/internals/channel-middleware-caches-only-statically-resolved-middleware.md +1 -1
- package/knowledge/decisions/internals/channel-user-id-is-persisted-after-onconnect-middleware-runs.md +1 -1
- package/knowledge/decisions/internals/cli-option-names-are-camelcase-in-state-and-kebab-on-the-command-line.md +1 -1
- package/knowledge/decisions/internals/cli-parse-errors-are-routed-by-message-prefix.md +1 -1
- package/knowledge/decisions/internals/cli-unknown-long-options-warn-instead-of-failing.md +1 -1
- package/knowledge/decisions/internals/core-column-form-is-an-axis-of-its-own.md +4 -4
- package/knowledge/decisions/internals/core-data-classification-brand-is-an-optional-property.md +1 -1
- package/knowledge/decisions/internals/core-function-runner-restores-the-wire-fields-it-overwrites.md +3 -3
- package/knowledge/decisions/internals/core-hot-reload-merges-generated-meta-never-replaces-it.md +2 -2
- package/knowledge/decisions/internals/core-hot-reload-owns-its-module-registry.md +2 -2
- package/knowledge/decisions/internals/core-middleware-order-is-scope-then-priority.md +1 -1
- package/knowledge/decisions/internals/core-schema-defaults-apply-on-every-transport.md +1 -1
- package/knowledge/decisions/internals/core-scopes-are-an-and-gate-separate-from-permissions.md +3 -3
- package/knowledge/decisions/internals/gateway-adapters-resolve-lazily-and-are-promise-cached.md +1 -1
- package/knowledge/decisions/internals/gateway-listener-middleware-runs-without-an-rpc-on-the-wire.md +4 -4
- package/knowledge/decisions/internals/gateway-wiring-is-a-meta-wiring-over-http-and-channels.md +1 -1
- package/knowledge/decisions/internals/http-router-matches-normalized-paths-but-returns-registered-ones.md +1 -1
- package/knowledge/decisions/internals/in-a-scenario-a-4xx-is-data-not-an-exception.md +1 -1
- package/knowledge/decisions/internals/in-memory-workflow-history-aliases-the-live-step-object.md +1 -1
- package/knowledge/decisions/internals/index.md +4 -2
- package/knowledge/decisions/internals/istanbul-statement-counts-attach-to-the-start-line-only.md +1 -1
- package/knowledge/decisions/internals/one-project-shape-check-two-validators.md +1 -1
- package/knowledge/decisions/internals/queue-jobs-always-carry-an-explicit-attempts-count.md +1 -1
- package/knowledge/decisions/internals/remote-addons-dispatch-over-http-instead-of-local-meta.md +1 -1
- package/knowledge/decisions/internals/rpc-names-resolve-through-package-scope-before-root.md +1 -1
- package/knowledge/decisions/internals/scenario-given-and-when-are-sugar-but-then-is-not.md +2 -2
- package/knowledge/decisions/internals/scenarios-live-in-files-named-for-them.md +5 -5
- package/knowledge/decisions/internals/speech-synthesis-picks-a-voice-per-sentence-and-warns-once.md +1 -1
- package/knowledge/decisions/internals/the-actor-prompt-says-json-because-of-json-object-mode.md +1 -1
- package/knowledge/decisions/internals/the-agent-done-event-goes-through-the-middleware-and-is-awaited.md +1 -1
- package/knowledge/decisions/internals/the-api-report-pins-members-not-just-names.md +1 -1
- package/knowledge/decisions/internals/the-ecosystem-entry-point-carries-the-adapter-surface.md +43 -19
- package/knowledge/decisions/internals/the-embedding-model-is-pinned-per-service-and-doc-query-embedding-is-split.md +1 -1
- package/knowledge/decisions/internals/the-per-invocation-rpc-view-is-a-class.md +5 -5
- package/knowledge/decisions/internals/the-persona-runtime-is-exported-from-the-persona-entry-point.md +1 -1
- package/knowledge/decisions/internals/the-transcript-event-is-sent-ahead-of-the-run.md +2 -2
- package/knowledge/decisions/internals/the-worker-disposition-is-the-one-that-is-not-testing.md +1 -1
- package/knowledge/decisions/internals/thread-history-records-the-transcript-not-the-audio.md +2 -2
- package/knowledge/decisions/internals/validate-runs-checks-by-precondition.md +3 -3
- package/knowledge/decisions/internals/virtual-user-step-order-comes-from-insertion-order.md +1 -1
- package/knowledge/decisions/internals/voice-output-speaks-unless-voice-input-explicitly-says-otherwise.md +1 -1
- package/knowledge/decisions/internals/webhook-delivery-history-records-every-attempt-best-effort.md +1 -1
- package/knowledge/decisions/internals/wiring-registries-erase-the-generics-their-wire-functions-capture.md +1 -1
- package/knowledge/decisions/internals/workflow-approval-expiry-is-decided-from-a-recorded-deadline.md +1 -1
- package/knowledge/decisions/internals/workflow-core-never-imports-a-browser-driver.md +1 -1
- package/knowledge/decisions/internals/workflow-inline-runs-report-their-run-id-before-they-can-fail.md +1 -1
- package/knowledge/decisions/internals/workflow-invocation-id-is-the-dedupe-key-not-step-id.md +1 -1
- package/knowledge/decisions/internals/workflow-run-capabilities-are-extensions-not-subclasses.md +1 -1
- package/knowledge/decisions/internals/workflow-run-timeline-is-a-pure-fold-over-durable-history.md +1 -1
- package/knowledge/decisions/internals/workflow-scenario-assertions-never-retry-and-record-one-step.md +9 -5
- package/knowledge/decisions/internals/workflow-scenario-hooks-are-a-scenario-only-affordance.md +1 -1
- package/knowledge/decisions/internals/workflow-step-rpc-name-is-provenance-only.md +2 -2
- package/knowledge/decisions/internals/workflow-suspend-and-approval-reasons-are-durable-step-identities.md +1 -1
- package/knowledge/decisions/security/a-function-never-receives-the-secret-service.md +1 -1
- package/knowledge/decisions/security/a-step-runs-the-function-the-workflow-dispatched-it-with.md +1 -1
- package/knowledge/decisions/security/a-virtual-user-is-never-offered-a-step-that-would-forge-its-own-oracle.md +2 -3
- package/knowledge/decisions/security/actor-sign-in-is-proven-by-set-cookie-not-a-non-empty-jar.md +1 -1
- package/knowledge/decisions/security/addon-auth-and-tags-only-tighten.md +1 -1
- package/knowledge/decisions/security/{ai-agent-approval-forwarding-requires-a-symbol-brand.md → agent-approval-forwarding-requires-a-symbol-brand.md} +3 -3
- package/knowledge/decisions/security/{ai-agent-credential-requests-are-symbol-branded.md → agent-credential-requests-are-symbol-branded.md} +4 -4
- package/knowledge/decisions/security/{ai-agent-gate-requires-a-session-only-when-auth-is-true.md → agent-gate-requires-a-session-only-when-auth-is-true.md} +4 -4
- package/knowledge/decisions/security/{ai-agent-ownership-failures-never-echo-the-resource.md → agent-ownership-failures-never-echo-the-resource.md} +2 -2
- package/knowledge/decisions/security/{ai-agent-resume-re-runs-the-authorization-gate.md → agent-resume-re-runs-the-authorization-gate.md} +4 -4
- package/knowledge/decisions/security/{ai-agent-sessionless-deployments-have-no-thread-ownership.md → agent-sessionless-deployments-have-no-thread-ownership.md} +5 -5
- package/knowledge/decisions/security/{ai-agent-thread-ownership-composes-the-session-principal.md → agent-thread-ownership-composes-the-session-principal.md} +2 -2
- package/knowledge/decisions/security/{ai-agent-tool-filtering-reads-the-live-function-config.md → agent-tool-filtering-reads-the-live-function-config.md} +2 -2
- package/knowledge/decisions/security/an-agent-approval-is-claimed-before-the-tool-runs.md +3 -3
- package/knowledge/decisions/security/an-approval-answer-outlives-the-run-it-answered.md +3 -3
- package/knowledge/decisions/security/an-empty-owners-constraint-matches-nothing.md +3 -3
- package/knowledge/decisions/security/console-addon-privileged-functions-gate-themselves.md +21 -13
- package/knowledge/decisions/security/core-safe-fetch-blocks-ssrf-by-host-literal-not-dns.md +1 -1
- package/knowledge/decisions/security/gateway-middleware-sessions-must-be-bridged-onto-the-wire.md +2 -2
- package/knowledge/decisions/security/global-permissions-and-function-permissions-are-independent-gates.md +1 -1
- package/knowledge/decisions/security/http-request-bodies-are-bounded-before-they-are-buffered.md +2 -2
- package/knowledge/decisions/security/index.md +3 -2
- package/knowledge/decisions/security/mcp-internal-error-details-are-double-gated-on-production.md +1 -1
- package/knowledge/decisions/security/queue-jobs-carry-the-producers-pikku-user-id.md +3 -3
- package/knowledge/decisions/security/remote-addon-tokens-are-client-credentials-not-mesh-trust.md +1 -1
- package/knowledge/decisions/security/scaffold-features-are-authenticated-unless-opted-out.md +2 -2
- package/knowledge/decisions/security/self-authentication-is-declared-not-detected.md +1 -1
- package/knowledge/decisions/security/signed-content-urls-bind-the-request-path.md +2 -2
- package/knowledge/index.md +3 -1
- package/knowledge/questions/channel-middleware-accepts-bare-factories-that-nothing-resolves.md +1 -1
- package/knowledge/questions/index.md +2 -0
- package/package.json +16 -14
- package/run-tests.sh +0 -0
- package/scripts/generate-api-report.d.mts +1 -1
- package/scripts/generate-api-report.mjs +67 -60
- package/scripts/generate-api-report.mts +37 -47
- package/src/agent-naming.test.ts +68 -0
- package/src/api-report.test.ts +70 -1
- package/src/app-alias-surface.test.ts +179 -0
- package/src/app-leaf-surface.test.ts +217 -0
- package/src/bootstrap-compat/root.ts +20 -0
- package/src/{column-form.test.ts → classification/column-form.test.ts} +2 -2
- package/src/{data-classification.ts → classification/data-classification.ts} +1 -5
- package/src/classification/index.ts +38 -0
- package/src/{secret-value.test.ts → classification/secret-value.test.ts} +2 -2
- package/src/{secret-value.ts → classification/secret-value.ts} +1 -6
- package/src/crypto-utils.ts +1 -1
- package/src/dev/reload-meta.test.ts +1 -1
- package/src/errors/index.ts +9 -0
- package/src/errors/serialized-error.ts +9 -0
- package/src/factory-functions.test.ts +4 -2
- package/src/function/function-meta.types.ts +151 -0
- package/src/function/function-runner.test.ts +4 -2
- package/src/function/function-runner.ts +47 -14
- package/src/function/functions.types.ts +11 -7
- package/src/function/index.ts +24 -5
- package/src/function/list.types.ts +1 -3
- package/src/middleware/auth-apikey.ts +4 -2
- package/src/middleware/auth-bearer.test.ts +1 -1
- package/src/middleware/auth-bearer.ts +4 -2
- package/src/middleware/auth-cookie.ts +4 -1
- package/src/middleware/cors.test.ts +126 -5
- package/src/middleware/cors.ts +19 -8
- package/src/middleware/index.ts +16 -0
- package/src/middleware/middleware-factories.ts +62 -0
- package/src/middleware/middleware.types.ts +61 -0
- package/src/middleware/remote-auth.test.ts +1 -1
- package/src/middleware/remote-auth.ts +1 -1
- package/src/middleware/telemetry.ts +4 -2
- package/src/middleware-runner.test.ts +2 -3
- package/src/middleware-runner.ts +2 -2
- package/src/no-root-barrel.test.ts +114 -0
- package/src/permissions.ts +2 -4
- package/src/pikku-state.ts +6 -4
- package/src/public-surface.json +90 -170
- package/src/public-surface.json.README +20 -2
- package/src/public-surface.test.ts +31 -3
- package/src/remote.test.ts +1 -1
- package/src/removed-legacy-exports.test.ts +5 -1
- package/src/services/{ai-run-state-service.ts → agent-run-state-service.ts} +5 -5
- package/src/services/{ai-agent-runner-service.ts → agent-runner-service.ts} +18 -18
- package/src/services/{ai-storage-service.ts → agent-storage-service.ts} +7 -7
- package/src/services/audit-service.ts +1 -1
- package/src/services/credential-wire-service.ts +1 -1
- package/src/services/email-service.ts +2 -4
- package/src/services/file-scenario-run-store.test.ts +349 -0
- package/src/services/file-scenario-run-store.ts +282 -0
- package/src/services/http-personas-converse.test.ts +3 -3
- package/src/services/http-personas.ts +4 -4
- package/src/services/{in-memory-ai-run-state-service.ts → in-memory-agent-run-state-service.ts} +7 -7
- package/src/services/in-memory-workflow-service.ts +1 -1
- package/src/services/index.ts +22 -10
- package/src/services/local-content-request-handler.ts +1 -2
- package/src/services/local-secrets.ts +1 -1
- package/src/services/logger.ts +7 -7
- package/src/services/meta-service.ts +5 -5
- package/src/services/queue-webhook-service.test.ts +1 -1
- package/src/services/scoped-secret-service.ts +1 -1
- package/src/services/secret-service.ts +1 -1
- package/src/services/typed-secret-service.test.ts +52 -0
- package/src/services/typed-secret-service.ts +26 -2
- package/src/services/webhook-service.ts +1 -1
- package/src/services/workflow-service.ts +2 -1
- package/src/template-alias-surface.test.ts +240 -0
- package/src/testing/index.ts +1 -0
- package/src/testing/service-tests/agent-run-service-tests.ts +4 -4
- package/src/testing/service-tests/{ai-storage-service-tests.ts → agent-storage-service-tests.ts} +8 -8
- package/src/testing/service-tests.ts +10 -8
- package/src/types/core.types.ts +40 -292
- package/src/types/index.ts +2 -0
- package/src/types/state.types.ts +12 -14
- package/src/types/typed-credentials.test.ts +72 -0
- package/src/utils.ts +34 -0
- package/src/wirings/actor-flow/run-conversation.test.ts +2 -2
- package/src/wirings/actor-flow/run-conversation.ts +7 -9
- package/src/wirings/{rpc → addon}/addon-scopes.test.ts +1 -1
- package/src/wirings/addon/index.ts +12 -0
- package/src/wirings/{rpc → addon}/remote-addon-auth.ts +4 -1
- package/src/wirings/{rpc → addon}/wire-addon.ts +37 -2
- package/src/wirings/{ai-agent/ai-agent-agui.test.ts → agent/agent-agui.test.ts} +126 -105
- package/src/wirings/{ai-agent/ai-agent-agui.ts → agent/agent-agui.ts} +7 -7
- package/src/wirings/{ai-agent/ai-agent-authorization.test.ts → agent/agent-authorization.test.ts} +6 -6
- package/src/wirings/{ai-agent/ai-agent-finalize.test.ts → agent/agent-finalize.test.ts} +17 -16
- package/src/wirings/{ai-agent/ai-agent-finalize.ts → agent/agent-finalize.ts} +22 -22
- package/src/wirings/{ai-agent/ai-agent-helpers.test.ts → agent/agent-helpers.test.ts} +1 -1
- package/src/wirings/{ai-agent/ai-agent-helpers.ts → agent/agent-helpers.ts} +1 -1
- package/src/wirings/{ai-agent/ai-agent-interrupt.test.ts → agent/agent-interrupt.test.ts} +67 -77
- package/src/wirings/{ai-agent/ai-agent-interrupt.ts → agent/agent-interrupt.ts} +5 -5
- package/src/wirings/{ai-agent/ai-agent-memory.test.ts → agent/agent-memory.test.ts} +12 -12
- package/src/wirings/{ai-agent/ai-agent-memory.ts → agent/agent-memory.ts} +36 -36
- package/src/wirings/{ai-agent/ai-agent-model-config.test.ts → agent/agent-model-config.test.ts} +2 -5
- package/src/wirings/{ai-agent/ai-agent-model-config.ts → agent/agent-model-config.ts} +1 -1
- package/src/wirings/{ai-agent/ai-agent-prepare.test.ts → agent/agent-prepare.test.ts} +18 -18
- package/src/wirings/{ai-agent/ai-agent-prepare.ts → agent/agent-prepare.ts} +60 -56
- package/src/wirings/{ai-agent/ai-agent-registry.test.ts → agent/agent-registry.test.ts} +49 -43
- package/src/wirings/{ai-agent/ai-agent-registry.ts → agent/agent-registry.ts} +14 -14
- package/src/wirings/{ai-agent/ai-agent-resume-authorization.test.ts → agent/agent-resume-authorization.test.ts} +18 -18
- package/src/wirings/{ai-agent → agent}/agent-rpc.ts +16 -20
- package/src/wirings/{ai-agent/ai-agent-runner.test.ts → agent/agent-runner.test.ts} +105 -106
- package/src/wirings/{ai-agent/ai-agent-runner.ts → agent/agent-runner.ts} +91 -82
- package/src/wirings/{ai-agent/ai-agent-stream-output-hooks.test.ts → agent/agent-stream-output-hooks.test.ts} +25 -25
- package/src/wirings/{ai-agent/ai-agent-stream.test.ts → agent/agent-stream.test.ts} +147 -143
- package/src/wirings/{ai-agent/ai-agent-stream.ts → agent/agent-stream.ts} +148 -148
- package/src/wirings/{ai-agent/ai-agent-thread-ownership.test.ts → agent/agent-thread-ownership.test.ts} +24 -28
- package/src/wirings/{ai-agent/ai-agent-turn.test.ts → agent/agent-turn.test.ts} +3 -5
- package/src/wirings/{ai-agent/ai-agent-turn.ts → agent/agent-turn.ts} +7 -7
- package/src/wirings/agent/agent-utils.ts +20 -0
- package/src/wirings/{ai-agent/ai-agent.types.ts → agent/agent.types.ts} +54 -51
- package/src/wirings/agent/index.ts +57 -0
- package/src/wirings/{ai-agent → agent}/voice-input.test.ts +15 -15
- package/src/wirings/{ai-agent → agent}/voice-input.ts +11 -11
- package/src/wirings/{ai-agent → agent}/voice-output.test.ts +25 -27
- package/src/wirings/{ai-agent → agent}/voice-output.ts +11 -11
- package/src/wirings/{ai-scorer/ai-scorer-grade.test.ts → agent-scorer/agent-scorer-grade.test.ts} +8 -8
- package/src/wirings/{ai-scorer/ai-scorer-grade.ts → agent-scorer/agent-scorer-grade.ts} +9 -9
- package/src/wirings/agent-scorer/agent-scorer-judge.test.ts +285 -0
- package/src/wirings/agent-scorer/agent-scorer-judge.ts +180 -0
- package/src/wirings/{ai-scorer/ai-scorer-live.test.ts → agent-scorer/agent-scorer-live.test.ts} +11 -11
- package/src/wirings/{ai-scorer/ai-scorer-live.ts → agent-scorer/agent-scorer-live.ts} +3 -3
- package/src/wirings/{ai-scorer/ai-scorer-registry.ts → agent-scorer/agent-scorer-registry.ts} +11 -8
- package/src/wirings/{ai-scorer/ai-scorer-sampling.test.ts → agent-scorer/agent-scorer-sampling.test.ts} +1 -1
- package/src/wirings/{ai-scorer/ai-scorer-snapshots.test.ts → agent-scorer/agent-scorer-snapshots.test.ts} +2 -2
- package/src/wirings/{ai-scorer/ai-scorer-snapshots.ts → agent-scorer/agent-scorer-snapshots.ts} +1 -1
- package/src/wirings/{ai-scorer/ai-scorer-worker.test.ts → agent-scorer/agent-scorer-worker.test.ts} +15 -15
- package/src/wirings/{ai-scorer/ai-scorer-worker.ts → agent-scorer/agent-scorer-worker.ts} +9 -7
- package/src/wirings/{ai-scorer/ai-scorer.ts → agent-scorer/agent-scorer.ts} +15 -7
- package/src/wirings/{ai-scorer/ai-scorer.types.ts → agent-scorer/agent-scorer.types.ts} +27 -6
- package/src/wirings/agent-scorer/index.ts +23 -0
- package/src/wirings/channel/channel-common.ts +4 -2
- package/src/wirings/channel/channel-handler.ts +2 -5
- package/src/wirings/channel/channel-middleware-runner.ts +1 -1
- package/src/wirings/channel/channel-rpc.types.ts +3 -7
- package/src/wirings/channel/channel.types.ts +1 -2
- package/src/wirings/channel/local/local-channel-runner.test.ts +1 -2
- package/src/wirings/channel/serverless/index.ts +1 -0
- package/src/wirings/cli/channel/cli-raw-channel-runner.ts +2 -2
- package/src/wirings/cli/channel/index.ts +1 -3
- package/src/wirings/cli/cli-runner.test.ts +1 -1
- package/src/wirings/cli/cli-runner.ts +11 -7
- package/src/wirings/cli/cli.types.ts +24 -3
- package/src/wirings/cli/command-parser.test.ts +388 -1
- package/src/wirings/cli/command-parser.ts +189 -29
- package/src/wirings/gateway/gateway-runner.test.ts +1 -2
- package/src/wirings/gateway/gateway-runner.ts +3 -6
- package/src/wirings/gateway/gateway.types.ts +5 -4
- package/src/wirings/http/http-routes.test.ts +1 -2
- package/src/wirings/http/http-runner-addon-ref.test.ts +238 -0
- package/src/wirings/http/http-runner.test.ts +3 -8
- package/src/wirings/http/http-runner.ts +9 -3
- package/src/wirings/http/http.types.ts +3 -12
- package/src/wirings/http/index.ts +1 -0
- package/src/wirings/http/pikku-fetch-http-request.ts +1 -1
- package/src/wirings/http/pikku-fetch-http-response.ts +3 -2
- package/src/wirings/mcp/mcp-runner.test.ts +1 -1
- package/src/wirings/mcp/mcp.types.ts +1 -2
- package/src/wirings/persona/index.ts +1 -4
- package/src/wirings/persona/persona.types.ts +14 -0
- package/src/wirings/queue/queue-identity.test.ts +1 -1
- package/src/wirings/queue/queue.types.ts +2 -6
- package/src/wirings/queue/signed-queue-service.ts +1 -1
- package/src/wirings/rpc/index.ts +0 -12
- package/src/wirings/rpc/rpc-runner.test.ts +4 -4
- package/src/wirings/rpc/rpc-runner.ts +5 -5
- package/src/wirings/rpc/rpc-types.ts +1 -1
- package/src/wirings/scheduler/scheduler.types.ts +2 -5
- package/src/wirings/scope/index.ts +1 -0
- package/src/wirings/secret/secret.types.ts +10 -0
- package/src/wirings/secret/validate-secret-definitions.test.ts +23 -0
- package/src/wirings/secret/validate-secret-definitions.ts +2 -0
- package/src/wirings/variable/validate-variable-definitions.test.ts +23 -0
- package/src/wirings/variable/validate-variable-definitions.ts +2 -0
- package/src/wirings/variable/variable.types.ts +9 -0
- package/src/wirings/virtual-user/index.ts +1 -4
- package/src/wirings/virtual-user/prepare-virtual-user-run.ts +2 -2
- package/src/wirings/virtual-user/run-virtual-user.test.ts +2 -2
- package/src/wirings/virtual-user/run-virtual-user.ts +3 -3
- package/src/wirings/virtual-user/virtual-user-agents.ts +1 -1
- package/src/wirings/virtual-user/virtual-user-derive.test.ts +1 -1
- package/src/wirings/virtual-user/virtual-user-derive.ts +1 -1
- package/src/wirings/virtual-user/virtual-user.types.ts +1 -5
- package/src/wirings/workflow/graph/graph-foreach-queued.test.ts +569 -0
- package/src/wirings/workflow/graph/graph-foreach.test.ts +626 -0
- package/src/wirings/workflow/graph/graph-node.ts +16 -1
- package/src/wirings/workflow/graph/graph-runner.ts +387 -61
- package/src/wirings/workflow/graph/workflow-graph.types.ts +28 -3
- package/src/wirings/workflow/index.ts +8 -0
- package/src/wirings/workflow/pikku-scenario-service.ts +59 -19
- package/src/wirings/workflow/pikku-workflow-service.ts +6 -8
- package/src/wirings/workflow/run-timeline.ts +2 -2
- package/src/wirings/workflow/scenario-expectations.test.ts +28 -13
- package/src/wirings/workflow/scenario-run.types.ts +186 -0
- package/src/wirings/workflow/scenario-step-guards.ts +1 -14
- package/src/wirings/workflow/scenario-step.test.ts +32 -7
- package/src/wirings/workflow/scenario-step.types.ts +27 -12
- package/src/wirings/workflow/workflow-approval-policy.test.ts +117 -47
- package/src/wirings/workflow/workflow-approval.ts +2 -1
- package/src/wirings/workflow/workflow-run-engine.types.ts +2 -1
- package/src/wirings/workflow/workflow.types.ts +4 -12
- package/src/wirings-stay-decoupled.test.ts +7 -4
- package/tsconfig.tsbuildinfo +1 -1
- package/tsconfig.type-tests.json +3 -2
- package/dist/testing/service-tests/ai-storage-service-tests.d.ts +0 -3
- package/dist/wirings/ai-agent/ai-agent-registry.d.ts +0 -16
- package/dist/wirings/ai-agent/ai-agent-runner.d.ts +0 -7
- package/dist/wirings/ai-agent/ai-agent-utils.d.ts +0 -1
- package/dist/wirings/ai-agent/ai-agent-utils.js +0 -1
- package/dist/wirings/ai-agent/index.d.ts +0 -12
- package/dist/wirings/ai-agent/index.js +0 -10
- package/dist/wirings/ai-scorer/ai-scorer-judge.d.ts +0 -17
- package/dist/wirings/ai-scorer/ai-scorer.types.js +0 -4
- package/dist/wirings/ai-scorer/index.d.ts +0 -6
- package/dist/wirings/ai-scorer/index.js +0 -5
- package/src/ecosystem.ts +0 -40
- package/src/index.ts +0 -255
- package/src/wirings/ai-agent/ai-agent-utils.ts +0 -1
- package/src/wirings/ai-agent/index.ts +0 -65
- package/src/wirings/ai-scorer/ai-scorer-judge.test.ts +0 -143
- package/src/wirings/ai-scorer/ai-scorer-judge.ts +0 -120
- package/src/wirings/ai-scorer/index.ts +0 -24
- /package/dist/{services/ai-agent-runner-service.js → bootstrap-compat/root.js} +0 -0
- /package/dist/{services/ai-run-state-service.js → classification/data-classification.js} +0 -0
- /package/dist/{services/ai-storage-service.js → ecosystem/gateway.js} +0 -0
- /package/dist/{wirings/ai-agent/ai-agent.types.js → ecosystem/node.js} +0 -0
- /package/dist/wirings/{ai-agent/ai-agent-helpers.js → agent/agent-helpers.js} +0 -0
- /package/dist/wirings/{ai-agent/ai-agent-model-config.d.ts → agent/agent-model-config.d.ts} +0 -0
- /package/dist/wirings/{ai-agent → agent}/agent-rpc.d.ts +0 -0
- /package/dist/wirings/{ai-scorer/ai-scorer-sampling.d.ts → agent-scorer/agent-scorer-sampling.d.ts} +0 -0
- /package/dist/wirings/{ai-scorer/ai-scorer-sampling.js → agent-scorer/agent-scorer-sampling.js} +0 -0
- /package/dist/wirings/{ai-scorer/ai-scorer-snapshots.js → agent-scorer/agent-scorer-snapshots.js} +0 -0
- /package/src/{column-form.ts → classification/column-form.ts} +0 -0
- /package/src/{pikku-request.test.ts → function/pikku-request.test.ts} +0 -0
- /package/src/{pikku-request.ts → function/pikku-request.ts} +0 -0
- /package/src/wirings/{rpc → addon}/addon-auth-tags.test.ts +0 -0
- /package/src/wirings/{rpc → addon}/addon-runner.ts +0 -0
- /package/src/wirings/{rpc → addon}/addon-secrets.test.ts +0 -0
- /package/src/wirings/{rpc → addon}/wire-addon.test.ts +0 -0
- /package/src/wirings/{rpc → addon}/wire-remote-addon.ts +0 -0
- /package/src/wirings/{ai-scorer/ai-scorer-sampling.ts → agent-scorer/agent-scorer-sampling.ts} +0 -0
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
type: decision
|
|
3
|
-
title: An
|
|
3
|
+
title: An agentMiddleware onError hook cannot change how a run fails
|
|
4
4
|
description: Hook throws are swallowed so observability code can never convert, mask, or replace the original error
|
|
5
|
-
tags:
|
|
5
|
+
tags: agent
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
# An
|
|
8
|
+
# An agentMiddleware onError hook cannot change how a run fails
|
|
9
9
|
|
|
10
|
-
Every `onError` invocation on the agent failure paths — in `
|
|
11
|
-
`continueAfterToolResult` (`
|
|
12
|
-
`continueAfterToolResultSync` (`
|
|
10
|
+
Every `onError` invocation on the agent failure paths — in `streamAgent` and
|
|
11
|
+
`continueAfterToolResult` (`agent-stream.ts`) and in `runAgent` and
|
|
12
|
+
`continueAfterToolResultSync` (`agent-runner.ts`) — is wrapped in its own
|
|
13
13
|
`try/catch` that discards whatever the hook throws. The run is then marked
|
|
14
14
|
`failed` with the original error message, and the original error propagates.
|
|
15
15
|
|
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
type: decision
|
|
3
3
|
title: AI runner methods must be called on the runner, never as detached references
|
|
4
4
|
description: Implementations use this internally, so grabbing transcribe or generateSpeech as a bare function loses the receiver and throws at runtime
|
|
5
|
-
tags:
|
|
5
|
+
tags: agent
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# AI runner methods must be called on the runner, never as detached references
|
|
9
9
|
|
|
10
10
|
The voice middlewares in `voice-input.ts` and `voice-output.ts` invoke
|
|
11
|
-
`
|
|
11
|
+
`agentRunner.transcribe(...)` and `agentRunner.generateSpeech?.(...)` as
|
|
12
12
|
method calls on the service object, and only ever test them for presence.
|
|
13
13
|
|
|
14
|
-
`
|
|
14
|
+
`AgentRunnerService` is an interface implemented by classes — the reference
|
|
15
15
|
implementation's `transcribe` calls `this.getModel(...)`. Extracting the method
|
|
16
|
-
into a local (`const { transcribe } = services.
|
|
16
|
+
into a local (`const { transcribe } = services.agentRunner`) type-checks
|
|
17
17
|
cleanly and then fails at runtime with `this` undefined. The regression is
|
|
18
18
|
pinned by a runner in `voice-input.test.ts` whose `transcribe` deliberately reads
|
|
19
19
|
instance state through `this`.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: decision
|
|
3
3
|
title: Agent speech travels as a CUSTOM AG-UI event rather than being dropped
|
|
4
4
|
description: AG-UI has no speech event, and dropping it makes a voice agent reached over HTTP silently inaudible while the provider still bills for the audio
|
|
5
|
-
tags: core,
|
|
5
|
+
tags: core, agent
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Agent speech travels as a CUSTOM AG-UI event
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
type: decision
|
|
3
3
|
title: Persisting an agent stream from send is best-effort and must never reject
|
|
4
4
|
description: The persisting channel flushes fire-and-forget because send is synchronous; a storage failure degrades the transcript instead of killing the process
|
|
5
|
-
tags:
|
|
5
|
+
tags: agent
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Persisting an agent stream from send is best-effort and must never reject
|
|
9
9
|
|
|
10
10
|
`createPersistingChannel` in
|
|
11
|
-
`packages/core/src/wirings/
|
|
11
|
+
`packages/core/src/wirings/agent/agent-stream.ts` accumulates step text,
|
|
12
12
|
tool calls and tool results, and writes them via `flushDetached` on the `usage`
|
|
13
|
-
and `done` events. `
|
|
13
|
+
and `done` events. `AgentStreamChannel.send` is synchronous, so it cannot await the
|
|
14
14
|
write. An unawaited rejection has nothing to propagate to and surfaces as an
|
|
15
15
|
`unhandledRejection`, which takes the whole server process down — a model
|
|
16
16
|
reusing a `toolCallId`, which is a primary key in AI storage, is enough to
|
|
@@ -18,7 +18,7 @@ trigger it. `flushDetached` therefore catches and logs, and the run carries on.
|
|
|
18
18
|
|
|
19
19
|
The awaited `flush()` on the suspend paths (`handleApprovals`,
|
|
20
20
|
`handleCredentialRequests`) is the seam that still surfaces persistence failures
|
|
21
|
-
to a caller. The regression test lives in `
|
|
21
|
+
to a caller. The regression test lives in `agent-stream.test.ts`; because the
|
|
22
22
|
floating promise settles on a later macrotask, the assertion has to wait a real
|
|
23
23
|
timer before checking that no `unhandledRejection` fired.
|
|
24
24
|
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
type: decision
|
|
3
3
|
title: A delegated sub-agent inherits the parent run's context block
|
|
4
4
|
description: The sub-agent tool schema carries only message and session, so the parent's identifier block is forwarded rather than re-typed by the model
|
|
5
|
-
tags:
|
|
5
|
+
tags: agent
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# A delegated sub-agent inherits the parent run's context block
|
|
9
9
|
|
|
10
10
|
`buildSubAgentRunInput` in
|
|
11
|
-
`packages/core/src/wirings/
|
|
12
|
-
run's `
|
|
11
|
+
`packages/core/src/wirings/agent/agent-prepare.ts` forwards the parent
|
|
12
|
+
run's `AgentInput.context` — the "Current context" identifier block with
|
|
13
13
|
organization, project and stage ids — into every delegated sub-agent run, on
|
|
14
14
|
both the streaming and non-streaming paths. `buildToolDefs` threads it down as
|
|
15
15
|
`parentContext` for the same reason.
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
type: decision
|
|
3
3
|
title: A tool's execute() failure is logged before the AI SDK swallows it
|
|
4
4
|
description: Every agent tool is wrapped in a logging try/catch, because a thrown tool error otherwise becomes a conversational reply and is invisible server-side
|
|
5
|
-
tags:
|
|
5
|
+
tags: agent
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# A tool's execute() failure is logged before the AI SDK swallows it
|
|
9
9
|
|
|
10
|
-
`buildToolDefs` in `packages/core/src/wirings/
|
|
10
|
+
`buildToolDefs` in `packages/core/src/wirings/agent/agent-prepare.ts`
|
|
11
11
|
wraps every tool it builds — RPC tools, sub-agent delegations and workflow tools
|
|
12
12
|
alike — in a `try/catch` that logs through `singletonServices.logger` and
|
|
13
13
|
rethrows.
|
|
@@ -18,7 +18,7 @@ and turns it into a conversational "tool error" reply to the model. The exceptio
|
|
|
18
18
|
never reaches pikku's own logger, so without this wrapper a consistently failing
|
|
19
19
|
tool is undiagnosable from the server side — the only symptom is an agent that
|
|
20
20
|
keeps apologising. The wrapper is applied unconditionally, not only when an
|
|
21
|
-
`
|
|
21
|
+
`agentMiddleware` `afterToolCall` hook happens to be registered.
|
|
22
22
|
|
|
23
23
|
**What this rules out:** folding the logging into the optional middleware
|
|
24
24
|
wrapper below it, and relying on the AI SDK's own error reporting for tool
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
type: decision
|
|
3
3
|
title: Voice input transcribes audio parts sequentially and in place
|
|
4
4
|
description: Each audio part is replaced by its text where it sat, one at a time, bounding concurrent downloads and preserving content order
|
|
5
|
-
tags:
|
|
5
|
+
tags: agent
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Voice input transcribes audio parts sequentially and in place
|
|
9
9
|
|
|
10
10
|
The `voiceInput` middleware in
|
|
11
|
-
`packages/core/src/wirings/
|
|
11
|
+
`packages/core/src/wirings/agent/voice-input.ts` walks the last user
|
|
12
12
|
message's content parts in order and swaps each audio part for a text part at the
|
|
13
13
|
same index, awaiting one transcription before starting the next.
|
|
14
14
|
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
type: decision
|
|
3
3
|
title: Working memory is persisted only when the merged value validates
|
|
4
4
|
description: A failed schema check logs and drops the update rather than saving it, because invalid state poisons every later read
|
|
5
|
-
tags:
|
|
5
|
+
tags: agent
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Working memory is persisted only when the merged value validates
|
|
9
9
|
|
|
10
10
|
`createWorkingMemoryMiddleware` in
|
|
11
|
-
`packages/core/src/wirings/
|
|
11
|
+
`packages/core/src/wirings/agent/agent-memory.ts` parses the model's
|
|
12
12
|
`<working_memory>` block, deep-merges it into the stored value, validates the
|
|
13
13
|
merge against the agent's working-memory schema when one is declared, and calls
|
|
14
14
|
`saveWorkingMemory` only if the merge is valid. An invalid merge is logged as a
|
|
@@ -24,7 +24,7 @@ permissions bug rather than a merge that dropped.
|
|
|
24
24
|
This is a different rule from
|
|
25
25
|
[scope roots may be co-declared by an addon and its host
|
|
26
26
|
app](scope-roots-may-be-co-declared-by-an-addon-and-its-host-app.md): that one
|
|
27
|
-
is about `flattenScopeDefinitions` deduping ids
|
|
27
|
+
is about `flattenScopeDefinitions` deduping ids _within_ a build where both
|
|
28
28
|
declarations are present and identical. This one is about the addon's copy never
|
|
29
29
|
arriving. The consequence for addon authors is the same either way — own a root
|
|
30
30
|
outright, named for the package or vendor, and nest everything under it. It is
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: decision
|
|
3
3
|
title: An interrupt is not a failure, and the non-streaming path throws rather than returning
|
|
4
4
|
description: It skips the onError hooks and never becomes an errorMessage; with no partial reply to hand back, a typed throw is what distinguishes it from a provider outage
|
|
5
|
-
tags: core,
|
|
5
|
+
tags: core, agent
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# An interrupt is not a failure
|
|
@@ -14,7 +14,7 @@ that did not happen.
|
|
|
14
14
|
|
|
15
15
|
The streaming and non-streaming paths then diverge, because what they can hand
|
|
16
16
|
back differs. A stream has already delivered part of the reply, so it returns
|
|
17
|
-
that fragment. `
|
|
17
|
+
that fragment. `runAgent` has delivered nothing — there is no partial answer to
|
|
18
18
|
return — so it throws a typed error instead. A caller can tell that apart from a
|
|
19
19
|
provider outage, which returning an empty result would not allow.
|
|
20
20
|
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
type: decision
|
|
3
3
|
title: An interrupt for a run owned by another instance says so, rather than returning false
|
|
4
4
|
description: A bare false is indistinguishable from "already finished", which is the one deployment shape the in-process registry cannot cover
|
|
5
|
-
tags: core,
|
|
5
|
+
tags: core, agent
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# An interrupt for a run owned by another instance says so
|
|
9
9
|
|
|
10
|
-
`
|
|
10
|
+
`interruptAgent` resolves a run through `agentRunState`, then tries to abort it
|
|
11
11
|
via the in-process registry. A run still marked `running` that this process has
|
|
12
12
|
no abort handle for is executing on another instance.
|
|
13
13
|
|
|
@@ -19,7 +19,7 @@ the condition instead.
|
|
|
19
19
|
|
|
20
20
|
**What this rules out:** collapsing the two outcomes into one boolean because
|
|
21
21
|
the caller "only cares whether it stopped". The caller cares a great deal about
|
|
22
|
-
the difference between
|
|
22
|
+
the difference between _stopped_ and _cannot be stopped from here_.
|
|
23
23
|
|
|
24
24
|
The fix for the underlying gap is `signalRunInterrupt`, which fans the interrupt
|
|
25
25
|
out over `eventHub` so every instance tries locally.
|
package/knowledge/decisions/internals/an-agent-stream-send-must-return-the-inner-sends-promise.md
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
type: decision
|
|
3
3
|
title: A wrapped agent-stream send must return the inner send's promise
|
|
4
4
|
description: Middleware runs asynchronously, so dropping the returned promise turns every awaited channel.send upstream into a no-op
|
|
5
|
-
tags: core,
|
|
5
|
+
tags: core, agent
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# A wrapped agent-stream send must return the inner send's promise
|
|
9
9
|
|
|
10
|
-
`
|
|
10
|
+
`streamAgent` wraps the caller's channel so every event passes through the
|
|
11
11
|
stream middleware. That wrapper's `send` returns whatever the inner `send`
|
|
12
12
|
returns, and it must: the middleware chain is asynchronous, so a wrapper that
|
|
13
13
|
calls the inner `send` and returns `undefined` resolves immediately while the
|
package/knowledge/decisions/internals/an-empty-text-part-is-omitted-from-an-agent-message.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: decision
|
|
3
3
|
title: A message with nothing to say carries no text part at all
|
|
4
4
|
description: An attachment on its own is a real turn, and providers are entitled to reject an empty text part sitting beside it
|
|
5
|
-
tags: core,
|
|
5
|
+
tags: core, agent
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# A message with nothing to say carries no text part
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: decision
|
|
3
3
|
title: A transcript is recorded only when something was actually heard
|
|
4
4
|
description: Recording an empty string sends a transcript event saying the user said nothing, which renders as an empty bubble rather than a pending one
|
|
5
|
-
tags: core,
|
|
5
|
+
tags: core, agent
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# A transcript is recorded only when something was actually heard
|
package/knowledge/decisions/internals/channel-message-handlers-accept-three-config-shapes.md
CHANGED
|
@@ -14,7 +14,7 @@ things a caller may put on `onMessage` or inside `onMessageWiring`:
|
|
|
14
14
|
- a direct function config, where `onMessage.func` is a plain `Function`;
|
|
15
15
|
- a wrapper, where `onMessage.func` is itself a `CorePikkuFunctionConfig` and so
|
|
16
16
|
has its own nested `.func`;
|
|
17
|
-
- a simple wrapper, which carries a plain `Function` under `func`
|
|
17
|
+
- a simple wrapper, which carries a plain `Function` under `func` _and_ a
|
|
18
18
|
sibling `middleware` array.
|
|
19
19
|
|
|
20
20
|
The `isWrapper` check tests exactly that: an object with `func`, where either
|
|
@@ -19,7 +19,7 @@ user's stream and growing memory run over run. It is therefore appended fresh on
|
|
|
19
19
|
every call, after the cached inherited slice.
|
|
20
20
|
|
|
21
21
|
The `uid` matters as much as the cache split. `processMessageHandlers` in
|
|
22
|
-
`channel-handler.ts` builds it from the channel name
|
|
22
|
+
`channel-handler.ts` builds it from the channel name _plus_ the routing property
|
|
23
23
|
and router value (`${name}:${routingProperty}:${routerValue}`, or
|
|
24
24
|
`${name}:default`), because several message routes on one channel may point at
|
|
25
25
|
the same function — a key based on the function alone would serve one route's
|
|
@@ -10,7 +10,7 @@ tags: channel
|
|
|
10
10
|
`runChannelConnect` in
|
|
11
11
|
`packages/core/src/wirings/channel/serverless/serverless-channel-runner.ts`
|
|
12
12
|
reads `userSession.getPikkuUserId()` and calls `channelStore.setPikkuUserId`
|
|
13
|
-
|
|
13
|
+
_after_ `runChannelLifecycleWithMiddleware` has executed the `onConnect`
|
|
14
14
|
lifecycle, not before.
|
|
15
15
|
|
|
16
16
|
Auth middleware runs as part of that lifecycle — it is what inspects the upgrade
|
|
@@ -19,7 +19,7 @@ the conversion happens. The parser normalises every incoming `--from-plan` to
|
|
|
19
19
|
`fromPlan` on the way in, and both `formatOptions` (help text) and the
|
|
20
20
|
"Missing required option" / "Invalid value for" errors render back to kebab on
|
|
21
21
|
the way out. `suggestOption` deliberately compares the typed string against
|
|
22
|
-
|
|
22
|
+
_both_ forms, so `--autoApply` and `--auto-apply` both find `autoApply`.
|
|
23
23
|
|
|
24
24
|
**What this rules out:** storing option keys kebab-cased anywhere in CLI state or
|
|
25
25
|
metadata — the schema pluck would then match nothing and every option would be
|
|
@@ -18,7 +18,7 @@ mistake (show the help text) or a value mistake (print the errors) by
|
|
|
18
18
|
This is why the parser pushes `Missing subcommand: <path>` for a group command
|
|
19
19
|
that has subcommands but no `pikkuFuncId` of its own, rather than simply
|
|
20
20
|
returning the command meta and letting the runner discover it is unrunnable. The
|
|
21
|
-
message
|
|
21
|
+
message _is_ the routing signal. Rewording any of those three strings, or
|
|
22
22
|
localising them, silently turns "show me the subcommands" into a raw error dump.
|
|
23
23
|
|
|
24
24
|
**What this rules out:** editing those error message prefixes without updating
|
|
@@ -18,7 +18,7 @@ The reason is forward compatibility: a script or wrapper written against a newer
|
|
|
18
18
|
command version may pass options an older installed binary does not know, and
|
|
19
19
|
failing hard there turns a harmless extra flag into a broken pipeline.
|
|
20
20
|
`RESERVED_OPTIONS` exempts flags the runner handles itself (`help`) from the
|
|
21
|
-
warning. Unknown
|
|
21
|
+
warning. Unknown _short_ flags are treated differently — they go to
|
|
22
22
|
`result.errors` and do fail — because a bundled short-flag cluster like `-abc`
|
|
23
23
|
cannot be reliably attributed, and a typo'd short flag is far more likely than a
|
|
24
24
|
version skew.
|
|
@@ -15,13 +15,13 @@ value leave the process?".
|
|
|
15
15
|
The two axes were one field before this, with `security: 'encrypted'` sitting
|
|
16
16
|
alongside `secret` as though they were alternatives. They are not, and the
|
|
17
17
|
conflation made the field unanswerable: a token hash and a live bearer token are
|
|
18
|
-
both `secret`, one must never be encrypted — the digest
|
|
18
|
+
both `secret`, one must never be encrypted — the digest _is_ the lookup key —
|
|
19
19
|
and the other must always be. Nothing in a single enum could tell them apart, so
|
|
20
20
|
nothing could check either.
|
|
21
21
|
|
|
22
22
|
## Why `wrapped` and `sealed` rather than `encrypted`
|
|
23
23
|
|
|
24
|
-
Sealed values
|
|
24
|
+
Sealed values _are_ encrypted, so an `encrypted` member sitting beside `sealed`
|
|
25
25
|
would be a supertype posing as a sibling, and every new column would be an
|
|
26
26
|
even-odds guess. What actually separates them is who can read the value back:
|
|
27
27
|
`wrapped` is symmetric and the application holds the key; `sealed` is asymmetric
|
|
@@ -64,7 +64,7 @@ it would buy nothing — feeding in the wrong string already fails at the AEAD t
|
|
|
64
64
|
— while forcing a cast into every path that reads ciphertext out of a row or off
|
|
65
65
|
the wire, which is where casts are least reviewable.
|
|
66
66
|
|
|
67
|
-
The brand proves
|
|
67
|
+
The brand proves _provenance_, not correctness. It cannot know a value was
|
|
68
68
|
wrapped under the right key, and making it know would mean phantom-typing key
|
|
69
69
|
ids per scope, which the multi-recipient path would fight constantly.
|
|
70
70
|
|
|
@@ -75,7 +75,7 @@ error. Every project predating the axis has such columns, and failing their next
|
|
|
75
75
|
`db migrate` would be a breaking change for a diagnosis they have not had a
|
|
76
76
|
chance to act on. `pikku db --fail-on-warn` is how a project opts into the
|
|
77
77
|
ratchet. An explicit `form: 'plain'` silences it — that is the acknowledgement
|
|
78
|
-
that reading the row is
|
|
78
|
+
that reading the row is _meant_ to yield a usable credential.
|
|
79
79
|
|
|
80
80
|
**What this rules out:** collapsing `wrapped` and `sealed` back into one
|
|
81
81
|
`encrypted`; making the form brands optional (they would enforce nothing);
|
package/knowledge/decisions/internals/core-data-classification-brand-is-an-optional-property.md
CHANGED
|
@@ -16,7 +16,7 @@ A required property would make a plain value unassignable to a branded column: a
|
|
|
16
16
|
`string` could no longer be passed where `Private<string>` is expected, which
|
|
17
17
|
breaks every ordinary Kysely query operand — `where('email', '=', someString)`,
|
|
18
18
|
inserts, and `.set(...)`. Making it optional keeps the brand structurally present
|
|
19
|
-
so static analysis still sees it, while letting plain values flow
|
|
19
|
+
so static analysis still sees it, while letting plain values flow _in_. The
|
|
20
20
|
asymmetry is the point: the brand constrains what comes out of a query, not what
|
|
21
21
|
goes into one.
|
|
22
22
|
|
package/knowledge/decisions/internals/core-function-runner-restores-the-wire-fields-it-overwrites.md
CHANGED
|
@@ -9,7 +9,7 @@ tags: core
|
|
|
9
9
|
|
|
10
10
|
`runPikkuFunc` in `packages/core/src/function/function-runner.ts` does not build a
|
|
11
11
|
fresh wire per call. Nested invocations — an RPC from inside a function, an addon
|
|
12
|
-
sibling call, a workflow step — reuse the
|
|
12
|
+
sibling call, a workflow step — reuse the _same_ wire object the outer transport
|
|
13
13
|
created. So before it runs, the runner captures `functionId`, `audit`,
|
|
14
14
|
`addonNamespace` and the property descriptor for `rpc`, overwrites them for the
|
|
15
15
|
duration of this function, and restores or `delete`s them in a `finally`. Both
|
|
@@ -18,7 +18,7 @@ inner call would leave its identity on the wire and every subsequent outer step
|
|
|
18
18
|
would be attributed to the wrong function.
|
|
19
19
|
|
|
20
20
|
The same reuse is why the audit binding is re-gated inside `executeFunction`
|
|
21
|
-
rather than trusted from `createWireServices`. The audit
|
|
21
|
+
rather than trusted from `createWireServices`. The audit _gate_ is per-function
|
|
22
22
|
but the `auditLog` wire service is created per-transport-invocation. A nested or
|
|
23
23
|
exposed-RPC call would otherwise inherit an `auditLog` built while the outer
|
|
24
24
|
wire's audit config was unset (the generated `rpcCaller` declares none), and
|
|
@@ -32,7 +32,7 @@ then the auth/readonly checks, then `verifyScopes` — all of which depend only
|
|
|
32
32
|
the session — and only then `await data()`, schema defaults, coercion, validation
|
|
33
33
|
and `runPermissions`. A request denied by scope never pays to parse or validate
|
|
34
34
|
its body. `rpc` is installed as a lazily-evaluating accessor that replaces itself
|
|
35
|
-
with the resolved value on first read, capturing the
|
|
35
|
+
with the resolved value on first read, capturing the _caller's_ package name in
|
|
36
36
|
the closure so an addon's RPCs resolve in its own namespace.
|
|
37
37
|
|
|
38
38
|
**What this rules out:** dropping the save/restore blocks as duplicated
|
package/knowledge/decisions/internals/core-hot-reload-merges-generated-meta-never-replaces-it.md
CHANGED
|
@@ -22,7 +22,7 @@ workflow job fails with `Function meta not found: pikkuWorkflowOrchestrator`.
|
|
|
22
22
|
`dev/reload-meta.test.ts` pins this. Meta maps that only codegen ever writes
|
|
23
23
|
(`http`, `rpc`, `agent`) are assigned outright.
|
|
24
24
|
|
|
25
|
-
Two limits are inherent rather than incidental. Routes registered by a
|
|
25
|
+
Two limits are inherent rather than incidental. Routes registered by a _new_
|
|
26
26
|
`wireHTTP` file are not picked up here — those modules were never imported — which
|
|
27
27
|
is why `hot-reload.ts` keeps a `postCodegenQueue` and exposes `reimportPending()`
|
|
28
28
|
for the dev server to drain after codegen, so registrations that were skipped for
|
|
@@ -35,5 +35,5 @@ entry stranded until a restart.
|
|
|
35
35
|
`pikkuState(null, 'function', 'meta', functionsMeta)` assignments on the grounds
|
|
36
36
|
that codegen output is authoritative — it is authoritative only for what codegen
|
|
37
37
|
emits. It also rules out folding `reimportPending()` back into the debounced
|
|
38
|
-
reload (the whole point is that it runs
|
|
38
|
+
reload (the whole point is that it runs _after_ codegen), and dropping
|
|
39
39
|
`reconcileAddonRegistry` as dead code.
|
|
@@ -23,7 +23,7 @@ edits, and eventually OOMs a long editing session. `dev/module-runner.test.ts`
|
|
|
23
23
|
asserts both the single-slot guarantee and bounded heap growth.
|
|
24
24
|
|
|
25
25
|
Two details keep the mechanism honest. `import`s inside the user file are
|
|
26
|
-
delegated to `createRequire`, whose resolution matches the native loader
|
|
26
|
+
delegated to `createRequire`, whose resolution matches the native loader _and_
|
|
27
27
|
returns the same live singletons (Node and Bun share the require/import cache) —
|
|
28
28
|
that is what lets a reloaded file's top-level `wireHTTP` side effects mutate the
|
|
29
29
|
services the running server is already using. And esbuild is invoked with no
|
|
@@ -37,6 +37,6 @@ code.
|
|
|
37
37
|
import(url + '?t=' + Date.now())` or any fresh-URL variant, and turning
|
|
38
38
|
sourcemaps back on for nicer stack traces (`filename` already anchors traces to
|
|
39
39
|
the user file). It also rules out swapping `createRequire` for a fresh `import()`
|
|
40
|
-
inside the compiled module — resolution would produce a
|
|
40
|
+
inside the compiled module — resolution would produce a _distinct_ copy of every
|
|
41
41
|
dependency, and the reloaded file would then wire itself into services nobody is
|
|
42
42
|
serving from.
|
|
@@ -19,7 +19,7 @@ finally passed through `freezeDedupe` and cached in `middlewareCache` keyed by
|
|
|
19
19
|
wire type and wire id.
|
|
20
20
|
|
|
21
21
|
Two properties fall out of that and both are load-bearing. Because the sort is
|
|
22
|
-
stable, priority is a coarse band and registration order breaks ties
|
|
22
|
+
stable, priority is a coarse band and registration order breaks ties _within_ a
|
|
23
23
|
band, so declaration order still means something. And because the result is
|
|
24
24
|
deduped by function identity, a middleware reachable through both a tag group and
|
|
25
25
|
a direct wire registration runs exactly once — a fact several tests assert
|
|
@@ -21,7 +21,7 @@ generated TypeScript type declares as present — the worst shape a mismatch can
|
|
|
21
21
|
take: validation permits the omission, the type promises the value, the body
|
|
22
22
|
reads `undefined`.
|
|
23
23
|
|
|
24
|
-
It is deliberately
|
|
24
|
+
It is deliberately _not_ gated on the `coerceDataFromSchema` flag that guards
|
|
25
25
|
`coerceTopLevelDataFromSchema`. That flag is about decoding transport-encoded
|
|
26
26
|
values — a query string's `"1,2"` into an array, an ISO string into a `Date` —
|
|
27
27
|
and is set only by transports that need it. Defaults are a property of the
|
package/knowledge/decisions/internals/core-scopes-are-an-and-gate-separate-from-permissions.md
CHANGED
|
@@ -14,8 +14,8 @@ closed: a session without a `scopes` field, or no session at all, satisfies
|
|
|
14
14
|
nothing. An empty `required` is the only thing anything satisfies.
|
|
15
15
|
|
|
16
16
|
This is deliberately the opposite composition from `permissions`, whose groups OR
|
|
17
|
-
together. Because permissions OR, adding a permission group can only
|
|
18
|
-
access; because scopes AND, adding a scope can only
|
|
17
|
+
together. Because permissions OR, adding a permission group can only _widen_
|
|
18
|
+
access; because scopes AND, adding a scope can only _narrow_ it. That is the
|
|
19
19
|
whole reason the two are separate mechanisms and separate code paths rather than
|
|
20
20
|
one merged authorization step, and it is why a passing global or function
|
|
21
21
|
permission must never be allowed to satisfy a scope.
|
|
@@ -24,7 +24,7 @@ Satisfaction itself is hierarchical, computed by `satisfyingGrants`: a grant
|
|
|
24
24
|
matches when it is the scope itself, a plain ancestor (`admin` covers
|
|
25
25
|
`admin:invoices:create`), a wildcard at or above it (`admin:*`, or the bare `*`),
|
|
26
26
|
or a wildcard directly beneath it. Narrower never satisfies broader —
|
|
27
|
-
`admin:invoices` does not grant `admin`. Core only ever
|
|
27
|
+
`admin:invoices` does not grant `admin`. Core only ever _reads_
|
|
28
28
|
`session.scopes`; whoever builds the session populates it (better-auth's
|
|
29
29
|
`mapSession` resolving through a `ScopeService`, for instance), and the runner
|
|
30
30
|
never fetches. `hasScopes` is the non-throwing counterpart of `verifyScopes`, for
|
package/knowledge/decisions/internals/gateway-adapters-resolve-lazily-and-are-promise-cached.md
CHANGED
|
@@ -13,7 +13,7 @@ platform adapters (WhatsApp Cloud API, Slack, …) need both, so
|
|
|
13
13
|
`resolveGatewayAdapter` in
|
|
14
14
|
`packages/core/src/wirings/gateway/gateway-runner.ts` invokes the factory on the
|
|
15
15
|
first inbound request (webhook/websocket) or on gateway start (listener). The
|
|
16
|
-
`resolvedAdapters` WeakMap caches the
|
|
16
|
+
`resolvedAdapters` WeakMap caches the _promise_, not the resolved adapter, so
|
|
17
17
|
concurrent first requests share one construction instead of racing to build two
|
|
18
18
|
adapters — which for a stateful adapter would mean two platform connections.
|
|
19
19
|
|
package/knowledge/decisions/internals/gateway-listener-middleware-runs-without-an-rpc-on-the-wire.md
CHANGED
|
@@ -10,8 +10,8 @@ tags: core, gateway
|
|
|
10
10
|
`runPikkuFunc` in `packages/core/src/function/function-runner.ts` attaches `rpc`
|
|
11
11
|
to the invocation wire with `Object.defineProperty`, as a lazy getter that
|
|
12
12
|
replaces itself on first read — and restores the previous descriptor in its
|
|
13
|
-
`finally`. `rpc` therefore exists on a wire
|
|
14
|
-
|
|
13
|
+
`finally`. `rpc` therefore exists on a wire _only for the duration of a function
|
|
14
|
+
invocation_. That is why `PikkuRawWire` is `Omit<PikkuWire, 'rpc'>`: it is the
|
|
15
15
|
wire as a runner constructs it, before the function runner adds `rpc`.
|
|
16
16
|
|
|
17
17
|
The three gateway transports reach middleware differently:
|
|
@@ -22,7 +22,7 @@ The three gateway transports reach middleware differently:
|
|
|
22
22
|
same invocation — `wire.rpc` is live.
|
|
23
23
|
- **listener** has no such wrapper. `createListenerMessageHandler` is handed
|
|
24
24
|
straight to `adapter.init()` by the `GatewayService`, builds
|
|
25
|
-
`const wire: PikkuRawWire = {}` itself, and runs `config.middleware`
|
|
25
|
+
`const wire: PikkuRawWire = {}` itself, and runs `config.middleware` _before_
|
|
26
26
|
`invoke()` reaches `runPikkuFunc`. There is no invocation in progress, so
|
|
27
27
|
`wire.rpc` is `undefined`.
|
|
28
28
|
|
|
@@ -34,7 +34,7 @@ off `CorePikkuMiddleware`, whose wire parameter is `PikkuWire`.
|
|
|
34
34
|
**What this rules out:** treating the assertion at that call as noise to be
|
|
35
35
|
deleted. It is naming a real gap. It also rules out "just widen
|
|
36
36
|
`CorePikkuMiddleware` to accept `PikkuRawWire`" as a free fix — that would make
|
|
37
|
-
`rpc` optional for
|
|
37
|
+
`rpc` optional for _every_ middleware in the framework, pushing the problem onto
|
|
38
38
|
every consumer to satisfy one transport.
|
|
39
39
|
|
|
40
40
|
**Still open:** whether the listener path should wrap its handler in a
|
package/knowledge/decisions/internals/gateway-wiring-is-a-meta-wiring-over-http-and-channels.md
CHANGED
|
@@ -18,7 +18,7 @@ followed by `httpRouter.reset()` because the router caches its match table.
|
|
|
18
18
|
The wrapper functions and routes created here look like they are missing their
|
|
19
19
|
metadata. They are not: the inspector projects a `wireGateway` call into the
|
|
20
20
|
generated HTTP and function meta at build time, so only the handler
|
|
21
|
-
|
|
21
|
+
_implementations_ register at runtime — the same split every other wire uses.
|
|
22
22
|
This is why `wireWebhookGateway` writes route entries but no `CommonWireMeta`,
|
|
23
23
|
and why the websocket path sets `channels.set(name, …)` with empty
|
|
24
24
|
`onConnect`/`onMessage` stubs while the real handlers live under the
|
|
@@ -11,7 +11,7 @@ tags: http
|
|
|
11
11
|
normalizes every route and every incoming path to a leading `/` before matching,
|
|
12
12
|
so a route registered as `'todos'` still answers a request for `/todos`. The
|
|
13
13
|
`route` field it stores alongside each matcher and static entry is the
|
|
14
|
-
|
|
14
|
+
_un-normalized_ original, and that is what `MatchResult.route` returns.
|
|
15
15
|
|
|
16
16
|
That asymmetry is load-bearing. `getMatchingRoute` in `http-runner.ts` takes the
|
|
17
17
|
returned route and uses it as a key into `pikkuState(null, 'http', 'routes')` and
|
|
@@ -12,7 +12,7 @@ tags: services
|
|
|
12
12
|
`invoke` throws, and it throws with a truncated body — which is why a scenario
|
|
13
13
|
asserting on a refusal must use `invokeRaw`.
|
|
14
14
|
|
|
15
|
-
A permissions or scopes scenario
|
|
15
|
+
A permissions or scopes scenario _expects_ the 403. The status is the assertion,
|
|
16
16
|
and the body usually names the scope that was missing, so both have to survive as
|
|
17
17
|
data rather than being reduced to a thrown `Error`. These helpers also exist
|
|
18
18
|
because every scenario reaching past an actor was hand-writing the same
|
package/knowledge/decisions/internals/in-memory-workflow-history-aliases-the-live-step-object.md
CHANGED
|
@@ -9,7 +9,7 @@ tags: services
|
|
|
9
9
|
|
|
10
10
|
`InMemoryWorkflowService` (`packages/core/src/services/in-memory-workflow-service.ts`)
|
|
11
11
|
stores each step twice: in `steps`, keyed `${runId}:${stepName}`, and appended to
|
|
12
|
-
`stepHistory` for the run. Both hold the
|
|
12
|
+
`stepHistory` for the run. Both hold the _same object_. `createStepImpl` and
|
|
13
13
|
`createRetryAttemptImpl` push the reference they just put into `steps`, not a
|
|
14
14
|
copy.
|
|
15
15
|
|
|
@@ -10,6 +10,7 @@ A rule about how core behaves: what runs where, in what order, and what a
|
|
|
10
10
|
caller is entitled to assume.
|
|
11
11
|
|
|
12
12
|
<!-- pikku:knowledge-index -->
|
|
13
|
+
|
|
13
14
|
- [A non-streaming agent run registers with aiRunState on the same terms as a streaming one](a-non-streaming-agent-run-registers-with-airunstate-too.md) — Otherwise interruptAIAgent finds the run, passes the ownership check, then cannot stop it — and reports that as if the run were on another host
|
|
14
15
|
- [A resumed turn is as interruptible as the first one](a-resumed-agent-turn-is-as-interruptible-as-the-first.md) — It is the same person listening to the same voice, and after an approval it is where most of the reply actually gets spoken
|
|
15
16
|
- [A scenario step's prose template is offered to a virtual user unfilled](a-scenario-step-template-is-offered-unfilled.md) — A reporter fills placeholders from a run that happened; there is no run yet, and the filled form would answer the question the user is there to answer
|
|
@@ -57,7 +58,7 @@ caller is entitled to assume.
|
|
|
57
58
|
- [CLI stdout is reserved for machine-readable output](cli-stdout-is-reserved-for-machine-readable-output.md) — The default renderer emits single-line NDJSON, diagnostics go to stderr, and --json only hijacks rendering for commands that declared a renderer
|
|
58
59
|
- [CLI unknown long options warn instead of failing](cli-unknown-long-options-warn-instead-of-failing.md) — Unrecognised --long options are accepted, warned about and dropped so older binaries tolerate newer invocations, while unknown short flags stay hard errors
|
|
59
60
|
- [A column's at-rest form is an axis of its own](core-column-form-is-an-axis-of-its-own.md) — How a value is stored is independent of how sensitive it is, so form carries a required nominal brand on writes while classification stays optional on reads
|
|
60
|
-
- [The data-classification brand is an optional property](core-data-classification-brand-is-an-optional-property.md) — Making
|
|
61
|
+
- [The data-classification brand is an optional property](core-data-classification-brand-is-an-optional-property.md) — Making **classification** required would break ordinary Kysely operands, so the brand only constrains values flowing out
|
|
61
62
|
- [The function runner restores the wire fields it overwrites](core-function-runner-restores-the-wire-fields-it-overwrites.md) — One wire object is reused across nested calls, so functionId, audit, addonNamespace and rpc are saved and put back in a finally
|
|
62
63
|
- [Hot reload merges generated meta and never replaces it](core-hot-reload-merges-generated-meta-never-replaces-it.md) — Reloading codegen output must preserve runtime-registered meta, which no generated JSON contains
|
|
63
64
|
- [Hot reload owns its module registry instead of re-importing](core-hot-reload-owns-its-module-registry.md) — Dev reload transpiles to CJS and runs modules through vm.compileFunction, because the native ESM loader map cannot be evicted
|
|
@@ -103,7 +104,7 @@ caller is entitled to assume.
|
|
|
103
104
|
- [The agent `done` event goes through the middleware and is awaited](the-agent-done-event-goes-through-the-middleware-and-is-awaited.md) — `done` is the only end-of-reply signal a stream hook gets, and buffering hooks flush on it — sending it raw discards work already paid for
|
|
104
105
|
- [The API report pins members, because the export list only pins names](the-api-report-pins-members-not-just-names.md) — public-surface.json catches an export appearing or vanishing; it cannot see a method added to an interface, which is the change that breaks a consumer's build
|
|
105
106
|
- [The dev queue copies prod timing and serialization semantics](the-dev-queue-copies-prod-timing-and-serialization-semantics.md) — InMemoryQueueService dispatches via setTimeout, retries with backoff, and JSON round-trips every payload so dev behaviour matches a real backend
|
|
106
|
-
- [
|
|
107
|
+
- [One door per name — the ecosystem tier and the package root are both gone](the-ecosystem-entry-point-carries-the-adapter-surface.md) — the adapter surface was split onto @pikku/core/ecosystem to keep a stability promise at the root; publishing every module twice cost more than the promise was worth, so both the facades and the root barrel were deleted
|
|
107
108
|
- [The embedding model is pinned per service and doc/query embedding is split](the-embedding-model-is-pinned-per-service-and-doc-query-embedding-is-split.md) — AIEmbeddingService fixes its model at construction so index and query share a vector space, and separates embedDocuments from embedQuery for asymmetric models
|
|
108
109
|
- [The in-memory workflow service is inline-only and single-process](the-in-memory-workflow-service-is-inline-only-and-single-process.md) — InMemoryWorkflowService wires no queues and implements withRunLock/withStepLock as pass-throughs, because inline execution has no second holder to exclude
|
|
109
110
|
- [The KEK salt is scoped to the key version, not the secret](the-kek-salt-is-scoped-to-the-key-version.md) — One stored salt per key version means N secrets cost one derivation, which is the point of envelope encryption
|
|
@@ -153,4 +154,5 @@ caller is entitled to assume.
|
|
|
153
154
|
- [A workflow step's recorded `rpcName` is provenance only — nothing dispatches off it](workflow-step-rpc-name-is-provenance-only.md) — It exists so a reader can join a runtime step row back to the declaration that produced it, especially when the durable name was built in a loop
|
|
154
155
|
- [A suspend or approval `reason` is the step's durable identity, not just a message](workflow-suspend-and-approval-reasons-are-durable-step-identities.md) — The reason is namespaced and used raw as the step key, so it must be derived deterministically across replays
|
|
155
156
|
- [A suspended workflow run keeps its in-process context; only terminal runs release it](workflow-suspended-runs-keep-their-in-process-context.md) — `suspended` is absent from the terminal set on purpose, and a context is dropped only when nothing is holding it open
|
|
157
|
+
|
|
156
158
|
<!-- /pikku:knowledge-index -->
|
package/knowledge/decisions/internals/istanbul-statement-counts-attach-to-the-start-line-only.md
CHANGED
|
@@ -9,7 +9,7 @@ tags: services
|
|
|
9
9
|
|
|
10
10
|
`IstanbulCoverageService` (`packages/core/src/services/istanbul-coverage-service.ts`)
|
|
11
11
|
reads instrumented counters off the `__coverage__` global and, when turning
|
|
12
|
-
statement maps into line hits, credits each statement's count to its
|
|
12
|
+
statement maps into line hits, credits each statement's count to its _start_ line
|
|
13
13
|
and no other line it spans.
|
|
14
14
|
|
|
15
15
|
This is istanbul's own semantics, and the reason matters: statements nest. An
|
|
@@ -29,7 +29,7 @@ Two of workspace validate's own checks were not merely absent from fabric — th
|
|
|
29
29
|
had never run anywhere:
|
|
30
30
|
|
|
31
31
|
- the auth checks were gated on a middleware instance with `definitionId ===
|
|
32
|
-
|
|
32
|
+
'betterAuthSession'`, but the CLI wires `betterAuthStatelessSession` whenever
|
|
33
33
|
`session.cookieCache` is on, which is the configuration Fabric asks for. So
|
|
34
34
|
they skipped precisely the apps most likely to have auth.
|
|
35
35
|
- they looked for migrations in `packages/functions/db/`, and for tables named
|