pandora-cli-skills 1.1.67 → 1.1.68

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 (44) hide show
  1. package/README.md +50 -146
  2. package/README_FOR_SHARING.md +70 -448
  3. package/SKILL.md +91 -699
  4. package/cli/lib/agent_contract_registry.cjs +667 -74
  5. package/cli/lib/autopilot_state_store.cjs +7 -0
  6. package/cli/lib/capabilities_command_service.cjs +468 -0
  7. package/cli/lib/claim_command_service.cjs +128 -0
  8. package/cli/lib/command_executor_service.cjs +162 -22
  9. package/cli/lib/command_router.cjs +6 -0
  10. package/cli/lib/lp_command_service.cjs +104 -0
  11. package/cli/lib/mcp_http_gateway_service.cjs +553 -0
  12. package/cli/lib/mcp_protocol_service.cjs +144 -0
  13. package/cli/lib/mcp_server_service.cjs +29 -88
  14. package/cli/lib/mcp_tool_registry.cjs +161 -9
  15. package/cli/lib/mirror_close_service.cjs +140 -2
  16. package/cli/lib/mirror_daemon_service.cjs +13 -10
  17. package/cli/lib/mirror_handlers/close.cjs +4 -0
  18. package/cli/lib/mirror_handlers/sync.cjs +122 -8
  19. package/cli/lib/mirror_service.cjs +227 -179
  20. package/cli/lib/operation_event_bus.cjs +315 -0
  21. package/cli/lib/operation_service.cjs +565 -0
  22. package/cli/lib/operation_state_store.cjs +895 -0
  23. package/cli/lib/operation_webhook_service.cjs +202 -0
  24. package/cli/lib/operations_command_service.cjs +131 -0
  25. package/cli/lib/parsers/autopilot_flags.cjs +16 -2
  26. package/cli/lib/parsers/core_command_flags.cjs +16 -7
  27. package/cli/lib/parsers/operations_flags.cjs +106 -0
  28. package/cli/lib/parsers/sports_flags.cjs +12 -2
  29. package/cli/lib/resolve_command_service.cjs +83 -0
  30. package/cli/lib/schema_command_service.cjs +665 -36
  31. package/cli/lib/shared/mcp_path_guard.cjs +39 -5
  32. package/cli/lib/shared/operation_bridge.cjs +280 -0
  33. package/cli/lib/shared/operation_hash.cjs +107 -0
  34. package/cli/lib/shared/operation_states.cjs +179 -0
  35. package/cli/lib/sports_command_service.cjs +4 -0
  36. package/cli/lib/sports_creation_service.cjs +95 -1
  37. package/cli/lib/sports_sync_service.cjs +25 -4
  38. package/cli/pandora.cjs +334 -8
  39. package/docs/skills/agent-interfaces.md +170 -0
  40. package/docs/skills/capabilities.md +97 -0
  41. package/docs/skills/command-reference.md +249 -0
  42. package/docs/skills/legacy-launchers.md +68 -0
  43. package/docs/skills/mirror-operations.md +141 -0
  44. package/package.json +2 -1
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Pandora CLI & Skills
2
2
 
3
- Production CLI for Pandora prediction markets with mirror + hedge tooling and agent-native interfaces.
3
+ Production CLI for Pandora prediction markets with mirror tooling, sports consensus, on-chain trading, analytics, and agent-native interfaces.
4
4
 
5
5
  ## Install
6
6
 
@@ -9,170 +9,74 @@ npm i -g pandora-cli-skills
9
9
  pandora --help
10
10
  ```
11
11
 
12
- Or run without installing:
12
+ Or without installing:
13
13
 
14
14
  ```bash
15
15
  npx pandora-cli-skills@latest --help
16
16
  ```
17
17
 
18
- ## Agent-Native Features
18
+ Node.js `>=18` required.
19
19
 
20
- - `pandora --output json schema`
21
- - emits machine-readable envelope schema + command descriptors.
22
- - `pandora mcp`
23
- - runs an MCP server over stdio (`tools/list`, `tools/call`) for direct agent tool execution.
24
- - JSON errors include optional next-best-action recovery hints:
25
- - `error.recovery = { action, command, retryable }`.
26
- - Attach-only fork runtime for on-chain command families:
27
- - `--fork`, `--fork-rpc-url`, `--fork-chain-id`.
28
- - Event-driven streaming:
29
- - `pandora stream prices|events` emits NDJSON lines on stdout.
30
- - MCP tool surface includes risk/lifecycle/odds command families in addition to core read/trade flows.
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/command-reference.md`](./docs/skills/command-reference.md)
26
+ - human-oriented command and flag reference; use capabilities/schema for machine authority
27
+ - [`docs/skills/mirror-operations.md`](./docs/skills/mirror-operations.md)
28
+ - mirror deploy/go safety, timing, validation, sync, and closeout guidance
29
+ - [`docs/skills/agent-interfaces.md`](./docs/skills/agent-interfaces.md)
30
+ - schema, MCP, JSON envelopes, recovery hints, fork runtime, and error codes
31
+ - [`docs/skills/legacy-launchers.md`](./docs/skills/legacy-launchers.md)
32
+ - `launch` / `clone-bet` legacy script wrappers
31
33
 
32
34
  ## Quickstart
33
35
 
34
36
  ```bash
35
- # schema for typed consumers (Pydantic/Zod/etc.)
37
+ # compact capability digest for agents
38
+ pandora --output json capabilities
39
+
40
+ # schema for typed consumers
36
41
  pandora --output json schema
37
42
 
38
43
  # MCP server mode
39
44
  pandora mcp
40
45
 
41
- # Read-only market discovery
42
- pandora --output json markets list --active --limit 10
46
+ # read-only discovery
47
+ pandora --output json scan --limit 10
43
48
 
44
- # Dry-run trade with fork runtime
49
+ # buy-side dry-run
45
50
  pandora --output json trade --dry-run \
46
- --market-address 0x... --side yes --amount-usdc 10 \
47
- --fork --fork-rpc-url http://127.0.0.1:8545
51
+ --market-address 0x... --side yes --amount-usdc 10
48
52
 
49
- # Dry-run a sell quote / exit path
53
+ # sell-side dry-run
50
54
  pandora --output json sell --dry-run \
51
- --market-address 0x... --side no --shares 25 \
52
- --fork --fork-rpc-url http://127.0.0.1:8545
53
-
54
- # NDJSON stream
55
- pandora stream prices --indexer-url https://pandoraindexer.up.railway.app/ --interval-ms 1000
56
- ```
57
-
58
- ### Sports Quickstart
59
-
60
- ```bash
61
- # list upcoming soccer events
62
- pandora --output json sports events list --competition <id-or-slug> --limit 5
63
-
64
- # compute trimmed-median consensus for one event
65
- pandora --output json sports consensus --event-id <event-id> --trim-percent 20
66
-
67
- # build conservative create + resolve plans
68
- pandora --output json sports create plan --event-id <event-id> --selection home
69
- pandora --output json sports resolve plan --event-id <event-id> --poll-address <0x...>
70
- ```
71
-
72
- ### Lifecycle Quickstart
73
-
74
- ```bash
75
- # lifecycle config must be JSON object (not YAML in current release)
76
- pandora --output json lifecycle start --config ./configs/lifecycle.json
77
- pandora --output json lifecycle status --id <lifecycle-id>
78
- pandora --output json lifecycle resolve --id <lifecycle-id> --confirm
79
- ```
80
-
81
- ### Mirror Operator Notes
82
-
83
- - `mirror plan` computes a sports-aware suggested `targetTimestamp`; do not assume a generic `+1h` close buffer. Use `--target-timestamp <unix|iso>` only when you intentionally want to override the suggested close time.
84
- - Fresh `mirror deploy` / `mirror go` runs need at least two independent public resolution URLs from different hosts in `--sources`. Polymarket, Gamma, and CLOB URLs are source-market discovery inputs and are not valid resolution sources.
85
- - Validation is payload-exact: run `pandora --output json agent market validate ...` on the final `question`, `rules`, `sources`, and `targetTimestamp` before execute mode. CLI mirror execute reruns use `--validation-ticket`; MCP execute/live reruns use `agentPreflight`.
86
- - For sports deploy/create flows, `--category Sports` (or `--category 1`) maps to the on-chain `PollCategory.Sports` enum.
87
- - Poll category ids: `Politics=0`, `Sports=1`, `Finance=2`, `Crypto=3`, `Culture=4`, `Technology=5`, `Science=6`, `Entertainment=7`, `Health=8`, `Environment=9`, `Other=10`.
88
-
89
- ## Risk Controls
90
-
91
- - Inspect/engage panic lock:
92
- - `pandora --output json risk show`
93
- - `pandora --output json risk panic --reason "incident"`
94
- - `pandora --output json risk panic --clear`
95
- - Current guardrail semantics:
96
- - `max_position_usd` guards per-operation notional.
97
- - `max_daily_loss_usd` currently maps to daily live notional cap (`counters.liveNotionalUsdc`).
98
- - `max_open_markets` currently maps to daily live operation cap (`counters.liveOps`).
99
- - All risk state and panic files are persisted with hardened permissions under `~/.pandora/`.
55
+ --market-address 0x... --side no --shares 25
100
56
 
101
- ## Fork Mode Notes
102
-
103
- - Runtime marker is included in payloads: `data.runtime.mode = "fork" | "live"`.
104
- - Fork RPC precedence:
105
- 1. `--fork-rpc-url`
106
- 2. `FORK_RPC_URL` (when `--fork` is set)
107
- 3. command default live RPC path
108
- - `polymarket trade --execute` in fork mode is simulation-only unless `--polymarket-mock-url` is provided.
109
-
110
- ## Streaming Contract
111
-
112
- `pandora stream prices|events` outputs NDJSON only (one JSON object per line), for example:
113
-
114
- ```json
115
- {"type":"stream.tick","channel":"prices","seq":1,"ts":"2026-03-01T12:00:00.000Z","source":{"transport":"polling"},"data":{"id":"market-1","yesPct":58.12}}
57
+ # inspect persisted mutable-operation records
58
+ pandora --output json operations list --status planned,queued,running --limit 20
116
59
  ```
117
60
 
118
- ## Command Surface
119
-
120
- - `pandora markets list|get`
121
- - `pandora scan`
122
- - `scan` is the canonical enriched discovery workflow.
123
- - `markets scan` remains a backward-compatible alias.
124
- - `pandora sports books list`
125
- - `pandora sports events list|live`
126
- - `pandora sports odds snapshot|bulk`
127
- - `pandora sports consensus`
128
- - `pandora sports create plan|run`
129
- - `pandora sports sync once|run|start|stop|status`
130
- - `pandora sports resolve plan`
131
- - `pandora lifecycle start|status|resolve`
132
- - `pandora quote`
133
- - `pandora trade`
134
- - `pandora sell`
135
- - `pandora claim --market-address <address>|--all --dry-run|--execute`
136
- - `pandora history`
137
- - `pandora export`
138
- - `pandora arb scan --output ndjson|json`
139
- - `pandora arbitrage`
140
- - `arb scan` is the canonical arbitrage workflow.
141
- - `arbitrage` remains a bounded one-shot compatibility wrapper.
142
- - `pandora odds record|history`
143
- - `pandora autopilot run|once`
144
- - `pandora mirror browse|plan|deploy|verify|lp-explain|hedge-calc|simulate|go|sync|status|close`
145
- - `mirror browse` supports `--polymarket-tag-id|--polymarket-tag-ids` (aliases `--sport-tag-id|--sport-tag-ids`) for sports-tagged Gamma event discovery.
146
- - `pandora polymarket check|approve|preflight|trade`
147
- - `pandora resolve`
148
- - `pandora lp add|remove|positions`
149
- - `pandora risk show|panic`
150
- - `pandora stream prices|events`
151
- - `pandora schema`
152
- - `pandora mcp`
153
-
154
- ## Quant ABM Baseline (Module Contract)
155
-
156
- - Deterministic ABM engine: `cli/lib/quant/abm_market.cjs`.
157
- - Simulate-agents handler module: `cli/lib/simulate_handlers/agents.cjs`.
158
- - Supported handler flags:
159
- - `--n-informed` or `--n_informed`
160
- - `--n-noise` or `--n_noise`
161
- - `--n-mm` or `--n_mm`
162
- - `--n-steps` or `--n_steps`
163
- - `--seed`
164
- - ABM payload fields include:
165
- - `convergenceError`
166
- - `spreadTrajectory[]`
167
- - `volume` (`total`, `averagePerStep`, `byAgentType`)
168
- - `pnlByAgentType`
169
- - `runtimeBounds` (`complexity`, `estimatedAgentDecisions`, `estimatedWorkUnits`)
170
- - Runtime bound metadata is documented as `O(n_steps * (n_informed + n_noise))`.
171
- - Unit coverage for this baseline is in `tests/unit/abm_market.test.cjs`.
172
-
173
- ## Docs
174
-
175
- - Full command contract and workflows: [`SKILL.md`](./SKILL.md)
176
- - Operator + package documentation: [`README_FOR_SHARING.md`](./README_FOR_SHARING.md)
177
-
178
- Node.js `>=18` required.
61
+ ## Mirror safety summary
62
+ - `mirror plan|deploy|go` use a sports-aware suggested `targetTimestamp`; they do not assume a generic `+1h` buffer.
63
+ - Use `--target-timestamp <unix|iso>` only when you intentionally need to override the suggested close time.
64
+ - Fresh `mirror deploy` / `mirror go` runs require at least two independent public resolution URLs from different hosts in `--sources`.
65
+ - Polymarket, Gamma, and CLOB URLs are discovery inputs only and are not valid `--sources`.
66
+ - Validation is exact-payload: validate the final `question`, `rules`, `sources`, and `targetTimestamp` before execute mode.
67
+ - CLI mirror execute reruns use `--validation-ticket`; MCP execute/live reruns use `agentPreflight`.
68
+
69
+ ## PollCategory mapping
70
+ - `Politics=0`
71
+ - `Sports=1`
72
+ - `Finance=2`
73
+ - `Crypto=3`
74
+ - `Culture=4`
75
+ - `Technology=5`
76
+ - `Science=6`
77
+ - `Entertainment=7`
78
+ - `Health=8`
79
+ - `Environment=9`
80
+ - `Other=10`
81
+
82
+ For sports mirror deploy/go flows, use `--category Sports` or `--category 1`.