@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,443 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// FDRS-661 — the terminal diff gate: run the wiring agent headless in a
|
|
3
|
-
// SHADOW copy of the repo, collect its edits as one git diff, render the
|
|
4
|
-
// moment-02 file list + unified diff in pome's own terminal, and touch the
|
|
5
|
-
// real working tree only after an explicit [y].
|
|
6
|
-
//
|
|
7
|
-
// Why a shadow workspace instead of canUseTool-deny-and-record: a denied
|
|
8
|
-
// Edit looks like a failure to the agent, which then retries; letting the
|
|
9
|
-
// edits land in an isolated copy keeps the session self-consistent (its
|
|
10
|
-
// Reads see its own writes) and the diff comes from git afterwards, exact
|
|
11
|
-
// and binary-safe. canUseTool still runs on every call — it confines all
|
|
12
|
-
// file paths to the shadow root (a live probe caught the model reaching
|
|
13
|
-
// for $HOME on turn one) and refuses tools outside the whitelist.
|
|
14
|
-
//
|
|
15
|
-
// The user's `.claude/` is deliberately NOT copied into the shadow:
|
|
16
|
-
// settings-file allow rules would shadow the canUseTool gate (the SDK
|
|
17
|
-
// warns about exactly this), and the only skill the session needs is the
|
|
18
|
-
// pome-setup skill pome injects itself.
|
|
19
|
-
import { execFile } from "node:child_process";
|
|
20
|
-
import { existsSync, realpathSync } from "node:fs";
|
|
21
|
-
import { cp, lstat, mkdir, mkdtemp, readdir, rm, writeFile } from "node:fs/promises";
|
|
22
|
-
import { tmpdir } from "node:os";
|
|
23
|
-
import { isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
24
|
-
import { promisify } from "node:util";
|
|
25
|
-
const execFileAsync = promisify(execFile);
|
|
26
|
-
/** Tools the staging session may use. Everything else — Bash above all —
|
|
27
|
-
* is refused: package installs and verification are pome's job, after
|
|
28
|
-
* the diff is approved. NOTE: never mirror these into `allowedTools`;
|
|
29
|
-
* bare allowedTools entries auto-approve before canUseTool is consulted. */
|
|
30
|
-
export const STAGING_TOOLS = ["Read", "Edit", "Write", "Glob", "Grep"];
|
|
31
|
-
/** First message of the headless session. The pome-setup skill (injected
|
|
32
|
-
* into the shadow's .claude/skills) carries the wiring knowledge; this
|
|
33
|
-
* adapts its interactive contract to staging: edits land automatically,
|
|
34
|
-
* the human approves ONE combined diff in pome's terminal afterwards. */
|
|
35
|
-
export const EMBEDDED_KICKOFF_PROMPT = [
|
|
36
|
-
"Use the pome-setup skill to wire this repository to pome (adapter-first:",
|
|
37
|
-
"withPome() + env-injected base URL). You are running non-interactively",
|
|
38
|
-
"inside a staged copy of the repo:",
|
|
39
|
-
"- There is no user to ask questions mid-session. Where the skill says to",
|
|
40
|
-
" pause and confirm, proceed with the best-evidence interpretation and",
|
|
41
|
-
" note the assumption in your final summary.",
|
|
42
|
-
"- Your edits are staged automatically; pome renders the combined diff for",
|
|
43
|
-
" the user's approval after this session. That is the skill's diff-approval",
|
|
44
|
-
" gate — do not wait for per-edit approval.",
|
|
45
|
-
"- Do not run package installs or shell commands: add dependencies by",
|
|
46
|
-
" editing package.json only. pome runs the install after the diff is",
|
|
47
|
-
" applied.",
|
|
48
|
-
"- Do not run pome doctor — pome verifies the wiring itself after applying.",
|
|
49
|
-
"When the wiring edits are complete, end the session with a one-line",
|
|
50
|
-
"summary. If you cannot produce the wiring, make no edits and end with a",
|
|
51
|
-
"short explanation of why.",
|
|
52
|
-
].join("\n");
|
|
53
|
-
export async function runEmbeddedWiring(options) {
|
|
54
|
-
const log = options.log ?? ((line) => console.error(line));
|
|
55
|
-
const shadow = await mkdtemp(join(tmpdir(), "pome-install-staging-"));
|
|
56
|
-
try {
|
|
57
|
-
const skippedLinks = await populateShadow(options.cwd, shadow);
|
|
58
|
-
if (skippedLinks.length > 0) {
|
|
59
|
-
log(`(symlinks stay out of the staged copy: ${skippedLinks.slice(0, 3).join(", ")}${skippedLinks.length > 3 ? ` +${skippedLinks.length - 3} more` : ""})`);
|
|
60
|
-
}
|
|
61
|
-
await mkdir(join(shadow, ".claude", "skills"), { recursive: true });
|
|
62
|
-
await cp(options.skillSourceDir, join(shadow, ".claude", "skills", "pome-setup"), {
|
|
63
|
-
recursive: true,
|
|
64
|
-
});
|
|
65
|
-
await gitIn(shadow, ["init", "-q"]);
|
|
66
|
-
await gitIn(shadow, ["add", "-A"]);
|
|
67
|
-
await gitIn(shadow, ["commit", "-q", "-m", "pome staging baseline"]);
|
|
68
|
-
const session = await runStagingSession(options, shadow, log);
|
|
69
|
-
if (session.kind === "session-error")
|
|
70
|
-
return session;
|
|
71
|
-
// Everything the session staged, as one diff — the injected .claude/
|
|
72
|
-
// (skill + any settings the agent might have written) never leaves
|
|
73
|
-
// the shadow.
|
|
74
|
-
await gitIn(shadow, ["add", "-A"]);
|
|
75
|
-
const exclude = [".", `:(exclude).claude`];
|
|
76
|
-
const { stdout: nameStatus } = await gitIn(shadow, [
|
|
77
|
-
"diff",
|
|
78
|
-
"--staged",
|
|
79
|
-
"--name-status",
|
|
80
|
-
"-M",
|
|
81
|
-
"--",
|
|
82
|
-
...exclude,
|
|
83
|
-
]);
|
|
84
|
-
const changes = parseNameStatus(nameStatus);
|
|
85
|
-
if (changes.length === 0) {
|
|
86
|
-
return {
|
|
87
|
-
kind: "no-diff",
|
|
88
|
-
reason: session.summary || "the agent session ended without staging any edits",
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
const { stdout: numstat } = await gitIn(shadow, [
|
|
92
|
-
"diff",
|
|
93
|
-
"--staged",
|
|
94
|
-
"--numstat",
|
|
95
|
-
"-M",
|
|
96
|
-
"--",
|
|
97
|
-
...exclude,
|
|
98
|
-
]);
|
|
99
|
-
const { stdout: patch } = await gitIn(shadow, [
|
|
100
|
-
"diff",
|
|
101
|
-
"--staged",
|
|
102
|
-
"--binary",
|
|
103
|
-
"-M",
|
|
104
|
-
"--",
|
|
105
|
-
...exclude,
|
|
106
|
-
]);
|
|
107
|
-
log("");
|
|
108
|
-
log("here's what it will change:");
|
|
109
|
-
log("");
|
|
110
|
-
for (const line of renderFileList(changes, parseNumstat(numstat)))
|
|
111
|
-
log(line);
|
|
112
|
-
log("");
|
|
113
|
-
for (const line of renderUnifiedDiff(patch))
|
|
114
|
-
log(line);
|
|
115
|
-
log("");
|
|
116
|
-
if (!(await options.confirm("apply these changes? [y/N] "))) {
|
|
117
|
-
return { kind: "declined" };
|
|
118
|
-
}
|
|
119
|
-
const patchFile = join(shadow, ".pome-staged.patch");
|
|
120
|
-
await writeFile(patchFile, patch);
|
|
121
|
-
await execFileAsync("git", ["apply", "--whitespace=nowarn", patchFile], {
|
|
122
|
-
cwd: options.cwd,
|
|
123
|
-
});
|
|
124
|
-
log(`✓ wrote ${changes.length} file${changes.length === 1 ? "" : "s"}`);
|
|
125
|
-
return {
|
|
126
|
-
kind: "applied",
|
|
127
|
-
files: changes.length,
|
|
128
|
-
// Any package.json in the tree, not just the root — in a workspace the
|
|
129
|
-
// wiring may add the adapter to a nested package's manifest.
|
|
130
|
-
packageJsonChanged: changes.some((c) => c.path === "package.json" || c.path.endsWith("/package.json")),
|
|
131
|
-
};
|
|
132
|
-
}
|
|
133
|
-
finally {
|
|
134
|
-
await rm(shadow, { recursive: true, force: true });
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
// ---------------------------------------------------------------------------
|
|
138
|
-
// Shadow population
|
|
139
|
-
/** Copy the repo into the shadow: tracked + untracked-but-not-ignored files
|
|
140
|
-
* when git is available, a filtered walk otherwise. `.git` and `.claude`
|
|
141
|
-
* never cross (see module header), and neither do SYMLINKS: a tracked link
|
|
142
|
-
* copied verbatim would carry a pointer out of the shadow that the agent's
|
|
143
|
-
* Read/Write could follow past the canUseTool path fence. Skipped links
|
|
144
|
-
* are returned so the caller can say so instead of silently dropping them.
|
|
145
|
-
*/
|
|
146
|
-
async function populateShadow(cwd, shadow) {
|
|
147
|
-
const skippedLinks = [];
|
|
148
|
-
let files = null;
|
|
149
|
-
try {
|
|
150
|
-
const { stdout } = await execFileAsync("git", ["ls-files", "-co", "--exclude-standard", "-z"], { cwd, maxBuffer: 64 * 1024 * 1024 });
|
|
151
|
-
files = stdout.split("\0").filter(Boolean);
|
|
152
|
-
}
|
|
153
|
-
catch {
|
|
154
|
-
files = null; // not a git repo (or no git) — fall through to the walk
|
|
155
|
-
}
|
|
156
|
-
if (files) {
|
|
157
|
-
for (const file of files) {
|
|
158
|
-
if (file === ".claude" || file.startsWith(`.claude${sep}`) || file.startsWith(".claude/")) {
|
|
159
|
-
continue;
|
|
160
|
-
}
|
|
161
|
-
const from = join(cwd, file);
|
|
162
|
-
let stat;
|
|
163
|
-
try {
|
|
164
|
-
stat = await lstat(from);
|
|
165
|
-
}
|
|
166
|
-
catch {
|
|
167
|
-
continue; // ls-files can list deleted-but-tracked paths
|
|
168
|
-
}
|
|
169
|
-
if (stat.isSymbolicLink()) {
|
|
170
|
-
skippedLinks.push(file);
|
|
171
|
-
continue;
|
|
172
|
-
}
|
|
173
|
-
if (!stat.isFile())
|
|
174
|
-
continue;
|
|
175
|
-
const to = join(shadow, file);
|
|
176
|
-
await mkdir(join(to, ".."), { recursive: true });
|
|
177
|
-
await cp(from, to, { recursive: false, verbatimSymlinks: true });
|
|
178
|
-
}
|
|
179
|
-
return skippedLinks;
|
|
180
|
-
}
|
|
181
|
-
const SKIP = new Set([".git", ".claude", "node_modules"]);
|
|
182
|
-
const walk = async (rel) => {
|
|
183
|
-
const entries = await readdir(join(cwd, rel), { withFileTypes: true });
|
|
184
|
-
for (const entry of entries) {
|
|
185
|
-
if (SKIP.has(entry.name))
|
|
186
|
-
continue;
|
|
187
|
-
const childRel = rel ? join(rel, entry.name) : entry.name;
|
|
188
|
-
if (entry.isSymbolicLink()) {
|
|
189
|
-
// Dirent methods don't dereference — mirror the git branch: skip
|
|
190
|
-
// links (whether they point at files or directories) and say so.
|
|
191
|
-
skippedLinks.push(childRel);
|
|
192
|
-
}
|
|
193
|
-
else if (entry.isDirectory()) {
|
|
194
|
-
await mkdir(join(shadow, childRel), { recursive: true });
|
|
195
|
-
await walk(childRel);
|
|
196
|
-
}
|
|
197
|
-
else if (entry.isFile()) {
|
|
198
|
-
await mkdir(join(shadow, childRel, ".."), { recursive: true });
|
|
199
|
-
await cp(join(cwd, childRel), join(shadow, childRel));
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
};
|
|
203
|
-
await walk("");
|
|
204
|
-
return skippedLinks;
|
|
205
|
-
}
|
|
206
|
-
function gitIn(cwd, args) {
|
|
207
|
-
return execFileAsync("git", [
|
|
208
|
-
// The shadow is throwaway: never touch the user's git identity/config.
|
|
209
|
-
"-c",
|
|
210
|
-
"user.email=install@pome.sh",
|
|
211
|
-
"-c",
|
|
212
|
-
"user.name=pome install",
|
|
213
|
-
"-c",
|
|
214
|
-
"commit.gpgsign=false",
|
|
215
|
-
"-c",
|
|
216
|
-
"core.autocrlf=false",
|
|
217
|
-
...args,
|
|
218
|
-
], { cwd, maxBuffer: 64 * 1024 * 1024 });
|
|
219
|
-
}
|
|
220
|
-
// ---------------------------------------------------------------------------
|
|
221
|
-
// The staging session
|
|
222
|
-
async function runStagingSession(options, shadow, log) {
|
|
223
|
-
const canUseTool = buildStagingCanUseTool(shadow, log);
|
|
224
|
-
let summary = "";
|
|
225
|
-
let sessionError = null;
|
|
226
|
-
const iterator = options.query({
|
|
227
|
-
prompt: EMBEDDED_KICKOFF_PROMPT,
|
|
228
|
-
options: {
|
|
229
|
-
cwd: shadow,
|
|
230
|
-
pathToClaudeCodeExecutable: options.claudePath,
|
|
231
|
-
permissionMode: "default",
|
|
232
|
-
systemPrompt: { type: "preset", preset: "claude_code" },
|
|
233
|
-
// Load the injected pome-setup skill from the shadow's .claude/skills.
|
|
234
|
-
settingSources: ["project"],
|
|
235
|
-
skills: "all",
|
|
236
|
-
tools: [...STAGING_TOOLS],
|
|
237
|
-
maxTurns: 80,
|
|
238
|
-
canUseTool,
|
|
239
|
-
},
|
|
240
|
-
});
|
|
241
|
-
try {
|
|
242
|
-
for await (const message of iterator) {
|
|
243
|
-
const type = message.type;
|
|
244
|
-
if (type === "assistant") {
|
|
245
|
-
for (const line of assistantTextLines(message))
|
|
246
|
-
log(dim(` ${line}`));
|
|
247
|
-
}
|
|
248
|
-
else if (type === "result") {
|
|
249
|
-
const subtype = message.subtype;
|
|
250
|
-
if (subtype === "success") {
|
|
251
|
-
summary = typeof message.result === "string" ? message.result.trim() : "";
|
|
252
|
-
}
|
|
253
|
-
else {
|
|
254
|
-
const errors = Array.isArray(message.errors) ? message.errors.join("; ") : subtype;
|
|
255
|
-
sessionError = `agent session ended without finishing: ${errors ?? "unknown error"}`;
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
catch (err) {
|
|
261
|
-
// The SDK's iterator throws after error results (max turns, process
|
|
262
|
-
// exit). The result message above is the source of truth when we got
|
|
263
|
-
// one; otherwise surface the thrown reason.
|
|
264
|
-
if (!sessionError && !summary) {
|
|
265
|
-
sessionError = `agent session failed: ${err instanceof Error ? err.message : String(err)}`;
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
if (sessionError)
|
|
269
|
-
return { kind: "session-error", reason: sessionError };
|
|
270
|
-
return { kind: "ok", summary };
|
|
271
|
-
}
|
|
272
|
-
/** Path-confining permission gate. Exported for direct unit tests. */
|
|
273
|
-
export function buildStagingCanUseTool(shadowRoot, log) {
|
|
274
|
-
const allowed = new Set(STAGING_TOOLS);
|
|
275
|
-
const resolvedRoot = resolve(shadowRoot);
|
|
276
|
-
// Compare in canonical (symlink-resolved) space on both sides — on macOS
|
|
277
|
-
// the tmpdir shadow itself sits behind /var → /private/var. For paths that
|
|
278
|
-
// don't exist yet (a Write creating a file), canonicalize the nearest
|
|
279
|
-
// existing ancestor and re-append the remainder.
|
|
280
|
-
const canonicalize = (abs) => {
|
|
281
|
-
let probe = abs;
|
|
282
|
-
while (!existsSync(probe)) {
|
|
283
|
-
const parent = resolve(probe, "..");
|
|
284
|
-
if (parent === probe)
|
|
285
|
-
break;
|
|
286
|
-
probe = parent;
|
|
287
|
-
}
|
|
288
|
-
return join(realpathSync(probe), relative(probe, abs));
|
|
289
|
-
};
|
|
290
|
-
const root = existsSync(resolvedRoot) ? realpathSync(resolvedRoot) : resolvedRoot;
|
|
291
|
-
const contained = (abs) => {
|
|
292
|
-
const rel = relative(root, abs);
|
|
293
|
-
return rel === "" || (!rel.startsWith("..") && !isAbsolute(rel));
|
|
294
|
-
};
|
|
295
|
-
const insideShadow = (p) => {
|
|
296
|
-
if (typeof p !== "string" || p.length === 0)
|
|
297
|
-
return true; // no path arg — cwd-scoped
|
|
298
|
-
const abs = isAbsolute(p) ? resolve(p) : resolve(resolvedRoot, p);
|
|
299
|
-
// Defense in depth: symlinks never cross into the shadow (populateShadow
|
|
300
|
-
// skips them), but canonicalizing means a link that appears anyway can't
|
|
301
|
-
// smuggle the operation outside.
|
|
302
|
-
try {
|
|
303
|
-
return contained(canonicalize(abs));
|
|
304
|
-
}
|
|
305
|
-
catch {
|
|
306
|
-
return false;
|
|
307
|
-
}
|
|
308
|
-
};
|
|
309
|
-
return async (toolName, input) => {
|
|
310
|
-
if (!allowed.has(toolName)) {
|
|
311
|
-
return {
|
|
312
|
-
behavior: "deny",
|
|
313
|
-
message: `${toolName} is not available in this pome staging session. ` +
|
|
314
|
-
"Make wiring edits with Read/Edit/Write only; pome runs installs and " +
|
|
315
|
-
"verification after the diff is approved.",
|
|
316
|
-
};
|
|
317
|
-
}
|
|
318
|
-
for (const key of ["file_path", "notebook_path", "path"]) {
|
|
319
|
-
if (key in input && !insideShadow(input[key])) {
|
|
320
|
-
return {
|
|
321
|
-
behavior: "deny",
|
|
322
|
-
message: `${String(input[key])} is outside the repository being wired. ` +
|
|
323
|
-
"Only files inside the working directory may be read or edited.",
|
|
324
|
-
};
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
if (toolName === "Edit" || toolName === "Write") {
|
|
328
|
-
const p = String(input.file_path ?? "");
|
|
329
|
-
const abs = isAbsolute(p) ? resolve(p) : resolve(resolvedRoot, p);
|
|
330
|
-
let rel;
|
|
331
|
-
try {
|
|
332
|
-
rel = relative(root, canonicalize(abs));
|
|
333
|
-
}
|
|
334
|
-
catch {
|
|
335
|
-
rel = p;
|
|
336
|
-
}
|
|
337
|
-
log(dim(` staged ${rel}`));
|
|
338
|
-
}
|
|
339
|
-
return { behavior: "allow", updatedInput: input };
|
|
340
|
-
};
|
|
341
|
-
}
|
|
342
|
-
function assistantTextLines(message) {
|
|
343
|
-
const inner = message.message;
|
|
344
|
-
if (!inner || !Array.isArray(inner.content))
|
|
345
|
-
return [];
|
|
346
|
-
const lines = [];
|
|
347
|
-
for (const block of inner.content) {
|
|
348
|
-
if (block && typeof block === "object" && block.type === "text") {
|
|
349
|
-
const text = block.text ?? "";
|
|
350
|
-
for (const line of text.split("\n")) {
|
|
351
|
-
if (line.trim())
|
|
352
|
-
lines.push(line.trimEnd());
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
return lines;
|
|
357
|
-
}
|
|
358
|
-
function parseNameStatus(out) {
|
|
359
|
-
const changes = [];
|
|
360
|
-
for (const line of out.split("\n")) {
|
|
361
|
-
if (!line.trim())
|
|
362
|
-
continue;
|
|
363
|
-
const parts = line.split("\t");
|
|
364
|
-
const code = parts[0] ?? "";
|
|
365
|
-
if (code.startsWith("R")) {
|
|
366
|
-
changes.push({ status: "renamed", from: parts[1], path: parts[2] ?? "" });
|
|
367
|
-
}
|
|
368
|
-
else if (code === "A") {
|
|
369
|
-
changes.push({ status: "new file", path: parts[1] ?? "" });
|
|
370
|
-
}
|
|
371
|
-
else if (code === "D") {
|
|
372
|
-
changes.push({ status: "deleted", path: parts[1] ?? "" });
|
|
373
|
-
}
|
|
374
|
-
else {
|
|
375
|
-
changes.push({ status: "modified", path: parts[1] ?? "" });
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
return changes;
|
|
379
|
-
}
|
|
380
|
-
function parseNumstat(out) {
|
|
381
|
-
const stats = new Map();
|
|
382
|
-
for (const line of out.split("\n")) {
|
|
383
|
-
if (!line.trim())
|
|
384
|
-
continue;
|
|
385
|
-
const [added, removed, ...rest] = line.split("\t");
|
|
386
|
-
let path = rest.join("\t");
|
|
387
|
-
// Renames appear as "old => new" or "prefix{old => new}suffix" — key by
|
|
388
|
-
// the new path, matching name-status.
|
|
389
|
-
const arrow = path.match(/^(.*)\{(.*) => (.*)\}(.*)$/);
|
|
390
|
-
if (arrow)
|
|
391
|
-
path = `${arrow[1]}${arrow[3]}${arrow[4]}`;
|
|
392
|
-
else if (path.includes(" => "))
|
|
393
|
-
path = path.split(" => ")[1] ?? path;
|
|
394
|
-
stats.set(path, {
|
|
395
|
-
added: added === "-" ? 0 : Number(added),
|
|
396
|
-
removed: removed === "-" ? 0 : Number(removed),
|
|
397
|
-
});
|
|
398
|
-
}
|
|
399
|
-
return stats;
|
|
400
|
-
}
|
|
401
|
-
function renderFileList(changes, stats) {
|
|
402
|
-
const width = Math.max(...changes.map((c) => c.status.length));
|
|
403
|
-
return changes.map((c) => {
|
|
404
|
-
const stat = stats.get(c.path);
|
|
405
|
-
const counts = stat
|
|
406
|
-
? [stat.added > 0 ? `+${stat.added}` : "", stat.removed > 0 ? `−${stat.removed}` : ""]
|
|
407
|
-
.filter(Boolean)
|
|
408
|
-
.join(" ")
|
|
409
|
-
: "";
|
|
410
|
-
const name = c.status === "renamed" && c.from ? `${c.from} → ${c.path}` : c.path;
|
|
411
|
-
return ` ${c.status.padEnd(width)} ${name}${counts ? ` ${counts}` : ""}`;
|
|
412
|
-
});
|
|
413
|
-
}
|
|
414
|
-
function useColor() {
|
|
415
|
-
return Boolean(process.stderr.isTTY && !process.env.NO_COLOR);
|
|
416
|
-
}
|
|
417
|
-
function dim(s) {
|
|
418
|
-
return useColor() ? `\x1b[2m${s}\x1b[0m` : s;
|
|
419
|
-
}
|
|
420
|
-
function renderUnifiedDiff(patch) {
|
|
421
|
-
const color = useColor();
|
|
422
|
-
const paint = (line) => {
|
|
423
|
-
if (!color)
|
|
424
|
-
return line;
|
|
425
|
-
if (line.startsWith("+++") || line.startsWith("---") || line.startsWith("diff --git")) {
|
|
426
|
-
return `\x1b[1m${line}\x1b[0m`;
|
|
427
|
-
}
|
|
428
|
-
if (line.startsWith("@@"))
|
|
429
|
-
return `\x1b[36m${line}\x1b[0m`;
|
|
430
|
-
if (line.startsWith("+"))
|
|
431
|
-
return `\x1b[32m${line}\x1b[0m`;
|
|
432
|
-
if (line.startsWith("-"))
|
|
433
|
-
return `\x1b[31m${line}\x1b[0m`;
|
|
434
|
-
if (line.startsWith("index ") || line.startsWith("new file") || line.startsWith("deleted")) {
|
|
435
|
-
return `\x1b[2m${line}\x1b[0m`;
|
|
436
|
-
}
|
|
437
|
-
return line;
|
|
438
|
-
};
|
|
439
|
-
return patch
|
|
440
|
-
.split("\n")
|
|
441
|
-
.filter((line, i, arr) => !(line === "" && i === arr.length - 1))
|
|
442
|
-
.map(paint);
|
|
443
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Catalog of scenarios bundled with the CLI, grouped by twin.
|
|
3
|
-
*
|
|
4
|
-
* Single source of truth for `pome scenarios` (browse + copy). `pome init`
|
|
5
|
-
* uses the GitHub twin entries from this catalog as its starter scaffold while
|
|
6
|
-
* Stripe/Slack scenarios remain opt-in via `pome scenarios <twin> --copy`.
|
|
7
|
-
*
|
|
8
|
-
* `runnable: false` marks a seed-only reference document (not a scenario
|
|
9
|
-
* to execute) — copy commands skip these.
|
|
10
|
-
*/
|
|
11
|
-
export interface CatalogScenario {
|
|
12
|
-
filename: string;
|
|
13
|
-
title: string;
|
|
14
|
-
summary: string;
|
|
15
|
-
runnable: boolean;
|
|
16
|
-
}
|
|
17
|
-
export interface ScenarioTwin {
|
|
18
|
-
id: string;
|
|
19
|
-
label: string;
|
|
20
|
-
description: string;
|
|
21
|
-
scenarios: CatalogScenario[];
|
|
22
|
-
}
|
|
23
|
-
export declare const SCENARIO_TWINS: ScenarioTwin[];
|
|
24
|
-
export declare function findTwin(id: string): ScenarioTwin | null;
|
|
25
|
-
export declare function runnableScenarios(twin: ScenarioTwin): CatalogScenario[];
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { type ScenarioTwin } from "./scenarios-catalog.js";
|
|
2
|
-
export interface ScenariosCommandOptions {
|
|
3
|
-
copy?: boolean;
|
|
4
|
-
force?: boolean;
|
|
5
|
-
dest?: string;
|
|
6
|
-
}
|
|
7
|
-
export declare function runScenariosCommand(twinArg: string | undefined, opts: ScenariosCommandOptions): Promise<void>;
|
|
8
|
-
interface CopyOptions {
|
|
9
|
-
destDir: string;
|
|
10
|
-
force: boolean;
|
|
11
|
-
}
|
|
12
|
-
export declare function copyTwinScenarios(twin: ScenarioTwin, opts: CopyOptions): Promise<void>;
|
|
13
|
-
export {};
|
package/dist/src/cli/skills.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export interface SkillsInstallOptions {
|
|
2
|
-
copy?: boolean;
|
|
3
|
-
force?: boolean;
|
|
4
|
-
dest?: string;
|
|
5
|
-
}
|
|
6
|
-
/** Skills shipped with this CLI. Keep in sync with `skills/<name>/`. */
|
|
7
|
-
export declare const BUNDLED_SKILLS: readonly ["pome-setup", "pome-test"];
|
|
8
|
-
export declare function runSkillsInstall(opts: SkillsInstallOptions): Promise<void>;
|
package/dist/src/cli/skills.js
DELETED
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
/**
|
|
3
|
-
* `pome skills install` — install the bundled pome agent skills into the
|
|
4
|
-
* user's Claude Code skills directory (`~/.claude/skills/`).
|
|
5
|
-
*
|
|
6
|
-
* Defaults to symlinking each skill folder to the canonical source inside
|
|
7
|
-
* this pome package install, matching the `npx skills` industry convention:
|
|
8
|
-
* an `npm i -g @pome-sh/cli@latest` automatically updates every linked skill.
|
|
9
|
-
* Pass `--copy` to fall back to independent copies (CI, Windows without
|
|
10
|
-
* symlink permission, or any environment where symlinks aren't suitable).
|
|
11
|
-
*/
|
|
12
|
-
import { existsSync } from "node:fs";
|
|
13
|
-
import { cp, lstat, mkdir, rm, symlink } from "node:fs/promises";
|
|
14
|
-
import { homedir } from "node:os";
|
|
15
|
-
import { join, resolve } from "node:path";
|
|
16
|
-
import { resolvePackageRoot } from "./resolve-package-root.js";
|
|
17
|
-
/** Skills shipped with this CLI. Keep in sync with `skills/<name>/`. */
|
|
18
|
-
export const BUNDLED_SKILLS = ["pome-setup", "pome-test"];
|
|
19
|
-
const CLAUDE_DOWNLOAD_URL = "https://claude.com/download";
|
|
20
|
-
function useColor() {
|
|
21
|
-
return Boolean(process.stdout.isTTY && !process.env.NO_COLOR);
|
|
22
|
-
}
|
|
23
|
-
function dim(s) {
|
|
24
|
-
return useColor() ? `\x1b[2m${s}\x1b[0m` : s;
|
|
25
|
-
}
|
|
26
|
-
function bold(s) {
|
|
27
|
-
return useColor() ? `\x1b[1m${s}\x1b[0m` : s;
|
|
28
|
-
}
|
|
29
|
-
export async function runSkillsInstall(opts) {
|
|
30
|
-
const root = resolvePackageRoot(import.meta.url);
|
|
31
|
-
if (!root) {
|
|
32
|
-
console.error("Could not locate the installed pome package (package.json not found).");
|
|
33
|
-
process.exitCode = 2;
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
const sourceDir = join(root, "skills");
|
|
37
|
-
if (!existsSync(sourceDir)) {
|
|
38
|
-
console.error(`Bundled skills directory missing from this pome install: ${sourceDir}`);
|
|
39
|
-
console.error("This is a packaging bug — please report at https://github.com/pome-sh/pome-twins/issues.");
|
|
40
|
-
process.exitCode = 2;
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
const destDir = await resolveDestDir(opts.dest);
|
|
44
|
-
if (!destDir) {
|
|
45
|
-
// resolveDestDir already printed a friendly error.
|
|
46
|
-
process.exitCode = 2;
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
await mkdir(destDir, { recursive: true });
|
|
50
|
-
const outcome = await installSkills({
|
|
51
|
-
sourceDir,
|
|
52
|
-
destDir,
|
|
53
|
-
copy: Boolean(opts.copy),
|
|
54
|
-
force: Boolean(opts.force),
|
|
55
|
-
});
|
|
56
|
-
const mode = opts.copy ? "copy" : "symlink";
|
|
57
|
-
console.log(bold(`Installed ${outcome.installed.length} pome skill${outcome.installed.length === 1 ? "" : "s"} to ${destDir} (${mode}).`));
|
|
58
|
-
for (const name of outcome.installed) {
|
|
59
|
-
const note = outcome.fellBackToCopy.includes(name)
|
|
60
|
-
? dim(" (copied — symlink unavailable)")
|
|
61
|
-
: "";
|
|
62
|
-
console.log(` ${dim("+")} ${name}${note}`);
|
|
63
|
-
}
|
|
64
|
-
for (const name of outcome.skipped) {
|
|
65
|
-
console.log(` ${dim("-")} ${name} ${dim("(exists — pass --force to overwrite)")}`);
|
|
66
|
-
}
|
|
67
|
-
for (const name of outcome.missingSources) {
|
|
68
|
-
console.error(` ${dim("!")} ${name} ${dim("(missing from this package install)")}`);
|
|
69
|
-
}
|
|
70
|
-
if (outcome.missingSources.length > 0) {
|
|
71
|
-
process.exitCode = 2;
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
if (outcome.installed.length > 0) {
|
|
75
|
-
console.log("");
|
|
76
|
-
console.log("Invoke them from your agent:");
|
|
77
|
-
console.log(` ${bold("/pome-setup")} — wire your agent up to pome`);
|
|
78
|
-
console.log(` ${bold("/pome-test")} — run tasks for a registered agent`);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
async function resolveDestDir(explicit) {
|
|
82
|
-
if (explicit) {
|
|
83
|
-
return resolve(explicit);
|
|
84
|
-
}
|
|
85
|
-
const claudeHome = join(homedir(), ".claude");
|
|
86
|
-
if (!existsSync(claudeHome)) {
|
|
87
|
-
console.error("Couldn't find Claude Code's home directory at ~/.claude/.");
|
|
88
|
-
console.error(`Install Claude Code first: ${CLAUDE_DOWNLOAD_URL}`);
|
|
89
|
-
console.error("Or pass --dest <dir> to install into a custom skills directory.");
|
|
90
|
-
return undefined;
|
|
91
|
-
}
|
|
92
|
-
return join(claudeHome, "skills");
|
|
93
|
-
}
|
|
94
|
-
async function installSkills(input) {
|
|
95
|
-
const outcome = {
|
|
96
|
-
installed: [],
|
|
97
|
-
skipped: [],
|
|
98
|
-
missingSources: [],
|
|
99
|
-
fellBackToCopy: [],
|
|
100
|
-
};
|
|
101
|
-
for (const name of BUNDLED_SKILLS) {
|
|
102
|
-
const src = join(input.sourceDir, name);
|
|
103
|
-
const dest = join(input.destDir, name);
|
|
104
|
-
if (!existsSync(join(src, "SKILL.md"))) {
|
|
105
|
-
outcome.missingSources.push(name);
|
|
106
|
-
continue;
|
|
107
|
-
}
|
|
108
|
-
if (await pathPresent(dest)) {
|
|
109
|
-
if (!input.force) {
|
|
110
|
-
outcome.skipped.push(name);
|
|
111
|
-
continue;
|
|
112
|
-
}
|
|
113
|
-
await rm(dest, { recursive: true, force: true });
|
|
114
|
-
}
|
|
115
|
-
if (input.copy) {
|
|
116
|
-
await cp(src, dest, { recursive: true });
|
|
117
|
-
}
|
|
118
|
-
else {
|
|
119
|
-
try {
|
|
120
|
-
await symlink(src, dest, "dir");
|
|
121
|
-
}
|
|
122
|
-
catch (err) {
|
|
123
|
-
// Windows without dev-mode, restricted FS, etc. Fall back transparently.
|
|
124
|
-
await cp(src, dest, { recursive: true });
|
|
125
|
-
outcome.fellBackToCopy.push(name);
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
outcome.installed.push(name);
|
|
129
|
-
}
|
|
130
|
-
return outcome;
|
|
131
|
-
}
|
|
132
|
-
/** lstat-based existence check — true for files, dirs, and dangling symlinks. */
|
|
133
|
-
async function pathPresent(p) {
|
|
134
|
-
try {
|
|
135
|
-
await lstat(p);
|
|
136
|
-
return true;
|
|
137
|
-
}
|
|
138
|
-
catch {
|
|
139
|
-
return false;
|
|
140
|
-
}
|
|
141
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { type Scenario } from "./scenarioSchema.js";
|
|
2
|
-
export declare function parseScenarioFile(path: string): Promise<Scenario>;
|
|
3
|
-
export declare function parseScenario(markdown: string, slug?: string, sidecarSeed?: unknown, scenarioPath?: string): Scenario;
|
|
4
|
-
/** The flat seed a single twin boots from. Single-twin scenarios return the
|
|
5
|
-
* flat `seedState` as-is; multi-twin scenarios return that twin's slice of the
|
|
6
|
-
* per-twin envelope (decided from `config.twins`, per the envelope-iff-multi-twin
|
|
7
|
-
* rule). Used by the local runner to seed each twin harness. */
|
|
8
|
-
export declare function seedStateForTwin(scenario: Scenario, twin: string): unknown;
|
|
9
|
-
export declare function formatScenarioError(error: unknown, filePath: string): string;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type { Context, MiddlewareHandler } from "hono";
|
|
2
|
-
/** Context variable consulted first by getClientIp(). */
|
|
3
|
-
export declare const CLIENT_IP_VAR = "pomeClientIp";
|
|
4
|
-
/**
|
|
5
|
-
* Explicitly record the peer address for this request. Alternate serving
|
|
6
|
-
* bridges (or tests) call this from an upstream middleware so the gate never
|
|
7
|
-
* reaches into runtime-private internals.
|
|
8
|
-
*
|
|
9
|
-
* SECURITY: the value passed here MUST be the transport-level peer address
|
|
10
|
-
* (the socket's remote address as reported by the serving bridge). It takes
|
|
11
|
-
* precedence over getConnInfo, so deriving it from any request-controlled
|
|
12
|
-
* input — X-Forwarded-For or any other client-supplied header — would make
|
|
13
|
-
* the loopback-only admin gate spoofable by whoever sets that header. If you
|
|
14
|
-
* are behind a reverse proxy, use TWIN_ADMIN_TOKEN instead of trying to
|
|
15
|
-
* recover the "real" client IP.
|
|
16
|
-
*/
|
|
17
|
-
export declare function setClientIp(c: Context, ip: string): void;
|
|
18
|
-
/**
|
|
19
|
-
* Runtime-neutral client-IP accessor (FDRS-587). Resolution order:
|
|
20
|
-
* 1. Explicit override set via setClientIp() (alternate bridges / tests).
|
|
21
|
-
* 2. The node serving bridge's official getConnInfo helper.
|
|
22
|
-
* 3. undefined — no live socket (e.g. app.request() in-process tests).
|
|
23
|
-
*/
|
|
24
|
-
export declare function getClientIp(c: Context): Promise<string | undefined>;
|
|
25
|
-
export declare function isLoopbackAddress(remote: string): boolean;
|
|
26
|
-
export interface AdminGateOptions {
|
|
27
|
-
/** 403 response factory so each twin keeps its own error envelope. */
|
|
28
|
-
forbidden?: () => Response;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Admin endpoint protection shared by every twin (FDRS-616). Each twin's
|
|
32
|
-
* auth.ts wraps this with its own `forbidden` envelope. Semantics are
|
|
33
|
-
* identical to the per-twin requireAdminAuth() copies this replaces.
|
|
34
|
-
*/
|
|
35
|
-
export declare function createAdminGate(options?: AdminGateOptions): MiddlewareHandler;
|