@agenticvault/openclaw 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 agenticvault
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.ja.md ADDED
@@ -0,0 +1,65 @@
1
+ <!-- Source: packages/openclaw-plugin/README.md | Commit: 96a8dcc | Last synced: 2026-02-16 -->
2
+
3
+ # @agenticvault/openclaw
4
+
5
+ [English](README.md) | [繁體中文](README.zh-TW.md) | [简体中文](README.zh-CN.md) | 日本語 | [한국어](README.ko.md)
6
+
7
+ [Agentic Vault](https://github.com/agenticvault/agentic-vault) の OpenClaw プラグイン -- サーバーサイド EVM 署名をデフォルト拒否のポリシーエンジン付き OpenClaw エージェントツールとして公開します。
8
+
9
+ ## インストール
10
+
11
+ ```bash
12
+ npm install @agenticvault/openclaw @agenticvault/agentic-vault
13
+ ```
14
+
15
+ ## 設定
16
+
17
+ OpenClaw エージェント設定にプラグインを登録します:
18
+
19
+ ```json
20
+ {
21
+ "plugins": {
22
+ "agentic-vault": {
23
+ "package": "@agenticvault/openclaw",
24
+ "config": {
25
+ "keyId": "arn:aws:kms:us-east-1:123456789:key/your-key-id",
26
+ "region": "us-east-1",
27
+ "policyConfigPath": "./policy.json"
28
+ }
29
+ }
30
+ }
31
+ }
32
+ ```
33
+
34
+ ## 利用可能なツール
35
+
36
+ ### セーフツール(常時登録)
37
+
38
+ | ツール | 説明 |
39
+ |--------|------|
40
+ | `vault_get_address` | この Vault が管理するウォレットアドレスを取得します |
41
+ | `vault_health_check` | Vault 署名器のヘルスステータスを確認します |
42
+ | `vault_sign_defi_call` | calldata デコードとポリシー検証後に DeFi コントラクトインタラクションに署名します |
43
+ | `vault_sign_permit` | ポリシー検証後に EIP-2612 permit に署名します |
44
+
45
+ ### デュアルゲートツール(`enableUnsafeRawSign: true` が必要)
46
+
47
+ | ツール | 説明 |
48
+ |--------|------|
49
+ | `vault_sign_transaction` | 生の EVM トランザクションに署名します(デコーダーパイプラインをバイパス) |
50
+ | `vault_sign_typed_data` | 生の EIP-712 型付きデータに署名します(デコーダーパイプラインをバイパス) |
51
+
52
+ ## セキュリティ
53
+
54
+ - **デフォルト拒否** -- すべての署名操作に明示的なポリシー承認が必要です
55
+ - **フェイルクローズ** -- 不明な calldata は常に拒否されます
56
+ - **デュアルゲート生署名** -- `vault_sign_transaction` と `vault_sign_typed_data` はデフォルトで無効です。有効にするにはプラグイン設定で `enableUnsafeRawSign: true` を設定する必要があります
57
+ - **監査証跡** -- すべての操作は構造化 JSON として記録されます
58
+
59
+ ## ポリシー設定
60
+
61
+ 完全な例については、メインリポジトリの[ポリシー設定ドキュメント](https://github.com/agenticvault/agentic-vault#configuration)と [`policy.example.json`](https://github.com/agenticvault/agentic-vault/blob/main/policy.example.json) をご覧ください。
62
+
63
+ ## ライセンス
64
+
65
+ [MIT](LICENSE)
package/README.ko.md ADDED
@@ -0,0 +1,65 @@
1
+ <!-- Source: packages/openclaw-plugin/README.md | Commit: 96a8dcc | Last synced: 2026-02-16 -->
2
+
3
+ # @agenticvault/openclaw
4
+
5
+ [English](README.md) | [繁體中文](README.zh-TW.md) | [简体中文](README.zh-CN.md) | [日本語](README.ja.md) | 한국어
6
+
7
+ [Agentic Vault](https://github.com/agenticvault/agentic-vault)의 OpenClaw 플러그인 -- 서버 측 EVM 서명을 기본 거부 정책 엔진이 적용된 OpenClaw 에이전트 도구로 노출합니다.
8
+
9
+ ## 설치
10
+
11
+ ```bash
12
+ npm install @agenticvault/openclaw @agenticvault/agentic-vault
13
+ ```
14
+
15
+ ## 설정
16
+
17
+ OpenClaw 에이전트 설정에서 플러그인을 등록합니다:
18
+
19
+ ```json
20
+ {
21
+ "plugins": {
22
+ "agentic-vault": {
23
+ "package": "@agenticvault/openclaw",
24
+ "config": {
25
+ "keyId": "arn:aws:kms:us-east-1:123456789:key/your-key-id",
26
+ "region": "us-east-1",
27
+ "policyConfigPath": "./policy.json"
28
+ }
29
+ }
30
+ }
31
+ }
32
+ ```
33
+
34
+ ## 사용 가능한 도구
35
+
36
+ ### 안전 도구 (항상 등록됨)
37
+
38
+ | 도구 | 설명 |
39
+ |------|------|
40
+ | `vault_get_address` | 이 Vault가 관리하는 지갑 주소를 가져옵니다 |
41
+ | `vault_health_check` | Vault 서명기의 상태를 확인합니다 |
42
+ | `vault_sign_defi_call` | calldata 디코딩 및 정책 검증 후 DeFi 컨트랙트 상호작용에 서명합니다 |
43
+ | `vault_sign_permit` | 정책 검증 후 EIP-2612 permit에 서명합니다 |
44
+
45
+ ### 이중 게이트 도구 (`enableUnsafeRawSign: true` 필요)
46
+
47
+ | 도구 | 설명 |
48
+ |------|------|
49
+ | `vault_sign_transaction` | 원시 EVM 트랜잭션에 서명합니다 (디코더 파이프라인 우회) |
50
+ | `vault_sign_typed_data` | 원시 EIP-712 타입 데이터에 서명합니다 (디코더 파이프라인 우회) |
51
+
52
+ ## 보안
53
+
54
+ - **기본 거부** -- 모든 서명 작업에 명시적인 정책 승인이 필요합니다
55
+ - **페일 클로즈** -- 알 수 없는 calldata는 항상 거부됩니다
56
+ - **이중 게이트 원시 서명** -- `vault_sign_transaction`과 `vault_sign_typed_data`는 기본적으로 비활성화됩니다. 활성화하려면 플러그인 설정에서 `enableUnsafeRawSign: true`를 설정해야 합니다
57
+ - **감사 추적** -- 모든 작업은 구조화된 JSON으로 기록됩니다
58
+
59
+ ## 정책 설정
60
+
61
+ 전체 예제는 메인 저장소의 [정책 설정 문서](https://github.com/agenticvault/agentic-vault#configuration)와 [`policy.example.json`](https://github.com/agenticvault/agentic-vault/blob/main/policy.example.json)를 참조하세요.
62
+
63
+ ## 라이선스
64
+
65
+ [MIT](LICENSE)
package/README.md ADDED
@@ -0,0 +1,63 @@
1
+ # @agenticvault/openclaw
2
+
3
+ English | [繁體中文](README.zh-TW.md) | [简体中文](README.zh-CN.md) | [日本語](README.ja.md) | [한국어](README.ko.md)
4
+
5
+ OpenClaw plugin for [Agentic Vault](https://github.com/agenticvault/agentic-vault) -- expose server-side EVM signing as OpenClaw agent tools with deny-by-default policy enforcement.
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ npm install @agenticvault/openclaw @agenticvault/agentic-vault
11
+ ```
12
+
13
+ ## Configuration
14
+
15
+ Register the plugin in your OpenClaw agent configuration:
16
+
17
+ ```json
18
+ {
19
+ "plugins": {
20
+ "agentic-vault": {
21
+ "package": "@agenticvault/openclaw",
22
+ "config": {
23
+ "keyId": "arn:aws:kms:us-east-1:123456789:key/your-key-id",
24
+ "region": "us-east-1",
25
+ "policyConfigPath": "./policy.json"
26
+ }
27
+ }
28
+ }
29
+ }
30
+ ```
31
+
32
+ ## Available Tools
33
+
34
+ ### Safe Tools (always registered)
35
+
36
+ | Tool | Description |
37
+ |------|-------------|
38
+ | `vault_get_address` | Get the wallet address managed by this vault |
39
+ | `vault_health_check` | Check the health status of the vault signer |
40
+ | `vault_sign_defi_call` | Sign a DeFi contract interaction after calldata decoding and policy validation |
41
+ | `vault_sign_permit` | Sign an EIP-2612 permit after policy validation |
42
+
43
+ ### Dual-Gated Tools (requires `enableUnsafeRawSign: true`)
44
+
45
+ | Tool | Description |
46
+ |------|-------------|
47
+ | `vault_sign_transaction` | Sign a raw EVM transaction (bypasses decoder pipeline) |
48
+ | `vault_sign_typed_data` | Sign raw EIP-712 typed data (bypasses decoder pipeline) |
49
+
50
+ ## Security
51
+
52
+ - **Deny by default** -- all signing operations require explicit policy approval
53
+ - **Fail-closed** -- unknown calldata is always rejected
54
+ - **Dual-gated raw signing** -- `vault_sign_transaction` and `vault_sign_typed_data` are disabled by default; enabling requires `enableUnsafeRawSign: true` in the plugin config
55
+ - **Audit trail** -- every operation is logged as structured JSON
56
+
57
+ ## Policy Configuration
58
+
59
+ See the main repository's [policy configuration docs](https://github.com/agenticvault/agentic-vault#configuration) and [`policy.example.json`](https://github.com/agenticvault/agentic-vault/blob/main/policy.example.json) for a complete example.
60
+
61
+ ## License
62
+
63
+ [MIT](LICENSE)
@@ -0,0 +1,65 @@
1
+ <!-- Source: packages/openclaw-plugin/README.md | Commit: 96a8dcc | Last synced: 2026-02-16 -->
2
+
3
+ # @agenticvault/openclaw
4
+
5
+ [English](README.md) | [繁體中文](README.zh-TW.md) | 简体中文 | [日本語](README.ja.md) | [한국어](README.ko.md)
6
+
7
+ [Agentic Vault](https://github.com/agenticvault/agentic-vault) 的 OpenClaw 插件 -- 将服务器端 EVM 签名暴露为 OpenClaw 代理工具,搭配默认拒绝的策略引擎。
8
+
9
+ ## 安装
10
+
11
+ ```bash
12
+ npm install @agenticvault/openclaw @agenticvault/agentic-vault
13
+ ```
14
+
15
+ ## 配置
16
+
17
+ 在 OpenClaw 代理配置中注册插件:
18
+
19
+ ```json
20
+ {
21
+ "plugins": {
22
+ "agentic-vault": {
23
+ "package": "@agenticvault/openclaw",
24
+ "config": {
25
+ "keyId": "arn:aws:kms:us-east-1:123456789:key/your-key-id",
26
+ "region": "us-east-1",
27
+ "policyConfigPath": "./policy.json"
28
+ }
29
+ }
30
+ }
31
+ }
32
+ ```
33
+
34
+ ## 可用工具
35
+
36
+ ### 安全工具(默认启用)
37
+
38
+ | 工具 | 说明 |
39
+ |------|------|
40
+ | `vault_get_address` | 获取此保险库管理的钱包地址 |
41
+ | `vault_health_check` | 检查保险库签名器的健康状态 |
42
+ | `vault_sign_defi_call` | 在 calldata 解码与策略验证后签署 DeFi 合约交互 |
43
+ | `vault_sign_permit` | 在策略验证后签署 EIP-2612 permit |
44
+
45
+ ### 双重闸控工具(需要 `enableUnsafeRawSign: true`)
46
+
47
+ | 工具 | 说明 |
48
+ |------|------|
49
+ | `vault_sign_transaction` | 签署原始 EVM 交易(绕过解码管线) |
50
+ | `vault_sign_typed_data` | 签署原始 EIP-712 类型化数据(绕过解码管线) |
51
+
52
+ ## 安全性
53
+
54
+ - **默认拒绝** -- 所有签名操作皆需明确的策略批准
55
+ - **失败关闭** -- 未知 calldata 一律拒绝
56
+ - **双重闸控原始签名** -- `vault_sign_transaction` 与 `vault_sign_typed_data` 默认禁用;启用需在插件配置中设置 `enableUnsafeRawSign: true`
57
+ - **审计追踪** -- 每次操作皆以结构化 JSON 记录
58
+
59
+ ## 策略配置
60
+
61
+ 请参阅主项目的[策略配置文档](https://github.com/agenticvault/agentic-vault#configuration)与 [`policy.example.json`](https://github.com/agenticvault/agentic-vault/blob/main/policy.example.json) 获取完整示例。
62
+
63
+ ## 许可证
64
+
65
+ [MIT](LICENSE)
@@ -0,0 +1,65 @@
1
+ <!-- Source: packages/openclaw-plugin/README.md | Commit: 96a8dcc | Last synced: 2026-02-16 -->
2
+
3
+ # @agenticvault/openclaw
4
+
5
+ [English](README.md) | 繁體中文 | [简体中文](README.zh-CN.md) | [日本語](README.ja.md) | [한국어](README.ko.md)
6
+
7
+ [Agentic Vault](https://github.com/agenticvault/agentic-vault) 的 OpenClaw 插件 -- 將伺服器端 EVM 簽章暴露為 OpenClaw 代理工具,搭配預設拒絕的策略引擎。
8
+
9
+ ## 安裝
10
+
11
+ ```bash
12
+ npm install @agenticvault/openclaw @agenticvault/agentic-vault
13
+ ```
14
+
15
+ ## 設定
16
+
17
+ 在 OpenClaw 代理設定中註冊插件:
18
+
19
+ ```json
20
+ {
21
+ "plugins": {
22
+ "agentic-vault": {
23
+ "package": "@agenticvault/openclaw",
24
+ "config": {
25
+ "keyId": "arn:aws:kms:us-east-1:123456789:key/your-key-id",
26
+ "region": "us-east-1",
27
+ "policyConfigPath": "./policy.json"
28
+ }
29
+ }
30
+ }
31
+ }
32
+ ```
33
+
34
+ ## 可用工具
35
+
36
+ ### 安全工具(預設啟用)
37
+
38
+ | 工具 | 說明 |
39
+ |------|------|
40
+ | `vault_get_address` | 取得此保險庫管理的錢包地址 |
41
+ | `vault_health_check` | 檢查保險庫簽署器的健康狀態 |
42
+ | `vault_sign_defi_call` | 在 calldata 解碼與策略驗證後簽署 DeFi 合約互動 |
43
+ | `vault_sign_permit` | 在策略驗證後簽署 EIP-2612 permit |
44
+
45
+ ### 雙重閘控工具(需要 `enableUnsafeRawSign: true`)
46
+
47
+ | 工具 | 說明 |
48
+ |------|------|
49
+ | `vault_sign_transaction` | 簽署原始 EVM 交易(繞過解碼管線) |
50
+ | `vault_sign_typed_data` | 簽署原始 EIP-712 型別化資料(繞過解碼管線) |
51
+
52
+ ## 安全性
53
+
54
+ - **預設拒絕** -- 所有簽署操作皆需明確的策略核准
55
+ - **失敗關閉** -- 未知 calldata 一律拒絕
56
+ - **雙重閘控原始簽署** -- `vault_sign_transaction` 與 `vault_sign_typed_data` 預設停用;啟用需在插件設定中指定 `enableUnsafeRawSign: true`
57
+ - **稽核軌跡** -- 每次操作皆以結構化 JSON 記錄
58
+
59
+ ## 策略設定
60
+
61
+ 請參閱主專案的[策略設定文件](https://github.com/agenticvault/agentic-vault#configuration)與 [`policy.example.json`](https://github.com/agenticvault/agentic-vault/blob/main/policy.example.json) 取得完整範例。
62
+
63
+ ## 授權
64
+
65
+ [MIT](LICENSE)
@@ -0,0 +1,7 @@
1
+ import { type WorkflowContext } from '@agenticvault/agentic-vault/protocols';
2
+ import { type OpenClawPluginConfig } from './types.js';
3
+ /**
4
+ * Build a WorkflowContext from OpenClaw plugin configuration.
5
+ * Returns a new instance on each call — caller manages lifecycle.
6
+ */
7
+ export declare function buildContext(config: OpenClawPluginConfig): WorkflowContext;
@@ -0,0 +1,62 @@
1
+ import { createSigningProvider, EvmSignerAdapter, } from '@agenticvault/agentic-vault';
2
+ import { PolicyEngine, erc20Evaluator, uniswapV3Evaluator, aaveV3Evaluator, ProtocolDispatcher, createDefaultRegistry, loadPolicyConfigFromFile, } from '@agenticvault/agentic-vault/protocols';
3
+ const DEFAULT_POLICY = {
4
+ allowedChainIds: [],
5
+ allowedContracts: [],
6
+ allowedSelectors: [],
7
+ maxAmountWei: 0n,
8
+ maxDeadlineSeconds: 0,
9
+ };
10
+ /**
11
+ * Build a WorkflowContext from OpenClaw plugin configuration.
12
+ * Returns a new instance on each call — caller manages lifecycle.
13
+ */
14
+ export function buildContext(config) {
15
+ if (!config.keyId) {
16
+ throw new Error('OpenClaw plugin config: keyId is required');
17
+ }
18
+ if (!config.region) {
19
+ throw new Error('OpenClaw plugin config: region is required');
20
+ }
21
+ const provider = createSigningProvider({
22
+ provider: 'aws-kms',
23
+ keyId: config.keyId,
24
+ region: config.region,
25
+ });
26
+ const signer = new EvmSignerAdapter(provider, {
27
+ expectedAddress: config.expectedAddress,
28
+ });
29
+ const policyConfig = config.policyConfigPath
30
+ ? loadPolicyConfigFromFile(config.policyConfigPath)
31
+ : DEFAULT_POLICY;
32
+ const policyEngine = new PolicyEngine(policyConfig, [
33
+ erc20Evaluator,
34
+ uniswapV3Evaluator,
35
+ aaveV3Evaluator,
36
+ ]);
37
+ const dispatcher = new ProtocolDispatcher(createDefaultRegistry());
38
+ const auditSink = createAuditSink();
39
+ return {
40
+ signer,
41
+ policyEngine,
42
+ auditSink,
43
+ dispatcher,
44
+ caller: 'openclaw',
45
+ service: 'agentic-vault-openclaw',
46
+ };
47
+ }
48
+ /** Simple AuditSink implementation — writes JSON to stderr */
49
+ function createAuditSink() {
50
+ return {
51
+ log(entry) {
52
+ const full = {
53
+ timestamp: new Date().toISOString(),
54
+ traceId: crypto.randomUUID(),
55
+ ...entry,
56
+ };
57
+ process.stderr.write(JSON.stringify(full) + '\n');
58
+ return full;
59
+ },
60
+ };
61
+ }
62
+ //# sourceMappingURL=context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAClB,qBAAqB,EACrB,wBAAwB,GAIzB,MAAM,uCAAuC,CAAC;AAG/C,MAAM,cAAc,GAAmB;IACrC,eAAe,EAAE,EAAE;IACnB,gBAAgB,EAAE,EAAE;IACpB,gBAAgB,EAAE,EAAE;IACpB,YAAY,EAAE,EAAE;IAChB,kBAAkB,EAAE,CAAC;CACtB,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,MAA4B;IACvD,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QAClB,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;IAC/D,CAAC;IACD,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;QACnB,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;IAChE,CAAC;IAED,MAAM,QAAQ,GAAG,qBAAqB,CAAC;QACrC,QAAQ,EAAE,SAAS;QACnB,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,MAAM,EAAE,MAAM,CAAC,MAAM;KACtB,CAAC,CAAC;IACH,MAAM,MAAM,GAAG,IAAI,gBAAgB,CAAC,QAAQ,EAAE;QAC5C,eAAe,EAAE,MAAM,CAAC,eAA4C;KACrE,CAAC,CAAC;IAEH,MAAM,YAAY,GAAG,MAAM,CAAC,gBAAgB;QAC1C,CAAC,CAAC,wBAAwB,CAAC,MAAM,CAAC,gBAAgB,CAAC;QACnD,CAAC,CAAC,cAAc,CAAC;IACnB,MAAM,YAAY,GAAG,IAAI,YAAY,CAAC,YAAY,EAAE;QAClD,cAAc;QACd,kBAAkB;QAClB,eAAe;KAChB,CAAC,CAAC;IAEH,MAAM,UAAU,GAAG,IAAI,kBAAkB,CAAC,qBAAqB,EAAE,CAAC,CAAC;IACnE,MAAM,SAAS,GAAG,eAAe,EAAE,CAAC;IAEpC,OAAO;QACL,MAAM;QACN,YAAY;QACZ,SAAS;QACT,UAAU;QACV,MAAM,EAAE,UAAU;QAClB,OAAO,EAAE,wBAAwB;KAClC,CAAC;AACJ,CAAC;AAED,8DAA8D;AAC9D,SAAS,eAAe;IACtB,OAAO;QACL,GAAG,CAAC,KAAK;YACP,MAAM,IAAI,GAAG;gBACX,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;gBACnC,OAAO,EAAE,MAAM,CAAC,UAAU,EAAE;gBAC5B,GAAG,KAAK;aACT,CAAC;YACF,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;YAClD,OAAO,IAAI,CAAC;QACd,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,9 @@
1
+ export { type OpenClawPluginApi, type OpenClawToolConfig, type OpenClawParameter, type OpenClawToolHandler, type OpenClawToolResult, type OpenClawPluginConfig, } from './types.js';
2
+ export { buildContext } from './context.js';
3
+ export { registerTools } from './tools.js';
4
+ import { type OpenClawPluginApi, type OpenClawPluginConfig } from './types.js';
5
+ /**
6
+ * OpenClaw plugin entry point.
7
+ * Called by the OpenClaw host to register vault signing tools.
8
+ */
9
+ export declare function register(api: OpenClawPluginApi, config: OpenClawPluginConfig): void;
package/dist/index.js ADDED
@@ -0,0 +1,13 @@
1
+ export { buildContext } from './context.js';
2
+ export { registerTools } from './tools.js';
3
+ import { buildContext } from './context.js';
4
+ import { registerTools } from './tools.js';
5
+ /**
6
+ * OpenClaw plugin entry point.
7
+ * Called by the OpenClaw host to register vault signing tools.
8
+ */
9
+ export function register(api, config) {
10
+ const ctx = buildContext(config);
11
+ registerTools(api, ctx, config);
12
+ }
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAG3C,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C;;;GAGG;AACH,MAAM,UAAU,QAAQ,CACtB,GAAsB,EACtB,MAA4B;IAE5B,MAAM,GAAG,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;IACjC,aAAa,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;AAClC,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { type WorkflowContext } from '@agenticvault/agentic-vault/protocols';
2
+ import { type OpenClawPluginApi, type OpenClawPluginConfig } from './types.js';
3
+ /**
4
+ * Register all OpenClaw tools.
5
+ * 4 safe tools are always registered.
6
+ * 2 dual-gated tools are only registered when enableUnsafeRawSign is true.
7
+ */
8
+ export declare function registerTools(api: OpenClawPluginApi, ctx: WorkflowContext, config: OpenClawPluginConfig): void;
package/dist/tools.js ADDED
@@ -0,0 +1,326 @@
1
+ import { signDefiCall, signPermit, getAddressWorkflow, healthCheckWorkflow, } from '@agenticvault/agentic-vault/protocols';
2
+ // ─── Result Adapter ───
3
+ function toResult(result) {
4
+ switch (result.status) {
5
+ case 'approved':
6
+ return { content: [{ type: 'text', text: result.data }] };
7
+ case 'dry-run-approved': {
8
+ const replacer = (_k, v) => typeof v === 'bigint' ? v.toString() : v;
9
+ return {
10
+ content: [
11
+ { type: 'text', text: JSON.stringify(result.details, replacer) },
12
+ ],
13
+ };
14
+ }
15
+ case 'denied':
16
+ return { content: [{ type: 'text', text: result.reason }] };
17
+ case 'error':
18
+ return { content: [{ type: 'text', text: `Error: ${result.reason}` }] };
19
+ }
20
+ }
21
+ // ─── Safe Tools (always registered) ───
22
+ function registerGetAddress(api, ctx) {
23
+ api.registerTool('vault_get_address', {
24
+ description: 'Get the wallet address managed by this vault',
25
+ }, async () => {
26
+ const result = await getAddressWorkflow(ctx);
27
+ return toResult(result);
28
+ });
29
+ }
30
+ function registerHealthCheck(api, ctx) {
31
+ api.registerTool('vault_health_check', {
32
+ description: 'Check the health status of the vault signer',
33
+ }, async () => {
34
+ const result = await healthCheckWorkflow(ctx);
35
+ return toResult(result);
36
+ });
37
+ }
38
+ function registerSignDefiCall(api, ctx) {
39
+ api.registerTool('vault_sign_defi_call', {
40
+ description: 'Sign a DeFi contract interaction after calldata decoding and policy validation',
41
+ parameters: {
42
+ chainId: {
43
+ type: 'number',
44
+ description: 'The chain ID for the transaction',
45
+ required: true,
46
+ },
47
+ to: {
48
+ type: 'string',
49
+ description: 'The target contract address (0x-prefixed)',
50
+ required: true,
51
+ },
52
+ data: {
53
+ type: 'string',
54
+ description: 'The calldata (hex-encoded, 0x-prefixed)',
55
+ required: true,
56
+ },
57
+ value: {
58
+ type: 'string',
59
+ description: 'The value in wei (decimal string)',
60
+ },
61
+ },
62
+ }, async (args) => {
63
+ const result = await signDefiCall(ctx, 'vault_sign_defi_call', {
64
+ chainId: args.chainId,
65
+ to: args.to,
66
+ data: args.data,
67
+ value: args.value,
68
+ });
69
+ return toResult(result);
70
+ });
71
+ }
72
+ function registerSignPermit(api, ctx) {
73
+ api.registerTool('vault_sign_permit', {
74
+ description: 'Sign an EIP-2612 permit after policy validation',
75
+ parameters: {
76
+ chainId: {
77
+ type: 'number',
78
+ description: 'The chain ID',
79
+ required: true,
80
+ },
81
+ token: {
82
+ type: 'string',
83
+ description: 'The token contract address (0x-prefixed)',
84
+ required: true,
85
+ },
86
+ spender: {
87
+ type: 'string',
88
+ description: 'The spender address (0x-prefixed)',
89
+ required: true,
90
+ },
91
+ value: {
92
+ type: 'string',
93
+ description: 'The permit value in wei (decimal string)',
94
+ required: true,
95
+ },
96
+ deadline: {
97
+ type: 'number',
98
+ description: 'The permit deadline (unix timestamp)',
99
+ required: true,
100
+ },
101
+ domain: {
102
+ type: 'object',
103
+ description: 'The EIP-712 domain',
104
+ required: true,
105
+ },
106
+ types: {
107
+ type: 'object',
108
+ description: 'The EIP-712 types',
109
+ required: true,
110
+ },
111
+ message: {
112
+ type: 'object',
113
+ description: 'The EIP-712 message',
114
+ required: true,
115
+ },
116
+ },
117
+ }, async (args) => {
118
+ const result = await signPermit(ctx, {
119
+ chainId: args.chainId,
120
+ token: args.token,
121
+ spender: args.spender,
122
+ value: args.value,
123
+ deadline: args.deadline,
124
+ domain: args.domain,
125
+ types: args.types,
126
+ message: args.message,
127
+ });
128
+ return toResult(result);
129
+ });
130
+ }
131
+ // ─── Dual-Gated Tools (only with enableUnsafeRawSign) ───
132
+ function registerSignTransaction(api, ctx) {
133
+ api.registerTool('vault_sign_transaction', {
134
+ description: '[UNSAFE] Sign a raw EVM transaction. Only available when enableUnsafeRawSign is configured.',
135
+ parameters: {
136
+ chainId: {
137
+ type: 'number',
138
+ description: 'The chain ID',
139
+ required: true,
140
+ },
141
+ to: {
142
+ type: 'string',
143
+ description: 'The target address (0x-prefixed)',
144
+ required: true,
145
+ },
146
+ data: {
147
+ type: 'string',
148
+ description: 'The calldata (hex-encoded)',
149
+ },
150
+ value: {
151
+ type: 'string',
152
+ description: 'The value in wei (decimal string)',
153
+ },
154
+ nonce: { type: 'number', description: 'The transaction nonce' },
155
+ gas: {
156
+ type: 'string',
157
+ description: 'The gas limit (decimal string)',
158
+ },
159
+ maxFeePerGas: {
160
+ type: 'string',
161
+ description: 'Max fee per gas in wei',
162
+ },
163
+ maxPriorityFeePerGas: {
164
+ type: 'string',
165
+ description: 'Max priority fee per gas in wei',
166
+ },
167
+ },
168
+ optional: true,
169
+ }, async (args) => {
170
+ if (!ctx.signer) {
171
+ ctx.auditSink.log({
172
+ service: ctx.service ?? 'agentic-vault-openclaw',
173
+ action: 'vault_sign_transaction',
174
+ who: ctx.caller,
175
+ what: 'Signer not available for raw transaction signing',
176
+ why: 'Configuration error: signer is required',
177
+ result: 'error',
178
+ });
179
+ return {
180
+ content: [{ type: 'text', text: 'Error: Signer is not available' }],
181
+ };
182
+ }
183
+ try {
184
+ const to = args.to.toLowerCase();
185
+ const tx = {
186
+ chainId: args.chainId,
187
+ to,
188
+ type: 'eip1559',
189
+ };
190
+ if (args.data)
191
+ tx.data = args.data;
192
+ if (args.value)
193
+ tx.value = BigInt(args.value);
194
+ if (args.nonce !== undefined)
195
+ tx.nonce = args.nonce;
196
+ if (args.gas)
197
+ tx.gas = BigInt(args.gas);
198
+ if (args.maxFeePerGas)
199
+ tx.maxFeePerGas = BigInt(args.maxFeePerGas);
200
+ if (args.maxPriorityFeePerGas)
201
+ tx.maxPriorityFeePerGas = BigInt(args.maxPriorityFeePerGas);
202
+ const signedTx = await ctx.signer.signTransaction(tx);
203
+ ctx.auditSink.log({
204
+ service: ctx.service ?? 'agentic-vault-openclaw',
205
+ action: 'vault_sign_transaction',
206
+ who: ctx.caller,
207
+ what: `Signed raw transaction to ${to} on chain ${args.chainId}`,
208
+ why: 'Raw transaction signing (enableUnsafeRawSign enabled)',
209
+ result: 'approved',
210
+ details: { chainId: args.chainId, to },
211
+ });
212
+ return { content: [{ type: 'text', text: signedTx }] };
213
+ }
214
+ catch (error) {
215
+ const msg = error instanceof Error ? error.message : String(error);
216
+ ctx.auditSink.log({
217
+ service: ctx.service ?? 'agentic-vault-openclaw',
218
+ action: 'vault_sign_transaction',
219
+ who: ctx.caller,
220
+ what: `Failed to sign raw transaction to ${args.to}`,
221
+ why: 'Signing error',
222
+ result: 'error',
223
+ details: { error: msg },
224
+ });
225
+ return {
226
+ content: [{ type: 'text', text: `Signing error: ${msg}` }],
227
+ };
228
+ }
229
+ });
230
+ }
231
+ function registerSignTypedData(api, ctx) {
232
+ api.registerTool('vault_sign_typed_data', {
233
+ description: '[UNSAFE] Sign raw EIP-712 typed data. Only available when enableUnsafeRawSign is configured.',
234
+ parameters: {
235
+ domain: {
236
+ type: 'object',
237
+ description: 'The EIP-712 domain',
238
+ required: true,
239
+ },
240
+ types: {
241
+ type: 'object',
242
+ description: 'The EIP-712 types',
243
+ required: true,
244
+ },
245
+ primaryType: {
246
+ type: 'string',
247
+ description: 'The primary type name',
248
+ required: true,
249
+ },
250
+ message: {
251
+ type: 'object',
252
+ description: 'The EIP-712 message',
253
+ required: true,
254
+ },
255
+ },
256
+ optional: true,
257
+ }, async (args) => {
258
+ if (!ctx.signer) {
259
+ ctx.auditSink.log({
260
+ service: ctx.service ?? 'agentic-vault-openclaw',
261
+ action: 'vault_sign_typed_data',
262
+ who: ctx.caller,
263
+ what: 'Signer not available for typed data signing',
264
+ why: 'Configuration error: signer is required',
265
+ result: 'error',
266
+ });
267
+ return {
268
+ content: [{ type: 'text', text: 'Error: Signer is not available' }],
269
+ };
270
+ }
271
+ try {
272
+ const sig = await ctx.signer.signTypedData({
273
+ domain: args.domain,
274
+ types: args.types,
275
+ primaryType: args.primaryType,
276
+ message: args.message,
277
+ });
278
+ ctx.auditSink.log({
279
+ service: ctx.service ?? 'agentic-vault-openclaw',
280
+ action: 'vault_sign_typed_data',
281
+ who: ctx.caller,
282
+ what: `Signed typed data with primaryType ${args.primaryType}`,
283
+ why: 'Raw typed data signing (enableUnsafeRawSign enabled)',
284
+ result: 'approved',
285
+ details: { primaryType: args.primaryType },
286
+ });
287
+ return {
288
+ content: [{ type: 'text', text: JSON.stringify(sig) }],
289
+ };
290
+ }
291
+ catch (error) {
292
+ const msg = error instanceof Error ? error.message : String(error);
293
+ ctx.auditSink.log({
294
+ service: ctx.service ?? 'agentic-vault-openclaw',
295
+ action: 'vault_sign_typed_data',
296
+ who: ctx.caller,
297
+ what: `Failed to sign typed data with primaryType ${args.primaryType}`,
298
+ why: 'Signing error',
299
+ result: 'error',
300
+ details: { error: msg },
301
+ });
302
+ return {
303
+ content: [{ type: 'text', text: `Signing error: ${msg}` }],
304
+ };
305
+ }
306
+ });
307
+ }
308
+ // ─── Public Registration ───
309
+ /**
310
+ * Register all OpenClaw tools.
311
+ * 4 safe tools are always registered.
312
+ * 2 dual-gated tools are only registered when enableUnsafeRawSign is true.
313
+ */
314
+ export function registerTools(api, ctx, config) {
315
+ // Safe tools — always registered
316
+ registerGetAddress(api, ctx);
317
+ registerHealthCheck(api, ctx);
318
+ registerSignDefiCall(api, ctx);
319
+ registerSignPermit(api, ctx);
320
+ // Dual-gated tools — only with enableUnsafeRawSign
321
+ if (config.enableUnsafeRawSign) {
322
+ registerSignTransaction(api, ctx);
323
+ registerSignTypedData(api, ctx);
324
+ }
325
+ }
326
+ //# sourceMappingURL=tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools.js","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,UAAU,EACV,kBAAkB,EAClB,mBAAmB,GAGpB,MAAM,uCAAuC,CAAC;AAO/C,yBAAyB;AAEzB,SAAS,QAAQ,CAAC,MAAsB;IACtC,QAAQ,MAAM,CAAC,MAAM,EAAE,CAAC;QACtB,KAAK,UAAU;YACb,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC;QAC5D,KAAK,kBAAkB,CAAC,CAAC,CAAC;YACxB,MAAM,QAAQ,GAAG,CAAC,EAAU,EAAE,CAAU,EAAE,EAAE,CAC1C,OAAO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C;YACf,MAAM,GAAG,GACP,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAEzD,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC;gBAChB,OAAO,EAAE,GAAG,CAAC,OAAO,IAAI,wBAAwB;gBAChD,MAAM,EAAE,uBAAuB;gBAC/B,GAAG,EAAE,GAAG,CAAC,MAAM;gBACf,IAAI,EAAE,8CAA8C,IAAI,CAAC,WAAqB,EAAE;gBAChF,GAAG,EAAE,eAAe;gBACpB,MAAM,EAAE,OAAO;gBACf,OAAO,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE;aACxB,CAAC,CAAC;YAEH,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,GAAG,EAAE,EAAE,CAAC;aAC3D,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC;AAED,8BAA8B;AAE9B;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAC3B,GAAsB,EACtB,GAAoB,EACpB,MAA4B;IAE5B,iCAAiC;IACjC,kBAAkB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAC7B,mBAAmB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAC9B,oBAAoB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAC/B,kBAAkB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAE7B,mDAAmD;IACnD,IAAI,MAAM,CAAC,mBAAmB,EAAE,CAAC;QAC/B,uBAAuB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QAClC,qBAAqB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAClC,CAAC;AACH,CAAC"}
@@ -0,0 +1,35 @@
1
+ /** OpenClaw plugin API — structural contract for tool registration */
2
+ export interface OpenClawPluginApi {
3
+ registerTool(name: string, config: OpenClawToolConfig, handler: OpenClawToolHandler): void;
4
+ }
5
+ /** Tool configuration for OpenClaw registration */
6
+ export interface OpenClawToolConfig {
7
+ description: string;
8
+ parameters?: Record<string, OpenClawParameter>;
9
+ /** When true, the tool can be allowlisted by the agent (dual-gated) */
10
+ optional?: boolean;
11
+ }
12
+ /** JSON Schema-compatible parameter definition (TypeBox compatible) */
13
+ export interface OpenClawParameter {
14
+ type: string;
15
+ description: string;
16
+ required?: boolean;
17
+ enum?: string[];
18
+ }
19
+ /** Tool handler function signature */
20
+ export type OpenClawToolHandler = (args: Record<string, unknown>) => Promise<OpenClawToolResult>;
21
+ /** Standard OpenClaw tool result format */
22
+ export interface OpenClawToolResult {
23
+ content: {
24
+ type: 'text';
25
+ text: string;
26
+ }[];
27
+ }
28
+ /** Plugin configuration provided by the OpenClaw host */
29
+ export interface OpenClawPluginConfig {
30
+ keyId: string;
31
+ region: string;
32
+ expectedAddress?: string;
33
+ policyConfigPath?: string;
34
+ enableUnsafeRawSign?: boolean;
35
+ }
package/dist/types.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "agentic-vault",
3
+ "displayName": "Agentic Vault",
4
+ "description": "Server-side EVM signing with AWS KMS — sign DeFi transactions, permits, and more",
5
+ "version": "0.1.0",
6
+ "configSchema": {
7
+ "keyId": { "type": "string", "required": true, "description": "AWS KMS key ID or alias" },
8
+ "region": { "type": "string", "required": true, "description": "AWS region" },
9
+ "expectedAddress": { "type": "string", "required": false, "description": "Expected signer address for verification" },
10
+ "policyConfigPath": { "type": "string", "required": false, "description": "Path to policy configuration JSON file" },
11
+ "enableUnsafeRawSign": { "type": "boolean", "required": false, "default": false, "description": "Enable raw transaction and typed data signing tools (unsafe)" }
12
+ }
13
+ }
package/package.json ADDED
@@ -0,0 +1,64 @@
1
+ {
2
+ "name": "@agenticvault/openclaw",
3
+ "version": "0.1.0",
4
+ "description": "OpenClaw plugin for Agentic Vault — expose EVM signing as OpenClaw agent tools",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js"
12
+ },
13
+ "./openclaw.plugin.json": "./openclaw.plugin.json"
14
+ },
15
+ "files": [
16
+ "dist",
17
+ "openclaw.plugin.json"
18
+ ],
19
+ "engines": {
20
+ "node": ">=24"
21
+ },
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "https://github.com/agenticvault/agentic-vault",
25
+ "directory": "packages/openclaw-plugin"
26
+ },
27
+ "license": "MIT",
28
+ "bugs": {
29
+ "url": "https://github.com/agenticvault/agentic-vault/issues"
30
+ },
31
+ "homepage": "https://github.com/agenticvault/agentic-vault/tree/main/packages/openclaw-plugin#readme",
32
+ "publishConfig": {
33
+ "access": "public",
34
+ "registry": "https://registry.npmjs.org"
35
+ },
36
+ "keywords": [
37
+ "openclaw",
38
+ "plugin",
39
+ "agentic-vault",
40
+ "evm",
41
+ "signing",
42
+ "aws-kms",
43
+ "ai-agent"
44
+ ],
45
+ "peerDependencies": {
46
+ "@agenticvault/agentic-vault": "~0.1.0"
47
+ },
48
+ "devDependencies": {
49
+ "@eslint/js": "^9.39.2",
50
+ "eslint": "^9.39.2",
51
+ "typescript": "^5.9.3",
52
+ "typescript-eslint": "^8.55.0",
53
+ "vitest": "^4.0.18",
54
+ "@agenticvault/agentic-vault": "0.1.0"
55
+ },
56
+ "scripts": {
57
+ "build": "tsc -b",
58
+ "typecheck": "tsc -p tsconfig.check.json",
59
+ "lint": "eslint src/ test/",
60
+ "lint:fix": "eslint src/ test/ --fix",
61
+ "test:unit": "vitest run test/unit/",
62
+ "test:integration": "vitest run test/integration/"
63
+ }
64
+ }