clawpowers 1.1.4 → 2.2.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.
Files changed (131) hide show
  1. package/CHANGELOG.md +126 -0
  2. package/COMPATIBILITY.md +13 -0
  3. package/KNOWN_LIMITATIONS.md +19 -0
  4. package/LICENSE +44 -0
  5. package/LICENSING.md +10 -0
  6. package/README.md +378 -210
  7. package/SECURITY.md +52 -0
  8. package/dist/index.d.ts +1477 -0
  9. package/dist/index.js +3464 -0
  10. package/dist/index.js.map +1 -0
  11. package/native/Cargo.lock +4863 -0
  12. package/native/Cargo.toml +73 -0
  13. package/native/crates/canonical/Cargo.toml +24 -0
  14. package/native/crates/canonical/src/lib.rs +673 -0
  15. package/native/crates/compression/Cargo.toml +20 -0
  16. package/native/crates/compression/benches/compression_bench.rs +42 -0
  17. package/native/crates/compression/src/lib.rs +393 -0
  18. package/native/crates/evm-eth/Cargo.toml +13 -0
  19. package/native/crates/evm-eth/src/lib.rs +105 -0
  20. package/native/crates/fee/Cargo.toml +15 -0
  21. package/native/crates/fee/src/lib.rs +281 -0
  22. package/native/crates/index/Cargo.toml +16 -0
  23. package/native/crates/index/src/lib.rs +277 -0
  24. package/native/crates/policy/Cargo.toml +17 -0
  25. package/native/crates/policy/src/lib.rs +614 -0
  26. package/native/crates/security/Cargo.toml +22 -0
  27. package/native/crates/security/src/lib.rs +478 -0
  28. package/native/crates/tokens/Cargo.toml +13 -0
  29. package/native/crates/tokens/src/lib.rs +534 -0
  30. package/native/crates/verification/Cargo.toml +23 -0
  31. package/native/crates/verification/src/lib.rs +333 -0
  32. package/native/crates/wallet/Cargo.toml +20 -0
  33. package/native/crates/wallet/src/lib.rs +261 -0
  34. package/native/crates/x402/Cargo.toml +30 -0
  35. package/native/crates/x402/src/lib.rs +423 -0
  36. package/native/ffi/Cargo.toml +34 -0
  37. package/native/ffi/build.rs +4 -0
  38. package/native/ffi/index.node +0 -0
  39. package/native/ffi/src/lib.rs +352 -0
  40. package/native/ffi/tests/integration.rs +354 -0
  41. package/native/pyo3/Cargo.toml +26 -0
  42. package/native/pyo3/pyproject.toml +16 -0
  43. package/native/pyo3/src/lib.rs +407 -0
  44. package/native/pyo3/tests/test_smoke.py +180 -0
  45. package/native/wasm/Cargo.toml +44 -0
  46. package/native/wasm/pkg/.gitignore +6 -0
  47. package/native/wasm/pkg/clawpowers_wasm.d.ts +208 -0
  48. package/native/wasm/pkg/clawpowers_wasm.js +872 -0
  49. package/native/wasm/pkg/clawpowers_wasm_bg.wasm +0 -0
  50. package/native/wasm/pkg/clawpowers_wasm_bg.wasm.d.ts +40 -0
  51. package/native/wasm/pkg/package.json +17 -0
  52. package/native/wasm/pkg-node/.gitignore +6 -0
  53. package/native/wasm/pkg-node/clawpowers_wasm.d.ts +143 -0
  54. package/native/wasm/pkg-node/clawpowers_wasm.js +798 -0
  55. package/native/wasm/pkg-node/clawpowers_wasm_bg.wasm +0 -0
  56. package/native/wasm/pkg-node/clawpowers_wasm_bg.wasm.d.ts +40 -0
  57. package/native/wasm/pkg-node/package.json +13 -0
  58. package/native/wasm/src/lib.rs +433 -0
  59. package/package.json +71 -44
  60. package/src/skills/catalog.ts +435 -0
  61. package/src/skills/executor.ts +56 -0
  62. package/src/skills/index.ts +3 -0
  63. package/src/skills/itp/SKILL.md +112 -0
  64. package/src/skills/loader.ts +193 -0
  65. package/.claude-plugin/manifest.json +0 -19
  66. package/.codex/INSTALL.md +0 -36
  67. package/.cursor-plugin/manifest.json +0 -21
  68. package/.opencode/INSTALL.md +0 -52
  69. package/ARCHITECTURE.md +0 -69
  70. package/bin/clawpowers.js +0 -625
  71. package/bin/clawpowers.sh +0 -91
  72. package/docs/demo/clawpowers-demo.cast +0 -197
  73. package/docs/demo/clawpowers-demo.gif +0 -0
  74. package/docs/launch-images/25-skills-breakdown.jpg +0 -0
  75. package/docs/launch-images/clawpowers-vs-superpowers.jpg +0 -0
  76. package/docs/launch-images/economic-code-optimization.jpg +0 -0
  77. package/docs/launch-images/native-vs-bridge-2.jpg +0 -0
  78. package/docs/launch-images/native-vs-bridge.jpg +0 -0
  79. package/docs/launch-images/post1-hero-lobster.jpg +0 -0
  80. package/docs/launch-images/post2-dashboard.jpg +0 -0
  81. package/docs/launch-images/post3-superpowers.jpg +0 -0
  82. package/docs/launch-images/post4-before-after.jpg +0 -0
  83. package/docs/launch-images/post5-install-now.jpg +0 -0
  84. package/docs/launch-images/ultimate-stack.jpg +0 -0
  85. package/docs/launch-posts.md +0 -76
  86. package/docs/quickstart-first-transaction.md +0 -204
  87. package/gemini-extension.json +0 -32
  88. package/hooks/session-start +0 -205
  89. package/hooks/session-start.cmd +0 -43
  90. package/hooks/session-start.js +0 -163
  91. package/runtime/demo/README.md +0 -78
  92. package/runtime/demo/x402-mock-server.js +0 -230
  93. package/runtime/feedback/analyze.js +0 -621
  94. package/runtime/feedback/analyze.sh +0 -546
  95. package/runtime/init.js +0 -210
  96. package/runtime/init.sh +0 -178
  97. package/runtime/metrics/collector.js +0 -361
  98. package/runtime/metrics/collector.sh +0 -308
  99. package/runtime/payments/ledger.js +0 -305
  100. package/runtime/payments/ledger.sh +0 -262
  101. package/runtime/payments/pipeline.js +0 -455
  102. package/runtime/persistence/store.js +0 -433
  103. package/runtime/persistence/store.sh +0 -303
  104. package/skill.json +0 -106
  105. package/skills/agent-bounties/SKILL.md +0 -553
  106. package/skills/agent-payments/SKILL.md +0 -479
  107. package/skills/brainstorming/SKILL.md +0 -233
  108. package/skills/content-pipeline/SKILL.md +0 -282
  109. package/skills/cross-project-knowledge/SKILL.md +0 -345
  110. package/skills/dispatching-parallel-agents/SKILL.md +0 -305
  111. package/skills/economic-code-optimization/SKILL.md +0 -265
  112. package/skills/executing-plans/SKILL.md +0 -255
  113. package/skills/finishing-a-development-branch/SKILL.md +0 -260
  114. package/skills/formal-verification-lite/SKILL.md +0 -441
  115. package/skills/learn-how-to-learn/SKILL.md +0 -235
  116. package/skills/market-intelligence/SKILL.md +0 -323
  117. package/skills/meta-skill-evolution/SKILL.md +0 -325
  118. package/skills/prospecting/SKILL.md +0 -454
  119. package/skills/receiving-code-review/SKILL.md +0 -225
  120. package/skills/requesting-code-review/SKILL.md +0 -206
  121. package/skills/security-audit/SKILL.md +0 -353
  122. package/skills/self-healing-code/SKILL.md +0 -369
  123. package/skills/subagent-driven-development/SKILL.md +0 -244
  124. package/skills/systematic-debugging/SKILL.md +0 -355
  125. package/skills/test-driven-development/SKILL.md +0 -416
  126. package/skills/using-clawpowers/SKILL.md +0 -160
  127. package/skills/using-git-worktrees/SKILL.md +0 -261
  128. package/skills/validator/SKILL.md +0 -281
  129. package/skills/verification-before-completion/SKILL.md +0 -254
  130. package/skills/writing-plans/SKILL.md +0 -276
  131. package/skills/writing-skills/SKILL.md +0 -260
package/CHANGELOG.md ADDED
@@ -0,0 +1,126 @@
1
+ # Changelog
2
+
3
+ All notable changes to ClawPowers are documented here.
4
+
5
+ ## [2.2.0] - 2026-04-06
6
+
7
+ ### Added
8
+
9
+ - **Full secp256k1 Ethereum wallet derivation** (MetaMask-compatible): private key → uncompressed public key (64 bytes) → Keccak-256 → last 20 bytes as EIP-55 checksummed address.
10
+ - **Pure Rust `k256`** (RustCrypto) in `native/crates/evm-eth`, wired into **WASM** and **FFI** with exports: `deriveEthereumAddress`, `derivePublicKey`, `signEcdsa`, `verifyEcdsa`.
11
+ - **TypeScript loader** (`src/native/index.ts`): `keccak256Digest`, `deriveEthereumAddress`, `derivePublicKey`, `signEcdsa`, `verifyEcdsa` (Tier 1 → Tier 2 → `null` / `false` as documented).
12
+ - **`signMessage` overload**: `(privateKeyHex, message)` returns a 65-byte ECDSA signature hex (`r‖s‖v`); existing `(message, keyFile, passphrase)` unchanged in shape, now uses ECDSA+Keccak when tiers allow, else HMAC fallback.
13
+ - **Tests**: `tests/wallet/secp256k1.test.ts` (Hardhat default account #0 vector).
14
+
15
+ ### Notes
16
+
17
+ - **WASM**: `getrandom` 0.2 `js` feature enabled for `wasm32` so `k256` builds under `wasm-pack`.
18
+ - **Loader**: If Tier 1 (native) loads, Tier 2 (WASM) is still initialized when available so newer exports (e.g. secp256k1) work when an older `.node` lacks them. `getActiveTier()` remains `native` when the addon is present.
19
+ - Existing keyfiles still use the stored `address` field as the source of truth; newly generated/imported keys use real Ethereum addresses when native or WASM is loaded.
20
+
21
+ ## [2.1.0] - 2026-04-06
22
+
23
+ ### Added
24
+
25
+ - **Native acceleration layer** (parity with ClawPowers-Agent): `native/` Rust workspace (wallet, tokens, policy, fee, x402, canonical, compression, index, verification, security, ffi, WASM crate, PyO3 bindings).
26
+ - **Pre-built WASM** in `native/wasm/pkg-node` and `native/wasm/pkg` so npm installs work **without** `wasm-pack` or Rust.
27
+ - **3-tier TypeScript loader** (`src/native/index.ts`): Tier 1 optional `.node` addon, Tier 2 WASM, Tier 3 pure TypeScript fallbacks. Exported from the package root (`getActiveTier`, `isNativeAvailable`, `isWasmAvailable`, `getCapabilitySummary`, `computeSha256`, `digestForWalletAddress`, `tokenAmountFromHuman`, `calculateFee`, `evaluateWriteFirewall`, etc.).
28
+ - **Payment bridges** (`calculateTransactionFee`, `createPaymentHeader`, `generateWalletAddress`) and **memory bridges** (`getBestCanonicalStore`, `compressVector`, `evaluateWriteSecurity`, …) via `src/payments/native-bridge.ts` and `src/memory/native-store.ts`.
29
+ - **npm scripts:** `build:native`, `build:wasm`.
30
+ - **WASM / native Keccak-256** for wallet address digest when Tier 1 or Tier 2 is active; **SHA-256** remains the Tier 3 fallback only.
31
+
32
+ ### Notes
33
+
34
+ - Tier 1 (native) is **optional**; building `native/ffi` requires Rust locally. Published tarballs focus on Tier 2 WASM + Tier 3 TS.
35
+ - Backward compatible at the **API** level for v2.0.0 importers; wallet **address strings** for newly generated keys may differ from v2.0.0 when WASM/native is loaded (Keccak-256 vs former SHA-256-only digest). Existing keyfiles keep their stored `address` field.
36
+
37
+ ## [2.0.0] - 2026-04-03
38
+
39
+ ### Breaking Changes
40
+
41
+ - **Complete TypeScript rewrite.** The v1.x shell-script runtime has been replaced with a fully typed TypeScript library.
42
+ - **No agent control loop.** ClawPowers is now a pure capability library — bring your own agent framework.
43
+ - **ESM-only.** Requires Node.js 20+.
44
+
45
+ ### Added
46
+
47
+ - **Payments module** — x402 detection (`detect402`), `SpendingPolicy` enforcement, `PaymentExecutor` with append-only audit log. Fees: 0.77% tx / 0.30% swap.
48
+ - **Memory module** — `WorkingMemoryManager` (in-process, token-budgeted), `EpisodicMemory` (JSONL append-only), `ProceduralMemory` (atomic JSON), `CheckpointManager` (crash recovery), `ContextInjector` (relevant memory selection).
49
+ - **RSI module** — `MetricsCollector`, `HypothesisEngine`, `MutationEngine`, `ABTestManager`, `RSIAuditLog`, `AutoResearcher`. Full measure → hypothesize → mutate → A/B test → promote/rollback cycle.
50
+ - **Wallet module** — `WalletManager`, `generateWallet`, `importWallet`, `signMessage` with AES-256-GCM encryption at rest.
51
+ - **Skills module** — `discoverSkills`, `loadSkillManifest`, `SkillExecutor` with outcome tracking.
52
+ - **Config module** — Zod-validated config, dot-notation access, profile support.
53
+ - **Framework demos** — LangChain (`demos/langchain.ts`), Claude Code (`demos/claude-code.md`), ElizaOS (`demos/elizaos.ts`).
54
+ - **231 TypeScript tests** — full coverage across all modules.
55
+ - **BSL 1.1 license** with Change Date April 3, 2030.
56
+ - **SECURITY.md** with vulnerability reporting policy and security design principles.
57
+
58
+ ### Compatibility
59
+
60
+ Drop-in library for: LangChain, LangGraph, Claude Code, Cursor, ElizaOS, AutoGen, CrewAI, Agent Zero, any MCP-compatible host.
61
+
62
+ ### Removed
63
+
64
+ - Shell-script runtime (v1.x skills)
65
+ - CLI binary (`clawpowers` command)
66
+ - Agent control loop (use ClawPowers-Agent for that)
67
+
68
+
69
+ ## [1.1.3] - 2026-03-22
70
+
71
+ ### Added
72
+
73
+ - **Unified Payment Decision Pipeline** (`runtime/payments/pipeline.js`) — 8-step flow for evaluating payment boundaries across all skills
74
+ - **Agent-to-Agent Bounties skill** (`skills/agent-bounties/`) — 6-phase escrow lifecycle for agent hiring
75
+ - **Premium enrichment** in prospecting skill — x402-aware paid data sources
76
+ - **5-minute transaction quickstart** (`docs/quickstart-first-transaction.md`) — JS + Python paths
77
+ - **Demo README** (`runtime/demo/README.md`) — x402 flow walkthrough with curl examples
78
+ - **30 natural language triggers** in skill.json — purchase intents, payment management, demo commands
79
+ - "Payments are optional" README section with regulatory disclaimer and patent positioning
80
+ - Smart `update` command — detects npm vs git install
81
+
82
+ ## [1.1.2] - 2026-03-22
83
+
84
+ ### Added
85
+
86
+ - **Config.json on init** — payments disabled by default, dry-run mode, $0 limits
87
+ - **Payment ledger** (`~/.clawpowers/logs/payments.jsonl`) — full audit trail
88
+ - **Wallet activation wizard** (`npx clawpowers payments setup`) — interactive, non-scary
89
+ - **x402 Mock Merchant** (`npx clawpowers demo x402`) — test payments with zero risk
90
+ - **Dry-run mode** documentation in agent-payments skill
91
+ - **Payment moment hooks** in market-intelligence + security-audit skills
92
+ - Updated using-clawpowers trigger map
93
+ - Standardized `.env.example` across all projects
94
+
95
+ ## [1.1.1] - 2026-03-22
96
+
97
+ ### Added
98
+
99
+ - **economic-code-optimization skill** (25th skill) — ROI-tracked micro-budget spending
100
+ - 4 RSI intelligence skills: meta-skill-evolution, self-healing-code, cross-project-knowledge, formal-verification-lite
101
+ - 2 skills enhanced: test-driven-development (+mutation testing), systematic-debugging (+hypothesis memory)
102
+
103
+ ### Changed
104
+
105
+ - README rewritten (381 lines)
106
+ - +994 lines inline JSDoc comments across 12 code files
107
+
108
+ ## [1.1.0] - 2026-03-21
109
+
110
+ ### Added
111
+
112
+ - agent-payments skill rewritten for agentwallet-sdk v6.0.0
113
+ - OpenClaw skill.json manifest
114
+ - Security Model section in README
115
+ - Agent Payment Demo (3-step walkthrough)
116
+ - Demo GIF (asciinema recording, 621KB)
117
+
118
+ ## [1.0.0] - 2026-03-21
119
+
120
+ ### Added
121
+
122
+ - Initial release — 20 core skills
123
+ - Dual runtime (bash + Node.js)
124
+ - Session hooks for Claude Code, Cursor, Codex, OpenCode, Gemini CLI
125
+ - Metrics collection and RSI feedback loop
126
+ - 366 tests passing
@@ -0,0 +1,13 @@
1
+ # Compatibility Matrix
2
+
3
+ ## Supported release line
4
+
5
+ | clawpowers | Recommended consumer |
6
+ | --- | --- |
7
+ | 2.2.x | capability-library consumers and `clawpowers-agent` 1.1.x |
8
+
9
+ ## Notes
10
+
11
+ - `clawpowers` is the capability library, not the stock OpenClaw wrapper runtime.
12
+ - `clawpowers-agent` is the wrapper runtime that consumes this package.
13
+ - When `clawpowers` ships updated skills or capability implementations, `clawpowers-agent` should pick them up through package updates and skill sync.
@@ -0,0 +1,19 @@
1
+ # Known Limitations
2
+
3
+ ## Production-ready
4
+
5
+ - capability library APIs for payments, memory, RSI, wallet, swarm, and ITP
6
+ - native plus WASM fallback packaging when shipped correctly
7
+ - local validation commands: lint, typecheck, test, build, pack
8
+
9
+ ## Experimental or environment-dependent
10
+
11
+ - prompt-cache economics in benchmark collateral remain modeled, not billed receipts
12
+ - native acceleration availability depends on platform and install environment
13
+ - some consumer behavior depends on the wrapper/runtime that integrates this package
14
+
15
+ ## Important operational notes
16
+
17
+ - non-native environments depend on packaged WASM fallback artifacts for real wallet derivation
18
+ - users should not assume modeled prompt-cache savings are direct provider billing results
19
+ - downstream runtimes should validate their own integration behavior separately from this library
package/LICENSE ADDED
@@ -0,0 +1,44 @@
1
+ Business Source License 1.1
2
+
3
+ Parameters
4
+
5
+ Licensor: AI Agent Economy
6
+ Licensed Work: ClawPowers v2.0.0
7
+ The Licensed Work is (c) 2026 AI Agent Economy.
8
+ Additional Use Grant: Non-production use (development, testing, personal
9
+ projects, academic research) is permitted without a
10
+ commercial license.
11
+ Change Date: April 3, 2030
12
+ Change License: Apache License, Version 2.0
13
+
14
+ -----------------------------------------------------------------------------
15
+
16
+ Terms
17
+
18
+ The Licensor grants you the right to copy, modify, create derivative works,
19
+ redistribute, and make non-production use of the Licensed Work. The Licensor
20
+ may make an Additional Use Grant permitting limited production use.
21
+
22
+ Effective on the Change Date, or the fourth anniversary of the first publicly
23
+ available distribution of a specific version of the Licensed Work under this
24
+ License, whichever comes first, the Licensor grants you rights under the terms
25
+ of the Change License, and the rights granted above terminate.
26
+
27
+ If your use of the Licensed Work does not comply with the requirements in this
28
+ License, you must purchase a commercial license from the Licensor or refrain
29
+ from using the Licensed Work.
30
+
31
+ All copies of the original and modified Licensed Work, and derivative works,
32
+ are subject to this License. This License applies separately for each version
33
+ of the Licensed Work.
34
+
35
+ You must conspicuously display this License on each original or modified copy
36
+ of the Licensed Work.
37
+
38
+ Any use of the Licensed Work in violation of this License will automatically
39
+ terminate your rights under this License.
40
+
41
+ TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
42
+ AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
43
+ EXPRESS OR IMPLIED, INCLUDING WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
44
+ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
package/LICENSING.md ADDED
@@ -0,0 +1,10 @@
1
+ # Licensing and Commercial Use
2
+
3
+ `clawpowers` is released under **BSL-1.1**.
4
+
5
+ ## What this means in practice
6
+
7
+ - this package is the core capability library
8
+ - commercial users should review the BSL terms before deployment or redistribution
9
+ - downstream runtimes such as `clawpowers-agent` may use different licenses for their own wrapper code
10
+ - always evaluate the exact published version you plan to ship