capacitor-wasm-agent-tools 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/CapacitorWasmAgentTools.podspec +25 -0
- package/Package.swift +35 -0
- package/android/build.gradle +26 -0
- package/android/src/main/java/com/t6x/plugins/wasmagenttools/WasmAgentToolsPlugin.kt +229 -0
- package/android/src/main/java/uniffi/wasm_agent_tools_ffi/wasm_agent_tools_ffi.kt +2268 -0
- package/android/src/main/jniLibs/arm64-v8a/libwasm_agent_tools_ffi.so +0 -0
- package/dist/esm/definitions.d.ts +56 -0
- package/dist/esm/definitions.d.ts.map +1 -0
- package/dist/esm/definitions.js +2 -0
- package/dist/esm/definitions.js.map +1 -0
- package/dist/esm/index.d.ts +3 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/web.d.ts +13 -0
- package/dist/esm/web.d.ts.map +1 -0
- package/dist/esm/web.js +28 -0
- package/dist/esm/web.js.map +1 -0
- package/ios/Frameworks/WasmAgentToolsFFI.xcframework/Info.plist +47 -0
- package/ios/Frameworks/WasmAgentToolsFFI.xcframework/ios-arm64/Headers/module.modulemap +4 -0
- package/ios/Frameworks/WasmAgentToolsFFI.xcframework/ios-arm64/Headers/wasm_agent_tools_ffiFFI.h +650 -0
- package/ios/Frameworks/WasmAgentToolsFFI.xcframework/ios-arm64/Headers/wasm_agent_tools_ffiFFI.modulemap +4 -0
- package/ios/Frameworks/WasmAgentToolsFFI.xcframework/ios-arm64/libwasm_agent_tools_ffi.a +0 -0
- package/ios/Frameworks/WasmAgentToolsFFI.xcframework/ios-arm64-simulator/Headers/module.modulemap +4 -0
- package/ios/Frameworks/WasmAgentToolsFFI.xcframework/ios-arm64-simulator/Headers/wasm_agent_tools_ffiFFI.h +650 -0
- package/ios/Frameworks/WasmAgentToolsFFI.xcframework/ios-arm64-simulator/Headers/wasm_agent_tools_ffiFFI.modulemap +4 -0
- package/ios/Frameworks/WasmAgentToolsFFI.xcframework/ios-arm64-simulator/libwasm_agent_tools_ffi.a +0 -0
- package/ios/Sources/WasmAgentToolsPlugin/Generated/wasm_agent_tools_ffi.swift +1484 -0
- package/ios/Sources/WasmAgentToolsPlugin/Generated/wasm_agent_tools_ffiFFI.h +650 -0
- package/ios/Sources/WasmAgentToolsPlugin/Generated/wasm_agent_tools_ffiFFI.modulemap +4 -0
- package/ios/Sources/WasmAgentToolsPlugin/WasmAgentToolsPlugin.swift +234 -0
- package/package.json +52 -0
|
Binary file
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export interface SandboxConfig {
|
|
2
|
+
fuelLimit?: number;
|
|
3
|
+
maxMemoryBytes?: number;
|
|
4
|
+
timeoutSecs?: number;
|
|
5
|
+
}
|
|
6
|
+
export interface SandboxResult {
|
|
7
|
+
output: string;
|
|
8
|
+
fuelConsumed: number;
|
|
9
|
+
durationMs: number;
|
|
10
|
+
}
|
|
11
|
+
export interface JsConfig {
|
|
12
|
+
fuelLimit?: number;
|
|
13
|
+
maxMemoryBytes?: number;
|
|
14
|
+
timeoutSecs?: number;
|
|
15
|
+
}
|
|
16
|
+
export interface JsResult {
|
|
17
|
+
output: string;
|
|
18
|
+
error?: string;
|
|
19
|
+
fuelConsumed: number;
|
|
20
|
+
durationMs: number;
|
|
21
|
+
}
|
|
22
|
+
export interface PythonConfig {
|
|
23
|
+
fuelLimit?: number;
|
|
24
|
+
maxMemoryBytes?: number;
|
|
25
|
+
timeoutSecs?: number;
|
|
26
|
+
}
|
|
27
|
+
export interface PythonResult {
|
|
28
|
+
output: string;
|
|
29
|
+
error?: string;
|
|
30
|
+
fuelConsumed: number;
|
|
31
|
+
durationMs: number;
|
|
32
|
+
}
|
|
33
|
+
export interface WasmAgentToolsPlugin {
|
|
34
|
+
createWasmSandbox(): Promise<void>;
|
|
35
|
+
executeSandbox(options: {
|
|
36
|
+
wasmBase64: string;
|
|
37
|
+
inputJson: string;
|
|
38
|
+
config?: SandboxConfig;
|
|
39
|
+
}): Promise<SandboxResult>;
|
|
40
|
+
executeWatSandbox(options: {
|
|
41
|
+
watText: string;
|
|
42
|
+
inputJson: string;
|
|
43
|
+
config?: SandboxConfig;
|
|
44
|
+
}): Promise<SandboxResult>;
|
|
45
|
+
createJsRuntime(): Promise<void>;
|
|
46
|
+
executeJs(options: {
|
|
47
|
+
code: string;
|
|
48
|
+
config?: JsConfig;
|
|
49
|
+
}): Promise<JsResult>;
|
|
50
|
+
createPythonRuntime(): Promise<void>;
|
|
51
|
+
executePython(options: {
|
|
52
|
+
code: string;
|
|
53
|
+
config?: PythonConfig;
|
|
54
|
+
}): Promise<PythonResult>;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=definitions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAA;IACd,YAAY,EAAE,MAAM,CAAA;IACpB,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,QAAQ;IACvB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,YAAY,EAAE,MAAM,CAAA;IACpB,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,YAAY;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,YAAY,EAAE,MAAM,CAAA;IACpB,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,oBAAoB;IACnC,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IAClC,cAAc,CAAC,OAAO,EAAE;QACtB,UAAU,EAAE,MAAM,CAAA;QAClB,SAAS,EAAE,MAAM,CAAA;QACjB,MAAM,CAAC,EAAE,aAAa,CAAA;KACvB,GAAG,OAAO,CAAC,aAAa,CAAC,CAAA;IAC1B,iBAAiB,CAAC,OAAO,EAAE;QACzB,OAAO,EAAE,MAAM,CAAA;QACf,SAAS,EAAE,MAAM,CAAA;QACjB,MAAM,CAAC,EAAE,aAAa,CAAA;KACvB,GAAG,OAAO,CAAC,aAAa,CAAC,CAAA;IAE1B,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IAChC,SAAS,CAAC,OAAO,EAAE;QACjB,IAAI,EAAE,MAAM,CAAA;QACZ,MAAM,CAAC,EAAE,QAAQ,CAAA;KAClB,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAA;IAErB,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IACpC,aAAa,CAAC,OAAO,EAAE;QACrB,IAAI,EAAE,MAAM,CAAA;QACZ,MAAM,CAAC,EAAE,YAAY,CAAA;KACtB,GAAG,OAAO,CAAC,YAAY,CAAC,CAAA;CAC1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AACtC,YAAY,EACV,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,aAAa,EACb,oBAAoB,GACrB,MAAM,eAAe,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { WebPlugin } from '@capacitor/core';
|
|
2
|
+
import type { JsResult, PythonResult, SandboxResult, WasmAgentToolsPlugin } from './definitions';
|
|
3
|
+
export declare class WasmAgentToolsWeb extends WebPlugin implements WasmAgentToolsPlugin {
|
|
4
|
+
createWasmSandbox(): Promise<void>;
|
|
5
|
+
executeSandbox(): Promise<SandboxResult>;
|
|
6
|
+
executeWatSandbox(): Promise<SandboxResult>;
|
|
7
|
+
createJsRuntime(): Promise<void>;
|
|
8
|
+
executeJs(): Promise<JsResult>;
|
|
9
|
+
createPythonRuntime(): Promise<void>;
|
|
10
|
+
executePython(): Promise<PythonResult>;
|
|
11
|
+
}
|
|
12
|
+
export declare const WasmAgentTools: WasmAgentToolsPlugin;
|
|
13
|
+
//# sourceMappingURL=web.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web.d.ts","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAE3D,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAA;AAEhG,qBAAa,iBAAkB,SAAQ,SAAU,YAAW,oBAAoB;IACxE,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC;IAIlC,cAAc,IAAI,OAAO,CAAC,aAAa,CAAC;IAIxC,iBAAiB,IAAI,OAAO,CAAC,aAAa,CAAC;IAI3C,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;IAIhC,SAAS,IAAI,OAAO,CAAC,QAAQ,CAAC;IAI9B,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;IAIpC,aAAa,IAAI,OAAO,CAAC,YAAY,CAAC;CAG7C;AAED,eAAO,MAAM,cAAc,sBAEzB,CAAA"}
|
package/dist/esm/web.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { registerPlugin, WebPlugin } from '@capacitor/core';
|
|
2
|
+
export class WasmAgentToolsWeb extends WebPlugin {
|
|
3
|
+
async createWasmSandbox() {
|
|
4
|
+
throw this.unavailable('WasmAgentTools is only available on native platforms.');
|
|
5
|
+
}
|
|
6
|
+
async executeSandbox() {
|
|
7
|
+
throw this.unavailable('WasmAgentTools is only available on native platforms.');
|
|
8
|
+
}
|
|
9
|
+
async executeWatSandbox() {
|
|
10
|
+
throw this.unavailable('WasmAgentTools is only available on native platforms.');
|
|
11
|
+
}
|
|
12
|
+
async createJsRuntime() {
|
|
13
|
+
throw this.unavailable('WasmAgentTools is only available on native platforms.');
|
|
14
|
+
}
|
|
15
|
+
async executeJs() {
|
|
16
|
+
throw this.unavailable('WasmAgentTools is only available on native platforms.');
|
|
17
|
+
}
|
|
18
|
+
async createPythonRuntime() {
|
|
19
|
+
throw this.unavailable('WasmAgentTools is only available on native platforms.');
|
|
20
|
+
}
|
|
21
|
+
async executePython() {
|
|
22
|
+
throw this.unavailable('WasmAgentTools is only available on native platforms.');
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export const WasmAgentTools = registerPlugin('WasmAgentTools', {
|
|
26
|
+
web: () => Promise.resolve(new WasmAgentToolsWeb()),
|
|
27
|
+
});
|
|
28
|
+
//# sourceMappingURL=web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAI3D,MAAM,OAAO,iBAAkB,SAAQ,SAAS;IAC9C,KAAK,CAAC,iBAAiB;QACrB,MAAM,IAAI,CAAC,WAAW,CAAC,uDAAuD,CAAC,CAAA;IACjF,CAAC;IAED,KAAK,CAAC,cAAc;QAClB,MAAM,IAAI,CAAC,WAAW,CAAC,uDAAuD,CAAC,CAAA;IACjF,CAAC;IAED,KAAK,CAAC,iBAAiB;QACrB,MAAM,IAAI,CAAC,WAAW,CAAC,uDAAuD,CAAC,CAAA;IACjF,CAAC;IAED,KAAK,CAAC,eAAe;QACnB,MAAM,IAAI,CAAC,WAAW,CAAC,uDAAuD,CAAC,CAAA;IACjF,CAAC;IAED,KAAK,CAAC,SAAS;QACb,MAAM,IAAI,CAAC,WAAW,CAAC,uDAAuD,CAAC,CAAA;IACjF,CAAC;IAED,KAAK,CAAC,mBAAmB;QACvB,MAAM,IAAI,CAAC,WAAW,CAAC,uDAAuD,CAAC,CAAA;IACjF,CAAC;IAED,KAAK,CAAC,aAAa;QACjB,MAAM,IAAI,CAAC,WAAW,CAAC,uDAAuD,CAAC,CAAA;IACjF,CAAC;CACF;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,cAAc,CAAuB,gBAAgB,EAAE;IACnF,GAAG,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,iBAAiB,EAAE,CAAC;CACpD,CAAC,CAAA"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>AvailableLibraries</key>
|
|
6
|
+
<array>
|
|
7
|
+
<dict>
|
|
8
|
+
<key>BinaryPath</key>
|
|
9
|
+
<string>libwasm_agent_tools_ffi.a</string>
|
|
10
|
+
<key>HeadersPath</key>
|
|
11
|
+
<string>Headers</string>
|
|
12
|
+
<key>LibraryIdentifier</key>
|
|
13
|
+
<string>ios-arm64</string>
|
|
14
|
+
<key>LibraryPath</key>
|
|
15
|
+
<string>libwasm_agent_tools_ffi.a</string>
|
|
16
|
+
<key>SupportedArchitectures</key>
|
|
17
|
+
<array>
|
|
18
|
+
<string>arm64</string>
|
|
19
|
+
</array>
|
|
20
|
+
<key>SupportedPlatform</key>
|
|
21
|
+
<string>ios</string>
|
|
22
|
+
</dict>
|
|
23
|
+
<dict>
|
|
24
|
+
<key>BinaryPath</key>
|
|
25
|
+
<string>libwasm_agent_tools_ffi.a</string>
|
|
26
|
+
<key>HeadersPath</key>
|
|
27
|
+
<string>Headers</string>
|
|
28
|
+
<key>LibraryIdentifier</key>
|
|
29
|
+
<string>ios-arm64-simulator</string>
|
|
30
|
+
<key>LibraryPath</key>
|
|
31
|
+
<string>libwasm_agent_tools_ffi.a</string>
|
|
32
|
+
<key>SupportedArchitectures</key>
|
|
33
|
+
<array>
|
|
34
|
+
<string>arm64</string>
|
|
35
|
+
</array>
|
|
36
|
+
<key>SupportedPlatform</key>
|
|
37
|
+
<string>ios</string>
|
|
38
|
+
<key>SupportedPlatformVariant</key>
|
|
39
|
+
<string>simulator</string>
|
|
40
|
+
</dict>
|
|
41
|
+
</array>
|
|
42
|
+
<key>CFBundlePackageType</key>
|
|
43
|
+
<string>XFWK</string>
|
|
44
|
+
<key>XCFrameworkFormatVersion</key>
|
|
45
|
+
<string>1.0</string>
|
|
46
|
+
</dict>
|
|
47
|
+
</plist>
|