pinecall 0.1.0
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/LICENSE +202 -0
- package/README.md +134 -0
- package/dist/agent/accepts.d.ts +32 -0
- package/dist/agent/accepts.d.ts.map +1 -0
- package/dist/agent/accepts.js +28 -0
- package/dist/agent/accepts.js.map +1 -0
- package/dist/agent/agent.d.ts +189 -0
- package/dist/agent/agent.d.ts.map +1 -0
- package/dist/agent/agent.js +262 -0
- package/dist/agent/agent.js.map +1 -0
- package/dist/agent/authors.d.ts +12 -0
- package/dist/agent/authors.d.ts.map +1 -0
- package/dist/agent/authors.js +28 -0
- package/dist/agent/authors.js.map +1 -0
- package/dist/agent/decorators.d.ts +22 -0
- package/dist/agent/decorators.d.ts.map +1 -0
- package/dist/agent/decorators.js +49 -0
- package/dist/agent/decorators.js.map +1 -0
- package/dist/agent/docstrings.d.ts +43 -0
- package/dist/agent/docstrings.d.ts.map +1 -0
- package/dist/agent/docstrings.js +311 -0
- package/dist/agent/docstrings.js.map +1 -0
- package/dist/agent/lifecycle.d.ts +29 -0
- package/dist/agent/lifecycle.d.ts.map +1 -0
- package/dist/agent/lifecycle.js +11 -0
- package/dist/agent/lifecycle.js.map +1 -0
- package/dist/agent/stages.d.ts +28 -0
- package/dist/agent/stages.d.ts.map +1 -0
- package/dist/agent/stages.js +32 -0
- package/dist/agent/stages.js.map +1 -0
- package/dist/agent/state.d.ts +43 -0
- package/dist/agent/state.d.ts.map +1 -0
- package/dist/agent/state.js +104 -0
- package/dist/agent/state.js.map +1 -0
- package/dist/agent/tools.d.ts +66 -0
- package/dist/agent/tools.d.ts.map +1 -0
- package/dist/agent/tools.js +148 -0
- package/dist/agent/tools.js.map +1 -0
- package/dist/agent/visibility.d.ts +40 -0
- package/dist/agent/visibility.d.ts.map +1 -0
- package/dist/agent/visibility.js +89 -0
- package/dist/agent/visibility.js.map +1 -0
- package/dist/call/call.d.ts +55 -0
- package/dist/call/call.d.ts.map +1 -0
- package/dist/call/call.js +108 -0
- package/dist/call/call.js.map +1 -0
- package/dist/call/history.d.ts +34 -0
- package/dist/call/history.d.ts.map +1 -0
- package/dist/call/history.js +38 -0
- package/dist/call/history.js.map +1 -0
- package/dist/call/room.d.ts +58 -0
- package/dist/call/room.d.ts.map +1 -0
- package/dist/call/room.js +68 -0
- package/dist/call/room.js.map +1 -0
- package/dist/cli/browser.d.ts +8 -0
- package/dist/cli/browser.d.ts.map +1 -0
- package/dist/cli/browser.js +27 -0
- package/dist/cli/browser.js.map +1 -0
- package/dist/cli/callbacks.d.ts +26 -0
- package/dist/cli/callbacks.d.ts.map +1 -0
- package/dist/cli/callbacks.js +68 -0
- package/dist/cli/callbacks.js.map +1 -0
- package/dist/cli/chat.d.ts +21 -0
- package/dist/cli/chat.d.ts.map +1 -0
- package/dist/cli/chat.js +214 -0
- package/dist/cli/chat.js.map +1 -0
- package/dist/cli/config.d.ts +16 -0
- package/dist/cli/config.d.ts.map +1 -0
- package/dist/cli/config.js +94 -0
- package/dist/cli/config.js.map +1 -0
- package/dist/cli/connected.d.ts +30 -0
- package/dist/cli/connected.d.ts.map +1 -0
- package/dist/cli/connected.js +32 -0
- package/dist/cli/connected.js.map +1 -0
- package/dist/cli/credentials.d.ts +41 -0
- package/dist/cli/credentials.d.ts.map +1 -0
- package/dist/cli/credentials.js +98 -0
- package/dist/cli/credentials.js.map +1 -0
- package/dist/cli/ear.d.ts +3 -0
- package/dist/cli/ear.d.ts.map +1 -0
- package/dist/cli/ear.js +59 -0
- package/dist/cli/ear.js.map +1 -0
- package/dist/cli/env.d.ts +40 -0
- package/dist/cli/env.d.ts.map +1 -0
- package/dist/cli/env.js +45 -0
- package/dist/cli/env.js.map +1 -0
- package/dist/cli/eval.d.ts +37 -0
- package/dist/cli/eval.d.ts.map +1 -0
- package/dist/cli/eval.js +83 -0
- package/dist/cli/eval.js.map +1 -0
- package/dist/cli/groups.d.ts +17 -0
- package/dist/cli/groups.d.ts.map +1 -0
- package/dist/cli/groups.js +38 -0
- package/dist/cli/groups.js.map +1 -0
- package/dist/cli/index.d.ts +16 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +169 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/keys.d.ts +28 -0
- package/dist/cli/keys.d.ts.map +1 -0
- package/dist/cli/keys.js +137 -0
- package/dist/cli/keys.js.map +1 -0
- package/dist/cli/knowledge.d.ts +35 -0
- package/dist/cli/knowledge.d.ts.map +1 -0
- package/dist/cli/knowledge.js +174 -0
- package/dist/cli/knowledge.js.map +1 -0
- package/dist/cli/line.d.ts +33 -0
- package/dist/cli/line.d.ts.map +1 -0
- package/dist/cli/line.js +134 -0
- package/dist/cli/line.js.map +1 -0
- package/dist/cli/listening.d.ts +38 -0
- package/dist/cli/listening.d.ts.map +1 -0
- package/dist/cli/listening.js +124 -0
- package/dist/cli/listening.js.map +1 -0
- package/dist/cli/load.d.ts +38 -0
- package/dist/cli/load.d.ts.map +1 -0
- package/dist/cli/load.js +99 -0
- package/dist/cli/load.js.map +1 -0
- package/dist/cli/login.d.ts +30 -0
- package/dist/cli/login.d.ts.map +1 -0
- package/dist/cli/login.js +158 -0
- package/dist/cli/login.js.map +1 -0
- package/dist/cli/machine.d.ts +8 -0
- package/dist/cli/machine.d.ts.map +1 -0
- package/dist/cli/machine.js +41 -0
- package/dist/cli/machine.js.map +1 -0
- package/dist/cli/memory.d.ts +26 -0
- package/dist/cli/memory.d.ts.map +1 -0
- package/dist/cli/memory.js +148 -0
- package/dist/cli/memory.js.map +1 -0
- package/dist/cli/numbers.d.ts +25 -0
- package/dist/cli/numbers.d.ts.map +1 -0
- package/dist/cli/numbers.js +132 -0
- package/dist/cli/numbers.js.map +1 -0
- package/dist/cli/personas.d.ts +5 -0
- package/dist/cli/personas.d.ts.map +1 -0
- package/dist/cli/personas.js +94 -0
- package/dist/cli/personas.js.map +1 -0
- package/dist/cli/pipeline.d.ts +52 -0
- package/dist/cli/pipeline.d.ts.map +1 -0
- package/dist/cli/pipeline.js +184 -0
- package/dist/cli/pipeline.js.map +1 -0
- package/dist/cli/profiles.d.ts +70 -0
- package/dist/cli/profiles.d.ts.map +1 -0
- package/dist/cli/profiles.js +210 -0
- package/dist/cli/profiles.js.map +1 -0
- package/dist/cli/prompt.d.ts +20 -0
- package/dist/cli/prompt.d.ts.map +1 -0
- package/dist/cli/prompt.js +58 -0
- package/dist/cli/prompt.js.map +1 -0
- package/dist/cli/providers.d.ts +14 -0
- package/dist/cli/providers.d.ts.map +1 -0
- package/dist/cli/providers.js +116 -0
- package/dist/cli/providers.js.map +1 -0
- package/dist/cli/remember.d.ts +29 -0
- package/dist/cli/remember.d.ts.map +1 -0
- package/dist/cli/remember.js +112 -0
- package/dist/cli/remember.js.map +1 -0
- package/dist/cli/run.d.ts +20 -0
- package/dist/cli/run.d.ts.map +1 -0
- package/dist/cli/run.js +347 -0
- package/dist/cli/run.js.map +1 -0
- package/dist/cli/runs/candidate.d.ts +51 -0
- package/dist/cli/runs/candidate.d.ts.map +1 -0
- package/dist/cli/runs/candidate.js +127 -0
- package/dist/cli/runs/candidate.js.map +1 -0
- package/dist/cli/runs/drift.d.ts +75 -0
- package/dist/cli/runs/drift.d.ts.map +1 -0
- package/dist/cli/runs/drift.js +151 -0
- package/dist/cli/runs/drift.js.map +1 -0
- package/dist/cli/runs/index.d.ts +5 -0
- package/dist/cli/runs/index.d.ts.map +1 -0
- package/dist/cli/runs/index.js +99 -0
- package/dist/cli/runs/index.js.map +1 -0
- package/dist/cli/runs/suites.d.ts +16 -0
- package/dist/cli/runs/suites.d.ts.map +1 -0
- package/dist/cli/runs/suites.js +63 -0
- package/dist/cli/runs/suites.js.map +1 -0
- package/dist/cli/secret.d.ts +18 -0
- package/dist/cli/secret.d.ts.map +1 -0
- package/dist/cli/secret.js +41 -0
- package/dist/cli/secret.js.map +1 -0
- package/dist/cli/sessions.d.ts +21 -0
- package/dist/cli/sessions.d.ts.map +1 -0
- package/dist/cli/sessions.js +174 -0
- package/dist/cli/sessions.js.map +1 -0
- package/dist/cli/signup.d.ts +25 -0
- package/dist/cli/signup.d.ts.map +1 -0
- package/dist/cli/signup.js +122 -0
- package/dist/cli/signup.js.map +1 -0
- package/dist/cli/simulate.d.ts +45 -0
- package/dist/cli/simulate.d.ts.map +1 -0
- package/dist/cli/simulate.js +320 -0
- package/dist/cli/simulate.js.map +1 -0
- package/dist/cli/supervise.d.ts +18 -0
- package/dist/cli/supervise.d.ts.map +1 -0
- package/dist/cli/supervise.js +134 -0
- package/dist/cli/supervise.js.map +1 -0
- package/dist/cli/test.d.ts +12 -0
- package/dist/cli/test.d.ts.map +1 -0
- package/dist/cli/test.js +128 -0
- package/dist/cli/test.js.map +1 -0
- package/dist/cli/testing/caller.d.ts +28 -0
- package/dist/cli/testing/caller.d.ts.map +1 -0
- package/dist/cli/testing/caller.js +30 -0
- package/dist/cli/testing/caller.js.map +1 -0
- package/dist/cli/testing/gateway.d.ts +172 -0
- package/dist/cli/testing/gateway.d.ts.map +1 -0
- package/dist/cli/testing/gateway.js +96 -0
- package/dist/cli/testing/gateway.js.map +1 -0
- package/dist/cli/testing/goldens.d.ts +61 -0
- package/dist/cli/testing/goldens.d.ts.map +1 -0
- package/dist/cli/testing/goldens.js +54 -0
- package/dist/cli/testing/goldens.js.map +1 -0
- package/dist/cli/testing/latency.d.ts +15 -0
- package/dist/cli/testing/latency.d.ts.map +1 -0
- package/dist/cli/testing/latency.js +44 -0
- package/dist/cli/testing/latency.js.map +1 -0
- package/dist/cli/testing/matrix.d.ts +12 -0
- package/dist/cli/testing/matrix.d.ts.map +1 -0
- package/dist/cli/testing/matrix.js +103 -0
- package/dist/cli/testing/matrix.js.map +1 -0
- package/dist/cli/testing/progress.d.ts +26 -0
- package/dist/cli/testing/progress.d.ts.map +1 -0
- package/dist/cli/testing/progress.js +185 -0
- package/dist/cli/testing/progress.js.map +1 -0
- package/dist/cli/testing/reproduction.d.ts +19 -0
- package/dist/cli/testing/reproduction.d.ts.map +1 -0
- package/dist/cli/testing/reproduction.js +65 -0
- package/dist/cli/testing/reproduction.js.map +1 -0
- package/dist/cli/testing/score.d.ts +11 -0
- package/dist/cli/testing/score.d.ts.map +1 -0
- package/dist/cli/testing/score.js +54 -0
- package/dist/cli/testing/score.js.map +1 -0
- package/dist/cli/testing/seeding.d.ts +32 -0
- package/dist/cli/testing/seeding.d.ts.map +1 -0
- package/dist/cli/testing/seeding.js +44 -0
- package/dist/cli/testing/seeding.js.map +1 -0
- package/dist/cli/testing/suite.d.ts +40 -0
- package/dist/cli/testing/suite.d.ts.map +1 -0
- package/dist/cli/testing/suite.js +103 -0
- package/dist/cli/testing/suite.js.map +1 -0
- package/dist/cli/testing/voice.d.ts +37 -0
- package/dist/cli/testing/voice.d.ts.map +1 -0
- package/dist/cli/testing/voice.js +53 -0
- package/dist/cli/testing/voice.js.map +1 -0
- package/dist/cli/ui/admin/assets/index-C3WMXdfL.css +1 -0
- package/dist/cli/ui/admin/assets/index-DR1mxoAh.js +58 -0
- package/dist/cli/ui/admin/index.html +20 -0
- package/dist/cli/ui/asked.d.ts +16 -0
- package/dist/cli/ui/asked.d.ts.map +1 -0
- package/dist/cli/ui/asked.js +53 -0
- package/dist/cli/ui/asked.js.map +1 -0
- package/dist/cli/ui/browser.d.ts +10 -0
- package/dist/cli/ui/browser.d.ts.map +1 -0
- package/dist/cli/ui/browser.js +30 -0
- package/dist/cli/ui/browser.js.map +1 -0
- package/dist/cli/ui/chatting.d.ts +62 -0
- package/dist/cli/ui/chatting.d.ts.map +1 -0
- package/dist/cli/ui/chatting.js +171 -0
- package/dist/cli/ui/chatting.js.map +1 -0
- package/dist/cli/ui/console/assets/index-DCTnou52.css +1 -0
- package/dist/cli/ui/console/assets/index-dOcE4usU.js +99 -0
- package/dist/cli/ui/console/index.html +20 -0
- package/dist/cli/ui/console/logo-mark.png +0 -0
- package/dist/cli/ui/doors.d.ts +37 -0
- package/dist/cli/ui/doors.d.ts.map +1 -0
- package/dist/cli/ui/doors.js +70 -0
- package/dist/cli/ui/doors.js.map +1 -0
- package/dist/cli/ui/drifting.d.ts +23 -0
- package/dist/cli/ui/drifting.d.ts.map +1 -0
- package/dist/cli/ui/drifting.js +33 -0
- package/dist/cli/ui/drifting.js.map +1 -0
- package/dist/cli/ui/index.d.ts +15 -0
- package/dist/cli/ui/index.d.ts.map +1 -0
- package/dist/cli/ui/index.js +117 -0
- package/dist/cli/ui/index.js.map +1 -0
- package/dist/cli/ui/knowing.d.ts +36 -0
- package/dist/cli/ui/knowing.d.ts.map +1 -0
- package/dist/cli/ui/knowing.js +86 -0
- package/dist/cli/ui/knowing.js.map +1 -0
- package/dist/cli/ui/promoting.d.ts +26 -0
- package/dist/cli/ui/promoting.d.ts.map +1 -0
- package/dist/cli/ui/promoting.js +44 -0
- package/dist/cli/ui/promoting.js.map +1 -0
- package/dist/cli/ui/refusal.d.ts +18 -0
- package/dist/cli/ui/refusal.d.ts.map +1 -0
- package/dist/cli/ui/refusal.js +26 -0
- package/dist/cli/ui/refusal.js.map +1 -0
- package/dist/cli/ui/refused.d.ts +8 -0
- package/dist/cli/ui/refused.d.ts.map +1 -0
- package/dist/cli/ui/refused.js +11 -0
- package/dist/cli/ui/refused.js.map +1 -0
- package/dist/cli/ui/remembering.d.ts +38 -0
- package/dist/cli/ui/remembering.d.ts.map +1 -0
- package/dist/cli/ui/remembering.js +87 -0
- package/dist/cli/ui/remembering.js.map +1 -0
- package/dist/cli/ui/reproducing.d.ts +23 -0
- package/dist/cli/ui/reproducing.d.ts.map +1 -0
- package/dist/cli/ui/reproducing.js +52 -0
- package/dist/cli/ui/reproducing.js.map +1 -0
- package/dist/cli/ui/server.d.ts +22 -0
- package/dist/cli/ui/server.d.ts.map +1 -0
- package/dist/cli/ui/server.js +211 -0
- package/dist/cli/ui/server.js.map +1 -0
- package/dist/cli/ui/simulating.d.ts +47 -0
- package/dist/cli/ui/simulating.d.ts.map +1 -0
- package/dist/cli/ui/simulating.js +86 -0
- package/dist/cli/ui/simulating.js.map +1 -0
- package/dist/cli/ui/testing.d.ts +49 -0
- package/dist/cli/ui/testing.d.ts.map +1 -0
- package/dist/cli/ui/testing.js +104 -0
- package/dist/cli/ui/testing.js.map +1 -0
- package/dist/cli/view.d.ts +43 -0
- package/dist/cli/view.d.ts.map +1 -0
- package/dist/cli/view.js +137 -0
- package/dist/cli/view.js.map +1 -0
- package/dist/cli/whoami.d.ts +37 -0
- package/dist/cli/whoami.d.ts.map +1 -0
- package/dist/cli/whoami.js +78 -0
- package/dist/cli/whoami.js.map +1 -0
- package/dist/cli/world.d.ts +33 -0
- package/dist/cli/world.d.ts.map +1 -0
- package/dist/cli/world.js +48 -0
- package/dist/cli/world.js.map +1 -0
- package/dist/client/agent.d.ts +87 -0
- package/dist/client/agent.d.ts.map +1 -0
- package/dist/client/agent.js +209 -0
- package/dist/client/agent.js.map +1 -0
- package/dist/client/calls.d.ts +77 -0
- package/dist/client/calls.d.ts.map +1 -0
- package/dist/client/calls.js +153 -0
- package/dist/client/calls.js.map +1 -0
- package/dist/client/client.d.ts +58 -0
- package/dist/client/client.d.ts.map +1 -0
- package/dist/client/client.js +146 -0
- package/dist/client/client.js.map +1 -0
- package/dist/client/connection.d.ts +47 -0
- package/dist/client/connection.d.ts.map +1 -0
- package/dist/client/connection.js +141 -0
- package/dist/client/connection.js.map +1 -0
- package/dist/client/endpoints.d.ts +7 -0
- package/dist/client/endpoints.d.ts.map +1 -0
- package/dist/client/endpoints.js +21 -0
- package/dist/client/endpoints.js.map +1 -0
- package/dist/client/frames.d.ts +24 -0
- package/dist/client/frames.d.ts.map +1 -0
- package/dist/client/frames.js +49 -0
- package/dist/client/frames.js.map +1 -0
- package/dist/client/index.d.ts +15 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +14 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/listeners.d.ts +36 -0
- package/dist/client/listeners.d.ts.map +1 -0
- package/dist/client/listeners.js +61 -0
- package/dist/client/listeners.js.map +1 -0
- package/dist/client/observe.d.ts +44 -0
- package/dist/client/observe.d.ts.map +1 -0
- package/dist/client/observe.js +122 -0
- package/dist/client/observe.js.map +1 -0
- package/dist/client/testing/gateway.d.ts +39 -0
- package/dist/client/testing/gateway.d.ts.map +1 -0
- package/dist/client/testing/gateway.js +129 -0
- package/dist/client/testing/gateway.js.map +1 -0
- package/dist/client/testing/index.d.ts +4 -0
- package/dist/client/testing/index.d.ts.map +1 -0
- package/dist/client/testing/index.js +4 -0
- package/dist/client/testing/index.js.map +1 -0
- package/dist/client/testing/log.d.ts +26 -0
- package/dist/client/testing/log.d.ts.map +1 -0
- package/dist/client/testing/log.js +111 -0
- package/dist/client/testing/log.js.map +1 -0
- package/dist/client/testing/loopback.d.ts +3 -0
- package/dist/client/testing/loopback.d.ts.map +1 -0
- package/dist/client/testing/loopback.js +3 -0
- package/dist/client/testing/loopback.js.map +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +35 -0
- package/dist/index.js.map +1 -0
- package/dist/runtime/channels.d.ts +16 -0
- package/dist/runtime/channels.d.ts.map +1 -0
- package/dist/runtime/channels.js +30 -0
- package/dist/runtime/channels.js.map +1 -0
- package/dist/runtime/connect.d.ts +51 -0
- package/dist/runtime/connect.d.ts.map +1 -0
- package/dist/runtime/connect.js +284 -0
- package/dist/runtime/connect.js.map +1 -0
- package/dist/runtime/dispatch.d.ts +37 -0
- package/dist/runtime/dispatch.d.ts.map +1 -0
- package/dist/runtime/dispatch.js +52 -0
- package/dist/runtime/dispatch.js.map +1 -0
- package/dist/runtime/grounding.d.ts +15 -0
- package/dist/runtime/grounding.d.ts.map +1 -0
- package/dist/runtime/grounding.js +72 -0
- package/dist/runtime/grounding.js.map +1 -0
- package/dist/runtime/recall.d.ts +10 -0
- package/dist/runtime/recall.d.ts.map +1 -0
- package/dist/runtime/recall.js +13 -0
- package/dist/runtime/recall.js.map +1 -0
- package/dist/runtime/run-tool.d.ts +26 -0
- package/dist/runtime/run-tool.d.ts.map +1 -0
- package/dist/runtime/run-tool.js +82 -0
- package/dist/runtime/run-tool.js.map +1 -0
- package/dist/views/components.d.ts +17 -0
- package/dist/views/components.d.ts.map +1 -0
- package/dist/views/components.js +33 -0
- package/dist/views/components.js.map +1 -0
- package/dist/views/jsx-dev-runtime.d.ts +3 -0
- package/dist/views/jsx-dev-runtime.d.ts.map +1 -0
- package/dist/views/jsx-dev-runtime.js +5 -0
- package/dist/views/jsx-dev-runtime.js.map +1 -0
- package/dist/views/jsx-runtime.d.ts +49 -0
- package/dist/views/jsx-runtime.d.ts.map +1 -0
- package/dist/views/jsx-runtime.js +67 -0
- package/dist/views/jsx-runtime.js.map +1 -0
- package/dist/views/lang.d.ts +17 -0
- package/dist/views/lang.d.ts.map +1 -0
- package/dist/views/lang.js +46 -0
- package/dist/views/lang.js.map +1 -0
- package/dist/views/layout.d.ts +19 -0
- package/dist/views/layout.d.ts.map +1 -0
- package/dist/views/layout.js +62 -0
- package/dist/views/layout.js.map +1 -0
- package/dist/views/render.d.ts +19 -0
- package/dist/views/render.d.ts.map +1 -0
- package/dist/views/render.js +26 -0
- package/dist/views/render.js.map +1 -0
- package/package.json +76 -0
- package/tsconfig.tenant.json +24 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refusal.js","sourceRoot":"","sources":["../../../src/cli/ui/refusal.ts"],"names":[],"mappings":"AAAA,+GAA+G;AAE/G,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,6GAA6G;AAC7G,MAAM,OAAO,OAAQ,SAAQ,KAAK;IAIrB,MAAM;IAHC,IAAI,GAAG,SAAS,CAAC;IAEnC,YACW,MAAc,EACvB,OAAe;QAEf,KAAK,CAAC,OAAO,CAAC,CAAC;sBAHN,MAAM;IAIjB,CAAC;CACF;AAED;;;;;GAKG;AACH,MAAM,UAAU,SAAS,CAAC,MAAe;IACvC,IAAI,MAAM,YAAY,OAAO;QAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC;IACxF,IAAI,MAAM,YAAY,OAAO;QAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;IACzF,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,YAAY,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;AAC5F,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** A refusal from one of the console's own doors: a sentence for the page, and the status it travels under. */
|
|
2
|
+
/** Thrown by a door of this process; the server writes it as `{detail}` under `status`, as FastAPI would. */
|
|
3
|
+
export declare class Refused extends Error {
|
|
4
|
+
readonly status: number;
|
|
5
|
+
readonly name = "Refused";
|
|
6
|
+
constructor(status: number, message: string);
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=refused.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refused.d.ts","sourceRoot":"","sources":["../../../src/cli/ui/refused.ts"],"names":[],"mappings":"AAAA,+GAA+G;AAE/G,6GAA6G;AAC7G,qBAAa,OAAQ,SAAQ,KAAK;IAI9B,QAAQ,CAAC,MAAM,EAAE,MAAM;IAHzB,SAAkB,IAAI,aAAa;IAEnC,YACW,MAAM,EAAE,MAAM,EACvB,OAAO,EAAE,MAAM,EAGhB;CACF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** A refusal from one of the console's own doors: a sentence for the page, and the status it travels under. */
|
|
2
|
+
/** Thrown by a door of this process; the server writes it as `{detail}` under `status`, as FastAPI would. */
|
|
3
|
+
export class Refused extends Error {
|
|
4
|
+
status;
|
|
5
|
+
name = "Refused";
|
|
6
|
+
constructor(status, message) {
|
|
7
|
+
super(message);
|
|
8
|
+
this.status = status;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=refused.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refused.js","sourceRoot":"","sources":["../../../src/cli/ui/refused.ts"],"names":[],"mappings":"AAAA,+GAA+G;AAE/G,6GAA6G;AAC7G,MAAM,OAAO,OAAQ,SAAQ,KAAK;IAIrB,MAAM;IAHC,IAAI,GAAG,SAAS,CAAC;IAEnC,YACW,MAAc,EACvB,OAAe;QAEf,KAAK,CAAC,OAAO,CAAC,CAAC;sBAHN,MAAM;IAIjB,CAAC;CACF"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/** The console's own door to memory's two goldens: what recall ranks, and what a hang-up makes of a call. */
|
|
2
|
+
import type { ExtractionGolden, ExtractionRun, MemoryScore } from "@pinecall/protocol";
|
|
3
|
+
import type { Door } from "../testing/gateway.js";
|
|
4
|
+
/** What this directory holds for memory: the recall golden, and the extraction cases beside it. */
|
|
5
|
+
export interface Roster {
|
|
6
|
+
agent: string | null;
|
|
7
|
+
golden: string | null;
|
|
8
|
+
questions: number;
|
|
9
|
+
cases: string[];
|
|
10
|
+
}
|
|
11
|
+
/** What the server needs from the memory door, and nothing of how it reads a directory. */
|
|
12
|
+
export interface Remembering {
|
|
13
|
+
roster(): Promise<Roster>;
|
|
14
|
+
/** The recall golden, asked of the gateway's own ranking. */
|
|
15
|
+
recall(asked: unknown): Promise<MemoryScore>;
|
|
16
|
+
/** The extraction goldens, through one hang-up's model call each, judged by code. */
|
|
17
|
+
extract(asked: unknown): Promise<ExtractionRun>;
|
|
18
|
+
}
|
|
19
|
+
/** The pieces a run is built from, named so a test can hand in its own. */
|
|
20
|
+
export interface Pieces {
|
|
21
|
+
/** The extraction goldens of this directory, read off the disk. */
|
|
22
|
+
cases: () => Promise<ExtractionGolden[]>;
|
|
23
|
+
/** The cases through the class of this directory, mounted here for the length of the run. */
|
|
24
|
+
extract: (door: Door, cases: ExtractionGolden[]) => Promise<ExtractionRun>;
|
|
25
|
+
/** Where the recall golden is, and which class this directory holds. */
|
|
26
|
+
golden: () => Promise<{
|
|
27
|
+
agent: string | null;
|
|
28
|
+
golden: string | null;
|
|
29
|
+
}>;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* One `Remembering` for the life of a `pinecall run`. Both goldens are FILES of this directory —
|
|
33
|
+
* `memory/golden.json` and `test/memory` — so only the process standing in it can run them, and
|
|
34
|
+
* both are the very ones `pinecall memory eval` and `pinecall remember` run. The models are the
|
|
35
|
+
* gateway's, as they always were: this process sends questions and cases, never a key.
|
|
36
|
+
*/
|
|
37
|
+
export declare function rememberingFrom(door: Door, agent: string | null, pieces?: Pieces): Remembering;
|
|
38
|
+
//# sourceMappingURL=remembering.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remembering.d.ts","sourceRoot":"","sources":["../../../src/cli/ui/remembering.ts"],"names":[],"mappings":"AAAA,6GAA6G;AAK7G,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AASvF,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAKlD,mGAAmG;AACnG,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,2FAA2F;AAC3F,MAAM,WAAW,WAAW;IAC1B,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAC1B,6DAA6D;IAC7D,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAC7C,qFAAqF;IACrF,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;CACjD;AAOD,2EAA2E;AAC3E,MAAM,WAAW,MAAM;IACrB,mEAAmE;IACnE,KAAK,EAAE,MAAM,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC;IACzC,6FAA6F;IAC7F,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,gBAAgB,EAAE,KAAK,OAAO,CAAC,aAAa,CAAC,CAAC;IAC3E,wEAAwE;IACxE,MAAM,EAAE,MAAM,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC,CAAC;CACxE;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,MAAM,GAAG,IAAI,EACpB,MAAM,GAAE,MAAuE,GAC9E,WAAW,CA8Bb"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/** The console's own door to memory's two goldens: what recall ranks, and what a hang-up makes of a call. */
|
|
2
|
+
import { existsSync } from "node:fs";
|
|
3
|
+
import { dirname, join, resolve } from "node:path";
|
|
4
|
+
import { Pinecall } from "../../client/index.js";
|
|
5
|
+
import { mount, slugOf } from "../../runtime/connect.js";
|
|
6
|
+
import { theQuestionsIn } from "../knowledge.js";
|
|
7
|
+
import { load, mountOptions } from "../load.js";
|
|
8
|
+
import { AN_EMPTY_GOLDEN, DEFAULT_GOLDEN, NO_GOLDEN, recalledOn } from "../memory.js";
|
|
9
|
+
import { CASES, extracted, NO_CASES } from "../remember.js";
|
|
10
|
+
import { casesIn } from "../testing/goldens.js";
|
|
11
|
+
import { anObject, aString, maybeNumber } from "./asked.js";
|
|
12
|
+
import { Refusal } from "./refusal.js";
|
|
13
|
+
const NOT_THIS_DIRECTORY = (asked, here) => here === null
|
|
14
|
+
? `no agent class in this directory: run \`pinecall run\` where ${asked}'s agent.tsx is`
|
|
15
|
+
: `this process runs in ${here}'s directory: to run ${asked}'s memory goldens, run \`pinecall run\` there`;
|
|
16
|
+
/**
|
|
17
|
+
* One `Remembering` for the life of a `pinecall run`. Both goldens are FILES of this directory —
|
|
18
|
+
* `memory/golden.json` and `test/memory` — so only the process standing in it can run them, and
|
|
19
|
+
* both are the very ones `pinecall memory eval` and `pinecall remember` run. The models are the
|
|
20
|
+
* gateway's, as they always were: this process sends questions and cases, never a key.
|
|
21
|
+
*/
|
|
22
|
+
export function rememberingFrom(door, agent, pieces = { cases: theCases, extract: inThisProcess, golden: theGolden }) {
|
|
23
|
+
return {
|
|
24
|
+
async roster() {
|
|
25
|
+
const { golden } = await pieces.golden();
|
|
26
|
+
const questions = golden !== null && existsSync(golden) ? theQuestionsIn(golden) : null;
|
|
27
|
+
return {
|
|
28
|
+
agent,
|
|
29
|
+
golden: golden !== null && existsSync(golden) ? golden : null,
|
|
30
|
+
questions: questions?.length ?? 0,
|
|
31
|
+
cases: (await pieces.cases()).map((one) => one.name),
|
|
32
|
+
};
|
|
33
|
+
},
|
|
34
|
+
async recall(asked) {
|
|
35
|
+
const given = anObject(asked, "a golden");
|
|
36
|
+
mine(aString(given, "agent"), agent);
|
|
37
|
+
const { golden } = await pieces.golden();
|
|
38
|
+
if (golden === null || !existsSync(golden))
|
|
39
|
+
throw new Refusal(404, NO_GOLDEN(golden ?? DEFAULT_GOLDEN));
|
|
40
|
+
const questions = theQuestionsIn(golden);
|
|
41
|
+
if (questions === null)
|
|
42
|
+
throw new Refusal(422, AN_EMPTY_GOLDEN(golden));
|
|
43
|
+
return await recalledOn(door, questions, maybeNumber(given, "k", 1, 100));
|
|
44
|
+
},
|
|
45
|
+
async extract(asked) {
|
|
46
|
+
mine(aString(anObject(asked, "a run"), "agent"), agent);
|
|
47
|
+
const cases = await pieces.cases();
|
|
48
|
+
if (cases.length === 0)
|
|
49
|
+
throw new Refusal(404, NO_CASES);
|
|
50
|
+
return await pieces.extract(door, cases);
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
function mine(asked, here) {
|
|
55
|
+
if (asked !== here)
|
|
56
|
+
throw new Refusal(409, NOT_THIS_DIRECTORY(asked, here));
|
|
57
|
+
}
|
|
58
|
+
/** The extraction goldens of `test/memory`, or none at all when this directory has none. */
|
|
59
|
+
async function theCases() {
|
|
60
|
+
return existsSync(CASES) ? await casesIn([], CASES) : [];
|
|
61
|
+
}
|
|
62
|
+
// The class is mounted here for the length of the run, exactly as `pinecall remember` mounts it:
|
|
63
|
+
// the categories a golden may name are the class's own declaration, read off the socket this
|
|
64
|
+
// process opens, and the extraction itself runs where the org's keys are.
|
|
65
|
+
async function inThisProcess(door, cases) {
|
|
66
|
+
const loaded = await load();
|
|
67
|
+
const pc = new Pinecall({ url: door.url, apiKey: door.apiKey });
|
|
68
|
+
const held = mount(loaded.ctor, { ...mountOptions(loaded, pc), takesUnclaimed: false });
|
|
69
|
+
try {
|
|
70
|
+
await pc.connect();
|
|
71
|
+
return await extracted(door, held.slug, cases);
|
|
72
|
+
}
|
|
73
|
+
finally {
|
|
74
|
+
pc.close();
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
/** Where the recall golden of this directory is, and which class it belongs to. */
|
|
78
|
+
async function theGolden() {
|
|
79
|
+
try {
|
|
80
|
+
const loaded = await load();
|
|
81
|
+
return { agent: slugOf(loaded.ctor), golden: resolve(join(dirname(loaded.file), DEFAULT_GOLDEN)) };
|
|
82
|
+
}
|
|
83
|
+
catch {
|
|
84
|
+
return { agent: null, golden: null };
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=remembering.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remembering.js","sourceRoot":"","sources":["../../../src/cli/ui/remembering.ts"],"names":[],"mappings":"AAAA,6GAA6G;AAE7G,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OA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C;AACH,CAAC;AAED,mFAAmF;AACnF,KAAK,UAAU,SAAS;IACtB,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,IAAI,EAAE,CAAC;QAC5B,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,cAAc,CAAC,CAAC,EAAE,CAAC;IACrG,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACvC,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** The console's own door to a broken golden's reproduction: the file the suite left on this disk. */
|
|
2
|
+
/** Which goldens of one run were written out, and where that folder is. */
|
|
3
|
+
export interface Written {
|
|
4
|
+
run: string;
|
|
5
|
+
folder: string;
|
|
6
|
+
goldens: string[];
|
|
7
|
+
}
|
|
8
|
+
/** What the server needs from the reproduction door, and nothing of how it reads a folder. */
|
|
9
|
+
export interface Reproducing {
|
|
10
|
+
/** Which goldens of this run left a file behind. A green run leaves none. */
|
|
11
|
+
roster(asked: unknown): Promise<Written>;
|
|
12
|
+
/** One of them, whole: the golden as written, the requests, the verdicts, the log. */
|
|
13
|
+
read(asked: unknown): Promise<unknown>;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* One `Reproducing` for the life of a `pinecall run`. A reproduction is a FILE the suite left in
|
|
17
|
+
* the directory it ran in — `.pinecall/evals/<run>/<golden>.json` — so the page can only have it
|
|
18
|
+
* through the process standing there. It carries the one thing the log deliberately does not: the
|
|
19
|
+
* requests the model actually answered, region by region, because the log keeps a hash of each
|
|
20
|
+
* prompt block on purpose.
|
|
21
|
+
*/
|
|
22
|
+
export declare function reproducingFrom(under?: string): Reproducing;
|
|
23
|
+
//# sourceMappingURL=reproducing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reproducing.d.ts","sourceRoot":"","sources":["../../../src/cli/ui/reproducing.ts"],"names":[],"mappings":"AAAA,sGAAsG;AAStG,2EAA2E;AAC3E,MAAM,WAAW,OAAO;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,8FAA8F;AAC9F,MAAM,WAAW,WAAW;IAC1B,6EAA6E;IAC7E,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACzC,sFAAsF;IACtF,IAAI,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACxC;AASD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,KAAK,GAAE,MAAsB,GAAG,WAAW,CAyB1E"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/** The console's own door to a broken golden's reproduction: the file the suite left on this disk. */
|
|
2
|
+
import { existsSync, readdirSync, readFileSync } from "node:fs";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { REPRODUCTIONS } from "../testing/reproduction.js";
|
|
5
|
+
import { anObject, aString } from "./asked.js";
|
|
6
|
+
import { Refusal } from "./refusal.js";
|
|
7
|
+
const A_RUN = /^[A-Za-z0-9_-]{1,64}$/;
|
|
8
|
+
const A_GOLDEN = /^[^/\\]{1,120}$/;
|
|
9
|
+
const NOT_HERE = (run) => `no reproduction of ${run} under ${REPRODUCTIONS}: the suite writes them where it was run, ` +
|
|
10
|
+
"and a run that was green wrote none";
|
|
11
|
+
/**
|
|
12
|
+
* One `Reproducing` for the life of a `pinecall run`. A reproduction is a FILE the suite left in
|
|
13
|
+
* the directory it ran in — `.pinecall/evals/<run>/<golden>.json` — so the page can only have it
|
|
14
|
+
* through the process standing there. It carries the one thing the log deliberately does not: the
|
|
15
|
+
* requests the model actually answered, region by region, because the log keeps a hash of each
|
|
16
|
+
* prompt block on purpose.
|
|
17
|
+
*/
|
|
18
|
+
export function reproducingFrom(under = REPRODUCTIONS) {
|
|
19
|
+
return {
|
|
20
|
+
async roster(asked) {
|
|
21
|
+
const run = theRun(asked);
|
|
22
|
+
const folder = join(under, run);
|
|
23
|
+
if (!existsSync(folder))
|
|
24
|
+
throw new Refusal(404, NOT_HERE(run));
|
|
25
|
+
const goldens = readdirSync(folder)
|
|
26
|
+
.filter((name) => name.endsWith(".json"))
|
|
27
|
+
.map((name) => name.slice(0, -".json".length))
|
|
28
|
+
.sort();
|
|
29
|
+
return { run, folder, goldens };
|
|
30
|
+
},
|
|
31
|
+
async read(asked) {
|
|
32
|
+
const given = anObject(asked, "a reproduction");
|
|
33
|
+
const run = theRun(given);
|
|
34
|
+
const golden = aString(given, "golden");
|
|
35
|
+
// A name out of the page is a name off this disk: neither half may climb out of the folder
|
|
36
|
+
// the suite wrote, which is why both are shapes and not just strings.
|
|
37
|
+
if (!A_GOLDEN.test(golden))
|
|
38
|
+
throw new Refusal(422, "a golden is a name, not a path");
|
|
39
|
+
const file = join(under, run, `${golden}.json`);
|
|
40
|
+
if (!existsSync(file))
|
|
41
|
+
throw new Refusal(404, `no reproduction of ${golden} in ${join(under, run)}`);
|
|
42
|
+
return JSON.parse(readFileSync(file, "utf8"));
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
function theRun(asked) {
|
|
47
|
+
const run = aString(anObject(asked, "a reproduction"), "run");
|
|
48
|
+
if (!A_RUN.test(run))
|
|
49
|
+
throw new Refusal(422, "a run is an id, not a path");
|
|
50
|
+
return run;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=reproducing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reproducing.js","sourceRoot":"","sources":["../../../src/cli/ui/reproducing.ts"],"names":[],"mappings":"AAAA,sGAAsG;AAEtG,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE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,EAAE,gBAAgB,CAAC,CAAC;YAChD,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;YAC1B,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;YACxC,2FAA2F;YAC3F,sEAAsE;YACtE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC;gBAAE,MAAM,IAAI,OAAO,CAAC,GAAG,EAAE,gCAAgC,CAAC,CAAC;YACrF,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,MAAM,OAAO,CAAC,CAAC;YAChD,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;gBAAE,MAAM,IAAI,OAAO,CAAC,GAAG,EAAE,sBAAsB,MAAM,OAAO,IAAI,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC;YACrG,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;QAChD,CAAC;KACF,CAAC;AACJ,CAAC;AAED,SAAS,MAAM,CAAC,KAAc;IAC5B,MAAM,GAAG,GAAG,OAAO,CAAC,QAAQ,CAAC,KAAK,EAAE,gBAAgB,CAAC,EAAE,KAAK,CAAC,CAAC;IAC9D,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC;QAAE,MAAM,IAAI,OAAO,CAAC,GAAG,EAAE,4BAA4B,CAAC,CAAC;IAC3E,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** The local server behind `pinecall ui`: the console's files and the gateway's doors, under one nonce on 127.0.0.1. */
|
|
2
|
+
import type { Door } from "../testing/gateway.js";
|
|
3
|
+
import type { OwnDoor } from "./doors.js";
|
|
4
|
+
/**
|
|
5
|
+
* The console's server for the life of one command. Under its nonce it serves the built console
|
|
6
|
+
* and forwards `v1/*` to the gateway with the org key on the header; outside the nonce it answers
|
|
7
|
+
* 404 and nothing else. The key is a field of this object and is written into exactly one place:
|
|
8
|
+
* the authorization header of a request this process makes.
|
|
9
|
+
*/
|
|
10
|
+
export declare class LocalConsole {
|
|
11
|
+
#private;
|
|
12
|
+
private constructor();
|
|
13
|
+
/** Bind the loopback on a free port and serve the console in `files` for this door. */
|
|
14
|
+
static open(door: Door, files: string, own?: OwnDoor[]): Promise<LocalConsole>;
|
|
15
|
+
/** Where the console is: the loopback, the port, the nonce. The one URL that answers anything. */
|
|
16
|
+
get url(): string;
|
|
17
|
+
/** Where one screen of the console is, by the path the console routes. */
|
|
18
|
+
at(path: string): string;
|
|
19
|
+
/** Close every socket and the port. After this, nothing answers at `url`. */
|
|
20
|
+
close(): Promise<void>;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../src/cli/ui/server.ts"],"names":[],"mappings":"AAAA,wHAAwH;AASxH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAoC1C;;;;;GAKG;AACH,qBAAa,YAAY;;IAQvB,OAAO,eAYN;IAED,uFAAuF;IACvF,OAAa,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,GAAE,OAAO,EAAO,GAAG,OAAO,CAAC,YAAY,CAAC,CAIvF;IAED,kGAAkG;IAClG,IAAI,GAAG,IAAI,MAAM,CAEhB;IAED,0EAA0E;IAC1E,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEvB;IAED,6EAA6E;IACvE,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAG3B;CAqHF"}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
/** The local server behind `pinecall ui`: the console's files and the gateway's doors, under one nonce on 127.0.0.1. */
|
|
2
|
+
import { randomBytes } from "node:crypto";
|
|
3
|
+
import { createReadStream, existsSync, readFileSync, statSync } from "node:fs";
|
|
4
|
+
import { createServer } from "node:http";
|
|
5
|
+
import { extname, join, normalize, resolve, sep } from "node:path";
|
|
6
|
+
import { Readable } from "node:stream";
|
|
7
|
+
import { Refusal, refusedAs } from "./refusal.js";
|
|
8
|
+
// Loopback only, and the kernel picks the port: nothing on the network can reach this console,
|
|
9
|
+
// and two `ui`s on one laptop do not fight over a number.
|
|
10
|
+
const LOOPBACK = "127.0.0.1";
|
|
11
|
+
// Everything answers under a random path — the console's files and, with them, the door to the
|
|
12
|
+
// gateway that this process opens with the org key. A process on this machine that scans the
|
|
13
|
+
// loopback finds a port; without the URL this process printed, it finds a 404 and nothing behind
|
|
14
|
+
// it. The key itself never leaves this process: the browser sends requests, this server signs them.
|
|
15
|
+
const NONCE_BYTES = 16;
|
|
16
|
+
// The gateway's doors, as the console asks for them relative to its base. Everything else under
|
|
17
|
+
// the nonce is a file of the console, or the console's page for a screen it routes itself.
|
|
18
|
+
const DOORS = "v1/";
|
|
19
|
+
// This process's OWN doors, beside the gateway's: what only the terminal that typed `ui` can do,
|
|
20
|
+
// because it stands in the agent's directory. Which ones there are is ui/doors.ts, and this
|
|
21
|
+
// server knows no more about them than their paths.
|
|
22
|
+
const OWN = "ui/";
|
|
23
|
+
const TYPES = {
|
|
24
|
+
".html": "text/html; charset=utf-8",
|
|
25
|
+
".js": "text/javascript; charset=utf-8",
|
|
26
|
+
".css": "text/css; charset=utf-8",
|
|
27
|
+
".json": "application/json",
|
|
28
|
+
".map": "application/json",
|
|
29
|
+
".svg": "image/svg+xml",
|
|
30
|
+
".woff2": "font/woff2",
|
|
31
|
+
};
|
|
32
|
+
// The headers a browser's request carries that the gateway needs to see. Everything else — the
|
|
33
|
+
// cookies, the origin, the user agent — is the browser's business and stops here.
|
|
34
|
+
const FORWARDED = ["content-type", "accept", "last-event-id", "range"];
|
|
35
|
+
/**
|
|
36
|
+
* The console's server for the life of one command. Under its nonce it serves the built console
|
|
37
|
+
* and forwards `v1/*` to the gateway with the org key on the header; outside the nonce it answers
|
|
38
|
+
* 404 and nothing else. The key is a field of this object and is written into exactly one place:
|
|
39
|
+
* the authorization header of a request this process makes.
|
|
40
|
+
*/
|
|
41
|
+
export class LocalConsole {
|
|
42
|
+
#server;
|
|
43
|
+
#nonce;
|
|
44
|
+
#door;
|
|
45
|
+
#files;
|
|
46
|
+
#own;
|
|
47
|
+
#url = "";
|
|
48
|
+
constructor(door, files, own) {
|
|
49
|
+
this.#door = door;
|
|
50
|
+
this.#own = own;
|
|
51
|
+
// Resolved, which is what strips a trailing separator: the directory arrives as a URL's path
|
|
52
|
+
// and so ends in one, and `#serve` compares against `#files + sep`. Left as it came, that
|
|
53
|
+
// comparison is `…/console//`, which no file under it starts with, and EVERY request fell
|
|
54
|
+
// through to the page — including the bundle, which the browser then parsed as HTML.
|
|
55
|
+
this.#files = resolve(files);
|
|
56
|
+
this.#nonce = randomBytes(NONCE_BYTES).toString("hex");
|
|
57
|
+
this.#server = createServer((request, response) => {
|
|
58
|
+
void this.#answer(request, response);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
/** Bind the loopback on a free port and serve the console in `files` for this door. */
|
|
62
|
+
static async open(door, files, own = []) {
|
|
63
|
+
const served = new LocalConsole(door, files, own);
|
|
64
|
+
await served.#listen();
|
|
65
|
+
return served;
|
|
66
|
+
}
|
|
67
|
+
/** Where the console is: the loopback, the port, the nonce. The one URL that answers anything. */
|
|
68
|
+
get url() {
|
|
69
|
+
return this.#url;
|
|
70
|
+
}
|
|
71
|
+
/** Where one screen of the console is, by the path the console routes. */
|
|
72
|
+
at(path) {
|
|
73
|
+
return `${this.#url}${path.replace(/^\//, "")}`;
|
|
74
|
+
}
|
|
75
|
+
/** Close every socket and the port. After this, nothing answers at `url`. */
|
|
76
|
+
async close() {
|
|
77
|
+
this.#server.closeAllConnections();
|
|
78
|
+
await new Promise((closed) => this.#server.close(() => closed()));
|
|
79
|
+
}
|
|
80
|
+
async #listen() {
|
|
81
|
+
await new Promise((bound, failed) => {
|
|
82
|
+
this.#server.once("error", failed);
|
|
83
|
+
this.#server.listen(0, LOOPBACK, bound);
|
|
84
|
+
});
|
|
85
|
+
const { port } = this.#server.address();
|
|
86
|
+
this.#url = `http://${LOOPBACK}:${port}/${this.#nonce}/`;
|
|
87
|
+
}
|
|
88
|
+
async #answer(request, response) {
|
|
89
|
+
const asked = new URL(request.url ?? "/", this.#url);
|
|
90
|
+
const under = `/${this.#nonce}/`;
|
|
91
|
+
if (!asked.pathname.startsWith(under)) {
|
|
92
|
+
response.writeHead(404, { "content-type": "text/plain; charset=utf-8" });
|
|
93
|
+
response.end("not here\n");
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
const path = asked.pathname.slice(under.length);
|
|
97
|
+
if (path.startsWith(DOORS)) {
|
|
98
|
+
await this.#forward(request, response, `/${path}${asked.search}`);
|
|
99
|
+
}
|
|
100
|
+
else if (path.startsWith(OWN)) {
|
|
101
|
+
await this.#answerOwn(request, response, path);
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
this.#serve(response, path);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
// The doors this process answers itself, read off the table it was opened with. A refusal
|
|
108
|
+
// travels as FastAPI's would — a status and a `detail` sentence — so the page reads both kinds
|
|
109
|
+
// of door the same way.
|
|
110
|
+
async #answerOwn(request, response, path) {
|
|
111
|
+
const method = request.method ?? "GET";
|
|
112
|
+
const door = this.#own.find((one) => `${OWN}${one.path}` === path);
|
|
113
|
+
const answer = method === "GET" ? door?.get : method === "POST" ? door?.post : undefined;
|
|
114
|
+
try {
|
|
115
|
+
if (answer === undefined)
|
|
116
|
+
throw new Refusal(404, `nothing at ${path}`);
|
|
117
|
+
json(response, 200, await answer(JSON.parse((await whole(request)).toString() || "{}")));
|
|
118
|
+
}
|
|
119
|
+
catch (refused) {
|
|
120
|
+
const said = refusedAs(refused);
|
|
121
|
+
json(response, said.status, { detail: said.detail });
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
// The one place the key is spent. The response streams back as it arrives, which is what a log
|
|
125
|
+
// over SSE needs; a browser that navigates away aborts the request behind it.
|
|
126
|
+
async #forward(request, response, path) {
|
|
127
|
+
const headers = { authorization: `Bearer ${this.#door.apiKey}` };
|
|
128
|
+
for (const name of FORWARDED) {
|
|
129
|
+
const value = request.headers[name];
|
|
130
|
+
if (typeof value === "string")
|
|
131
|
+
headers[name] = value;
|
|
132
|
+
}
|
|
133
|
+
// The response closing before it finished is the browser going away — a tab closed, a screen
|
|
134
|
+
// left — and the door behind it is let go with it. (The request's own `close` is not that: it
|
|
135
|
+
// fires the moment its body has been read.)
|
|
136
|
+
const stopping = new AbortController();
|
|
137
|
+
response.once("close", () => {
|
|
138
|
+
if (!response.writableFinished)
|
|
139
|
+
stopping.abort();
|
|
140
|
+
});
|
|
141
|
+
// A body the console sends is one JSON object, read whole before the door is asked: the
|
|
142
|
+
// doors it writes to take a document, never a stream.
|
|
143
|
+
const method = request.method ?? "GET";
|
|
144
|
+
const body = method === "GET" || method === "HEAD" ? {} : { body: await whole(request) };
|
|
145
|
+
let answered;
|
|
146
|
+
try {
|
|
147
|
+
answered = await fetch(new URL(path, this.#door.url), { method, headers, signal: stopping.signal, ...body });
|
|
148
|
+
}
|
|
149
|
+
catch (failed) {
|
|
150
|
+
if (stopping.signal.aborted)
|
|
151
|
+
return;
|
|
152
|
+
response.writeHead(502, { "content-type": "text/plain; charset=utf-8" });
|
|
153
|
+
response.end(`the gateway did not answer: ${failed instanceof Error ? failed.message : String(failed)}\n`);
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
const relayed = {
|
|
157
|
+
"content-type": answered.headers.get("content-type") ?? "application/octet-stream",
|
|
158
|
+
"cache-control": "no-store",
|
|
159
|
+
};
|
|
160
|
+
// A recording is served in byte ranges so a player can seek; those three headers are the
|
|
161
|
+
// range's own and travel back with it.
|
|
162
|
+
for (const name of ["content-range", "accept-ranges", "content-length"]) {
|
|
163
|
+
const value = answered.headers.get(name);
|
|
164
|
+
if (value !== null)
|
|
165
|
+
relayed[name] = value;
|
|
166
|
+
}
|
|
167
|
+
response.writeHead(answered.status, relayed);
|
|
168
|
+
if (answered.body === null) {
|
|
169
|
+
response.end();
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
const relaying = Readable.fromWeb(answered.body);
|
|
173
|
+
// The browser leaving mid-stream aborts the fetch, and the abort surfaces here as the body's
|
|
174
|
+
// own error. It is the one way a stream is expected to end, not a failure of this process —
|
|
175
|
+
// unheard, it was an uncaught exception that took the whole console down (2026-09-09).
|
|
176
|
+
relaying.on("error", () => response.destroy());
|
|
177
|
+
relaying.pipe(response);
|
|
178
|
+
}
|
|
179
|
+
// A path that names a file of the console is that file; every other path is a screen the console
|
|
180
|
+
// routes itself, so it gets the page. Nothing above the console's directory is ever read.
|
|
181
|
+
#serve(response, path) {
|
|
182
|
+
const file = join(this.#files, normalize(`/${path}`));
|
|
183
|
+
if (!file.startsWith(this.#files + sep) || !existsSync(file) || statSync(file).isDirectory()) {
|
|
184
|
+
response.writeHead(200, { "content-type": TYPES[".html"], "cache-control": "no-store" });
|
|
185
|
+
response.end(this.#page());
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
response.writeHead(200, { "content-type": TYPES[extname(file)] ?? "application/octet-stream" });
|
|
189
|
+
createReadStream(file).pipe(response);
|
|
190
|
+
}
|
|
191
|
+
// Read on every request and not once: a console rebuilt while `ui` runs names new assets in a
|
|
192
|
+
// new page, and a person reloading should get it. The page is served for every screen the
|
|
193
|
+
// console routes itself, at any depth, so its assets are addressed from the base and not from
|
|
194
|
+
// wherever the address bar happens to stand.
|
|
195
|
+
#page() {
|
|
196
|
+
return readFileSync(join(this.#files, "index.html"), "utf8").replace("<head>", `<head><base href="/${this.#nonce}/">`);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
/** One JSON answer, whole. */
|
|
200
|
+
function json(response, status, body) {
|
|
201
|
+
response.writeHead(status, { "content-type": TYPES[".json"], "cache-control": "no-store" });
|
|
202
|
+
response.end(`${JSON.stringify(body)}\n`);
|
|
203
|
+
}
|
|
204
|
+
/** Every byte of a request's body, as one buffer. */
|
|
205
|
+
async function whole(request) {
|
|
206
|
+
const chunks = [];
|
|
207
|
+
for await (const chunk of request)
|
|
208
|
+
chunks.push(Buffer.from(chunk));
|
|
209
|
+
return Buffer.concat(chunks);
|
|
210
|
+
}
|
|
211
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../../src/cli/ui/server.ts"],"names":[],"mappings":"AAAA,wHAAwH;AAExH,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC/E,OAAO,EAAE,YAAY,EAA0D,MAAM,WAAW,CAAC;AAEjG,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAIvC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAElD,+FAA+F;AAC/F,0DAA0D;AAC1D,MAAM,QAAQ,GAAG,WAAW,CAAC;AAE7B,+FAA+F;AAC/F,6FAA6F;AAC7F,iGAAiG;AACjG,oGAAoG;AACpG,MAAM,WAAW,GAAG,EAAE,CAAC;AAEvB,gGAAgG;AAChG,2FAA2F;AAC3F,MAAM,KAAK,GAAG,KAAK,CAAC;AAEpB,iGAAiG;AACjG,4FAA4F;AAC5F,oDAAoD;AACpD,MAAM,GAAG,GAAG,KAAK,CAAC;AAElB,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,0BA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AQ,CAAC,CAAC;IACxC,CAAC;IAED,8FAA8F;IAC9F,0FAA0F;IAC1F,8FAA8F;IAC9F,6CAA6C;IAC7C,KAAK;QACH,OAAO,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,sBAAsB,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC;IACzH,CAAC;CAEF;AAED,8BAA8B;AAC9B,SAAS,IAAI,CAAC,QAAwB,EAAE,MAAc,EAAE,IAAa;IACnE,QAAQ,CAAC,SAAS,CAAC,MAAM,EAAE,EAAE,cAAc,EAAE,KAAK,CAAC,OAAO,CAAE,EAAE,eAAe,EAAE,UAAU,EAAE,CAAC,CAAC;IAC7F,QAAQ,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC5C,CAAC;AAED,qDAAqD;AACrD,KAAK,UAAU,KAAK,CAAC,OAAwB;IAC3C,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,OAAO;QAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAe,CAAC,CAAC,CAAC;IAC7E,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAC/B,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/** The console's own door to a simulated caller: this directory's personas, and one call started from the page. */
|
|
2
|
+
import { aSimulation } from "../simulate.js";
|
|
3
|
+
import { type Persona } from "../testing/caller.js";
|
|
4
|
+
import type { Door } from "../testing/gateway.js";
|
|
5
|
+
/** What the page asks for: the caller, the line, and how far to go. */
|
|
6
|
+
export interface Wanted {
|
|
7
|
+
agent: string;
|
|
8
|
+
persona: string;
|
|
9
|
+
voice: boolean;
|
|
10
|
+
judge: boolean;
|
|
11
|
+
turns: number;
|
|
12
|
+
/** dB under the caller. Only on a spoken line. */
|
|
13
|
+
background_noise?: number | undefined;
|
|
14
|
+
/** Percent of packets lost, as a person types it. Only on a spoken line. */
|
|
15
|
+
packet_loss?: number | undefined;
|
|
16
|
+
}
|
|
17
|
+
/** A persona as the page lists it: enough to pick one, and nothing the model is told. */
|
|
18
|
+
export interface Listed {
|
|
19
|
+
name: string;
|
|
20
|
+
goal: string;
|
|
21
|
+
style: string;
|
|
22
|
+
}
|
|
23
|
+
/** What the door answers: the class this console can simulate against, and its callers. */
|
|
24
|
+
export interface Roster {
|
|
25
|
+
agent: string | null;
|
|
26
|
+
personas: Listed[];
|
|
27
|
+
}
|
|
28
|
+
/** What the server needs from the simulation, and nothing of how it prints. */
|
|
29
|
+
export interface Simulating {
|
|
30
|
+
roster(): Promise<Roster>;
|
|
31
|
+
start(wanted: unknown): Promise<{
|
|
32
|
+
call: string;
|
|
33
|
+
}>;
|
|
34
|
+
}
|
|
35
|
+
/** The pieces a simulation is built from, named so a test can hand in its own. */
|
|
36
|
+
export interface Pieces {
|
|
37
|
+
personas: () => Promise<Persona[]>;
|
|
38
|
+
simulate: typeof aSimulation;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* One `Simulating` for the life of a `pinecall run`: the door it was opened with, the class of the
|
|
42
|
+
* directory it runs in, and where the simulation's own lines go — the terminal that typed `ui`,
|
|
43
|
+
* exactly as `pinecall simulate` prints them. The call itself is watched from the page, off the
|
|
44
|
+
* log, like any other call; nothing here keeps a second transcript.
|
|
45
|
+
*/
|
|
46
|
+
export declare function simulatingFrom(door: Door, agent: string | null, out: NodeJS.WritableStream, pieces?: Pieces): Simulating;
|
|
47
|
+
//# sourceMappingURL=simulating.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"simulating.d.ts","sourceRoot":"","sources":["../../../src/cli/ui/simulating.ts"],"names":[],"mappings":"AAAA,mHAAmH;AAEnH,OAAO,EAAE,WAAW,EAAqC,MAAM,gBAAgB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