@nextclaw/app-runtime 0.14.1 → 0.16.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/dist/index.d.ts +5 -4
- package/dist/index.js +2 -1
- package/dist/package.js +1 -1
- package/dist/services/app-build.service.d.ts +1 -0
- package/dist/services/app-build.service.d.ts.map +1 -1
- package/dist/services/app-build.service.js +37 -2
- package/dist/services/app-build.service.js.map +1 -1
- package/dist/services/app-grant.service.d.ts.map +1 -1
- package/dist/services/app-grant.service.js +1 -4
- package/dist/services/app-grant.service.js.map +1 -1
- package/dist/services/app-installation-lifecycle.service.js +29 -2
- package/dist/services/app-installation-lifecycle.service.js.map +1 -1
- package/dist/services/app-manifest.service.d.ts +1 -0
- package/dist/services/app-manifest.service.d.ts.map +1 -1
- package/dist/services/app-manifest.service.js +27 -0
- package/dist/services/app-manifest.service.js.map +1 -1
- package/dist/services/app-permissions.service.d.ts.map +1 -1
- package/dist/services/app-permissions.service.js +0 -3
- package/dist/services/app-permissions.service.js.map +1 -1
- package/dist/services/app-registry-parser.service.js +200 -0
- package/dist/services/app-registry-parser.service.js.map +1 -0
- package/dist/services/app-registry.service.d.ts +4 -9
- package/dist/services/app-registry.service.d.ts.map +1 -1
- package/dist/services/app-registry.service.js +40 -164
- package/dist/services/app-registry.service.js.map +1 -1
- package/dist/services/app-runtime-cli.service.js +1 -1
- package/dist/services/app-runtime-cli.service.js.map +1 -1
- package/dist/services/app-runtime-options.service.d.ts.map +1 -1
- package/dist/services/app-runtime-options.service.js +2 -2
- package/dist/services/app-runtime-options.service.js.map +1 -1
- package/dist/services/app-runtime-toolchain.service.d.ts +5 -2
- package/dist/services/app-runtime-toolchain.service.d.ts.map +1 -1
- package/dist/services/app-runtime-toolchain.service.js +36 -4
- package/dist/services/app-runtime-toolchain.service.js.map +1 -1
- package/dist/services/app-rust-wasi-scaffold-template.service.d.ts +24 -0
- package/dist/services/app-rust-wasi-scaffold-template.service.d.ts.map +1 -0
- package/dist/services/app-rust-wasi-scaffold-template.service.js +394 -0
- package/dist/services/app-rust-wasi-scaffold-template.service.js.map +1 -0
- package/dist/services/app-scaffold.service.d.ts +4 -2
- package/dist/services/app-scaffold.service.d.ts.map +1 -1
- package/dist/services/app-scaffold.service.js +20 -4
- package/dist/services/app-scaffold.service.js.map +1 -1
- package/dist/services/platform-auth-state.service.js +1 -1
- package/dist/types/app-manifest.types.d.ts +8 -1
- package/dist/types/app-manifest.types.d.ts.map +1 -1
- package/dist/types/app-manifest.types.js.map +1 -1
- package/dist/types/app-registry.types.d.ts +8 -1
- package/dist/types/app-registry.types.d.ts.map +1 -1
- package/package.json +2 -1
- package/resources/rust-wasi/Cargo.lock +454 -0
- package/resources/wit/deps/clocks@0.2.6/monotonic-clock.wit +50 -0
- package/resources/wit/deps/clocks@0.2.6/timezone.wit +55 -0
- package/resources/wit/deps/clocks@0.2.6/wall-clock.wit +46 -0
- package/resources/wit/deps/clocks@0.2.6/world.wit +11 -0
- package/resources/wit/deps/config@0.2.0-draft-2024-09-27/package.wit +1 -0
- package/resources/wit/deps/config@0.2.0-draft-2024-09-27/store.wit +9 -0
- package/resources/wit/deps/http@0.2.6/handler.wit +49 -0
- package/resources/wit/deps/http@0.2.6/package.wit +1 -0
- package/resources/wit/deps/http@0.2.6/types.wit +688 -0
- package/resources/wit/deps/io@0.2.6/error.wit +34 -0
- package/resources/wit/deps/io@0.2.6/poll.wit +47 -0
- package/resources/wit/deps/io@0.2.6/streams.wit +290 -0
- package/resources/wit/deps/io@0.2.6/world.wit +10 -0
- package/resources/wit/deps/spin@2.0.0/package.wit +1 -0
- package/resources/wit/deps/spin@2.0.0/sqlite.wit +50 -0
- package/resources/wit/portable-service.wit +120 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-manifest.types.js","names":[],"sources":["../../src/types/app-manifest.types.ts"],"sourcesContent":["export type AppDocumentAccessMode = \"read\" | \"read-write\";\n\nexport type AppDocumentAccessScope = {\n id: string;\n mode: AppDocumentAccessMode;\n description?: string;\n};\n\nexport type AppPermissions = {\n documentAccess?: AppDocumentAccessScope[];\n allowedDomains?: string[];\n storage?: boolean | { namespace?: string };\n capabilities?: {\n hostBridge?: boolean;\n nativeProcess?: boolean;\n };\n};\n\nexport type AppRuntimeProfile = \"panel-only\" | \"wasi\" | \"native-process\";\nexport type AppRuntimeIsolation = \"sandboxed\" | \"host-mediated\" | \"full-user\";\n\nexport type AppRuntimeDeclaration = {\n profile: AppRuntimeProfile;\n};\n\nexport type AppArtifactArchitecture = \"x64\" | \"arm64\";\n\nexport type AppDarwinArtifactTarget = {\n kind: \"native\";\n os: \"darwin\";\n arch: AppArtifactArchitecture;\n};\n\nexport type AppLinuxArtifactTarget = {\n kind: \"native\";\n os: \"linux\";\n arch: AppArtifactArchitecture;\n abi: \"gnu\" | \"musl\";\n};\n\nexport type AppWindowsArtifactTarget = {\n kind: \"native\";\n os: \"win32\";\n arch: AppArtifactArchitecture;\n abi: \"msvc\";\n};\n\nexport type AppNativeArtifactTarget =\n | AppDarwinArtifactTarget\n | AppLinuxArtifactTarget\n | AppWindowsArtifactTarget;\n\nexport type AppUniversalArtifactTarget = {\n kind: \"universal\";\n};\n\nexport type AppArtifactTarget =\n | AppUniversalArtifactTarget\n | AppNativeArtifactTarget;\n\nexport type AppDistributionDeclaration =\n | { mode: \"universal\" }\n | {\n mode: \"targeted\";\n targets: AppNativeArtifactTarget[];\n };\n\nexport type AppStorageDeclaration = {\n scope: \"global\";\n schemaVersion: number;\n};\n\nexport type AppPlatformSecuritySummary = {\n runtimeProfile: AppRuntimeProfile;\n isolation: AppRuntimeIsolation;\n hasServiceComponents: boolean;\n inferred: boolean;\n permissions: AppPermissions;\n};\n\nexport type AppCoreWasmMainManifest = {\n kind: \"wasm\";\n entry: string;\n export: string;\n action: string;\n};\n\nexport type AppWasiHttpComponentMainManifest = {\n kind: \"wasi-http-component\";\n entry: string;\n};\n\nexport type AppMainManifest = AppCoreWasmMainManifest | AppWasiHttpComponentMainManifest;\n\nexport type AppUiManifest = {\n entry: string;\n};\n\nexport type AppStandaloneManifest = {\n schemaVersion: 1;\n id: string;\n name: string;\n version: string;\n description?: string;\n icon?: string;\n main: AppMainManifest;\n ui: AppUiManifest;\n permissions?: AppPermissions;\n};\n\nexport type AppComponentKind = \"panel\" | \"service\";\n\nexport type AppComponentReference = {\n kind: AppComponentKind;\n path: string;\n};\n\nexport type AppComponentManifest = {\n schemaVersion: 2;\n id: string;\n name: string;\n version: string;\n description?: string;\n icon?: string;\n engines?: {\n nextclaw?: string;\n };\n presentation?: {\n primaryPanel?: string;\n };\n runtime?: AppRuntimeDeclaration;\n distribution?: AppDistributionDeclaration;\n storage?: AppStorageDeclaration;\n permissions?: AppPermissions;\n components: AppComponentReference[];\n};\n\nexport type AppManifest = AppStandaloneManifest | AppComponentManifest;\n\nexport type AppResolvedComponent = AppComponentReference & {\n id: string;\n componentDirectory: string;\n manifestPath: string;\n};\n\nexport type AppStandaloneManifestBundle = {\n appDirectory: string;\n manifestPath: string;\n manifest: AppStandaloneManifest;\n mainEntryPath: string;\n uiEntryPath: string;\n uiDirectoryPath: string;\n assetsDirectoryPath: string;\n iconPath?: string;\n};\n\nexport type AppComponentManifestBundle = {\n appDirectory: string;\n manifestPath: string;\n manifest: AppComponentManifest;\n components: AppResolvedComponent[];\n assetsDirectoryPath: string;\n iconPath?: string;\n primaryPanelId?: string;\n};\n\nexport type AppManifestBundle = AppStandaloneManifestBundle | AppComponentManifestBundle;\n\nexport type AppStandaloneManifestSummary = {\n schemaVersion: 1;\n id: string;\n name: string;\n version: string;\n description?: string;\n mainKind: AppMainManifest[\"kind\"];\n action?: string;\n manifestPath: string;\n mainEntryPath: string;\n uiEntryPath: string;\n iconPath?: string;\n permissions: AppPermissions;\n};\n\nexport type AppComponentManifestSummary = {\n schemaVersion: 2;\n id: string;\n name: string;\n version: string;\n description?: string;\n manifestPath: string;\n iconPath?: string;\n primaryPanelId?: string;\n components: AppResolvedComponent[];\n distribution: AppDistributionDeclaration;\n security: AppPlatformSecuritySummary;\n};\n\nexport type AppManifestSummary = AppStandaloneManifestSummary | AppComponentManifestSummary;\n\nexport function isAppStandaloneManifestBundle(\n bundle: AppManifestBundle,\n): bundle is AppStandaloneManifestBundle {\n return bundle.manifest.schemaVersion === 1;\n}\n\nexport function isAppComponentManifestBundle(\n bundle: AppManifestBundle,\n): bundle is AppComponentManifestBundle {\n return bundle.manifest.schemaVersion === 2;\n}\n"],"mappings":";
|
|
1
|
+
{"version":3,"file":"app-manifest.types.js","names":[],"sources":["../../src/types/app-manifest.types.ts"],"sourcesContent":["export type AppDocumentAccessMode = \"read\" | \"read-write\";\n\nexport type AppDocumentAccessScope = {\n id: string;\n mode: AppDocumentAccessMode;\n description?: string;\n};\n\nexport type AppSecretSlot = {\n id: string;\n title: string;\n description: string;\n required: boolean;\n};\n\nexport type AppPermissions = {\n documentAccess?: AppDocumentAccessScope[];\n secrets?: AppSecretSlot[];\n allowedDomains?: string[];\n storage?: boolean | { namespace?: string };\n capabilities?: {\n hostBridge?: boolean;\n nativeProcess?: boolean;\n };\n};\n\nexport type AppRuntimeProfile = \"panel-only\" | \"wasi\" | \"native-process\";\nexport type AppRuntimeIsolation = \"sandboxed\" | \"host-mediated\" | \"full-user\";\n\nexport type AppRuntimeDeclaration = {\n profile: AppRuntimeProfile;\n};\n\nexport type AppArtifactArchitecture = \"x64\" | \"arm64\";\n\nexport type AppDarwinArtifactTarget = {\n kind: \"native\";\n os: \"darwin\";\n arch: AppArtifactArchitecture;\n};\n\nexport type AppLinuxArtifactTarget = {\n kind: \"native\";\n os: \"linux\";\n arch: AppArtifactArchitecture;\n abi: \"gnu\" | \"musl\";\n};\n\nexport type AppWindowsArtifactTarget = {\n kind: \"native\";\n os: \"win32\";\n arch: AppArtifactArchitecture;\n abi: \"msvc\";\n};\n\nexport type AppNativeArtifactTarget =\n | AppDarwinArtifactTarget\n | AppLinuxArtifactTarget\n | AppWindowsArtifactTarget;\n\nexport type AppUniversalArtifactTarget = {\n kind: \"universal\";\n};\n\nexport type AppArtifactTarget =\n | AppUniversalArtifactTarget\n | AppNativeArtifactTarget;\n\nexport type AppDistributionDeclaration =\n | { mode: \"universal\" }\n | {\n mode: \"targeted\";\n targets: AppNativeArtifactTarget[];\n };\n\nexport type AppStorageDeclaration = {\n scope: \"global\";\n schemaVersion: number;\n};\n\nexport type AppPlatformSecuritySummary = {\n runtimeProfile: AppRuntimeProfile;\n isolation: AppRuntimeIsolation;\n hasServiceComponents: boolean;\n inferred: boolean;\n permissions: AppPermissions;\n};\n\nexport type AppCoreWasmMainManifest = {\n kind: \"wasm\";\n entry: string;\n export: string;\n action: string;\n};\n\nexport type AppWasiHttpComponentMainManifest = {\n kind: \"wasi-http-component\";\n entry: string;\n};\n\nexport type AppMainManifest = AppCoreWasmMainManifest | AppWasiHttpComponentMainManifest;\n\nexport type AppUiManifest = {\n entry: string;\n};\n\nexport type AppStandaloneManifest = {\n schemaVersion: 1;\n id: string;\n name: string;\n version: string;\n description?: string;\n icon?: string;\n main: AppMainManifest;\n ui: AppUiManifest;\n permissions?: AppPermissions;\n};\n\nexport type AppComponentKind = \"panel\" | \"service\";\n\nexport type AppComponentReference = {\n kind: AppComponentKind;\n path: string;\n};\n\nexport type AppComponentManifest = {\n schemaVersion: 2;\n id: string;\n name: string;\n version: string;\n description?: string;\n icon?: string;\n engines?: {\n nextclaw?: string;\n };\n presentation?: {\n primaryPanel?: string;\n };\n runtime?: AppRuntimeDeclaration;\n distribution?: AppDistributionDeclaration;\n storage?: AppStorageDeclaration;\n permissions?: AppPermissions;\n components: AppComponentReference[];\n};\n\nexport type AppManifest = AppStandaloneManifest | AppComponentManifest;\n\nexport type AppResolvedComponent = AppComponentReference & {\n id: string;\n componentDirectory: string;\n manifestPath: string;\n};\n\nexport type AppStandaloneManifestBundle = {\n appDirectory: string;\n manifestPath: string;\n manifest: AppStandaloneManifest;\n mainEntryPath: string;\n uiEntryPath: string;\n uiDirectoryPath: string;\n assetsDirectoryPath: string;\n iconPath?: string;\n};\n\nexport type AppComponentManifestBundle = {\n appDirectory: string;\n manifestPath: string;\n manifest: AppComponentManifest;\n components: AppResolvedComponent[];\n assetsDirectoryPath: string;\n iconPath?: string;\n primaryPanelId?: string;\n};\n\nexport type AppManifestBundle = AppStandaloneManifestBundle | AppComponentManifestBundle;\n\nexport type AppStandaloneManifestSummary = {\n schemaVersion: 1;\n id: string;\n name: string;\n version: string;\n description?: string;\n mainKind: AppMainManifest[\"kind\"];\n action?: string;\n manifestPath: string;\n mainEntryPath: string;\n uiEntryPath: string;\n iconPath?: string;\n permissions: AppPermissions;\n};\n\nexport type AppComponentManifestSummary = {\n schemaVersion: 2;\n id: string;\n name: string;\n version: string;\n description?: string;\n manifestPath: string;\n iconPath?: string;\n primaryPanelId?: string;\n components: AppResolvedComponent[];\n distribution: AppDistributionDeclaration;\n security: AppPlatformSecuritySummary;\n};\n\nexport type AppManifestSummary = AppStandaloneManifestSummary | AppComponentManifestSummary;\n\nexport function isAppStandaloneManifestBundle(\n bundle: AppManifestBundle,\n): bundle is AppStandaloneManifestBundle {\n return bundle.manifest.schemaVersion === 1;\n}\n\nexport function isAppComponentManifestBundle(\n bundle: AppManifestBundle,\n): bundle is AppComponentManifestBundle {\n return bundle.manifest.schemaVersion === 2;\n}\n"],"mappings":";AA+MA,SAAgB,8BACd,QACuC;AACvC,QAAO,OAAO,SAAS,kBAAkB;;AAG3C,SAAgB,6BACd,QACsC;AACtC,QAAO,OAAO,SAAS,kBAAkB"}
|
|
@@ -5,6 +5,12 @@ import { AppInstanceRecord } from "./app-storage.types.js";
|
|
|
5
5
|
import { AppPublisher } from "./app-remote-registry.types.js";
|
|
6
6
|
|
|
7
7
|
//#region src/types/app-registry.types.d.ts
|
|
8
|
+
type AppSecretBinding = {
|
|
9
|
+
source: "env" | "file" | "exec";
|
|
10
|
+
provider?: string;
|
|
11
|
+
id: string;
|
|
12
|
+
};
|
|
13
|
+
type AppSecretBindingMap = Record<string, AppSecretBinding>;
|
|
8
14
|
type AppInstallSourceKind = "bundle" | "directory" | "registry";
|
|
9
15
|
type AppRegistryInstalledVersion = {
|
|
10
16
|
version: string;
|
|
@@ -37,6 +43,7 @@ type AppRegistryAppRecord = {
|
|
|
37
43
|
defaultInstance: AppInstanceRecord;
|
|
38
44
|
installedVersions: Record<string, AppRegistryInstalledVersion>;
|
|
39
45
|
grants: AppDocumentGrantMap;
|
|
46
|
+
secretBindings: AppSecretBindingMap;
|
|
40
47
|
};
|
|
41
48
|
type AppRegistry = {
|
|
42
49
|
schemaVersion: 1;
|
|
@@ -46,5 +53,5 @@ type AppRegistry = {
|
|
|
46
53
|
}>;
|
|
47
54
|
};
|
|
48
55
|
//#endregion
|
|
49
|
-
export { AppInstallSourceKind, AppRegistry, AppRegistryAppRecord, AppRegistryInstalledVersion };
|
|
56
|
+
export { AppInstallSourceKind, AppRegistry, AppRegistryAppRecord, AppRegistryInstalledVersion, AppSecretBinding, AppSecretBindingMap };
|
|
50
57
|
//# sourceMappingURL=app-registry.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-registry.types.d.ts","names":[],"sources":["../../src/types/app-registry.types.ts"],"mappings":";;;;;;;KAWY,oBAAA;AAAA,KAEA,2BAAA;EACV,OAAA;EACA,gBAAA;EACA,UAAA,EAAY,oBAAA;EACZ,SAAA;EACA,WAAA;EACA,gBAAA,GAAmB,mBAAA;EACnB,WAAA,EAAa,cAAA;EACb,WAAA;EACA,SAAA;EACA,MAAA;EACA,MAAA,GAAS,iBAAA;EACT,SAAA,GAAY,YAAA;EACZ,qBAAA;EACA,UAAA,GAAa,oBAAA;EACb,cAAA;EACA,QAAA,GAAW,0BAAA;EACX,iBAAA;EACA,aAAA;AAAA;AAAA,KAGU,oBAAA;EACV,KAAA;EACA,IAAA;EACA,WAAA;EACA,SAAA,GAAY,YAAA;EACZ,aAAA;EACA,OAAA;EACA,aAAA;EACA,eAAA,EAAiB,iBAAA;EACjB,iBAAA,EAAmB,MAAA,SAAe,2BAAA;EAClC,MAAA,EAAQ,mBAAA;AAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"app-registry.types.d.ts","names":[],"sources":["../../src/types/app-registry.types.ts"],"mappings":";;;;;;;KAWY,gBAAA;EACV,MAAA;EACA,QAAA;EACA,EAAA;AAAA;AAAA,KAGU,mBAAA,GAAsB,MAAA,SAAe,gBAAA;AAAA,KAErC,oBAAA;AAAA,KAEA,2BAAA;EACV,OAAA;EACA,gBAAA;EACA,UAAA,EAAY,oBAAA;EACZ,SAAA;EACA,WAAA;EACA,gBAAA,GAAmB,mBAAA;EACnB,WAAA,EAAa,cAAA;EACb,WAAA;EACA,SAAA;EACA,MAAA;EACA,MAAA,GAAS,iBAAA;EACT,SAAA,GAAY,YAAA;EACZ,qBAAA;EACA,UAAA,GAAa,oBAAA;EACb,cAAA;EACA,QAAA,GAAW,0BAAA;EACX,iBAAA;EACA,aAAA;AAAA;AAAA,KAGU,oBAAA;EACV,KAAA;EACA,IAAA;EACA,WAAA;EACA,SAAA,GAAY,YAAA;EACZ,aAAA;EACA,OAAA;EACA,aAAA;EACA,eAAA,EAAiB,iBAAA;EACjB,iBAAA,EAAmB,MAAA,SAAe,2BAAA;EAClC,MAAA,EAAQ,mBAAA;EACR,cAAA,EAAgB,mBAAA;AAAA;AAAA,KAGN,WAAA;EACV,aAAA;EACA,IAAA,EAAM,MAAA,SAAe,oBAAA;EACrB,kBAAA,EAAoB,MAAA;IAClB,YAAA;EAAA;AAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nextclaw/app-runtime",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Standalone micro app runtime and CLI for NextClaw apps.",
|
|
6
6
|
"type": "module",
|
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
},
|
|
54
54
|
"files": [
|
|
55
55
|
"dist",
|
|
56
|
+
"resources",
|
|
56
57
|
"README.md"
|
|
57
58
|
],
|
|
58
59
|
"dependencies": {
|
|
@@ -0,0 +1,454 @@
|
|
|
1
|
+
# This file is automatically @generated by Cargo.
|
|
2
|
+
# It is not intended for manual editing.
|
|
3
|
+
version = 4
|
|
4
|
+
|
|
5
|
+
[[package]]
|
|
6
|
+
name = "anyhow"
|
|
7
|
+
version = "1.0.104"
|
|
8
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
9
|
+
checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470"
|
|
10
|
+
|
|
11
|
+
[[package]]
|
|
12
|
+
name = "bitflags"
|
|
13
|
+
version = "2.13.1"
|
|
14
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
15
|
+
checksum = "b588b76d00fde79687d7646a9b5bdf3cc0f655e0bbd080335a95d7e96f3587da"
|
|
16
|
+
|
|
17
|
+
[[package]]
|
|
18
|
+
name = "equivalent"
|
|
19
|
+
version = "1.0.2"
|
|
20
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
21
|
+
checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
|
|
22
|
+
|
|
23
|
+
[[package]]
|
|
24
|
+
name = "foldhash"
|
|
25
|
+
version = "0.1.5"
|
|
26
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
27
|
+
checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2"
|
|
28
|
+
|
|
29
|
+
[[package]]
|
|
30
|
+
name = "futures"
|
|
31
|
+
version = "0.3.34"
|
|
32
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
33
|
+
checksum = "9a31d2a3fbaaeb2af2368bbdd904aa8e812d3c04a1ee10d3171f52d556e5d0a3"
|
|
34
|
+
dependencies = [
|
|
35
|
+
"futures-channel",
|
|
36
|
+
"futures-core",
|
|
37
|
+
"futures-executor",
|
|
38
|
+
"futures-io",
|
|
39
|
+
"futures-sink",
|
|
40
|
+
"futures-task",
|
|
41
|
+
"futures-util",
|
|
42
|
+
]
|
|
43
|
+
|
|
44
|
+
[[package]]
|
|
45
|
+
name = "futures-channel"
|
|
46
|
+
version = "0.3.34"
|
|
47
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
48
|
+
checksum = "b1f9e3d69d39e4862ffed03ed071a76f9a13ba1d9109d355b0f0aa6b15e393c4"
|
|
49
|
+
dependencies = [
|
|
50
|
+
"futures-core",
|
|
51
|
+
"futures-sink",
|
|
52
|
+
]
|
|
53
|
+
|
|
54
|
+
[[package]]
|
|
55
|
+
name = "futures-core"
|
|
56
|
+
version = "0.3.34"
|
|
57
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
58
|
+
checksum = "92d699e522242e69e3003b94ecc1f960f3a5e015aa7c5d7486e65ad01dd94f5e"
|
|
59
|
+
|
|
60
|
+
[[package]]
|
|
61
|
+
name = "futures-executor"
|
|
62
|
+
version = "0.3.34"
|
|
63
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
64
|
+
checksum = "031b47cf1a3c6cc8bc2fc76cd437f521619387907d469316e7c0bc278f1f5432"
|
|
65
|
+
dependencies = [
|
|
66
|
+
"futures-core",
|
|
67
|
+
"futures-task",
|
|
68
|
+
"futures-util",
|
|
69
|
+
]
|
|
70
|
+
|
|
71
|
+
[[package]]
|
|
72
|
+
name = "futures-io"
|
|
73
|
+
version = "0.3.34"
|
|
74
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
75
|
+
checksum = "53c0fa8157de1303bfffdaa1cc2a673bfffb60102f76b0ef4441659124373fed"
|
|
76
|
+
|
|
77
|
+
[[package]]
|
|
78
|
+
name = "futures-macro"
|
|
79
|
+
version = "0.3.34"
|
|
80
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
81
|
+
checksum = "9fb9654ba8355388abeb8dcb4fc62f511300867002afc858860463bdd9fe0c44"
|
|
82
|
+
dependencies = [
|
|
83
|
+
"proc-macro2",
|
|
84
|
+
"quote",
|
|
85
|
+
"syn 3.0.4",
|
|
86
|
+
]
|
|
87
|
+
|
|
88
|
+
[[package]]
|
|
89
|
+
name = "futures-sink"
|
|
90
|
+
version = "0.3.34"
|
|
91
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
92
|
+
checksum = "1944426bf7d03f1d14f708785e4b33efd750b36d48a157b836b3efc15ede8e1d"
|
|
93
|
+
|
|
94
|
+
[[package]]
|
|
95
|
+
name = "futures-task"
|
|
96
|
+
version = "0.3.34"
|
|
97
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
98
|
+
checksum = "cd417de3d1d015fc3bfd2b1ea46dfc7bab72ef86f1cc7cc9c78e728b34a6d1fd"
|
|
99
|
+
|
|
100
|
+
[[package]]
|
|
101
|
+
name = "futures-util"
|
|
102
|
+
version = "0.3.34"
|
|
103
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
104
|
+
checksum = "0d50a92467f8ba5dd6e3ee5d4bd04d73ab2e4e1c44474a0674821dfce14b79bc"
|
|
105
|
+
dependencies = [
|
|
106
|
+
"futures-channel",
|
|
107
|
+
"futures-core",
|
|
108
|
+
"futures-io",
|
|
109
|
+
"futures-macro",
|
|
110
|
+
"futures-sink",
|
|
111
|
+
"futures-task",
|
|
112
|
+
"memchr",
|
|
113
|
+
"pin-project-lite",
|
|
114
|
+
"slab",
|
|
115
|
+
]
|
|
116
|
+
|
|
117
|
+
[[package]]
|
|
118
|
+
name = "hashbrown"
|
|
119
|
+
version = "0.15.5"
|
|
120
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
121
|
+
checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1"
|
|
122
|
+
dependencies = [
|
|
123
|
+
"foldhash",
|
|
124
|
+
]
|
|
125
|
+
|
|
126
|
+
[[package]]
|
|
127
|
+
name = "hashbrown"
|
|
128
|
+
version = "0.17.1"
|
|
129
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
130
|
+
checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a"
|
|
131
|
+
|
|
132
|
+
[[package]]
|
|
133
|
+
name = "heck"
|
|
134
|
+
version = "0.5.0"
|
|
135
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
136
|
+
checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
|
|
137
|
+
|
|
138
|
+
[[package]]
|
|
139
|
+
name = "id-arena"
|
|
140
|
+
version = "2.3.0"
|
|
141
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
142
|
+
checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954"
|
|
143
|
+
|
|
144
|
+
[[package]]
|
|
145
|
+
name = "indexmap"
|
|
146
|
+
version = "2.14.1"
|
|
147
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
148
|
+
checksum = "07aa2048142242915a31d35844fb311e0e53fcca590c3a0a40dcf1b841fa09eb"
|
|
149
|
+
dependencies = [
|
|
150
|
+
"equivalent",
|
|
151
|
+
"hashbrown 0.17.1",
|
|
152
|
+
"serde",
|
|
153
|
+
"serde_core",
|
|
154
|
+
]
|
|
155
|
+
|
|
156
|
+
[[package]]
|
|
157
|
+
name = "itoa"
|
|
158
|
+
version = "1.0.18"
|
|
159
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
160
|
+
checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
|
|
161
|
+
|
|
162
|
+
[[package]]
|
|
163
|
+
name = "leb128fmt"
|
|
164
|
+
version = "0.1.0"
|
|
165
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
166
|
+
checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2"
|
|
167
|
+
|
|
168
|
+
[[package]]
|
|
169
|
+
name = "log"
|
|
170
|
+
version = "0.4.34"
|
|
171
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
172
|
+
checksum = "f9f8bd3e56ce4dfc153cf470fffbfa98c7620958b312ca5c3a4b8d5181fd13c6"
|
|
173
|
+
|
|
174
|
+
[[package]]
|
|
175
|
+
name = "memchr"
|
|
176
|
+
version = "2.8.3"
|
|
177
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
178
|
+
checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"
|
|
179
|
+
|
|
180
|
+
[[package]]
|
|
181
|
+
name = "nextclaw-rust-wasi-guest"
|
|
182
|
+
version = "0.1.0"
|
|
183
|
+
dependencies = [
|
|
184
|
+
"serde_json",
|
|
185
|
+
"wit-bindgen",
|
|
186
|
+
]
|
|
187
|
+
|
|
188
|
+
[[package]]
|
|
189
|
+
name = "once_cell"
|
|
190
|
+
version = "1.21.4"
|
|
191
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
192
|
+
checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
|
|
193
|
+
|
|
194
|
+
[[package]]
|
|
195
|
+
name = "pin-project-lite"
|
|
196
|
+
version = "0.2.17"
|
|
197
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
198
|
+
checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd"
|
|
199
|
+
|
|
200
|
+
[[package]]
|
|
201
|
+
name = "prettyplease"
|
|
202
|
+
version = "0.2.37"
|
|
203
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
204
|
+
checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b"
|
|
205
|
+
dependencies = [
|
|
206
|
+
"proc-macro2",
|
|
207
|
+
"syn 2.0.119",
|
|
208
|
+
]
|
|
209
|
+
|
|
210
|
+
[[package]]
|
|
211
|
+
name = "proc-macro2"
|
|
212
|
+
version = "1.0.107"
|
|
213
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
214
|
+
checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
|
|
215
|
+
dependencies = [
|
|
216
|
+
"unicode-ident",
|
|
217
|
+
]
|
|
218
|
+
|
|
219
|
+
[[package]]
|
|
220
|
+
name = "quote"
|
|
221
|
+
version = "1.0.47"
|
|
222
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
223
|
+
checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
|
|
224
|
+
dependencies = [
|
|
225
|
+
"proc-macro2",
|
|
226
|
+
]
|
|
227
|
+
|
|
228
|
+
[[package]]
|
|
229
|
+
name = "semver"
|
|
230
|
+
version = "1.0.28"
|
|
231
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
232
|
+
checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd"
|
|
233
|
+
|
|
234
|
+
[[package]]
|
|
235
|
+
name = "serde"
|
|
236
|
+
version = "1.0.229"
|
|
237
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
238
|
+
checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba"
|
|
239
|
+
dependencies = [
|
|
240
|
+
"serde_core",
|
|
241
|
+
]
|
|
242
|
+
|
|
243
|
+
[[package]]
|
|
244
|
+
name = "serde_core"
|
|
245
|
+
version = "1.0.229"
|
|
246
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
247
|
+
checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48"
|
|
248
|
+
dependencies = [
|
|
249
|
+
"serde_derive",
|
|
250
|
+
]
|
|
251
|
+
|
|
252
|
+
[[package]]
|
|
253
|
+
name = "serde_derive"
|
|
254
|
+
version = "1.0.229"
|
|
255
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
256
|
+
checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348"
|
|
257
|
+
dependencies = [
|
|
258
|
+
"proc-macro2",
|
|
259
|
+
"quote",
|
|
260
|
+
"syn 3.0.4",
|
|
261
|
+
]
|
|
262
|
+
|
|
263
|
+
[[package]]
|
|
264
|
+
name = "serde_json"
|
|
265
|
+
version = "1.0.151"
|
|
266
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
267
|
+
checksum = "c841b55ecdae098c80dcae9cf767f6f8a0c2cdb3416bbef72181df4d0fe73f14"
|
|
268
|
+
dependencies = [
|
|
269
|
+
"itoa",
|
|
270
|
+
"memchr",
|
|
271
|
+
"serde",
|
|
272
|
+
"serde_core",
|
|
273
|
+
"zmij",
|
|
274
|
+
]
|
|
275
|
+
|
|
276
|
+
[[package]]
|
|
277
|
+
name = "slab"
|
|
278
|
+
version = "0.4.12"
|
|
279
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
280
|
+
checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5"
|
|
281
|
+
|
|
282
|
+
[[package]]
|
|
283
|
+
name = "syn"
|
|
284
|
+
version = "2.0.119"
|
|
285
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
286
|
+
checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297"
|
|
287
|
+
dependencies = [
|
|
288
|
+
"proc-macro2",
|
|
289
|
+
"quote",
|
|
290
|
+
"unicode-ident",
|
|
291
|
+
]
|
|
292
|
+
|
|
293
|
+
[[package]]
|
|
294
|
+
name = "syn"
|
|
295
|
+
version = "3.0.4"
|
|
296
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
297
|
+
checksum = "e6275cddf4610d1775e6d1fe9469b2e77d0f39fd98fb7450901b821e0c53649f"
|
|
298
|
+
dependencies = [
|
|
299
|
+
"proc-macro2",
|
|
300
|
+
"quote",
|
|
301
|
+
"unicode-ident",
|
|
302
|
+
]
|
|
303
|
+
|
|
304
|
+
[[package]]
|
|
305
|
+
name = "unicode-ident"
|
|
306
|
+
version = "1.0.24"
|
|
307
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
308
|
+
checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"
|
|
309
|
+
|
|
310
|
+
[[package]]
|
|
311
|
+
name = "unicode-xid"
|
|
312
|
+
version = "0.2.6"
|
|
313
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
314
|
+
checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853"
|
|
315
|
+
|
|
316
|
+
[[package]]
|
|
317
|
+
name = "wasm-encoder"
|
|
318
|
+
version = "0.236.1"
|
|
319
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
320
|
+
checksum = "724fccfd4f3c24b7e589d333fc0429c68042897a7e8a5f8694f31792471841e7"
|
|
321
|
+
dependencies = [
|
|
322
|
+
"leb128fmt",
|
|
323
|
+
"wasmparser",
|
|
324
|
+
]
|
|
325
|
+
|
|
326
|
+
[[package]]
|
|
327
|
+
name = "wasm-metadata"
|
|
328
|
+
version = "0.236.1"
|
|
329
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
330
|
+
checksum = "c909f94a49a8de3365f3c0344f064818f1e369ff1740c5b04f455f85d454768e"
|
|
331
|
+
dependencies = [
|
|
332
|
+
"anyhow",
|
|
333
|
+
"indexmap",
|
|
334
|
+
"wasm-encoder",
|
|
335
|
+
"wasmparser",
|
|
336
|
+
]
|
|
337
|
+
|
|
338
|
+
[[package]]
|
|
339
|
+
name = "wasmparser"
|
|
340
|
+
version = "0.236.1"
|
|
341
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
342
|
+
checksum = "a9b1e81f3eb254cf7404a82cee6926a4a3ccc5aad80cc3d43608a070c67aa1d7"
|
|
343
|
+
dependencies = [
|
|
344
|
+
"bitflags",
|
|
345
|
+
"hashbrown 0.15.5",
|
|
346
|
+
"indexmap",
|
|
347
|
+
"semver",
|
|
348
|
+
]
|
|
349
|
+
|
|
350
|
+
[[package]]
|
|
351
|
+
name = "wit-bindgen"
|
|
352
|
+
version = "0.44.0"
|
|
353
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
354
|
+
checksum = "04bd9ed271234163b18c92783b0d406f08ca32c232e972f207a68c7b324c44bf"
|
|
355
|
+
dependencies = [
|
|
356
|
+
"wit-bindgen-rt",
|
|
357
|
+
"wit-bindgen-rust-macro",
|
|
358
|
+
]
|
|
359
|
+
|
|
360
|
+
[[package]]
|
|
361
|
+
name = "wit-bindgen-core"
|
|
362
|
+
version = "0.44.0"
|
|
363
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
364
|
+
checksum = "b4103c7a3e178b75cd8b0b574fa199ed015e8399c9859b003865cc28834b474b"
|
|
365
|
+
dependencies = [
|
|
366
|
+
"anyhow",
|
|
367
|
+
"heck",
|
|
368
|
+
"wit-parser",
|
|
369
|
+
]
|
|
370
|
+
|
|
371
|
+
[[package]]
|
|
372
|
+
name = "wit-bindgen-rt"
|
|
373
|
+
version = "0.44.0"
|
|
374
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
375
|
+
checksum = "653c85dd7aee6fe6f4bded0d242406deadae9819029ce6f7d258c920c384358a"
|
|
376
|
+
dependencies = [
|
|
377
|
+
"bitflags",
|
|
378
|
+
"futures",
|
|
379
|
+
"once_cell",
|
|
380
|
+
]
|
|
381
|
+
|
|
382
|
+
[[package]]
|
|
383
|
+
name = "wit-bindgen-rust"
|
|
384
|
+
version = "0.44.0"
|
|
385
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
386
|
+
checksum = "95d164b3b6fbd2b0dd8b639b1012110c0bc256519a0a6def410d4020fa8ae106"
|
|
387
|
+
dependencies = [
|
|
388
|
+
"anyhow",
|
|
389
|
+
"heck",
|
|
390
|
+
"indexmap",
|
|
391
|
+
"prettyplease",
|
|
392
|
+
"syn 2.0.119",
|
|
393
|
+
"wasm-metadata",
|
|
394
|
+
"wit-bindgen-core",
|
|
395
|
+
"wit-component",
|
|
396
|
+
]
|
|
397
|
+
|
|
398
|
+
[[package]]
|
|
399
|
+
name = "wit-bindgen-rust-macro"
|
|
400
|
+
version = "0.44.0"
|
|
401
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
402
|
+
checksum = "2c9100a5e1ac85e526dcd4ef49c3ff7689e026fa5e56e2a2047fd377fc682e02"
|
|
403
|
+
dependencies = [
|
|
404
|
+
"anyhow",
|
|
405
|
+
"prettyplease",
|
|
406
|
+
"proc-macro2",
|
|
407
|
+
"quote",
|
|
408
|
+
"syn 2.0.119",
|
|
409
|
+
"wit-bindgen-core",
|
|
410
|
+
"wit-bindgen-rust",
|
|
411
|
+
]
|
|
412
|
+
|
|
413
|
+
[[package]]
|
|
414
|
+
name = "wit-component"
|
|
415
|
+
version = "0.236.1"
|
|
416
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
417
|
+
checksum = "3622959ed7ed6341c38e5aa35af243632534b0a36226852faa802939ce11e00f"
|
|
418
|
+
dependencies = [
|
|
419
|
+
"anyhow",
|
|
420
|
+
"bitflags",
|
|
421
|
+
"indexmap",
|
|
422
|
+
"log",
|
|
423
|
+
"serde",
|
|
424
|
+
"serde_derive",
|
|
425
|
+
"serde_json",
|
|
426
|
+
"wasm-encoder",
|
|
427
|
+
"wasm-metadata",
|
|
428
|
+
"wasmparser",
|
|
429
|
+
"wit-parser",
|
|
430
|
+
]
|
|
431
|
+
|
|
432
|
+
[[package]]
|
|
433
|
+
name = "wit-parser"
|
|
434
|
+
version = "0.236.1"
|
|
435
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
436
|
+
checksum = "16e4833a20cd6e85d6abfea0e63a399472d6f88c6262957c17f546879a80ba15"
|
|
437
|
+
dependencies = [
|
|
438
|
+
"anyhow",
|
|
439
|
+
"id-arena",
|
|
440
|
+
"indexmap",
|
|
441
|
+
"log",
|
|
442
|
+
"semver",
|
|
443
|
+
"serde",
|
|
444
|
+
"serde_derive",
|
|
445
|
+
"serde_json",
|
|
446
|
+
"unicode-xid",
|
|
447
|
+
"wasmparser",
|
|
448
|
+
]
|
|
449
|
+
|
|
450
|
+
[[package]]
|
|
451
|
+
name = "zmij"
|
|
452
|
+
version = "1.0.23"
|
|
453
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
454
|
+
checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b"
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
package wasi:clocks@0.2.6;
|
|
2
|
+
/// WASI Monotonic Clock is a clock API intended to let users measure elapsed
|
|
3
|
+
/// time.
|
|
4
|
+
///
|
|
5
|
+
/// It is intended to be portable at least between Unix-family platforms and
|
|
6
|
+
/// Windows.
|
|
7
|
+
///
|
|
8
|
+
/// A monotonic clock is a clock which has an unspecified initial value, and
|
|
9
|
+
/// successive reads of the clock will produce non-decreasing values.
|
|
10
|
+
@since(version = 0.2.0)
|
|
11
|
+
interface monotonic-clock {
|
|
12
|
+
@since(version = 0.2.0)
|
|
13
|
+
use wasi:io/poll@0.2.6.{pollable};
|
|
14
|
+
|
|
15
|
+
/// An instant in time, in nanoseconds. An instant is relative to an
|
|
16
|
+
/// unspecified initial value, and can only be compared to instances from
|
|
17
|
+
/// the same monotonic-clock.
|
|
18
|
+
@since(version = 0.2.0)
|
|
19
|
+
type instant = u64;
|
|
20
|
+
|
|
21
|
+
/// A duration of time, in nanoseconds.
|
|
22
|
+
@since(version = 0.2.0)
|
|
23
|
+
type duration = u64;
|
|
24
|
+
|
|
25
|
+
/// Read the current value of the clock.
|
|
26
|
+
///
|
|
27
|
+
/// The clock is monotonic, therefore calling this function repeatedly will
|
|
28
|
+
/// produce a sequence of non-decreasing values.
|
|
29
|
+
@since(version = 0.2.0)
|
|
30
|
+
now: func() -> instant;
|
|
31
|
+
|
|
32
|
+
/// Query the resolution of the clock. Returns the duration of time
|
|
33
|
+
/// corresponding to a clock tick.
|
|
34
|
+
@since(version = 0.2.0)
|
|
35
|
+
resolution: func() -> duration;
|
|
36
|
+
|
|
37
|
+
/// Create a `pollable` which will resolve once the specified instant
|
|
38
|
+
/// has occurred.
|
|
39
|
+
@since(version = 0.2.0)
|
|
40
|
+
subscribe-instant: func(
|
|
41
|
+
when: instant,
|
|
42
|
+
) -> pollable;
|
|
43
|
+
|
|
44
|
+
/// Create a `pollable` that will resolve after the specified duration has
|
|
45
|
+
/// elapsed from the time this function is invoked.
|
|
46
|
+
@since(version = 0.2.0)
|
|
47
|
+
subscribe-duration: func(
|
|
48
|
+
when: duration,
|
|
49
|
+
) -> pollable;
|
|
50
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
package wasi:clocks@0.2.6;
|
|
2
|
+
|
|
3
|
+
@unstable(feature = clocks-timezone)
|
|
4
|
+
interface timezone {
|
|
5
|
+
@unstable(feature = clocks-timezone)
|
|
6
|
+
use wall-clock.{datetime};
|
|
7
|
+
|
|
8
|
+
/// Return information needed to display the given `datetime`. This includes
|
|
9
|
+
/// the UTC offset, the time zone name, and a flag indicating whether
|
|
10
|
+
/// daylight saving time is active.
|
|
11
|
+
///
|
|
12
|
+
/// If the timezone cannot be determined for the given `datetime`, return a
|
|
13
|
+
/// `timezone-display` for `UTC` with a `utc-offset` of 0 and no daylight
|
|
14
|
+
/// saving time.
|
|
15
|
+
@unstable(feature = clocks-timezone)
|
|
16
|
+
display: func(when: datetime) -> timezone-display;
|
|
17
|
+
|
|
18
|
+
/// The same as `display`, but only return the UTC offset.
|
|
19
|
+
@unstable(feature = clocks-timezone)
|
|
20
|
+
utc-offset: func(when: datetime) -> s32;
|
|
21
|
+
|
|
22
|
+
/// Information useful for displaying the timezone of a specific `datetime`.
|
|
23
|
+
///
|
|
24
|
+
/// This information may vary within a single `timezone` to reflect daylight
|
|
25
|
+
/// saving time adjustments.
|
|
26
|
+
@unstable(feature = clocks-timezone)
|
|
27
|
+
record timezone-display {
|
|
28
|
+
/// The number of seconds difference between UTC time and the local
|
|
29
|
+
/// time of the timezone.
|
|
30
|
+
///
|
|
31
|
+
/// The returned value will always be less than 86400 which is the
|
|
32
|
+
/// number of seconds in a day (24*60*60).
|
|
33
|
+
///
|
|
34
|
+
/// In implementations that do not expose an actual time zone, this
|
|
35
|
+
/// should return 0.
|
|
36
|
+
utc-offset: s32,
|
|
37
|
+
|
|
38
|
+
/// The abbreviated name of the timezone to display to a user. The name
|
|
39
|
+
/// `UTC` indicates Coordinated Universal Time. Otherwise, this should
|
|
40
|
+
/// reference local standards for the name of the time zone.
|
|
41
|
+
///
|
|
42
|
+
/// In implementations that do not expose an actual time zone, this
|
|
43
|
+
/// should be the string `UTC`.
|
|
44
|
+
///
|
|
45
|
+
/// In time zones that do not have an applicable name, a formatted
|
|
46
|
+
/// representation of the UTC offset may be returned, such as `-04:00`.
|
|
47
|
+
name: string,
|
|
48
|
+
|
|
49
|
+
/// Whether daylight saving time is active.
|
|
50
|
+
///
|
|
51
|
+
/// In implementations that do not expose an actual time zone, this
|
|
52
|
+
/// should return false.
|
|
53
|
+
in-daylight-saving-time: bool,
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
package wasi:clocks@0.2.6;
|
|
2
|
+
/// WASI Wall Clock is a clock API intended to let users query the current
|
|
3
|
+
/// time. The name "wall" makes an analogy to a "clock on the wall", which
|
|
4
|
+
/// is not necessarily monotonic as it may be reset.
|
|
5
|
+
///
|
|
6
|
+
/// It is intended to be portable at least between Unix-family platforms and
|
|
7
|
+
/// Windows.
|
|
8
|
+
///
|
|
9
|
+
/// A wall clock is a clock which measures the date and time according to
|
|
10
|
+
/// some external reference.
|
|
11
|
+
///
|
|
12
|
+
/// External references may be reset, so this clock is not necessarily
|
|
13
|
+
/// monotonic, making it unsuitable for measuring elapsed time.
|
|
14
|
+
///
|
|
15
|
+
/// It is intended for reporting the current date and time for humans.
|
|
16
|
+
@since(version = 0.2.0)
|
|
17
|
+
interface wall-clock {
|
|
18
|
+
/// A time and date in seconds plus nanoseconds.
|
|
19
|
+
@since(version = 0.2.0)
|
|
20
|
+
record datetime {
|
|
21
|
+
seconds: u64,
|
|
22
|
+
nanoseconds: u32,
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/// Read the current value of the clock.
|
|
26
|
+
///
|
|
27
|
+
/// This clock is not monotonic, therefore calling this function repeatedly
|
|
28
|
+
/// will not necessarily produce a sequence of non-decreasing values.
|
|
29
|
+
///
|
|
30
|
+
/// The returned timestamps represent the number of seconds since
|
|
31
|
+
/// 1970-01-01T00:00:00Z, also known as [POSIX's Seconds Since the Epoch],
|
|
32
|
+
/// also known as [Unix Time].
|
|
33
|
+
///
|
|
34
|
+
/// The nanoseconds field of the output is always less than 1000000000.
|
|
35
|
+
///
|
|
36
|
+
/// [POSIX's Seconds Since the Epoch]: https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xbd_chap04.html#tag_21_04_16
|
|
37
|
+
/// [Unix Time]: https://en.wikipedia.org/wiki/Unix_time
|
|
38
|
+
@since(version = 0.2.0)
|
|
39
|
+
now: func() -> datetime;
|
|
40
|
+
|
|
41
|
+
/// Query the resolution of the clock.
|
|
42
|
+
///
|
|
43
|
+
/// The nanoseconds field of the output is always less than 1000000000.
|
|
44
|
+
@since(version = 0.2.0)
|
|
45
|
+
resolution: func() -> datetime;
|
|
46
|
+
}
|