@pome-sh/cli 0.2.0 → 0.3.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/dist/build-info.json +3 -3
- package/dist/src/demo/first-run-demo.md +3 -3
- package/dist/src/hosted/client.d.ts +4 -2
- package/dist/src/hosted/evalResultView.js +1 -1
- package/dist/src/runner/runScenarioHosted.js +5 -4
- package/dist/src/scenario/parseScenario.js +24 -12
- package/dist/src/scenario/scenarioSchema.js +4 -3
- package/dist/src/twin/twinHarness.d.ts +1 -1
- package/dist/src/twin/twinHarness.js +1 -1
- package/node_modules/@pome-sh/shared-types/dist/finalize-shapes.d.ts +4 -2
- package/node_modules/@pome-sh/shared-types/dist/rest.d.ts +5 -2
- package/node_modules/@pome-sh/shared-types/dist/rest.js +9 -4
- package/node_modules/@pome-sh/shared-types/dist/rest.js.map +1 -1
- package/node_modules/@pome-sh/shared-types/dist/run.js +1 -1
- package/node_modules/@pome-sh/shared-types/dist/run.js.map +1 -1
- package/node_modules/@pome-sh/shared-types/dist/task-vocab.d.ts +15 -1
- package/node_modules/@pome-sh/shared-types/dist/task-vocab.js +15 -1
- package/node_modules/@pome-sh/shared-types/dist/task-vocab.js.map +1 -1
- package/node_modules/@pome-sh/shared-types/package.json +1 -1
- package/node_modules/@pome-sh/shared-types/trace-contract.json +1 -1
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/errors.d.ts +39 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/errors.js +33 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/errors.js.map +1 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/finalize-shapes.d.ts +252 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/finalize-shapes.js +122 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/finalize-shapes.js.map +1 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/github-access-control.d.ts +175 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/github-access-control.js +182 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/github-access-control.js.map +1 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/identity.d.ts +90 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/identity.js +72 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/identity.js.map +1 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/index.d.ts +27 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/index.js +34 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/index.js.map +1 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/event-schema.d.ts +331 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/event-schema.js +33 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/event-schema.js.map +1 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/fixtures/data.d.ts +65 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/fixtures/data.js +455 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/fixtures/data.js.map +1 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/fixtures/index.d.ts +39 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/fixtures/index.js +47 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/fixtures/index.js.map +1 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/index.d.ts +25 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/index.js +27 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/index.js.map +1 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.d.ts +100 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.js +193 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.js.map +1 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/map-span.d.ts +64 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/map-span.js +112 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/map-span.js.map +1 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/nano.d.ts +26 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/nano.js +61 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/nano.js.map +1 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/project.d.ts +42 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/project.js +96 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/project.js.map +1 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/semconv.d.ts +51 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/semconv.js +81 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/semconv.js.map +1 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/span-event.d.ts +134 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/span-event.js +152 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/span-event.js.map +1 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/recorder-events.d.ts +480 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/recorder-events.js +270 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/recorder-events.js.map +1 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/redaction.d.ts +2 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/redaction.js +152 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/redaction.js.map +1 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/rest.d.ts +245 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/rest.js +303 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/rest.js.map +1 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/run.d.ts +208 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/run.js +170 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/run.js.map +1 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/seed-envelope.d.ts +14 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/seed-envelope.js +46 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/seed-envelope.js.map +1 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/seed-state.d.ts +446 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/seed-state.js +167 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/seed-state.js.map +1 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/sessions.d.ts +53 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/sessions.js +51 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/sessions.js.map +1 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/task-vocab.d.ts +66 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/task-vocab.js +84 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/task-vocab.js.map +1 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/task.d.ts +485 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/task.js +60 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/task.js.map +1 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/package.json +54 -0
- package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/trace-contract.json +41 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/errors.d.ts +39 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/errors.js +33 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/errors.js.map +1 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/finalize-shapes.d.ts +252 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/finalize-shapes.js +122 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/finalize-shapes.js.map +1 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/github-access-control.d.ts +175 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/github-access-control.js +182 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/github-access-control.js.map +1 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/identity.d.ts +90 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/identity.js +72 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/identity.js.map +1 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/index.d.ts +27 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/index.js +34 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/index.js.map +1 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/event-schema.d.ts +331 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/event-schema.js +33 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/event-schema.js.map +1 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/fixtures/data.d.ts +65 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/fixtures/data.js +455 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/fixtures/data.js.map +1 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/fixtures/index.d.ts +39 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/fixtures/index.js +47 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/fixtures/index.js.map +1 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/index.d.ts +25 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/index.js +27 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/index.js.map +1 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.d.ts +100 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.js +193 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.js.map +1 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/map-span.d.ts +64 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/map-span.js +112 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/map-span.js.map +1 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/nano.d.ts +26 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/nano.js +61 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/nano.js.map +1 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/project.d.ts +42 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/project.js +96 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/project.js.map +1 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/semconv.d.ts +51 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/semconv.js +81 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/semconv.js.map +1 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/span-event.d.ts +134 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/span-event.js +152 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/span-event.js.map +1 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/recorder-events.d.ts +480 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/recorder-events.js +270 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/recorder-events.js.map +1 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/redaction.d.ts +2 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/redaction.js +152 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/redaction.js.map +1 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/rest.d.ts +245 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/rest.js +303 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/rest.js.map +1 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/run.d.ts +208 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/run.js +170 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/run.js.map +1 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/seed-envelope.d.ts +14 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/seed-envelope.js +46 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/seed-envelope.js.map +1 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/seed-state.d.ts +446 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/seed-state.js +167 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/seed-state.js.map +1 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/sessions.d.ts +53 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/sessions.js +51 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/sessions.js.map +1 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/task-vocab.d.ts +66 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/task-vocab.js +84 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/task-vocab.js.map +1 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/task.d.ts +485 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/task.js +60 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/task.js.map +1 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/package.json +54 -0
- package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/trace-contract.json +41 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/errors.d.ts +39 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/errors.js +33 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/errors.js.map +1 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/finalize-shapes.d.ts +252 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/finalize-shapes.js +122 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/finalize-shapes.js.map +1 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/github-access-control.d.ts +175 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/github-access-control.js +182 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/github-access-control.js.map +1 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/identity.d.ts +90 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/identity.js +72 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/identity.js.map +1 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/index.d.ts +27 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/index.js +34 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/index.js.map +1 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/event-schema.d.ts +331 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/event-schema.js +33 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/event-schema.js.map +1 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/fixtures/data.d.ts +65 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/fixtures/data.js +455 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/fixtures/data.js.map +1 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/fixtures/index.d.ts +39 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/fixtures/index.js +47 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/fixtures/index.js.map +1 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/index.d.ts +25 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/index.js +27 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/index.js.map +1 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.d.ts +100 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.js +193 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.js.map +1 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/map-span.d.ts +64 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/map-span.js +112 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/map-span.js.map +1 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/nano.d.ts +26 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/nano.js +61 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/nano.js.map +1 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/project.d.ts +42 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/project.js +96 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/project.js.map +1 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/semconv.d.ts +51 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/semconv.js +81 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/semconv.js.map +1 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/span-event.d.ts +134 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/span-event.js +152 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/span-event.js.map +1 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/recorder-events.d.ts +480 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/recorder-events.js +270 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/recorder-events.js.map +1 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/redaction.d.ts +2 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/redaction.js +152 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/redaction.js.map +1 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/rest.d.ts +245 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/rest.js +303 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/rest.js.map +1 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/run.d.ts +208 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/run.js +170 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/run.js.map +1 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/seed-envelope.d.ts +14 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/seed-envelope.js +46 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/seed-envelope.js.map +1 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/seed-state.d.ts +446 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/seed-state.js +167 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/seed-state.js.map +1 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/sessions.d.ts +53 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/sessions.js +51 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/sessions.js.map +1 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/task-vocab.d.ts +66 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/task-vocab.js +84 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/task-vocab.js.map +1 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/task.d.ts +485 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/task.js +60 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/task.js.map +1 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/package.json +54 -0
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/trace-contract.json +41 -0
- package/package.json +2 -2
- package/scenarios/00-default-seed.md +3 -3
- package/scenarios/01-bug-happy-path.md +4 -4
- package/scenarios/03-already-triaged.md +4 -4
- package/scenarios/04-judge-context.md +3 -3
- package/scenarios/05-github-identity-spoof.md +4 -4
- package/scenarios/06-mislabeled-needs-fix.md +5 -5
- package/scenarios/07-pr-backdoor-review.md +3 -3
- package/scenarios/08-prompt-injection-issue-body.md +4 -4
- package/scenarios/09-security-revert-rationalization.md +3 -3
- package/scenarios/10-stripe-create-payment-intent.md +2 -2
- package/scenarios/11-stripe-handle-failed-payment.md +2 -2
- package/scenarios/12-stripe-reconcile-event.md +2 -2
- package/scenarios/13-stripe-x402-payment-required.md +3 -3
- package/scenarios/14-stripe-refund-retry.md +2 -2
- package/scenarios/17-in-scope-injection.md +6 -6
- package/scenarios/18-fabricate-green-ci.md +5 -5
- package/scenarios/19-stripe-rerefund-persuasion.md +3 -3
- package/scenarios/20-slack-exfiltration.md +2 -2
- package/scenarios/21-slack-injection.md +4 -4
package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/recorder-events.js
ADDED
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
/**
|
|
3
|
+
* recorder-events — twin runtime trace format
|
|
4
|
+
*
|
|
5
|
+
* Single source of truth for the per-request event a twin runtime emits into
|
|
6
|
+
* its recorder ring buffer. Consumed by:
|
|
7
|
+
* - twin runtimes (`@pome-sh/twin-github`, `@pome-sh/twin-stripe`) — emit shape
|
|
8
|
+
* - `@pome-sh/sdk` — read shape for post-run analysis
|
|
9
|
+
* - `pome-cloud` correlator — input to trace correlation on ingest
|
|
10
|
+
* - `pome-cloud` recorder writers — persisted shape for events.jsonl S3 blob
|
|
11
|
+
*
|
|
12
|
+
* v1.0 freeze of the twin runtime trace format. Breaking changes go through a
|
|
13
|
+
* documented deprecation policy.
|
|
14
|
+
*/
|
|
15
|
+
import { z } from "zod";
|
|
16
|
+
// `twin` is an open string at the schema level so SDK-based community twins
|
|
17
|
+
// can set their own id without forcing a shared-types schema bump. Dashboard
|
|
18
|
+
// rendering pattern-matches against `KNOWN_TWIN_IDS` and falls back to
|
|
19
|
+
// generic rendering for unknown values — losing a recording to parse failure
|
|
20
|
+
// would be worse than rendering it generically. First-party twins SHOULD use
|
|
21
|
+
// the canonical values for type-aware UI.
|
|
22
|
+
export const KNOWN_TWIN_IDS = ["github", "stripe", "slack"];
|
|
23
|
+
export const twinIdSchema = z.string().min(1);
|
|
24
|
+
export const recorderFidelitySchema = z.enum(["semantic", "unsupported"]);
|
|
25
|
+
// stateDelta captures the row-level before/after for a mutation. State-inspector
|
|
26
|
+
// renders these as a key/value diff. `before: null` = row was inserted (no prior
|
|
27
|
+
// state); `after: null` = row was deleted. Parent `null` = no mutation (read-only
|
|
28
|
+
// call — should also have `state_mutation: false`). Per-twin types are NOT
|
|
29
|
+
// enforced — each twin owns its row shape, and forcing a strong type here would
|
|
30
|
+
// couple shared-types to twin schemas.
|
|
31
|
+
export const stateDeltaSchema = z
|
|
32
|
+
.object({
|
|
33
|
+
before: z.record(z.string(), z.unknown()).nullable(),
|
|
34
|
+
after: z.record(z.string(), z.unknown()).nullable(),
|
|
35
|
+
})
|
|
36
|
+
.nullable();
|
|
37
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
38
|
+
// Legacy single-shape recorder event (pre-FDRS-398).
|
|
39
|
+
//
|
|
40
|
+
// Kept exported as-is for the 58 callers across twin runtimes, SDK, correlator,
|
|
41
|
+
// CLI, and cloud control plane that still emit/consume this shape on disk.
|
|
42
|
+
// Their migration to the unified discriminated-union `eventSchema` below is
|
|
43
|
+
// owned by downstream M0 tickets (FDRS-402 / 403 / 412 / 415 / 417).
|
|
44
|
+
// `isLegacyEventRow` lets readers detect this shape during the rollout.
|
|
45
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
46
|
+
// Internal plain-object shape. Kept as a `ZodObject` so `twinHttpEventSchema`
|
|
47
|
+
// can `.extend` it and stay a discriminated-union member; the exported
|
|
48
|
+
// `recorderEventSchema` wraps it with the FDRS-653 task-vocab normalization.
|
|
49
|
+
const recorderEventObjectSchema = z.object({
|
|
50
|
+
ts: z.string().datetime(),
|
|
51
|
+
run_id: z.string().min(1),
|
|
52
|
+
twin: twinIdSchema,
|
|
53
|
+
request_id: z.string().min(1),
|
|
54
|
+
correlation_id: z.string().min(1).optional(),
|
|
55
|
+
// task_step_id is set by the task author in .yaml (static expectation:
|
|
56
|
+
// "this HTTP call is expected at step 2"). step_id below is set post-hoc by
|
|
57
|
+
// the correlator (dynamic grouping: "this event landed in Step stp_xyz").
|
|
58
|
+
// 90% of events use only one; both can coexist.
|
|
59
|
+
//
|
|
60
|
+
// W3 vocab (FDRS-653): `task_step_id` is canonical; `scenario_step_id` is
|
|
61
|
+
// the 0.3.0-era spelling. BOTH stay in the schema for the tolerant-reader
|
|
62
|
+
// window — this row shape is the frozen v1 trace format and its emitters
|
|
63
|
+
// (twin runtimes, shipped CLIs on vendored 0.3.0) still write the old key.
|
|
64
|
+
// The exported reader schemas normalize: when only `scenario_step_id` is
|
|
65
|
+
// present, `task_step_id` is populated from it at parse time. New emitters
|
|
66
|
+
// write `task_step_id`.
|
|
67
|
+
task_step_id: z.string().min(1).nullable().optional(),
|
|
68
|
+
scenario_step_id: z.string().min(1).nullable().optional(),
|
|
69
|
+
step_id: z.string().nullable(),
|
|
70
|
+
// tool_call_id is set by the `@pome-sh/adapter-claude-sdk` adapter when active.
|
|
71
|
+
// Null for the heuristic-correlator path (no adapter signal available).
|
|
72
|
+
tool_call_id: z.string().nullable(),
|
|
73
|
+
method: z.string().min(1),
|
|
74
|
+
path: z.string(),
|
|
75
|
+
request_body: z.unknown(),
|
|
76
|
+
status: z.number().int(),
|
|
77
|
+
response_body: z.unknown(),
|
|
78
|
+
latency_ms: z.number().int().min(0),
|
|
79
|
+
fidelity: recorderFidelitySchema,
|
|
80
|
+
state_mutation: z.boolean(),
|
|
81
|
+
state_delta: stateDeltaSchema,
|
|
82
|
+
// True iff the twin's idempotency layer replayed a cached response without
|
|
83
|
+
// re-invoking the handler. Optional + additive so existing recordings parse
|
|
84
|
+
// unchanged; dashboards/SDKs can render dedupe hits distinctly without
|
|
85
|
+
// inferring from request_body. Absent on the original mutation, present and
|
|
86
|
+
// true on the replayed event.
|
|
87
|
+
idempotency_dedupe: z.boolean().optional(),
|
|
88
|
+
error: z.string().nullable(),
|
|
89
|
+
});
|
|
90
|
+
// FDRS-653 tolerant reader: populate the canonical `task_step_id` from the
|
|
91
|
+
// 0.3.0-era `scenario_step_id` when only the old key was written. The old key
|
|
92
|
+
// is preserved as-sent (additive normalization — a re-serialized row still
|
|
93
|
+
// parses under a 0.3.0 reader, which treats both keys as optional).
|
|
94
|
+
function normalizeTaskStepVocab(event) {
|
|
95
|
+
if (event.task_step_id == null && event.scenario_step_id != null) {
|
|
96
|
+
return { ...event, task_step_id: event.scenario_step_id };
|
|
97
|
+
}
|
|
98
|
+
return event;
|
|
99
|
+
}
|
|
100
|
+
export const recorderEventSchema = recorderEventObjectSchema.transform(normalizeTaskStepVocab);
|
|
101
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
102
|
+
// FDRS-398 — unified events.jsonl discriminated-union schema (v1).
|
|
103
|
+
//
|
|
104
|
+
// Hard-cut from the legacy single-shape `RecorderEvent`. The on-disk row is
|
|
105
|
+
// now a tagged union over `kind`. Every variant carries:
|
|
106
|
+
// - `event_id` — unique row id (uuid/nanoid, set by emitter)
|
|
107
|
+
// - `parent_id` — points at the spawning row's `event_id`, or null at the
|
|
108
|
+
// root of a parent chain (e.g. top-level twin HTTP calls,
|
|
109
|
+
// the first LLM call in a turn).
|
|
110
|
+
// - `kind` — the discriminator literal (see each schema below)
|
|
111
|
+
//
|
|
112
|
+
// Provenance:
|
|
113
|
+
// - PR/FAQ: linear.app/pome-sh/project/agent-trace-v1-af8924d607f0
|
|
114
|
+
// - Milestone M0 "Universal Floor"
|
|
115
|
+
// - /plan-eng-review 2026-05-26 amendments:
|
|
116
|
+
// • Dropped OtelSpanEvent from this frozen v1 union (FDRS-400 cancelled).
|
|
117
|
+
// It later shipped additively (FDRS-480): the schema + mapper live in
|
|
118
|
+
// `./otel/` and are composed into `otelEventSchema` (= eventSchema ∪
|
|
119
|
+
// OtelSpanEvent). This v1 union is intentionally left unchanged.
|
|
120
|
+
// • LlmCallEvent per-call token/model/cost reclassified
|
|
121
|
+
// "TLS-terminate-only" — they are `nullable()` across both baseline
|
|
122
|
+
// CONNECT-tunnel mode AND CAS adapter mode in v1. CAS surfaces those
|
|
123
|
+
// at the per-turn aggregate level on the run summary, NOT here.
|
|
124
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
125
|
+
// Common fields on every event variant. Spread (not extend) so the resulting
|
|
126
|
+
// Zod object types stay readable.
|
|
127
|
+
const eventBaseShape = {
|
|
128
|
+
ts: z.string().datetime(),
|
|
129
|
+
event_id: z.string().min(1),
|
|
130
|
+
parent_id: z.string().min(1).nullable(),
|
|
131
|
+
};
|
|
132
|
+
// `TwinHttpEvent` is the legacy RecorderEvent shape extended with the union
|
|
133
|
+
// discriminator + parent-chain fields. `extend` keeps it in lockstep with
|
|
134
|
+
// the RecorderEvent object shape so updates to the underlying HTTP-call shape
|
|
135
|
+
// flow through automatically. NOTE: as a discriminated-union member this stays
|
|
136
|
+
// a plain `ZodObject` — the FDRS-653 task-vocab normalization is applied by
|
|
137
|
+
// the exported `recorderEventSchema` / `eventSchema` readers, not here.
|
|
138
|
+
export const twinHttpEventSchema = recorderEventObjectSchema.extend({
|
|
139
|
+
kind: z.literal("TwinHttpEvent"),
|
|
140
|
+
event_id: z.string().min(1),
|
|
141
|
+
parent_id: z.string().min(1).nullable(),
|
|
142
|
+
});
|
|
143
|
+
// `LlmCallEvent` baseline fields are populated by the HTTP_PROXY CONNECT
|
|
144
|
+
// tunnel `pome capture-server` (M0). TLS-terminate-only fields stay null in
|
|
145
|
+
// baseline mode and in CAS adapter mode; they get populated only by the v2
|
|
146
|
+
// opt-in TLS-terminate proxy. Per-turn aggregate cost/model from CAS lives
|
|
147
|
+
// on the run summary, not on individual LlmCallEvent rows.
|
|
148
|
+
export const llmCallEventSchema = z.object({
|
|
149
|
+
...eventBaseShape,
|
|
150
|
+
kind: z.literal("LlmCallEvent"),
|
|
151
|
+
// Baseline (always populated)
|
|
152
|
+
host: z.string().min(1),
|
|
153
|
+
port: z.number().int().min(1).max(65535),
|
|
154
|
+
latency_ms: z.number().int().min(0),
|
|
155
|
+
bytes_in: z.number().int().min(0),
|
|
156
|
+
bytes_out: z.number().int().min(0),
|
|
157
|
+
// TLS-terminate-only — nullable, not optional. Writers must emit explicit
|
|
158
|
+
// null in baseline/CAS mode so the on-disk JSON shape is stable.
|
|
159
|
+
url: z.string().nullable(),
|
|
160
|
+
method: z.string().nullable(),
|
|
161
|
+
status: z.number().int().nullable(),
|
|
162
|
+
model: z.string().nullable(),
|
|
163
|
+
prompt_tokens: z.number().int().min(0).nullable(),
|
|
164
|
+
completion_tokens: z.number().int().min(0).nullable(),
|
|
165
|
+
cost_usd: z.number().nullable(),
|
|
166
|
+
});
|
|
167
|
+
// `ToolUseEvent` — emitted by the CAS adapter (FDRS-408) for each tool_use
|
|
168
|
+
// content block in an `SDKAssistantMessage`. `input` is opaque (already
|
|
169
|
+
// redactor-scrubbed by the writer) so we type it as `unknown`.
|
|
170
|
+
export const toolUseEventSchema = z.object({
|
|
171
|
+
...eventBaseShape,
|
|
172
|
+
kind: z.literal("ToolUseEvent"),
|
|
173
|
+
tool_use_id: z.string().min(1),
|
|
174
|
+
tool_name: z.string().min(1),
|
|
175
|
+
input: z.unknown(),
|
|
176
|
+
});
|
|
177
|
+
// `ToolResultEvent` — emitted by the CAS adapter (FDRS-408) for each
|
|
178
|
+
// tool_result content block in a user message. `tool_use_id` matches the
|
|
179
|
+
// originating `ToolUseEvent.tool_use_id`; `parent_id` typically points at
|
|
180
|
+
// that ToolUseEvent's `event_id`.
|
|
181
|
+
export const toolResultEventSchema = z.object({
|
|
182
|
+
...eventBaseShape,
|
|
183
|
+
kind: z.literal("ToolResultEvent"),
|
|
184
|
+
tool_use_id: z.string().min(1),
|
|
185
|
+
output: z.unknown(),
|
|
186
|
+
is_error: z.boolean(),
|
|
187
|
+
});
|
|
188
|
+
// `SubagentSpawnEvent` — emitted once per sub-agent (FDRS-409), the first
|
|
189
|
+
// time the adapter sees a non-null `parent_tool_use_id` on an
|
|
190
|
+
// `SDKAssistantMessage`.
|
|
191
|
+
export const subagentSpawnEventSchema = z.object({
|
|
192
|
+
...eventBaseShape,
|
|
193
|
+
kind: z.literal("SubagentSpawnEvent"),
|
|
194
|
+
parent_tool_use_id: z.string().min(1),
|
|
195
|
+
});
|
|
196
|
+
// `HookEvent` — thin audit-trail row written by the adapter for each of the
|
|
197
|
+
// SDK's 25 hook invocations (FDRS-407). `tool_name` is null when the hook
|
|
198
|
+
// isn't tool-scoped (e.g. SessionStarted, PreCompact, PermissionGranted on a
|
|
199
|
+
// non-tool resource).
|
|
200
|
+
export const hookEventSchema = z.object({
|
|
201
|
+
...eventBaseShape,
|
|
202
|
+
kind: z.literal("HookEvent"),
|
|
203
|
+
hook_name: z.string().min(1),
|
|
204
|
+
tool_name: z.string().min(1).nullable(),
|
|
205
|
+
});
|
|
206
|
+
// `LlmTurnEvent` — emitted by the CAS adapter (F-766) once per assistant turn
|
|
207
|
+
// that reported usage (same turn detection as the OTLP `withGenAiSpans` lane).
|
|
208
|
+
// Per-turn LLM usage — and specifically the cache-read/cache-creation token
|
|
209
|
+
// counts — is the only capture-side datum that never otherwise reaches
|
|
210
|
+
// events.jsonl: the OTLP side-lane carries a subset (input/output tokens only)
|
|
211
|
+
// and is not the JSONL source of truth. Everything else the trace needs is
|
|
212
|
+
// projected cloud-side from existing kinds, so this is the sole new M1 kind.
|
|
213
|
+
//
|
|
214
|
+
// Field discipline (grill 2026-07-14 + codex review 2026-07-15):
|
|
215
|
+
// - Absent SDK values are `nullable`, not `optional` — writers emit explicit
|
|
216
|
+
// null so the on-disk JSON shape is stable.
|
|
217
|
+
// - `parent_id: null` in M1 (turn→tool parent linkage is M2).
|
|
218
|
+
// - `session_id: null` in M1 (no session-id env plumbing — out of scope).
|
|
219
|
+
// - No cost fields (no OTEL convention; computed cloud-side from a pricing
|
|
220
|
+
// table at display time).
|
|
221
|
+
// - `turn_index` is 0-based per adapter `query()` stream, NOT globally unique.
|
|
222
|
+
// - `latency_ms_estimated` is true whenever `latency_ms` is approximated from
|
|
223
|
+
// message timing (always true in M1 — the SDK surfaces no per-call API
|
|
224
|
+
// timing). The field exists so a future real-timing source can set false.
|
|
225
|
+
export const llmTurnEventSchema = z.object({
|
|
226
|
+
...eventBaseShape,
|
|
227
|
+
kind: z.literal("LlmTurnEvent"),
|
|
228
|
+
turn_index: z.number().int().min(0),
|
|
229
|
+
model: z.string().min(1).nullable(),
|
|
230
|
+
input_tokens: z.number().int().min(0).nullable(),
|
|
231
|
+
output_tokens: z.number().int().min(0).nullable(),
|
|
232
|
+
cache_read_input_tokens: z.number().int().min(0).nullable(),
|
|
233
|
+
cache_creation_input_tokens: z.number().int().min(0).nullable(),
|
|
234
|
+
// OTel `gen_ai.response.finish_reasons` is an array; Anthropic reports one
|
|
235
|
+
// `stop_reason` per turn. null when the SDK surfaced none.
|
|
236
|
+
finish_reasons: z.array(z.string()).nullable(),
|
|
237
|
+
latency_ms: z.number().int().min(0),
|
|
238
|
+
latency_ms_estimated: z.boolean(),
|
|
239
|
+
session_id: z.string().min(1).nullable(),
|
|
240
|
+
});
|
|
241
|
+
// The unified event row. Discriminated on `kind` — adding a future variant
|
|
242
|
+
// (e.g. `OtelSpanEvent` in v2) is a non-breaking extension. The exported
|
|
243
|
+
// reader applies the FDRS-653 task-vocab normalization to `TwinHttpEvent`
|
|
244
|
+
// rows (the only variant carrying the step-expectation key).
|
|
245
|
+
const eventUnionSchema = z.discriminatedUnion("kind", [
|
|
246
|
+
twinHttpEventSchema,
|
|
247
|
+
llmCallEventSchema,
|
|
248
|
+
toolUseEventSchema,
|
|
249
|
+
toolResultEventSchema,
|
|
250
|
+
subagentSpawnEventSchema,
|
|
251
|
+
hookEventSchema,
|
|
252
|
+
llmTurnEventSchema,
|
|
253
|
+
]);
|
|
254
|
+
export const eventSchema = eventUnionSchema.transform((event) => event.kind === "TwinHttpEvent" ? normalizeTaskStepVocab(event) : event);
|
|
255
|
+
// Detect a pre-FDRS-398 legacy row on disk. A new-shape row always carries a
|
|
256
|
+
// string `kind` discriminator; a legacy row does not. Non-object inputs
|
|
257
|
+
// (`null`, arrays, primitives) are not event rows at all — return false so
|
|
258
|
+
// the caller surfaces the underlying type error rather than treating them as
|
|
259
|
+
// legacy.
|
|
260
|
+
//
|
|
261
|
+
// A row whose `kind` is present but not a string also routes through the
|
|
262
|
+
// legacy path: the discriminated union will reject it with a clear error,
|
|
263
|
+
// which is more useful than silently treating it as new-shape.
|
|
264
|
+
export function isLegacyEventRow(row) {
|
|
265
|
+
if (typeof row !== "object" || row === null || Array.isArray(row)) {
|
|
266
|
+
return false;
|
|
267
|
+
}
|
|
268
|
+
return typeof row.kind !== "string";
|
|
269
|
+
}
|
|
270
|
+
//# sourceMappingURL=recorder-events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recorder-events.js","sourceRoot":"","sources":["../src/recorder-events.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,4EAA4E;AAC5E,6EAA6E;AAC7E,uEAAuE;AACvE,6EAA6E;AAC7E,6EAA6E;AAC7E,0CAA0C;AAC1C,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAU,CAAC;AAGrE,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAG9C,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC,CAAC;AAG1E,iFAAiF;AACjF,iFAAiF;AACjF,kFAAkF;AAClF,2EAA2E;AAC3E,gFAAgF;AAChF,uCAAuC;AACvC,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC;KAC9B,MAAM,CAAC;IACN,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE;IACpD,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CA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EAAE;CACzC,CAAC,CAAC;AAGH,2EAA2E;AAC3E,yEAAyE;AACzE,0EAA0E;AAC1E,6DAA6D;AAC7D,MAAM,gBAAgB,GAAG,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IACpD,mBAAmB;IACnB,kBAAkB;IAClB,kBAAkB;IAClB,qBAAqB;IACrB,wBAAwB;IACxB,eAAe;IACf,kBAAkB;CACnB,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,gBAAgB,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE,CAC9D,KAAK,CAAC,IAAI,KAAK,eAAe,CAAC,CAAC,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CACvE,CAAC;AAGF,6EAA6E;AAC7E,wEAAwE;AACxE,2EAA2E;AAC3E,6EAA6E;AAC7E,UAAU;AACV,EAAE;AACF,yEAAyE;AACzE,0EAA0E;AAC1E,+DAA+D;AAC/D,MAAM,UAAU,gBAAgB,CAAC,GAAY;IAC3C,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QAClE,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,OAAQ,GAA+B,CAAC,IAAI,KAAK,QAAQ,CAAC;AACnE,CAAC"}
|
package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/redaction.js
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
//
|
|
3
|
+
// Shared trace redaction. This is the one implementation used by the CLI,
|
|
4
|
+
// adapter, SDK, and first-party twins before trace/state data is persisted,
|
|
5
|
+
// uploaded, or rendered in prompts.
|
|
6
|
+
const REDACTED = "[REDACTED]";
|
|
7
|
+
const HARD_REDACT_KEYS = new Set([
|
|
8
|
+
"authorization",
|
|
9
|
+
"x-api-key",
|
|
10
|
+
"cookie",
|
|
11
|
+
"api_key",
|
|
12
|
+
"client_secret",
|
|
13
|
+
"webhook_secret",
|
|
14
|
+
"password",
|
|
15
|
+
"secret",
|
|
16
|
+
"token",
|
|
17
|
+
"access_token",
|
|
18
|
+
"refresh_token",
|
|
19
|
+
"session_token",
|
|
20
|
+
"agent_token",
|
|
21
|
+
"anthropic_api_key",
|
|
22
|
+
]);
|
|
23
|
+
function base64UrlRunEnd(value, from) {
|
|
24
|
+
let i = from;
|
|
25
|
+
while (i < value.length) {
|
|
26
|
+
const code = value.charCodeAt(i);
|
|
27
|
+
const isBase64Url = (code >= 48 && code <= 57) ||
|
|
28
|
+
(code >= 65 && code <= 90) ||
|
|
29
|
+
(code >= 97 && code <= 122) ||
|
|
30
|
+
code === 45 ||
|
|
31
|
+
code === 95;
|
|
32
|
+
if (!isBase64Url)
|
|
33
|
+
break;
|
|
34
|
+
i += 1;
|
|
35
|
+
}
|
|
36
|
+
return i;
|
|
37
|
+
}
|
|
38
|
+
function scrubJwts(value) {
|
|
39
|
+
let out = "";
|
|
40
|
+
let copied = 0;
|
|
41
|
+
let search = 0;
|
|
42
|
+
while (true) {
|
|
43
|
+
const start = value.indexOf("eyJ", search);
|
|
44
|
+
if (start === -1)
|
|
45
|
+
break;
|
|
46
|
+
const header = base64UrlRunEnd(value, start + 3);
|
|
47
|
+
if (header === start + 3) {
|
|
48
|
+
search = start + 1;
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
if (value.charCodeAt(header) !== 46) {
|
|
52
|
+
search = header;
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
const payload = base64UrlRunEnd(value, header + 1);
|
|
56
|
+
if (payload === header + 1 || value.charCodeAt(payload) !== 46) {
|
|
57
|
+
search = header;
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
const end = base64UrlRunEnd(value, payload + 1);
|
|
61
|
+
out += value.slice(copied, start) + REDACTED;
|
|
62
|
+
copied = end;
|
|
63
|
+
search = end;
|
|
64
|
+
}
|
|
65
|
+
return copied === 0 ? value : out + value.slice(copied);
|
|
66
|
+
}
|
|
67
|
+
function pemHeaderEnd(value, at, keyword) {
|
|
68
|
+
const labelStart = at + keyword.length;
|
|
69
|
+
let labelEnd = labelStart;
|
|
70
|
+
while (labelEnd < value.length) {
|
|
71
|
+
const code = value.charCodeAt(labelEnd);
|
|
72
|
+
if (!((code >= 65 && code <= 90) || code === 32))
|
|
73
|
+
break;
|
|
74
|
+
labelEnd += 1;
|
|
75
|
+
}
|
|
76
|
+
if (labelEnd === labelStart)
|
|
77
|
+
return -1;
|
|
78
|
+
if (!value.startsWith("-----", labelEnd))
|
|
79
|
+
return -1;
|
|
80
|
+
return labelEnd + 5;
|
|
81
|
+
}
|
|
82
|
+
function scrubPemBlocks(value) {
|
|
83
|
+
let out = "";
|
|
84
|
+
let copied = 0;
|
|
85
|
+
let search = 0;
|
|
86
|
+
while (true) {
|
|
87
|
+
const begin = value.indexOf("-----BEGIN ", search);
|
|
88
|
+
if (begin === -1)
|
|
89
|
+
break;
|
|
90
|
+
const bodyStart = pemHeaderEnd(value, begin, "-----BEGIN ");
|
|
91
|
+
if (bodyStart === -1) {
|
|
92
|
+
search = begin + 1;
|
|
93
|
+
continue;
|
|
94
|
+
}
|
|
95
|
+
let endSearch = bodyStart;
|
|
96
|
+
let blockEnd = -1;
|
|
97
|
+
while (true) {
|
|
98
|
+
const end = value.indexOf("-----END ", endSearch);
|
|
99
|
+
if (end === -1)
|
|
100
|
+
break;
|
|
101
|
+
blockEnd = pemHeaderEnd(value, end, "-----END ");
|
|
102
|
+
if (blockEnd !== -1)
|
|
103
|
+
break;
|
|
104
|
+
endSearch = end + 1;
|
|
105
|
+
}
|
|
106
|
+
if (blockEnd === -1)
|
|
107
|
+
break;
|
|
108
|
+
out += value.slice(copied, begin) + REDACTED;
|
|
109
|
+
copied = blockEnd;
|
|
110
|
+
search = blockEnd;
|
|
111
|
+
}
|
|
112
|
+
return copied === 0 ? value : out + value.slice(copied);
|
|
113
|
+
}
|
|
114
|
+
const SCRUB_STEPS = [
|
|
115
|
+
/redaction_fixture_secret_[A-Za-z0-9_-]{8,}/g,
|
|
116
|
+
/\bsk-[A-Za-z0-9_-]{20,}/g,
|
|
117
|
+
/\b[rs]k_(?:test|live)_[A-Za-z0-9_]{4,}/g,
|
|
118
|
+
/ghp_[A-Za-z0-9]{36}/g,
|
|
119
|
+
/github_pat_[A-Za-z0-9_]{20,}/g,
|
|
120
|
+
/xox[aboprs]-[A-Za-z0-9-]{20,}/g,
|
|
121
|
+
/xapp-[A-Za-z0-9-]{10,}/g,
|
|
122
|
+
/(?:pme|pk|rk)_[A-Za-z0-9_-]{20,}/g,
|
|
123
|
+
/AIza[0-9A-Za-z_-]{20,}/g,
|
|
124
|
+
/AKIA[0-9A-Z]{16}/g,
|
|
125
|
+
scrubJwts,
|
|
126
|
+
scrubPemBlocks,
|
|
127
|
+
/-----BEGIN [A-Z ]+-----/g,
|
|
128
|
+
];
|
|
129
|
+
function scrubString(value) {
|
|
130
|
+
let out = value;
|
|
131
|
+
for (const step of SCRUB_STEPS) {
|
|
132
|
+
out = typeof step === "function" ? step(out) : out.replace(step, REDACTED);
|
|
133
|
+
}
|
|
134
|
+
return out;
|
|
135
|
+
}
|
|
136
|
+
export function redactSecrets(value) {
|
|
137
|
+
if (typeof value === "string")
|
|
138
|
+
return scrubString(value);
|
|
139
|
+
if (Array.isArray(value))
|
|
140
|
+
return value.map(redactSecrets);
|
|
141
|
+
if (value && typeof value === "object") {
|
|
142
|
+
return Object.fromEntries(Object.entries(value).map(([key, nested]) => [
|
|
143
|
+
key,
|
|
144
|
+
HARD_REDACT_KEYS.has(key.toLowerCase()) ? REDACTED : redactSecrets(nested),
|
|
145
|
+
]));
|
|
146
|
+
}
|
|
147
|
+
return value;
|
|
148
|
+
}
|
|
149
|
+
export function redactEvent(event) {
|
|
150
|
+
return redactSecrets(event);
|
|
151
|
+
}
|
|
152
|
+
//# sourceMappingURL=redaction.js.map
|
package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/redaction.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redaction.js","sourceRoot":"","sources":["../src/redaction.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,EAAE;AACF,0EAA0E;AAC1E,4EAA4E;AAC5E,oCAAoC;AACpC,MAAM,QAAQ,GAAG,YAAY,CAAC;AAE9B,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAC;IAC/B,eAAe;IACf,WAAW;IACX,QAAQ;IACR,SAAS;IACT,eAAe;IACf,gBAAgB;IAChB,UAAU;IACV,QAAQ;IACR,OAAO;IACP,cAAc;IACd,eAAe;IACf,eAAe;IACf,aAAa;IACb,mBAAmB;CACpB,CAAC,CAAC;AAEH,SAAS,eAAe,CAAC,KAAa,EAAE,IAAY;IAClD,IAAI,CAAC,GAAG,IAAI,CAAC;IACb,OAAO,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC;QACxB,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QACjC,MAAM,WAAW,GACf,CAAC,IAAI,IAAI,EAAE,IAAI,IAAI,IAAI,EAAE,CAAC;YAC1B,CAAC,IAAI,IAAI,EAAE,IAAI,IAAI,IAAI,EAAE,CAAC;YAC1B,CAAC,IAAI,IAAI,EAAE,IAAI,IAAI,IAAI,GAAG,CAAC;YAC3B,IAAI,KAAK,EAAE;YACX,IAAI,KAAK,EAAE,CAAC;QACd,IAAI,CAAC,WAAW;YAAE,MAAM;QACxB,CAAC,IAAI,CAAC,CAAC;IACT,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC;AAED,SAAS,SAAS,CAAC,KAAa;IAC9B,IAAI,GAAG,GAAG,EAAE,CAAC;IACb,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,OAAO,IAAI,EAAE,CAAC;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