@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
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export type { AuditDurability, AuditEvent, AuditEventBatch, } from '../services/audit-service.js';
|
|
2
|
+
export type { DeploymentConfig, DeploymentService, DeploymentServiceConfig, } from '../services/deployment-service.js';
|
|
3
|
+
export { InMemoryAgentRunStateService } from '../services/in-memory-agent-run-state-service.js';
|
|
4
|
+
export type { AgentMeta, AgentsMeta, EmailTemplateMeta, EmailsMeta, GroupMeta, MCPMeta, MetaService, MiddlewareDefinitionMeta, MiddlewareGroupsMeta, MiddlewareInstanceMeta, PermissionDefinitionMeta, PermissionsGroupsMeta, RPCMetaRecord, ServiceMeta, ServicesMetaRecord, } from '../services/meta-service.js';
|
|
5
|
+
export type { ResolvedPersona, ScenarioPersonas, } from '../services/personas-service.js';
|
|
6
|
+
export { pikkuWebhookWorkerFunc } from '../services/queue-webhook-service.js';
|
|
7
|
+
export type { ScheduledTaskInfo, ScheduledTaskSummary, } from '../services/scheduler-service.js';
|
|
8
|
+
export type { Role } from '../services/scope-service.js';
|
|
9
|
+
export { getStubTracker, spy } from '../services/stub-tracker.js';
|
|
10
|
+
export type { CredentialMetaInfo } from '../services/typed-credential-service.js';
|
|
11
|
+
export type { CredentialMeta } from '../services/typed-secret-service.js';
|
|
12
|
+
export { TypedVariablesService } from '../services/typed-variables-service.js';
|
|
13
|
+
export type { VariableMeta } from '../services/typed-variables-service.js';
|
|
14
|
+
export { PikkuSessionService, createMiddlewareSessionWireProps, } from '../services/user-session-service.js';
|
|
15
|
+
export type { CoverageFunctionMeta, CoverageService, FunctionCoverageEntry, FunctionCoverageReport, ScriptCoverage, } from '../services/v8-coverage-service.js';
|
|
16
|
+
export { PIKKU_OUTGOING_WEBHOOK_QUEUE_NAME } from '../services/webhook-service.js';
|
|
17
|
+
export type { SendWebhookInput, SendWebhookResult, WebhookAttemptResult, WebhookDeliveryRecord, WebhookDeliveryWithAttempts, } from '../services/webhook-service.js';
|
|
18
|
+
export type { FunctionMeta, FunctionsMeta, MiddlewareMetadata as MiddlewareMeta, PermissionMetadata as PermissionMeta, } from '../types/core.types.js';
|
|
19
|
+
/**
|
|
20
|
+
* Types the exports above mention but do not themselves export. Without
|
|
21
|
+
* them a consumer's declaration emit has no name for the type it infers,
|
|
22
|
+
* and fails with TS2883 rather than reaching for the original entry point.
|
|
23
|
+
*/
|
|
24
|
+
export type { Logger } from '../services/logger.js';
|
|
25
|
+
export type { StubTracker } from '../services/stub-tracker.js';
|
|
26
|
+
export type { SessionService } from '../services/user-session-service.js';
|
|
27
|
+
export type { WebhookJobData, WebhookService, } from '../services/webhook-service.js';
|
|
28
|
+
export type { CoreUserSession } from '../types/core.types.js';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { InMemoryAgentRunStateService } from '../services/in-memory-agent-run-state-service.js';
|
|
2
|
+
export { pikkuWebhookWorkerFunc } from '../services/queue-webhook-service.js';
|
|
3
|
+
export { getStubTracker, spy } from '../services/stub-tracker.js';
|
|
4
|
+
export { TypedVariablesService } from '../services/typed-variables-service.js';
|
|
5
|
+
export { PikkuSessionService, createMiddlewareSessionWireProps, } from '../services/user-session-service.js';
|
|
6
|
+
export { PIKKU_OUTGOING_WEBHOOK_QUEUE_NAME } from '../services/webhook-service.js';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { defineServiceTests } from '../testing/service-tests.js';
|
|
2
|
+
/**
|
|
3
|
+
* Types the exports above mention but do not themselves export. Without
|
|
4
|
+
* them a consumer's declaration emit has no name for the type it infers,
|
|
5
|
+
* and fails with TS2883 rather than reaching for the original entry point.
|
|
6
|
+
*/
|
|
7
|
+
export type { ServiceTestConfig } from '../testing/service-tests.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { defineServiceTests } from '../testing/service-tests.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { CorePikkuTriggerFunction, CorePikkuTriggerFunctionConfig, CoreTrigger, TriggerMeta, TriggerSourceMeta, } from '../wirings/trigger/trigger.types.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { isExpectedError } from '../errors/error-handler.js';
|
|
2
|
+
export type { CorePermissionGroup } from '../function/functions.types.js';
|
|
3
|
+
export { PikkuRequest } from '../pikku-request.js';
|
|
4
|
+
export type { AuditFacets, AuditQuery, AuditQueryResult, } from '../services/audit-service.js';
|
|
5
|
+
export { parseDurationString } from '../time-utils.js';
|
|
6
|
+
export type { RelativeTimeInput } from '../time-utils.js';
|
|
7
|
+
export type { AuthInstance, FunctionServicesMeta, FunctionWiresMeta, JSONValue, MiddlewareMetadata, PermissionMetadata, PikkuWire, PikkuWiringTypes, PostgresConfig, SecretlessServices, SecurityAuditIssue, SecurityAuditReport, SecurityAuditUpdate, SecuritySeverity, SecurityUpdateLevel, SerializedError, } from '../types/core.types.js';
|
|
8
|
+
export { isSerializable } from '../utils.js';
|
|
9
|
+
export { formatVersionedId, isVersionedId, parseVersionedId, } from '../version.js';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { isExpectedError } from '../errors/error-handler.js';
|
|
2
|
+
export { PikkuRequest } from '../pikku-request.js';
|
|
3
|
+
export { parseDurationString } from '../time-utils.js';
|
|
4
|
+
export { isSerializable } from '../utils.js';
|
|
5
|
+
export { formatVersionedId, isVersionedId, parseVersionedId, } from '../version.js';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { validateAndBuildVariableDefinitionsMeta } from '../wirings/variable/validate-variable-definitions.js';
|
|
2
|
+
export type { CoreVariable, VariableDefinitionMeta, VariableDefinitions, VariableDefinitionsMeta, } from '../wirings/variable/variable.types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Types the exports above mention but do not themselves export. Without
|
|
5
|
+
* them a consumer's declaration emit has no name for the type it infers,
|
|
6
|
+
* and fails with TS2883 rather than reaching for the original entry point.
|
|
7
|
+
*/
|
|
8
|
+
export type { SchemaRefLike } from '../types/core.types.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { validateAndBuildVariableDefinitionsMeta } from '../wirings/variable/validate-variable-definitions.js';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export { personaScopes, prepareVirtualUserRun, } from '../wirings/virtual-user/prepare-virtual-user-run.js';
|
|
2
|
+
export { catalogueClassification, isReadOnly, reachableCatalogue, unreachableCatalogue, } from '../wirings/virtual-user/virtual-user-catalogue.js';
|
|
3
|
+
export { DISPOSITIONS, dispositionProfile, } from '../wirings/virtual-user/virtual-user-dispositions.js';
|
|
4
|
+
export type { DispositionProfile } from '../wirings/virtual-user/virtual-user-dispositions.js';
|
|
5
|
+
export { intentsForPersona } from '../wirings/virtual-user/virtual-user-intents.js';
|
|
6
|
+
export type { VirtualUserRunOutcome, VirtualUserRunRecord, VirtualUserRunStart, VirtualUserRunStore, } from '../wirings/virtual-user/virtual-user-run-store.js';
|
|
7
|
+
export { PRODUCTION_DISPOSITION } from '../wirings/virtual-user/virtual-user.types.js';
|
|
8
|
+
export type { IntentSource, VirtualUserFinding, VirtualUserRunResult, } from '../wirings/virtual-user/virtual-user.types.js';
|
|
9
|
+
/**
|
|
10
|
+
* Types the exports above mention but do not themselves export. Without
|
|
11
|
+
* them a consumer's declaration emit has no name for the type it infers,
|
|
12
|
+
* and fails with TS2883 rather than reaching for the original entry point.
|
|
13
|
+
*/
|
|
14
|
+
export type { FunctionsMeta } from '../types/core.types.js';
|
|
15
|
+
export type { SystemRoleDefinitions, SystemRoleDefinitionsMeta, } from '../wirings/role/role.types.js';
|
|
16
|
+
export type { VirtualUserPreparation } from '../wirings/virtual-user/prepare-virtual-user-run.js';
|
|
17
|
+
export type { AgentReachability } from '../wirings/virtual-user/virtual-user-agents.js';
|
|
18
|
+
export type { SchemaMap } from '../wirings/virtual-user/virtual-user-derive.js';
|
|
19
|
+
export type { VirtualUserTuning } from '../wirings/virtual-user/virtual-user-dispositions.js';
|
|
20
|
+
export type { ApiCatalogueEntry, VirtualUserDisposition, } from '../wirings/virtual-user/virtual-user.types.js';
|
|
21
|
+
export type { WorkflowsMeta } from '../wirings/workflow/workflow.types.js';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { personaScopes, prepareVirtualUserRun, } from '../wirings/virtual-user/prepare-virtual-user-run.js';
|
|
2
|
+
export { catalogueClassification, isReadOnly, reachableCatalogue, unreachableCatalogue, } from '../wirings/virtual-user/virtual-user-catalogue.js';
|
|
3
|
+
export { DISPOSITIONS, dispositionProfile, } from '../wirings/virtual-user/virtual-user-dispositions.js';
|
|
4
|
+
export { intentsForPersona } from '../wirings/virtual-user/virtual-user-intents.js';
|
|
5
|
+
export { PRODUCTION_DISPOSITION } from '../wirings/virtual-user/virtual-user.types.js';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type { WorkflowService } from '../services/workflow-service.js';
|
|
2
|
+
export type { ApprovalStepMeta, ArrayPredicateStepMeta, BranchStepMeta, CancelStepMeta, Condition, FanoutStepMeta, FilterStepMeta, InlineStepMeta, InputSource, OutputBinding, ParallelGroupStepMeta, PikkuWorkflowWire, RpcStepMeta, SetStepMeta, SleepStepMeta, SuspendStepMeta, SwitchCaseMeta, SwitchStepMeta, WorkflowStepMeta, WorkflowStepOptions, WorkflowWireDoRPC, } from '../wirings/workflow/dsl/workflow-dsl.types.js';
|
|
3
|
+
export { template } from '../wirings/workflow/graph/template.js';
|
|
4
|
+
export type { PikkuWorkflowGraphConfig, PikkuWorkflowGraphResult, } from '../wirings/workflow/graph/wire-workflow-graph.js';
|
|
5
|
+
export { isRef } from '../wirings/workflow/graph/workflow-graph.types.js';
|
|
6
|
+
export { buildRunTimeline, reconstructFinalState, reconstructStateAt, } from '../wirings/workflow/run-timeline.js';
|
|
7
|
+
export type { ReconstructedRunState, RunTimeline, } from '../wirings/workflow/run-timeline.js';
|
|
8
|
+
export { assertWorkflowRunOwner } from '../wirings/workflow/workflow-run-ownership.js';
|
|
9
|
+
export type { ContextVariable, CoreWorkflow, StepState, StepStatus, WorkflowContext, WorkflowPlannedStep, WorkflowQueueOptions, WorkflowRun, WorkflowRunMirror, WorkflowRunService, WorkflowRunStatus, WorkflowRunWire, WorkflowStatus, WorkflowVersionStatus, WorkflowsMeta, WorkflowsRuntimeMeta, } from '../wirings/workflow/workflow.types.js';
|
|
10
|
+
/**
|
|
11
|
+
* Types the exports above mention but do not themselves export. Without
|
|
12
|
+
* them a consumer's declaration emit has no name for the type it infers,
|
|
13
|
+
* and fails with TS2883 rather than reaching for the original entry point.
|
|
14
|
+
*/
|
|
15
|
+
export type { CoreUserSession } from '../types/core.types.js';
|
|
16
|
+
export type { TemplateString } from '../wirings/workflow/graph/template.js';
|
|
17
|
+
export type { RefValue } from '../wirings/workflow/graph/workflow-graph.types.js';
|
|
18
|
+
export type { HistoryEntry } from '../wirings/workflow/run-timeline.js';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { template } from '../wirings/workflow/graph/template.js';
|
|
2
|
+
export { isRef } from '../wirings/workflow/graph/workflow-graph.types.js';
|
|
3
|
+
export { buildRunTimeline, reconstructFinalState, reconstructStateAt, } from '../wirings/workflow/run-timeline.js';
|
|
4
|
+
export { assertWorkflowRunOwner } from '../wirings/workflow/workflow-run-ownership.js';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module @pikku/core
|
|
3
3
|
*/
|
|
4
|
-
export type { AuthInstance, CommonWireMeta, CoreConfig, CorePikkuMiddleware, CorePikkuMiddlewareConfig, CorePikkuMiddlewareFactory, CorePikkuMiddlewareGroup, CoreServices, CoreSecretlessSingletonServices, CoreSingletonServices, CoreUserSession, SecretlessServices, CreateConfig, ServerLifecycle, FunctionMeta, FunctionServicesMeta, FunctionWiresMeta, FunctionsMeta, FunctionsRuntimeMeta, JSONValue, MakeRequired, MiddlewareMetadata, MiddlewarePriority, PermissionMetadata, PickOptional, PickRequired,
|
|
5
|
-
export {
|
|
4
|
+
export type { AuthInstance, CommonWireMeta, CoreConfig, CorePikkuMiddleware, CorePikkuMiddlewareConfig, CorePikkuMiddlewareFactory, CorePikkuMiddlewareGroup, CoreServices, CoreSecretlessSingletonServices, CoreSingletonServices, CoreUserSession, SecretlessServices, CreateConfig, ServerLifecycle, FunctionMeta, FunctionServicesMeta, FunctionWiresMeta, FunctionsMeta, FunctionsRuntimeMeta, JSONValue, MakeRequired, MiddlewareMetadata, MiddlewarePriority, PermissionMetadata, PickOptional, PickRequired, PikkuAgentMiddlewareHooks, PikkuWire, PikkuRawWire, PikkuWiringTypes, PostgresConfig, RequireAtLeastOne, SecurityAuditIssue, SecurityAuditReport, SecurityAuditSummary, SecurityAuditUpdate, SecuritySeverity, SecurityUpdateLevel, SerializedError, } from './types/core.types.js';
|
|
5
|
+
export { pikkuAgentMiddleware, pikkuChannelMiddleware, pikkuChannelMiddlewareFactory, pikkuMiddleware, pikkuMiddlewareFactory, } from './types/core.types.js';
|
|
6
6
|
export type { CorePikkuAuth, CorePikkuAuthConfig, CorePikkuFunction, CorePikkuFunctionConfig, CorePikkuPermission, CorePikkuPermissionConfig, CorePikkuPermissionFactory, CorePikkuApprovalDescription, CorePermissionGroup, } from './function/functions.types.js';
|
|
7
7
|
export { pikkuAuth, pikkuPermission, pikkuPermissionFactory, pikkuApprovalDescription, } from './function/functions.types.js';
|
|
8
8
|
export { getAllFunctionNames } from './function/index.js';
|
|
9
|
-
export type { ListInput, ListOutput, Filter
|
|
9
|
+
export type { ListInput, ListOutput, Filter } from './function/list.types.js';
|
|
10
10
|
export { pikkuCLIRender } from './wirings/cli/cli-runner.js';
|
|
11
11
|
export { PikkuRequest } from './pikku-request.js';
|
|
12
12
|
export { getRelativeTimeOffsetFromNow, parseDurationString, } from './time-utils.js';
|
|
13
13
|
export type { RelativeTimeInput } from './time-utils.js';
|
|
14
14
|
export { formatVersionedId, isVersionedId, parseVersionedId, } from './version.js';
|
|
15
|
-
export { AbandonedError, type AbortScope
|
|
15
|
+
export { AbandonedError, type AbortScope } from './function/abort-scope.js';
|
|
16
16
|
export { fetch } from './wirings/http/http-runner.js';
|
|
17
17
|
export type { MCPToolResponse, MCPResourceResponse, MCPPromptResponse, } from './wirings/mcp/mcp.types.js';
|
|
18
18
|
export { AIProviderAuthError, AIProviderNotConfiguredError, BadGatewayError, BadRequestError, ConflictError, ExpectationFailedError, ForbiddenError, GatewayTimeoutError, GoneError, HTTPVersionNotSupportedError, InternalServerError, InvalidMiddlewareWireError, InvalidOriginError, InvalidSessionError, LengthRequiredError, LocalEnvironmentOnlyError, LockedError, MaxComputeTimeReachedError, MethodNotAllowedError, MissingCredentialError, MissingSchemaError, MissingScopeError, MissingServiceError, MissingSessionError, NotAcceptableError, NotFoundError, NotImplementedError, PayloadTooLargeError, PaymentRequiredError, PikkuMissingMetaError, PreconditionFailedError, ProxyAuthenticationRequiredError, RangeNotSatisfiableError, ReadonlySessionError, RequestTimeoutError, ServiceUnavailableError, TooManyRequestsError, URITooLongError, UnauthorizedError, UnprocessableContentError, UnsupportedMediaTypeError, } from './errors/errors.js';
|
|
@@ -34,10 +34,10 @@ export type { SchemaService } from './services/schema-service.js';
|
|
|
34
34
|
export type { SessionService } from './services/user-session-service.js';
|
|
35
35
|
export { NoopAuditService, createInvocationAudit, } from './services/audit-service.js';
|
|
36
36
|
export type { AuditConfig, AuditDurability, AuditEvent, AuditEventBatch, AuditFacets, AuditLog, AuditQuery, AuditQueryResult, AuditService, AuditUserIdentity, ResolvedAuditConfig, } from './services/audit-service.js';
|
|
37
|
-
export type {
|
|
37
|
+
export type { AgentRunnerService } from './services/agent-runner-service.js';
|
|
38
38
|
export type { AIEmbeddingService } from './services/ai-embedding-service.js';
|
|
39
|
-
export type {
|
|
40
|
-
export type {
|
|
39
|
+
export type { AgentRunStateService } from './services/agent-run-state-service.js';
|
|
40
|
+
export type { AgentStorageService } from './services/agent-storage-service.js';
|
|
41
41
|
export type { EmailsMeta, EmailTemplateMeta, MetaService, } from './services/meta-service.js';
|
|
42
42
|
export type { HTTPMethod } from './wirings/http/http.types.js';
|
|
43
43
|
export type { GraphNodeConfig } from './wirings/workflow/graph/workflow-graph.types.js';
|
|
@@ -55,6 +55,6 @@ export { clearPikkuRuntimeState } from './test-utils.js';
|
|
|
55
55
|
export { type ScheduledTaskInfo, type ScheduledTaskSummary, } from './services/scheduler-service.js';
|
|
56
56
|
export { SchedulerService } from './services/scheduler-service.js';
|
|
57
57
|
export type { Private, Pii, Secret, Classification, AnonymizeStrategy, ClassificationManifest, ColumnForm, WrappedValue, SealedValue, HashedValue, } from './data-classification.js';
|
|
58
|
-
export { hashToken
|
|
58
|
+
export { hashToken } from './column-form.js';
|
|
59
59
|
export type { SecretValue, Safe } from './secret-value.js';
|
|
60
60
|
export { createSecretValue, isSecretValue, SecretCoercionError, REDACTED, } from './secret-value.js';
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { pikkuAgentMiddleware, pikkuChannelMiddleware, pikkuChannelMiddlewareFactory, pikkuMiddleware, pikkuMiddlewareFactory, } from './types/core.types.js';
|
|
2
2
|
export { pikkuAuth, pikkuPermission, pikkuPermissionFactory, pikkuApprovalDescription, } from './function/functions.types.js';
|
|
3
3
|
export { getAllFunctionNames } from './function/index.js';
|
|
4
4
|
export { pikkuCLIRender } from './wirings/cli/cli-runner.js';
|
|
5
5
|
export { PikkuRequest } from './pikku-request.js';
|
|
6
6
|
export { getRelativeTimeOffsetFromNow, parseDurationString, } from './time-utils.js';
|
|
7
7
|
export { formatVersionedId, isVersionedId, parseVersionedId, } from './version.js';
|
|
8
|
-
export { AbandonedError
|
|
8
|
+
export { AbandonedError } from './function/abort-scope.js';
|
|
9
9
|
export { fetch } from './wirings/http/http-runner.js';
|
|
10
10
|
export { AIProviderAuthError, AIProviderNotConfiguredError, BadGatewayError, BadRequestError, ConflictError, ExpectationFailedError, ForbiddenError, GatewayTimeoutError, GoneError, HTTPVersionNotSupportedError, InternalServerError, InvalidMiddlewareWireError, InvalidOriginError, InvalidSessionError, LengthRequiredError, LocalEnvironmentOnlyError, LockedError, MaxComputeTimeReachedError, MethodNotAllowedError, MissingCredentialError, MissingSchemaError, MissingScopeError, MissingServiceError, MissingSessionError, NotAcceptableError, NotFoundError, NotImplementedError, PayloadTooLargeError, PaymentRequiredError, PikkuMissingMetaError, PreconditionFailedError, ProxyAuthenticationRequiredError, RangeNotSatisfiableError, ReadonlySessionError, RequestTimeoutError, ServiceUnavailableError, TooManyRequestsError, URITooLongError, UnauthorizedError, UnprocessableContentError, UnsupportedMediaTypeError, } from './errors/errors.js';
|
|
11
11
|
export { PikkuError, isExpectedError } from './errors/error-handler.js';
|
|
@@ -21,5 +21,5 @@ export { hasScopes, verifyScopes } from './scopes.js';
|
|
|
21
21
|
export { isSerializable, stopSingletonServices, pikkuServerLifecycle, } from './utils.js';
|
|
22
22
|
export { clearPikkuRuntimeState } from './test-utils.js';
|
|
23
23
|
export { SchedulerService } from './services/scheduler-service.js';
|
|
24
|
-
export { hashToken
|
|
24
|
+
export { hashToken } from './column-form.js';
|
|
25
25
|
export { createSecretValue, isSecretValue, SecretCoercionError, REDACTED, } from './secret-value.js';
|
|
@@ -5,7 +5,7 @@ export declare const authAPIKey: import("../types/core.types.js").CorePikkuMiddl
|
|
|
5
5
|
secrets?: {
|
|
6
6
|
requireAllowedHosts?: boolean;
|
|
7
7
|
};
|
|
8
|
-
workflow?: import("../
|
|
8
|
+
workflow?: import("../ecosystem/agent.js").WorkflowServiceConfig;
|
|
9
9
|
webhook?: import("../services/webhook-service.js").WebhookServiceConfig;
|
|
10
10
|
postgres?: import("../types/core.types.js").PostgresConfig;
|
|
11
11
|
}>, import("../types/core.types.js").CoreUserSession>;
|
|
@@ -17,7 +17,7 @@ export declare const authBearer: import("../types/core.types.js").CorePikkuMiddl
|
|
|
17
17
|
secrets?: {
|
|
18
18
|
requireAllowedHosts?: boolean;
|
|
19
19
|
};
|
|
20
|
-
workflow?: import("../
|
|
20
|
+
workflow?: import("../ecosystem/agent.js").WorkflowServiceConfig;
|
|
21
21
|
webhook?: import("../services/webhook-service.js").WebhookServiceConfig;
|
|
22
22
|
postgres?: import("../types/core.types.js").PostgresConfig;
|
|
23
23
|
}>, CoreUserSession>;
|
|
@@ -9,7 +9,7 @@ export declare const authCookie: import("../types/core.types.js").CorePikkuMiddl
|
|
|
9
9
|
secrets?: {
|
|
10
10
|
requireAllowedHosts?: boolean;
|
|
11
11
|
};
|
|
12
|
-
workflow?: import("../
|
|
12
|
+
workflow?: import("../ecosystem/agent.js").WorkflowServiceConfig;
|
|
13
13
|
webhook?: import("../services/webhook-service.js").WebhookServiceConfig;
|
|
14
14
|
postgres?: import("../types/core.types.js").PostgresConfig;
|
|
15
15
|
}>, import("../types/core.types.js").CoreUserSession>;
|
|
@@ -15,7 +15,7 @@ export declare const cors: import("../types/core.types.js").CorePikkuMiddlewareF
|
|
|
15
15
|
secrets?: {
|
|
16
16
|
requireAllowedHosts?: boolean;
|
|
17
17
|
};
|
|
18
|
-
workflow?: import("../
|
|
18
|
+
workflow?: import("../ecosystem/agent.js").WorkflowServiceConfig;
|
|
19
19
|
webhook?: import("../services/webhook-service.js").WebhookServiceConfig;
|
|
20
20
|
postgres?: import("../types/core.types.js").PostgresConfig;
|
|
21
21
|
}>, import("../types/core.types.js").CoreUserSession>;
|
|
@@ -3,7 +3,7 @@ export declare const pikkuRemoteAuthMiddleware: import("../types/core.types.js")
|
|
|
3
3
|
secrets?: {
|
|
4
4
|
requireAllowedHosts?: boolean;
|
|
5
5
|
};
|
|
6
|
-
workflow?: import("../
|
|
6
|
+
workflow?: import("../ecosystem/agent.js").WorkflowServiceConfig;
|
|
7
7
|
webhook?: import("../services/webhook-service.js").WebhookServiceConfig;
|
|
8
8
|
postgres?: import("../types/core.types.js").PostgresConfig;
|
|
9
9
|
}>, import("../types/core.types.js").CoreUserSession>;
|
|
@@ -7,7 +7,7 @@ export declare const telemetryOuter: import("../types/core.types.js").CorePikkuM
|
|
|
7
7
|
secrets?: {
|
|
8
8
|
requireAllowedHosts?: boolean;
|
|
9
9
|
};
|
|
10
|
-
workflow?: import("../
|
|
10
|
+
workflow?: import("../ecosystem/agent.js").WorkflowServiceConfig;
|
|
11
11
|
webhook?: import("../services/webhook-service.js").WebhookServiceConfig;
|
|
12
12
|
postgres?: import("../types/core.types.js").PostgresConfig;
|
|
13
13
|
}>, import("../types/core.types.js").CoreUserSession>;
|
|
@@ -20,7 +20,7 @@ export declare const telemetryInner: import("../types/core.types.js").CorePikkuM
|
|
|
20
20
|
secrets?: {
|
|
21
21
|
requireAllowedHosts?: boolean;
|
|
22
22
|
};
|
|
23
|
-
workflow?: import("../
|
|
23
|
+
workflow?: import("../ecosystem/agent.js").WorkflowServiceConfig;
|
|
24
24
|
webhook?: import("../services/webhook-service.js").WebhookServiceConfig;
|
|
25
25
|
postgres?: import("../types/core.types.js").PostgresConfig;
|
|
26
26
|
}>, import("../types/core.types.js").CoreUserSession>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { AgentRunState, PendingApproval } from '../wirings/agent/agent.types.js';
|
|
2
|
+
import type { AgentRunScore } from '../wirings/agent-scorer/agent-scorer.types.js';
|
|
3
|
+
export type CreateRunInput = Omit<AgentRunState, 'runId'>;
|
|
4
|
+
export type SaveScoreInput = Omit<AgentRunScore, 'createdAt'>;
|
|
5
|
+
export interface AgentRunStateService {
|
|
6
|
+
createRun(run: CreateRunInput): Promise<string>;
|
|
7
|
+
updateRun(runId: string, updates: Partial<AgentRunState>): Promise<void>;
|
|
8
|
+
getRun(runId: string): Promise<AgentRunState | null>;
|
|
9
|
+
getRunsByThread(threadId: string): Promise<AgentRunState[]>;
|
|
10
|
+
/**
|
|
11
|
+
* Claims an approval: removes it from the run's pending list and records the
|
|
12
|
+
* decision, as one atomic step. Returns whether THIS caller made the claim —
|
|
13
|
+
* concurrent approvals of the same tool call produce exactly one `true`, and
|
|
14
|
+
* only that caller may run the tool.
|
|
15
|
+
*/
|
|
16
|
+
resolveApproval(toolCallId: string, status: 'approved' | 'denied'): Promise<boolean>;
|
|
17
|
+
findRunByToolCallId(toolCallId: string): Promise<{
|
|
18
|
+
run: AgentRunState;
|
|
19
|
+
approval: PendingApproval;
|
|
20
|
+
} | null>;
|
|
21
|
+
/**
|
|
22
|
+
* Record one scorer's grade of a finished run. A run accumulates one row per
|
|
23
|
+
* scorer, and a scorer may grade the same run more than once — a retried job
|
|
24
|
+
* appends rather than replaces, so a re-grade never silently overwrites the
|
|
25
|
+
* grade that was acted on.
|
|
26
|
+
*/
|
|
27
|
+
saveScore(score: SaveScoreInput): Promise<void>;
|
|
28
|
+
getScores(runId: string): Promise<AgentRunScore[]>;
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import type { AgentMessage, AgentStep, AgentToolDef, AgentStreamChannel } from '../wirings/agent/agent.types.js';
|
|
2
|
+
export type AIProviderOptions = Record<string, Record<string, unknown>>;
|
|
3
|
+
export type AgentRunnerParams = {
|
|
4
|
+
model: string;
|
|
5
|
+
temperature?: number;
|
|
6
|
+
instructions: string;
|
|
7
|
+
messages: AgentMessage[];
|
|
8
|
+
tools: AgentToolDef[];
|
|
9
|
+
maxSteps: number;
|
|
10
|
+
toolChoice: 'auto' | 'required' | 'none';
|
|
11
|
+
outputSchema?: Record<string, unknown>;
|
|
12
|
+
/** Pikku agent function name — forwarded to the LLM proxy (LiteLLM) as
|
|
13
|
+
* request-level metadata so usage can be broken down per agent. */
|
|
14
|
+
agentId?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Cancels the model call itself, not just delivery of its output. Set by
|
|
17
|
+
* `streamAgent` from the run's interrupt handle so a voice barge-in stops
|
|
18
|
+
* generation upstream rather than leaving tokens being billed into a stream
|
|
19
|
+
* nobody reads. A runner that ignores it degrades to "the caller stops
|
|
20
|
+
* listening", which is the behaviour before this field existed.
|
|
21
|
+
*/
|
|
22
|
+
abortSignal?: AbortSignal;
|
|
23
|
+
/**
|
|
24
|
+
* Per-provider settings passed to the model untouched — the escape hatch for
|
|
25
|
+
* anything the shared params above cannot express because only one vendor
|
|
26
|
+
* has it.
|
|
27
|
+
*
|
|
28
|
+
* The setting that motivated it is `reasoningEffort`. A voice turn is heard
|
|
29
|
+
* rather than read, so the wait before the first word is most of the
|
|
30
|
+
* experience: `{ openai: { reasoningEffort: 'minimal' } }` on gpt-5-mini
|
|
31
|
+
* measured 0.9s to first token against 2.5s at the default, and 1.6s of
|
|
32
|
+
* silence is a long time to sit through having just finished speaking.
|
|
33
|
+
*/
|
|
34
|
+
providerOptions?: AIProviderOptions;
|
|
35
|
+
};
|
|
36
|
+
export type AgentRunnerResult = {
|
|
37
|
+
text: string;
|
|
38
|
+
object?: unknown;
|
|
39
|
+
steps: AgentStep[];
|
|
40
|
+
usage: {
|
|
41
|
+
inputTokens: number;
|
|
42
|
+
outputTokens: number;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
export type AgentStepResult = {
|
|
46
|
+
text: string;
|
|
47
|
+
object?: unknown;
|
|
48
|
+
toolCalls: {
|
|
49
|
+
toolCallId: string;
|
|
50
|
+
toolName: string;
|
|
51
|
+
args: unknown;
|
|
52
|
+
}[];
|
|
53
|
+
toolResults: {
|
|
54
|
+
toolCallId: string;
|
|
55
|
+
toolName: string;
|
|
56
|
+
result: unknown;
|
|
57
|
+
/**
|
|
58
|
+
* Set when the tool threw rather than returned. Carried as its own field
|
|
59
|
+
* because `result` is a rendered string by the time anything downstream
|
|
60
|
+
* reads it, and "did this tool fail" is not answerable by looking for an
|
|
61
|
+
* `Error:` prefix in text a tool could legitimately have returned.
|
|
62
|
+
*/
|
|
63
|
+
error?: string;
|
|
64
|
+
}[];
|
|
65
|
+
usage: {
|
|
66
|
+
inputTokens: number;
|
|
67
|
+
outputTokens: number;
|
|
68
|
+
};
|
|
69
|
+
finishReason: 'stop' | 'tool-calls' | 'length' | 'error' | 'unknown';
|
|
70
|
+
reasoningContent?: string;
|
|
71
|
+
};
|
|
72
|
+
export type AITranscriptionParams = {
|
|
73
|
+
model: string;
|
|
74
|
+
audio: Uint8Array;
|
|
75
|
+
providerOptions?: AIProviderOptions;
|
|
76
|
+
maxRetries?: number;
|
|
77
|
+
abortSignal?: AbortSignal;
|
|
78
|
+
headers?: Record<string, string>;
|
|
79
|
+
};
|
|
80
|
+
export type AITranscriptionResult = {
|
|
81
|
+
text: string;
|
|
82
|
+
segments?: Array<{
|
|
83
|
+
text: string;
|
|
84
|
+
startSecond: number;
|
|
85
|
+
endSecond: number;
|
|
86
|
+
}>;
|
|
87
|
+
language?: string;
|
|
88
|
+
durationInSeconds?: number;
|
|
89
|
+
warnings?: unknown[];
|
|
90
|
+
providerMetadata?: Record<string, unknown>;
|
|
91
|
+
responses?: unknown[];
|
|
92
|
+
};
|
|
93
|
+
export type AIGenerateSpeechParams = {
|
|
94
|
+
model: string;
|
|
95
|
+
text: string;
|
|
96
|
+
voice?: string;
|
|
97
|
+
outputFormat?: string;
|
|
98
|
+
instructions?: string;
|
|
99
|
+
speed?: number;
|
|
100
|
+
language?: string;
|
|
101
|
+
providerOptions?: AIProviderOptions;
|
|
102
|
+
maxRetries?: number;
|
|
103
|
+
abortSignal?: AbortSignal;
|
|
104
|
+
headers?: Record<string, string>;
|
|
105
|
+
};
|
|
106
|
+
export type AIGenerateSpeechResult = {
|
|
107
|
+
audio: {
|
|
108
|
+
uint8Array: Uint8Array;
|
|
109
|
+
base64: string;
|
|
110
|
+
mediaType: string;
|
|
111
|
+
format: string;
|
|
112
|
+
};
|
|
113
|
+
warnings?: unknown[];
|
|
114
|
+
providerMetadata?: Record<string, unknown>;
|
|
115
|
+
responses?: unknown[];
|
|
116
|
+
};
|
|
117
|
+
export type AIGenerateImagePrompt = string | {
|
|
118
|
+
images: Array<Uint8Array | ArrayBuffer | string>;
|
|
119
|
+
text?: string;
|
|
120
|
+
mask?: Uint8Array | ArrayBuffer | string;
|
|
121
|
+
};
|
|
122
|
+
export type AIGenerateImageParams = {
|
|
123
|
+
model: string;
|
|
124
|
+
prompt: AIGenerateImagePrompt;
|
|
125
|
+
n?: number;
|
|
126
|
+
maxImagesPerCall?: number;
|
|
127
|
+
size?: `${number}x${number}`;
|
|
128
|
+
aspectRatio?: `${number}:${number}`;
|
|
129
|
+
seed?: number;
|
|
130
|
+
providerOptions?: AIProviderOptions;
|
|
131
|
+
maxRetries?: number;
|
|
132
|
+
abortSignal?: AbortSignal;
|
|
133
|
+
headers?: Record<string, string>;
|
|
134
|
+
};
|
|
135
|
+
export type AIGenerateImageResult = {
|
|
136
|
+
images: Array<{
|
|
137
|
+
uint8Array: Uint8Array;
|
|
138
|
+
base64: string;
|
|
139
|
+
mediaType: string;
|
|
140
|
+
}>;
|
|
141
|
+
warnings?: unknown[];
|
|
142
|
+
providerMetadata?: Record<string, unknown>;
|
|
143
|
+
responses?: unknown[];
|
|
144
|
+
usage?: {
|
|
145
|
+
inputTokens?: number;
|
|
146
|
+
outputTokens?: number;
|
|
147
|
+
totalTokens?: number;
|
|
148
|
+
};
|
|
149
|
+
};
|
|
150
|
+
export type AIEmbedParams = {
|
|
151
|
+
model: string;
|
|
152
|
+
value: string;
|
|
153
|
+
providerOptions?: AIProviderOptions;
|
|
154
|
+
maxRetries?: number;
|
|
155
|
+
abortSignal?: AbortSignal;
|
|
156
|
+
headers?: Record<string, string>;
|
|
157
|
+
};
|
|
158
|
+
export type AIEmbedResult = {
|
|
159
|
+
value: string;
|
|
160
|
+
embedding: number[];
|
|
161
|
+
usage?: {
|
|
162
|
+
tokens?: number;
|
|
163
|
+
};
|
|
164
|
+
warnings?: unknown[];
|
|
165
|
+
providerMetadata?: Record<string, unknown>;
|
|
166
|
+
response?: unknown;
|
|
167
|
+
};
|
|
168
|
+
export type AIEmbedManyParams = {
|
|
169
|
+
model: string;
|
|
170
|
+
values: string[];
|
|
171
|
+
providerOptions?: AIProviderOptions;
|
|
172
|
+
maxRetries?: number;
|
|
173
|
+
abortSignal?: AbortSignal;
|
|
174
|
+
headers?: Record<string, string>;
|
|
175
|
+
maxParallelCalls?: number;
|
|
176
|
+
};
|
|
177
|
+
export type AIEmbedManyResult = {
|
|
178
|
+
values: string[];
|
|
179
|
+
embeddings: number[][];
|
|
180
|
+
usage?: {
|
|
181
|
+
tokens?: number;
|
|
182
|
+
};
|
|
183
|
+
warnings?: unknown[];
|
|
184
|
+
providerMetadata?: Record<string, unknown>;
|
|
185
|
+
responses?: unknown[];
|
|
186
|
+
};
|
|
187
|
+
export type AIRerankParams<VALUE extends string | Record<string, unknown>> = {
|
|
188
|
+
model: string;
|
|
189
|
+
query: string;
|
|
190
|
+
documents: VALUE[];
|
|
191
|
+
topK?: number;
|
|
192
|
+
providerOptions?: AIProviderOptions;
|
|
193
|
+
maxRetries?: number;
|
|
194
|
+
abortSignal?: AbortSignal;
|
|
195
|
+
headers?: Record<string, string>;
|
|
196
|
+
};
|
|
197
|
+
export type AIRerankResult<VALUE extends string | Record<string, unknown>> = {
|
|
198
|
+
ranking: Array<{
|
|
199
|
+
index: number;
|
|
200
|
+
document: VALUE;
|
|
201
|
+
score: number;
|
|
202
|
+
}>;
|
|
203
|
+
rerankedDocuments: VALUE[];
|
|
204
|
+
originalDocuments: VALUE[];
|
|
205
|
+
providerMetadata?: Record<string, unknown>;
|
|
206
|
+
response?: unknown;
|
|
207
|
+
};
|
|
208
|
+
export interface AgentRunnerService {
|
|
209
|
+
stream(params: AgentRunnerParams, channel: AgentStreamChannel): Promise<AgentStepResult>;
|
|
210
|
+
run(params: AgentRunnerParams): Promise<AgentStepResult>;
|
|
211
|
+
transcribe?(params: AITranscriptionParams): Promise<AITranscriptionResult>;
|
|
212
|
+
generateSpeech?(params: AIGenerateSpeechParams): Promise<AIGenerateSpeechResult>;
|
|
213
|
+
generateImage?(params: AIGenerateImageParams): Promise<AIGenerateImageResult>;
|
|
214
|
+
embed?(params: AIEmbedParams): Promise<AIEmbedResult>;
|
|
215
|
+
embedMany?(params: AIEmbedManyParams): Promise<AIEmbedManyResult>;
|
|
216
|
+
rerank?<VALUE extends string | Record<string, unknown>>(params: AIRerankParams<VALUE>): Promise<AIRerankResult<VALUE>>;
|
|
217
|
+
/** Return a new runner that uses the given API key for every LLM call.
|
|
218
|
+
* Optional — runners that don't support per-key scoping leave this undefined. */
|
|
219
|
+
withApiKey?(apiKey: string): AgentRunnerService;
|
|
220
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { AgentThread, AgentMessage } from '../wirings/agent/agent.types.js';
|
|
2
|
+
export interface AgentStorageService {
|
|
3
|
+
createThread(resourceId: string, options?: {
|
|
4
|
+
threadId?: string;
|
|
5
|
+
title?: string;
|
|
6
|
+
metadata?: Record<string, unknown>;
|
|
7
|
+
}): Promise<AgentThread>;
|
|
8
|
+
getThread(threadId: string): Promise<AgentThread>;
|
|
9
|
+
getThreads(resourceId: string): Promise<AgentThread[]>;
|
|
10
|
+
deleteThread(threadId: string): Promise<void>;
|
|
11
|
+
getMessages(threadId: string, options?: {
|
|
12
|
+
lastN?: number;
|
|
13
|
+
cursor?: string;
|
|
14
|
+
}): Promise<AgentMessage[]>;
|
|
15
|
+
saveMessages(threadId: string, messages: AgentMessage[]): Promise<void>;
|
|
16
|
+
getWorkingMemory(id: string, scope: 'resource' | 'thread'): Promise<Record<string, unknown> | null>;
|
|
17
|
+
saveWorkingMemory(id: string, scope: 'resource' | 'thread', data: Record<string, unknown>): Promise<void>;
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -24,7 +24,7 @@ export interface HttpPersonasConfig {
|
|
|
24
24
|
/**
|
|
25
25
|
* Default model a persona thinks with when `converse(...)` is called without
|
|
26
26
|
* an explicit `model`. Its own turns/approvals/evaluation run in-process via
|
|
27
|
-
* the configured `
|
|
27
|
+
* the configured `agentRunner`.
|
|
28
28
|
*/
|
|
29
29
|
model?: string;
|
|
30
30
|
}
|
|
@@ -53,8 +53,8 @@ export class HttpPersona {
|
|
|
53
53
|
return readScenarioHttpResponse(res);
|
|
54
54
|
}
|
|
55
55
|
async converse(options) {
|
|
56
|
-
const {
|
|
57
|
-
if (!
|
|
56
|
+
const { agentRunner } = getSingletonServices();
|
|
57
|
+
if (!agentRunner) {
|
|
58
58
|
throw new AIProviderNotConfiguredError();
|
|
59
59
|
}
|
|
60
60
|
const model = options.model ?? this.config.model;
|
|
@@ -72,7 +72,7 @@ export class HttpPersona {
|
|
|
72
72
|
approvals: options.approvals,
|
|
73
73
|
model,
|
|
74
74
|
maxTurns: options.maxTurns,
|
|
75
|
-
llm: (params) =>
|
|
75
|
+
llm: (params) => agentRunner.run(params),
|
|
76
76
|
target: {
|
|
77
77
|
run: (message) => this.agentRun(options.agent, message, threadId, resourceId),
|
|
78
78
|
approve: (runId, decisions) => this.agentApprove(options.agent, runId, decisions),
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { AgentRunStateService, CreateRunInput, SaveScoreInput } from './agent-run-state-service.js';
|
|
2
|
+
import type { AgentRunState, PendingApproval } from '../wirings/agent/agent.types.js';
|
|
3
|
+
import type { AgentRunScore } from '../wirings/agent-scorer/agent-scorer.types.js';
|
|
4
|
+
export declare class InMemoryAgentRunStateService implements AgentRunStateService {
|
|
5
|
+
private runs;
|
|
6
|
+
private scores;
|
|
7
|
+
private counter;
|
|
8
|
+
createRun(run: CreateRunInput): Promise<string>;
|
|
9
|
+
updateRun(runId: string, updates: Partial<AgentRunState>): Promise<void>;
|
|
10
|
+
getRun(runId: string): Promise<AgentRunState | null>;
|
|
11
|
+
getRunsByThread(threadId: string): Promise<AgentRunState[]>;
|
|
12
|
+
resolveApproval(toolCallId: string, status: 'approved' | 'denied'): Promise<boolean>;
|
|
13
|
+
findRunByToolCallId(toolCallId: string): Promise<{
|
|
14
|
+
run: AgentRunState;
|
|
15
|
+
approval: PendingApproval;
|
|
16
|
+
} | null>;
|
|
17
|
+
saveScore(score: SaveScoreInput): Promise<void>;
|
|
18
|
+
getScores(runId: string): Promise<AgentRunScore[]>;
|
|
19
|
+
}
|