Skip to content

Commit a46ea28

Browse files
committed
feat(w3rt-core): add unified core index exports and wire public api to core boundary
1 parent 9dca129 commit a46ea28

File tree

4 files changed

+31
-2
lines changed

4 files changed

+31
-2
lines changed

docs/architecture/multi-mono-migration.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ This repo is entering a transition from single-repo accumulation to a federated
2727
- `tool-types.ts`
2828
- `workflow-run-mode.ts`
2929
- `evm-transfer-policy-types.ts`
30+
- `index.ts` (single import surface)
3031
2. **Chain split**
3132
- one repo per chain family (`chain-*-tools`)
3233
3. **Strategy split**

src/index.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export type {
1818
ChainToolGroupName,
1919
ChainToolset,
2020
RegisteredTool,
21-
} from "./core/types.js";
21+
} from "./w3rt-core/index.js";
2222
export type {
2323
PiMcpAdapter,
2424
PiMcpRoute,
@@ -47,6 +47,13 @@ export type {
4747
PiMcpSolanaApi,
4848
} from "./core/pi-mcp-solana.js";
4949

50+
export {
51+
parseRunMode,
52+
parseRunModeHint,
53+
parseRunModeWithCompose,
54+
resolveWorkflowRunMode,
55+
} from "./w3rt-core/index.js";
56+
5057
export {
5158
DANGEROUS_RPC_METHODS,
5259
TOOL_PREFIX,
@@ -189,7 +196,7 @@ export type {
189196
EvmTransferPolicyEnforceOn,
190197
EvmTransferPolicyMode,
191198
EvmTransferPolicyUpdate,
192-
} from "./chains/evm/policy.js";
199+
} from "./w3rt-core/index.js";
193200
export {
194201
getPolymarketBtc5mAdvice,
195202
getPolymarketBtc5mMarkets,

src/w3rt-core/index.test.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { describe, expect, it } from "vitest";
2+
3+
import {
4+
EVM_TRANSFER_POLICY_SCHEMA,
5+
parseRunMode,
6+
resolveWorkflowRunMode,
7+
} from "./index.js";
8+
9+
describe("w3rt-core index", () => {
10+
it("re-exports workflow helpers", () => {
11+
expect(parseRunMode("simulate")).toBe("simulate");
12+
expect(resolveWorkflowRunMode(undefined, "现在执行")).toBe("execute");
13+
});
14+
15+
it("re-exports policy schema constants", () => {
16+
expect(EVM_TRANSFER_POLICY_SCHEMA).toBe("evm.transfer.policy.v1");
17+
});
18+
});

src/w3rt-core/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export * from "./tool-types.js";
2+
export * from "./workflow-run-mode.js";
3+
export * from "./evm-transfer-policy-types.js";

0 commit comments

Comments
 (0)