@nextclaw/x-harness 0.0.0-stage → 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 +10 -0
- package/README.md +41 -2
- package/cli/main.js +207 -0
- package/dist/api.d.ts +10 -0
- package/dist/api.js +256 -0
- package/dist/boundary.d.ts +2 -0
- package/dist/browser-common.d.ts +4 -0
- package/dist/browser-common.js +29 -0
- package/dist/browser-dom.d.ts +2 -0
- package/dist/browser-dom.js +854 -0
- package/dist/browser-native.d.ts +1 -0
- package/dist/browser-native.js +211 -0
- package/dist/browser.d.ts +4 -0
- package/dist/browser.js +143 -0
- package/dist/creator.d.ts +29 -0
- package/dist/creator.js +164 -0
- package/dist/growth.d.ts +1 -0
- package/dist/growth.js +1918 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +22 -0
- package/dist/observation.d.ts +1 -0
- package/dist/observation.js +2 -0
- package/dist/platform.d.ts +2 -0
- package/dist/platform.js +681 -0
- package/dist/readers.d.ts +20 -0
- package/dist/readers.js +1045 -0
- package/dist/results.d.ts +6 -0
- package/dist/results.js +233 -0
- package/dist/round-state.d.ts +3 -0
- package/dist/round-state.js +155 -0
- package/dist/store.d.ts +30 -0
- package/dist/store.js +175 -0
- package/dist/types.d.ts +397 -0
- package/generated/observation.d.mts +1 -0
- package/generated/observation.mjs +514 -0
- package/package.json +29 -3
- package/skill/SKILL.md +52 -0
- package/skill/references/api.md +37 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { HarnessOptions, XGrowthHarness } from "./types.js";
|
|
2
|
+
export type * from "./types.js";
|
|
3
|
+
/** Bind a selected real CUA handle once. Construction performs no browser I/O. */
|
|
4
|
+
export declare function createXGrowthHarness(options: HarnessOptions): XGrowthHarness;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { createBusinessHarness } from "./api.js";
|
|
2
|
+
import { createFileRoundStore } from "./store.js";
|
|
3
|
+
import { createXPlatform } from "./platform.js";
|
|
4
|
+
import { createDOMXBrowser, createNativeXBrowser } from "./browser.js";
|
|
5
|
+
/** Bind a selected real CUA handle once. Construction performs no browser I/O. */
|
|
6
|
+
export function createXGrowthHarness(options) {
|
|
7
|
+
const { tab, app, ledgerPath, proofDirectory, clock, executor } = options;
|
|
8
|
+
if (Boolean(tab) === Boolean(app))
|
|
9
|
+
throw new Error("需一个已绑定Chrome app或tab,不能两个或零个");
|
|
10
|
+
if (!ledgerPath || !proofDirectory)
|
|
11
|
+
throw new Error("需原台账路径与本地证明目录");
|
|
12
|
+
if (executor && (!tab || !tab.id))
|
|
13
|
+
throw new Error("executor-requires-independent-tab");
|
|
14
|
+
const browser = tab ? createDOMXBrowser(tab) : createNativeXBrowser(app);
|
|
15
|
+
const store = createFileRoundStore({ ledgerPath, proofDirectory });
|
|
16
|
+
return createBusinessHarness({
|
|
17
|
+
platform: createXPlatform(browser, { clock }),
|
|
18
|
+
store,
|
|
19
|
+
clock,
|
|
20
|
+
executor: executor ? { ...executor, tabId: tab.id } : undefined,
|
|
21
|
+
});
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { readXObservation } from "../generated/observation.mjs";
|