nextclaw 0.44.2 → 0.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/app/index.js +2 -2
- package/dist/cli/launcher/index.js +1 -1
- package/dist/{nextclaw-cli-app-B_ffeXOD.js → nextclaw-cli-app-Bwa2L2Jv.js} +115 -22
- package/dist/nextclaw-cli-app-Bwa2L2Jv.js.map +1 -0
- package/dist/{nextclaw-distribution.utils-BneKclXo.js → nextclaw-distribution.utils-Bba2GRvc.js} +4 -2
- package/dist/nextclaw-distribution.utils-Bba2GRvc.js.map +1 -0
- package/package.json +10 -10
- package/resources/apps/nextclaw-portable-runtime-lab/README.md +34 -0
- package/resources/apps/nextclaw-portable-runtime-lab/assets/icon.svg +12 -0
- package/resources/apps/nextclaw-portable-runtime-lab/manifest.json +74 -0
- package/resources/apps/nextclaw-portable-runtime-lab/marketplace.json +21 -0
- package/resources/apps/nextclaw-portable-runtime-lab/panels/nextclaw-portable-runtime-lab-contacts.panel/assets/app.js +92 -0
- package/resources/apps/nextclaw-portable-runtime-lab/panels/nextclaw-portable-runtime-lab-contacts.panel/assets/style.css +43 -0
- package/resources/apps/nextclaw-portable-runtime-lab/panels/nextclaw-portable-runtime-lab-contacts.panel/index.html +43 -0
- package/resources/apps/nextclaw-portable-runtime-lab/panels/nextclaw-portable-runtime-lab-contacts.panel/panel-app.json +10 -0
- package/resources/apps/nextclaw-portable-runtime-lab/panels/nextclaw-portable-runtime-lab-focus.panel/assets/app.js +132 -0
- package/resources/apps/nextclaw-portable-runtime-lab/panels/nextclaw-portable-runtime-lab-focus.panel/assets/style.css +39 -0
- package/resources/apps/nextclaw-portable-runtime-lab/panels/nextclaw-portable-runtime-lab-focus.panel/index.html +40 -0
- package/resources/apps/nextclaw-portable-runtime-lab/panels/nextclaw-portable-runtime-lab-focus.panel/panel-app.json +14 -0
- package/resources/apps/nextclaw-portable-runtime-lab/panels/nextclaw-portable-runtime-lab-notes.panel/assets/app.js +117 -0
- package/resources/apps/nextclaw-portable-runtime-lab/panels/nextclaw-portable-runtime-lab-notes.panel/assets/style.css +41 -0
- package/resources/apps/nextclaw-portable-runtime-lab/panels/nextclaw-portable-runtime-lab-notes.panel/index.html +41 -0
- package/resources/apps/nextclaw-portable-runtime-lab/panels/nextclaw-portable-runtime-lab-notes.panel/panel-app.json +12 -0
- package/resources/apps/nextclaw-portable-runtime-lab/panels/nextclaw-portable-runtime-lab-panel.panel/assets/app.js +266 -0
- package/resources/apps/nextclaw-portable-runtime-lab/panels/nextclaw-portable-runtime-lab-panel.panel/assets/style.css +87 -0
- package/resources/apps/nextclaw-portable-runtime-lab/panels/nextclaw-portable-runtime-lab-panel.panel/index.html +154 -0
- package/resources/apps/nextclaw-portable-runtime-lab/panels/nextclaw-portable-runtime-lab-panel.panel/panel-app.json +29 -0
- package/resources/apps/nextclaw-portable-runtime-lab/panels/nextclaw-portable-runtime-lab-todos.panel/assets/app.js +143 -0
- package/resources/apps/nextclaw-portable-runtime-lab/panels/nextclaw-portable-runtime-lab-todos.panel/assets/style.css +48 -0
- package/resources/apps/nextclaw-portable-runtime-lab/panels/nextclaw-portable-runtime-lab-todos.panel/index.html +45 -0
- package/resources/apps/nextclaw-portable-runtime-lab/panels/nextclaw-portable-runtime-lab-todos.panel/panel-app.json +12 -0
- package/resources/apps/nextclaw-portable-runtime-lab/service-components/nextclaw-portable-runtime-lab-capabilities/service-app.json +20 -0
- package/resources/apps/nextclaw-portable-runtime-lab/service-components/nextclaw-portable-runtime-lab-capabilities/service.wasm +0 -0
- package/resources/apps/nextclaw-portable-runtime-lab/service-components/nextclaw-portable-runtime-lab-composition/service-app.json +30 -0
- package/resources/apps/nextclaw-portable-runtime-lab/service-components/nextclaw-portable-runtime-lab-composition/service.wasm +0 -0
- package/resources/apps/nextclaw-portable-runtime-lab/service-components/nextclaw-portable-runtime-lab-provider/service-app.json +30 -0
- package/resources/apps/nextclaw-portable-runtime-lab/service-components/nextclaw-portable-runtime-lab-provider/service.wasm +0 -0
- package/resources/apps/nextclaw-portable-runtime-lab/service-components/nextclaw-portable-runtime-lab-resident/service-app.json +31 -0
- package/resources/apps/nextclaw-portable-runtime-lab/service-components/nextclaw-portable-runtime-lab-resident/service.wasm +0 -0
- package/resources/apps/nextclaw-portable-runtime-lab/service-components/nextclaw-portable-runtime-lab-state/service-app.json +49 -0
- package/resources/apps/nextclaw-portable-runtime-lab/service-components/nextclaw-portable-runtime-lab-state/service.wasm +0 -0
- package/ui-dist/assets/{api-DNLQPHfQ.js → api-m33O1Kb0.js} +3 -3
- package/ui-dist/assets/api-m33O1Kb0.js.gz +0 -0
- package/ui-dist/assets/{appearance-settings-page-BlAFMOGV.js → appearance-settings-page-x4Vjnfmz.js} +1 -1
- package/ui-dist/assets/appearance-settings-page-x4Vjnfmz.js.gz +0 -0
- package/ui-dist/assets/{book-open-BryfPTTa.js → book-open-BHiasMCg.js} +1 -1
- package/ui-dist/assets/{channels-list-page-Cfbgubyv.js → channels-list-page-DOxJZeXq.js} +1 -1
- package/ui-dist/assets/channels-list-page-DOxJZeXq.js.gz +0 -0
- package/ui-dist/assets/{config-split-page-Dd8xG0Jk.js → config-split-page-DBnMEP1o.js} +1 -1
- package/ui-dist/assets/config-split-page-DBnMEP1o.js.gz +0 -0
- package/ui-dist/assets/{confirm-dialog-CZIWjnJ6.js → confirm-dialog-f5NKLh5I.js} +2 -2
- package/ui-dist/assets/confirm-dialog-f5NKLh5I.js.gz +0 -0
- package/ui-dist/assets/{createLucideIcon-BxwVe8ZD.js → createLucideIcon-CHALGA42.js} +1 -1
- package/ui-dist/assets/{desktop-capabilities-page-C6YxsHeV.js → desktop-capabilities-page-DixayAe6.js} +1 -1
- package/ui-dist/assets/desktop-capabilities-page-DixayAe6.js.gz +0 -0
- package/ui-dist/assets/{desktop-update-config-BVN4QPJn.js → desktop-update-config-ChhfeOHj.js} +1 -1
- package/ui-dist/assets/desktop-update-config-ChhfeOHj.js.gz +0 -0
- package/ui-dist/assets/{dist-Cd8Nm3BW.js → dist-_UMsWSY0.js} +1 -1
- package/ui-dist/assets/{dist-Cd8Nm3BW.js.gz → dist-_UMsWSY0.js.gz} +0 -0
- package/ui-dist/assets/{dist-BRloKr3S.js → dist-sD6V4nHX.js} +1 -1
- package/ui-dist/assets/dist-sD6V4nHX.js.gz +0 -0
- package/ui-dist/assets/doc-browser-Bq7LJsQY.js +1 -0
- package/ui-dist/assets/doc-browser-Bq7LJsQY.js.gz +0 -0
- package/ui-dist/assets/doc-browser-BuDgpY2e.js +1 -0
- package/ui-dist/assets/{doc-browser-context-3JGufiMA.js → doc-browser-context-Capim3og.js} +1 -1
- package/ui-dist/assets/doc-browser-context-Capim3og.js.gz +0 -0
- package/ui-dist/assets/{extensions-Dedd2oDI.js → extensions-Bdclr3Wr.js} +1 -1
- package/ui-dist/assets/extensions-Bdclr3Wr.js.gz +0 -0
- package/ui-dist/assets/{form-actions-FWCEof3V.js → form-actions-CH0kWhEt.js} +1 -1
- package/ui-dist/assets/index-BjxnLYE3.js +109 -0
- package/ui-dist/assets/index-BjxnLYE3.js.gz +0 -0
- package/ui-dist/assets/index-CBmwJjwE.css +1 -0
- package/ui-dist/assets/index-CBmwJjwE.css.gz +0 -0
- package/ui-dist/assets/loader-circle-CH_0iPLy.js +1 -0
- package/ui-dist/assets/{mcp-marketplace-page-e9Rmfz-d.js → mcp-marketplace-page-BUsxLVB5.js} +2 -2
- package/ui-dist/assets/mcp-marketplace-page-BUsxLVB5.js.gz +0 -0
- package/ui-dist/assets/mcp-marketplace-page-GPRV3fB0.js +1 -0
- package/ui-dist/assets/{model-config-page-C173Ssil.js → model-config-page-CIevwqp4.js} +1 -1
- package/ui-dist/assets/model-config-page-CIevwqp4.js.gz +0 -0
- package/ui-dist/assets/{navigation-link-DTPOvGGL.js → navigation-link-CAUiM3zS.js} +1 -1
- package/ui-dist/assets/navigation-link-CAUiM3zS.js.gz +0 -0
- package/ui-dist/assets/plus-B3obD55V.js +1 -0
- package/ui-dist/assets/{privacy-settings-page-CRserBVF.js → privacy-settings-page-CNKfZsYH.js} +1 -1
- package/ui-dist/assets/privacy-settings-page-CNKfZsYH.js.gz +0 -0
- package/ui-dist/assets/{providers-config-page-C8jUtnZb.js → providers-config-page-DAah2NIS.js} +1 -1
- package/ui-dist/assets/providers-config-page-DAah2NIS.js.gz +0 -0
- package/ui-dist/assets/{react-BAzO6LZS.js → react-Co6JiC1n.js} +1 -1
- package/ui-dist/assets/react-Co6JiC1n.js.gz +0 -0
- package/ui-dist/assets/{refresh-cw-BCj-yjde.js → refresh-cw-BG_LX3SS.js} +1 -1
- package/ui-dist/assets/remote-DuscgfvR.js +1 -0
- package/ui-dist/assets/{rotate-cw-BPnW4qUl.js → rotate-cw-Cz7I_m7O.js} +1 -1
- package/ui-dist/assets/{runtime-config-page-aeQ1Dryz.js → runtime-config-page-Cl1RpmSC.js} +1 -1
- package/ui-dist/assets/runtime-config-page-Cl1RpmSC.js.gz +0 -0
- package/ui-dist/assets/{save-KT0MumfJ.js → save-BiHnb8ps.js} +1 -1
- package/ui-dist/assets/{search-Cv1Hx_nx.js → search-C47TyRg0.js} +1 -1
- package/ui-dist/assets/{search-config-page-b283V-fo.js → search-config-page-BAIzd6gN.js} +1 -1
- package/ui-dist/assets/search-config-page-BAIzd6gN.js.gz +0 -0
- package/ui-dist/assets/{secrets-config-page-ss7x3BOo.js → secrets-config-page-Ddi-n43R.js} +1 -1
- package/ui-dist/assets/secrets-config-page-Ddi-n43R.js.gz +0 -0
- package/ui-dist/assets/security-config-C8MHnE1r.js +1 -0
- package/ui-dist/assets/{select-BVgD4EpG.js → select-BzQKfW1e.js} +2 -2
- package/ui-dist/assets/select-BzQKfW1e.js.gz +0 -0
- package/ui-dist/assets/skeleton-BXFAE9SE.js +1 -0
- package/ui-dist/assets/{tag-chip-DZ4ircUB.js → tag-chip-C3K814HZ.js} +1 -1
- package/ui-dist/assets/x-C1r9IXet.js +1 -0
- package/ui-dist/index.html +29 -21
- package/ui-dist/index.html.gz +0 -0
- package/ui-dist/themes/island/island-atmosphere.webp +0 -0
- package/dist/nextclaw-cli-app-B_ffeXOD.js.map +0 -1
- package/dist/nextclaw-distribution.utils-BneKclXo.js.map +0 -1
- package/ui-dist/assets/api-DNLQPHfQ.js.gz +0 -0
- package/ui-dist/assets/appearance-settings-page-BlAFMOGV.js.gz +0 -0
- package/ui-dist/assets/channels-list-page-Cfbgubyv.js.gz +0 -0
- package/ui-dist/assets/config-split-page-Dd8xG0Jk.js.gz +0 -0
- package/ui-dist/assets/confirm-dialog-CZIWjnJ6.js.gz +0 -0
- package/ui-dist/assets/desktop-capabilities-page-C6YxsHeV.js.gz +0 -0
- package/ui-dist/assets/desktop-update-config-BVN4QPJn.js.gz +0 -0
- package/ui-dist/assets/dist-BRloKr3S.js.gz +0 -0
- package/ui-dist/assets/doc-browser-Bzgqmmiu.js +0 -1
- package/ui-dist/assets/doc-browser-Bzgqmmiu.js.gz +0 -0
- package/ui-dist/assets/doc-browser-D0qI0Z_R.js +0 -1
- package/ui-dist/assets/doc-browser-context-3JGufiMA.js.gz +0 -0
- package/ui-dist/assets/extensions-Dedd2oDI.js.gz +0 -0
- package/ui-dist/assets/index-CXkHcESm.css +0 -1
- package/ui-dist/assets/index-CXkHcESm.css.gz +0 -0
- package/ui-dist/assets/index-D25tRg1p.js +0 -109
- package/ui-dist/assets/index-D25tRg1p.js.gz +0 -0
- package/ui-dist/assets/loader-circle-BoyCoFps.js +0 -1
- package/ui-dist/assets/mcp-marketplace-page-Cn-9CDh3.js +0 -1
- package/ui-dist/assets/mcp-marketplace-page-e9Rmfz-d.js.gz +0 -0
- package/ui-dist/assets/model-config-page-C173Ssil.js.gz +0 -0
- package/ui-dist/assets/navigation-link-DTPOvGGL.js.gz +0 -0
- package/ui-dist/assets/plus-D1R4Vipq.js +0 -1
- package/ui-dist/assets/privacy-settings-page-CRserBVF.js.gz +0 -0
- package/ui-dist/assets/providers-config-page-C8jUtnZb.js.gz +0 -0
- package/ui-dist/assets/react-BAzO6LZS.js.gz +0 -0
- package/ui-dist/assets/remote-6BHWP5zi.js +0 -1
- package/ui-dist/assets/runtime-config-page-aeQ1Dryz.js.gz +0 -0
- package/ui-dist/assets/search-config-page-b283V-fo.js.gz +0 -0
- package/ui-dist/assets/secrets-config-page-ss7x3BOo.js.gz +0 -0
- package/ui-dist/assets/security-config-HHz62oxH.js +0 -1
- package/ui-dist/assets/select-BVgD4EpG.js.gz +0 -0
- package/ui-dist/assets/skeleton-ChUmcyys.js +0 -1
- package/ui-dist/assets/x-BWDRfVWL.js +0 -1
package/dist/cli/app/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { t as createNextclawDistribution } from "../../nextclaw-distribution.utils-
|
|
2
|
+
import { t as createNextclawDistribution } from "../../nextclaw-distribution.utils-Bba2GRvc.js";
|
|
3
3
|
import { NextclawDistributionService } from "@nextclaw/service";
|
|
4
4
|
//#region src/cli/app/index.ts
|
|
5
5
|
NextclawDistributionService.configureRuntime(createNextclawDistribution(import.meta.url));
|
|
6
|
-
const { nextclawCliProgram } = await import("../../nextclaw-cli-app-
|
|
6
|
+
const { nextclawCliProgram } = await import("../../nextclaw-cli-app-Bwa2L2Jv.js");
|
|
7
7
|
await nextclawCliProgram.parseAsync(process.argv);
|
|
8
8
|
//#endregion
|
|
9
9
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { t as createNextclawDistribution } from "../../nextclaw-distribution.utils-
|
|
2
|
+
import { t as createNextclawDistribution } from "../../nextclaw-distribution.utils-Bba2GRvc.js";
|
|
3
3
|
import { NextclawDistributionService, runNextclawNpmRuntimeLauncher } from "@nextclaw/service";
|
|
4
4
|
//#region src/cli/launcher/index.ts
|
|
5
5
|
NextclawDistributionService.configure(createNextclawDistribution(import.meta.url));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire } from "node:module";
|
|
2
2
|
import { APP_NAME, APP_TAGLINE, getConfigPath, getDataDir, getRunPath, loadConfig, resolveConfigSecrets } from "@nextclaw/core";
|
|
3
|
-
import { NextclawServiceRuntime, readLearningLoopRuntimeConfig } from "@nextclaw/service";
|
|
3
|
+
import { NextclawDistributionService, NextclawServiceRuntime, readLearningLoopRuntimeConfig } from "@nextclaw/service";
|
|
4
4
|
import { constants, existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
5
5
|
import path, { join, resolve } from "node:path";
|
|
6
6
|
import { Command, InvalidArgumentError } from "commander";
|
|
@@ -9,8 +9,8 @@ import { execFile } from "node:child_process";
|
|
|
9
9
|
import { tmpdir } from "node:os";
|
|
10
10
|
import "@nextclaw/server";
|
|
11
11
|
import { access, mkdtemp, readFile, rm, stat } from "node:fs/promises";
|
|
12
|
-
import { AppBundleService, AppHomeService, AppInstanceInventoryService, AppInstanceStorageService, AppPlatformTargetService, AppPublishService, AppPublishValidationService } from "@nextclaw/app-runtime";
|
|
13
|
-
import {
|
|
12
|
+
import { AppBundleService, AppHomeService, AppInstanceInventoryService, AppInstanceStorageService, AppManifestService, AppPlatformTargetService, AppPublishService, AppPublishValidationService, isAppComponentManifestBundle } from "@nextclaw/app-runtime";
|
|
13
|
+
import { NextclawHarnessError, ServiceAppRuntimeService, buildServiceActionId, getServiceAppManifestPath, mergeServiceAppRuntimeActions, readServiceAppManifest } from "@nextclaw/kernel";
|
|
14
14
|
import { format, promisify } from "node:util";
|
|
15
15
|
import { formatNextClawAppInstallCommand } from "@nextclaw/shared";
|
|
16
16
|
var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
@@ -3648,15 +3648,17 @@ var ServiceAppDevService = class {
|
|
|
3648
3648
|
message: `--reset-data requires --confirm ${loaded.manifest.id}.`
|
|
3649
3649
|
});
|
|
3650
3650
|
if (this.hasErrors(issues)) return this.buildDevReport(appPath, this.toServiceAppRecord(appPath, loaded.manifest, this.idleRuntimeStatus), [], issues);
|
|
3651
|
+
const portable = await this.loadPortableDevContext(appPath, loaded.manifest, issues);
|
|
3652
|
+
if (this.hasErrors(issues)) return this.buildDevReport(appPath, this.toServiceAppRecord(appPath, loaded.manifest, this.idleRuntimeStatus), [], issues);
|
|
3651
3653
|
const runtime = this.createRuntimeService();
|
|
3652
3654
|
const storage = await this.createDevStorage(appPath, loaded.manifest.id, options.resetData === true);
|
|
3653
3655
|
try {
|
|
3654
|
-
const startRecord = this.toServiceAppRecord(appPath, loaded.manifest, runtime, storage);
|
|
3656
|
+
const startRecord = this.toServiceAppRecord(appPath, loaded.manifest, runtime, storage, portable);
|
|
3655
3657
|
const runtimeActions = await runtime.listActions({
|
|
3656
3658
|
app: startRecord,
|
|
3657
3659
|
manifest: loaded.manifest
|
|
3658
3660
|
});
|
|
3659
|
-
const record = this.toServiceAppRecord(appPath, loaded.manifest, runtime, storage);
|
|
3661
|
+
const record = this.toServiceAppRecord(appPath, loaded.manifest, runtime, storage, portable);
|
|
3660
3662
|
const actions = mergeServiceAppRuntimeActions({
|
|
3661
3663
|
record,
|
|
3662
3664
|
manifest: loaded.manifest,
|
|
@@ -3684,20 +3686,22 @@ var ServiceAppDevService = class {
|
|
|
3684
3686
|
const record = this.toServiceAppRecord(appPath, loaded.manifest, this.idleRuntimeStatus);
|
|
3685
3687
|
return this.buildCallReport(appPath, record, void 0, void 0, issues);
|
|
3686
3688
|
}
|
|
3689
|
+
const portable = await this.loadPortableDevContext(appPath, loaded.manifest, issues);
|
|
3690
|
+
if (this.hasErrors(issues)) return this.buildCallReport(appPath, this.toServiceAppRecord(appPath, loaded.manifest, this.idleRuntimeStatus), void 0, void 0, issues);
|
|
3687
3691
|
const runtime = this.createRuntimeService();
|
|
3688
3692
|
const storage = await this.createDevStorage(appPath, loaded.manifest.id);
|
|
3689
3693
|
try {
|
|
3690
|
-
const record = this.toServiceAppRecord(appPath, loaded.manifest, runtime, storage);
|
|
3694
|
+
const record = this.toServiceAppRecord(appPath, loaded.manifest, runtime, storage, portable);
|
|
3691
3695
|
const result = await runtime.invokeAction({
|
|
3692
3696
|
app: record,
|
|
3693
3697
|
manifest: loaded.manifest,
|
|
3694
3698
|
actionName: action,
|
|
3695
3699
|
input
|
|
3696
3700
|
});
|
|
3697
|
-
const nextRecord = this.toServiceAppRecord(appPath, loaded.manifest, runtime, storage);
|
|
3701
|
+
const nextRecord = this.toServiceAppRecord(appPath, loaded.manifest, runtime, storage, portable);
|
|
3698
3702
|
return this.buildCallReport(appPath, nextRecord, buildServiceActionId(loaded.manifest.id, action), result, issues);
|
|
3699
3703
|
} catch (error) {
|
|
3700
|
-
const record = this.toServiceAppRecord(appPath, loaded.manifest, runtime, storage);
|
|
3704
|
+
const record = this.toServiceAppRecord(appPath, loaded.manifest, runtime, storage, portable);
|
|
3701
3705
|
issues.push({
|
|
3702
3706
|
severity: "error",
|
|
3703
3707
|
code: "service.runtime.callFailed",
|
|
@@ -3731,7 +3735,60 @@ var ServiceAppDevService = class {
|
|
|
3731
3735
|
return null;
|
|
3732
3736
|
}
|
|
3733
3737
|
};
|
|
3734
|
-
createRuntimeService = () =>
|
|
3738
|
+
createRuntimeService = () => {
|
|
3739
|
+
if (this.params.runtimeService) return this.params.runtimeService;
|
|
3740
|
+
return new ServiceAppRuntimeService({
|
|
3741
|
+
getConfig: this.params.getConfig ?? this.loadRuntimeConfig,
|
|
3742
|
+
portableServiceRunnerPath: this.params.portableServiceRunnerPath
|
|
3743
|
+
});
|
|
3744
|
+
};
|
|
3745
|
+
loadPortableDevContext = async (appPath, manifest, issues) => {
|
|
3746
|
+
if (manifest.protocol !== "wasi-component") return void 0;
|
|
3747
|
+
const componentPath = path.resolve(appPath, manifest.componentEntry ?? "");
|
|
3748
|
+
if (!await this.pathExists(componentPath)) {
|
|
3749
|
+
issues.push({
|
|
3750
|
+
severity: "error",
|
|
3751
|
+
code: "service.component.notFound",
|
|
3752
|
+
message: `Portable Component does not exist: ${manifest.componentEntry ?? "(missing)"}.`
|
|
3753
|
+
});
|
|
3754
|
+
return;
|
|
3755
|
+
}
|
|
3756
|
+
const packageContext = await this.findOwningPackage(appPath);
|
|
3757
|
+
if (!packageContext) {
|
|
3758
|
+
issues.push({
|
|
3759
|
+
severity: "error",
|
|
3760
|
+
code: "service.package.required",
|
|
3761
|
+
message: "Portable Service App development requires an owning schema v2 Mini App so permissions have one product owner.",
|
|
3762
|
+
fixHint: "Place the service under a manifest.json components entry and run app dev on that service directory."
|
|
3763
|
+
});
|
|
3764
|
+
return;
|
|
3765
|
+
}
|
|
3766
|
+
return {
|
|
3767
|
+
componentPath,
|
|
3768
|
+
permissions: packageContext.permissions
|
|
3769
|
+
};
|
|
3770
|
+
};
|
|
3771
|
+
findOwningPackage = async (appPath) => {
|
|
3772
|
+
let candidate = path.dirname(appPath);
|
|
3773
|
+
while (true) {
|
|
3774
|
+
const permissions = await this.readOwningPackagePermissions(candidate, appPath);
|
|
3775
|
+
if (permissions) return { permissions };
|
|
3776
|
+
const parent = path.dirname(candidate);
|
|
3777
|
+
if (parent === candidate) return void 0;
|
|
3778
|
+
candidate = parent;
|
|
3779
|
+
}
|
|
3780
|
+
};
|
|
3781
|
+
readOwningPackagePermissions = async (candidate, appPath) => {
|
|
3782
|
+
if (!await this.pathExists(path.join(candidate, "manifest.json"))) return void 0;
|
|
3783
|
+
const manifestService = new AppManifestService();
|
|
3784
|
+
try {
|
|
3785
|
+
const bundle = await manifestService.load(candidate);
|
|
3786
|
+
if (!isAppComponentManifestBundle(bundle)) return void 0;
|
|
3787
|
+
return bundle.components.some((component) => path.resolve(component.componentDirectory) === path.resolve(appPath)) ? manifestService.resolvePlatformSecurity(bundle.manifest).permissions : void 0;
|
|
3788
|
+
} catch {
|
|
3789
|
+
return;
|
|
3790
|
+
}
|
|
3791
|
+
};
|
|
3735
3792
|
loadRuntimeConfig = () => {
|
|
3736
3793
|
const configPath = getConfigPath();
|
|
3737
3794
|
return resolveConfigSecrets(loadConfig(configPath), { configPath });
|
|
@@ -3767,7 +3824,7 @@ var ServiceAppDevService = class {
|
|
|
3767
3824
|
return false;
|
|
3768
3825
|
}
|
|
3769
3826
|
};
|
|
3770
|
-
toServiceAppRecord = (dirPath, manifest, runtime, storage) => {
|
|
3827
|
+
toServiceAppRecord = (dirPath, manifest, runtime, storage, portable) => {
|
|
3771
3828
|
const runtimeStatus = runtime.getStatus(manifest.id);
|
|
3772
3829
|
const record = {
|
|
3773
3830
|
id: manifest.id,
|
|
@@ -3783,7 +3840,12 @@ var ServiceAppDevService = class {
|
|
|
3783
3840
|
dataDirectory: storage?.dataDirectory,
|
|
3784
3841
|
instanceId: storage?.instanceId,
|
|
3785
3842
|
storage,
|
|
3786
|
-
isolation: "full-user"
|
|
3843
|
+
isolation: manifest.protocol === "wasi-component" ? "host-mediated" : "full-user",
|
|
3844
|
+
runtimeProfile: manifest.protocol === "wasi-component" ? "wasi" : "native-process",
|
|
3845
|
+
componentPath: portable?.componentPath,
|
|
3846
|
+
permissions: portable?.permissions,
|
|
3847
|
+
providerIds: manifest.providerIds,
|
|
3848
|
+
lifecycle: manifest.lifecycle
|
|
3787
3849
|
};
|
|
3788
3850
|
if (manifest.description) record.description = manifest.description;
|
|
3789
3851
|
if (runtimeStatus.lastError) record.lastError = runtimeStatus.lastError;
|
|
@@ -4240,15 +4302,17 @@ var ServiceAppCheckService = class {
|
|
|
4240
4302
|
const manifestResult = await readJsonObject(path.join(appPath, SERVICE_MANIFEST_FILE));
|
|
4241
4303
|
this.pushIssue(issues, manifestResult.issue);
|
|
4242
4304
|
if (!manifestResult.value) return issues;
|
|
4243
|
-
const
|
|
4305
|
+
const protocol = readOptionalString(manifestResult.value, "protocol") ?? "mcp";
|
|
4306
|
+
const serviceId = this.checkManifestFields(appPath, manifestResult.value, protocol, issues);
|
|
4244
4307
|
const command = readOptionalString(manifestResult.value, "command");
|
|
4245
4308
|
const args = readStringArray(manifestResult.value.args, "service.args");
|
|
4246
4309
|
this.pushIssue(issues, args.issue);
|
|
4247
4310
|
this.checkActions(serviceId, manifestResult.value.actions, issues);
|
|
4248
|
-
await this.
|
|
4311
|
+
if (protocol === "wasi-component") await this.checkPortableComponent(appPath, manifestResult.value, issues);
|
|
4312
|
+
else await this.checkCommand(appPath, command, args.values, issues);
|
|
4249
4313
|
return issues;
|
|
4250
4314
|
};
|
|
4251
|
-
checkManifestFields = (appPath, manifest, issues) => {
|
|
4315
|
+
checkManifestFields = (appPath, manifest, protocol, issues) => {
|
|
4252
4316
|
const id = readRequiredString(manifest, "id", "service");
|
|
4253
4317
|
this.pushIssue(issues, id.issue);
|
|
4254
4318
|
if (id.value && (!KEBAB_ID_PATTERN.test(id.value) || id.value !== path.basename(appPath))) issues.push({
|
|
@@ -4257,14 +4321,42 @@ var ServiceAppCheckService = class {
|
|
|
4257
4321
|
message: `service-app.json id must be kebab-case and equal directory name: ${path.basename(appPath)}.`
|
|
4258
4322
|
});
|
|
4259
4323
|
this.pushIssue(issues, readRequiredString(manifest, "title", "service").issue);
|
|
4260
|
-
this.pushIssue(issues, readRequiredString(manifest, "command", "service").issue);
|
|
4261
|
-
if (
|
|
4324
|
+
if (protocol === "mcp") this.pushIssue(issues, readRequiredString(manifest, "command", "service").issue);
|
|
4325
|
+
else if (protocol !== "wasi-component") issues.push({
|
|
4262
4326
|
severity: "error",
|
|
4263
4327
|
code: "service.protocol.invalid",
|
|
4264
|
-
message: "Service App protocol must be mcp."
|
|
4328
|
+
message: "Service App protocol must be mcp or wasi-component."
|
|
4265
4329
|
});
|
|
4266
4330
|
return id.value;
|
|
4267
4331
|
};
|
|
4332
|
+
checkPortableComponent = async (appPath, manifest, issues) => {
|
|
4333
|
+
if (!isRecord(manifest.component)) {
|
|
4334
|
+
issues.push({
|
|
4335
|
+
severity: "error",
|
|
4336
|
+
code: "service.component.missing",
|
|
4337
|
+
message: "wasi-component Service App must declare component.entry."
|
|
4338
|
+
});
|
|
4339
|
+
return;
|
|
4340
|
+
}
|
|
4341
|
+
const entry = readRequiredString(manifest.component, "entry", "service.component");
|
|
4342
|
+
this.pushIssue(issues, entry.issue);
|
|
4343
|
+
if (!entry.value) return;
|
|
4344
|
+
const normalized = entry.value.replace(/\\/g, "/");
|
|
4345
|
+
if (path.isAbsolute(normalized) || normalized.split("/").includes("..") || !normalized.endsWith(".wasm")) {
|
|
4346
|
+
issues.push({
|
|
4347
|
+
severity: "error",
|
|
4348
|
+
code: "service.component.entryInvalid",
|
|
4349
|
+
message: "service.component.entry must be a package-relative .wasm path."
|
|
4350
|
+
});
|
|
4351
|
+
return;
|
|
4352
|
+
}
|
|
4353
|
+
const componentPath = resolveRelativeFile(appPath, normalized);
|
|
4354
|
+
if (!componentPath || !await fileExists(componentPath)) issues.push({
|
|
4355
|
+
severity: "error",
|
|
4356
|
+
code: "service.component.notFound",
|
|
4357
|
+
message: `Portable Component does not exist: ${entry.value}.`
|
|
4358
|
+
});
|
|
4359
|
+
};
|
|
4268
4360
|
checkActions = (serviceId, value, issues) => {
|
|
4269
4361
|
if (!isRecord(value) || Object.keys(value).length === 0) {
|
|
4270
4362
|
issues.push({
|
|
@@ -5049,12 +5141,13 @@ var AppPackageCommandController = class {
|
|
|
5049
5141
|
};
|
|
5050
5142
|
//#endregion
|
|
5051
5143
|
//#region src/cli/app/register-app-commands.ts
|
|
5052
|
-
function registerAppCommands(program) {
|
|
5144
|
+
function registerAppCommands(program, options = {}) {
|
|
5053
5145
|
const app = program.command("app").description("Develop, validate, and publish NextClaw apps");
|
|
5054
5146
|
const appCheck = new AppCheckCommandController();
|
|
5055
|
-
const
|
|
5147
|
+
const serviceAppDev = new ServiceAppDevService({ portableServiceRunnerPath: options.portableServiceRunnerPath });
|
|
5148
|
+
const appDev = new AppDevCommandController(serviceAppDev);
|
|
5056
5149
|
const appData = new AppDataCommandController();
|
|
5057
|
-
const appCall = new AppCallCommandController();
|
|
5150
|
+
const appCall = new AppCallCommandController(serviceAppDev);
|
|
5058
5151
|
const appRestart = new AppRestartCommandController();
|
|
5059
5152
|
const appPack = new AppPackCommandController();
|
|
5060
5153
|
const appValidatePublish = new AppValidatePublishCommandController();
|
|
@@ -5315,7 +5408,7 @@ registerAgentsCommands(program, runtime);
|
|
|
5315
5408
|
registerProjectCommands(program, runtime);
|
|
5316
5409
|
registerSessionCommands(program, runtime);
|
|
5317
5410
|
registerExecCommand(program, runtime);
|
|
5318
|
-
registerAppCommands(program);
|
|
5411
|
+
registerAppCommands(program, { portableServiceRunnerPath: NextclawDistributionService.get().portableServiceRunnerPath });
|
|
5319
5412
|
const config = program.command("config").description("Manage config values");
|
|
5320
5413
|
config.command("get <path>").description("Get a config value by dot path").option("--json", "Output JSON", false).action((path, opts) => runtime.commands.config.get(path, opts));
|
|
5321
5414
|
config.command("set <path> <value>").description("Set a config value by dot path").option("--json", "Parse value as JSON", false).action((path, value, opts) => runtime.commands.config.set(path, value, opts));
|
|
@@ -5355,4 +5448,4 @@ program.command("usage").description("Show observed LLM usage snapshots, history
|
|
|
5355
5448
|
//#endregion
|
|
5356
5449
|
export { program as nextclawCliProgram };
|
|
5357
5450
|
|
|
5358
|
-
//# sourceMappingURL=nextclaw-cli-app-
|
|
5451
|
+
//# sourceMappingURL=nextclaw-cli-app-Bwa2L2Jv.js.map
|