@nextclaw/app-runtime 0.9.13 → 0.9.15
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/README.md +2 -2
- package/dist/{main.js → app/main.js} +2 -2
- package/dist/app/main.js.map +1 -0
- package/dist/{commands → controllers}/create.controller.d.ts +2 -2
- package/dist/controllers/create.controller.d.ts.map +1 -0
- package/dist/{commands → controllers}/create.controller.js +2 -2
- package/dist/controllers/create.controller.js.map +1 -0
- package/dist/{commands → controllers}/dev.controller.js +1 -1
- package/dist/controllers/dev.controller.js.map +1 -0
- package/dist/{commands → controllers}/grant.controller.d.ts +3 -3
- package/dist/controllers/grant.controller.d.ts.map +1 -0
- package/dist/{commands → controllers}/grant.controller.js +2 -2
- package/dist/controllers/grant.controller.js.map +1 -0
- package/dist/{commands → controllers}/info.controller.d.ts +2 -2
- package/dist/controllers/info.controller.d.ts.map +1 -0
- package/dist/{commands → controllers}/info.controller.js +2 -2
- package/dist/controllers/info.controller.js.map +1 -0
- package/dist/{commands → controllers}/inspect.controller.js +8 -2
- package/dist/controllers/inspect.controller.js.map +1 -0
- package/dist/{commands → controllers}/install.controller.d.ts +2 -2
- package/dist/controllers/install.controller.d.ts.map +1 -0
- package/dist/{commands → controllers}/install.controller.js +2 -2
- package/dist/controllers/install.controller.js.map +1 -0
- package/dist/{commands → controllers}/list.controller.d.ts +2 -2
- package/dist/controllers/list.controller.d.ts.map +1 -0
- package/dist/{commands → controllers}/list.controller.js +2 -2
- package/dist/controllers/list.controller.js.map +1 -0
- package/dist/controllers/pack.controller.d.ts +19 -0
- package/dist/controllers/pack.controller.d.ts.map +1 -0
- package/dist/{commands → controllers}/pack.controller.js +8 -4
- package/dist/controllers/pack.controller.js.map +1 -0
- package/dist/{commands → controllers}/permissions.controller.d.ts +2 -2
- package/dist/controllers/permissions.controller.d.ts.map +1 -0
- package/dist/{commands → controllers}/permissions.controller.js +2 -2
- package/dist/controllers/permissions.controller.js.map +1 -0
- package/dist/{commands → controllers}/publish.controller.d.ts +3 -3
- package/dist/controllers/publish.controller.d.ts.map +1 -0
- package/dist/{commands → controllers}/publish.controller.js +2 -2
- package/dist/controllers/publish.controller.js.map +1 -0
- package/dist/{commands → controllers}/registry.controller.d.ts +2 -2
- package/dist/controllers/registry.controller.d.ts.map +1 -0
- package/dist/{commands → controllers}/registry.controller.js +2 -2
- package/dist/controllers/registry.controller.js.map +1 -0
- package/dist/{commands → controllers}/revoke.controller.d.ts +2 -2
- package/dist/controllers/revoke.controller.d.ts.map +1 -0
- package/dist/{commands → controllers}/revoke.controller.js +2 -2
- package/dist/controllers/revoke.controller.js.map +1 -0
- package/dist/{commands → controllers}/run.controller.js +8 -6
- package/dist/controllers/run.controller.js.map +1 -0
- package/dist/{commands → controllers}/uninstall.controller.d.ts +2 -2
- package/dist/controllers/uninstall.controller.d.ts.map +1 -0
- package/dist/{commands → controllers}/uninstall.controller.js +2 -2
- package/dist/controllers/uninstall.controller.js.map +1 -0
- package/dist/{commands → controllers}/update.controller.d.ts +2 -2
- package/dist/controllers/update.controller.d.ts.map +1 -0
- package/dist/{commands → controllers}/update.controller.js +2 -2
- package/dist/controllers/update.controller.js.map +1 -0
- package/dist/{commands → controllers}/validate-publish.controller.d.ts +3 -3
- package/dist/controllers/validate-publish.controller.d.ts.map +1 -0
- package/dist/{commands → controllers}/validate-publish.controller.js +9 -5
- package/dist/controllers/validate-publish.controller.js.map +1 -0
- package/dist/index.d.ts +51 -51
- package/dist/index.js +46 -45
- package/dist/package.js +1 -1
- package/dist/{runtime → services}/app-build.service.d.ts +2 -2
- package/dist/services/app-build.service.d.ts.map +1 -0
- package/dist/{runtime → services}/app-build.service.js +4 -2
- package/dist/services/app-build.service.js.map +1 -0
- package/dist/{bundle → services}/app-bundle.service.d.ts +18 -6
- package/dist/services/app-bundle.service.d.ts.map +1 -0
- package/dist/services/app-bundle.service.js +305 -0
- package/dist/services/app-bundle.service.js.map +1 -0
- package/dist/{permissions → services}/app-grant.service.d.ts +4 -4
- package/dist/services/app-grant.service.d.ts.map +1 -0
- package/dist/{permissions → services}/app-grant.service.js +7 -4
- package/dist/services/app-grant.service.js.map +1 -0
- package/dist/{paths → services}/app-home.service.d.ts +2 -1
- package/dist/services/app-home.service.d.ts.map +1 -0
- package/dist/{paths → services}/app-home.service.js +4 -1
- package/dist/services/app-home.service.js.map +1 -0
- package/dist/{host → services}/app-host.service.d.ts +2 -2
- package/dist/services/app-host.service.d.ts.map +1 -0
- package/dist/{host → services}/app-host.service.js +3 -3
- package/dist/services/app-host.service.js.map +1 -0
- package/dist/services/app-install-source.service.js +72 -0
- package/dist/services/app-install-source.service.js.map +1 -0
- package/dist/services/app-installation.service.d.ts +48 -0
- package/dist/services/app-installation.service.d.ts.map +1 -0
- package/dist/services/app-installation.service.js +411 -0
- package/dist/services/app-installation.service.js.map +1 -0
- package/dist/services/app-instance.service.d.ts +34 -0
- package/dist/services/app-instance.service.d.ts.map +1 -0
- package/dist/{host → services}/app-instance.service.js +4 -4
- package/dist/services/app-instance.service.js.map +1 -0
- package/dist/{manifest → services}/app-manifest.service.d.ts +12 -2
- package/dist/services/app-manifest.service.d.ts.map +1 -0
- package/dist/services/app-manifest.service.js +271 -0
- package/dist/services/app-manifest.service.js.map +1 -0
- package/dist/{publish → services}/app-marketplace-client.service.d.ts +2 -2
- package/dist/services/app-marketplace-client.service.d.ts.map +1 -0
- package/dist/{publish → services}/app-marketplace-client.service.js +2 -2
- package/dist/services/app-marketplace-client.service.js.map +1 -0
- package/dist/{publish → services}/app-marketplace-metadata.service.d.ts +7 -3
- package/dist/services/app-marketplace-metadata.service.d.ts.map +1 -0
- package/dist/{publish → services}/app-marketplace-metadata.service.js +45 -3
- package/dist/services/app-marketplace-metadata.service.js.map +1 -0
- package/dist/{permissions → services}/app-permissions.service.d.ts +3 -3
- package/dist/services/app-permissions.service.d.ts.map +1 -0
- package/dist/{permissions → services}/app-permissions.service.js +4 -1
- package/dist/services/app-permissions.service.js.map +1 -0
- package/dist/{publish → services}/app-publish-validation.service.d.ts +9 -7
- package/dist/services/app-publish-validation.service.d.ts.map +1 -0
- package/dist/{publish → services}/app-publish-validation.service.js +14 -10
- package/dist/services/app-publish-validation.service.js.map +1 -0
- package/dist/{publish → services}/app-publish.service.d.ts +5 -5
- package/dist/services/app-publish.service.d.ts.map +1 -0
- package/dist/{publish → services}/app-publish.service.js +10 -7
- package/dist/services/app-publish.service.js.map +1 -0
- package/dist/{registry → services}/app-registry-config.service.d.ts +3 -3
- package/dist/{registry → services}/app-registry-config.service.d.ts.map +1 -1
- package/dist/{registry → services}/app-registry-config.service.js +3 -3
- package/dist/services/app-registry-config.service.js.map +1 -0
- package/dist/{registry → services}/app-registry.service.d.ts +20 -5
- package/dist/services/app-registry.service.d.ts.map +1 -0
- package/dist/services/app-registry.service.js +228 -0
- package/dist/services/app-registry.service.js.map +1 -0
- package/dist/{registry → services}/app-remote-registry-client.service.d.ts +6 -2
- package/dist/services/app-remote-registry-client.service.d.ts.map +1 -0
- package/dist/{registry → services}/app-remote-registry-client.service.js +54 -8
- package/dist/services/app-remote-registry-client.service.js.map +1 -0
- package/dist/{cli → services}/app-runtime-cli.service.d.ts +1 -1
- package/dist/services/app-runtime-cli.service.d.ts.map +1 -0
- package/dist/{cli → services}/app-runtime-cli.service.js +19 -19
- package/dist/services/app-runtime-cli.service.js.map +1 -0
- package/dist/{cli → services}/app-runtime-options.service.d.ts +6 -6
- package/dist/services/app-runtime-options.service.d.ts.map +1 -0
- package/dist/{cli → services}/app-runtime-options.service.js +3 -9
- package/dist/services/app-runtime-options.service.js.map +1 -0
- package/dist/{runtime → services}/app-runtime-toolchain.service.d.ts +1 -1
- package/dist/services/app-runtime-toolchain.service.d.ts.map +1 -0
- package/dist/{runtime → services}/app-runtime-toolchain.service.js +1 -1
- package/dist/services/app-runtime-toolchain.service.js.map +1 -0
- package/dist/{scaffold → services}/app-scaffold.service.d.ts +1 -1
- package/dist/{scaffold → services}/app-scaffold.service.d.ts.map +1 -1
- package/dist/{scaffold → services}/app-scaffold.service.js +1 -1
- package/dist/{scaffold → services}/app-scaffold.service.js.map +1 -1
- package/dist/{scaffold → services}/app-ts-http-lite-scaffold-template.service.d.ts +1 -1
- package/dist/{scaffold → services}/app-ts-http-lite-scaffold-template.service.d.ts.map +1 -1
- package/dist/{scaffold → services}/app-ts-http-lite-scaffold-template.service.js +1 -1
- package/dist/{scaffold → services}/app-ts-http-lite-scaffold-template.service.js.map +1 -1
- package/dist/{scaffold → services}/app-ts-http-scaffold-template.service.d.ts +1 -1
- package/dist/{scaffold → services}/app-ts-http-scaffold-template.service.d.ts.map +1 -1
- package/dist/{scaffold → services}/app-ts-http-scaffold-template.service.js +1 -1
- package/dist/{scaffold → services}/app-ts-http-scaffold-template.service.js.map +1 -1
- package/dist/{bridge → services}/host-bridge.service.d.ts +2 -2
- package/dist/services/host-bridge.service.d.ts.map +1 -0
- package/dist/{bridge → services}/host-bridge.service.js +1 -1
- package/dist/services/host-bridge.service.js.map +1 -0
- package/dist/services/main-runner.service.d.ts +9 -0
- package/dist/services/main-runner.service.d.ts.map +1 -0
- package/dist/services/main-runner.service.js +6 -0
- package/dist/services/main-runner.service.js.map +1 -0
- package/dist/{publish → services}/platform-auth-state.service.d.ts +1 -1
- package/dist/services/platform-auth-state.service.d.ts.map +1 -0
- package/dist/{publish → services}/platform-auth-state.service.js +1 -1
- package/dist/services/platform-auth-state.service.js.map +1 -0
- package/dist/{ui → services}/ui-server.service.d.ts +3 -3
- package/dist/services/ui-server.service.d.ts.map +1 -0
- package/dist/{ui → services}/ui-server.service.js +1 -1
- package/dist/services/ui-server.service.js.map +1 -0
- package/dist/{runtime → services}/wasm-main-runner.service.d.ts +3 -3
- package/dist/services/wasm-main-runner.service.d.ts.map +1 -0
- package/dist/{runtime → services}/wasm-main-runner.service.js +2 -2
- package/dist/services/wasm-main-runner.service.js.map +1 -0
- package/dist/{sidecar → services}/wasm-sidecar-client.service.d.ts +1 -1
- package/dist/services/wasm-sidecar-client.service.d.ts.map +1 -0
- package/dist/{sidecar → services}/wasm-sidecar-client.service.js +1 -1
- package/dist/services/wasm-sidecar-client.service.js.map +1 -0
- package/dist/{runtime → services}/wasmtime-wasi-http-component.service.d.ts +1 -1
- package/dist/services/wasmtime-wasi-http-component.service.d.ts.map +1 -0
- package/dist/{runtime → services}/wasmtime-wasi-http-component.service.js +1 -1
- package/dist/services/wasmtime-wasi-http-component.service.js.map +1 -0
- package/dist/{bundle → types}/app-bundle.types.d.ts +1 -1
- package/dist/types/app-bundle.types.d.ts.map +1 -0
- package/dist/{install → types}/app-installation.types.d.ts +29 -7
- package/dist/types/app-installation.types.d.ts.map +1 -0
- package/dist/types/app-manifest.types.d.ts +119 -0
- package/dist/types/app-manifest.types.d.ts.map +1 -0
- package/dist/types/app-manifest.types.js +11 -0
- package/dist/types/app-manifest.types.js.map +1 -0
- package/dist/{permissions → types}/app-permissions.types.d.ts +2 -2
- package/dist/types/app-permissions.types.d.ts.map +1 -0
- package/dist/{publish → types}/app-publish.types.d.ts +11 -5
- package/dist/types/app-publish.types.d.ts.map +1 -0
- package/dist/{publish → types}/app-publish.types.js +1 -1
- package/dist/types/app-publish.types.js.map +1 -0
- package/dist/{registry → types}/app-registry.types.d.ts +11 -4
- package/dist/types/app-registry.types.d.ts.map +1 -0
- package/dist/{registry → types}/app-remote-registry.types.d.ts +3 -3
- package/dist/types/app-remote-registry.types.d.ts.map +1 -0
- package/dist/{registry → types}/app-remote-registry.types.js +1 -1
- package/dist/types/app-remote-registry.types.js.map +1 -0
- package/dist/{runtime → types}/main-runner.types.d.ts +3 -3
- package/dist/types/main-runner.types.d.ts.map +1 -0
- package/package.json +10 -3
- package/dist/bridge/host-bridge.service.d.ts.map +0 -1
- package/dist/bridge/host-bridge.service.js.map +0 -1
- package/dist/bundle/app-bundle.service.d.ts.map +0 -1
- package/dist/bundle/app-bundle.service.js +0 -196
- package/dist/bundle/app-bundle.service.js.map +0 -1
- package/dist/bundle/app-bundle.types.d.ts.map +0 -1
- package/dist/cli/app-runtime-cli.service.d.ts.map +0 -1
- package/dist/cli/app-runtime-cli.service.js.map +0 -1
- package/dist/cli/app-runtime-options.service.d.ts.map +0 -1
- package/dist/cli/app-runtime-options.service.js.map +0 -1
- package/dist/commands/create.controller.d.ts.map +0 -1
- package/dist/commands/create.controller.js.map +0 -1
- package/dist/commands/dev.controller.js.map +0 -1
- package/dist/commands/grant.controller.d.ts.map +0 -1
- package/dist/commands/grant.controller.js.map +0 -1
- package/dist/commands/info.controller.d.ts.map +0 -1
- package/dist/commands/info.controller.js.map +0 -1
- package/dist/commands/inspect.controller.js.map +0 -1
- package/dist/commands/install.controller.d.ts.map +0 -1
- package/dist/commands/install.controller.js.map +0 -1
- package/dist/commands/list.controller.d.ts.map +0 -1
- package/dist/commands/list.controller.js.map +0 -1
- package/dist/commands/pack.controller.d.ts +0 -17
- package/dist/commands/pack.controller.d.ts.map +0 -1
- package/dist/commands/pack.controller.js.map +0 -1
- package/dist/commands/permissions.controller.d.ts.map +0 -1
- package/dist/commands/permissions.controller.js.map +0 -1
- package/dist/commands/publish.controller.d.ts.map +0 -1
- package/dist/commands/publish.controller.js.map +0 -1
- package/dist/commands/registry.controller.d.ts.map +0 -1
- package/dist/commands/registry.controller.js.map +0 -1
- package/dist/commands/revoke.controller.d.ts.map +0 -1
- package/dist/commands/revoke.controller.js.map +0 -1
- package/dist/commands/run.controller.js.map +0 -1
- package/dist/commands/uninstall.controller.d.ts.map +0 -1
- package/dist/commands/uninstall.controller.js.map +0 -1
- package/dist/commands/update.controller.d.ts.map +0 -1
- package/dist/commands/update.controller.js.map +0 -1
- package/dist/commands/validate-publish.controller.d.ts.map +0 -1
- package/dist/commands/validate-publish.controller.js.map +0 -1
- package/dist/host/app-host.service.d.ts.map +0 -1
- package/dist/host/app-host.service.js.map +0 -1
- package/dist/host/app-instance.service.d.ts +0 -34
- package/dist/host/app-instance.service.d.ts.map +0 -1
- package/dist/host/app-instance.service.js.map +0 -1
- package/dist/install/app-installation.service.d.ts +0 -41
- package/dist/install/app-installation.service.d.ts.map +0 -1
- package/dist/install/app-installation.service.js +0 -276
- package/dist/install/app-installation.service.js.map +0 -1
- package/dist/install/app-installation.types.d.ts.map +0 -1
- package/dist/main.js.map +0 -1
- package/dist/manifest/app-manifest.service.d.ts.map +0 -1
- package/dist/manifest/app-manifest.service.js +0 -147
- package/dist/manifest/app-manifest.service.js.map +0 -1
- package/dist/manifest/app-manifest.types.d.ts +0 -68
- package/dist/manifest/app-manifest.types.d.ts.map +0 -1
- package/dist/paths/app-home.service.d.ts.map +0 -1
- package/dist/paths/app-home.service.js.map +0 -1
- package/dist/permissions/app-grant.service.d.ts.map +0 -1
- package/dist/permissions/app-grant.service.js.map +0 -1
- package/dist/permissions/app-permissions.service.d.ts.map +0 -1
- package/dist/permissions/app-permissions.service.js.map +0 -1
- package/dist/permissions/app-permissions.types.d.ts.map +0 -1
- package/dist/publish/app-marketplace-client.service.d.ts.map +0 -1
- package/dist/publish/app-marketplace-client.service.js.map +0 -1
- package/dist/publish/app-marketplace-metadata.service.d.ts.map +0 -1
- package/dist/publish/app-marketplace-metadata.service.js.map +0 -1
- package/dist/publish/app-publish-validation.service.d.ts.map +0 -1
- package/dist/publish/app-publish-validation.service.js.map +0 -1
- package/dist/publish/app-publish.service.d.ts.map +0 -1
- package/dist/publish/app-publish.service.js.map +0 -1
- package/dist/publish/app-publish.types.d.ts.map +0 -1
- package/dist/publish/app-publish.types.js.map +0 -1
- package/dist/publish/platform-auth-state.service.d.ts.map +0 -1
- package/dist/publish/platform-auth-state.service.js.map +0 -1
- package/dist/registry/app-registry-config.service.js.map +0 -1
- package/dist/registry/app-registry.service.d.ts.map +0 -1
- package/dist/registry/app-registry.service.js +0 -118
- package/dist/registry/app-registry.service.js.map +0 -1
- package/dist/registry/app-registry.types.d.ts.map +0 -1
- package/dist/registry/app-remote-registry-client.service.d.ts.map +0 -1
- package/dist/registry/app-remote-registry-client.service.js.map +0 -1
- package/dist/registry/app-remote-registry.types.d.ts.map +0 -1
- package/dist/registry/app-remote-registry.types.js.map +0 -1
- package/dist/runtime/app-build.service.d.ts.map +0 -1
- package/dist/runtime/app-build.service.js.map +0 -1
- package/dist/runtime/app-runtime-toolchain.service.d.ts.map +0 -1
- package/dist/runtime/app-runtime-toolchain.service.js.map +0 -1
- package/dist/runtime/main-runner.service.d.ts +0 -9
- package/dist/runtime/main-runner.service.d.ts.map +0 -1
- package/dist/runtime/main-runner.service.js +0 -6
- package/dist/runtime/main-runner.service.js.map +0 -1
- package/dist/runtime/main-runner.types.d.ts.map +0 -1
- package/dist/runtime/wasm-main-runner.service.d.ts.map +0 -1
- package/dist/runtime/wasm-main-runner.service.js.map +0 -1
- package/dist/runtime/wasmtime-wasi-http-component.service.d.ts.map +0 -1
- package/dist/runtime/wasmtime-wasi-http-component.service.js.map +0 -1
- package/dist/sidecar/wasm-sidecar-client.service.d.ts.map +0 -1
- package/dist/sidecar/wasm-sidecar-client.service.js.map +0 -1
- package/dist/ui/ui-server.service.d.ts.map +0 -1
- package/dist/ui/ui-server.service.js.map +0 -1
- /package/dist/{main.d.ts → app/main.d.ts} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"install.controller.js","names":[],"sources":["../../src/commands/install.controller.ts"],"sourcesContent":["import { AppInstallationService } from \"../install/app-installation.service.js\";\n\nexport class InstallCommand {\n constructor(\n private readonly installationService: AppInstallationService = new AppInstallationService(),\n ) {}\n\n run = async (params: {\n appSource: string;\n registryUrl?: string;\n json: boolean;\n write: (text: string) => void;\n }): Promise<void> => {\n const { appSource, registryUrl, json, write } = params;\n const result = await this.installationService.install(appSource, {\n registryUrl,\n });\n if (json) {\n write(`${JSON.stringify({ ok: true, installation: result }, null, 2)}\\n`);\n return;\n }\n write(`Installed ${result.name} (${result.appId}) ${result.version}\\n`);\n write(`Code: ${result.installDirectory}\\n`);\n write(`Data: ${result.dataDirectory}\\n`);\n if (result.registryUrl) {\n write(`Registry: ${result.registryUrl}\\n`);\n }\n };\n}\n"],"mappings":";;AAEA,IAAa,iBAAb,MAA4B;CAC1B,YACE,sBAA+D,IAAI,wBAAwB,EAC3F;AADiB,OAAA,sBAAA;;CAGnB,MAAM,OAAO,WAKQ;EACnB,MAAM,EAAE,WAAW,aAAa,MAAM,UAAU;EAChD,MAAM,SAAS,MAAM,KAAK,oBAAoB,QAAQ,WAAW,EAC/D,aACD,CAAC;AACF,MAAI,MAAM;AACR,SAAM,GAAG,KAAK,UAAU;IAAE,IAAI;IAAM,cAAc;IAAQ,EAAE,MAAM,EAAE,CAAC,IAAI;AACzE;;AAEF,QAAM,aAAa,OAAO,KAAK,IAAI,OAAO,MAAM,IAAI,OAAO,QAAQ,IAAI;AACvE,QAAM,SAAS,OAAO,iBAAiB,IAAI;AAC3C,QAAM,SAAS,OAAO,cAAc,IAAI;AACxC,MAAI,OAAO,YACT,OAAM,aAAa,OAAO,YAAY,IAAI"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"list.controller.d.ts","names":[],"sources":["../../src/commands/list.controller.ts"],"mappings":";;;cAEa,WAAA;EAAA,iBAEQ,mBAAA;cAAA,mBAAA,GAAqB,sBAAA;EAGxC,GAAA,GAAa,MAAA;IACX,IAAA;IACA,KAAA,GAAQ,IAAA;EAAA,MACN,OAAA;AAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"list.controller.js","names":[],"sources":["../../src/commands/list.controller.ts"],"sourcesContent":["import { AppInstallationService } from \"../install/app-installation.service.js\";\n\nexport class ListCommand {\n constructor(\n private readonly installationService: AppInstallationService = new AppInstallationService(),\n ) {}\n\n run = async (params: {\n json: boolean;\n write: (text: string) => void;\n }): Promise<void> => {\n const { json, write } = params;\n const result = await this.installationService.list();\n if (json) {\n write(`${JSON.stringify({ ok: true, apps: result }, null, 2)}\\n`);\n return;\n }\n if (result.length === 0) {\n write(\"No installed apps.\\n\");\n return;\n }\n for (const appItem of result) {\n write(`${appItem.appId} ${appItem.activeVersion} ${appItem.sourceKind} ${appItem.name}\\n`);\n }\n };\n}\n"],"mappings":";;AAEA,IAAa,cAAb,MAAyB;CACvB,YACE,sBAA+D,IAAI,wBAAwB,EAC3F;AADiB,OAAA,sBAAA;;CAGnB,MAAM,OAAO,WAGQ;EACnB,MAAM,EAAE,MAAM,UAAU;EACxB,MAAM,SAAS,MAAM,KAAK,oBAAoB,MAAM;AACpD,MAAI,MAAM;AACR,SAAM,GAAG,KAAK,UAAU;IAAE,IAAI;IAAM,MAAM;IAAQ,EAAE,MAAM,EAAE,CAAC,IAAI;AACjE;;AAEF,MAAI,OAAO,WAAW,GAAG;AACvB,SAAM,uBAAuB;AAC7B;;AAEF,OAAK,MAAM,WAAW,OACpB,OAAM,GAAG,QAAQ,MAAM,GAAG,QAAQ,cAAc,GAAG,QAAQ,WAAW,GAAG,QAAQ,KAAK,IAAI"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { AppBundleService } from "../bundle/app-bundle.service.js";
|
|
2
|
-
|
|
3
|
-
//#region src/commands/pack.controller.d.ts
|
|
4
|
-
declare class PackCommand {
|
|
5
|
-
private readonly bundleService;
|
|
6
|
-
constructor(bundleService?: AppBundleService);
|
|
7
|
-
run: (params: {
|
|
8
|
-
appDirectory: string;
|
|
9
|
-
outputPath?: string;
|
|
10
|
-
mode: "source" | "bundle";
|
|
11
|
-
json: boolean;
|
|
12
|
-
write: (text: string) => void;
|
|
13
|
-
}) => Promise<void>;
|
|
14
|
-
}
|
|
15
|
-
//#endregion
|
|
16
|
-
export { PackCommand };
|
|
17
|
-
//# sourceMappingURL=pack.controller.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pack.controller.d.ts","names":[],"sources":["../../src/commands/pack.controller.ts"],"mappings":";;;cAEa,WAAA;EAAA,iBAEQ,aAAA;cAAA,aAAA,GAAe,gBAAA;EAGlC,GAAA,GAAa,MAAA;IACX,YAAA;IACA,UAAA;IACA,IAAA;IACA,IAAA;IACA,KAAA,GAAQ,IAAA;EAAA,MACN,OAAA;AAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pack.controller.js","names":[],"sources":["../../src/commands/pack.controller.ts"],"sourcesContent":["import { AppBundleService } from \"../bundle/app-bundle.service.js\";\n\nexport class PackCommand {\n constructor(\n private readonly bundleService: AppBundleService = new AppBundleService(),\n ) {}\n\n run = async (params: {\n appDirectory: string;\n outputPath?: string;\n mode: \"source\" | \"bundle\";\n json: boolean;\n write: (text: string) => void;\n }): Promise<void> => {\n const { appDirectory, outputPath, mode, json, write } = params;\n const result = await this.bundleService.packAppDirectory({\n appDirectory,\n outputPath,\n mode,\n });\n if (json) {\n write(`${JSON.stringify({ ok: true, bundle: result }, null, 2)}\\n`);\n return;\n }\n write(`Packed ${result.metadata.name} ${result.metadata.version} (${result.metadata.distributionMode})\\n`);\n write(`Bundle: ${result.bundlePath}\\n`);\n };\n}\n"],"mappings":";;AAEA,IAAa,cAAb,MAAyB;CACvB,YACE,gBAAmD,IAAI,kBAAkB,EACzE;AADiB,OAAA,gBAAA;;CAGnB,MAAM,OAAO,WAMQ;EACnB,MAAM,EAAE,cAAc,YAAY,MAAM,MAAM,UAAU;EACxD,MAAM,SAAS,MAAM,KAAK,cAAc,iBAAiB;GACvD;GACA;GACA;GACD,CAAC;AACF,MAAI,MAAM;AACR,SAAM,GAAG,KAAK,UAAU;IAAE,IAAI;IAAM,QAAQ;IAAQ,EAAE,MAAM,EAAE,CAAC,IAAI;AACnE;;AAEF,QAAM,UAAU,OAAO,SAAS,KAAK,GAAG,OAAO,SAAS,QAAQ,IAAI,OAAO,SAAS,iBAAiB,KAAK;AAC1G,QAAM,WAAW,OAAO,WAAW,IAAI"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"permissions.controller.d.ts","names":[],"sources":["../../src/commands/permissions.controller.ts"],"mappings":";;;cAEa,kBAAA;EAAA,iBAEQ,YAAA;cAAA,YAAA,GAAc,eAAA;EAGjC,GAAA,GAAa,MAAA;IACX,KAAA;IACA,IAAA;IACA,KAAA,GAAQ,IAAA;EAAA,MACN,OAAA;AAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"permissions.controller.js","names":[],"sources":["../../src/commands/permissions.controller.ts"],"sourcesContent":["import { AppGrantService } from \"../permissions/app-grant.service.js\";\n\nexport class PermissionsCommand {\n constructor(\n private readonly grantService: AppGrantService = new AppGrantService(),\n ) {}\n\n run = async (params: {\n appId: string;\n json: boolean;\n write: (text: string) => void;\n }): Promise<void> => {\n const { appId, json, write } = params;\n const result = await this.grantService.summarize(appId);\n if (json) {\n write(`${JSON.stringify({ ok: true, permissions: result }, null, 2)}\\n`);\n return;\n }\n write(`Permissions: ${result.name} (${result.appId}) ${result.activeVersion}\\n`);\n if (result.documentAccess.length === 0) {\n write(\"Document access: none\\n\");\n } else {\n for (const scope of result.documentAccess) {\n write(\n `Document ${scope.id} ${scope.mode} ${scope.granted ? scope.grantedPath : \"[missing]\"}\\n`,\n );\n }\n }\n write(\n `Allowed domains: ${result.allowedDomains.length > 0 ? result.allowedDomains.join(\", \") : \"none\"}\\n`,\n );\n write(`Storage: ${result.storage.enabled ? result.storage.namespace ?? \"enabled\" : \"disabled\"}\\n`);\n write(`Host bridge: ${result.capabilities.hostBridge ? \"enabled\" : \"disabled\"}\\n`);\n };\n}\n"],"mappings":";;AAEA,IAAa,qBAAb,MAAgC;CAC9B,YACE,eAAiD,IAAI,iBAAiB,EACtE;AADiB,OAAA,eAAA;;CAGnB,MAAM,OAAO,WAIQ;EACnB,MAAM,EAAE,OAAO,MAAM,UAAU;EAC/B,MAAM,SAAS,MAAM,KAAK,aAAa,UAAU,MAAM;AACvD,MAAI,MAAM;AACR,SAAM,GAAG,KAAK,UAAU;IAAE,IAAI;IAAM,aAAa;IAAQ,EAAE,MAAM,EAAE,CAAC,IAAI;AACxE;;AAEF,QAAM,gBAAgB,OAAO,KAAK,IAAI,OAAO,MAAM,IAAI,OAAO,cAAc,IAAI;AAChF,MAAI,OAAO,eAAe,WAAW,EACnC,OAAM,0BAA0B;MAEhC,MAAK,MAAM,SAAS,OAAO,eACzB,OACE,YAAY,MAAM,GAAG,GAAG,MAAM,KAAK,GAAG,MAAM,UAAU,MAAM,cAAc,YAAY,IACvF;AAGL,QACE,oBAAoB,OAAO,eAAe,SAAS,IAAI,OAAO,eAAe,KAAK,KAAK,GAAG,OAAO,IAClG;AACD,QAAM,YAAY,OAAO,QAAQ,UAAU,OAAO,QAAQ,aAAa,YAAY,WAAW,IAAI;AAClG,QAAM,gBAAgB,OAAO,aAAa,aAAa,YAAY,WAAW,IAAI"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"publish.controller.d.ts","names":[],"sources":["../../src/commands/publish.controller.ts"],"mappings":";;;cAEa,cAAA;EAAA,iBAEQ,cAAA;cAAA,cAAA,GAAgB,iBAAA;EAGnC,GAAA,GAAa,MAAA;IACX,YAAA;IACA,YAAA;IACA,UAAA;IACA,KAAA;IACA,IAAA;IACA,IAAA;IACA,KAAA,GAAQ,IAAA;EAAA,MACN,OAAA;AAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"publish.controller.js","names":[],"sources":["../../src/commands/publish.controller.ts"],"sourcesContent":["import { AppPublishService } from \"../publish/app-publish.service.js\";\n\nexport class PublishCommand {\n constructor(\n private readonly publishService: AppPublishService = new AppPublishService(),\n ) {}\n\n run = async (params: {\n appDirectory: string;\n metadataPath?: string;\n apiBaseUrl?: string;\n token?: string;\n mode: \"source\" | \"bundle\";\n json: boolean;\n write: (text: string) => void;\n }): Promise<void> => {\n const { appDirectory, metadataPath, apiBaseUrl, token, mode, json, write } = params;\n const result = await this.publishService.publish({\n appDirectory,\n metadataPath,\n apiBaseUrl,\n token,\n mode,\n });\n if (json) {\n write(`${JSON.stringify({ ok: true, publish: result }, null, 2)}\\n`);\n return;\n }\n write(\n `${result.created ? \"Published\" : \"Updated\"} ${result.item.name} (${result.item.appId}) ${result.item.latestVersion}\\n`,\n );\n write(`Distribution: ${result.distribution.path} (${result.distribution.mode})\\n`);\n if (result.item.webUrl) {\n write(`Details: ${result.item.webUrl}\\n`);\n }\n write(`Install: ${result.item.install.command}\\n`);\n };\n}\n"],"mappings":";;AAEA,IAAa,iBAAb,MAA4B;CAC1B,YACE,iBAAqD,IAAI,mBAAmB,EAC5E;AADiB,OAAA,iBAAA;;CAGnB,MAAM,OAAO,WAQQ;EACnB,MAAM,EAAE,cAAc,cAAc,YAAY,OAAO,MAAM,MAAM,UAAU;EAC7E,MAAM,SAAS,MAAM,KAAK,eAAe,QAAQ;GAC/C;GACA;GACA;GACA;GACA;GACD,CAAC;AACF,MAAI,MAAM;AACR,SAAM,GAAG,KAAK,UAAU;IAAE,IAAI;IAAM,SAAS;IAAQ,EAAE,MAAM,EAAE,CAAC,IAAI;AACpE;;AAEF,QACE,GAAG,OAAO,UAAU,cAAc,UAAU,GAAG,OAAO,KAAK,KAAK,IAAI,OAAO,KAAK,MAAM,IAAI,OAAO,KAAK,cAAc,IACrH;AACD,QAAM,iBAAiB,OAAO,aAAa,KAAK,IAAI,OAAO,aAAa,KAAK,KAAK;AAClF,MAAI,OAAO,KAAK,OACd,OAAM,YAAY,OAAO,KAAK,OAAO,IAAI;AAE3C,QAAM,YAAY,OAAO,KAAK,QAAQ,QAAQ,IAAI"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registry.controller.d.ts","names":[],"sources":["../../src/commands/registry.controller.ts"],"mappings":";;;cAEa,eAAA;EAAA,iBAEQ,aAAA;cAAA,aAAA,GAAe,wBAAA;EAGlC,GAAA,GAAa,MAAA;IACX,MAAA;IACA,WAAA;IACA,IAAA;IACA,KAAA,GAAQ,IAAA;EAAA,MACN,OAAA;EAAA,QAiBI,kBAAA;AAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registry.controller.js","names":[],"sources":["../../src/commands/registry.controller.ts"],"sourcesContent":["import { AppRegistryConfigService } from \"../registry/app-registry-config.service.js\";\n\nexport class RegistryCommand {\n constructor(\n private readonly configService: AppRegistryConfigService = new AppRegistryConfigService(),\n ) {}\n\n run = async (params: {\n action: \"get\" | \"set\" | \"reset\";\n registryUrl?: string;\n json: boolean;\n write: (text: string) => void;\n }): Promise<void> => {\n const { action, registryUrl, json, write } = params;\n const snapshot =\n action === \"set\"\n ? await this.configService.setRegistryUrl(this.requireRegistryUrl(registryUrl))\n : action === \"reset\"\n ? await this.configService.resetRegistryUrl()\n : await this.configService.getSnapshot();\n if (json) {\n write(`${JSON.stringify({ ok: true, registry: snapshot }, null, 2)}\\n`);\n return;\n }\n write(`Registry: ${snapshot.currentUrl}\\n`);\n write(`Source: ${snapshot.source}\\n`);\n write(`Default: ${snapshot.defaultUrl}\\n`);\n };\n\n private requireRegistryUrl = (registryUrl: string | undefined): string => {\n if (!registryUrl) {\n throw new Error(\"registry set 缺少 URL。\");\n }\n return registryUrl;\n };\n}\n"],"mappings":";;AAEA,IAAa,kBAAb,MAA6B;CAC3B,YACE,gBAA2D,IAAI,0BAA0B,EACzF;AADiB,OAAA,gBAAA;;CAGnB,MAAM,OAAO,WAKQ;EACnB,MAAM,EAAE,QAAQ,aAAa,MAAM,UAAU;EAC7C,MAAM,WACJ,WAAW,QACP,MAAM,KAAK,cAAc,eAAe,KAAK,mBAAmB,YAAY,CAAC,GAC7E,WAAW,UACT,MAAM,KAAK,cAAc,kBAAkB,GAC3C,MAAM,KAAK,cAAc,aAAa;AAC9C,MAAI,MAAM;AACR,SAAM,GAAG,KAAK,UAAU;IAAE,IAAI;IAAM,UAAU;IAAU,EAAE,MAAM,EAAE,CAAC,IAAI;AACvE;;AAEF,QAAM,aAAa,SAAS,WAAW,IAAI;AAC3C,QAAM,WAAW,SAAS,OAAO,IAAI;AACrC,QAAM,YAAY,SAAS,WAAW,IAAI;;CAG5C,sBAA8B,gBAA4C;AACxE,MAAI,CAAC,YACH,OAAM,IAAI,MAAM,uBAAuB;AAEzC,SAAO"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"revoke.controller.d.ts","names":[],"sources":["../../src/commands/revoke.controller.ts"],"mappings":";;;cAEa,aAAA;EAAA,iBAEQ,YAAA;cAAA,YAAA,GAAc,eAAA;EAGjC,GAAA,GAAa,MAAA;IACX,KAAA;IACA,gBAAA;IACA,IAAA;IACA,KAAA,GAAQ,IAAA;EAAA,MACN,OAAA;AAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"revoke.controller.js","names":[],"sources":["../../src/commands/revoke.controller.ts"],"sourcesContent":["import { AppGrantService } from \"../permissions/app-grant.service.js\";\n\nexport class RevokeCommand {\n constructor(\n private readonly grantService: AppGrantService = new AppGrantService(),\n ) {}\n\n run = async (params: {\n appId: string;\n documentScopeIds: string[];\n json: boolean;\n write: (text: string) => void;\n }): Promise<void> => {\n const { appId, documentScopeIds, json, write } = params;\n const results = await Promise.all(\n documentScopeIds.map((scopeId) =>\n this.grantService.revokeDocumentScope({\n appId,\n scopeId,\n }),\n ),\n );\n if (json) {\n write(`${JSON.stringify({ ok: true, revocations: results }, null, 2)}\\n`);\n return;\n }\n for (const result of results) {\n write(`Revoked ${result.scopeId}: ${result.removed ? \"yes\" : \"no\"}\\n`);\n }\n };\n}\n"],"mappings":";;AAEA,IAAa,gBAAb,MAA2B;CACzB,YACE,eAAiD,IAAI,iBAAiB,EACtE;AADiB,OAAA,eAAA;;CAGnB,MAAM,OAAO,WAKQ;EACnB,MAAM,EAAE,OAAO,kBAAkB,MAAM,UAAU;EACjD,MAAM,UAAU,MAAM,QAAQ,IAC5B,iBAAiB,KAAK,YACpB,KAAK,aAAa,oBAAoB;GACpC;GACA;GACD,CAAC,CACH,CACF;AACD,MAAI,MAAM;AACR,SAAM,GAAG,KAAK,UAAU;IAAE,IAAI;IAAM,aAAa;IAAS,EAAE,MAAM,EAAE,CAAC,IAAI;AACzE;;AAEF,OAAK,MAAM,UAAU,QACnB,OAAM,WAAW,OAAO,QAAQ,IAAI,OAAO,UAAU,QAAQ,KAAK,IAAI"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"run.controller.js","names":[],"sources":["../../src/commands/run.controller.ts"],"sourcesContent":["import { AppHostService } from \"../host/app-host.service.js\";\nimport { AppInstanceService } from \"../host/app-instance.service.js\";\nimport { AppInstallationService } from \"../install/app-installation.service.js\";\nimport { AppManifestService } from \"../manifest/app-manifest.service.js\";\nimport type { AppDocumentGrantMap } from \"../permissions/app-permissions.types.js\";\nimport { WasmtimeWasiHttpComponentService } from \"../runtime/wasmtime-wasi-http-component.service.js\";\n\nexport type RunCommandInput = {\n appReference: string;\n host: string;\n port: number;\n dataDirectory?: string;\n json: boolean;\n documentGrantMap: AppDocumentGrantMap;\n write: (text: string) => void;\n};\n\nexport class RunCommand {\n constructor(\n private readonly manifestService: AppManifestService = new AppManifestService(),\n private readonly installationService: AppInstallationService = new AppInstallationService(),\n ) {}\n\n run = async (params: RunCommandInput): Promise<void> => {\n const { appReference, host, port, dataDirectory, json, documentGrantMap, write } = params;\n const launch = await this.installationService.resolveLaunch(appReference, documentGrantMap);\n const bundle = await this.manifestService.load(launch.appDirectory);\n const appInstance = new AppInstanceService(bundle);\n await appInstance.initialize(launch.documentGrantMap, {\n appId: launch.appId,\n });\n await this.installationService.persistGrants(launch.appId, launch.documentGrantMap);\n const wasiHttpComponentService =\n bundle.manifest.main.kind === \"wasi-http-component\"\n ? new WasmtimeWasiHttpComponentService()\n : undefined;\n const effectiveDataDirectory = dataDirectory ?? launch.dataDirectory;\n if (wasiHttpComponentService) {\n if (!effectiveDataDirectory) {\n throw new Error(\"wasi-http-component 应用需要通过 --data /path 指定后端数据目录。\");\n }\n await wasiHttpComponentService.start({\n wasmPath: bundle.mainEntryPath,\n dataDirectory: effectiveDataDirectory,\n });\n }\n const appHost = new AppHostService(appInstance, wasiHttpComponentService);\n let hostHandle: Awaited<ReturnType<AppHostService[\"start\"]>>;\n try {\n hostHandle = await appHost.start({\n host,\n port,\n });\n } catch (error) {\n await wasiHttpComponentService?.stop();\n throw error;\n }\n\n const shutdown = async (): Promise<void> => {\n await appHost.stop();\n await wasiHttpComponentService?.stop();\n process.exit(0);\n };\n\n process.once(\"SIGINT\", () => {\n void shutdown();\n });\n process.once(\"SIGTERM\", () => {\n void shutdown();\n });\n\n if (json) {\n write(\n `${JSON.stringify(\n {\n ok: true,\n host: hostHandle,\n app: {\n appId: launch.appId ?? bundle.manifest.id,\n appDirectory: launch.appDirectory,\n dataDirectory: effectiveDataDirectory,\n },\n },\n null,\n 2,\n )}\\n`,\n );\n return;\n }\n\n write(`[napp] ${bundle.manifest.name} listening on ${hostHandle.url}\\n`);\n };\n}\n"],"mappings":";;;;;;AAiBA,IAAa,aAAb,MAAwB;CACtB,YACE,kBAAuD,IAAI,oBAAoB,EAC/E,sBAA+D,IAAI,wBAAwB,EAC3F;AAFiB,OAAA,kBAAA;AACA,OAAA,sBAAA;;CAGnB,MAAM,OAAO,WAA2C;EACtD,MAAM,EAAE,cAAc,MAAM,MAAM,eAAe,MAAM,kBAAkB,UAAU;EACnF,MAAM,SAAS,MAAM,KAAK,oBAAoB,cAAc,cAAc,iBAAiB;EAC3F,MAAM,SAAS,MAAM,KAAK,gBAAgB,KAAK,OAAO,aAAa;EACnE,MAAM,cAAc,IAAI,mBAAmB,OAAO;AAClD,QAAM,YAAY,WAAW,OAAO,kBAAkB,EACpD,OAAO,OAAO,OACf,CAAC;AACF,QAAM,KAAK,oBAAoB,cAAc,OAAO,OAAO,OAAO,iBAAiB;EACnF,MAAM,2BACJ,OAAO,SAAS,KAAK,SAAS,wBAC1B,IAAI,kCAAkC,GACtC,KAAA;EACN,MAAM,yBAAyB,iBAAiB,OAAO;AACvD,MAAI,0BAA0B;AAC5B,OAAI,CAAC,uBACH,OAAM,IAAI,MAAM,oDAAoD;AAEtE,SAAM,yBAAyB,MAAM;IACnC,UAAU,OAAO;IACjB,eAAe;IAChB,CAAC;;EAEJ,MAAM,UAAU,IAAI,eAAe,aAAa,yBAAyB;EACzE,IAAI;AACJ,MAAI;AACF,gBAAa,MAAM,QAAQ,MAAM;IAC/B;IACA;IACD,CAAC;WACK,OAAO;AACd,SAAM,0BAA0B,MAAM;AACtC,SAAM;;EAGR,MAAM,WAAW,YAA2B;AAC1C,SAAM,QAAQ,MAAM;AACpB,SAAM,0BAA0B,MAAM;AACtC,WAAQ,KAAK,EAAE;;AAGjB,UAAQ,KAAK,gBAAgB;AACtB,aAAU;IACf;AACF,UAAQ,KAAK,iBAAiB;AACvB,aAAU;IACf;AAEF,MAAI,MAAM;AACR,SACE,GAAG,KAAK,UACN;IACE,IAAI;IACJ,MAAM;IACN,KAAK;KACH,OAAO,OAAO,SAAS,OAAO,SAAS;KACvC,cAAc,OAAO;KACrB,eAAe;KAChB;IACF,EACD,MACA,EACD,CAAC,IACH;AACD;;AAGF,QAAM,UAAU,OAAO,SAAS,KAAK,gBAAgB,WAAW,IAAI,IAAI"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"uninstall.controller.d.ts","names":[],"sources":["../../src/commands/uninstall.controller.ts"],"mappings":";;;cAEa,gBAAA;EAAA,iBAEQ,mBAAA;cAAA,mBAAA,GAAqB,sBAAA;EAGxC,GAAA,GAAa,MAAA;IACX,KAAA;IACA,SAAA;IACA,IAAA;IACA,KAAA,GAAQ,IAAA;EAAA,MACN,OAAA;AAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"uninstall.controller.js","names":[],"sources":["../../src/commands/uninstall.controller.ts"],"sourcesContent":["import { AppInstallationService } from \"../install/app-installation.service.js\";\n\nexport class UninstallCommand {\n constructor(\n private readonly installationService: AppInstallationService = new AppInstallationService(),\n ) {}\n\n run = async (params: {\n appId: string;\n purgeData: boolean;\n json: boolean;\n write: (text: string) => void;\n }): Promise<void> => {\n const { appId, purgeData, json, write } = params;\n const result = await this.installationService.uninstall(appId, purgeData);\n if (json) {\n write(`${JSON.stringify({ ok: true, uninstall: result }, null, 2)}\\n`);\n return;\n }\n write(`Uninstalled ${result.appId}\\n`);\n write(`Versions: ${result.removedVersions.join(\", \")}\\n`);\n write(`Data removed: ${result.dataRemoved ? \"yes\" : \"no\"}\\n`);\n };\n}\n"],"mappings":";;AAEA,IAAa,mBAAb,MAA8B;CAC5B,YACE,sBAA+D,IAAI,wBAAwB,EAC3F;AADiB,OAAA,sBAAA;;CAGnB,MAAM,OAAO,WAKQ;EACnB,MAAM,EAAE,OAAO,WAAW,MAAM,UAAU;EAC1C,MAAM,SAAS,MAAM,KAAK,oBAAoB,UAAU,OAAO,UAAU;AACzE,MAAI,MAAM;AACR,SAAM,GAAG,KAAK,UAAU;IAAE,IAAI;IAAM,WAAW;IAAQ,EAAE,MAAM,EAAE,CAAC,IAAI;AACtE;;AAEF,QAAM,eAAe,OAAO,MAAM,IAAI;AACtC,QAAM,aAAa,OAAO,gBAAgB,KAAK,KAAK,CAAC,IAAI;AACzD,QAAM,iBAAiB,OAAO,cAAc,QAAQ,KAAK,IAAI"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update.controller.d.ts","names":[],"sources":["../../src/commands/update.controller.ts"],"mappings":";;;cAEa,aAAA;EAAA,iBAEQ,mBAAA;cAAA,mBAAA,GAAqB,sBAAA;EAGxC,GAAA,GAAa,MAAA;IACX,KAAA;IACA,OAAA;IACA,WAAA;IACA,IAAA;IACA,KAAA,GAAQ,IAAA;EAAA,MACN,OAAA;AAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update.controller.js","names":[],"sources":["../../src/commands/update.controller.ts"],"sourcesContent":["import { AppInstallationService } from \"../install/app-installation.service.js\";\n\nexport class UpdateCommand {\n constructor(\n private readonly installationService: AppInstallationService = new AppInstallationService(),\n ) {}\n\n run = async (params: {\n appId: string;\n version?: string;\n registryUrl?: string;\n json: boolean;\n write: (text: string) => void;\n }): Promise<void> => {\n const { appId, version, registryUrl, json, write } = params;\n const result = await this.installationService.update(appId, {\n version,\n registryUrl,\n });\n if (json) {\n write(`${JSON.stringify({ ok: true, update: result }, null, 2)}\\n`);\n return;\n }\n if (!result.updated) {\n write(`Already up to date: ${result.appId} ${result.version}\\n`);\n return;\n }\n write(`Updated ${result.name} (${result.appId}) ${result.previousVersion} -> ${result.version}\\n`);\n write(`Code: ${result.installDirectory}\\n`);\n };\n}\n"],"mappings":";;AAEA,IAAa,gBAAb,MAA2B;CACzB,YACE,sBAA+D,IAAI,wBAAwB,EAC3F;AADiB,OAAA,sBAAA;;CAGnB,MAAM,OAAO,WAMQ;EACnB,MAAM,EAAE,OAAO,SAAS,aAAa,MAAM,UAAU;EACrD,MAAM,SAAS,MAAM,KAAK,oBAAoB,OAAO,OAAO;GAC1D;GACA;GACD,CAAC;AACF,MAAI,MAAM;AACR,SAAM,GAAG,KAAK,UAAU;IAAE,IAAI;IAAM,QAAQ;IAAQ,EAAE,MAAM,EAAE,CAAC,IAAI;AACnE;;AAEF,MAAI,CAAC,OAAO,SAAS;AACnB,SAAM,uBAAuB,OAAO,MAAM,GAAG,OAAO,QAAQ,IAAI;AAChE;;AAEF,QAAM,WAAW,OAAO,KAAK,IAAI,OAAO,MAAM,IAAI,OAAO,gBAAgB,MAAM,OAAO,QAAQ,IAAI;AAClG,QAAM,SAAS,OAAO,iBAAiB,IAAI"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validate-publish.controller.d.ts","names":[],"sources":["../../src/commands/validate-publish.controller.ts"],"mappings":";;;cAEa,sBAAA;EAAA,iBAEQ,iBAAA;cAAA,iBAAA,GAAmB,2BAAA;EAGtC,GAAA,GAAa,MAAA;IACX,YAAA;IACA,YAAA;IACA,IAAA;IACA,IAAA;IACA,KAAA,GAAQ,IAAA;EAAA,MACN,OAAA;AAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validate-publish.controller.js","names":[],"sources":["../../src/commands/validate-publish.controller.ts"],"sourcesContent":["import { AppPublishValidationService } from \"../publish/app-publish-validation.service.js\";\n\nexport class ValidatePublishCommand {\n constructor(\n private readonly validationService: AppPublishValidationService = new AppPublishValidationService(),\n ) {}\n\n run = async (params: {\n appDirectory: string;\n metadataPath?: string;\n mode: \"source\" | \"bundle\";\n json: boolean;\n write: (text: string) => void;\n }): Promise<void> => {\n const { appDirectory, metadataPath, mode, json, write } = params;\n const result = await this.validationService.validate({\n appDirectory,\n metadataPath,\n mode,\n });\n if (json) {\n write(`${JSON.stringify({ ok: true, validation: result }, null, 2)}\\n`);\n return;\n }\n write(`Publish validation ok for ${result.appId}@${result.version}\\n`);\n write(`Distribution mode: ${result.distributionMode}\\n`);\n write(`Main kind: ${result.mainKind}\\n`);\n write(`Main: ${result.mainEntryPath}\\n`);\n write(`Metadata: ${result.metadataPath}\\n`);\n write(`Bundle size: ${result.bundleSizeBytes} bytes\\n`);\n write(`Main entry size: ${result.mainEntrySizeBytes} bytes\\n`);\n write(`Bundle files (${result.bundleFilePaths.length}): ${result.bundleFilePaths.join(\", \")}\\n`);\n if (result.warnings.length > 0) {\n for (const warning of result.warnings) {\n write(`Warning [${warning.code}]: ${warning.message}\\n`);\n }\n }\n };\n}\n"],"mappings":";;AAEA,IAAa,yBAAb,MAAoC;CAClC,YACE,oBAAkE,IAAI,6BAA6B,EACnG;AADiB,OAAA,oBAAA;;CAGnB,MAAM,OAAO,WAMQ;EACnB,MAAM,EAAE,cAAc,cAAc,MAAM,MAAM,UAAU;EAC1D,MAAM,SAAS,MAAM,KAAK,kBAAkB,SAAS;GACnD;GACA;GACA;GACD,CAAC;AACF,MAAI,MAAM;AACR,SAAM,GAAG,KAAK,UAAU;IAAE,IAAI;IAAM,YAAY;IAAQ,EAAE,MAAM,EAAE,CAAC,IAAI;AACvE;;AAEF,QAAM,6BAA6B,OAAO,MAAM,GAAG,OAAO,QAAQ,IAAI;AACtE,QAAM,sBAAsB,OAAO,iBAAiB,IAAI;AACxD,QAAM,cAAc,OAAO,SAAS,IAAI;AACxC,QAAM,SAAS,OAAO,cAAc,IAAI;AACxC,QAAM,aAAa,OAAO,aAAa,IAAI;AAC3C,QAAM,gBAAgB,OAAO,gBAAgB,UAAU;AACvD,QAAM,oBAAoB,OAAO,mBAAmB,UAAU;AAC9D,QAAM,iBAAiB,OAAO,gBAAgB,OAAO,KAAK,OAAO,gBAAgB,KAAK,KAAK,CAAC,IAAI;AAChG,MAAI,OAAO,SAAS,SAAS,EAC3B,MAAK,MAAM,WAAW,OAAO,SAC3B,OAAM,YAAY,QAAQ,KAAK,KAAK,QAAQ,QAAQ,IAAI"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"app-host.service.d.ts","names":[],"sources":["../../src/host/app-host.service.ts"],"mappings":";;;;KAMY,mBAAA;EACV,IAAA;EACA,IAAA;AAAA;AAAA,KAGU,aAAA;EACV,KAAA;EACA,GAAA;EACA,IAAA;EACA,IAAA;AAAA;AAAA,cAGW,cAAA;EAAA,iBAMQ,WAAA;EAAA,iBACA,wBAAA;EAAA,QANX,MAAA;EAAA,iBACS,YAAA;EAAA,iBACA,QAAA;cAGE,WAAA,EAAa,kBAAA,EACb,wBAAA,GAA2B,gCAAA;EAM9C,KAAA,GAAe,OAAA,EAAS,mBAAA,KAAsB,OAAA,CAAQ,aAAA;EA2BtD,IAAA,QAAiB,OAAA;EAAA,QAgBT,aAAA;AAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"app-host.service.js","names":[],"sources":["../../src/host/app-host.service.ts"],"sourcesContent":["import { createServer, type IncomingMessage, type Server, type ServerResponse } from \"node:http\";\nimport { HostBridgeServer } from \"../bridge/host-bridge.service.js\";\nimport type { AppInstanceService } from \"./app-instance.service.js\";\nimport { UiServerService } from \"../ui/ui-server.service.js\";\nimport type { WasmtimeWasiHttpComponentService } from \"../runtime/wasmtime-wasi-http-component.service.js\";\n\nexport type AppHostStartOptions = {\n host: string;\n port: number;\n};\n\nexport type AppHostHandle = {\n appId: string;\n url: string;\n host: string;\n port: number;\n};\n\nexport class AppHostService {\n private server?: Server;\n private readonly bridgeServer: HostBridgeServer;\n private readonly uiServer: UiServerService;\n\n constructor(\n private readonly appInstance: AppInstanceService,\n private readonly wasiHttpComponentService?: WasmtimeWasiHttpComponentService,\n ) {\n this.bridgeServer = new HostBridgeServer(appInstance);\n this.uiServer = new UiServerService(appInstance.bundle);\n }\n\n start = async (options: AppHostStartOptions): Promise<AppHostHandle> => {\n if (this.server) {\n throw new Error(\"应用宿主已经启动。\");\n }\n const server = createServer((request, response) => {\n void this.handleRequest(request, response);\n });\n this.server = server;\n await new Promise<void>((resolve, reject) => {\n server.once(\"error\", reject);\n server.listen(options.port, options.host, () => {\n server.off(\"error\", reject);\n resolve();\n });\n });\n const address = server.address();\n if (!address || typeof address === \"string\") {\n throw new Error(\"无法获取应用宿主监听地址。\");\n }\n return {\n appId: this.appInstance.bundle.manifest.id,\n url: `http://${address.address}:${address.port}`,\n host: address.address,\n port: address.port,\n };\n };\n\n stop = async (): Promise<void> => {\n if (!this.server) {\n return;\n }\n await new Promise<void>((resolve, reject) => {\n this.server?.close((error) => {\n if (error) {\n reject(error);\n return;\n }\n resolve();\n });\n });\n this.server = undefined;\n };\n\n private handleRequest = async (\n request: IncomingMessage,\n response: ServerResponse,\n ): Promise<void> => {\n try {\n if (this.wasiHttpComponentService) {\n const backendHandled = await this.wasiHttpComponentService.handleRequest(request, response);\n if (backendHandled) {\n return;\n }\n }\n const bridgeHandled = await this.bridgeServer.handle(request, response);\n if (bridgeHandled) {\n return;\n }\n await this.uiServer.handle(request, response);\n } catch (error) {\n response.writeHead(500, {\n \"content-type\": \"application/json; charset=utf-8\",\n });\n response.end(\n JSON.stringify(\n {\n ok: false,\n error: {\n code: \"APP_HOST_ERROR\",\n message: error instanceof Error ? error.message : String(error),\n },\n },\n null,\n 2,\n ),\n );\n }\n };\n}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AAgB,mCACjB,CAAC;AACF,YAAS,IACP,KAAK,UACH;IACE,IAAI;IACJ,OAAO;KACL,MAAM;KACN,SAAS,iBAAiB,QAAQ,MAAM,UAAU,OAAO,MAAM;KAChE;IACF,EACD,MACA,EACD,CACF"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { AppManifestBundle, AppManifestSummary } from "../manifest/app-manifest.types.js";
|
|
2
|
-
import { AppManifestService } from "../manifest/app-manifest.service.js";
|
|
3
|
-
import { AppDocumentGrantMap, AppPermissionSummary } from "../permissions/app-permissions.types.js";
|
|
4
|
-
import { AppPermissionsService } from "../permissions/app-permissions.service.js";
|
|
5
|
-
import { MainRunResult, WasmDocumentSummaryInput } from "../runtime/main-runner.types.js";
|
|
6
|
-
import { WasmMainRunnerService } from "../runtime/wasm-main-runner.service.js";
|
|
7
|
-
|
|
8
|
-
//#region src/host/app-instance.service.d.ts
|
|
9
|
-
type AppRunResult = {
|
|
10
|
-
action: string;
|
|
11
|
-
input: WasmDocumentSummaryInput;
|
|
12
|
-
output: MainRunResult;
|
|
13
|
-
observedAt: string;
|
|
14
|
-
};
|
|
15
|
-
declare class AppInstanceService {
|
|
16
|
-
readonly bundle: AppManifestBundle;
|
|
17
|
-
private readonly permissionsService;
|
|
18
|
-
private readonly mainRunner;
|
|
19
|
-
private readonly manifestService;
|
|
20
|
-
private permissions?;
|
|
21
|
-
constructor(bundle: AppManifestBundle, permissionsService?: AppPermissionsService, mainRunner?: WasmMainRunnerService, manifestService?: AppManifestService);
|
|
22
|
-
initialize: (documentGrantMap: AppDocumentGrantMap, context?: {
|
|
23
|
-
appId?: string;
|
|
24
|
-
}) => Promise<void>;
|
|
25
|
-
summarizeManifest: () => AppManifestSummary;
|
|
26
|
-
summarizePermissions: () => AppPermissionSummary;
|
|
27
|
-
runAction: (action?: string) => Promise<AppRunResult>;
|
|
28
|
-
private collectDocumentSummaryInput;
|
|
29
|
-
private collectDirectorySummary;
|
|
30
|
-
private getPermissions;
|
|
31
|
-
}
|
|
32
|
-
//#endregion
|
|
33
|
-
export { AppInstanceService, AppRunResult };
|
|
34
|
-
//# sourceMappingURL=app-instance.service.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"app-instance.service.d.ts","names":[],"sources":["../../src/host/app-instance.service.ts"],"mappings":";;;;;;;;KAaY,YAAA;EACV,MAAA;EACA,KAAA,EAAO,wBAAA;EACP,MAAA,EAAQ,aAAA;EACR,UAAA;AAAA;AAAA,cAGW,kBAAA;EAAA,SAIA,MAAA,EAAQ,iBAAA;EAAA,iBACA,kBAAA;EAAA,iBACA,UAAA;EAAA,iBACA,eAAA;EAAA,QANX,WAAA;cAGG,MAAA,EAAQ,iBAAA,EACA,kBAAA,GAAoB,qBAAA,EACpB,UAAA,GAAY,qBAAA,EACZ,eAAA,GAAiB,kBAAA;EAGpC,UAAA,GACE,gBAAA,EAAkB,mBAAA,EAClB,OAAA;IACE,KAAA;EAAA,MAED,OAAA;EAQH,iBAAA,QARU,kBAAA;EAYV,oBAAA,QAA2B,oBAAA;EAI3B,SAAA,GAAmB,MAAA,cAAkB,OAAA,CAAQ,YAAA;EAAA,QAuBrC,2BAAA;EAAA,QAiBA,uBAAA;EAAA,QA6BA,cAAA;AAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"app-instance.service.js","names":[],"sources":["../../src/host/app-instance.service.ts"],"sourcesContent":["import { readdir, readFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport type { AppManifestBundle } from \"../manifest/app-manifest.types.js\";\nimport { AppManifestService } from \"../manifest/app-manifest.service.js\";\nimport { AppPermissionsService } from \"../permissions/app-permissions.service.js\";\nimport type {\n AppDocumentGrantMap,\n AppPermissionSummary,\n ResolvedPermissions,\n} from \"../permissions/app-permissions.types.js\";\nimport { WasmMainRunnerService } from \"../runtime/wasm-main-runner.service.js\";\nimport type { MainRunResult, WasmDocumentSummaryInput } from \"../runtime/main-runner.types.js\";\n\nexport type AppRunResult = {\n action: string;\n input: WasmDocumentSummaryInput;\n output: MainRunResult;\n observedAt: string;\n};\n\nexport class AppInstanceService {\n private permissions?: ResolvedPermissions;\n\n constructor(\n readonly bundle: AppManifestBundle,\n private readonly permissionsService: AppPermissionsService = new AppPermissionsService(),\n private readonly mainRunner: WasmMainRunnerService = new WasmMainRunnerService(),\n private readonly manifestService: AppManifestService = new AppManifestService(),\n ) {}\n\n initialize = async (\n documentGrantMap: AppDocumentGrantMap,\n context?: {\n appId?: string;\n },\n ): Promise<void> => {\n this.permissions = await this.permissionsService.resolve(\n this.bundle,\n documentGrantMap,\n context,\n );\n };\n\n summarizeManifest = () => {\n return this.manifestService.summarize(this.bundle);\n };\n\n summarizePermissions = (): AppPermissionSummary => {\n return this.permissionsService.summarize(this.bundle, this.getPermissions());\n };\n\n runAction = async (action?: string): Promise<AppRunResult> => {\n if (this.bundle.manifest.main.kind !== \"wasm\") {\n throw new Error(\"当前应用不支持 __napp/run action,请通过 /api/* 调用 WASI HTTP 后端。\");\n }\n const expectedAction = this.bundle.manifest.main.action;\n if (action && action !== expectedAction) {\n throw new Error(`当前应用只支持动作 ${expectedAction}。`);\n }\n\n const input = await this.collectDocumentSummaryInput();\n const output = await this.mainRunner.runDocumentSummary({\n bundle: this.bundle,\n input,\n });\n\n return {\n action: expectedAction,\n input,\n output,\n observedAt: new Date().toISOString(),\n };\n };\n\n private collectDocumentSummaryInput = async (): Promise<WasmDocumentSummaryInput> => {\n const permissions = this.getPermissions();\n let documentCount = 0;\n let textBytes = 0;\n\n for (const grant of permissions.documentAccess) {\n const scopeSummary = await this.collectDirectorySummary(grant.path);\n documentCount += scopeSummary.documentCount;\n textBytes += scopeSummary.textBytes;\n }\n\n return {\n documentCount,\n textBytes,\n };\n };\n\n private collectDirectorySummary = async (\n directoryPath: string,\n ): Promise<WasmDocumentSummaryInput> => {\n const entries = await readdir(directoryPath, { withFileTypes: true });\n let documentCount = 0;\n let textBytes = 0;\n\n for (const entry of entries) {\n const entryPath = path.join(directoryPath, entry.name);\n if (entry.isDirectory()) {\n const childSummary = await this.collectDirectorySummary(entryPath);\n documentCount += childSummary.documentCount;\n textBytes += childSummary.textBytes;\n continue;\n }\n if (!entry.isFile()) {\n continue;\n }\n const content = await readFile(entryPath, \"utf-8\");\n documentCount += 1;\n textBytes += Buffer.byteLength(content, \"utf-8\");\n }\n\n return {\n documentCount,\n textBytes,\n };\n };\n\n private getPermissions = (): ResolvedPermissions => {\n if (!this.permissions) {\n throw new Error(\"应用实例尚未初始化权限。\");\n }\n return this.permissions;\n };\n}\n"],"mappings":";;;;;;AAoBA,IAAa,qBAAb,MAAgC;CAC9B;CAEA,YACE,QACA,qBAA6D,IAAI,uBAAuB,EACxF,aAAqD,IAAI,uBAAuB,EAChF,kBAAuD,IAAI,oBAAoB,EAC/E;AAJS,OAAA,SAAA;AACQ,OAAA,qBAAA;AACA,OAAA,aAAA;AACA,OAAA,kBAAA;;CAGnB,aAAa,OACX,kBACA,YAGkB;AAClB,OAAK,cAAc,MAAM,KAAK,mBAAmB,QAC/C,KAAK,QACL,kBACA,QACD;;CAGH,0BAA0B;AACxB,SAAO,KAAK,gBAAgB,UAAU,KAAK,OAAO;;CAGpD,6BAAmD;AACjD,SAAO,KAAK,mBAAmB,UAAU,KAAK,QAAQ,KAAK,gBAAgB,CAAC;;CAG9E,YAAY,OAAO,WAA2C;AAC5D,MAAI,KAAK,OAAO,SAAS,KAAK,SAAS,OACrC,OAAM,IAAI,MAAM,wDAAwD;EAE1E,MAAM,iBAAiB,KAAK,OAAO,SAAS,KAAK;AACjD,MAAI,UAAU,WAAW,eACvB,OAAM,IAAI,MAAM,aAAa,eAAe,GAAG;EAGjD,MAAM,QAAQ,MAAM,KAAK,6BAA6B;AAMtD,SAAO;GACL,QAAQ;GACR;GACA,QARa,MAAM,KAAK,WAAW,mBAAmB;IACtD,QAAQ,KAAK;IACb;IACD,CAAC;GAMA,6BAAY,IAAI,MAAM,EAAC,aAAa;GACrC;;CAGH,8BAAsC,YAA+C;EACnF,MAAM,cAAc,KAAK,gBAAgB;EACzC,IAAI,gBAAgB;EACpB,IAAI,YAAY;AAEhB,OAAK,MAAM,SAAS,YAAY,gBAAgB;GAC9C,MAAM,eAAe,MAAM,KAAK,wBAAwB,MAAM,KAAK;AACnE,oBAAiB,aAAa;AAC9B,gBAAa,aAAa;;AAG5B,SAAO;GACL;GACA;GACD;;CAGH,0BAAkC,OAChC,kBACsC;EACtC,MAAM,UAAU,MAAM,QAAQ,eAAe,EAAE,eAAe,MAAM,CAAC;EACrE,IAAI,gBAAgB;EACpB,IAAI,YAAY;AAEhB,OAAK,MAAM,SAAS,SAAS;GAC3B,MAAM,YAAY,KAAK,KAAK,eAAe,MAAM,KAAK;AACtD,OAAI,MAAM,aAAa,EAAE;IACvB,MAAM,eAAe,MAAM,KAAK,wBAAwB,UAAU;AAClE,qBAAiB,aAAa;AAC9B,iBAAa,aAAa;AAC1B;;AAEF,OAAI,CAAC,MAAM,QAAQ,CACjB;GAEF,MAAM,UAAU,MAAM,SAAS,WAAW,QAAQ;AAClD,oBAAiB;AACjB,gBAAa,OAAO,WAAW,SAAS,QAAQ;;AAGlD,SAAO;GACL;GACA;GACD;;CAGH,uBAAoD;AAClD,MAAI,CAAC,KAAK,YACR,OAAM,IAAI,MAAM,eAAe;AAEjC,SAAO,KAAK"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { AppManifestService } from "../manifest/app-manifest.service.js";
|
|
2
|
-
import { AppBundleService } from "../bundle/app-bundle.service.js";
|
|
3
|
-
import { AppDocumentGrantMap } from "../permissions/app-permissions.types.js";
|
|
4
|
-
import { AppHomeService } from "../paths/app-home.service.js";
|
|
5
|
-
import { AppRegistryService } from "../registry/app-registry.service.js";
|
|
6
|
-
import { AppBuildService } from "../runtime/app-build.service.js";
|
|
7
|
-
import { AppRegistryConfigService } from "../registry/app-registry-config.service.js";
|
|
8
|
-
import { AppRemoteRegistryClientService } from "../registry/app-remote-registry-client.service.js";
|
|
9
|
-
import { AppInfoResult, AppInstallResult, AppLaunchResolution, AppUninstallResult, AppUpdateResult, InstalledAppListItem } from "./app-installation.types.js";
|
|
10
|
-
|
|
11
|
-
//#region src/install/app-installation.service.d.ts
|
|
12
|
-
declare class AppInstallationService {
|
|
13
|
-
private readonly appHomeService;
|
|
14
|
-
private readonly bundleService;
|
|
15
|
-
private readonly manifestService;
|
|
16
|
-
private readonly buildService;
|
|
17
|
-
private readonly registryService;
|
|
18
|
-
private readonly registryConfigService;
|
|
19
|
-
private readonly remoteRegistryClient;
|
|
20
|
-
constructor(appHomeService?: AppHomeService, bundleService?: AppBundleService, manifestService?: AppManifestService, buildService?: AppBuildService, registryService?: AppRegistryService, registryConfigService?: AppRegistryConfigService, remoteRegistryClient?: AppRemoteRegistryClientService);
|
|
21
|
-
install: (appSource: string, options?: {
|
|
22
|
-
registryUrl?: string;
|
|
23
|
-
}) => Promise<AppInstallResult>;
|
|
24
|
-
update: (appId: string, options?: {
|
|
25
|
-
version?: string;
|
|
26
|
-
registryUrl?: string;
|
|
27
|
-
}) => Promise<AppUpdateResult>;
|
|
28
|
-
uninstall: (appId: string, purgeData: boolean) => Promise<AppUninstallResult>;
|
|
29
|
-
list: () => Promise<InstalledAppListItem[]>;
|
|
30
|
-
info: (appId: string) => Promise<AppInfoResult>;
|
|
31
|
-
resolveLaunch: (appReference: string, explicitDocumentGrantMap: AppDocumentGrantMap) => Promise<AppLaunchResolution>;
|
|
32
|
-
persistGrants: (appId: string | undefined, documentGrantMap: AppDocumentGrantMap) => Promise<void>;
|
|
33
|
-
private resolveInstallSource;
|
|
34
|
-
private detectLocalSourceType;
|
|
35
|
-
private parseRegistrySpec;
|
|
36
|
-
private looksLikePath;
|
|
37
|
-
private materializeDistribution;
|
|
38
|
-
}
|
|
39
|
-
//#endregion
|
|
40
|
-
export { AppInstallationService };
|
|
41
|
-
//# sourceMappingURL=app-installation.service.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"app-installation.service.d.ts","names":[],"sources":["../../src/install/app-installation.service.ts"],"mappings":";;;;;;;;;;;cAoBa,sBAAA;EAAA,iBAEQ,cAAA;EAAA,iBACA,aAAA;EAAA,iBACA,eAAA;EAAA,iBACA,YAAA;EAAA,iBACA,eAAA;EAAA,iBACA,qBAAA;EAAA,iBAGA,oBAAA;cARA,cAAA,GAAgB,cAAA,EAChB,aAAA,GAAe,gBAAA,EACf,eAAA,GAAiB,kBAAA,EACjB,YAAA,GAAc,eAAA,EACd,eAAA,GAAiB,kBAAA,EACjB,qBAAA,GAAuB,wBAAA,EAGvB,oBAAA,GAAsB,8BAAA;EAKzC,OAAA,GACE,SAAA,UACA,OAAA;IACE,WAAA;EAAA,MAED,OAAA,CAAQ,gBAAA;EA6FX,MAAA,GACE,KAAA,UACA,OAAA;IACE,OAAA;IACA,WAAA;EAAA,MAED,OAAA,CAAQ,eAAA;EA8CX,SAAA,GACE,KAAA,UACA,SAAA,cACC,OAAA,CAAQ,kBAAA;EAuBX,IAAA,QAAiB,OAAA,CAAQ,oBAAA;EAazB,IAAA,GAAc,KAAA,aAAgB,OAAA,CAAQ,aAAA;EA+BtC,aAAA,GACE,YAAA,UACA,wBAAA,EAA0B,mBAAA,KACzB,OAAA,CAAQ,mBAAA;EA2BX,aAAA,GACE,KAAA,sBACA,gBAAA,EAAkB,mBAAA,KACjB,OAAA;EAAA,QAOK,oBAAA;EAAA,QAsDA,qBAAA;EAAA,QAiDA,iBAAA;EAAA,QAkBA,aAAA;EAAA,QAQA,uBAAA;AAAA"}
|
|
@@ -1,276 +0,0 @@
|
|
|
1
|
-
import { AppManifestService } from "../manifest/app-manifest.service.js";
|
|
2
|
-
import { AppBundleService } from "../bundle/app-bundle.service.js";
|
|
3
|
-
import { AppHomeService } from "../paths/app-home.service.js";
|
|
4
|
-
import { AppBuildService } from "../runtime/app-build.service.js";
|
|
5
|
-
import { AppRegistryConfigService } from "../registry/app-registry-config.service.js";
|
|
6
|
-
import { AppRemoteRegistryClientService } from "../registry/app-remote-registry-client.service.js";
|
|
7
|
-
import { AppRegistryService } from "../registry/app-registry.service.js";
|
|
8
|
-
import { access, cp, mkdir, rm } from "node:fs/promises";
|
|
9
|
-
import path from "node:path";
|
|
10
|
-
//#region src/install/app-installation.service.ts
|
|
11
|
-
var AppInstallationService = class {
|
|
12
|
-
constructor(appHomeService = new AppHomeService(), bundleService = new AppBundleService(), manifestService = new AppManifestService(), buildService = new AppBuildService(), registryService = new AppRegistryService(appHomeService), registryConfigService = new AppRegistryConfigService(appHomeService), remoteRegistryClient = new AppRemoteRegistryClientService(new AppRegistryConfigService(appHomeService))) {
|
|
13
|
-
this.appHomeService = appHomeService;
|
|
14
|
-
this.bundleService = bundleService;
|
|
15
|
-
this.manifestService = manifestService;
|
|
16
|
-
this.buildService = buildService;
|
|
17
|
-
this.registryService = registryService;
|
|
18
|
-
this.registryConfigService = registryConfigService;
|
|
19
|
-
this.remoteRegistryClient = remoteRegistryClient;
|
|
20
|
-
}
|
|
21
|
-
install = async (appSource, options) => {
|
|
22
|
-
const source = await this.resolveInstallSource(appSource, options?.registryUrl);
|
|
23
|
-
const tempDirectory = await this.appHomeService.createTemporaryDirectory("napp-install-");
|
|
24
|
-
try {
|
|
25
|
-
const bundlePath = source.kind === "directory" ? (await this.bundleService.packAppDirectory({
|
|
26
|
-
appDirectory: source.appDirectory,
|
|
27
|
-
outputPath: path.join(tempDirectory, "app.napp")
|
|
28
|
-
})).bundlePath : source.kind === "bundle" ? source.bundlePath : (await this.remoteRegistryClient.downloadBundle({
|
|
29
|
-
resolution: source.registryResolution,
|
|
30
|
-
targetDirectory: tempDirectory
|
|
31
|
-
})).bundlePath;
|
|
32
|
-
const extractedDirectory = path.join(tempDirectory, "bundle");
|
|
33
|
-
const extractedMetadata = await this.bundleService.extractBundle({
|
|
34
|
-
bundlePath,
|
|
35
|
-
targetDirectory: extractedDirectory
|
|
36
|
-
});
|
|
37
|
-
await this.materializeDistribution({
|
|
38
|
-
appDirectory: extractedDirectory,
|
|
39
|
-
distributionMode: extractedMetadata.metadata.distributionMode
|
|
40
|
-
});
|
|
41
|
-
const manifestBundle = await this.manifestService.load(extractedDirectory);
|
|
42
|
-
const installDirectory = this.appHomeService.getInstallDirectory(manifestBundle.manifest.id, manifestBundle.manifest.version);
|
|
43
|
-
if (source.kind === "registry" && manifestBundle.manifest.id !== source.registryResolution.appId) throw new Error(`bundle manifest.appId 与 registry 请求不一致:期望 ${source.registryResolution.appId},实际 ${manifestBundle.manifest.id}`);
|
|
44
|
-
const dataDirectory = this.appHomeService.getAppDataDirectory(manifestBundle.manifest.id);
|
|
45
|
-
await rm(installDirectory, {
|
|
46
|
-
recursive: true,
|
|
47
|
-
force: true
|
|
48
|
-
});
|
|
49
|
-
await mkdir(path.dirname(installDirectory), { recursive: true });
|
|
50
|
-
await mkdir(dataDirectory, { recursive: true });
|
|
51
|
-
await cp(extractedDirectory, installDirectory, { recursive: true });
|
|
52
|
-
const registryRecord = await this.registryService.upsertInstallation({
|
|
53
|
-
appId: manifestBundle.manifest.id,
|
|
54
|
-
name: manifestBundle.manifest.name,
|
|
55
|
-
description: manifestBundle.manifest.description,
|
|
56
|
-
version: manifestBundle.manifest.version,
|
|
57
|
-
installDirectory,
|
|
58
|
-
dataDirectory,
|
|
59
|
-
sourceKind: source.kind,
|
|
60
|
-
distributionMode: source.kind === "registry" ? source.registryResolution.distributionMode : extractedMetadata.metadata.distributionMode,
|
|
61
|
-
sourceRef: source.sourceRef,
|
|
62
|
-
installedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
63
|
-
permissions: manifestBundle.manifest.permissions ?? {},
|
|
64
|
-
registryUrl: source.kind === "registry" ? source.registryResolution.registryUrl : void 0,
|
|
65
|
-
bundleUrl: source.kind === "registry" ? source.registryResolution.bundleUrl : void 0,
|
|
66
|
-
sha256: source.kind === "registry" ? source.registryResolution.sha256 : void 0,
|
|
67
|
-
publisher: source.kind === "registry" ? source.registryResolution.publisher : void 0
|
|
68
|
-
});
|
|
69
|
-
return {
|
|
70
|
-
appId: registryRecord.appId,
|
|
71
|
-
name: registryRecord.name,
|
|
72
|
-
version: registryRecord.activeVersion,
|
|
73
|
-
installDirectory,
|
|
74
|
-
dataDirectory,
|
|
75
|
-
sourceKind: source.kind,
|
|
76
|
-
sourceRef: source.sourceRef,
|
|
77
|
-
distributionMode: registryRecord.installedVersions[registryRecord.activeVersion]?.distributionMode,
|
|
78
|
-
permissions: registryRecord.installedVersions[registryRecord.activeVersion]?.permissions ?? {},
|
|
79
|
-
registryUrl: registryRecord.installedVersions[registryRecord.activeVersion]?.registryUrl,
|
|
80
|
-
bundleUrl: registryRecord.installedVersions[registryRecord.activeVersion]?.bundleUrl,
|
|
81
|
-
sha256: registryRecord.installedVersions[registryRecord.activeVersion]?.sha256,
|
|
82
|
-
publisher: registryRecord.installedVersions[registryRecord.activeVersion]?.publisher
|
|
83
|
-
};
|
|
84
|
-
} finally {
|
|
85
|
-
await rm(tempDirectory, {
|
|
86
|
-
recursive: true,
|
|
87
|
-
force: true
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
update = async (appId, options) => {
|
|
92
|
-
const appRecord = await this.registryService.getApp(appId);
|
|
93
|
-
if (!appRecord) throw new Error(`未找到已安装应用:${appId}`);
|
|
94
|
-
const activeVersionRecord = appRecord.installedVersions[appRecord.activeVersion];
|
|
95
|
-
const registryUrl = options?.registryUrl ?? activeVersionRecord?.registryUrl ?? (await this.registryConfigService.getSnapshot()).currentUrl;
|
|
96
|
-
const resolution = await this.remoteRegistryClient.resolve({
|
|
97
|
-
appId,
|
|
98
|
-
version: options?.version,
|
|
99
|
-
registryUrl
|
|
100
|
-
});
|
|
101
|
-
if (resolution.version === appRecord.activeVersion) {
|
|
102
|
-
if (!activeVersionRecord) throw new Error(`已安装应用缺少激活版本:${appId}`);
|
|
103
|
-
return {
|
|
104
|
-
appId: appRecord.appId,
|
|
105
|
-
name: appRecord.name,
|
|
106
|
-
version: appRecord.activeVersion,
|
|
107
|
-
previousVersion: appRecord.activeVersion,
|
|
108
|
-
installDirectory: activeVersionRecord.installDirectory,
|
|
109
|
-
dataDirectory: appRecord.dataDirectory,
|
|
110
|
-
sourceKind: activeVersionRecord.sourceKind,
|
|
111
|
-
sourceRef: activeVersionRecord.sourceRef,
|
|
112
|
-
permissions: activeVersionRecord.permissions,
|
|
113
|
-
registryUrl: activeVersionRecord.registryUrl,
|
|
114
|
-
bundleUrl: activeVersionRecord.bundleUrl,
|
|
115
|
-
sha256: activeVersionRecord.sha256,
|
|
116
|
-
publisher: activeVersionRecord.publisher,
|
|
117
|
-
updated: false
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
return {
|
|
121
|
-
...await this.install(`${appId}@${resolution.version}`, { registryUrl }),
|
|
122
|
-
previousVersion: appRecord.activeVersion,
|
|
123
|
-
updated: true
|
|
124
|
-
};
|
|
125
|
-
};
|
|
126
|
-
uninstall = async (appId, purgeData) => {
|
|
127
|
-
const appRecord = await this.registryService.removeApp(appId);
|
|
128
|
-
if (!appRecord) throw new Error(`未找到已安装应用:${appId}`);
|
|
129
|
-
const removedVersions = Object.keys(appRecord.installedVersions).sort((left, right) => left.localeCompare(right));
|
|
130
|
-
await Promise.all(Object.values(appRecord.installedVersions).map((versionRecord) => rm(versionRecord.installDirectory, {
|
|
131
|
-
recursive: true,
|
|
132
|
-
force: true
|
|
133
|
-
})));
|
|
134
|
-
if (purgeData) await rm(appRecord.dataDirectory, {
|
|
135
|
-
recursive: true,
|
|
136
|
-
force: true
|
|
137
|
-
});
|
|
138
|
-
return {
|
|
139
|
-
appId,
|
|
140
|
-
removedVersions,
|
|
141
|
-
dataRemoved: purgeData
|
|
142
|
-
};
|
|
143
|
-
};
|
|
144
|
-
list = async () => {
|
|
145
|
-
return (await this.registryService.listApps()).map((appRecord) => ({
|
|
146
|
-
appId: appRecord.appId,
|
|
147
|
-
name: appRecord.name,
|
|
148
|
-
activeVersion: appRecord.activeVersion,
|
|
149
|
-
sourceKind: appRecord.installedVersions[appRecord.activeVersion]?.sourceKind ?? "directory",
|
|
150
|
-
distributionMode: appRecord.installedVersions[appRecord.activeVersion]?.distributionMode
|
|
151
|
-
}));
|
|
152
|
-
};
|
|
153
|
-
info = async (appId) => {
|
|
154
|
-
const appRecord = await this.registryService.getApp(appId);
|
|
155
|
-
if (!appRecord) throw new Error(`未找到已安装应用:${appId}`);
|
|
156
|
-
const installedVersions = Object.values(appRecord.installedVersions).sort((left, right) => left.version.localeCompare(right.version));
|
|
157
|
-
return {
|
|
158
|
-
appId: appRecord.appId,
|
|
159
|
-
name: appRecord.name,
|
|
160
|
-
description: appRecord.description,
|
|
161
|
-
activeVersion: appRecord.activeVersion,
|
|
162
|
-
dataDirectory: appRecord.dataDirectory,
|
|
163
|
-
installedVersions: installedVersions.map((versionRecord) => ({
|
|
164
|
-
version: versionRecord.version,
|
|
165
|
-
installDirectory: versionRecord.installDirectory,
|
|
166
|
-
sourceKind: versionRecord.sourceKind,
|
|
167
|
-
distributionMode: versionRecord.distributionMode,
|
|
168
|
-
sourceRef: versionRecord.sourceRef,
|
|
169
|
-
installedAt: versionRecord.installedAt,
|
|
170
|
-
permissions: versionRecord.permissions,
|
|
171
|
-
registryUrl: versionRecord.registryUrl,
|
|
172
|
-
bundleUrl: versionRecord.bundleUrl,
|
|
173
|
-
sha256: versionRecord.sha256,
|
|
174
|
-
publisher: versionRecord.publisher
|
|
175
|
-
})),
|
|
176
|
-
grants: appRecord.grants
|
|
177
|
-
};
|
|
178
|
-
};
|
|
179
|
-
resolveLaunch = async (appReference, explicitDocumentGrantMap) => {
|
|
180
|
-
const sourceType = await this.detectLocalSourceType(appReference, false);
|
|
181
|
-
if (sourceType.kind === "directory") return {
|
|
182
|
-
appDirectory: sourceType.appDirectory,
|
|
183
|
-
documentGrantMap: explicitDocumentGrantMap
|
|
184
|
-
};
|
|
185
|
-
const appRecord = await this.registryService.getApp(appReference);
|
|
186
|
-
if (!appRecord) throw new Error(`未找到应用目录,也未找到已安装应用:${appReference}`);
|
|
187
|
-
const activeVersion = appRecord.installedVersions[appRecord.activeVersion];
|
|
188
|
-
if (!activeVersion) throw new Error(`已安装应用缺少激活版本:${appReference}`);
|
|
189
|
-
return {
|
|
190
|
-
appDirectory: activeVersion.installDirectory,
|
|
191
|
-
appId: appRecord.appId,
|
|
192
|
-
dataDirectory: appRecord.dataDirectory,
|
|
193
|
-
documentGrantMap: {
|
|
194
|
-
...appRecord.grants,
|
|
195
|
-
...explicitDocumentGrantMap
|
|
196
|
-
}
|
|
197
|
-
};
|
|
198
|
-
};
|
|
199
|
-
persistGrants = async (appId, documentGrantMap) => {
|
|
200
|
-
if (!appId || Object.keys(documentGrantMap).length === 0) return;
|
|
201
|
-
await this.registryService.updateGrants(appId, documentGrantMap);
|
|
202
|
-
};
|
|
203
|
-
resolveInstallSource = async (appSource, registryUrl) => {
|
|
204
|
-
const localSource = await this.detectLocalSourceType(appSource);
|
|
205
|
-
if (localSource.kind === "directory") return {
|
|
206
|
-
kind: "directory",
|
|
207
|
-
appDirectory: localSource.appDirectory,
|
|
208
|
-
sourceRef: localSource.appDirectory
|
|
209
|
-
};
|
|
210
|
-
if (localSource.kind === "bundle") return {
|
|
211
|
-
kind: "bundle",
|
|
212
|
-
bundlePath: localSource.bundlePath,
|
|
213
|
-
sourceRef: localSource.bundlePath
|
|
214
|
-
};
|
|
215
|
-
const registrySpec = this.parseRegistrySpec(appSource);
|
|
216
|
-
if (!registrySpec) {
|
|
217
|
-
if (this.looksLikePath(appSource)) throw new Error(`本地安装源不存在:${appSource}`);
|
|
218
|
-
throw new Error(`无法识别安装源:${appSource}`);
|
|
219
|
-
}
|
|
220
|
-
const registryResolution = await this.remoteRegistryClient.resolve({
|
|
221
|
-
appId: registrySpec.appId,
|
|
222
|
-
version: registrySpec.version,
|
|
223
|
-
registryUrl
|
|
224
|
-
});
|
|
225
|
-
return {
|
|
226
|
-
kind: "registry",
|
|
227
|
-
sourceRef: `${registryResolution.appId}@${registryResolution.version}`,
|
|
228
|
-
registryResolution
|
|
229
|
-
};
|
|
230
|
-
};
|
|
231
|
-
detectLocalSourceType = async (sourcePath, allowBundle = true) => {
|
|
232
|
-
const normalizedSource = path.resolve(sourcePath);
|
|
233
|
-
try {
|
|
234
|
-
await access(normalizedSource);
|
|
235
|
-
if ((await this.manifestService.load(normalizedSource)).appDirectory) return {
|
|
236
|
-
kind: "directory",
|
|
237
|
-
appDirectory: normalizedSource
|
|
238
|
-
};
|
|
239
|
-
} catch {
|
|
240
|
-
if (allowBundle && normalizedSource.endsWith(".napp")) try {
|
|
241
|
-
await access(normalizedSource);
|
|
242
|
-
return {
|
|
243
|
-
kind: "bundle",
|
|
244
|
-
bundlePath: normalizedSource
|
|
245
|
-
};
|
|
246
|
-
} catch {
|
|
247
|
-
return { kind: "missing" };
|
|
248
|
-
}
|
|
249
|
-
return { kind: "missing" };
|
|
250
|
-
}
|
|
251
|
-
return { kind: "missing" };
|
|
252
|
-
};
|
|
253
|
-
parseRegistrySpec = (appSource) => {
|
|
254
|
-
const match = /^(?<appId>[a-z0-9][a-z0-9._-]*)(?:@(?<version>[A-Za-z0-9._+-]+))?$/i.exec(appSource.trim());
|
|
255
|
-
if (!match?.groups?.appId) return;
|
|
256
|
-
return {
|
|
257
|
-
appId: match.groups.appId,
|
|
258
|
-
version: match.groups.version
|
|
259
|
-
};
|
|
260
|
-
};
|
|
261
|
-
looksLikePath = (appSource) => {
|
|
262
|
-
return appSource.startsWith(".") || appSource.startsWith("/") || appSource.includes(path.sep);
|
|
263
|
-
};
|
|
264
|
-
materializeDistribution = async (params) => {
|
|
265
|
-
if (params.distributionMode !== "source") return;
|
|
266
|
-
if ((await this.manifestService.load(params.appDirectory)).manifest.main.kind !== "wasi-http-component") return;
|
|
267
|
-
await this.buildService.build({
|
|
268
|
-
appDirectory: params.appDirectory,
|
|
269
|
-
install: true
|
|
270
|
-
});
|
|
271
|
-
};
|
|
272
|
-
};
|
|
273
|
-
//#endregion
|
|
274
|
-
export { AppInstallationService };
|
|
275
|
-
|
|
276
|
-
//# sourceMappingURL=app-installation.service.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"app-installation.service.js","names":[],"sources":["../../src/install/app-installation.service.ts"],"sourcesContent":["import { access, cp, mkdir, rm } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { AppBundleService } from \"../bundle/app-bundle.service.js\";\nimport { AppManifestService } from \"../manifest/app-manifest.service.js\";\nimport { AppHomeService } from \"../paths/app-home.service.js\";\nimport { AppBuildService } from \"../runtime/app-build.service.js\";\nimport type { AppDistributionMode } from \"../bundle/app-bundle.types.js\";\nimport type { AppDocumentGrantMap } from \"../permissions/app-permissions.types.js\";\nimport { AppRegistryConfigService } from \"../registry/app-registry-config.service.js\";\nimport { AppRemoteRegistryClientService } from \"../registry/app-remote-registry-client.service.js\";\nimport { AppRegistryService } from \"../registry/app-registry.service.js\";\nimport type {\n AppInfoResult,\n AppInstallResult,\n AppLaunchResolution,\n AppUpdateResult,\n AppUninstallResult,\n InstalledAppListItem,\n} from \"./app-installation.types.js\";\n\nexport class AppInstallationService {\n constructor(\n private readonly appHomeService: AppHomeService = new AppHomeService(),\n private readonly bundleService: AppBundleService = new AppBundleService(),\n private readonly manifestService: AppManifestService = new AppManifestService(),\n private readonly buildService: AppBuildService = new AppBuildService(),\n private readonly registryService: AppRegistryService = new AppRegistryService(appHomeService),\n private readonly registryConfigService: AppRegistryConfigService = new AppRegistryConfigService(\n appHomeService,\n ),\n private readonly remoteRegistryClient: AppRemoteRegistryClientService = new AppRemoteRegistryClientService(\n new AppRegistryConfigService(appHomeService),\n ),\n ) {}\n\n install = async (\n appSource: string,\n options?: {\n registryUrl?: string;\n },\n ): Promise<AppInstallResult> => {\n const source = await this.resolveInstallSource(appSource, options?.registryUrl);\n const tempDirectory = await this.appHomeService.createTemporaryDirectory(\"napp-install-\");\n try {\n const bundlePath =\n source.kind === \"directory\"\n ? (await this.bundleService.packAppDirectory({\n appDirectory: source.appDirectory,\n outputPath: path.join(tempDirectory, \"app.napp\"),\n })).bundlePath\n : source.kind === \"bundle\"\n ? source.bundlePath\n : (\n await this.remoteRegistryClient.downloadBundle({\n resolution: source.registryResolution,\n targetDirectory: tempDirectory,\n })\n ).bundlePath;\n const extractedDirectory = path.join(tempDirectory, \"bundle\");\n const extractedMetadata = await this.bundleService.extractBundle({\n bundlePath,\n targetDirectory: extractedDirectory,\n });\n await this.materializeDistribution({\n appDirectory: extractedDirectory,\n distributionMode: extractedMetadata.metadata.distributionMode,\n });\n const manifestBundle = await this.manifestService.load(extractedDirectory);\n const installDirectory = this.appHomeService.getInstallDirectory(\n manifestBundle.manifest.id,\n manifestBundle.manifest.version,\n );\n if (\n source.kind === \"registry\" &&\n manifestBundle.manifest.id !== source.registryResolution.appId\n ) {\n throw new Error(\n `bundle manifest.appId 与 registry 请求不一致:期望 ${source.registryResolution.appId},实际 ${manifestBundle.manifest.id}`,\n );\n }\n const dataDirectory = this.appHomeService.getAppDataDirectory(manifestBundle.manifest.id);\n await rm(installDirectory, { recursive: true, force: true });\n await mkdir(path.dirname(installDirectory), { recursive: true });\n await mkdir(dataDirectory, { recursive: true });\n await cp(extractedDirectory, installDirectory, { recursive: true });\n const registryRecord = await this.registryService.upsertInstallation({\n appId: manifestBundle.manifest.id,\n name: manifestBundle.manifest.name,\n description: manifestBundle.manifest.description,\n version: manifestBundle.manifest.version,\n installDirectory,\n dataDirectory,\n sourceKind: source.kind,\n distributionMode:\n source.kind === \"registry\"\n ? source.registryResolution.distributionMode\n : extractedMetadata.metadata.distributionMode,\n sourceRef: source.sourceRef,\n installedAt: new Date().toISOString(),\n permissions: manifestBundle.manifest.permissions ?? {},\n registryUrl:\n source.kind === \"registry\" ? source.registryResolution.registryUrl : undefined,\n bundleUrl:\n source.kind === \"registry\" ? source.registryResolution.bundleUrl : undefined,\n sha256: source.kind === \"registry\" ? source.registryResolution.sha256 : undefined,\n publisher:\n source.kind === \"registry\" ? source.registryResolution.publisher : undefined,\n });\n return {\n appId: registryRecord.appId,\n name: registryRecord.name,\n version: registryRecord.activeVersion,\n installDirectory,\n dataDirectory,\n sourceKind: source.kind,\n sourceRef: source.sourceRef,\n distributionMode:\n registryRecord.installedVersions[registryRecord.activeVersion]?.distributionMode,\n permissions:\n registryRecord.installedVersions[registryRecord.activeVersion]?.permissions ?? {},\n registryUrl:\n registryRecord.installedVersions[registryRecord.activeVersion]?.registryUrl,\n bundleUrl:\n registryRecord.installedVersions[registryRecord.activeVersion]?.bundleUrl,\n sha256: registryRecord.installedVersions[registryRecord.activeVersion]?.sha256,\n publisher:\n registryRecord.installedVersions[registryRecord.activeVersion]?.publisher,\n };\n } finally {\n await rm(tempDirectory, { recursive: true, force: true });\n }\n };\n\n update = async (\n appId: string,\n options?: {\n version?: string;\n registryUrl?: string;\n },\n ): Promise<AppUpdateResult> => {\n const appRecord = await this.registryService.getApp(appId);\n if (!appRecord) {\n throw new Error(`未找到已安装应用:${appId}`);\n }\n const activeVersionRecord = appRecord.installedVersions[appRecord.activeVersion];\n const registryUrl =\n options?.registryUrl ??\n activeVersionRecord?.registryUrl ??\n (await this.registryConfigService.getSnapshot()).currentUrl;\n const resolution = await this.remoteRegistryClient.resolve({\n appId,\n version: options?.version,\n registryUrl,\n });\n if (resolution.version === appRecord.activeVersion) {\n if (!activeVersionRecord) {\n throw new Error(`已安装应用缺少激活版本:${appId}`);\n }\n return {\n appId: appRecord.appId,\n name: appRecord.name,\n version: appRecord.activeVersion,\n previousVersion: appRecord.activeVersion,\n installDirectory: activeVersionRecord.installDirectory,\n dataDirectory: appRecord.dataDirectory,\n sourceKind: activeVersionRecord.sourceKind,\n sourceRef: activeVersionRecord.sourceRef,\n permissions: activeVersionRecord.permissions,\n registryUrl: activeVersionRecord.registryUrl,\n bundleUrl: activeVersionRecord.bundleUrl,\n sha256: activeVersionRecord.sha256,\n publisher: activeVersionRecord.publisher,\n updated: false,\n };\n }\n const installResult = await this.install(`${appId}@${resolution.version}`, {\n registryUrl,\n });\n return {\n ...installResult,\n previousVersion: appRecord.activeVersion,\n updated: true,\n };\n };\n\n uninstall = async (\n appId: string,\n purgeData: boolean,\n ): Promise<AppUninstallResult> => {\n const appRecord = await this.registryService.removeApp(appId);\n if (!appRecord) {\n throw new Error(`未找到已安装应用:${appId}`);\n }\n const removedVersions = Object.keys(appRecord.installedVersions).sort((left, right) =>\n left.localeCompare(right),\n );\n await Promise.all(\n Object.values(appRecord.installedVersions).map((versionRecord) =>\n rm(versionRecord.installDirectory, { recursive: true, force: true }),\n ),\n );\n if (purgeData) {\n await rm(appRecord.dataDirectory, { recursive: true, force: true });\n }\n return {\n appId,\n removedVersions,\n dataRemoved: purgeData,\n };\n };\n\n list = async (): Promise<InstalledAppListItem[]> => {\n const appRecords = await this.registryService.listApps();\n return appRecords.map((appRecord) => ({\n appId: appRecord.appId,\n name: appRecord.name,\n activeVersion: appRecord.activeVersion,\n sourceKind:\n appRecord.installedVersions[appRecord.activeVersion]?.sourceKind ?? \"directory\",\n distributionMode:\n appRecord.installedVersions[appRecord.activeVersion]?.distributionMode,\n }));\n };\n\n info = async (appId: string): Promise<AppInfoResult> => {\n const appRecord = await this.registryService.getApp(appId);\n if (!appRecord) {\n throw new Error(`未找到已安装应用:${appId}`);\n }\n const installedVersions = Object.values(appRecord.installedVersions).sort((left, right) =>\n left.version.localeCompare(right.version),\n );\n return {\n appId: appRecord.appId,\n name: appRecord.name,\n description: appRecord.description,\n activeVersion: appRecord.activeVersion,\n dataDirectory: appRecord.dataDirectory,\n installedVersions: installedVersions.map((versionRecord) => ({\n version: versionRecord.version,\n installDirectory: versionRecord.installDirectory,\n sourceKind: versionRecord.sourceKind,\n distributionMode: versionRecord.distributionMode,\n sourceRef: versionRecord.sourceRef,\n installedAt: versionRecord.installedAt,\n permissions: versionRecord.permissions,\n registryUrl: versionRecord.registryUrl,\n bundleUrl: versionRecord.bundleUrl,\n sha256: versionRecord.sha256,\n publisher: versionRecord.publisher,\n })),\n grants: appRecord.grants,\n };\n };\n\n resolveLaunch = async (\n appReference: string,\n explicitDocumentGrantMap: AppDocumentGrantMap,\n ): Promise<AppLaunchResolution> => {\n const sourceType = await this.detectLocalSourceType(appReference, false);\n if (sourceType.kind === \"directory\") {\n return {\n appDirectory: sourceType.appDirectory,\n documentGrantMap: explicitDocumentGrantMap,\n };\n }\n const appRecord = await this.registryService.getApp(appReference);\n if (!appRecord) {\n throw new Error(`未找到应用目录,也未找到已安装应用:${appReference}`);\n }\n const activeVersion = appRecord.installedVersions[appRecord.activeVersion];\n if (!activeVersion) {\n throw new Error(`已安装应用缺少激活版本:${appReference}`);\n }\n return {\n appDirectory: activeVersion.installDirectory,\n appId: appRecord.appId,\n dataDirectory: appRecord.dataDirectory,\n documentGrantMap: {\n ...appRecord.grants,\n ...explicitDocumentGrantMap,\n },\n };\n };\n\n persistGrants = async (\n appId: string | undefined,\n documentGrantMap: AppDocumentGrantMap,\n ): Promise<void> => {\n if (!appId || Object.keys(documentGrantMap).length === 0) {\n return;\n }\n await this.registryService.updateGrants(appId, documentGrantMap);\n };\n\n private resolveInstallSource = async (\n appSource: string,\n registryUrl?: string,\n ): Promise<\n | {\n kind: \"directory\";\n appDirectory: string;\n sourceRef: string;\n }\n | {\n kind: \"bundle\";\n bundlePath: string;\n sourceRef: string;\n }\n | {\n kind: \"registry\";\n sourceRef: string;\n registryResolution: Awaited<ReturnType<AppRemoteRegistryClientService[\"resolve\"]>>;\n }\n > => {\n const localSource = await this.detectLocalSourceType(appSource);\n if (localSource.kind === \"directory\") {\n return {\n kind: \"directory\",\n appDirectory: localSource.appDirectory,\n sourceRef: localSource.appDirectory,\n };\n }\n if (localSource.kind === \"bundle\") {\n return {\n kind: \"bundle\",\n bundlePath: localSource.bundlePath,\n sourceRef: localSource.bundlePath,\n };\n }\n const registrySpec = this.parseRegistrySpec(appSource);\n if (!registrySpec) {\n if (this.looksLikePath(appSource)) {\n throw new Error(`本地安装源不存在:${appSource}`);\n }\n throw new Error(`无法识别安装源:${appSource}`);\n }\n const registryResolution = await this.remoteRegistryClient.resolve({\n appId: registrySpec.appId,\n version: registrySpec.version,\n registryUrl,\n });\n return {\n kind: \"registry\",\n sourceRef: `${registryResolution.appId}@${registryResolution.version}`,\n registryResolution,\n };\n };\n\n private detectLocalSourceType = async (\n sourcePath: string,\n allowBundle: boolean = true,\n ): Promise<\n | {\n kind: \"directory\";\n appDirectory: string;\n }\n | {\n kind: \"bundle\";\n bundlePath: string;\n }\n | {\n kind: \"missing\";\n }\n > => {\n const normalizedSource = path.resolve(sourcePath);\n try {\n await access(normalizedSource);\n const manifestBundle = await this.manifestService.load(normalizedSource);\n if (manifestBundle.appDirectory) {\n return {\n kind: \"directory\",\n appDirectory: normalizedSource,\n };\n }\n } catch {\n if (allowBundle && normalizedSource.endsWith(\".napp\")) {\n try {\n await access(normalizedSource);\n return {\n kind: \"bundle\",\n bundlePath: normalizedSource,\n };\n } catch {\n return {\n kind: \"missing\",\n };\n }\n }\n return {\n kind: \"missing\",\n };\n }\n return {\n kind: \"missing\",\n };\n };\n\n private parseRegistrySpec = (\n appSource: string,\n ): {\n appId: string;\n version?: string;\n } | undefined => {\n const match = /^(?<appId>[a-z0-9][a-z0-9._-]*)(?:@(?<version>[A-Za-z0-9._+-]+))?$/i.exec(\n appSource.trim(),\n );\n if (!match?.groups?.appId) {\n return undefined;\n }\n return {\n appId: match.groups.appId,\n version: match.groups.version,\n };\n };\n\n private looksLikePath = (appSource: string): boolean => {\n return (\n appSource.startsWith(\".\") ||\n appSource.startsWith(\"/\") ||\n appSource.includes(path.sep)\n );\n };\n\n private materializeDistribution = async (params: {\n appDirectory: string;\n distributionMode: AppDistributionMode;\n }): Promise<void> => {\n if (params.distributionMode !== \"source\") {\n return;\n }\n const manifestBundle = await this.manifestService.load(params.appDirectory);\n if (manifestBundle.manifest.main.kind !== \"wasi-http-component\") {\n return;\n }\n await this.buildService.build({\n appDirectory: params.appDirectory,\n install: true,\n });\n };\n}\n"],"mappings":";;;;;;;;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,gBAAgB,KAAK,iBAAiB,EACrD,aACjB,QAAO;IACL,MAAM;IACN,cAAc;IACf;UAEG;AACN,OAAI,eAAe,iBAAiB,SAAS,QAAQ,CACnD,KAAI;AACF,UAAM,OAAO,iBAAiB;AAC9B,WAAO;KACL,MAAM;KACN,YAAY;KACb;WACK;AACN,WAAO,EACL,MAAM,WACP;;AAGL,UAAO,EACL,MAAM,WACP;;AAEH,SAAO,EACL,MAAM,WACP;;CAGH,qBACE,cAIe;EACf,MAAM,QAAQ,sEAAsE,KAClF,UAAU,MAAM,CACjB;AACD,MAAI,CAAC,OAAO,QAAQ,MAClB;AAEF,SAAO;GACL,OAAO,MAAM,OAAO;GACpB,SAAS,MAAM,OAAO;GACvB;;CAGH,iBAAyB,cAA+B;AACtD,SACE,UAAU,WAAW,IAAI,IACzB,UAAU,WAAW,IAAI,IACzB,UAAU,SAAS,KAAK,IAAI;;CAIhC,0BAAkC,OAAO,WAGpB;AACnB,MAAI,OAAO,qBAAqB,SAC9B;AAGF,OADuB,MAAM,KAAK,gBAAgB,KAAK,OAAO,aAAa,EACxD,SAAS,KAAK,SAAS,sBACxC;AAEF,QAAM,KAAK,aAAa,MAAM;GAC5B,cAAc,OAAO;GACrB,SAAS;GACV,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"app-installation.types.d.ts","names":[],"sources":["../../src/install/app-installation.types.ts"],"mappings":";;;;;;;KAMY,gBAAA;EACV,KAAA;EACA,IAAA;EACA,OAAA;EACA,gBAAA;EACA,aAAA;EACA,UAAA,EAAY,oBAAA;EACZ,gBAAA,GAAmB,mBAAA;EACnB,SAAA;EACA,WAAA,EAAa,cAAA;EACb,WAAA;EACA,SAAA;EACA,MAAA;EACA,SAAA,GAAY,YAAA;AAAA;AAAA,KAGF,aAAA;EACV,KAAA;EACA,IAAA;EACA,WAAA;EACA,aAAA;EACA,aAAA;EACA,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,SAAA,GAAY,YAAA;EAAA;EAEd,MAAA,EAAQ,mBAAA;AAAA;AAAA,KAGE,oBAAA;EACV,KAAA;EACA,IAAA;EACA,aAAA;EACA,UAAA,EAAY,oBAAA;EACZ,gBAAA,GAAmB,mBAAA;AAAA;AAAA,KAGT,kBAAA;EACV,KAAA;EACA,eAAA;EACA,WAAA;AAAA;AAAA,KAGU,mBAAA;EACV,YAAA;EACA,KAAA;EACA,aAAA;EACA,gBAAA,EAAkB,mBAAA;AAAA;AAAA,KAGR,eAAA,GAAkB,gBAAA;EAC5B,eAAA;EACA,OAAA;AAAA"}
|
package/dist/main.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","names":[],"sources":["../src/main.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { AppRuntimeCliService } from \"./cli/app-runtime-cli.service.js\";\n\nvoid new AppRuntimeCliService().run().catch((error) => {\n process.stderr.write(`${error instanceof Error ? error.message : String(error)}\\n`);\n process.exit(1);\n});\n"],"mappings":";;;AAIK,IAAI,sBAAsB,CAAC,KAAK,CAAC,OAAO,UAAU;AACrD,SAAQ,OAAO,MAAM,GAAG,iBAAiB,QAAQ,MAAM,UAAU,OAAO,MAAM,CAAC,IAAI;AACnF,SAAQ,KAAK,EAAE;EACf"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"app-manifest.service.d.ts","names":[],"sources":["../../src/manifest/app-manifest.service.ts"],"mappings":";;;cAUa,kBAAA;EACX,IAAA,GAAc,YAAA,aAAuB,OAAA,CAAQ,iBAAA;EAiC7C,SAAA,GAAa,MAAA,EAAQ,iBAAA,KAAoB,kBAAA;EAAA,QAiBjC,aAAA;EAAA,QA0BA,SAAA;EAAA,QAoBA,OAAA;EAAA,QAOA,gBAAA;EAAA,QAaA,mBAAA;EAAA,QA+BA,gBAAA;EAAA,QAeA,YAAA;EAAA,QAeA,iBAAA;EAAA,QAeA,kBAAA;EAAA,QAiBA,YAAA;EAAA,QAOA,kBAAA;EAAA,QAOA,kBAAA;EAAA,QAOA,UAAA;EAAA,QAOA,WAAA;AAAA"}
|