@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
package/src/public-surface.json
CHANGED
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"isVersionedId",
|
|
71
71
|
"parseDurationString",
|
|
72
72
|
"parseVersionedId",
|
|
73
|
-
"
|
|
73
|
+
"pikkuAgentMiddleware",
|
|
74
74
|
"pikkuApprovalDescription",
|
|
75
75
|
"pikkuAuth",
|
|
76
76
|
"pikkuCLIRender",
|
|
@@ -127,7 +127,6 @@
|
|
|
127
127
|
"./workflow": [
|
|
128
128
|
"DEFAULT_STEP_RETRIES",
|
|
129
129
|
"PikkuWorkflowService",
|
|
130
|
-
"SCENARIO_SURFACES",
|
|
131
130
|
"WorkflowApprovalForbiddenError",
|
|
132
131
|
"WorkflowApprovalResolvedError",
|
|
133
132
|
"WorkflowCancelledException",
|
|
@@ -137,35 +136,36 @@
|
|
|
137
136
|
"WorkflowRunNotFoundError",
|
|
138
137
|
"WorkflowStepFunctionMismatchError",
|
|
139
138
|
"WorkflowSuspendedException",
|
|
140
|
-
"addFeature",
|
|
141
139
|
"addWorkflow",
|
|
142
140
|
"assertWorkflowRunOwner",
|
|
143
141
|
"buildRunTimeline",
|
|
144
|
-
"composeStepProse",
|
|
145
|
-
"createCookieJar",
|
|
146
142
|
"deriveInvocationId",
|
|
147
143
|
"isRef",
|
|
148
144
|
"pikkuWorkflowGraph",
|
|
149
|
-
"pollUntil",
|
|
150
145
|
"reconstructFinalState",
|
|
151
146
|
"reconstructStateAt",
|
|
152
|
-
"renderStepTemplate",
|
|
153
|
-
"requireActor",
|
|
154
|
-
"requireScenarioEnv",
|
|
155
|
-
"resolveFeatureScenarios",
|
|
156
|
-
"resolveScenarioSurfaces",
|
|
157
147
|
"template",
|
|
158
148
|
"uuidv5"
|
|
159
149
|
],
|
|
160
150
|
"./scenario": [
|
|
161
151
|
"PikkuScenarioService",
|
|
152
|
+
"SCENARIO_SURFACES",
|
|
162
153
|
"ScenarioBrowserActorRequired",
|
|
163
154
|
"ScenarioBrowserUnavailable",
|
|
164
155
|
"ScenarioHookError",
|
|
165
156
|
"ScenarioNoSurfaceBinding",
|
|
166
157
|
"ScenarioNoWitness",
|
|
167
158
|
"ScenarioWitnessDisagreement",
|
|
168
|
-
"
|
|
159
|
+
"addFeature",
|
|
160
|
+
"composeStepProse",
|
|
161
|
+
"createCookieJar",
|
|
162
|
+
"createScenarioRunner",
|
|
163
|
+
"pollUntil",
|
|
164
|
+
"renderStepTemplate",
|
|
165
|
+
"requireActor",
|
|
166
|
+
"requireScenarioEnv",
|
|
167
|
+
"resolveFeatureScenarios",
|
|
168
|
+
"resolveScenarioSurfaces"
|
|
169
169
|
],
|
|
170
170
|
"./workflow/timeline": [
|
|
171
171
|
"buildRunTimeline",
|
|
@@ -173,9 +173,7 @@
|
|
|
173
173
|
"reconstructStateAt"
|
|
174
174
|
],
|
|
175
175
|
"./workflow/types": [],
|
|
176
|
-
"./actor-flow": [
|
|
177
|
-
"runConversation"
|
|
178
|
-
],
|
|
176
|
+
"./actor-flow": ["runConversation"],
|
|
179
177
|
"./virtual-user": [
|
|
180
178
|
"DISPOSITIONS",
|
|
181
179
|
"IntentStack",
|
|
@@ -218,9 +216,7 @@
|
|
|
218
216
|
"wireHTTP",
|
|
219
217
|
"wireHTTPRoutes"
|
|
220
218
|
],
|
|
221
|
-
"./remote": [
|
|
222
|
-
"buildRemoteHeaders"
|
|
223
|
-
],
|
|
219
|
+
"./remote": ["buildRemoteHeaders"],
|
|
224
220
|
"./queue": [
|
|
225
221
|
"QueueJobDiscardedError",
|
|
226
222
|
"QueueJobFailedError",
|
|
@@ -235,11 +231,7 @@
|
|
|
235
231
|
"runScheduledTask",
|
|
236
232
|
"wireScheduler"
|
|
237
233
|
],
|
|
238
|
-
"./trigger": [
|
|
239
|
-
"PikkuTriggerService",
|
|
240
|
-
"wireTrigger",
|
|
241
|
-
"wireTriggerSource"
|
|
242
|
-
],
|
|
234
|
+
"./trigger": ["PikkuTriggerService", "wireTrigger", "wireTriggerSource"],
|
|
243
235
|
"./rpc": [
|
|
244
236
|
"PikkuRPCService",
|
|
245
237
|
"RPCNotFoundError",
|
|
@@ -257,10 +249,7 @@
|
|
|
257
249
|
"safeFetch",
|
|
258
250
|
"setDefaultHostResolver"
|
|
259
251
|
],
|
|
260
|
-
"./node-host-resolver": [
|
|
261
|
-
"installNodeHostResolver",
|
|
262
|
-
"nodeHostResolver"
|
|
263
|
-
],
|
|
252
|
+
"./node-host-resolver": ["installNodeHostResolver", "nodeHostResolver"],
|
|
264
253
|
"./mcp": [
|
|
265
254
|
"MCPEndpointRegistry",
|
|
266
255
|
"MCPError",
|
|
@@ -273,28 +262,28 @@
|
|
|
273
262
|
"wireMCPPrompt",
|
|
274
263
|
"wireMCPResource"
|
|
275
264
|
],
|
|
276
|
-
"./
|
|
265
|
+
"./agent": [
|
|
277
266
|
"AgentInterruptedError",
|
|
278
267
|
"NoSpeechDetectedError",
|
|
279
268
|
"SPOKEN_TRANSCRIPT",
|
|
280
269
|
"SPOKEN_TURN",
|
|
281
270
|
"ToolApprovalRequired",
|
|
282
271
|
"ToolCredentialRequired",
|
|
283
|
-
"
|
|
272
|
+
"addAgent",
|
|
284
273
|
"agent",
|
|
285
274
|
"agentApprove",
|
|
286
275
|
"agentInterrupt",
|
|
287
276
|
"agentResume",
|
|
288
277
|
"agentStream",
|
|
289
278
|
"canAccessThread",
|
|
290
|
-
"
|
|
279
|
+
"interruptAgent",
|
|
291
280
|
"isOwnedByPrincipal",
|
|
292
281
|
"resolveModelAlias",
|
|
293
|
-
"
|
|
294
|
-
"
|
|
295
|
-
"
|
|
282
|
+
"resumeAgent",
|
|
283
|
+
"resumeAgentSync",
|
|
284
|
+
"runAgent",
|
|
296
285
|
"signalRunInterrupt",
|
|
297
|
-
"
|
|
286
|
+
"streamAgent",
|
|
298
287
|
"threadOwnerConstraint",
|
|
299
288
|
"unspeakableScripts",
|
|
300
289
|
"voiceForText",
|
|
@@ -302,16 +291,16 @@
|
|
|
302
291
|
"voiceOutput",
|
|
303
292
|
"wrapChannelWithAGUI"
|
|
304
293
|
],
|
|
305
|
-
"./
|
|
306
|
-
"
|
|
294
|
+
"./agent-scorer": [
|
|
295
|
+
"addAgentScorer",
|
|
307
296
|
"enableScoreSnapshots",
|
|
308
|
-
"
|
|
309
|
-
"
|
|
297
|
+
"getAgentScorers",
|
|
298
|
+
"getAgentScorersMeta",
|
|
310
299
|
"getScoreSnapshot",
|
|
311
300
|
"gradeRun",
|
|
312
|
-
"
|
|
313
|
-
"
|
|
314
|
-
"
|
|
301
|
+
"pikkuAgentJudge",
|
|
302
|
+
"pikkuAgentScorer",
|
|
303
|
+
"wireAgentScorerQueueWorkers"
|
|
315
304
|
],
|
|
316
305
|
"./gateway": [
|
|
317
306
|
"createListenerMessageHandler",
|
|
@@ -328,10 +317,7 @@
|
|
|
328
317
|
"runCLICommand",
|
|
329
318
|
"wireCLI"
|
|
330
319
|
],
|
|
331
|
-
"./cli/command-parser": [
|
|
332
|
-
"generateCommandHelp",
|
|
333
|
-
"parseCLIArguments"
|
|
334
|
-
],
|
|
320
|
+
"./cli/command-parser": ["generateCommandHelp", "parseCLIArguments"],
|
|
335
321
|
"./cli/channel": [
|
|
336
322
|
"executeCLIViaChannel",
|
|
337
323
|
"executeRawCLIViaChannel",
|
|
@@ -368,14 +354,8 @@
|
|
|
368
354
|
"validateAndBuildPersonasMeta",
|
|
369
355
|
"verifyPersonaRoles"
|
|
370
356
|
],
|
|
371
|
-
"./secret": [
|
|
372
|
-
|
|
373
|
-
"validateAndBuildSecretDefinitionsMeta"
|
|
374
|
-
],
|
|
375
|
-
"./variable": [
|
|
376
|
-
"defineVariable",
|
|
377
|
-
"validateAndBuildVariableDefinitionsMeta"
|
|
378
|
-
],
|
|
357
|
+
"./secret": ["defineSecret", "validateAndBuildSecretDefinitionsMeta"],
|
|
358
|
+
"./variable": ["defineVariable", "validateAndBuildVariableDefinitionsMeta"],
|
|
379
359
|
"./oauth2": [],
|
|
380
360
|
"./errors": [
|
|
381
361
|
"AIProviderAuthError",
|
|
@@ -428,7 +408,7 @@
|
|
|
428
408
|
"./services": [
|
|
429
409
|
"ConsoleLogger",
|
|
430
410
|
"DEFAULT_WEBHOOK_RETRIES",
|
|
431
|
-
"
|
|
411
|
+
"InMemoryAgentRunStateService",
|
|
432
412
|
"InMemoryQueueService",
|
|
433
413
|
"InMemorySessionStore",
|
|
434
414
|
"InMemoryTriggerService",
|
|
@@ -463,19 +443,10 @@
|
|
|
463
443
|
"spy",
|
|
464
444
|
"stub"
|
|
465
445
|
],
|
|
466
|
-
"./services/local-meta": [
|
|
467
|
-
|
|
468
|
-
],
|
|
469
|
-
"./services/
|
|
470
|
-
"V8CoverageService"
|
|
471
|
-
],
|
|
472
|
-
"./services/istanbul-coverage": [
|
|
473
|
-
"IstanbulCoverageService"
|
|
474
|
-
],
|
|
475
|
-
"./services/local-content": [
|
|
476
|
-
"LocalContent",
|
|
477
|
-
"signedContentPath"
|
|
478
|
-
],
|
|
446
|
+
"./services/local-meta": ["LocalMetaService"],
|
|
447
|
+
"./services/v8-coverage": ["V8CoverageService"],
|
|
448
|
+
"./services/istanbul-coverage": ["IstanbulCoverageService"],
|
|
449
|
+
"./services/local-content": ["LocalContent", "signedContentPath"],
|
|
479
450
|
"./services/local-content-request-handler": [
|
|
480
451
|
"createLocalContentRequestHandler",
|
|
481
452
|
"verifySignedContentRequest"
|
|
@@ -505,10 +476,7 @@
|
|
|
505
476
|
"verifyWithKeyMaterial",
|
|
506
477
|
"wrapDEK"
|
|
507
478
|
],
|
|
508
|
-
"./hmac": [
|
|
509
|
-
"hmacSha256Hex",
|
|
510
|
-
"timingSafeStringEqual"
|
|
511
|
-
],
|
|
479
|
+
"./hmac": ["hmacSha256Hex", "timingSafeStringEqual"],
|
|
512
480
|
"./ecosystem": [
|
|
513
481
|
"addFunction",
|
|
514
482
|
"addGlobalMiddleware",
|
|
@@ -522,18 +490,148 @@
|
|
|
522
490
|
"runPikkuFunc",
|
|
523
491
|
"setSingletonServices"
|
|
524
492
|
],
|
|
525
|
-
"./
|
|
526
|
-
"
|
|
527
|
-
"
|
|
528
|
-
"
|
|
529
|
-
"
|
|
530
|
-
"
|
|
531
|
-
"
|
|
532
|
-
"
|
|
533
|
-
"
|
|
534
|
-
"
|
|
535
|
-
"
|
|
536
|
-
"
|
|
493
|
+
"./ecosystem/agent": [
|
|
494
|
+
"addAgent",
|
|
495
|
+
"agent",
|
|
496
|
+
"agentApprove",
|
|
497
|
+
"agentResume",
|
|
498
|
+
"agentStream",
|
|
499
|
+
"canAccessThread",
|
|
500
|
+
"isOwnedByPrincipal",
|
|
501
|
+
"resolveModelAlias",
|
|
502
|
+
"threadOwnerConstraint",
|
|
503
|
+
"voiceInput",
|
|
504
|
+
"voiceOutput"
|
|
505
|
+
],
|
|
506
|
+
"./ecosystem/agent-scorer": [
|
|
507
|
+
"addAgentScorer",
|
|
508
|
+
"enableScoreSnapshots",
|
|
509
|
+
"getScoreSnapshot",
|
|
510
|
+
"gradeRun",
|
|
511
|
+
"pikkuAgentJudge",
|
|
512
|
+
"pikkuAgentScorer",
|
|
513
|
+
"wireAgentScorerQueueWorkers"
|
|
514
|
+
],
|
|
515
|
+
"./ecosystem/channel": [
|
|
516
|
+
"EventHubStore",
|
|
517
|
+
"PikkuAbstractChannelHandler",
|
|
518
|
+
"addChannelMiddleware",
|
|
519
|
+
"logChannels"
|
|
520
|
+
],
|
|
521
|
+
"./ecosystem/channel/local": ["PikkuLocalChannelHandler"],
|
|
522
|
+
"./ecosystem/cli": ["CLIError", "executeCLI", "generateCommandHelp"],
|
|
523
|
+
"./ecosystem/cli/channel": ["executeRawCLIViaChannel", "handleRawCLI"],
|
|
524
|
+
"./ecosystem/credential": ["validateAndBuildCredentialDefinitionsMeta"],
|
|
525
|
+
"./ecosystem/dev": ["reconcileAddonRegistry", "reloadGeneratedMeta"],
|
|
526
|
+
"./ecosystem/function": ["getAllFunctionNames", "pikkuAuth"],
|
|
527
|
+
"./ecosystem/gateway": [],
|
|
528
|
+
"./ecosystem/hmac": ["hmacSha256Hex", "timingSafeStringEqual"],
|
|
529
|
+
"./ecosystem/http": ["DEFAULT_MAX_BODY_SIZE", "logRoutes", "toWebRequest"],
|
|
530
|
+
"./ecosystem/mcp": [
|
|
531
|
+
"MCPEndpointRegistry",
|
|
532
|
+
"MCPError",
|
|
533
|
+
"getMCPPromptsMeta",
|
|
534
|
+
"getMCPResourcesMeta",
|
|
535
|
+
"getMCPToolsMeta"
|
|
536
|
+
],
|
|
537
|
+
"./ecosystem/middleware": [
|
|
538
|
+
"addGlobalPermission",
|
|
539
|
+
"authAPIKey",
|
|
540
|
+
"authCookie",
|
|
541
|
+
"pikkuRemoteAuthMiddleware",
|
|
542
|
+
"runMiddleware",
|
|
543
|
+
"telemetryInner",
|
|
544
|
+
"telemetryOuter"
|
|
545
|
+
],
|
|
546
|
+
"./ecosystem/node": [],
|
|
547
|
+
"./ecosystem/node-host-resolver": ["installNodeHostResolver"],
|
|
548
|
+
"./ecosystem/oauth2": [],
|
|
549
|
+
"./ecosystem/persona": [
|
|
550
|
+
"HttpPersona",
|
|
551
|
+
"createHttpPersonas",
|
|
552
|
+
"personaEmails",
|
|
553
|
+
"personaEnvironmentErrors",
|
|
554
|
+
"personaEnvironmentRefusal",
|
|
555
|
+
"roleMismatchMessage",
|
|
556
|
+
"validateAndBuildPersonasMeta",
|
|
557
|
+
"verifyPersonaRoles"
|
|
558
|
+
],
|
|
559
|
+
"./ecosystem/queue": [
|
|
560
|
+
"QueueJobDiscardedError",
|
|
561
|
+
"QueueJobFailedError",
|
|
562
|
+
"registerQueueWorkers"
|
|
563
|
+
],
|
|
564
|
+
"./ecosystem/remote": ["buildRemoteHeaders"],
|
|
565
|
+
"./ecosystem/role": [
|
|
566
|
+
"defineSystemRole",
|
|
567
|
+
"flattenSystemRoleDefinitions",
|
|
568
|
+
"validateAndBuildSystemRoleDefinitionsMeta"
|
|
569
|
+
],
|
|
570
|
+
"./ecosystem/rpc": ["wireAddon", "wireRemoteAddon"],
|
|
571
|
+
"./ecosystem/safe-fetch": ["safeFetch"],
|
|
572
|
+
"./ecosystem/scenario": [
|
|
573
|
+
"PikkuScenarioService",
|
|
574
|
+
"SCENARIO_SURFACES",
|
|
575
|
+
"addFeature",
|
|
576
|
+
"composeStepProse",
|
|
577
|
+
"resolveFeatureScenarios"
|
|
578
|
+
],
|
|
579
|
+
"./ecosystem/scheduler": ["getScheduledTasks"],
|
|
580
|
+
"./ecosystem/schema": ["addSchema"],
|
|
581
|
+
"./ecosystem/scope": [
|
|
582
|
+
"defineScope",
|
|
583
|
+
"flattenScopeDefinitions",
|
|
584
|
+
"validateAndBuildScopeDefinitionsMeta"
|
|
585
|
+
],
|
|
586
|
+
"./ecosystem/secret": ["validateAndBuildSecretDefinitionsMeta"],
|
|
587
|
+
"./ecosystem/services": [
|
|
588
|
+
"InMemoryAgentRunStateService",
|
|
589
|
+
"PIKKU_OUTGOING_WEBHOOK_QUEUE_NAME",
|
|
590
|
+
"PikkuSessionService",
|
|
591
|
+
"TypedVariablesService",
|
|
592
|
+
"createMiddlewareSessionWireProps",
|
|
593
|
+
"getStubTracker",
|
|
594
|
+
"pikkuWebhookWorkerFunc",
|
|
595
|
+
"spy"
|
|
596
|
+
],
|
|
597
|
+
"./ecosystem/services/istanbul-coverage": ["IstanbulCoverageService"],
|
|
598
|
+
"./ecosystem/services/local-content": ["signedContentPath"],
|
|
599
|
+
"./ecosystem/services/local-content-request-handler": [
|
|
600
|
+
"createLocalContentRequestHandler",
|
|
601
|
+
"verifySignedContentRequest"
|
|
602
|
+
],
|
|
603
|
+
"./ecosystem/services/v8-coverage": ["V8CoverageService"],
|
|
604
|
+
"./ecosystem/testing": ["defineServiceTests"],
|
|
605
|
+
"./ecosystem/trigger": [],
|
|
606
|
+
"./ecosystem/types": [
|
|
607
|
+
"PikkuRequest",
|
|
608
|
+
"formatVersionedId",
|
|
609
|
+
"isExpectedError",
|
|
610
|
+
"isSerializable",
|
|
611
|
+
"isVersionedId",
|
|
612
|
+
"parseDurationString",
|
|
613
|
+
"parseVersionedId"
|
|
614
|
+
],
|
|
615
|
+
"./ecosystem/variable": ["validateAndBuildVariableDefinitionsMeta"],
|
|
616
|
+
"./ecosystem/virtual-user": [
|
|
617
|
+
"DISPOSITIONS",
|
|
618
|
+
"PRODUCTION_DISPOSITION",
|
|
619
|
+
"catalogueClassification",
|
|
620
|
+
"dispositionProfile",
|
|
621
|
+
"intentsForPersona",
|
|
622
|
+
"isReadOnly",
|
|
623
|
+
"personaScopes",
|
|
624
|
+
"prepareVirtualUserRun",
|
|
625
|
+
"reachableCatalogue",
|
|
626
|
+
"unreachableCatalogue"
|
|
627
|
+
],
|
|
628
|
+
"./ecosystem/workflow": [
|
|
629
|
+
"assertWorkflowRunOwner",
|
|
630
|
+
"buildRunTimeline",
|
|
631
|
+
"isRef",
|
|
632
|
+
"reconstructFinalState",
|
|
633
|
+
"reconstructStateAt",
|
|
634
|
+
"template"
|
|
537
635
|
],
|
|
538
636
|
"./schema": [
|
|
539
637
|
"addSchema",
|
|
@@ -543,12 +641,6 @@
|
|
|
543
641
|
"getSchema",
|
|
544
642
|
"validateSchema"
|
|
545
643
|
],
|
|
546
|
-
"./testing": [
|
|
547
|
-
|
|
548
|
-
],
|
|
549
|
-
"./dev": [
|
|
550
|
-
"pikkuDevReloader",
|
|
551
|
-
"reconcileAddonRegistry",
|
|
552
|
-
"reloadGeneratedMeta"
|
|
553
|
-
]
|
|
644
|
+
"./testing": ["defineServiceTests"],
|
|
645
|
+
"./dev": ["pikkuDevReloader", "reconcileAddonRegistry", "reloadGeneratedMeta"]
|
|
554
646
|
}
|
|
@@ -5,17 +5,35 @@ disagree, so widening the API is a visible diff rather than a side effect of an
|
|
|
5
5
|
|
|
6
6
|
Types are not pinned: they are erased before the test can enumerate them.
|
|
7
7
|
|
|
8
|
+
A wildcard subpath is expanded to the files it matches, so `./ecosystem/*` is
|
|
9
|
+
pinned as one entry per area rather than as a pattern — otherwise a new
|
|
10
|
+
sub-barrel joins the published API without a diff.
|
|
11
|
+
|
|
8
12
|
Regenerate after an intentional change, from `packages/core`:
|
|
9
13
|
|
|
10
14
|
```bash
|
|
11
15
|
cat > src/__gen-surface.mts <<'EOF'
|
|
12
|
-
import { readFileSync, writeFileSync } from 'node:fs'
|
|
16
|
+
import { readdirSync, readFileSync, writeFileSync } from 'node:fs'
|
|
13
17
|
import { resolve } from 'node:path'
|
|
14
18
|
import { pathToFileURL } from 'node:url'
|
|
15
19
|
|
|
16
20
|
const pkg = JSON.parse(readFileSync('package.json', 'utf-8'))
|
|
21
|
+
const expand = ([sub, dist]: [string, string]): [string, string][] => {
|
|
22
|
+
if (!sub.includes('*')) return [[sub, dist]]
|
|
23
|
+
const [prefix] = dist.split('*') as [string]
|
|
24
|
+
return readdirSync(resolve(prefix.replace('./dist/', './src/')), {
|
|
25
|
+
recursive: true,
|
|
26
|
+
encoding: 'utf-8',
|
|
27
|
+
})
|
|
28
|
+
.filter((f) => f.endsWith('.ts') && !f.endsWith('.d.ts'))
|
|
29
|
+
.map((f) => f.slice(0, -'.ts'.length))
|
|
30
|
+
.sort()
|
|
31
|
+
.map((area) => [sub.replace('*', area), dist.replace('*', area)])
|
|
32
|
+
}
|
|
17
33
|
const surface: Record<string, string[]> = {}
|
|
18
|
-
for (const [sub, dist] of Object.entries(
|
|
34
|
+
for (const [sub, dist] of Object.entries(
|
|
35
|
+
pkg.exports as Record<string, string>
|
|
36
|
+
).flatMap(expand)) {
|
|
19
37
|
const src = pathToFileURL(resolve(dist.replace('./dist/', './src/'))).href
|
|
20
38
|
surface[sub] = Object.keys(await import(src)).sort()
|
|
21
39
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { describe, test } from 'node:test'
|
|
2
2
|
import assert from 'node:assert/strict'
|
|
3
|
-
import { readFileSync } from 'node:fs'
|
|
3
|
+
import { readdirSync, readFileSync } from 'node:fs'
|
|
4
4
|
import { fileURLToPath, pathToFileURL } from 'node:url'
|
|
5
5
|
import { dirname, join, resolve } from 'node:path'
|
|
6
6
|
|
|
@@ -16,6 +16,34 @@ const expected: Record<string, string[]> = JSON.parse(
|
|
|
16
16
|
|
|
17
17
|
const subpaths = packageJson.exports as Record<string, string>
|
|
18
18
|
|
|
19
|
+
/**
|
|
20
|
+
* `exports` entries, with a wildcard subpath replaced by the files it matches.
|
|
21
|
+
*
|
|
22
|
+
* `./ecosystem/*` publishes one sub-barrel per area, so pinning it as written
|
|
23
|
+
* would pin a pattern rather than a surface — and a new barrel would appear in
|
|
24
|
+
* the published API without a diff. Expanding it is what keeps each area's
|
|
25
|
+
* exports in `public-surface.json` under the same guarantee as every other
|
|
26
|
+
* entry point's.
|
|
27
|
+
*/
|
|
28
|
+
const entryPoints = (): [string, string][] =>
|
|
29
|
+
Object.entries(subpaths).flatMap(([subpath, dist]) => {
|
|
30
|
+
if (!subpath.includes('*')) return [[subpath, dist] as [string, string]]
|
|
31
|
+
|
|
32
|
+
const [prefix] = dist.split('*') as [string]
|
|
33
|
+
const directory = resolve(packageRoot, prefix.replace('./dist/', './src/'))
|
|
34
|
+
return readdirSync(directory, { recursive: true, encoding: 'utf-8' })
|
|
35
|
+
.filter((file) => file.endsWith('.ts') && !file.endsWith('.d.ts'))
|
|
36
|
+
.map((file) => file.slice(0, -'.ts'.length))
|
|
37
|
+
.sort()
|
|
38
|
+
.map(
|
|
39
|
+
(area) =>
|
|
40
|
+
[subpath.replace('*', area), dist.replace('*', area)] as [
|
|
41
|
+
string,
|
|
42
|
+
string,
|
|
43
|
+
]
|
|
44
|
+
)
|
|
45
|
+
})
|
|
46
|
+
|
|
19
47
|
/**
|
|
20
48
|
* Every runtime export reachable through an entry point, keyed by subpath.
|
|
21
49
|
*
|
|
@@ -24,7 +52,7 @@ const subpaths = packageJson.exports as Record<string, string>
|
|
|
24
52
|
*/
|
|
25
53
|
const actualSurface = async () => {
|
|
26
54
|
const surface: Record<string, string[]> = {}
|
|
27
|
-
for (const [subpath, dist] of
|
|
55
|
+
for (const [subpath, dist] of entryPoints()) {
|
|
28
56
|
const src = resolve(packageRoot, dist.replace('./dist/', './src/'))
|
|
29
57
|
const module = await import(pathToFileURL(src).href)
|
|
30
58
|
surface[subpath] = Object.keys(module).sort()
|
|
@@ -38,7 +66,7 @@ const REGENERATE =
|
|
|
38
66
|
|
|
39
67
|
describe('the published surface is the surface we meant to publish', () => {
|
|
40
68
|
test('every export subpath resolves to a source file', () => {
|
|
41
|
-
const missing =
|
|
69
|
+
const missing = entryPoints().filter(([, dist]) => {
|
|
42
70
|
try {
|
|
43
71
|
readFileSync(
|
|
44
72
|
resolve(packageRoot, dist.replace('./dist/', './src/')).replace(
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
AgentRunState,
|
|
3
3
|
PendingApproval,
|
|
4
|
-
} from '../wirings/
|
|
5
|
-
import type {
|
|
4
|
+
} from '../wirings/agent/agent.types.js'
|
|
5
|
+
import type { AgentRunScore } from '../wirings/agent-scorer/agent-scorer.types.js'
|
|
6
6
|
|
|
7
7
|
export type CreateRunInput = Omit<AgentRunState, 'runId'>
|
|
8
8
|
|
|
9
|
-
export type SaveScoreInput = Omit<
|
|
9
|
+
export type SaveScoreInput = Omit<AgentRunScore, 'createdAt'>
|
|
10
10
|
|
|
11
|
-
export interface
|
|
11
|
+
export interface AgentRunStateService {
|
|
12
12
|
createRun(run: CreateRunInput): Promise<string>
|
|
13
13
|
updateRun(runId: string, updates: Partial<AgentRunState>): Promise<void>
|
|
14
14
|
getRun(runId: string): Promise<AgentRunState | null>
|
|
@@ -33,5 +33,5 @@ export interface AIRunStateService {
|
|
|
33
33
|
* grade that was acted on.
|
|
34
34
|
*/
|
|
35
35
|
saveScore(score: SaveScoreInput): Promise<void>
|
|
36
|
-
getScores(runId: string): Promise<
|
|
36
|
+
getScores(runId: string): Promise<AgentRunScore[]>
|
|
37
37
|
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
} from '../wirings/
|
|
2
|
+
AgentMessage,
|
|
3
|
+
AgentStep,
|
|
4
|
+
AgentToolDef,
|
|
5
|
+
AgentStreamChannel,
|
|
6
|
+
} from '../wirings/agent/agent.types.js'
|
|
7
7
|
|
|
8
8
|
export type AIProviderOptions = Record<string, Record<string, unknown>>
|
|
9
9
|
|
|
10
|
-
export type
|
|
10
|
+
export type AgentRunnerParams = {
|
|
11
11
|
model: string
|
|
12
12
|
temperature?: number
|
|
13
13
|
instructions: string
|
|
14
|
-
messages:
|
|
15
|
-
tools:
|
|
14
|
+
messages: AgentMessage[]
|
|
15
|
+
tools: AgentToolDef[]
|
|
16
16
|
maxSteps: number
|
|
17
17
|
toolChoice: 'auto' | 'required' | 'none'
|
|
18
18
|
outputSchema?: Record<string, unknown>
|
|
@@ -21,7 +21,7 @@ export type AIAgentRunnerParams = {
|
|
|
21
21
|
agentId?: string
|
|
22
22
|
/**
|
|
23
23
|
* Cancels the model call itself, not just delivery of its output. Set by
|
|
24
|
-
* `
|
|
24
|
+
* `streamAgent` from the run's interrupt handle so a voice barge-in stops
|
|
25
25
|
* generation upstream rather than leaving tokens being billed into a stream
|
|
26
26
|
* nobody reads. A runner that ignores it degrades to "the caller stops
|
|
27
27
|
* listening", which is the behaviour before this field existed.
|
|
@@ -41,14 +41,14 @@ export type AIAgentRunnerParams = {
|
|
|
41
41
|
providerOptions?: AIProviderOptions
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
export type
|
|
44
|
+
export type AgentRunnerResult = {
|
|
45
45
|
text: string
|
|
46
46
|
object?: unknown
|
|
47
|
-
steps:
|
|
47
|
+
steps: AgentStep[]
|
|
48
48
|
usage: { inputTokens: number; outputTokens: number }
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
export type
|
|
51
|
+
export type AgentStepResult = {
|
|
52
52
|
text: string
|
|
53
53
|
object?: unknown
|
|
54
54
|
toolCalls: { toolCallId: string; toolName: string; args: unknown }[]
|
|
@@ -216,12 +216,12 @@ export type AIRerankResult<VALUE extends string | Record<string, unknown>> = {
|
|
|
216
216
|
response?: unknown
|
|
217
217
|
}
|
|
218
218
|
|
|
219
|
-
export interface
|
|
219
|
+
export interface AgentRunnerService {
|
|
220
220
|
stream(
|
|
221
|
-
params:
|
|
222
|
-
channel:
|
|
223
|
-
): Promise<
|
|
224
|
-
run(params:
|
|
221
|
+
params: AgentRunnerParams,
|
|
222
|
+
channel: AgentStreamChannel
|
|
223
|
+
): Promise<AgentStepResult>
|
|
224
|
+
run(params: AgentRunnerParams): Promise<AgentStepResult>
|
|
225
225
|
transcribe?(params: AITranscriptionParams): Promise<AITranscriptionResult>
|
|
226
226
|
generateSpeech?(
|
|
227
227
|
params: AIGenerateSpeechParams
|
|
@@ -234,5 +234,5 @@ export interface AIAgentRunnerService {
|
|
|
234
234
|
): Promise<AIRerankResult<VALUE>>
|
|
235
235
|
/** Return a new runner that uses the given API key for every LLM call.
|
|
236
236
|
* Optional — runners that don't support per-key scoping leave this undefined. */
|
|
237
|
-
withApiKey?(apiKey: string):
|
|
237
|
+
withApiKey?(apiKey: string): AgentRunnerService
|
|
238
238
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AgentThread, AgentMessage } from '../wirings/agent/agent.types.js'
|
|
2
2
|
|
|
3
|
-
export interface
|
|
3
|
+
export interface AgentStorageService {
|
|
4
4
|
createThread(
|
|
5
5
|
resourceId: string,
|
|
6
6
|
options?: {
|
|
@@ -8,11 +8,11 @@ export interface AIStorageService {
|
|
|
8
8
|
title?: string
|
|
9
9
|
metadata?: Record<string, unknown>
|
|
10
10
|
}
|
|
11
|
-
): Promise<
|
|
11
|
+
): Promise<AgentThread>
|
|
12
12
|
|
|
13
|
-
getThread(threadId: string): Promise<
|
|
13
|
+
getThread(threadId: string): Promise<AgentThread>
|
|
14
14
|
|
|
15
|
-
getThreads(resourceId: string): Promise<
|
|
15
|
+
getThreads(resourceId: string): Promise<AgentThread[]>
|
|
16
16
|
|
|
17
17
|
deleteThread(threadId: string): Promise<void>
|
|
18
18
|
|
|
@@ -22,9 +22,9 @@ export interface AIStorageService {
|
|
|
22
22
|
lastN?: number
|
|
23
23
|
cursor?: string
|
|
24
24
|
}
|
|
25
|
-
): Promise<
|
|
25
|
+
): Promise<AgentMessage[]>
|
|
26
26
|
|
|
27
|
-
saveMessages(threadId: string, messages:
|
|
27
|
+
saveMessages(threadId: string, messages: AgentMessage[]): Promise<void>
|
|
28
28
|
|
|
29
29
|
getWorkingMemory(
|
|
30
30
|
id: string,
|
|
@@ -4,7 +4,7 @@ import { createServer, type Server } from 'node:http'
|
|
|
4
4
|
|
|
5
5
|
import { createHttpPersonas } from './http-personas.js'
|
|
6
6
|
import { pikkuState, resetPikkuState } from '../pikku-state.js'
|
|
7
|
-
import type {
|
|
7
|
+
import type { AgentStepResult } from './agent-runner-service.js'
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Minimal target app exposing the agent HTTP surface: actor sign-in, the agent
|
|
@@ -104,7 +104,7 @@ const scriptedRunner = () => {
|
|
|
104
104
|
return {
|
|
105
105
|
run: async (params: {
|
|
106
106
|
outputSchema?: unknown
|
|
107
|
-
}): Promise<
|
|
107
|
+
}): Promise<AgentStepResult> => {
|
|
108
108
|
const props =
|
|
109
109
|
(params.outputSchema as { properties?: Record<string, unknown> })
|
|
110
110
|
?.properties ?? {}
|
|
@@ -135,7 +135,7 @@ const wireRunner = () => {
|
|
|
135
135
|
error: () => {},
|
|
136
136
|
debug: () => {},
|
|
137
137
|
},
|
|
138
|
-
|
|
138
|
+
agentRunner: scriptedRunner(),
|
|
139
139
|
} as any)
|
|
140
140
|
}
|
|
141
141
|
|