@nextclaw/app-runtime 0.15.0 → 0.16.1-beta.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.
Files changed (53) hide show
  1. package/dist/index.d.ts +4 -4
  2. package/dist/package.js +1 -1
  3. package/dist/services/app-grant.service.d.ts +2 -0
  4. package/dist/services/app-grant.service.d.ts.map +1 -1
  5. package/dist/services/app-grant.service.js +40 -16
  6. package/dist/services/app-grant.service.js.map +1 -1
  7. package/dist/services/app-installation-lifecycle.service.js +29 -2
  8. package/dist/services/app-installation-lifecycle.service.js.map +1 -1
  9. package/dist/services/app-installation.service.d.ts.map +1 -1
  10. package/dist/services/app-installation.service.js +1 -1
  11. package/dist/services/app-installation.service.js.map +1 -1
  12. package/dist/services/app-manifest.service.d.ts +1 -0
  13. package/dist/services/app-manifest.service.d.ts.map +1 -1
  14. package/dist/services/app-manifest.service.js +27 -0
  15. package/dist/services/app-manifest.service.js.map +1 -1
  16. package/dist/services/app-permissions.service.d.ts.map +1 -1
  17. package/dist/services/app-permissions.service.js +0 -3
  18. package/dist/services/app-permissions.service.js.map +1 -1
  19. package/dist/services/app-registry-parser.service.js +228 -0
  20. package/dist/services/app-registry-parser.service.js.map +1 -0
  21. package/dist/services/app-registry.service.d.ts +7 -11
  22. package/dist/services/app-registry.service.d.ts.map +1 -1
  23. package/dist/services/app-registry.service.js +91 -173
  24. package/dist/services/app-registry.service.js.map +1 -1
  25. package/dist/services/app-rust-wasi-scaffold-template.service.d.ts.map +1 -1
  26. package/dist/services/app-rust-wasi-scaffold-template.service.js +37 -0
  27. package/dist/services/app-rust-wasi-scaffold-template.service.js.map +1 -1
  28. package/dist/types/app-installation.types.d.ts +2 -2
  29. package/dist/types/app-installation.types.d.ts.map +1 -1
  30. package/dist/types/app-manifest.types.d.ts +8 -1
  31. package/dist/types/app-manifest.types.d.ts.map +1 -1
  32. package/dist/types/app-manifest.types.js.map +1 -1
  33. package/dist/types/app-permissions.types.d.ts +12 -1
  34. package/dist/types/app-permissions.types.d.ts.map +1 -1
  35. package/dist/types/app-registry.types.d.ts +10 -3
  36. package/dist/types/app-registry.types.d.ts.map +1 -1
  37. package/package.json +2 -2
  38. package/resources/wit/deps/clocks@0.2.6/monotonic-clock.wit +50 -0
  39. package/resources/wit/deps/clocks@0.2.6/timezone.wit +55 -0
  40. package/resources/wit/deps/clocks@0.2.6/wall-clock.wit +46 -0
  41. package/resources/wit/deps/clocks@0.2.6/world.wit +11 -0
  42. package/resources/wit/deps/config@0.2.0-draft-2024-09-27/package.wit +1 -0
  43. package/resources/wit/deps/config@0.2.0-draft-2024-09-27/store.wit +9 -0
  44. package/resources/wit/deps/http@0.2.6/handler.wit +49 -0
  45. package/resources/wit/deps/http@0.2.6/package.wit +1 -0
  46. package/resources/wit/deps/http@0.2.6/types.wit +688 -0
  47. package/resources/wit/deps/io@0.2.6/error.wit +34 -0
  48. package/resources/wit/deps/io@0.2.6/poll.wit +47 -0
  49. package/resources/wit/deps/io@0.2.6/streams.wit +290 -0
  50. package/resources/wit/deps/io@0.2.6/world.wit +10 -0
  51. package/resources/wit/deps/spin@2.0.0/package.wit +1 -0
  52. package/resources/wit/deps/spin@2.0.0/sqlite.wit +50 -0
  53. package/resources/wit/portable-service.wit +73 -0
@@ -1 +1 @@
1
- {"version":3,"file":"app-installation.types.d.ts","names":[],"sources":["../../src/types/app-installation.types.ts"],"mappings":";;;;;;;;KAeY,uBAAA;AAAA,KAOA,yBAAA,IACV,KAAA,EAAO,uBAAA,YACG,OAAA;AAAA,KAEA,gBAAA;EACV,KAAA;EACA,IAAA;EACA,OAAA;EACA,gBAAA;EACA,aAAA;EACA,QAAA,EAAU,iBAAA;EACV,UAAA,EAAY,oBAAA;EACZ,gBAAA,GAAmB,mBAAA;EACnB,SAAA;EACA,WAAA,EAAa,cAAA;EACb,WAAA;EACA,SAAA;EACA,MAAA;EACA,MAAA,GAAS,iBAAA;EACT,SAAA,GAAY,YAAA;EACZ,OAAA;EACA,qBAAA;EACA,UAAA,GAAa,oBAAA;EACb,cAAA;AAAA;AAAA,KAGU,aAAA;EACV,KAAA;EACA,IAAA;EACA,WAAA;EACA,aAAA;EACA,OAAA;EACA,aAAA;EACA,QAAA,EAAU,iBAAA;EACV,OAAA,EAAS,iBAAA;EACT,YAAA,GAAe,eAAA;EACf,iBAAA,EAAmB,KAAA;IACjB,OAAA;IACA,gBAAA;IACA,UAAA,EAAY,oBAAA;IACZ,gBAAA,GAAmB,mBAAA;IACnB,SAAA;IACA,WAAA;IACA,WAAA,EAAa,cAAA;IACb,WAAA;IACA,SAAA;IACA,MAAA;IACA,MAAA,GAAS,iBAAA;IACT,SAAA,GAAY,YAAA;IACZ,qBAAA;IACA,UAAA,GAAa,oBAAA;IACb,cAAA;IACA,aAAA;EAAA;EAEF,MAAA,EAAQ,mBAAA;AAAA;AAAA,KAGE,oBAAA;EACV,KAAA;EACA,IAAA;EACA,aAAA;EACA,UAAA,EAAY,oBAAA;EACZ,gBAAA,GAAmB,mBAAA;EACnB,OAAA;EACA,qBAAA;EACA,cAAA;AAAA;AAAA,KAGU,kBAAA;EACV,KAAA;EACA,eAAA;EACA,WAAA;AAAA;AAAA,KAGU,mBAAA;EACV,YAAA;EACA,KAAA;EACA,aAAA;EACA,OAAA,GAAU,iBAAA;EACV,gBAAA,EAAkB,mBAAA;AAAA;AAAA,KAGR,eAAA,GAAkB,gBAAA;EAC5B,eAAA;EACA,OAAA;AAAA;AAAA,KAGU,mBAAA;EACV,KAAA;EACA,aAAA;EACA,OAAA;AAAA;AAAA,KAGU,iBAAA,GAAoB,mBAAA;EAC9B,eAAA;EACA,UAAA;AAAA"}
1
+ {"version":3,"file":"app-installation.types.d.ts","names":[],"sources":["../../src/types/app-installation.types.ts"],"mappings":";;;;;;;;KAkBY,uBAAA;AAAA,KAOA,yBAAA,IACV,KAAA,EAAO,uBAAA,YACG,OAAA;AAAA,KAEA,gBAAA;EACV,KAAA;EACA,IAAA;EACA,OAAA;EACA,gBAA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A;AAAA"}
@@ -5,8 +5,15 @@ type AppDocumentAccessScope = {
5
5
  mode: AppDocumentAccessMode;
6
6
  description?: string;
7
7
  };
8
+ type AppSecretSlot = {
9
+ id: string;
10
+ title: string;
11
+ description: string;
12
+ required: boolean;
13
+ };
8
14
  type AppPermissions = {
9
15
  documentAccess?: AppDocumentAccessScope[];
16
+ secrets?: AppSecretSlot[];
10
17
  allowedDomains?: string[];
11
18
  storage?: boolean | {
12
19
  namespace?: string;
@@ -167,5 +174,5 @@ type AppManifestSummary = AppStandaloneManifestSummary | AppComponentManifestSum
167
174
  declare function isAppStandaloneManifestBundle(bundle: AppManifestBundle): bundle is AppStandaloneManifestBundle;
168
175
  declare function isAppComponentManifestBundle(bundle: AppManifestBundle): bundle is AppComponentManifestBundle;
169
176
  //#endregion
170
- export { AppArtifactArchitecture, AppArtifactTarget, AppComponentKind, AppComponentManifest, AppComponentManifestBundle, AppComponentManifestSummary, AppComponentReference, AppCoreWasmMainManifest, AppDarwinArtifactTarget, AppDistributionDeclaration, AppDocumentAccessMode, AppDocumentAccessScope, AppLinuxArtifactTarget, AppMainManifest, AppManifest, AppManifestBundle, AppManifestSummary, AppNativeArtifactTarget, AppPermissions, AppPlatformSecuritySummary, AppResolvedComponent, AppRuntimeDeclaration, AppRuntimeIsolation, AppRuntimeProfile, AppStandaloneManifest, AppStandaloneManifestBundle, AppStandaloneManifestSummary, AppStorageDeclaration, AppUiManifest, AppUniversalArtifactTarget, AppWasiHttpComponentMainManifest, AppWindowsArtifactTarget, isAppComponentManifestBundle, isAppStandaloneManifestBundle };
177
+ export { AppArtifactArchitecture, AppArtifactTarget, AppComponentKind, AppComponentManifest, AppComponentManifestBundle, AppComponentManifestSummary, AppComponentReference, AppCoreWasmMainManifest, AppDarwinArtifactTarget, AppDistributionDeclaration, AppDocumentAccessMode, AppDocumentAccessScope, AppLinuxArtifactTarget, AppMainManifest, AppManifest, AppManifestBundle, AppManifestSummary, AppNativeArtifactTarget, AppPermissions, AppPlatformSecuritySummary, AppResolvedComponent, AppRuntimeDeclaration, AppRuntimeIsolation, AppRuntimeProfile, AppSecretSlot, AppStandaloneManifest, AppStandaloneManifestBundle, AppStandaloneManifestSummary, AppStorageDeclaration, AppUiManifest, AppUniversalArtifactTarget, AppWasiHttpComponentMainManifest, AppWindowsArtifactTarget, isAppComponentManifestBundle, isAppStandaloneManifestBundle };
171
178
  //# sourceMappingURL=app-manifest.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"app-manifest.types.d.ts","names":[],"sources":["../../src/types/app-manifest.types.ts"],"mappings":";KAAY,qBAAA;AAAA,KAEA,sBAAA;EACV,EAAA;EACA,IAAA,EAAM,qBAAA;EACN,WAAA;AAAA;AAAA,KAGU,cAAA;EACV,cAAA,GAAiB,sBAAA;EACjB,cAAA;EACA,OAAA;IAAsB,SAAA;EAAA;EACtB,YAAA;IACE,UAAA;IACA,aAAA;EAAA;AAAA;AAAA,KAIQ,iBAAA;AAAA,KACA,mBAAA;AAAA,KAEA,qBAAA;EACV,OAAA,EAAS,iBAAA;AAAA;AAAA,KAGC,uBAAA;AAAA,KAEA,uBAAA;EACV,IAAA;EACA,EAAA;EACA,IAAA,EAAM,uBAAA;AAAA;AAAA,KAGI,sBAAA;EACV,IAAA;EACA,EAAA;EACA,IAAA,EAAM,uBAAA;EACN,GAAA;AAAA;AAAA,KAGU,wBAAA;EACV,IAAA;EACA,EAAA;EACA,IAAA,EAAM,uBAAA;EACN,GAAA;AAAA;AAAA,KAGU,uBAAA,GACR,uBAAA,GACA,sBAAA,GACA,wBAAA;AAAA,KAEQ,0BAAA;EACV,IAAA;AAAA;AAAA,KAGU,iBAAA,GACR,0BAAA,GACA,uBAAA;AAAA,KAEQ,0BAAA;EACN,IAAA;AAAA;EAEA,IAAA;EACA,OAAA,EAAS,uBAAA;AAAA;AAAA,KAGH,qBAAA;EACV,KAAA;EACA,aAAA;AAAA;AAAA,KAGU,0BAAA;EACV,cAAA,EAAgB,iBAAA;EAChB,SAAA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,EAAA;EACA,IAAA;EACA,OAAA;EACA,WAAA;EACA,QAAA,EAAU,eAAA;EACV,MAAA;EACA,YAAA;EACA,aAAA;EACA,WAAA;EACA,QAAA;EACA,WAAA,EAAa,cAAA;AAAA;AAAA,KAGH,2BAAA;EACV,aAAA;EACA,EAAA;EACA,IAAA;EACA,OAAA;EACA,WAAA;EACA,YAAA;EACA,QAAA;EACA,cAAA;EACA,UAAA,EAAY,oBAAA;EACZ,YAAA,EAAc,0BAAA;EACd,QAAA,EAAU,0BAAA;AAAA;AAAA,KAGA,kBAAA,GAAqB,4BAAA,GAA+B,2BAAA;AAAA,iBAEhD,6BAAA,CACd,MAAA,EAAQ,iBAAA,GACP,MAAA,IAAU,2BAAA;AAAA,iBAIG,4BAAA,CACd,MAAA,EAAQ,iBAAA,GACP,MAAA,IAAU,0BAAA"}
1
+ {"version":3,"file":"app-manifest.types.d.ts","names":[],"sources":["../../src/types/app-manifest.types.ts"],"mappings":";KAAY,qBAAA;AAAA,KAEA,sBAAA;EACV,EAAA;EACA,IAAA,EAAM,qBAAA;EACN,WAAA;AAAA;AAAA,KAGU,aAAA;EACV,EAAA;EACA,KAAA;EACA,WAAA;EACA,QAAA;AAAA;AAAA,KAGU,cAAA;EACV,cAAA,GAAiB,sBAAA;EACjB,OAAA,GAAU,aAAA;EACV,cAAA;EACA,OAAA;IAAsB,SAAA;EAAA;EACtB,YAAA;IACE,UAAA;IACA,aAAA;EAAA;AAAA;AAAA,KAIQ,iBAAA;AAAA,KACA,mBAAA;AAAA,KAEA,qBAAA;EACV,OAAA,EAAS,iBAAA;AAAA;AAAA,KAGC,uBAAA;AAAA,KAEA,uBAAA;EACV,IAAA;EACA,EAAA;EACA,IAAA,EAAM,uBAAA;AAAA;AAAA,KAGI,sBAAA;EACV,IAAA;EACA,EAAA;EACA,IAAA,EAAM,uBAAA;EACN,GAAA;AAAA;AAAA,KAGU,wBAAA;EACV,IAAA;EACA,EAAA;EACA,IAAA,EAAM,uBAAA;EACN,GA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,2BAAA;EACV,YAAA;EACA,YAAA;EACA,QAAA,EAAU,qBAAA;EACV,aAAA;EACA,WAAA;EACA,eAAA;EACA,mBAAA;EACA,QAAA;AAAA;AAAA,KAGU,0BAAA;EACV,YAAA;EACA,YAAA;EACA,QAAA,EAAU,oBAAA;EACV,UAAA,EAAY,oBAAA;EACZ,mBAAA;EACA,QAAA;EACA,cAAA;AAAA;AAAA,KAGU,iBAAA,GAAoB,2BAAA,GAA8B,0BAAA;AAAA,KAElD,4BAAA;EACV,aAAA;EACA,EAAA;EACA,IAAA;EACA,OAAA;EACA,WAAA;EACA,QAAA,EAAU,eAAA;EACV,MAAA;EACA,YAAA;EACA,aAAA;EACA,WAAA;EACA,QAAA;EACA,WAAA,EAAa,cAAA;AAAA;AAAA,KAGH,2BAAA;EACV,aAAA;EACA,EAAA;EACA,IAAA;EACA,OAAA;EACA,WAAA;EACA,YAAA;EACA,QAAA;EACA,cAAA;EACA,UAAA,EAAY,oBAAA;EACZ,YAAA,EAAc,0BAAA;EACd,QAAA,EAAU,0BAAA;AAAA;AAAA,KAGA,kBAAA,GAAqB,4BAAA,GAA+B,2BAAA;AAAA,iBAEhD,6BAAA,CACd,MAAA,EAAQ,iBAAA,GACP,MAAA,IAAU,2BAAA;AAAA,iBAIG,4BAAA,CACd,MAAA,EAAQ,iBAAA,GACP,MAAA,IAAU,0BAAA"}
@@ -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":";AAuMA,SAAgB,8BACd,QACuC;AACvC,QAAO,OAAO,SAAS,kBAAkB;;AAG3C,SAAgB,6BACd,QACsC;AACtC,QAAO,OAAO,SAAS,kBAAkB"}
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"}
@@ -2,6 +2,12 @@ import { AppPermissions } from "./app-manifest.types.js";
2
2
 
3
3
  //#region src/types/app-permissions.types.d.ts
4
4
  type AppDocumentGrantMap = Record<string, string>;
5
+ type AppStoredDocumentGrant = {
6
+ path: string;
7
+ mode: "read" | "read-write";
8
+ grantedAt: string;
9
+ };
10
+ type AppStoredDocumentGrantMap = Record<string, AppStoredDocumentGrant>;
5
11
  type ResolvedDocumentGrant = {
6
12
  id: string;
7
13
  mode: "read" | "read-write";
@@ -28,6 +34,10 @@ type AppDocumentGrantState = {
28
34
  description?: string;
29
35
  granted: boolean;
30
36
  grantedPath?: string;
37
+ effectiveMode?: "read" | "read-write";
38
+ grantedAt?: string;
39
+ status: "ungranted" | "granted" | "insufficient" | "unavailable";
40
+ availableActions: Array<"grant" | "replace" | "upgrade" | "downgrade" | "revoke">;
31
41
  };
32
42
  type AppInstalledPermissionState = {
33
43
  appId: string;
@@ -47,8 +57,9 @@ type AppDocumentGrantMutationResult = {
47
57
  appId: string;
48
58
  scopeId: string;
49
59
  grantedPath?: string;
60
+ effectiveMode?: "read" | "read-write";
50
61
  removed?: boolean;
51
62
  };
52
63
  //#endregion
53
- export { AppDocumentGrantMap, AppDocumentGrantMutationResult, AppDocumentGrantState, AppInstalledPermissionState, AppPermissionSummary, ResolvedDocumentGrant, ResolvedPermissions };
64
+ export { AppDocumentGrantMap, AppDocumentGrantMutationResult, AppDocumentGrantState, AppInstalledPermissionState, AppPermissionSummary, AppStoredDocumentGrant, AppStoredDocumentGrantMap, ResolvedDocumentGrant, ResolvedPermissions };
54
65
  //# sourceMappingURL=app-permissions.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"app-permissions.types.d.ts","names":[],"sources":["../../src/types/app-permissions.types.ts"],"mappings":";;;KAEY,mBAAA,GAAsB,MAAA;AAAA,KAEtB,qBAAA;EACV,EAAA;EACA,IAAA;EACA,WAAA;EACA,IAAA;AAAA;AAAA,KAGU,mBAAA;EACV,cAAA,EAAgB,qBAAA;EAChB,cAAA;EACA,OAAA;IACE,OAAA;IACA,SAAA;EAAA;EAEF,YAAA;IACE,UAAA;EAAA;AAAA;AAAA,KAIQ,oBAAA,GAAuB,IAAA,CACjC,mBAAA;EAGA,SAAA,EAAW,cAAA;AAAA;AAAA,KAGD,qBAAA;EACV,EAAA;EACA,IAAA;EACA,WAAA;EACA,OAAA;EACA,WAAA;AAAA;AAAA,KAGU,2BAAA;EACV,KAAA;EACA,IAAA;EACA,aAAA;EACA,cAAA,EAAgB,qBAAA;EAChB,cAAA;EACA,OAAA;IACE,OAAA;IACA,SAAA;EAAA;EAEF,YAAA;IACE,UAAA;EAAA;AAAA;AAAA,KAIQ,8BAAA;EACV,KAAA;EACA,OAAA;EACA,WAAA;EACA,OAAA;AAAA"}
1
+ {"version":3,"file":"app-permissions.types.d.ts","names":[],"sources":["../../src/types/app-permissions.types.ts"],"mappings":";;;KAEY,mBAAA,GAAsB,MAAA;AAAA,KAEtB,sBAAA;EACV,IAAA;EACA,IAAA;EACA,SAAA;AAAA;AAAA,KAGU,yBAAA,GAA4B,MAAA,SAAe,sBAAA;AAAA,KAE3C,qBAAA;EACV,EAAA;EACA,IAAA;EACA,WAAA;EACA,IAAA;AAAA;AAAA,KAGU,mBAAA;EACV,cAAA,EAAgB,qBAAA;EAChB,cAAA;EACA,OAAA;IACE,OAAA;IACA,SAAA;EAAA;EAEF,YAAA;IACE,UAAA;EAAA;AAAA;AAAA,KAIQ,oBAAA,GAAuB,IAAA,CACjC,mBAAA;EAGA,SAAA,EAAW,cAAA;AAAA;AAAA,KAGD,qBAAA;EACV,EAAA;EACA,IAAA;EACA,WAAA;EACA,OAAA;EACA,WAAA;EACA,aAAA;EACA,SAAA;EACA,MAAA;EACA,gBAAA,EAAkB,KAAA;AAAA;AAAA,KAKR,2BAAA;EACV,KAAA;EACA,IAAA;EACA,aAAA;EACA,cAAA,EAAgB,qBAAA;EAChB,cAAA;EACA,OAAA;IACE,OAAA;IACA,SAAA;EAAA;EAEF,YAAA;IACE,UAAA;EAAA;AAAA;AAAA,KAIQ,8BAAA;EACV,KAAA;EACA,OAAA;EACA,WAAA;EACA,aAAA;EACA,OAAA;AAAA"}
@@ -1,10 +1,16 @@
1
1
  import { AppArtifactTarget, AppPermissions, AppPlatformSecuritySummary, AppResolvedComponent } from "./app-manifest.types.js";
2
2
  import { AppDistributionMode } from "./app-bundle.types.js";
3
- import { AppDocumentGrantMap } from "./app-permissions.types.js";
3
+ import { AppStoredDocumentGrantMap } from "./app-permissions.types.js";
4
4
  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;
@@ -36,7 +42,8 @@ type AppRegistryAppRecord = {
36
42
  dataDirectory: string;
37
43
  defaultInstance: AppInstanceRecord;
38
44
  installedVersions: Record<string, AppRegistryInstalledVersion>;
39
- grants: AppDocumentGrantMap;
45
+ grants: AppStoredDocumentGrantMap;
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,KAGE,WAAA;EACV,aAAA;EACA,IAAA,EAAM,MAAA,SAAe,oBAAA;EACrB,kBAAA,EAAoB,MAAA;IAClB,YAAA;EAAA;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,yBAAA;EACR,cAAA,EAAgB,mBAAA;AAAA;AAAA,KAGN,WAAA;EACV,aAAA;EACA,IAAA,EAAM,MAAA,SAAe,oBAAA;EACrB,kBAAA,EAAoB,MAAA;IAGhB,YAAA;EAAA;AAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nextclaw/app-runtime",
3
- "version": "0.15.0",
3
+ "version": "0.16.1-beta.0",
4
4
  "private": false,
5
5
  "description": "Standalone micro app runtime and CLI for NextClaw apps.",
6
6
  "type": "module",
@@ -58,7 +58,7 @@
58
58
  ],
59
59
  "dependencies": {
60
60
  "fflate": "^0.8.2",
61
- "@nextclaw/shared": "0.4.30"
61
+ "@nextclaw/shared": "0.5.0-beta.0"
62
62
  },
63
63
  "devDependencies": {
64
64
  "@types/node": "^20.17.6",
@@ -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
+ }
@@ -0,0 +1,11 @@
1
+ package wasi:clocks@0.2.6;
2
+
3
+ @since(version = 0.2.0)
4
+ world imports {
5
+ @since(version = 0.2.0)
6
+ import monotonic-clock;
7
+ @since(version = 0.2.0)
8
+ import wall-clock;
9
+ @unstable(feature = clocks-timezone)
10
+ import timezone;
11
+ }
@@ -0,0 +1 @@
1
+ package wasi:config@0.2.0-draft-2024-09-27;
@@ -0,0 +1,9 @@
1
+ interface store {
2
+ variant error {
3
+ upstream(string),
4
+ io(string),
5
+ }
6
+
7
+ get: func(key: string) -> result<option<string>, error>;
8
+ get-all: func() -> result<list<tuple<string, string>>, error>;
9
+ }
@@ -0,0 +1,49 @@
1
+ /// This interface defines a handler of incoming HTTP Requests. It should
2
+ /// be exported by components which can respond to HTTP Requests.
3
+ @since(version = 0.2.0)
4
+ interface incoming-handler {
5
+ @since(version = 0.2.0)
6
+ use types.{incoming-request, response-outparam};
7
+
8
+ /// This function is invoked with an incoming HTTP Request, and a resource
9
+ /// `response-outparam` which provides the capability to reply with an HTTP
10
+ /// Response. The response is sent by calling the `response-outparam.set`
11
+ /// method, which allows execution to continue after the response has been
12
+ /// sent. This enables both streaming to the response body, and performing other
13
+ /// work.
14
+ ///
15
+ /// The implementor of this function must write a response to the
16
+ /// `response-outparam` before returning, or else the caller will respond
17
+ /// with an error on its behalf.
18
+ @since(version = 0.2.0)
19
+ handle: func(
20
+ request: incoming-request,
21
+ response-out: response-outparam
22
+ );
23
+ }
24
+
25
+ /// This interface defines a handler of outgoing HTTP Requests. It should be
26
+ /// imported by components which wish to make HTTP Requests.
27
+ @since(version = 0.2.0)
28
+ interface outgoing-handler {
29
+ @since(version = 0.2.0)
30
+ use types.{
31
+ outgoing-request, request-options, future-incoming-response, error-code
32
+ };
33
+
34
+ /// This function is invoked with an outgoing HTTP Request, and it returns
35
+ /// a resource `future-incoming-response` which represents an HTTP Response
36
+ /// which may arrive in the future.
37
+ ///
38
+ /// The `options` argument accepts optional parameters for the HTTP
39
+ /// protocol's transport layer.
40
+ ///
41
+ /// This function may return an error if the `outgoing-request` is invalid
42
+ /// or not allowed to be made. Otherwise, protocol errors are reported
43
+ /// through the `future-incoming-response`.
44
+ @since(version = 0.2.0)
45
+ handle: func(
46
+ request: outgoing-request,
47
+ options: option<request-options>
48
+ ) -> result<future-incoming-response, error-code>;
49
+ }
@@ -0,0 +1 @@
1
+ package wasi:http@0.2.6;