@pikku/core 0.12.82 → 0.12.84
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 +101 -0
- package/README.md +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 +18 -0
- package/dist/ecosystem/agent.js +6 -0
- package/dist/ecosystem/ai-agent.d.ts +18 -0
- package/dist/ecosystem/ai-agent.js +6 -0
- package/dist/ecosystem/ai-scorer.d.ts +12 -0
- package/dist/ecosystem/ai-scorer.js +5 -0
- package/dist/ecosystem/channel/local.d.ts +1 -0
- package/dist/ecosystem/channel/local.js +1 -0
- package/dist/ecosystem/channel.d.ts +12 -0
- package/dist/ecosystem/channel.js +4 -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 +9 -0
- package/dist/ecosystem/credential.js +1 -0
- package/dist/ecosystem/dev.d.ts +8 -0
- package/dist/ecosystem/dev.js +1 -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/gateway.js +1 -0
- package/dist/ecosystem/hmac.d.ts +1 -0
- package/dist/ecosystem/hmac.js +1 -0
- package/dist/ecosystem/http.d.ts +11 -0
- package/dist/ecosystem/http.js +3 -0
- package/dist/ecosystem/mcp.d.ts +3 -0
- package/dist/ecosystem/mcp.js +2 -0
- package/dist/ecosystem/middleware.d.ts +17 -0
- package/dist/ecosystem/middleware.js +6 -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/node.js +1 -0
- package/dist/ecosystem/oauth2.d.ts +1 -0
- package/dist/ecosystem/oauth2.js +1 -0
- package/dist/ecosystem/persona.d.ts +15 -0
- package/dist/ecosystem/persona.js +4 -0
- package/dist/ecosystem/queue.d.ts +11 -0
- package/dist/ecosystem/queue.js +2 -0
- package/dist/ecosystem/remote.d.ts +8 -0
- package/dist/ecosystem/remote.js +1 -0
- package/dist/ecosystem/role.d.ts +3 -0
- package/dist/ecosystem/role.js +2 -0
- package/dist/ecosystem/rpc.d.ts +4 -0
- package/dist/ecosystem/rpc.js +2 -0
- package/dist/ecosystem/safe-fetch.d.ts +7 -0
- package/dist/ecosystem/safe-fetch.js +1 -0
- package/dist/ecosystem/scenario.d.ts +15 -0
- package/dist/ecosystem/scenario.js +4 -0
- package/dist/ecosystem/scheduler.d.ts +2 -0
- package/dist/ecosystem/scheduler.js +1 -0
- package/dist/ecosystem/schema.d.ts +1 -0
- package/dist/ecosystem/schema.js +1 -0
- package/dist/ecosystem/scope.d.ts +3 -0
- package/dist/ecosystem/scope.js +2 -0
- package/dist/ecosystem/secret.d.ts +9 -0
- package/dist/ecosystem/secret.js +1 -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 +1 -0
- package/dist/ecosystem/services/local-content.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 +28 -0
- package/dist/ecosystem/services.js +6 -0
- package/dist/ecosystem/testing.d.ts +7 -0
- package/dist/ecosystem/testing.js +1 -0
- package/dist/ecosystem/trigger.d.ts +1 -0
- package/dist/ecosystem/trigger.js +1 -0
- package/dist/ecosystem/types.d.ts +9 -0
- package/dist/ecosystem/types.js +5 -0
- package/dist/ecosystem/variable.d.ts +8 -0
- package/dist/ecosystem/variable.js +1 -0
- package/dist/ecosystem/virtual-user.d.ts +21 -0
- package/dist/ecosystem/virtual-user.js +5 -0
- package/dist/ecosystem/workflow.d.ts +18 -0
- package/dist/ecosystem/workflow.js +4 -0
- package/dist/index.d.ts +8 -8
- package/dist/index.js +3 -3
- package/dist/middleware/auth-apikey.d.ts +1 -1
- package/dist/middleware/auth-bearer.d.ts +1 -1
- package/dist/middleware/auth-cookie.d.ts +1 -1
- package/dist/middleware/cors.d.ts +1 -1
- package/dist/middleware/remote-auth.d.ts +1 -1
- package/dist/middleware/telemetry.d.ts +2 -2
- package/dist/services/agent-run-state-service.d.ts +29 -0
- package/dist/services/agent-run-state-service.js +1 -0
- package/dist/services/agent-runner-service.d.ts +220 -0
- package/dist/services/agent-runner-service.js +1 -0
- package/dist/services/agent-storage-service.d.ts +18 -0
- package/dist/services/agent-storage-service.js +1 -0
- package/dist/services/http-personas.d.ts +1 -1
- package/dist/services/http-personas.js +3 -3
- package/dist/services/in-memory-agent-run-state-service.d.ts +19 -0
- package/dist/services/in-memory-agent-run-state-service.js +54 -0
- package/dist/services/index.d.ts +9 -10
- package/dist/services/index.js +3 -3
- package/dist/services/meta-service.d.ts +5 -4
- 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/agent-storage-service-tests.js +302 -0
- package/dist/testing/service-tests.d.ts +4 -4
- package/dist/testing/service-tests.js +4 -4
- package/dist/types/core.types.d.ts +12 -11
- package/dist/types/core.types.js +1 -1
- package/dist/types/state.types.d.ts +11 -6
- package/dist/wirings/actor-flow/run-conversation.d.ts +2 -2
- package/dist/wirings/agent/agent-agui.d.ts +79 -0
- package/dist/wirings/agent/agent-agui.js +327 -0
- package/dist/wirings/agent/agent-finalize.d.ts +58 -0
- package/dist/wirings/agent/agent-finalize.js +138 -0
- package/dist/wirings/agent/agent-helpers.d.ts +35 -0
- package/dist/wirings/agent/agent-helpers.js +47 -0
- package/dist/wirings/agent/agent-interrupt.d.ts +153 -0
- package/dist/wirings/agent/agent-interrupt.js +257 -0
- package/dist/wirings/agent/agent-memory.d.ts +42 -0
- package/dist/wirings/agent/agent-memory.js +333 -0
- package/dist/wirings/agent/agent-model-config.d.ts +16 -0
- package/dist/wirings/agent/agent-model-config.js +51 -0
- package/dist/wirings/agent/agent-prepare.d.ts +117 -0
- package/dist/wirings/agent/agent-prepare.js +728 -0
- package/dist/wirings/agent/agent-registry.d.ts +16 -0
- package/dist/wirings/agent/agent-registry.js +51 -0
- package/dist/wirings/agent/agent-rpc.d.ts +15 -0
- package/dist/wirings/agent/agent-rpc.js +53 -0
- package/dist/wirings/agent/agent-runner.d.ts +7 -0
- package/dist/wirings/agent/agent-runner.js +580 -0
- package/dist/wirings/agent/agent-stream.d.ts +41 -0
- package/dist/wirings/agent/agent-stream.js +1029 -0
- package/dist/wirings/agent/agent-turn.d.ts +57 -0
- package/dist/wirings/agent/agent-turn.js +82 -0
- package/dist/wirings/agent/agent-utils.d.ts +1 -0
- package/dist/wirings/agent/agent-utils.js +1 -0
- package/dist/wirings/agent/agent.types.d.ts +625 -0
- 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/agent/voice-input.d.ts +69 -0
- package/dist/wirings/agent/voice-input.js +150 -0
- package/dist/wirings/agent/voice-output.d.ts +85 -0
- package/dist/wirings/agent/voice-output.js +196 -0
- package/dist/wirings/agent-scorer/agent-scorer-grade.d.ts +26 -0
- package/dist/wirings/agent-scorer/agent-scorer-grade.js +33 -0
- package/dist/wirings/agent-scorer/agent-scorer-judge.d.ts +17 -0
- package/dist/wirings/agent-scorer/agent-scorer-judge.js +92 -0
- package/dist/wirings/agent-scorer/agent-scorer-live.d.ts +15 -0
- package/dist/wirings/agent-scorer/agent-scorer-live.js +38 -0
- package/dist/wirings/agent-scorer/agent-scorer-registry.d.ts +18 -0
- package/dist/wirings/agent-scorer/agent-scorer-registry.js +46 -0
- package/dist/wirings/agent-scorer/agent-scorer-sampling.d.ts +8 -0
- package/dist/wirings/agent-scorer/agent-scorer-sampling.js +31 -0
- package/dist/wirings/agent-scorer/agent-scorer-snapshots.d.ts +10 -0
- package/dist/wirings/agent-scorer/agent-scorer-snapshots.js +40 -0
- package/dist/wirings/agent-scorer/agent-scorer-worker.d.ts +15 -0
- package/dist/wirings/agent-scorer/agent-scorer-worker.js +60 -0
- package/dist/wirings/agent-scorer/agent-scorer.d.ts +39 -0
- package/dist/wirings/agent-scorer/agent-scorer.js +40 -0
- package/dist/wirings/agent-scorer/agent-scorer.types.d.ts +90 -0
- 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/ai-agent/ai-agent-prepare.js +2 -0
- package/dist/wirings/ai-agent/voice-output.d.ts +1 -2
- package/dist/wirings/channel/channel-rpc.types.d.ts +2 -2
- package/dist/wirings/rpc/addon-runner.d.ts +4 -0
- package/dist/wirings/rpc/addon-runner.js +14 -2
- package/dist/wirings/rpc/rpc-runner.d.ts +1 -1
- package/dist/wirings/rpc/rpc-runner.js +4 -2
- package/dist/wirings/rpc/rpc-types.d.ts +5 -1
- package/dist/wirings/rpc/wire-addon.d.ts +12 -0
- package/dist/wirings/rpc/wire-addon.js +4 -0
- 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/workflow/feature.d.ts +2 -1
- package/dist/wirings/workflow/index.d.ts +3 -14
- package/dist/wirings/workflow/index.js +0 -8
- package/dist/wirings/workflow/pikku-scenario-service.d.ts +10 -0
- package/dist/wirings/workflow/pikku-scenario-service.js +9 -0
- package/dist/wirings/workflow/run-timeline.d.ts +1 -2
- package/dist/wirings/workflow/scenario.types.d.ts +37 -0
- package/dist/wirings/workflow/scenario.types.js +1 -0
- package/dist/wirings/workflow/workflow.types.d.ts +2 -37
- 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/actor-flow-drives-the-target-through-a-transport-seam.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-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/speech-synthesis-picks-a-voice-per-sentence-and-warns-once.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-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-transcript-event-is-sent-ahead-of-the-run.md +2 -2
- package/knowledge/decisions/internals/thread-history-records-the-transcript-not-the-audio.md +2 -2
- package/knowledge/decisions/internals/voice-output-speaks-unless-voice-input-explicitly-says-otherwise.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} +3 -3
- 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-empty-owners-constraint-matches-nothing.md +3 -3
- package/knowledge/decisions/security/console-addon-privileged-functions-gate-themselves.md +20 -13
- package/knowledge/decisions/security/index.md +1 -2
- package/package.json +4 -4
- package/scripts/generate-api-report.mts +32 -8
- package/src/agent-naming.test.ts +68 -0
- package/src/ecosystem/agent-scorer.ts +24 -0
- package/src/ecosystem/agent.ts +42 -0
- package/src/ecosystem/channel/local.ts +1 -0
- package/src/ecosystem/channel.ts +22 -0
- package/src/ecosystem/cli/channel.ts +25 -0
- package/src/ecosystem/cli.ts +21 -0
- package/src/ecosystem/credential.ts +10 -0
- package/src/ecosystem/dev.ts +12 -0
- package/src/ecosystem/function.ts +28 -0
- package/src/ecosystem/gateway.ts +4 -0
- package/src/ecosystem/hmac.ts +1 -0
- package/src/ecosystem/http.ts +22 -0
- package/src/ecosystem/mcp.ts +17 -0
- package/src/ecosystem/middleware.ts +27 -0
- package/src/ecosystem/node-host-resolver.ts +1 -0
- package/src/ecosystem/node.ts +5 -0
- package/src/ecosystem/oauth2.ts +4 -0
- package/src/ecosystem/persona.ts +30 -0
- package/src/ecosystem/queue.ts +23 -0
- package/src/ecosystem/remote.ts +9 -0
- package/src/ecosystem/role.ts +13 -0
- package/src/ecosystem/rpc.ts +7 -0
- package/src/ecosystem/safe-fetch.ts +8 -0
- package/src/ecosystem/scenario.ts +32 -0
- package/src/ecosystem/scheduler.ts +5 -0
- package/src/ecosystem/schema.ts +1 -0
- package/src/ecosystem/scope.ts +14 -0
- package/src/ecosystem/secret.ts +15 -0
- package/src/ecosystem/services/istanbul-coverage.ts +1 -0
- package/src/ecosystem/services/local-content-request-handler.ts +16 -0
- package/src/ecosystem/services/local-content.ts +1 -0
- package/src/ecosystem/services/v8-coverage.ts +1 -0
- package/src/ecosystem/services.ts +82 -0
- package/src/ecosystem/testing.ts +8 -0
- package/src/ecosystem/trigger.ts +7 -0
- package/src/ecosystem/types.ts +34 -0
- package/src/ecosystem/variable.ts +14 -0
- package/src/ecosystem/virtual-user.ts +48 -0
- package/src/ecosystem/workflow.ts +68 -0
- package/src/index.ts +8 -19
- package/src/pikku-state.ts +3 -3
- package/src/public-surface.json +183 -91
- package/src/public-surface.json.README +20 -2
- package/src/public-surface.test.ts +31 -3
- 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/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/index.ts +13 -24
- package/src/services/meta-service.ts +5 -7
- 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 +13 -13
- package/src/types/state.types.ts +11 -10
- package/src/wirings/actor-flow/run-conversation.test.ts +2 -2
- package/src/wirings/actor-flow/run-conversation.ts +7 -9
- 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} +54 -51
- 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} +90 -80
- 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} +147 -146
- 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/{ai-agent/ai-agent.types.ts → agent/agent.types.ts} +51 -48
- package/src/wirings/agent/index.ts +56 -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 +23 -23
- 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/{ai-scorer/ai-scorer-judge.test.ts → agent-scorer/agent-scorer-judge.test.ts} +11 -14
- package/src/wirings/{ai-scorer/ai-scorer-judge.ts → agent-scorer/agent-scorer-judge.ts} +11 -11
- 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} +7 -7
- package/src/wirings/{ai-scorer/ai-scorer.types.ts → agent-scorer/agent-scorer.types.ts} +6 -6
- package/src/wirings/agent-scorer/index.ts +22 -0
- package/src/wirings/channel/channel-rpc.types.ts +2 -2
- package/src/wirings/rpc/addon-runner.ts +31 -3
- package/src/wirings/rpc/addon-secrets.test.ts +130 -0
- package/src/wirings/rpc/rpc-runner.ts +4 -2
- package/src/wirings/rpc/rpc-types.ts +5 -1
- package/src/wirings/rpc/wire-addon.ts +16 -0
- package/src/wirings/virtual-user/prepare-virtual-user-run.ts +1 -1
- 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/workflow/feature.ts +2 -5
- package/src/wirings/workflow/index.ts +1 -49
- package/src/wirings/workflow/pikku-scenario-service.ts +21 -1
- package/src/wirings/workflow/run-timeline.ts +1 -1
- package/src/wirings/workflow/scenario.types.ts +63 -0
- package/src/wirings/workflow/workflow.types.ts +1 -54
- package/src/wirings-stay-decoupled.test.ts +3 -3
- package/tsconfig.tsbuildinfo +1 -1
- package/src/wirings/ai-agent/index.ts +0 -65
- package/src/wirings/ai-scorer/index.ts +0 -24
- /package/src/wirings/{ai-agent/ai-agent-utils.ts → agent/agent-utils.ts} +0 -0
- /package/src/wirings/{ai-scorer/ai-scorer-sampling.ts → agent-scorer/agent-scorer-sampling.ts} +0 -0
|
@@ -13,7 +13,7 @@ import { PikkuError, addError } from '../../errors/error-handler.js'
|
|
|
13
13
|
import type { PikkuRPC, ResolvedFunction } from './rpc-types.js'
|
|
14
14
|
import { parseVersionedId } from '../../version.js'
|
|
15
15
|
import { resolveRemoteAddonToken } from './remote-addon-auth.js'
|
|
16
|
-
import { createAgentRPC } from '../
|
|
16
|
+
import { createAgentRPC } from '../agent/agent-rpc.js'
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* The session for a wire: read through `getSession` when a runner attached one,
|
|
@@ -284,6 +284,8 @@ export class ContextAwareRPCService {
|
|
|
284
284
|
secretOverrides: resolved.addonConfig?.secretOverrides,
|
|
285
285
|
variableOverrides: resolved.addonConfig?.variableOverrides,
|
|
286
286
|
credentialOverrides: resolved.addonConfig?.credentialOverrides,
|
|
287
|
+
secretGrants: resolved.addonConfig?.secretGrants,
|
|
288
|
+
credentialGrants: resolved.addonConfig?.credentialGrants,
|
|
287
289
|
globalSecrets: resolved.addonConfig?.globalSecrets,
|
|
288
290
|
globalCredentials: resolved.addonConfig?.globalCredentials,
|
|
289
291
|
},
|
|
@@ -459,7 +461,7 @@ export class ContextAwareRPCService {
|
|
|
459
461
|
/**
|
|
460
462
|
* The agent facade, built on access.
|
|
461
463
|
*
|
|
462
|
-
* The implementation lives in `
|
|
464
|
+
* The implementation lives in `agent/agent-rpc.ts` so the agent surface is
|
|
463
465
|
* one file rather than a wing of this one; a getter rather than a field so a
|
|
464
466
|
* request that never touches an agent never builds it.
|
|
465
467
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PikkuRawWire } from '../../types/core.types.js'
|
|
2
|
-
import type { AgentInterruptResult } from '../
|
|
2
|
+
import type { AgentInterruptResult } from '../agent/agent-interrupt.js'
|
|
3
3
|
|
|
4
4
|
export type PikkuRPC<
|
|
5
5
|
Invoke extends (...args: any[]) => any = (...args: any[]) => any,
|
|
@@ -67,6 +67,10 @@ export interface ResolvedFunction {
|
|
|
67
67
|
secretOverrides?: Record<string, string>
|
|
68
68
|
variableOverrides?: Record<string, string>
|
|
69
69
|
credentialOverrides?: Record<string, string>
|
|
70
|
+
/** Set by the consuming app: secrets it lends this instance, as the addon names them */
|
|
71
|
+
secretGrants?: string[]
|
|
72
|
+
/** Set by the consuming app: credentials it lends this instance, as the addon names them */
|
|
73
|
+
credentialGrants?: string[]
|
|
70
74
|
/** Set by the consuming app: hand this instance the unscoped `SecretService` */
|
|
71
75
|
globalSecrets?: string
|
|
72
76
|
/** Set by the consuming app: hand this instance the unscoped `CredentialService` */
|
|
@@ -14,6 +14,18 @@ export type WireAddonConfig = {
|
|
|
14
14
|
secretOverrides?: Record<string, string>
|
|
15
15
|
variableOverrides?: Record<string, string>
|
|
16
16
|
credentialOverrides?: Record<string, string>
|
|
17
|
+
/**
|
|
18
|
+
* Secrets this instance may read on top of the ones it declared, named as the
|
|
19
|
+
* addon reads them — the scope check runs before `secretOverrides` renames
|
|
20
|
+
* them, so an overridden secret is named here by its addon-side key. Listing
|
|
21
|
+
* one in `secretOverrides` grants it too.
|
|
22
|
+
*
|
|
23
|
+
* For an addon whose secret names come off its input rather than its own
|
|
24
|
+
* source, this is how the host lends names the addon could not declare.
|
|
25
|
+
*/
|
|
26
|
+
secretGrants?: string[]
|
|
27
|
+
/** Credentials this instance may read on top of the ones it declared. */
|
|
28
|
+
credentialGrants?: string[]
|
|
17
29
|
/**
|
|
18
30
|
* Hands this instance the whole `SecretService` instead of one scoped to the
|
|
19
31
|
* secrets it declared. The value is the reason, recorded in the deploy
|
|
@@ -45,6 +57,10 @@ export const wireAddon = (config: WireAddonConfig): void => {
|
|
|
45
57
|
...(config.credentialOverrides
|
|
46
58
|
? { credentialOverrides: config.credentialOverrides }
|
|
47
59
|
: {}),
|
|
60
|
+
...(config.secretGrants ? { secretGrants: config.secretGrants } : {}),
|
|
61
|
+
...(config.credentialGrants
|
|
62
|
+
? { credentialGrants: config.credentialGrants }
|
|
63
|
+
: {}),
|
|
48
64
|
...(config.globalSecrets ? { globalSecrets: config.globalSecrets } : {}),
|
|
49
65
|
...(config.globalCredentials
|
|
50
66
|
? { globalCredentials: config.globalCredentials }
|
|
@@ -87,7 +87,7 @@ export const prepareVirtualUserRun = (input: {
|
|
|
87
87
|
const scopes = personaScopes(input.persona, roleScopes)
|
|
88
88
|
|
|
89
89
|
// Gated by the same scopes as the RPCs, because an agent is reached rather
|
|
90
|
-
// than declared: `
|
|
90
|
+
// than declared: `CoreAgent.scopes` is checked against the session, so a
|
|
91
91
|
// persona finds the specialists its roles unlock and no others.
|
|
92
92
|
const agents = reachableAgents(input.agentsMeta ?? {}, scopes)
|
|
93
93
|
|
|
@@ -3,7 +3,7 @@ import assert from 'node:assert/strict'
|
|
|
3
3
|
|
|
4
4
|
import { rememberIds, runVirtualUser } from './run-virtual-user.js'
|
|
5
5
|
import type { ActorLLM } from '../actor-flow/run-conversation.js'
|
|
6
|
-
import type {
|
|
6
|
+
import type { AgentStepResult } from '../../services/agent-runner-service.js'
|
|
7
7
|
import type { ScenarioHttpResponse } from '../../services/personas-service.js'
|
|
8
8
|
import type {
|
|
9
9
|
ApiCatalogueEntry,
|
|
@@ -83,7 +83,7 @@ const scripted = (
|
|
|
83
83
|
toolResults: [],
|
|
84
84
|
usage: { inputTokens: 10, outputTokens: 4 },
|
|
85
85
|
finishReason: 'stop',
|
|
86
|
-
} satisfies
|
|
86
|
+
} satisfies AgentStepResult
|
|
87
87
|
}
|
|
88
88
|
return { llm, turns: () => turn }
|
|
89
89
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ResolvedPersona } from '../../services/personas-service.js'
|
|
2
|
-
import type {
|
|
2
|
+
import type { AgentMessage } from '../agent/agent.types.js'
|
|
3
3
|
import type { ActorLLM } from '../actor-flow/run-conversation.js'
|
|
4
4
|
import { getDurationInMilliseconds } from '../../time-utils.js'
|
|
5
5
|
import {
|
|
@@ -135,7 +135,7 @@ export interface RunVirtualUserParams {
|
|
|
135
135
|
maxStepsPerIntent?: number
|
|
136
136
|
}
|
|
137
137
|
|
|
138
|
-
const msg = (role:
|
|
138
|
+
const msg = (role: AgentMessage['role'], content: string): AgentMessage => ({
|
|
139
139
|
id: globalThis.crypto.randomUUID(),
|
|
140
140
|
role,
|
|
141
141
|
content,
|
|
@@ -318,7 +318,7 @@ export const runVirtualUser = async (
|
|
|
318
318
|
const described = new Set<string>()
|
|
319
319
|
const findings: VirtualUserFinding[] = []
|
|
320
320
|
const steps: StepRecord[] = []
|
|
321
|
-
const history = new Map<string,
|
|
321
|
+
const history = new Map<string, AgentMessage[]>()
|
|
322
322
|
|
|
323
323
|
const tally: VirtualUserTally = {
|
|
324
324
|
steps: 0,
|
|
@@ -4,7 +4,7 @@ import { hasScopes } from '../../scopes.js'
|
|
|
4
4
|
* Which of the product's agents a persona can actually talk to.
|
|
5
5
|
*
|
|
6
6
|
* An agent is not something a persona declares. It is something a persona
|
|
7
|
-
* *reaches*, under exactly the rule an RPC is reached by: `
|
|
7
|
+
* *reaches*, under exactly the rule an RPC is reached by: `CoreAgent.scopes`
|
|
8
8
|
* is checked against the session, so a persona holding the scopes an agent
|
|
9
9
|
* requires finds it in front of them, and one that does not, does not.
|
|
10
10
|
*
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { pikkuState } from '../../pikku-state.js'
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
CoreWorkflow,
|
|
5
|
-
FeaturePlanEntry,
|
|
6
|
-
} from './workflow.types.js'
|
|
2
|
+
import type { CoreWorkflow } from './workflow.types.js'
|
|
3
|
+
import type { CoreFeature, FeaturePlanEntry } from './scenario.types.js'
|
|
7
4
|
|
|
8
5
|
export const addFeature = (
|
|
9
6
|
featureId: string,
|
|
@@ -28,13 +28,9 @@ export {
|
|
|
28
28
|
reconstructStateAt,
|
|
29
29
|
reconstructFinalState,
|
|
30
30
|
} from './run-timeline.js'
|
|
31
|
-
export type {
|
|
32
|
-
RunTimeline,
|
|
33
|
-
ReconstructedRunState,
|
|
34
|
-
} from './run-timeline.js'
|
|
31
|
+
export type { RunTimeline, ReconstructedRunState } from './run-timeline.js'
|
|
35
32
|
|
|
36
33
|
export { addWorkflow } from './dsl/workflow-runner.js'
|
|
37
|
-
export { addFeature, resolveFeatureScenarios } from './feature.js'
|
|
38
34
|
|
|
39
35
|
export { template, type TemplateString } from './graph/template.js'
|
|
40
36
|
export {
|
|
@@ -63,10 +59,6 @@ export type {
|
|
|
63
59
|
WorkflowRunService,
|
|
64
60
|
WorkflowRunMirror,
|
|
65
61
|
CoreWorkflow,
|
|
66
|
-
CoreFeature,
|
|
67
|
-
FeatureMeta,
|
|
68
|
-
FeaturesMeta,
|
|
69
|
-
FeaturePlanEntry,
|
|
70
62
|
PikkuWorkflow,
|
|
71
63
|
ContextVariable,
|
|
72
64
|
WorkflowContext,
|
|
@@ -97,47 +89,7 @@ export type {
|
|
|
97
89
|
SwitchStepMeta,
|
|
98
90
|
FilterStepMeta,
|
|
99
91
|
ArrayPredicateStepMeta,
|
|
100
|
-
ScenarioStepInvocation,
|
|
101
|
-
ScenarioStepMeta,
|
|
102
92
|
WorkflowStepMeta,
|
|
103
93
|
WorkflowStepWire,
|
|
104
94
|
PikkuWorkflowWire,
|
|
105
|
-
PikkuScenarioWire,
|
|
106
95
|
} from './workflow.types.js'
|
|
107
|
-
|
|
108
|
-
export type {
|
|
109
|
-
ScenarioStepPhase,
|
|
110
|
-
ScenarioStepKind,
|
|
111
|
-
ScenarioStepOptions,
|
|
112
|
-
PikkuScenarioStepWire,
|
|
113
|
-
ScenarioEnvironment,
|
|
114
|
-
ScenarioSurface,
|
|
115
|
-
ScenarioSurfaceResolution,
|
|
116
|
-
} from './scenario-step.types.js'
|
|
117
|
-
export { SCENARIO_SURFACES } from './scenario-step.types.js'
|
|
118
|
-
|
|
119
|
-
// Which of a step's bindings run: one for an action, every witness for a `then`
|
|
120
|
-
export { resolveScenarioSurfaces } from './scenario-surface.js'
|
|
121
|
-
|
|
122
|
-
export { requireActor, requireScenarioEnv } from './scenario-step-guards.js'
|
|
123
|
-
|
|
124
|
-
export { pollUntil, type PollOptions } from './scenario-poll.js'
|
|
125
|
-
|
|
126
|
-
export { createCookieJar } from './scenario-cookie-jar.js'
|
|
127
|
-
export type { ScenarioCookieJar } from './scenario-cookie-jar.js'
|
|
128
|
-
|
|
129
|
-
export type {
|
|
130
|
-
ScenarioHttpResponse,
|
|
131
|
-
ScenarioJsonRequest,
|
|
132
|
-
} from '../../services/personas-service.js'
|
|
133
|
-
// The readers themselves live on `@pikku/core/persona`; workflow is a production
|
|
134
|
-
// wiring and must not pull scenario runtime in behind it.
|
|
135
|
-
|
|
136
|
-
export type {
|
|
137
|
-
PikkuBrowserWire,
|
|
138
|
-
TestIdSelector,
|
|
139
|
-
ScenarioBrowserProvider,
|
|
140
|
-
ScenarioBrowserFailure,
|
|
141
|
-
} from './scenario-step.types.js'
|
|
142
|
-
|
|
143
|
-
export { composeStepProse, renderStepTemplate } from './scenario-prose.js'
|
|
@@ -27,10 +27,10 @@ import type {
|
|
|
27
27
|
} from './scenario-step.types.js'
|
|
28
28
|
import { resolveScenarioSurfaces, witnessesAgree } from './scenario-surface.js'
|
|
29
29
|
import type {
|
|
30
|
-
PikkuScenarioWire,
|
|
31
30
|
PikkuWorkflowWire,
|
|
32
31
|
WorkflowQueueOptions,
|
|
33
32
|
} from './workflow.types.js'
|
|
33
|
+
import type { PikkuScenarioWire } from './scenario.types.js'
|
|
34
34
|
import type {
|
|
35
35
|
WorkflowExpectEventuallyOptions,
|
|
36
36
|
WorkflowExpectErrorOptions,
|
|
@@ -38,6 +38,26 @@ import type {
|
|
|
38
38
|
WorkflowExpectServiceOptions,
|
|
39
39
|
} from './dsl/workflow-dsl.types.js'
|
|
40
40
|
|
|
41
|
+
export { addFeature, resolveFeatureScenarios } from './feature.js'
|
|
42
|
+
export type * from './scenario.types.js'
|
|
43
|
+
export { SCENARIO_SURFACES } from './scenario-step.types.js'
|
|
44
|
+
|
|
45
|
+
// Which of a step's bindings run: one for an action, every witness for a `then`
|
|
46
|
+
export { resolveScenarioSurfaces } from './scenario-surface.js'
|
|
47
|
+
|
|
48
|
+
export { pollUntil, type PollOptions } from './scenario-poll.js'
|
|
49
|
+
export { createCookieJar } from './scenario-cookie-jar.js'
|
|
50
|
+
export type { ScenarioCookieJar } from './scenario-cookie-jar.js'
|
|
51
|
+
export { composeStepProse, renderStepTemplate } from './scenario-prose.js'
|
|
52
|
+
|
|
53
|
+
export { requireActor, requireScenarioEnv } from './scenario-step-guards.js'
|
|
54
|
+
|
|
55
|
+
export type {
|
|
56
|
+
ScenarioHttpResponse,
|
|
57
|
+
ScenarioJsonRequest,
|
|
58
|
+
} from '../../services/personas-service.js'
|
|
59
|
+
// The readers themselves live on `@pikku/core/persona`
|
|
60
|
+
|
|
41
61
|
/**
|
|
42
62
|
* A workflow service with the scenario capability attached — the two lines
|
|
43
63
|
* `pikku scenario run` needs, in one call so no caller has to remember that the
|
|
@@ -17,7 +17,7 @@ export interface RunTimelineEvent {
|
|
|
17
17
|
|
|
18
18
|
export type RunTimeline = RunTimelineEvent[]
|
|
19
19
|
|
|
20
|
-
type HistoryEntry = StepState & { stepName: string }
|
|
20
|
+
export type HistoryEntry = StepState & { stepName: string }
|
|
21
21
|
|
|
22
22
|
const LIFECYCLE_ORDER: Record<RunTimelineEvent['type'], number> = {
|
|
23
23
|
pending: 0,
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
CorePikkuFunctionConfig,
|
|
3
|
+
CorePikkuFunctionHook,
|
|
4
|
+
} from '../../function/functions.types.js'
|
|
5
|
+
|
|
6
|
+
export type {
|
|
7
|
+
ScenarioStepInvocation,
|
|
8
|
+
ScenarioStepMeta,
|
|
9
|
+
PikkuScenarioWire,
|
|
10
|
+
} from './dsl/workflow-dsl.types.js'
|
|
11
|
+
|
|
12
|
+
export type {
|
|
13
|
+
ScenarioStepPhase,
|
|
14
|
+
ScenarioStepKind,
|
|
15
|
+
ScenarioStepOptions,
|
|
16
|
+
PikkuScenarioStepWire,
|
|
17
|
+
ScenarioEnvironment,
|
|
18
|
+
ScenarioSurface,
|
|
19
|
+
ScenarioSurfaceResolution,
|
|
20
|
+
PikkuBrowserWire,
|
|
21
|
+
TestIdSelector,
|
|
22
|
+
ScenarioBrowserProvider,
|
|
23
|
+
ScenarioBrowserFailure,
|
|
24
|
+
} from './scenario-step.types.js'
|
|
25
|
+
|
|
26
|
+
export type CoreFeatureScenario =
|
|
27
|
+
| CorePikkuFunctionConfig<any, any, any>
|
|
28
|
+
| { scenario: CorePikkuFunctionConfig<any, any, any>; data: unknown }
|
|
29
|
+
|
|
30
|
+
export type CoreFeature = {
|
|
31
|
+
name: string
|
|
32
|
+
description?: string
|
|
33
|
+
tags?: string[]
|
|
34
|
+
scenarios: readonly CoreFeatureScenario[]
|
|
35
|
+
before?: CorePikkuFunctionHook
|
|
36
|
+
after?: CorePikkuFunctionHook
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export type FeatureMetaEntry = {
|
|
40
|
+
scenario: string
|
|
41
|
+
data?: unknown
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export type FeatureMeta = {
|
|
45
|
+
id: string
|
|
46
|
+
name: string
|
|
47
|
+
description?: string
|
|
48
|
+
tags: string[]
|
|
49
|
+
entries: FeatureMetaEntry[]
|
|
50
|
+
unresolvedEntries: number
|
|
51
|
+
hasBefore: boolean
|
|
52
|
+
hasAfter: boolean
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export type FeaturesMeta = Record<string, FeatureMeta>
|
|
56
|
+
|
|
57
|
+
export type FeaturePlanEntry = {
|
|
58
|
+
featureId: string
|
|
59
|
+
featureName: string
|
|
60
|
+
scenarioName: string
|
|
61
|
+
data?: unknown
|
|
62
|
+
tags: string[]
|
|
63
|
+
}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import type { SerializedError, CommonWireMeta } from '../../types/core.types.js'
|
|
2
|
-
import type {
|
|
3
|
-
CorePikkuFunctionConfig,
|
|
4
|
-
CorePikkuFunctionHook,
|
|
5
|
-
} from '../../function/functions.types.js'
|
|
2
|
+
import type { CorePikkuFunctionConfig } from '../../function/functions.types.js'
|
|
6
3
|
import type { GroupConcurrencyConfig } from '../queue/queue.types.js'
|
|
7
4
|
|
|
8
5
|
export type { WorkflowService } from '../../services/workflow-service.js'
|
|
@@ -30,22 +27,11 @@ export type {
|
|
|
30
27
|
SwitchStepMeta,
|
|
31
28
|
FilterStepMeta,
|
|
32
29
|
ArrayPredicateStepMeta,
|
|
33
|
-
ScenarioStepInvocation,
|
|
34
|
-
ScenarioStepMeta,
|
|
35
30
|
WorkflowStepMeta,
|
|
36
31
|
WorkflowStepWire,
|
|
37
32
|
PikkuWorkflowWire,
|
|
38
|
-
PikkuScenarioWire,
|
|
39
33
|
} from './dsl/workflow-dsl.types.js'
|
|
40
34
|
|
|
41
|
-
export type {
|
|
42
|
-
ScenarioStepPhase,
|
|
43
|
-
ScenarioStepOptions,
|
|
44
|
-
PikkuScenarioStepWire,
|
|
45
|
-
PikkuBrowserWire,
|
|
46
|
-
ScenarioBrowserProvider,
|
|
47
|
-
} from './scenario-step.types.js'
|
|
48
|
-
|
|
49
35
|
import type { WorkflowStepMeta } from './dsl/workflow-dsl.types.js'
|
|
50
36
|
|
|
51
37
|
export interface WorkflowRunWire {
|
|
@@ -238,45 +224,6 @@ export type CoreWorkflow<
|
|
|
238
224
|
tags?: string[]
|
|
239
225
|
}
|
|
240
226
|
|
|
241
|
-
export type CoreFeatureScenario =
|
|
242
|
-
| CorePikkuFunctionConfig<any, any, any>
|
|
243
|
-
| { scenario: CorePikkuFunctionConfig<any, any, any>; data: unknown }
|
|
244
|
-
|
|
245
|
-
export type CoreFeature = {
|
|
246
|
-
name: string
|
|
247
|
-
description?: string
|
|
248
|
-
tags?: string[]
|
|
249
|
-
scenarios: readonly CoreFeatureScenario[]
|
|
250
|
-
before?: CorePikkuFunctionHook
|
|
251
|
-
after?: CorePikkuFunctionHook
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
export type FeatureMetaEntry = {
|
|
255
|
-
scenario: string
|
|
256
|
-
data?: unknown
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
export type FeatureMeta = {
|
|
260
|
-
id: string
|
|
261
|
-
name: string
|
|
262
|
-
description?: string
|
|
263
|
-
tags: string[]
|
|
264
|
-
entries: FeatureMetaEntry[]
|
|
265
|
-
unresolvedEntries: number
|
|
266
|
-
hasBefore: boolean
|
|
267
|
-
hasAfter: boolean
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
export type FeaturesMeta = Record<string, FeatureMeta>
|
|
271
|
-
|
|
272
|
-
export type FeaturePlanEntry = {
|
|
273
|
-
featureId: string
|
|
274
|
-
featureName: string
|
|
275
|
-
scenarioName: string
|
|
276
|
-
data?: unknown
|
|
277
|
-
tags: string[]
|
|
278
|
-
}
|
|
279
|
-
|
|
280
227
|
export interface PikkuWorkflow {
|
|
281
228
|
start: <I>(input: I) => Promise<{ runId: string }>
|
|
282
229
|
getRun: (runId: string) => Promise<WorkflowRun>
|
|
@@ -26,12 +26,12 @@ const ALLOWED: Record<string, string[]> = {
|
|
|
26
26
|
cli: ['channel'],
|
|
27
27
|
// An agent streams over a channel and is invoked over rpc, and grades itself
|
|
28
28
|
// as the last thing a finished run does.
|
|
29
|
-
|
|
29
|
+
agent: ['channel', 'rpc', 'agent-scorer'],
|
|
30
30
|
// A judge is a degenerate agent — it builds agent messages and runs them —
|
|
31
31
|
// and a grade is dispatched to a queue.
|
|
32
|
-
'
|
|
32
|
+
'agent-scorer': ['agent', 'queue'],
|
|
33
33
|
// `wire.rpc.agent` — the facade lives with the agent runtime it delegates to.
|
|
34
|
-
rpc: ['
|
|
34
|
+
rpc: ['agent'],
|
|
35
35
|
gateway: ['http'],
|
|
36
36
|
mcp: ['rpc'],
|
|
37
37
|
trigger: ['rpc'],
|