pandora-cli-skills 1.1.74 → 1.1.78

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.
Files changed (72) hide show
  1. package/README.md +222 -281
  2. package/README_FOR_SHARING.md +201 -220
  3. package/SKILL.md +138 -194
  4. package/anthropic-skill-src/SKILL.md +133 -0
  5. package/benchmarks/latest/core-bundle.json +227 -135
  6. package/benchmarks/latest/core-history.json +124 -8
  7. package/benchmarks/latest/core-report.json +953 -1177
  8. package/benchmarks/locks/core.lock.json +40 -40
  9. package/cli/lib/agent_contract_registry.cjs +136 -23
  10. package/cli/lib/capabilities_command_service.cjs +19 -10
  11. package/cli/lib/export_service.cjs +115 -42
  12. package/cli/lib/flashbots_service.cjs +810 -0
  13. package/cli/lib/mirror_command_service.cjs +28 -10
  14. package/cli/lib/mirror_daemon_service.cjs +7 -3
  15. package/cli/lib/mirror_handlers/audit.cjs +38 -15
  16. package/cli/lib/mirror_handlers/go.cjs +13 -1
  17. package/cli/lib/mirror_handlers/pnl.cjs +45 -14
  18. package/cli/lib/mirror_handlers/sync.cjs +78 -0
  19. package/cli/lib/mirror_handlers/trace.cjs +106 -0
  20. package/cli/lib/mirror_replay_service.cjs +32 -2
  21. package/cli/lib/mirror_state_store.cjs +11 -4
  22. package/cli/lib/mirror_surface_service.cjs +1200 -0
  23. package/cli/lib/mirror_sync/execution.cjs +69 -0
  24. package/cli/lib/mirror_sync/rebalance_trade.cjs +52 -0
  25. package/cli/lib/mirror_sync/reserve_source.cjs +469 -19
  26. package/cli/lib/parsers/mirror_go_flags.cjs +82 -0
  27. package/cli/lib/parsers/mirror_remaining_flags.cjs +169 -0
  28. package/cli/lib/parsers/mirror_sync_flags.cjs +82 -0
  29. package/cli/lib/parsers/polymarket_flags.cjs +149 -0
  30. package/cli/lib/polymarket_command_service.cjs +127 -2
  31. package/cli/lib/polymarket_ops_service.cjs +325 -0
  32. package/cli/lib/polymarket_trade_adapter.cjs +1050 -110
  33. package/cli/lib/risk_state_store.cjs +9 -5
  34. package/cli/lib/schema_command_service.cjs +221 -5
  35. package/cli/lib/sports_command_service.cjs +8 -1
  36. package/cli/lib/trade_execution_route_service.cjs +142 -0
  37. package/cli/pandora.cjs +405 -83
  38. package/docs/assets/skills/anthropic-skill-first-run.svg +80 -0
  39. package/docs/assets/skills/anthropic-skill-install-flow.svg +77 -0
  40. package/docs/benchmarks/README.md +1 -1
  41. package/docs/benchmarks/history.json +124 -8
  42. package/docs/skills/agent-interfaces.md +6 -2
  43. package/docs/skills/agent-quickstart.md +28 -4
  44. package/docs/skills/anthropic-skill-evals.md +113 -0
  45. package/docs/skills/command-reference.md +46 -8
  46. package/docs/skills/install-anthropic-skill.md +168 -0
  47. package/docs/skills/mirror-operations.md +61 -4
  48. package/docs/skills/portfolio-closeout.md +9 -1
  49. package/docs/trust/operator-deployment.md +16 -0
  50. package/docs/trust/support-matrix.md +14 -2
  51. package/package.json +6 -1
  52. package/scripts/build_anthropic_skill_bundle.cjs +137 -0
  53. package/scripts/check_anthropic_skill_bundle.cjs +138 -0
  54. package/sdk/generated/command-descriptors.json +558 -22
  55. package/sdk/generated/contract-registry.json +4363 -388
  56. package/sdk/generated/manifest.json +27 -25
  57. package/sdk/generated/mcp-tool-definitions.json +1735 -780
  58. package/sdk/python/README.md +7 -1
  59. package/sdk/python/pandora_agent/generated/command-descriptors.json +558 -22
  60. package/sdk/python/pandora_agent/generated/contract-registry.json +4363 -388
  61. package/sdk/python/pandora_agent/generated/manifest.json +27 -25
  62. package/sdk/python/pandora_agent/generated/mcp-tool-definitions.json +1735 -780
  63. package/sdk/python/pyproject.toml +2 -2
  64. package/sdk/typescript/README.md +11 -3
  65. package/sdk/typescript/generated/command-descriptors.json +558 -22
  66. package/sdk/typescript/generated/contract-registry.json +4363 -388
  67. package/sdk/typescript/generated/manifest.json +27 -25
  68. package/sdk/typescript/generated/mcp-tool-definitions.json +1735 -780
  69. package/sdk/typescript/package.json +1 -1
  70. package/tests/skills/functional-scenarios.json +123 -0
  71. package/tests/skills/manual-eval-template.md +64 -0
  72. package/tests/skills/trigger-fixtures.json +121 -0
package/README.md CHANGED
@@ -1,317 +1,258 @@
1
1
  # Pandora CLI & Skills
2
2
 
3
- Production CLI for Pandora prediction markets with mirror tooling, sports consensus, on-chain trading, analytics, and agent-native interfaces.
3
+ Pandora is a production CLI and agent surface for prediction-market workflows: read-only discovery, mirror planning, sports consensus, on-chain execution, MCP serving, and shipped SDK contracts.
4
+
5
+ ```text
6
+ +----------------------------------------------------------------------------------+
7
+ | Start read-only. |
8
+ | Learn the contract surface first. |
9
+ | Add policy scopes, signer profiles, and secrets only on the runtime that |
10
+ | actually needs to execute mutable work. |
11
+ +----------------------------------------------------------------------------------+
12
+ ```
13
+
14
+ ```text
15
+ +----------------------- README MAP -----------------------+
16
+ | humans -> install, inspect, follow task guides |
17
+ | agents -> bootstrap, schema, MCP, policy/profile checks |
18
+ | trust -> release verification, security, support |
19
+ | sdk -> TypeScript, Python, generated contracts |
20
+ +----------------------------------------------------------+
21
+ ```
22
+
23
+ ## Start Here
24
+
25
+ If you are reading this page on GitHub, use these jump points first:
26
+
27
+ - Anthropic skill install: [`docs/skills/install-anthropic-skill.md`](./docs/skills/install-anthropic-skill.md)
28
+ - Humans: [`docs/skills/command-reference.md`](./docs/skills/command-reference.md)
29
+ - Agents: [`docs/skills/agent-quickstart.md`](./docs/skills/agent-quickstart.md)
30
+ - MCP / JSON contracts: [`docs/skills/agent-interfaces.md`](./docs/skills/agent-interfaces.md)
31
+ - Policy packs / signer profiles: [`docs/skills/policy-profiles.md`](./docs/skills/policy-profiles.md)
32
+ - Release trust: [`docs/trust/release-verification.md`](./docs/trust/release-verification.md)
33
+ - Security posture: [`docs/trust/security-model.md`](./docs/trust/security-model.md)
34
+ - Support guarantees: [`docs/trust/support-matrix.md`](./docs/trust/support-matrix.md)
35
+ - Root doc router: [`SKILL.md`](./SKILL.md)
36
+
37
+ ## For Humans
38
+
39
+ Use this path if you want the repo explained in order and prefer detailed guidance over terse machine contracts.
4
40
 
5
- ## Install
41
+ ### Anthropic skill install
42
+
43
+ If you want Claude.ai or Claude Code to use Pandora as a skill, start here:
44
+
45
+ - [`docs/skills/install-anthropic-skill.md`](./docs/skills/install-anthropic-skill.md)
46
+
47
+ Use the generated Anthropic skill bundle from the packaging flow. Do **not** zip and upload the repo root as a skill.
48
+ Build it with `npm run pack:anthropic-skill`, then upload `dist/pandora-skill.zip` in Claude.ai or install `dist/pandora-skill/` in Claude Code.
49
+
50
+ ### Detailed setup
6
51
 
7
52
  ```bash
8
- npm i -g pandora-cli-skills
9
- pandora --help
53
+ npm install
54
+ npm run init-env
55
+ npm run doctor
56
+ npm run build
57
+ npx pandora help
10
58
  ```
11
59
 
12
- Or without installing:
60
+ What each step is for:
61
+
62
+ - `npm install`: install the local CLI and docs/test dependencies
63
+ - `npm run init-env`: scaffold the expected environment inputs
64
+ - `npm run doctor`: inspect local runtime readiness before live work
65
+ - `npm run build`: run the repo’s verification gates, including docs, trust, SDK parity, and benchmark checks
66
+ - `npx pandora help`: browse the command surface manually
67
+
68
+ ### Human reading order
69
+
70
+ 1. [`docs/skills/command-reference.md`](./docs/skills/command-reference.md) for the command families and flags.
71
+ 2. [`docs/skills/trading-workflows.md`](./docs/skills/trading-workflows.md) for discover -> quote -> trade -> claim flows.
72
+ 3. [`docs/skills/mirror-operations.md`](./docs/skills/mirror-operations.md) for mirror planning, validation, deploy, sync, and status.
73
+ 4. [`docs/skills/portfolio-closeout.md`](./docs/skills/portfolio-closeout.md) for portfolio inspection, LP exits, and closeout.
74
+ 5. [`docs/trust/release-verification.md`](./docs/trust/release-verification.md) before installs, release checks, or operator handoff.
75
+
76
+ If you are testing the Anthropic skill itself rather than the repo manually, use the install guide first and then come back to the docs above for deeper workflow detail.
77
+
78
+ ### Safe human-first discovery
79
+
80
+ If you want to explore without touching signer material:
13
81
 
14
82
  ```bash
15
- npx pandora-cli-skills@latest --help
83
+ npx pandora --output json bootstrap
84
+ npx pandora --output json capabilities
85
+ npx pandora --output json schema
86
+ npx pandora --output json policy list
87
+ npx pandora --output json profile list
16
88
  ```
17
89
 
18
- Node.js `>=18` required.
19
-
20
- ## Documentation map
21
- - [`SKILL.md`](./SKILL.md)
22
- - root overview and routing index
23
- - [`docs/skills/capabilities.md`](./docs/skills/capabilities.md)
24
- - capability map, canonical paths, and PollCategory mapping
25
- - [`docs/skills/agent-quickstart.md`](./docs/skills/agent-quickstart.md)
26
- - fastest safe bootstrap path for agents using local CLI, stdio MCP, remote MCP HTTP, and SDKs
27
- - [`docs/skills/command-reference.md`](./docs/skills/command-reference.md)
28
- - human-oriented command and flag reference; use capabilities/schema for machine authority
29
- - [`docs/skills/trading-workflows.md`](./docs/skills/trading-workflows.md)
30
- - discover -> quote -> trade/sell -> claim workflows
31
- - [`docs/skills/portfolio-closeout.md`](./docs/skills/portfolio-closeout.md)
32
- - portfolio inspection, history/export, LP exits, claim-all, and mirror closeout
33
- - [`docs/skills/mirror-operations.md`](./docs/skills/mirror-operations.md)
34
- - mirror deploy/go safety, timing, validation, sync close-window guards, live diagnostics, daemon health, and closeout guidance
35
- - [`docs/skills/agent-interfaces.md`](./docs/skills/agent-interfaces.md)
36
- - schema, MCP, JSON envelopes, recovery hints, fork runtime, and error codes
37
- - [`docs/skills/policy-profiles.md`](./docs/skills/policy-profiles.md)
38
- - policy packs, signer profiles, gateway scopes, and preferred secret handling
39
- - [`docs/skills/recipes.md`](./docs/skills/recipes.md)
40
- - reusable safe workflows that compile to ordinary Pandora commands
41
- - [`docs/benchmarks/README.md`](./docs/benchmarks/README.md)
42
- - public benchmark harness, release-gate role, and agent-readiness interpretation
43
- - [`docs/benchmarks/scenario-catalog.md`](./docs/benchmarks/scenario-catalog.md)
44
- - scenario-by-scenario benchmark coverage and parity groups
45
- - [`docs/benchmarks/scorecard.md`](./docs/benchmarks/scorecard.md)
46
- - weighted scoring, parity failures, and benchmark output interpretation
47
- - [`docs/skills/legacy-launchers.md`](./docs/skills/legacy-launchers.md)
48
- - `launch` / `clone-bet` legacy script wrappers
49
- - [`docs/trust/release-verification.md`](./docs/trust/release-verification.md)
50
- - verify tarballs, checksums, attestations, SBOM, and cosign signatures before install
51
- - [`docs/trust/release-bundle-playbook.md`](./docs/trust/release-bundle-playbook.md)
52
- - one-tag maintainer flow that republishes the CLI, standalone SDKs, benchmark bundle, and trust assets together
53
- - [`docs/trust/security-model.md`](./docs/trust/security-model.md)
54
- - trust boundaries, mutation controls, and secret-handling posture across CLI, MCP, gateway, and SDKs
55
- - [`docs/trust/support-matrix.md`](./docs/trust/support-matrix.md)
56
- - support status and guarantees for local CLI, MCP transports, SDKs, benchmarks, and packaged docs
57
-
58
- ## Quickstart
90
+ Those commands are the preferred front door for both humans and agents because they expose the current surface area without assuming execution readiness.
91
+
92
+ ## For Agents
93
+
94
+ Use this path if the consumer is an LLM, automation runtime, SDK client, or MCP host.
95
+
96
+ ### Choose the operating model first
97
+
98
+ #### Self-custody local runtime
99
+
100
+ Use this when the agent should execute with the user's own wallet and signer material.
101
+
102
+ - run `pandora mcp` locally, or `pandora mcp http` on the user's own machine or server
103
+ - keep signer material on the user's own runtime
104
+ - prefer this path for live execution with user-owned funds
105
+
106
+ #### Hosted read-only / planning gateway
107
+
108
+ Use this when you want a shared remote endpoint for discovery, bootstrap, schema inspection, recipes, planning, audit, and receipts.
109
+
110
+ - host `pandora mcp http` centrally
111
+ - keep the shared gateway read-only by default
112
+ - only add hosted mutation if you explicitly want a BYO-signer or custodial model
113
+ - do not require self-custody users to route live execution through the shared gateway
114
+
115
+ ### One command: bootstrap the contract
59
116
 
60
117
  ```bash
61
- # compact capability digest for agents
62
- pandora --output json bootstrap
63
- pandora --output json capabilities
118
+ npm install && npx pandora --output json bootstrap
119
+ ```
120
+
121
+ Use `bootstrap` first for canonical tools, recommended next steps, default policy/profile hints, and doc routing.
122
+
123
+ ### One command: start local stdio MCP
64
124
 
65
- # schema for typed consumers
66
- pandora --output json schema
125
+ ```bash
126
+ npm install && npx pandora mcp
127
+ ```
67
128
 
68
- # inspect shipped policy packs and named profiles
69
- pandora --output json policy list
70
- pandora --output json profile list
71
- pandora --output json recipe list
129
+ Use local stdio MCP when the agent runs on the same machine as Pandora. This is the default self-custody path for live execution.
72
130
 
73
- # MCP server mode
74
- pandora mcp
131
+ ### One command: host remote read-only HTTP MCP
75
132
 
76
- # read-only discovery
77
- pandora --output json scan --limit 10
133
+ ```bash
134
+ npm install && npx pandora mcp http --auth-scopes capabilities:read,contracts:read,help:read,schema:read,operations:read,scan:read,quote:read,portfolio:read,mirror:read,sports:read,network:indexer,network:rpc,network:polymarket,network:sports
135
+ ```
78
136
 
79
- # buy-side dry-run
80
- pandora --output json trade --dry-run \
81
- --market-address 0x... --side yes --amount-usdc 10
137
+ Use remote HTTP MCP only when you intentionally want external agents to connect over the network. Start with read-only scopes and widen later. For most teams, this gateway should be the shared discovery and planning surface, not the default home of user signer material.
82
138
 
83
- # sell-side dry-run
84
- pandora --output json sell --dry-run \
85
- --market-address 0x... --side no --shares 25
139
+ ### Recommended agent order
86
140
 
87
- # inspect persisted mutable-operation records
88
- pandora --output json operations list --status planned,queued,running --limit 20
141
+ ```text
142
+ bootstrap
143
+ -> capabilities
144
+ -> schema
145
+ -> policy list
146
+ -> profile list
147
+ -> profile explain (only when mutation is actually needed)
89
148
  ```
90
149
 
91
- Notes:
92
- - `bootstrap` is the preferred first call for cold agents and returns canonical tools by default.
93
- - Use `pandora --output json bootstrap --include-compatibility` only when you are debugging or migrating a legacy caller that still speaks in alias commands.
150
+ ### Agent-first docs
151
+
152
+ - [`docs/skills/agent-quickstart.md`](./docs/skills/agent-quickstart.md): fastest safe bootstrap path
153
+ - [`docs/skills/agent-interfaces.md`](./docs/skills/agent-interfaces.md): JSON envelopes, schema, MCP, recovery, and error contracts
154
+ - [`docs/skills/policy-profiles.md`](./docs/skills/policy-profiles.md): policy packs, signer profiles, gateway scopes, and readiness guidance
155
+ - [`docs/skills/recipes.md`](./docs/skills/recipes.md): reusable safe workflows compiled from ordinary Pandora commands
156
+
157
+ ## Recommendations
158
+
159
+ - Prefer `bootstrap` over raw `help` output when the caller is an agent.
160
+ - Prefer canonical tool names. Only use compatibility aliases for legacy callers or migration diffing.
161
+ - Prefer self-custody local runtimes for live execution with user-owned funds.
162
+ - Prefer a hosted HTTP gateway for shared discovery, planning, schema, recipes, audit, and receipt retrieval.
163
+ - Prefer read-only planning first. Do not provision secrets until `requiresSecrets`, `policyScopes`, and `profile explain` say the workflow actually needs them.
164
+ - Prefer `--profile-id` or `--profile-file` over raw `--private-key` when a command family supports profile-directed execution.
165
+ - Prefer `pandora mcp` for local agents and `pandora mcp http` for intentionally hosted remote agents.
166
+ - Prefer `operations list|get|receipt|verify-receipt` when you need persisted state or audit evidence for mutable work.
167
+ - Prefer the trust docs before install, release verification, or external sharing of artifacts.
94
168
 
95
- ## Agent-first onboarding
169
+ ## Critical Safety Rules
96
170
 
97
- Use this path when the consumer is an agent, not a human operator:
171
+ - `mirror plan|deploy|go` do not use a generic `+1h` close rule. They use a sports-aware suggested `targetTimestamp`.
172
+ - `mirror deploy|go` requires at least 2 independent public resolution URLs from different hosts in `--sources`.
173
+ - Polymarket, Gamma, and CLOB URLs are discovery inputs only. They are not valid resolution sources.
174
+ - Validation is payload-exact. Reuse the validation ticket or `agentPreflight` data for execute/live reruns.
175
+ - Treat mutable profiles as not ready until `profile explain` confirms the exact tool, mode, and runtime context are usable.
176
+
177
+ ## Common Paths
178
+
179
+ ### Discovery and planning
98
180
 
99
181
  ```bash
100
- # 1) discover the live contract
101
- pandora --output json bootstrap
102
- pandora --output json capabilities
103
- pandora --output json schema
104
- pandora --output json policy list
105
- pandora --output json profile list
106
-
107
- # 2) start local stdio MCP, or intentionally host remote MCP
108
- pandora mcp
109
- # or
110
- pandora mcp http [--auth-scopes <csv>]
182
+ npx pandora --output json bootstrap
183
+ npx pandora --output json capabilities
184
+ npx pandora --output json schema
185
+ npx pandora scan --output json --limit 10
111
186
  ```
112
187
 
113
- Canonical-routing note:
114
- - start from `bootstrap`, then resolve any follow-up decisions against canonical tool names from `bootstrap`, `capabilities`, or `schema`
115
- - only opt into compatibility aliases with `--include-compatibility` when you are inspecting legacy/debug workflows; do not use alias names as the default planning surface for new agents
116
-
117
- If you are embedding the shipped SDKs instead of only consuming raw JSON:
118
- - standalone SDK package identities:
119
- - TypeScript/Node: `@thisispandora/agent-sdk`
120
- - Python: `pandora-agent`
121
- - current release flow builds, verifies, and publishes those standalone SDK packages alongside the main CLI release
122
- - this repository and the root Pandora package also vendor matching SDK copies under `sdk/typescript` and `sdk/python` for parity, local audit, and in-tree consumption
123
-
124
- Maintainer note:
125
- - use `npm run release:bundle:verify` before tagging any release that touches CLI, contract, SDK, benchmark, or trust surfaces
126
- - local SDK execution maps to `pandora mcp` over stdio on the same machine
127
- - remote SDK execution maps to intentionally hosted `pandora mcp http ...`; remote clients connect to the `/mcp` endpoint with a bearer token
128
- - standalone SDK packages ship package-local generated artifacts
129
- - the repository root also keeps a shared contract bundle under `sdk/generated` for parity checks, custom generators, and vendored consumers
130
- - the vendored TypeScript copy keeps a local loader and manifest under `sdk/typescript/generated`
131
- - the vendored Python copy keeps a local manifest under `sdk/python/pandora_agent/generated/manifest.json`; in the published root package its loader falls back to the shared `sdk/generated` bundle for the heavy generated JSON artifacts
132
-
133
- For live signing:
134
- - current builds ship policy packs and named profiles in alpha
135
- - current builds also ship first-party recipes in alpha via `recipe list|get|validate|run`
136
- - inspect them with `policy list|get|lint` and `profile list|get|explain|validate` before exposing tools to an agent
137
- - treat `bootstrap` as the machine-usable recommendation surface:
138
- - `defaults.policyId` / `defaults.profileId`
139
- - `policyProfiles.policyPacks.recommendedReadOnlyPolicyId` / `recommendedMutablePolicyId`
140
- - `policyProfiles.signerProfiles.recommendedReadOnlyProfileId` / `recommendedMutableProfileId`
141
- - `nextSteps[]`
142
- - use `bootstrap` for safe defaults, then use `policy explain`, `policy recommend`, and `profile recommend` for exact context-aware remediation or ranking
143
- - use `policy get` for pack inspection
144
- - use `profile get` for raw profile state
145
- - use `profile explain` for exact usability decisions
146
- - do not collapse signer readiness into one “pending” bucket:
147
- - implementation-status fields: `implementedBackends`, `placeholderBackends`
148
- - runtime-readiness fields: `readyBuiltinIds`, `degradedBuiltinIds`, `placeholderBuiltinIds`
149
- - backend-level rollup: `policyProfiles.signerProfiles.backendStatuses`
150
- - vocabulary: `policyProfiles.signerProfiles.statusAxes`
151
- - today, all shipped signer backends are implemented: `read-only`, `local-env`, `local-keystore`, `external-signer`
152
- - in the default runtime view, `market_observer_ro` is the only built-in profile reporting `ready`, and it is read-only
153
- - `--runtime-local-readiness` actively probes local signer/network prerequisites and can promote built-in mutable profiles such as `prod_trader_a`, `dev_keystore_operator`, and `desk_signer_service` to `ready` when their runtime requirements are satisfied
154
- - in the current runtime, no built-in mutable profile is ready
155
- - current built-in mutable profile states are:
156
- - `prod_trader_a`: backend rollup `degraded`, per-profile `resolutionStatus` `missing-secrets`
157
- - `dev_keystore_operator`: backend rollup `degraded`, per-profile `resolutionStatus` `missing-keystore`
158
- - `desk_signer_service`: backend rollup `degraded`, per-profile `resolutionStatus` `missing-context`
159
- - `degraded` means the backend is implemented, but this process is still missing signer material, keystore access, external-signer context, network context, or other compatibility prerequisites
160
- - use `profile list` for the compact `runtimeReady` / `resolutionStatus` view
161
- - use `profile explain --id <profile-id> [--command <tool>] [--mode <mode>] [--policy-id <id>] [--chain-id <id>] [--category <id|name>]` before mutable execution to inspect `explanation.requestedContext`, `explanation.usable`, `explanation.readiness`, `explanation.compatibility`, `explanation.remediation`, and `explanation.blockers`
162
- - there is not yet a universal `--profile` selector across mutating commands
163
- - direct Pandora signer-bearing commands now accept `--profile-id` / `--profile-file` for `trade`, `sell`, `lp add`, `lp remove`, `resolve`, `claim`, `mirror deploy`, `mirror go`, `mirror sync once|run|start`, and `sports create run`
164
- - other live families still commonly resolve signing material from env / `.env` / explicit flags
165
- - the preferred agent pattern is a scoped MCP gateway plus signer material only on the runtime that actually executes live tools
166
-
167
- ## Live execution setup
168
-
169
- Only do this when the runtime will execute signing commands:
188
+ ### Pricing before mutation
170
189
 
171
190
  ```bash
172
- npm run init-env
173
- npm run doctor
191
+ npx pandora quote --output json --market-address 0x... --side yes --amount-usdc 25
174
192
  ```
175
193
 
176
- Populate `.env` or process env with only the fields your live workflow actually needs:
177
- - `CHAIN_ID`
178
- - `RPC_URL`
179
- - `PRIVATE_KEY`
180
- - `ORACLE`
181
- - `FACTORY`
182
- - `USDC`
183
-
184
- For Polymarket and live mirror hedging, also configure only the fields that path actually needs:
185
- - `POLYMARKET_PRIVATE_KEY`
186
- - `POLYMARKET_FUNDER`
187
- - `POLYMARKET_RPC_URL`
188
- - `POLYMARKET_API_KEY`
189
- - `POLYMARKET_API_SECRET`
190
- - `POLYMARKET_API_PASSPHRASE`
191
- - `POLYMARKET_HOST`
192
-
193
- Operator notes:
194
- - `POLYMARKET_FUNDER` / `--funder` must be the Polymarket proxy wallet (Gnosis Safe), not the signer EOA.
195
- - Polymarket CLOB collateral is Polygon USDC.e. Use `pandora polymarket balance --funder <proxy>` to inspect signer/proxy balances and `pandora polymarket deposit` to move USDC.e from signer to proxy. `pandora polymarket withdraw` can preview proxy-to-signer transfers, but execute mode only works when the signer controls the source wallet; proxy-originated withdrawals usually require manual execution from the proxy wallet itself.
196
- - `pandora mirror status --with-live` is an operator dashboard. `netPnlApproxUsdc`, `pnlApprox`, and `pnlScenarios` are scenario or mark-to-market approximations, not realized accounting or a tax-ready audit trail.
197
-
198
- ## Standalone SDKs And Contract Export
199
-
200
- Current shipped consumer paths:
201
- - TypeScript/Node:
202
- - standalone package identity: `@thisispandora/agent-sdk`
203
- - current external install path: signed GitHub release tarball attached to the tagged Pandora release
204
- - repository checkout path: `sdk/typescript` for maintainers and in-tree consumers
205
- - vendored root-package copy: `pandora-cli-skills/sdk/typescript`
206
- - Python:
207
- - standalone package identity: `pandora-agent`
208
- - current external install path: signed GitHub release wheel or sdist attached to the tagged Pandora release
209
- - repository checkout path: `sdk/python` for maintainers and in-tree consumers
210
- - module/import name: `pandora_agent`
211
- - Shared static contract bundle:
212
- - standalone TypeScript package: `@thisispandora/agent-sdk/generated`
213
- - repository/root shared bundle: `sdk/generated`
214
- - vendored root-package subpath: `pandora-cli-skills/sdk/generated`
194
+ ### Local runtime checks
215
195
 
216
196
  ```bash
217
- npm run generate:sdk-contracts
197
+ npm run doctor
198
+ npx pandora --output json profile list
199
+ npx pandora --output json profile explain --id market_observer_ro
200
+ ```
201
+
202
+ ## Docs By Task
203
+
204
+ - General command surface: [`docs/skills/command-reference.md`](./docs/skills/command-reference.md)
205
+ - Trading and claim flows: [`docs/skills/trading-workflows.md`](./docs/skills/trading-workflows.md)
206
+ - Mirror planning and operations: [`docs/skills/mirror-operations.md`](./docs/skills/mirror-operations.md)
207
+ - Portfolio and closeout: [`docs/skills/portfolio-closeout.md`](./docs/skills/portfolio-closeout.md)
208
+ - Capability map and category routing: [`docs/skills/capabilities.md`](./docs/skills/capabilities.md)
209
+ - Agent bootstrap: [`docs/skills/agent-quickstart.md`](./docs/skills/agent-quickstart.md)
210
+ - Agent interface contracts: [`docs/skills/agent-interfaces.md`](./docs/skills/agent-interfaces.md)
211
+ - Policies, profiles, and scopes: [`docs/skills/policy-profiles.md`](./docs/skills/policy-profiles.md)
212
+ - Recipes: [`docs/skills/recipes.md`](./docs/skills/recipes.md)
213
+ - Benchmarks and scorecards: [`docs/benchmarks/README.md`](./docs/benchmarks/README.md), [`docs/benchmarks/scenario-catalog.md`](./docs/benchmarks/scenario-catalog.md), [`docs/benchmarks/scorecard.md`](./docs/benchmarks/scorecard.md)
214
+ - Trust and release posture: [`docs/trust/release-verification.md`](./docs/trust/release-verification.md), [`docs/trust/release-bundle-playbook.md`](./docs/trust/release-bundle-playbook.md), [`docs/trust/security-model.md`](./docs/trust/security-model.md), [`docs/trust/support-matrix.md`](./docs/trust/support-matrix.md)
215
+
216
+ ## SDK Surfaces
217
+
218
+ - TypeScript SDK: [`sdk/typescript/README.md`](./sdk/typescript/README.md)
219
+ - Python SDK: [`sdk/python/README.md`](./sdk/python/README.md)
220
+ - Shared generated contracts: `sdk/generated`
221
+
222
+ Notes:
223
+
224
+ - The shipped SDK surfaces are alpha.
225
+ - The repository also vendors matching generated manifests under `sdk/typescript/generated` and `sdk/python/pandora_agent/generated`.
226
+ - Use the SDK-local manifests first when embedding Pandora in a client.
227
+
228
+ ## Repository Layout
229
+
230
+ ```text
231
+ .
232
+ |-- cli/ CLI entrypoint and runtime surface
233
+ |-- docs/skills/ operator and agent documentation
234
+ |-- docs/trust/ release, security, and support docs
235
+ |-- docs/benchmarks/ benchmark methodology and scorecards
236
+ |-- sdk/typescript/ TypeScript SDK surface
237
+ |-- sdk/python/ Python SDK surface
238
+ |-- sdk/generated/ shared generated contract bundle
239
+ |-- references/ contracts and protocol references
240
+ |-- scripts/ build, trust, benchmark, and release helpers
241
+ `-- tests/ CLI, MCP, workflow, and smoke coverage
218
242
  ```
219
243
 
220
- Run that only from a repository checkout. The published npm package ships the generated SDK artifacts already and does not include the repo-only generator script.
221
-
222
- - This repository ships standalone SDK alpha packages plus vendored copies and the shared contract bundle:
223
- - JavaScript/TypeScript SDK package sources under `sdk/typescript`
224
- - Python SDK package sources under `sdk/python`
225
- - vendored TypeScript loader/manifest under `sdk/typescript/generated`
226
- - vendored Python manifest under `sdk/python/pandora_agent/generated`
227
- - shared JS contract export under `sdk/generated`
228
- - `capabilities.data.transports.sdk` reports `supported=true` and `status="alpha"` in current builds.
229
- - Use `capabilities` for compact discovery, canonical tool routing, transport status, and registry digests.
230
- - Use `schema` for the authoritative contract export: JSON envelope definitions, per-command input schemas, and `commandDescriptors`.
231
- - In a repository checkout, `npm run generate:sdk-contracts` regenerates the shared export in `sdk/generated` plus the standalone SDK package-local copies in `sdk/typescript/generated` and `sdk/python/pandora_agent/generated`.
232
- - Standalone SDK consumers should prefer the standalone package entrypoints and package-local generated artifacts:
233
- - TypeScript SDK package identity: `@thisispandora/agent-sdk`
234
- - TypeScript generated bundle subpath: `@thisispandora/agent-sdk/generated`
235
- - Python SDK package identity: `pandora-agent`
236
- - Current release/distribution status:
237
- - standalone SDK artifacts are built and verified in release flow
238
- - use signed GitHub release assets as the external installation path unless a release explicitly announces public npm/PyPI publication
239
- - The root Pandora package continues to vendor matching copies:
240
- - TypeScript client: `pandora-cli-skills/sdk/typescript`
241
- - shared contract bundle: `pandora-cli-skills/sdk/generated`
242
- - vendored manifests: `sdk/typescript/generated/manifest.json` and `sdk/python/pandora_agent/generated/manifest.json`
243
- - Custom generators can still export raw `capabilities` / `schema` snapshots if they need bespoke codegen.
244
- - Regenerate cached clients or derived types when `commandDescriptorVersion` or `registryDigest.descriptorHash` changes.
245
- - For most agent bootstrap flows, start with `bootstrap`, then `schema`, `policy`, `profile`, or MCP before embedding the alpha SDK sources into your own code.
246
- - For direct execution instead of local codegen, connect an SDK or MCP client to `pandora mcp` for local stdio, or intentionally host `pandora mcp http ...` for remote streamable HTTP execution.
247
-
248
- ## Policy And Signer Guidance
249
-
250
- - Prefer scoped MCP access over broad live credentials when an agent can work through `pandora mcp http`. The gateway enforces bearer-token scopes from `--auth-scopes` against each tool's declared `policyScopes`.
251
- - Current builds ship policy packs in alpha. `capabilities.data.policyProfiles.policyPacks` reports `supported=true` and `status="alpha"`, and `pandora --output json policy list|get|lint` exposes the available built-in/user-defined packs.
252
- - Current builds also ship named signer profiles in alpha. `capabilities.data.policyProfiles.signerProfiles` reports `supported=true` and `status="alpha"`, and `pandora --output json profile list|get|explain|validate` exposes sample/user profiles plus readiness metadata.
253
- - `bootstrap` is the canonical recommendation surface today:
254
- - `defaults.policyId` and `defaults.profileId` are the cold-start defaults
255
- - `policyProfiles.policyPacks.recommendedReadOnlyPolicyId` / `recommendedMutablePolicyId` are the machine-usable policy recommendations
256
- - `policyProfiles.signerProfiles.recommendedReadOnlyProfileId` / `recommendedMutableProfileId` are the machine-usable profile recommendations
257
- - `nextSteps[]` gives the canonical follow-up commands in order
258
- - `bootstrap` remains the preferred cold-start surface, but exact-context commands are also available:
259
- - `policy explain`
260
- - `policy recommend`
261
- - `profile recommend`
262
- - treat those exact-context commands as follow-ups after you already know the canonical target tool and execution context; they are not a substitute for `bootstrap`
263
- - `capabilities.data.policyProfiles.signerProfiles` now separates implementation status from runtime readiness:
264
- - implementation fields: `implementedBackends`, `placeholderBackends`
265
- - runtime fields: `readyBuiltinIds`, `degradedBuiltinIds`, `placeholderBuiltinIds`, `pendingBuiltinIds`
266
- - backend rollup: `backendStatuses`
267
- - vocabulary: `statusAxes`
268
- - In the default runtime view, `market_observer_ro` is the only built-in profile reporting `ready`, and it is read-only.
269
- - Use `pandora --output json capabilities --runtime-local-readiness` when you want the CLI to actively probe local signer/network prerequisites; under valid runtime conditions, built-in mutable profiles such as `prod_trader_a`, `dev_keystore_operator`, and `desk_signer_service` can move from `degraded` to `ready`.
270
- - For reproducible host certification without manually sourcing `~/.pandora-cli.env`, run `npm run check:final-readiness:runtime-local`.
271
- - In the current runtime, no built-in mutable profile is ready:
272
- - `prod_trader_a` resolves as `missing-secrets`
273
- - `dev_keystore_operator` resolves as `missing-keystore`
274
- - `desk_signer_service` resolves as `missing-context`
275
- - Treat `degraded` as the backend-level summary only. The exact cause lives in the per-profile payload:
276
- - `profile list` for `runtimeReady` and `resolutionStatus`
277
- - `profile get --id <profile-id>` for raw `resolution` and constraint details
278
- - `profile explain --id <profile-id> [--command <tool>] [--mode <mode>] [--policy-id <id>] [--chain-id <id>] [--category <id|name>]` for the exact decision surface:
279
- - prefer canonical command names from `bootstrap`, `capabilities`, or `schema` when filling `--command`
280
- - `explanation.requestedContext.exact` tells you whether the evaluation is complete or still missing flags
281
- - `explanation.requestedContext.missingFlags` tells the agent what to add before trusting the answer
282
- - `explanation.remediation[]` is the machine-usable action list; treat `blockers` as the human-readable summary
283
- - There is not yet a universal `--profile` selector across mutating commands.
284
- - Direct signer-bearing execution now supports `--profile-id` / `--profile-file` on:
285
- - `trade`, `sell`, `lp add`, `lp remove`, `resolve`, `claim`
286
- - `mirror deploy`, `mirror go`, `mirror sync once|run|start`
287
- - sports live execution paths that route through the shared sports parsers/services
288
- - Some families still commonly bootstrap secrets from process env, `.env`, or explicit flags, but profile-directed execution is no longer limited to the core trading/admin commands.
289
- - The built-in read-only pair is `research-only` plus `market_observer_ro`. Use that pattern for discovery, schema inspection, validation, and other non-signing agent workflows before granting write access.
290
- - If you host `pandora mcp http` without `--auth-token` or `--auth-token-file`, Pandora generates a bearer token at `~/.pandora/mcp-http/auth-token`. If the runtime cannot resolve a home directory, pass one of those flags explicitly.
291
- - `--private-key <hex>` remains supported because the live parser surface still accepts it, but use it as a manual fallback rather than the default operator pattern.
292
-
293
- ## Mirror safety summary
294
- - `mirror plan|deploy|go` use a sports-aware suggested `targetTimestamp`; they do not assume a generic `+1h` buffer.
295
- - Use `--target-timestamp <unix|iso>` only when you intentionally need to override the suggested close time.
296
- - Fresh `mirror deploy` / `mirror go` runs require at least two independent public resolution URLs from different hosts in `--sources`.
297
- - Polymarket, Gamma, and CLOB URLs are discovery inputs only and are not valid `--sources`.
298
- - Validation is exact-payload: validate the final `question`, `rules`, `sources`, and `targetTimestamp` before execute mode.
299
- - CLI mirror execute reruns use `--validation-ticket`; MCP execute/live reruns use `agentPreflight`.
300
- - `mirror sync` is still separate-leg execution, not an atomic cross-venue settlement path. Prefer `--rebalance-mode atomic --price-source on-chain` when you want the single-rebalance sizing path.
301
- - `mirror status --with-live` is the cross-venue status and hedge-gap dashboard, but its P&L fields remain approximate scenario surfaces rather than realized closeout accounting.
302
- - `mirror close` stops daemons and unwinds the Pandora side, but it does not auto-resolve or auto-settle Polymarket inventory. Use `pandora resolve --watch` after close when finalization is not yet open.
303
-
304
- ## PollCategory mapping
305
- - `Politics=0`
306
- - `Sports=1`
307
- - `Finance=2`
308
- - `Crypto=3`
309
- - `Culture=4`
310
- - `Technology=5`
311
- - `Science=6`
312
- - `Entertainment=7`
313
- - `Health=8`
314
- - `Environment=9`
315
- - `Other=10`
316
-
317
- For sports mirror deploy/go flows, use `--category Sports` or `--category 1`.
244
+ ## Minimal Install Facts
245
+
246
+ - Node.js `>=18`
247
+ - Package bin: `pandora`
248
+ - Main repo homepage: this README
249
+ - Shareable/sanitized companion guide: [`README_FOR_SHARING.md`](./README_FOR_SHARING.md)
250
+
251
+ ## Short Version
252
+
253
+ ```text
254
+ Anthropic skill? Install the generated bundle -> test with Pandora-specific prompts -> keep repo root out of skill upload.
255
+ Human? Install -> doctor -> build -> read command/workflow docs.
256
+ Agent? bootstrap -> capabilities -> schema -> policy/profile -> MCP.
257
+ Live? Add scopes and secrets only after exact readiness checks pass.
258
+ ```