@pome-sh/cli 0.4.0 → 0.7.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/README.md +31 -6
- package/dist/build-info.json +3 -3
- package/dist/examples/agents/llm-refund-agent.js +1 -1
- package/dist/src/cli/compile-seeds.js +22 -22
- package/dist/src/cli/default-task.d.ts +2 -2
- package/dist/src/cli/default-task.js +4 -4
- package/dist/src/cli/docs-topics.js +49 -16
- package/dist/src/cli/eval.d.ts +1 -1
- package/dist/src/cli/eval.js +3 -3
- package/dist/src/cli/init-sdk.js +1 -1
- package/dist/src/cli/install.d.ts +4 -41
- package/dist/src/cli/install.js +31 -412
- package/dist/src/cli/main.js +212 -118
- package/dist/src/cli/register.d.ts +4 -22
- package/dist/src/cli/register.js +6 -31
- package/dist/src/cli/session.js +1 -1
- package/dist/src/cli/tasks-catalog.d.ts +25 -0
- package/dist/src/cli/{scenarios-catalog.js → tasks-catalog.js} +9 -9
- package/dist/src/cli/tasks.d.ts +13 -0
- package/dist/src/cli/{scenarios.js → tasks.js} +32 -32
- package/dist/src/demo/agent.js +2 -2
- package/dist/src/demo/runDemo.d.ts +3 -3
- package/dist/src/demo/runDemo.js +14 -14
- package/dist/src/doctor/checks.js +12 -3
- package/dist/src/doctor/render.d.ts +9 -0
- package/dist/src/doctor/render.js +7 -0
- package/dist/src/fix-prompt/prompt.d.ts +3 -3
- package/dist/src/fix-prompt/prompt.js +4 -4
- package/dist/src/hosted/client.d.ts +6 -6
- package/dist/src/hosted/client.js +6 -6
- package/dist/src/hosted/errors.js +1 -1
- package/dist/src/hosted/evalResultCache.d.ts +1 -1
- package/dist/src/hosted/evalResultCache.js +1 -1
- package/dist/src/hosted/evalResultView.d.ts +1 -1
- package/dist/src/hosted/evalResultView.js +1 -1
- package/dist/src/hosted/uploadAndFinalize.d.ts +1 -1
- package/dist/src/hosted/uploadAndFinalize.js +2 -2
- package/dist/src/recorder/artifacts.d.ts +2 -2
- package/dist/src/recorder/inspect.d.ts +3 -3
- package/dist/src/recorder/inspect.js +3 -3
- package/dist/src/runner/captureServerChild.js +1 -1
- package/dist/src/runner/{runScenario.d.ts → runTask.d.ts} +3 -3
- package/dist/src/runner/{runScenario.js → runTask.js} +4 -4
- package/dist/src/runner/{runScenarioCore.d.ts → runTaskCore.d.ts} +2 -2
- package/dist/src/runner/{runScenarioHosted.d.ts → runTaskHosted.d.ts} +6 -6
- package/dist/src/runner/{runScenarioHosted.js → runTaskHosted.js} +12 -12
- package/dist/src/runner/runTrialGroup.d.ts +4 -4
- package/dist/src/runner/runTrialGroup.js +10 -10
- package/dist/src/runner/trialCount.js +1 -1
- package/dist/src/task/parseTask.d.ts +9 -0
- package/dist/src/{scenario/parseScenario.js → task/parseTask.js} +21 -21
- package/dist/src/{scenario → task}/seed-compiler-hosted.d.ts +1 -1
- package/dist/src/{scenario → task}/seed-compiler-hosted.js +1 -1
- package/dist/src/{scenario/scenarioSchema.d.ts → task/taskSchema.d.ts} +4 -4
- package/dist/src/{scenario/scenarioSchema.js → task/taskSchema.js} +6 -6
- package/examples/agents/llm-refund-agent.ts +1 -1
- package/node_modules/@pome-sh/twin-gmail/CHANGELOG.md +5 -0
- package/node_modules/@pome-sh/twin-gmail/package.json +2 -2
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/index.d.ts +1 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/index.js +1 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/index.js.map +1 -1
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/manifest.d.ts +31 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/manifest.js +76 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/manifest.js.map +1 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/rest.d.ts +9 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/rest.js +27 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/rest.js.map +1 -1
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/manifest-schema.json +68 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/package.json +2 -1
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/trace-contract.json +1 -1
- package/node_modules/@pome-sh/twin-slack/package.json +3 -3
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/index.d.ts +1 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/index.js +1 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/index.js.map +1 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/manifest.d.ts +31 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/manifest.js +76 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/manifest.js.map +1 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/rest.d.ts +9 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/rest.js +27 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/rest.js.map +1 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/manifest-schema.json +68 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/package.json +2 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/trace-contract.json +1 -1
- package/node_modules/@pome-sh/twin-stripe/package.json +3 -3
- package/package.json +6 -7
- package/{scenarios → tasks}/00-default-seed.md +1 -1
- package/{scenarios → tasks}/14-stripe-refund-retry.md +1 -1
- package/dist/src/cli/agent-sdk.d.ts +0 -32
- package/dist/src/cli/agent-sdk.js +0 -105
- package/dist/src/cli/embedded-wiring.d.ts +0 -47
- package/dist/src/cli/embedded-wiring.js +0 -443
- package/dist/src/cli/scenarios-catalog.d.ts +0 -25
- package/dist/src/cli/scenarios.d.ts +0 -13
- package/dist/src/cli/skills.d.ts +0 -8
- package/dist/src/cli/skills.js +0 -141
- package/dist/src/scenario/parseScenario.d.ts +0 -9
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/sdk/dist/admin-gate.d.ts +0 -35
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/sdk/dist/admin-gate.js +0 -103
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/sdk/dist/admin-gate.js.map +0 -1
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/sdk/dist/auth.d.ts +0 -100
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/sdk/dist/auth.js +0 -262
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/sdk/dist/auth.js.map +0 -1
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/sdk/dist/build-info.d.ts +0 -7
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/sdk/dist/build-info.js +0 -14
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/sdk/dist/build-info.js.map +0 -1
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/sdk/dist/db.d.ts +0 -44
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/sdk/dist/db.js +0 -113
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/sdk/dist/db.js.map +0 -1
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/sdk/dist/errors.d.ts +0 -24
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/sdk/dist/errors.js +0 -61
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/sdk/dist/errors.js.map +0 -1
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/sdk/dist/failure-injection.d.ts +0 -43
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/sdk/dist/failure-injection.js +0 -160
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/sdk/dist/failure-injection.js.map +0 -1
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/sdk/dist/fidelity-inventory.d.ts +0 -121
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/sdk/dist/fidelity-inventory.js +0 -204
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/sdk/dist/fidelity-inventory.js.map +0 -1
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/sdk/dist/fidelity.d.ts +0 -8
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/sdk/dist/fidelity.js +0 -39
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/sdk/dist/fidelity.js.map +0 -1
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/sdk/dist/index.d.ts +0 -372
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/sdk/dist/index.js +0 -139
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/sdk/dist/index.js.map +0 -1
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/sdk/dist/mcp-jsonrpc.d.ts +0 -10
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/sdk/dist/mcp-jsonrpc.js +0 -221
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/sdk/dist/mcp-jsonrpc.js.map +0 -1
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/sdk/dist/parity.d.ts +0 -61
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/sdk/dist/parity.js +0 -123
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/sdk/dist/parity.js.map +0 -1
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/sdk/dist/recorder.d.ts +0 -120
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/sdk/dist/recorder.js +0 -368
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/sdk/dist/recorder.js.map +0 -1
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/sdk/dist/redaction.d.ts +0 -1
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/sdk/dist/redaction.js +0 -3
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/sdk/dist/redaction.js.map +0 -1
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/sdk/dist/server-helpers.d.ts +0 -54
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/sdk/dist/server-helpers.js +0 -181
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/sdk/dist/server-helpers.js.map +0 -1
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/sdk/dist/server.d.ts +0 -46
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/sdk/dist/server.js +0 -394
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/sdk/dist/server.js.map +0 -1
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/sdk/dist/tool-context.d.ts +0 -8
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/sdk/dist/tool-context.js +0 -22
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/sdk/dist/tool-context.js.map +0 -1
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/sdk/package.json +0 -54
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/errors.d.ts +0 -39
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/errors.js +0 -33
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/errors.js.map +0 -1
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/finalize-shapes.d.ts +0 -254
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/finalize-shapes.js +0 -122
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/finalize-shapes.js.map +0 -1
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/github-access-control.d.ts +0 -175
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/github-access-control.js +0 -182
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/github-access-control.js.map +0 -1
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/identity.d.ts +0 -90
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/identity.js +0 -72
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/identity.js.map +0 -1
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/index.d.ts +0 -27
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/index.js +0 -34
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/index.js.map +0 -1
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/otel/event-schema.d.ts +0 -331
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/otel/event-schema.js +0 -33
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/otel/event-schema.js.map +0 -1
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/otel/fixtures/data.d.ts +0 -65
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/otel/fixtures/data.js +0 -455
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/otel/fixtures/data.js.map +0 -1
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/otel/fixtures/index.d.ts +0 -39
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/otel/fixtures/index.js +0 -47
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/otel/fixtures/index.js.map +0 -1
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/otel/index.d.ts +0 -25
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/otel/index.js +0 -27
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/otel/index.js.map +0 -1
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.d.ts +0 -100
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.js +0 -193
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.js.map +0 -1
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/otel/map-span.d.ts +0 -64
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/otel/map-span.js +0 -112
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/otel/map-span.js.map +0 -1
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/otel/nano.d.ts +0 -26
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/otel/nano.js +0 -61
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/otel/nano.js.map +0 -1
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/otel/project.d.ts +0 -42
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/otel/project.js +0 -104
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/otel/project.js.map +0 -1
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/otel/semconv.d.ts +0 -57
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/otel/semconv.js +0 -102
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/otel/semconv.js.map +0 -1
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/otel/span-event.d.ts +0 -134
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/otel/span-event.js +0 -152
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/otel/span-event.js.map +0 -1
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/recorder-events.d.ts +0 -480
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/recorder-events.js +0 -270
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/recorder-events.js.map +0 -1
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/redaction.d.ts +0 -2
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/redaction.js +0 -152
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/redaction.js.map +0 -1
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/rest.d.ts +0 -248
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/rest.js +0 -308
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/rest.js.map +0 -1
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/run.d.ts +0 -208
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/run.js +0 -170
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/run.js.map +0 -1
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/seed-envelope.d.ts +0 -14
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/seed-envelope.js +0 -46
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/seed-envelope.js.map +0 -1
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/seed-state.d.ts +0 -1006
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/seed-state.js +0 -263
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/seed-state.js.map +0 -1
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/sessions.d.ts +0 -53
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/sessions.js +0 -51
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/sessions.js.map +0 -1
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/task-vocab.d.ts +0 -80
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/task-vocab.js +0 -98
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/task-vocab.js.map +0 -1
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/task.d.ts +0 -859
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/task.js +0 -60
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/dist/task.js.map +0 -1
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/package.json +0 -54
- package/node_modules/@pome-sh/twin-gmail/node_modules/@pome-sh/shared-types/trace-contract.json +0 -41
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/sdk/dist/admin-gate.d.ts +0 -35
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/sdk/dist/admin-gate.js +0 -103
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/sdk/dist/admin-gate.js.map +0 -1
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/sdk/dist/auth.d.ts +0 -100
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/sdk/dist/auth.js +0 -262
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/sdk/dist/auth.js.map +0 -1
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/sdk/dist/build-info.d.ts +0 -7
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/sdk/dist/build-info.js +0 -14
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/sdk/dist/build-info.js.map +0 -1
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/sdk/dist/db.d.ts +0 -44
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/sdk/dist/db.js +0 -113
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/sdk/dist/db.js.map +0 -1
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/sdk/dist/errors.d.ts +0 -24
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/sdk/dist/errors.js +0 -61
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/sdk/dist/errors.js.map +0 -1
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/sdk/dist/failure-injection.d.ts +0 -43
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/sdk/dist/failure-injection.js +0 -160
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/sdk/dist/failure-injection.js.map +0 -1
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/sdk/dist/fidelity-inventory.d.ts +0 -121
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/sdk/dist/fidelity-inventory.js +0 -204
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/sdk/dist/fidelity-inventory.js.map +0 -1
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/sdk/dist/fidelity.d.ts +0 -8
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/sdk/dist/fidelity.js +0 -39
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/sdk/dist/fidelity.js.map +0 -1
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/sdk/dist/index.d.ts +0 -372
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/sdk/dist/index.js +0 -139
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/sdk/dist/index.js.map +0 -1
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/sdk/dist/mcp-jsonrpc.d.ts +0 -10
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/sdk/dist/mcp-jsonrpc.js +0 -221
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/sdk/dist/mcp-jsonrpc.js.map +0 -1
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/sdk/dist/parity.d.ts +0 -61
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/sdk/dist/parity.js +0 -123
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/sdk/dist/parity.js.map +0 -1
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/sdk/dist/recorder.d.ts +0 -120
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/sdk/dist/recorder.js +0 -368
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/sdk/dist/recorder.js.map +0 -1
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/sdk/dist/redaction.d.ts +0 -1
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/sdk/dist/redaction.js +0 -3
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/sdk/dist/redaction.js.map +0 -1
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/sdk/dist/server-helpers.d.ts +0 -54
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/sdk/dist/server-helpers.js +0 -181
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/sdk/dist/server-helpers.js.map +0 -1
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/sdk/dist/server.d.ts +0 -46
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/sdk/dist/server.js +0 -394
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/sdk/dist/server.js.map +0 -1
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/sdk/dist/tool-context.d.ts +0 -8
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/sdk/dist/tool-context.js +0 -22
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/sdk/dist/tool-context.js.map +0 -1
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/sdk/package.json +0 -54
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/admin-gate.d.ts +0 -35
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/admin-gate.js +0 -103
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/admin-gate.js.map +0 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/auth.d.ts +0 -100
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/auth.js +0 -262
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/auth.js.map +0 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/build-info.d.ts +0 -7
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/build-info.js +0 -14
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/build-info.js.map +0 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/db.d.ts +0 -44
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/db.js +0 -113
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/db.js.map +0 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/errors.d.ts +0 -24
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/errors.js +0 -61
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/errors.js.map +0 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/failure-injection.d.ts +0 -43
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/failure-injection.js +0 -160
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/failure-injection.js.map +0 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/fidelity-inventory.d.ts +0 -121
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/fidelity-inventory.js +0 -204
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/fidelity-inventory.js.map +0 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/fidelity.d.ts +0 -8
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/fidelity.js +0 -39
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/fidelity.js.map +0 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/index.d.ts +0 -372
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/index.js +0 -139
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/index.js.map +0 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/mcp-jsonrpc.d.ts +0 -10
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/mcp-jsonrpc.js +0 -221
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/mcp-jsonrpc.js.map +0 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/parity.d.ts +0 -61
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/parity.js +0 -123
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/parity.js.map +0 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/recorder.d.ts +0 -120
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/recorder.js +0 -368
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/recorder.js.map +0 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/redaction.d.ts +0 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/redaction.js +0 -3
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/redaction.js.map +0 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/server-helpers.d.ts +0 -54
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/server-helpers.js +0 -181
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/server-helpers.js.map +0 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/server.d.ts +0 -46
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/server.js +0 -394
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/server.js.map +0 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/tool-context.d.ts +0 -8
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/tool-context.js +0 -22
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/tool-context.js.map +0 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/package.json +0 -54
- package/skills/pome-setup/SKILL.md +0 -150
- package/skills/pome-test/SKILL.md +0 -137
- /package/dist/src/runner/{runScenarioCore.js → runTaskCore.js} +0 -0
- /package/dist/src/{scenario → task}/githubSeedCompat.d.ts +0 -0
- /package/dist/src/{scenario → task}/githubSeedCompat.js +0 -0
- /package/dist/src/{scenario → task}/seed-compiler.d.ts +0 -0
- /package/dist/src/{scenario → task}/seed-compiler.js +0 -0
- /package/dist/src/{scenario → task}/seed-verifier.d.ts +0 -0
- /package/dist/src/{scenario → task}/seed-verifier.js +0 -0
- /package/{scenarios → tasks}/01-bug-happy-path.md +0 -0
- /package/{scenarios → tasks}/01-bug-happy-path.seed.json +0 -0
- /package/{scenarios → tasks}/03-already-triaged.md +0 -0
- /package/{scenarios → tasks}/03-already-triaged.seed.json +0 -0
- /package/{scenarios → tasks}/04-judge-context.md +0 -0
- /package/{scenarios → tasks}/04-judge-context.seed.json +0 -0
- /package/{scenarios → tasks}/05-github-identity-spoof.md +0 -0
- /package/{scenarios → tasks}/05-github-identity-spoof.seed.json +0 -0
- /package/{scenarios → tasks}/06-mislabeled-needs-fix.md +0 -0
- /package/{scenarios → tasks}/06-mislabeled-needs-fix.seed.json +0 -0
- /package/{scenarios → tasks}/07-pr-backdoor-review.md +0 -0
- /package/{scenarios → tasks}/07-pr-backdoor-review.seed.json +0 -0
- /package/{scenarios → tasks}/08-prompt-injection-issue-body.md +0 -0
- /package/{scenarios → tasks}/08-prompt-injection-issue-body.seed.json +0 -0
- /package/{scenarios → tasks}/09-security-revert-rationalization.md +0 -0
- /package/{scenarios → tasks}/09-security-revert-rationalization.seed.json +0 -0
- /package/{scenarios → tasks}/10-stripe-create-payment-intent.md +0 -0
- /package/{scenarios → tasks}/11-stripe-handle-failed-payment.md +0 -0
- /package/{scenarios → tasks}/12-stripe-reconcile-event.md +0 -0
- /package/{scenarios → tasks}/13-stripe-x402-payment-required.md +0 -0
- /package/{scenarios → tasks}/14-stripe-refund-retry.expected-events.jsonl +0 -0
- /package/{scenarios → tasks}/17-in-scope-injection.md +0 -0
- /package/{scenarios → tasks}/17-in-scope-injection.seed.json +0 -0
- /package/{scenarios → tasks}/18-fabricate-green-ci.md +0 -0
- /package/{scenarios → tasks}/18-fabricate-green-ci.seed.json +0 -0
- /package/{scenarios → tasks}/19-stripe-rerefund-persuasion.md +0 -0
- /package/{scenarios → tasks}/19-stripe-rerefund-persuasion.seed.json +0 -0
- /package/{scenarios → tasks}/20-slack-exfiltration.md +0 -0
- /package/{scenarios → tasks}/20-slack-exfiltration.seed.json +0 -0
- /package/{scenarios → tasks}/21-slack-injection.md +0 -0
- /package/{scenarios → tasks}/21-slack-injection.seed.json +0 -0
- /package/{scenarios → tasks}/22-gmail-inbox-triage.md +0 -0
- /package/{scenarios → tasks}/22-gmail-inbox-triage.seed.json +0 -0
- /package/{scenarios → tasks}/23-gmail-first-party-parity.md +0 -0
- /package/{scenarios → tasks}/23-gmail-first-party-parity.seed.json +0 -0
- /package/{scenarios → tasks}/24-linear-issue-triage.md +0 -0
- /package/{scenarios → tasks}/24-linear-issue-triage.seed.json +0 -0
- /package/{scenarios → tasks}/25-linear-comment-label-triage.md +0 -0
- /package/{scenarios → tasks}/25-linear-comment-label-triage.seed.json +0 -0
- /package/{scenarios → tasks}/26-github-linear-handoff.md +0 -0
- /package/{scenarios → tasks}/26-github-linear-handoff.seed.json +0 -0
- /package/{scenarios → tasks}/27-gmail-github-support-escalation.md +0 -0
- /package/{scenarios → tasks}/27-gmail-github-support-escalation.seed.json +0 -0
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import type { RecorderEvent, TwinId } from "@pome-sh/shared-types";
|
|
2
|
-
import type { RecorderHandle } from "./index.js";
|
|
3
|
-
/**
|
|
4
|
-
* Projects a thrown error into the `{ status, body }` shape a route returns.
|
|
5
|
-
* Twin authors override this via `TwinDefinition.errorEnvelope` to preserve
|
|
6
|
-
* the upstream API's error shape (Stripe nests under `{ error: {...} }`;
|
|
7
|
-
* GitHub uses `{ message, documentation_url, errors[] }`; etc).
|
|
8
|
-
*/
|
|
9
|
-
export type ErrorEnvelopeFn = (err: unknown) => {
|
|
10
|
-
status: number;
|
|
11
|
-
body: unknown;
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* Backing store for the twin-core recorder.
|
|
15
|
-
*
|
|
16
|
-
* `record` / `events` are required. `flush` / `close` are optional so existing
|
|
17
|
-
* in-memory callers stay source-compatible; durable stores implement them.
|
|
18
|
-
*/
|
|
19
|
-
export interface RecorderStore {
|
|
20
|
-
record(event: RecorderEvent): void;
|
|
21
|
-
events(): RecorderEvent[];
|
|
22
|
-
/** Event count without the O(N) copy `events()` makes. Optional for custom stores. */
|
|
23
|
-
count?(): number;
|
|
24
|
-
/** Events dropped by a bounded store (stripe pins a 10k cap + dropped counter). */
|
|
25
|
-
dropped?(): number;
|
|
26
|
-
/**
|
|
27
|
-
* Durability barrier. Resolves when every previously accepted event is on
|
|
28
|
-
* the backing medium. Optional for heap-only stores.
|
|
29
|
-
*/
|
|
30
|
-
flush?(): Promise<void>;
|
|
31
|
-
/**
|
|
32
|
-
* Flush + release. Idempotent. Optional for heap-only stores.
|
|
33
|
-
*/
|
|
34
|
-
close?(): Promise<void>;
|
|
35
|
-
}
|
|
36
|
-
export interface RecorderStoreOptions {
|
|
37
|
-
/**
|
|
38
|
-
* Bound the in-memory tape: past `maxEvents` the store drops the OLDEST
|
|
39
|
-
* event and increments the `dropped()` counter (stripe's pre-port
|
|
40
|
-
* D-ENG-10/E-10 recorder behavior). Default: unbounded (github/slack).
|
|
41
|
-
* For file-backed stores this does **not** truncate the NDJSON tape —
|
|
42
|
-
* durability stays append-only; only `events()` is capped.
|
|
43
|
-
*/
|
|
44
|
-
maxEvents?: number;
|
|
45
|
-
}
|
|
46
|
-
export declare function createRecorderStore(options?: RecorderStoreOptions): RecorderStore;
|
|
47
|
-
export interface FileBackedRecorderStoreOptions extends RecorderStoreOptions {
|
|
48
|
-
/**
|
|
49
|
-
* Path to the NDJSON tape (typically a run's `events.jsonl` or a sidecar).
|
|
50
|
-
* Parent directories are created if missing. Opens append-mode.
|
|
51
|
-
*/
|
|
52
|
-
path: string;
|
|
53
|
-
/**
|
|
54
|
-
* When true, each accepted write is `fsync`'d so a `kill -9` loses at most
|
|
55
|
-
* the in-flight event. Default true for the production durable path (F-698).
|
|
56
|
-
*/
|
|
57
|
-
fsync?: boolean;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Env key for the durable recorder tape. When set, twin boot paths and the
|
|
61
|
-
* self-host harness use `createFileBackedRecorderStore` instead of heap-only.
|
|
62
|
-
* Architecture (F-698 / §9 Q3): recorder *transport* lives in twin-core
|
|
63
|
-
* (`packages/sdk`); twins inherit durability by reading this env.
|
|
64
|
-
*/
|
|
65
|
-
export declare const POME_RECORDER_EVENTS_PATH = "POME_RECORDER_EVENTS_PATH";
|
|
66
|
-
/**
|
|
67
|
-
* Wrap a legacy `RecorderEvent` into the unified `TwinHttpEvent` NDJSON row
|
|
68
|
-
* shape used by uploaded `events.jsonl` (FDRS-398). Pass-through only when
|
|
69
|
-
* `kind` is already `"TwinHttpEvent"`; any other kind is re-wrapped so the
|
|
70
|
-
* durable tape never persists a mismatched discriminator. Disk rows from the
|
|
71
|
-
* durable store use this shape so finalize/upload does not need a second wrap
|
|
72
|
-
* for crash-streamed events.
|
|
73
|
-
*/
|
|
74
|
-
export declare function toTwinHttpEventRow(event: RecorderEvent): RecorderEvent & {
|
|
75
|
-
kind: "TwinHttpEvent";
|
|
76
|
-
event_id: string;
|
|
77
|
-
parent_id: null;
|
|
78
|
-
};
|
|
79
|
-
/**
|
|
80
|
-
* Durable recorder store (F-720 contract / F-698 implementation).
|
|
81
|
-
*
|
|
82
|
-
* Keeps an in-memory mirror of legacy `RecorderEvent` rows for `events()` /
|
|
83
|
-
* `GET /_pome/events` (unchanged API), and appends each accepted event as a
|
|
84
|
-
* `TwinHttpEvent` NDJSON line so on-disk `events.jsonl` matches the uploaded
|
|
85
|
-
* raw-trace byte shape. `flush()` drains pending writes and rethrows the
|
|
86
|
-
* first append/fsync failure; `fsync` (default true) bounds crash loss to
|
|
87
|
-
* the in-flight event. `maxEvents` caps only the heap mirror — the NDJSON
|
|
88
|
-
* tape stays append-only.
|
|
89
|
-
*/
|
|
90
|
-
export declare function createFileBackedRecorderStore(options: FileBackedRecorderStoreOptions): RecorderStore;
|
|
91
|
-
/**
|
|
92
|
-
* Resolve the recorder store for a twin boot: durable file-backed when
|
|
93
|
-
* `POME_RECORDER_EVENTS_PATH` is set, otherwise the in-memory default.
|
|
94
|
-
*/
|
|
95
|
-
export declare function resolveRecorderStore(options?: RecorderStoreOptions): RecorderStore;
|
|
96
|
-
export interface RecorderHandleOptions {
|
|
97
|
-
runId: string;
|
|
98
|
-
twin: TwinId;
|
|
99
|
-
store?: RecorderStore;
|
|
100
|
-
/**
|
|
101
|
-
* Projects thrown errors into a route response. Defaults to the generic
|
|
102
|
-
* `{ message, errors? }` envelope; the SDK's `createApp` forwards
|
|
103
|
-
* `definition.errorEnvelope` here so API-mirroring twins control their
|
|
104
|
-
* own error shape without bypassing the recorder middleware.
|
|
105
|
-
*/
|
|
106
|
-
errorEnvelope?: ErrorEnvelopeFn;
|
|
107
|
-
/**
|
|
108
|
-
* FDRS-402 adapter-rich stamping pin (F-682): when true, events persist
|
|
109
|
-
* the incoming `x-pome-correlation-id` header as `tool_call_id` (github's
|
|
110
|
-
* frozen tape shape). Default false — slack's frozen tape stamps null.
|
|
111
|
-
*/
|
|
112
|
-
stampToolCallId?: boolean;
|
|
113
|
-
/**
|
|
114
|
-
* Optional pre-redaction projection (from `TwinDefinition.recordingProjection`).
|
|
115
|
-
* Runs before `redactEvent` so twins can replace raw payloads with digests
|
|
116
|
-
* without bypassing the secret scrubber. Unset = no-op (existing twins).
|
|
117
|
-
*/
|
|
118
|
-
recordingProjection?: (event: RecorderEvent) => RecorderEvent;
|
|
119
|
-
}
|
|
120
|
-
export declare function createRecorderHandle(options: RecorderHandleOptions): RecorderHandle;
|
|
@@ -1,368 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// Twin-core recorder (F-681 / F-720). Home: `packages/sdk/src/recorder.ts`
|
|
3
|
-
// (`@pome-sh/sdk`); all first-party twins and the CLI harness consume it.
|
|
4
|
-
// In-memory recorder + `handle()` helper. `handle({mutation}, fn)` wraps a
|
|
5
|
-
// Hono handler so every wrapped route emits a `RecorderEvent` matching
|
|
6
|
-
// `recording-spec.md` v1.0:
|
|
7
|
-
// - `latency_ms` boundary: start = Date.now() before request body parse,
|
|
8
|
-
// end = Date.now() immediately before c.json() writes the response.
|
|
9
|
-
// - `state_mutation` = the declared route/tool mutation flag.
|
|
10
|
-
// - `error` = response_body.message when status >= 400, null otherwise.
|
|
11
|
-
// - Memory is bounded by session timeout × max-rps.
|
|
12
|
-
// ── Write-through contract (F-720) ──────────────────────────────────────────
|
|
13
|
-
// Acceptance: an event is *accepted* once `RecorderStore.record()` returns.
|
|
14
|
-
// Heap stores retain it in memory; durable stores queue it for append.
|
|
15
|
-
// `flush()` / `close()` are the durability barrier; `record()` is not fsync.
|
|
16
|
-
// Recording pipeline: optional `recordingProjection` (twin-supplied) runs
|
|
17
|
-
// first, then `createRecorderHandle` redacts *before* every `store.record()`
|
|
18
|
-
// call — including custom stores and direct `recorder.record()` — so no
|
|
19
|
-
// store ever sees unredacted secrets. Stores must not re-emit raw bodies.
|
|
20
|
-
// Persisted row shape (F-698): durable stores write one redacted
|
|
21
|
-
// `TwinHttpEvent` NDJSON line per accepted event (shared-types
|
|
22
|
-
// `twinHttpEventSchema`) so on-disk `events.jsonl` matches the uploaded
|
|
23
|
-
// raw-trace byte shape. The in-memory mirror / `GET /_pome/events` still
|
|
24
|
-
// exposes legacy `RecorderEvent` rows.
|
|
25
|
-
// `flush()`: optional. When present, resolves after every accepted event is
|
|
26
|
-
// durable on the store's backing medium (fsync for file-backed). In-memory
|
|
27
|
-
// stores may omit it (no-op if called via a handle that forwards). Callers
|
|
28
|
-
// that need crash-bounded loss (≤ in-flight event) must await `flush()`
|
|
29
|
-
// before relying on the on-disk tape, or use a store that fsyncs on each
|
|
30
|
-
// `record()` (F-698 production default).
|
|
31
|
-
// `close()`: optional. When present, flushes pending writes, releases the
|
|
32
|
-
// backing resource, and is idempotent. After `close()`, further `record()`
|
|
33
|
-
// calls are undefined (stores should throw or no-op). Callers must await
|
|
34
|
-
// `close()` (or at least `flush()`) before upload/finalize so every accepted
|
|
35
|
-
// write has either landed on disk or surfaced as a flush/close error.
|
|
36
|
-
// Bounded stores (`maxEvents`): the cap applies only to the in-memory mirror
|
|
37
|
-
// used by `events()` / `GET /_pome/events` (memory pressure). The durable
|
|
38
|
-
// NDJSON tape is append-only and retains every accepted write — including
|
|
39
|
-
// rows later dropped from the heap mirror — so crash-safe upload reads the
|
|
40
|
-
// tape, not `events()`.
|
|
41
|
-
// Default runtime behavior: `createRecorderStore()` remains heap-only.
|
|
42
|
-
// Set `POME_RECORDER_EVENTS_PATH` (or pass `createFileBackedRecorderStore`)
|
|
43
|
-
// for durable write-through; twin boot resolves via `resolveRecorderStore()`.
|
|
44
|
-
import { randomUUID } from "node:crypto";
|
|
45
|
-
import { closeSync, createWriteStream, fsync, mkdirSync, openSync, } from "node:fs";
|
|
46
|
-
import { dirname } from "node:path";
|
|
47
|
-
import { envelopeFor } from "./errors.js";
|
|
48
|
-
import { redactEvent } from "./redaction.js";
|
|
49
|
-
export function createRecorderStore(options = {}) {
|
|
50
|
-
const items = [];
|
|
51
|
-
const cap = options.maxEvents !== undefined ? Math.max(1, options.maxEvents) : undefined;
|
|
52
|
-
let droppedCount = 0;
|
|
53
|
-
return {
|
|
54
|
-
record(event) {
|
|
55
|
-
items.push(event);
|
|
56
|
-
if (cap !== undefined) {
|
|
57
|
-
while (items.length > cap) {
|
|
58
|
-
items.shift();
|
|
59
|
-
droppedCount += 1;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
events() {
|
|
64
|
-
return [...items];
|
|
65
|
-
},
|
|
66
|
-
count() {
|
|
67
|
-
return items.length;
|
|
68
|
-
},
|
|
69
|
-
dropped() {
|
|
70
|
-
return droppedCount;
|
|
71
|
-
},
|
|
72
|
-
async flush() {
|
|
73
|
-
// Heap-only: accepted === durable for this store.
|
|
74
|
-
},
|
|
75
|
-
async close() {
|
|
76
|
-
// No backing resource.
|
|
77
|
-
},
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Env key for the durable recorder tape. When set, twin boot paths and the
|
|
82
|
-
* self-host harness use `createFileBackedRecorderStore` instead of heap-only.
|
|
83
|
-
* Architecture (F-698 / §9 Q3): recorder *transport* lives in twin-core
|
|
84
|
-
* (`packages/sdk`); twins inherit durability by reading this env.
|
|
85
|
-
*/
|
|
86
|
-
export const POME_RECORDER_EVENTS_PATH = "POME_RECORDER_EVENTS_PATH";
|
|
87
|
-
/**
|
|
88
|
-
* Wrap a legacy `RecorderEvent` into the unified `TwinHttpEvent` NDJSON row
|
|
89
|
-
* shape used by uploaded `events.jsonl` (FDRS-398). Pass-through only when
|
|
90
|
-
* `kind` is already `"TwinHttpEvent"`; any other kind is re-wrapped so the
|
|
91
|
-
* durable tape never persists a mismatched discriminator. Disk rows from the
|
|
92
|
-
* durable store use this shape so finalize/upload does not need a second wrap
|
|
93
|
-
* for crash-streamed events.
|
|
94
|
-
*/
|
|
95
|
-
export function toTwinHttpEventRow(event) {
|
|
96
|
-
const maybeKind = event.kind;
|
|
97
|
-
if (maybeKind === "TwinHttpEvent") {
|
|
98
|
-
const existing = event;
|
|
99
|
-
return {
|
|
100
|
-
...existing,
|
|
101
|
-
event_id: typeof existing.event_id === "string" ? existing.event_id : event.request_id,
|
|
102
|
-
parent_id: null,
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
return {
|
|
106
|
-
...event,
|
|
107
|
-
kind: "TwinHttpEvent",
|
|
108
|
-
event_id: event.request_id,
|
|
109
|
-
parent_id: null,
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* Durable recorder store (F-720 contract / F-698 implementation).
|
|
114
|
-
*
|
|
115
|
-
* Keeps an in-memory mirror of legacy `RecorderEvent` rows for `events()` /
|
|
116
|
-
* `GET /_pome/events` (unchanged API), and appends each accepted event as a
|
|
117
|
-
* `TwinHttpEvent` NDJSON line so on-disk `events.jsonl` matches the uploaded
|
|
118
|
-
* raw-trace byte shape. `flush()` drains pending writes and rethrows the
|
|
119
|
-
* first append/fsync failure; `fsync` (default true) bounds crash loss to
|
|
120
|
-
* the in-flight event. `maxEvents` caps only the heap mirror — the NDJSON
|
|
121
|
-
* tape stays append-only.
|
|
122
|
-
*/
|
|
123
|
-
export function createFileBackedRecorderStore(options) {
|
|
124
|
-
const items = [];
|
|
125
|
-
const cap = options.maxEvents !== undefined ? Math.max(1, options.maxEvents) : undefined;
|
|
126
|
-
let droppedCount = 0;
|
|
127
|
-
let closed = false;
|
|
128
|
-
const doFsync = options.fsync !== false;
|
|
129
|
-
mkdirSync(dirname(options.path), { recursive: true });
|
|
130
|
-
// Open the fd synchronously so fsync never races createWriteStream's
|
|
131
|
-
// async open (which can leave `writer.fd` undefined and silently skip
|
|
132
|
-
// durability on the first write).
|
|
133
|
-
const fd = openSync(options.path, "a");
|
|
134
|
-
const writer = createWriteStream(options.path, { fd, autoClose: false });
|
|
135
|
-
const pending = new Set();
|
|
136
|
-
// First append/fsync failure is retained so a later flush()/close() still
|
|
137
|
-
// reports it even after the rejected promise leaves `pending`.
|
|
138
|
-
let writeFailure = null;
|
|
139
|
-
function enqueueWrite(line) {
|
|
140
|
-
const write = new Promise((resolve, reject) => {
|
|
141
|
-
writer.write(line, (err) => {
|
|
142
|
-
if (err) {
|
|
143
|
-
reject(err);
|
|
144
|
-
return;
|
|
145
|
-
}
|
|
146
|
-
if (!doFsync) {
|
|
147
|
-
resolve();
|
|
148
|
-
return;
|
|
149
|
-
}
|
|
150
|
-
fsync(fd, (fsyncErr) => (fsyncErr ? reject(fsyncErr) : resolve()));
|
|
151
|
-
});
|
|
152
|
-
});
|
|
153
|
-
pending.add(write);
|
|
154
|
-
// Handle rejection here so a failed write before flush() is not an
|
|
155
|
-
// unhandled rejection, and so flush() can still surface the error after
|
|
156
|
-
// the promise has left `pending`.
|
|
157
|
-
void write.then(() => {
|
|
158
|
-
pending.delete(write);
|
|
159
|
-
}, (err) => {
|
|
160
|
-
pending.delete(write);
|
|
161
|
-
if (!writeFailure) {
|
|
162
|
-
writeFailure = err instanceof Error ? err : new Error(String(err));
|
|
163
|
-
}
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
async function flush() {
|
|
167
|
-
while (pending.size > 0) {
|
|
168
|
-
// allSettled: individual failures are already captured in writeFailure;
|
|
169
|
-
// awaiting a rejected member of `pending` must not short-circuit drain.
|
|
170
|
-
await Promise.allSettled([...pending]);
|
|
171
|
-
}
|
|
172
|
-
if (writeFailure) {
|
|
173
|
-
const err = writeFailure;
|
|
174
|
-
writeFailure = null;
|
|
175
|
-
throw err;
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
return {
|
|
179
|
-
record(event) {
|
|
180
|
-
if (closed) {
|
|
181
|
-
throw new Error("RecorderStore.record() after close()");
|
|
182
|
-
}
|
|
183
|
-
items.push(event);
|
|
184
|
-
if (cap !== undefined) {
|
|
185
|
-
while (items.length > cap) {
|
|
186
|
-
items.shift();
|
|
187
|
-
droppedCount += 1;
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
enqueueWrite(`${JSON.stringify(toTwinHttpEventRow(event))}\n`);
|
|
191
|
-
},
|
|
192
|
-
events() {
|
|
193
|
-
return [...items];
|
|
194
|
-
},
|
|
195
|
-
count() {
|
|
196
|
-
return items.length;
|
|
197
|
-
},
|
|
198
|
-
dropped() {
|
|
199
|
-
return droppedCount;
|
|
200
|
-
},
|
|
201
|
-
flush,
|
|
202
|
-
async close() {
|
|
203
|
-
if (closed) {
|
|
204
|
-
await flush();
|
|
205
|
-
return;
|
|
206
|
-
}
|
|
207
|
-
closed = true;
|
|
208
|
-
await flush();
|
|
209
|
-
await new Promise((resolve, reject) => {
|
|
210
|
-
writer.end((err) => {
|
|
211
|
-
try {
|
|
212
|
-
closeSync(fd);
|
|
213
|
-
}
|
|
214
|
-
catch (closeErr) {
|
|
215
|
-
reject(err ?? closeErr);
|
|
216
|
-
return;
|
|
217
|
-
}
|
|
218
|
-
if (err)
|
|
219
|
-
reject(err);
|
|
220
|
-
else
|
|
221
|
-
resolve();
|
|
222
|
-
});
|
|
223
|
-
});
|
|
224
|
-
},
|
|
225
|
-
};
|
|
226
|
-
}
|
|
227
|
-
/**
|
|
228
|
-
* Resolve the recorder store for a twin boot: durable file-backed when
|
|
229
|
-
* `POME_RECORDER_EVENTS_PATH` is set, otherwise the in-memory default.
|
|
230
|
-
*/
|
|
231
|
-
export function resolveRecorderStore(options = {}) {
|
|
232
|
-
const path = process.env[POME_RECORDER_EVENTS_PATH]?.trim();
|
|
233
|
-
if (path) {
|
|
234
|
-
return createFileBackedRecorderStore({ ...options, path });
|
|
235
|
-
}
|
|
236
|
-
return createRecorderStore(options);
|
|
237
|
-
}
|
|
238
|
-
export function createRecorderHandle(options) {
|
|
239
|
-
const store = options.store ?? createRecorderStore();
|
|
240
|
-
const errorEnvelope = options.errorEnvelope ?? envelopeFor;
|
|
241
|
-
const project = options.recordingProjection;
|
|
242
|
-
function accept(event) {
|
|
243
|
-
// Projection (optional) → secret redaction (always). Order is load-bearing:
|
|
244
|
-
// Gmail replaces MIME/attachment bytes with digests before scrubbing.
|
|
245
|
-
store.record(redactEvent(project ? project(event) : event));
|
|
246
|
-
}
|
|
247
|
-
function emit(c, started, requestBody, result, mutation, fidelity, error) {
|
|
248
|
-
const requestId = `req_${randomUUID()}`;
|
|
249
|
-
// FDRS-402 / FDRS-653 stamping (F-683: engine parity with the per-twin
|
|
250
|
-
// recorders it replaces): correlation_id persists the adapter's
|
|
251
|
-
// x-pome-correlation-id (falling back to the request id), and the task
|
|
252
|
-
// author's x-pome-scenario-step-id lands as the canonical task_step_id
|
|
253
|
-
// plus the legacy scenario_step_id key (frozen v1 trace format —
|
|
254
|
-
// preserve semantics, tolerant readers accept either).
|
|
255
|
-
const stepId = c.req.header("x-pome-scenario-step-id") ?? null;
|
|
256
|
-
const correlationHeader = c.req.header("x-pome-correlation-id") ?? null;
|
|
257
|
-
// Redaction is unconditional at the engine layer (F-681 / F-720): every
|
|
258
|
-
// event that reaches any store — including custom stores — is already
|
|
259
|
-
// scrubbed. Optional recordingProjection runs immediately before that.
|
|
260
|
-
accept({
|
|
261
|
-
ts: new Date().toISOString(),
|
|
262
|
-
run_id: options.runId,
|
|
263
|
-
twin: options.twin,
|
|
264
|
-
request_id: requestId,
|
|
265
|
-
correlation_id: correlationHeader ?? requestId,
|
|
266
|
-
task_step_id: stepId,
|
|
267
|
-
scenario_step_id: stepId,
|
|
268
|
-
step_id: null,
|
|
269
|
-
// FDRS-402 adapter-rich path: only twins that pin `stampToolCallId`
|
|
270
|
-
// persist the header here (github); the default tape stamps null.
|
|
271
|
-
tool_call_id: options.stampToolCallId ? correlationHeader : null,
|
|
272
|
-
method: c.req.method,
|
|
273
|
-
path: new URL(c.req.url).pathname,
|
|
274
|
-
request_body: requestBody,
|
|
275
|
-
status: result.status,
|
|
276
|
-
response_body: result.body,
|
|
277
|
-
latency_ms: Date.now() - started,
|
|
278
|
-
fidelity,
|
|
279
|
-
state_mutation: mutation,
|
|
280
|
-
state_delta: result.delta ?? null,
|
|
281
|
-
error,
|
|
282
|
-
});
|
|
283
|
-
}
|
|
284
|
-
return {
|
|
285
|
-
record(event) {
|
|
286
|
-
accept(event);
|
|
287
|
-
},
|
|
288
|
-
events() {
|
|
289
|
-
return store.events();
|
|
290
|
-
},
|
|
291
|
-
count() {
|
|
292
|
-
return store.count?.() ?? store.events().length;
|
|
293
|
-
},
|
|
294
|
-
dropped() {
|
|
295
|
-
return store.dropped?.() ?? 0;
|
|
296
|
-
},
|
|
297
|
-
async flush() {
|
|
298
|
-
await store.flush?.();
|
|
299
|
-
},
|
|
300
|
-
async close() {
|
|
301
|
-
await store.close?.();
|
|
302
|
-
},
|
|
303
|
-
handle({ mutation, fidelity = "semantic", errorEnvelope: perCallEnvelope }, fn) {
|
|
304
|
-
const projectError = perCallEnvelope ?? errorEnvelope;
|
|
305
|
-
return async (c) => {
|
|
306
|
-
const started = Date.now();
|
|
307
|
-
let requestBody = null;
|
|
308
|
-
try {
|
|
309
|
-
requestBody =
|
|
310
|
-
c.req.method === "GET" || c.req.method === "HEAD"
|
|
311
|
-
? null
|
|
312
|
-
: await readRequestJson(c);
|
|
313
|
-
const result = await fn(c);
|
|
314
|
-
const effectiveMutation = result.mutation ?? mutation;
|
|
315
|
-
const errorMsg = result.status >= 400 ? extractMessage(result.body) ?? "request failed" : null;
|
|
316
|
-
emit(c, started, requestBody, result, effectiveMutation, fidelity, errorMsg);
|
|
317
|
-
return respondWith(c, result.status, result.body);
|
|
318
|
-
}
|
|
319
|
-
catch (caught) {
|
|
320
|
-
const envelope = projectError(caught);
|
|
321
|
-
// Failed routes never mutated state — record as state_mutation=false
|
|
322
|
-
// regardless of the declared flag. Per recording-spec § state_mutation,
|
|
323
|
-
// the field reflects whether the request *did* mutate state.
|
|
324
|
-
const errMsg = extractMessage(envelope.body) ??
|
|
325
|
-
(caught instanceof Error ? caught.message : "request failed");
|
|
326
|
-
emit(c, started, requestBody, { status: envelope.status, body: envelope.body }, false, fidelity, errMsg);
|
|
327
|
-
return respondWith(c, envelope.status, envelope.body);
|
|
328
|
-
}
|
|
329
|
-
};
|
|
330
|
-
},
|
|
331
|
-
};
|
|
332
|
-
}
|
|
333
|
-
// The Response constructor forbids a body on null-body statuses (204/205/
|
|
334
|
-
// 304) — `c.json(null, 204)` throws and surfaces as a 500. github's frozen
|
|
335
|
-
// surface answers deletes and the collaborator-membership check with a bare
|
|
336
|
-
// 204 (F-682), so those statuses return an empty body.
|
|
337
|
-
function respondWith(c, status, body) {
|
|
338
|
-
if (status === 204 || status === 205 || status === 304) {
|
|
339
|
-
return c.body(null, status);
|
|
340
|
-
}
|
|
341
|
-
return c.json(body, status);
|
|
342
|
-
}
|
|
343
|
-
// `clone()` throws synchronously once the body stream is disturbed — e.g.
|
|
344
|
-
// after the form token resolver's parseBody() read a form-encoded POST
|
|
345
|
-
// (F-683). A consumed or non-JSON body records as null, never a 500.
|
|
346
|
-
async function readRequestJson(c) {
|
|
347
|
-
try {
|
|
348
|
-
return await c.req.raw.clone().json();
|
|
349
|
-
}
|
|
350
|
-
catch {
|
|
351
|
-
return null;
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
function extractMessage(body) {
|
|
355
|
-
if (!body || typeof body !== "object")
|
|
356
|
-
return undefined;
|
|
357
|
-
const record = body;
|
|
358
|
-
if (typeof record.message === "string")
|
|
359
|
-
return record.message;
|
|
360
|
-
// Gmail (and other Google-style) envelopes nest under `{ error: { message } }`.
|
|
361
|
-
if (record.error && typeof record.error === "object") {
|
|
362
|
-
const nested = record.error.message;
|
|
363
|
-
if (typeof nested === "string")
|
|
364
|
-
return nested;
|
|
365
|
-
}
|
|
366
|
-
return undefined;
|
|
367
|
-
}
|
|
368
|
-
//# sourceMappingURL=recorder.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"recorder.js","sourceRoot":"","sources":["../src/recorder.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,2EAA2E;AAC3E,0EAA0E;AAC1E,2EAA2E;AAC3E,uEAAuE;AACvE,4BAA4B;AAC5B,2EAA2E;AAC3E,wEAAwE;AACxE,gEAAgE;AAChE,0EAA0E;AAC1E,sDAAsD;AACtD,+EAA+E;AAC/E,4EAA4E;AAC5E,uEAAuE;AACvE,6EAA6E;AAC7E,0EAA0E;AAC1E,6EAA6E;AAC7E,wEAAwE;AACxE,0EAA0E;AAC1E,iEAAiE;AACjE,+DA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,CAAC,CAAU,EAAE,MAAc,EAAE,IAAa;IAC5D,IAAI,MAAM,KAAK,GAAG,IAAI,MAAM,KAAK,GAAG,IAAI,MAAM,KAAK,GAAG,EAAE,CAAC;QACvD,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,MAAe,CAAC,CAAC;IACvC,CAAC;IACD,OAAO,CAAC,CAAC,IAAI,CAAC,IAAa,EAAE,MAAe,CAAC,CAAC;AAChD,CAAC;AAED,0EAA0E;AAC1E,uEAAuE;AACvE,qEAAqE;AACrE,KAAK,UAAU,eAAe,CAAC,CAAU;IACvC,IAAI,CAAC;QACH,OAAO,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,CAAC;IACxC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,SAAS,cAAc,CAAC,IAAa;IACnC,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAC;IACxD,MAAM,MAAM,GAAG,IAA8C,CAAC;IAC9D,IAAI,OAAO,MAAM,CAAC,OAAO,KAAK,QAAQ;QAAE,OAAO,MAAM,CAAC,OAAO,CAAC;IAC9D,gFAAgF;IAChF,IAAI,MAAM,CAAC,KAAK,IAAI,OAAO,MAAM,CAAC,KAAK,KAAK,QAAQ,EAAE,CAAC;QACrD,MAAM,MAAM,GAAI,MAAM,CAAC,KAA+B,CAAC,OAAO,CAAC;QAC/D,IAAI,OAAO,MAAM,KAAK,QAAQ;YAAE,OAAO,MAAM,CAAC;IAChD,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { redactEvent, redactSecrets } from "@pome-sh/shared-types/redaction";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"redaction.js","sourceRoot":"","sources":["../src/redaction.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { type ToolSpec, type TwinDefinition } from "./index.js";
|
|
2
|
-
export declare class TwinBootError extends Error {
|
|
3
|
-
constructor(message: string);
|
|
4
|
-
}
|
|
5
|
-
/** Engine-owned `/_pome/*` route names a twin's `pomeRoutes` may not shadow. */
|
|
6
|
-
export declare const POME_CORE_ROUTE_NAMES: Set<string>;
|
|
7
|
-
export declare function makeDeltaSink(): {
|
|
8
|
-
report(d: import("@pome-sh/shared-types").RecorderEvent["state_delta"]): void;
|
|
9
|
-
value(): {
|
|
10
|
-
before: Record<string, unknown> | null;
|
|
11
|
-
after: Record<string, unknown> | null;
|
|
12
|
-
} | null;
|
|
13
|
-
};
|
|
14
|
-
/** Hostnames the boot guard treats as loopback binds. */
|
|
15
|
-
export declare function isLoopbackHost(value: string): boolean;
|
|
16
|
-
/**
|
|
17
|
-
* F-708: self-generate `TWIN_AUTH_SECRET` on first boot. An env-injected
|
|
18
|
-
* secret always wins (pome-cloud injects per-tenant secrets — that contract
|
|
19
|
-
* is untouched), and loopback binds keep the dev-fallback path. Otherwise
|
|
20
|
-
* the secret persisted at the compose-era contract location
|
|
21
|
-
* `.pome-data/<twin>/secret` (cwd-relative; `POME_TWIN_DATA_DIR` overrides
|
|
22
|
-
* the directory) is reused, or a fresh 32-byte hex secret is generated,
|
|
23
|
-
* persisted there, and printed once to stdout so the operator can mint JWTs.
|
|
24
|
-
*
|
|
25
|
-
* The resolved secret lands in `process.env.TWIN_AUTH_SECRET`, which is
|
|
26
|
-
* process-global by design: the engine's auth (`resolveAuthSecret`) reads
|
|
27
|
-
* the env, so one process serves one secret — the frozen boot contract is
|
|
28
|
-
* one twin per process, and a multi-twin process shares the first secret.
|
|
29
|
-
*/
|
|
30
|
-
export declare function ensureTwinAuthSecret(twin: string, host: string): void;
|
|
31
|
-
export declare function shadowedPrefix(routePath: string): string | null;
|
|
32
|
-
export declare function assertUniqueToolNames<TDomain>(tools: ReadonlyArray<ToolSpec<TDomain>>, twinId: string): void;
|
|
33
|
-
export declare function findTool<TDb, TSeed, TDomain>(definition: TwinDefinition<TDb, TSeed, TDomain>, name: string): ToolSpec<TDomain>;
|
|
34
|
-
export declare function readJson(req: Request): Promise<unknown>;
|
|
35
|
-
/**
|
|
36
|
-
* Convenience helper for `recorder.handle` inner functions. Returns a
|
|
37
|
-
* 200 response with the supplied `mutation` flag (default: false). Mirrors
|
|
38
|
-
* `packages/twin-github/src/app.ts:ok`.
|
|
39
|
-
*/
|
|
40
|
-
export declare function ok(body: unknown, mutation?: boolean): {
|
|
41
|
-
status: 200;
|
|
42
|
-
body: unknown;
|
|
43
|
-
mutation: boolean;
|
|
44
|
-
};
|
|
45
|
-
/**
|
|
46
|
-
* Convenience helper for `recorder.handle` inner functions. Returns a
|
|
47
|
-
* 201 response with `mutation: true`. Mirrors
|
|
48
|
-
* `packages/twin-github/src/app.ts:created`.
|
|
49
|
-
*/
|
|
50
|
-
export declare function created(body: unknown): {
|
|
51
|
-
status: 201;
|
|
52
|
-
body: unknown;
|
|
53
|
-
mutation: true;
|
|
54
|
-
};
|