nextclaw 0.38.0 → 0.39.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/dist/cli/app/index.js +1 -1
  2. package/dist/{nextclaw-cli-app-BITGWcdZ.js → nextclaw-cli-app-CyPsZCXX.js} +54 -7
  3. package/dist/nextclaw-cli-app-CyPsZCXX.js.map +1 -0
  4. package/package.json +13 -13
  5. package/resources/USAGE.md +12 -0
  6. package/ui-dist/assets/{api-BJioGtWS.js → api-BSsQ0I4l.js} +1 -1
  7. package/ui-dist/assets/{appearance-settings-page-DAF1fd14.js → appearance-settings-page-2ilQwMl0.js} +1 -1
  8. package/ui-dist/assets/{book-open-aDv6R1av.js → book-open-BOJLGVsx.js} +1 -1
  9. package/ui-dist/assets/{channels-list-page-Dubt8r9S.js → channels-list-page-BPy2mXoD.js} +1 -1
  10. package/ui-dist/assets/{chat-page-JbwjeUo4.js → chat-page-DDR-Q4Kf.js} +1 -1
  11. package/ui-dist/assets/{config-split-page-Bs1wArsX.js → config-split-page-aUTKtWJu.js} +1 -1
  12. package/ui-dist/assets/{confirm-dialog-BFatCZUq.js → confirm-dialog-Bsg9A62_.js} +1 -1
  13. package/ui-dist/assets/{desktop-update-config-DFefhK96.js → desktop-update-config-Ds4pN7kz.js} +1 -1
  14. package/ui-dist/assets/{dist-CV9wIyME.js → dist-DyUY9uQ0.js} +1 -1
  15. package/ui-dist/assets/{dist-D1I3blO_.js → dist-IBUY9_9h.js} +1 -1
  16. package/ui-dist/assets/doc-browser-D0arfzHY.js +1 -0
  17. package/ui-dist/assets/{doc-browser-BFfstBoh.js → doc-browser-D73yN8ts.js} +1 -1
  18. package/ui-dist/assets/{doc-browser-context-BcwcVwX_.js → doc-browser-context-BM6Af8gN.js} +1 -1
  19. package/ui-dist/assets/{form-actions-YSnn7q_U.js → form-actions-Cpd7glh8.js} +1 -1
  20. package/ui-dist/assets/index-C2N1bYyb.js +109 -0
  21. package/ui-dist/assets/loader-circle-C1fL3kBZ.js +1 -0
  22. package/ui-dist/assets/{mcp-marketplace-page-ZTHpQTvi.js → mcp-marketplace-page-D8V0GU4Y.js} +1 -1
  23. package/ui-dist/assets/mcp-marketplace-page-q6T-vKoH.js +1 -0
  24. package/ui-dist/assets/{model-config-page-jYCwpq4U.js → model-config-page-B7QR33ED.js} +1 -1
  25. package/ui-dist/assets/{navigation-link-7oSjAC9R.js → navigation-link-DtPZZ_Q_.js} +1 -1
  26. package/ui-dist/assets/plus-B9V7Z_Eu.js +1 -0
  27. package/ui-dist/assets/{provider-scoped-model-input-C1CUHVJx.js → provider-scoped-model-input-RWZz36z7.js} +1 -1
  28. package/ui-dist/assets/{providers-config-page-CMvI4R1e.js → providers-config-page-B5yakiZe.js} +1 -1
  29. package/ui-dist/assets/{react-7zG0fz1I.js → react-D-jOo51s.js} +1 -1
  30. package/ui-dist/assets/{refresh-cw-BUg7hI3u.js → refresh-cw-BQHORcAs.js} +1 -1
  31. package/ui-dist/assets/remote-BfRYDhkz.js +1 -0
  32. package/ui-dist/assets/rotate-cw-DuCF-3PX.js +1 -0
  33. package/ui-dist/assets/{runtime-config-page-DYuYv5yM.js → runtime-config-page-Big45YWb.js} +1 -1
  34. package/ui-dist/assets/{save-CTCYuZqu.js → save-BgiS2u-T.js} +1 -1
  35. package/ui-dist/assets/{search-CfFUpaf7.js → search-B6mO7mmo.js} +1 -1
  36. package/ui-dist/assets/{search-config-page-GUtGbk6i.js → search-config-page-QS-kqNDZ.js} +1 -1
  37. package/ui-dist/assets/{secrets-config-page-Delo8ab0.js → secrets-config-page-DE3kmDHk.js} +1 -1
  38. package/ui-dist/assets/security-config-Ds_2SXBh.js +1 -0
  39. package/ui-dist/assets/{select-MSvkWmPP.js → select-DToos7Rq.js} +1 -1
  40. package/ui-dist/assets/{settings-2-DXUfAWgg.js → settings-2-ZAWXrq81.js} +1 -1
  41. package/ui-dist/assets/skeleton-Bs2eO2CA.js +1 -0
  42. package/ui-dist/assets/{tag-chip-u8g0b0Nf.js → tag-chip-urB3N-kk.js} +1 -1
  43. package/ui-dist/assets/x-BkjTUiww.js +1 -0
  44. package/ui-dist/index.html +19 -19
  45. package/dist/nextclaw-cli-app-BITGWcdZ.js.map +0 -1
  46. package/ui-dist/assets/doc-browser-DEdoMb3X.js +0 -1
  47. package/ui-dist/assets/index-L58BO782.js +0 -109
  48. package/ui-dist/assets/loader-circle-CsNiT6VM.js +0 -1
  49. package/ui-dist/assets/mcp-marketplace-page-DfUCF-L5.js +0 -1
  50. package/ui-dist/assets/plus-D6UN8XN5.js +0 -1
  51. package/ui-dist/assets/remote-BYPq49kD.js +0 -1
  52. package/ui-dist/assets/rotate-cw-B3qmXtfJ.js +0 -1
  53. package/ui-dist/assets/security-config-DoVoel5I.js +0 -1
  54. package/ui-dist/assets/skeleton-DDFivi9Y.js +0 -1
  55. package/ui-dist/assets/x-DdOEUmR4.js +0 -1
@@ -3,7 +3,7 @@ import { t as createNextclawDistribution } from "../../nextclaw-distribution.uti
3
3
  import { NextclawDistributionService } from "@nextclaw/service";
4
4
  //#region src/cli/app/index.ts
5
5
  NextclawDistributionService.configureRuntime(createNextclawDistribution(import.meta.url));
6
- await import("../../nextclaw-cli-app-BITGWcdZ.js");
6
+ await import("../../nextclaw-cli-app-CyPsZCXX.js");
7
7
  //#endregion
8
8
  export {};
9
9
 
@@ -9,7 +9,7 @@ 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 { AppHomeService, AppInstanceInventoryService, AppInstanceStorageService, AppPublishService, AppPublishValidationService } from "@nextclaw/app-runtime";
12
+ import { AppBundleService, AppHomeService, AppInstanceInventoryService, AppInstanceStorageService, AppPlatformTargetService, AppPublishService, AppPublishValidationService } from "@nextclaw/app-runtime";
13
13
  import { McpServiceAppRuntimeService, buildServiceActionId, getServiceAppManifestPath, mergeServiceAppRuntimeActions, readServiceAppManifest } from "@nextclaw/kernel";
14
14
  import { promisify } from "node:util";
15
15
  var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
@@ -4683,14 +4683,23 @@ var AppRestartCommandController = class {
4683
4683
  //#endregion
4684
4684
  //#region src/cli/app/services/app-publishing.service.ts
4685
4685
  var AppPublishingService = class {
4686
- constructor(validationService = new AppPublishValidationService(), publishService = new AppPublishService()) {
4686
+ constructor(validationService = new AppPublishValidationService(), publishService = new AppPublishService(), bundleService = new AppBundleService(), platformTargetService = new AppPlatformTargetService()) {
4687
4687
  this.validationService = validationService;
4688
4688
  this.publishService = publishService;
4689
+ this.bundleService = bundleService;
4690
+ this.platformTargetService = platformTargetService;
4689
4691
  }
4692
+ pack = async (params) => this.bundleService.packAppDirectory({
4693
+ appDirectory: params.appDirectory,
4694
+ outputPath: params.outputPath,
4695
+ mode: "bundle",
4696
+ target: this.platformTargetService.parseTargetKey(params.target)
4697
+ });
4690
4698
  validate = async (params) => {
4691
4699
  const result = await this.validationService.validate({
4692
4700
  appDirectory: params.appDirectory,
4693
4701
  metadataPath: params.metadataPath,
4702
+ artifactsDirectory: params.artifactsDirectory,
4694
4703
  mode: "bundle"
4695
4704
  });
4696
4705
  if (result.profile !== "components") throw new Error("nextclaw app publish 只支持由 Panel App 或 Service App 组成的 schema v2 Mini App。");
@@ -4708,6 +4717,7 @@ var AppPublishingService = class {
4708
4717
  const result = await this.publishService.publish({
4709
4718
  appDirectory: params.appDirectory,
4710
4719
  metadataPath: params.metadataPath,
4720
+ artifactsDirectory: params.artifactsDirectory,
4711
4721
  bundleOutputPath: path.join(tempDirectory, "artifact.napp"),
4712
4722
  mode: "bundle"
4713
4723
  });
@@ -4741,6 +4751,38 @@ var AppPublishingService = class {
4741
4751
  };
4742
4752
  };
4743
4753
  //#endregion
4754
+ //#region src/cli/app/controllers/app-pack-command.controller.ts
4755
+ var AppPackCommandController = class {
4756
+ constructor(appPublishingService = new AppPublishingService()) {
4757
+ this.appPublishingService = appPublishingService;
4758
+ }
4759
+ pack = async (target, options) => {
4760
+ try {
4761
+ const bundle = await this.appPublishingService.pack({
4762
+ appDirectory: target,
4763
+ outputPath: options.out,
4764
+ target: options.target
4765
+ });
4766
+ process.stdout.write(options.json ? `${JSON.stringify({
4767
+ ok: true,
4768
+ bundle
4769
+ }, null, 2)}\n` : [
4770
+ `Packed ${bundle.metadata.name} ${bundle.metadata.version}.`,
4771
+ bundle.metadata.target ? `Target: ${options.target}` : "Target: universal",
4772
+ `Bundle: ${bundle.bundlePath}`,
4773
+ ""
4774
+ ].join("\n"));
4775
+ } catch (error) {
4776
+ const message = error instanceof Error ? error.message : String(error);
4777
+ process.stdout.write(options.json ? `${JSON.stringify({
4778
+ ok: false,
4779
+ error: { message }
4780
+ }, null, 2)}\n` : `Mini App pack failed: ${message}\n`);
4781
+ process.exitCode = 1;
4782
+ }
4783
+ };
4784
+ };
4785
+ //#endregion
4744
4786
  //#region src/cli/app/controllers/app-publish-command.controller.ts
4745
4787
  const PLATFORM_APPS_URL = "https://platform.nextclaw.io/apps";
4746
4788
  var AppPublishCommandController = class {
@@ -4748,11 +4790,12 @@ var AppPublishCommandController = class {
4748
4790
  this.appPublishingService = appPublishingService;
4749
4791
  }
4750
4792
  publish = async (target, options) => {
4751
- const { allowWarnings, json, meta } = options;
4793
+ const { allowWarnings, artifacts, json, meta } = options;
4752
4794
  try {
4753
4795
  const result = await this.appPublishingService.publish({
4754
4796
  appDirectory: target,
4755
4797
  metadataPath: meta,
4798
+ artifactsDirectory: artifacts,
4756
4799
  allowWarnings
4757
4800
  });
4758
4801
  process.stdout.write(json ? `${JSON.stringify({
@@ -4799,7 +4842,8 @@ var AppValidatePublishCommandController = class {
4799
4842
  try {
4800
4843
  const validation = await this.appPublishingService.validate({
4801
4844
  appDirectory: target,
4802
- metadataPath: options.meta
4845
+ metadataPath: options.meta,
4846
+ artifactsDirectory: options.artifacts
4803
4847
  });
4804
4848
  process.stdout.write(options.json ? `${JSON.stringify({
4805
4849
  ok: true,
@@ -4817,6 +4861,7 @@ var AppValidatePublishCommandController = class {
4817
4861
  `Bundle size: ${validation.bundleSizeBytes} bytes`,
4818
4862
  `Metadata: ${validation.metadataPath}`
4819
4863
  ];
4864
+ for (const artifact of validation.artifacts ?? []) lines.push(`Artifact ${artifact.targetKey}: ${artifact.sizeBytes} bytes`);
4820
4865
  for (const warning of validation.warnings) lines.push(`Warning [${warning.code}]: ${warning.message}`);
4821
4866
  return `${lines.join("\n")}\n`;
4822
4867
  };
@@ -4837,10 +4882,12 @@ function registerAppCommands(program) {
4837
4882
  const appData = new AppDataCommandController();
4838
4883
  const appCall = new AppCallCommandController();
4839
4884
  const appRestart = new AppRestartCommandController();
4885
+ const appPack = new AppPackCommandController();
4840
4886
  const appValidatePublish = new AppValidatePublishCommandController();
4841
4887
  const appPublish = new AppPublishCommandController();
4842
- app.command("validate-publish <app-dir>").description("Validate a NextClaw Mini App before Marketplace submission").option("--meta <path>", "Use a custom marketplace metadata file").option("--json", "Output JSON", false).action(async (target, opts) => appValidatePublish.validate(target, opts));
4843
- app.command("publish <app-dir>").description("Submit a NextClaw Mini App to the App Marketplace").option("--meta <path>", "Use a custom marketplace metadata file").option("--allow-warnings", "Submit after reviewing validation warnings", false).option("--json", "Output JSON", false).action(async (target, opts) => appPublish.publish(target, opts));
4888
+ app.command("pack <app-dir>").description("Pack one declared platform target as a NextClaw App artifact").requiredOption("--target <target-key>", "Pack a declared platform target").requiredOption("--out <path>", "Write the .napp artifact to a specific path").option("--json", "Output JSON", false).action(async (target, opts) => appPack.pack(target, opts));
4889
+ app.command("validate-publish <app-dir>").description("Validate a NextClaw Mini App before Marketplace submission").option("--meta <path>", "Use a custom marketplace metadata file").option("--artifacts <dir>", "Use target-keyed .napp artifacts from a directory").option("--json", "Output JSON", false).action(async (target, opts) => appValidatePublish.validate(target, opts));
4890
+ app.command("publish <app-dir>").description("Submit a NextClaw Mini App to the App Marketplace").option("--meta <path>", "Use a custom marketplace metadata file").option("--artifacts <dir>", "Publish target-keyed .napp artifacts from a directory").option("--allow-warnings", "Submit after reviewing validation warnings", false).option("--json", "Output JSON", false).action(async (target, opts) => appPublish.publish(target, opts));
4844
4891
  app.command("check <app-dir>").description("Check a Panel App or Service App directory").option("--json", "Output JSON", false).action(async (target, opts) => appCheck.check(target, opts));
4845
4892
  app.command("dev <service-app-dir>").description("Start a Service App through the real runtime and inspect its actions").option("--json", "Output JSON", false).option("--reset-data", "Reset the exact development instance before starting", false).option("--confirm <app-id>", "Confirm the Service App id when resetting data").action(async (target, opts) => appDev.dev(target, opts));
4846
4893
  const data = app.command("data").description("Inspect and manage NextClaw App data");
@@ -4940,4 +4987,4 @@ await program.parseAsync(process.argv);
4940
4987
  //#endregion
4941
4988
  export {};
4942
4989
 
4943
- //# sourceMappingURL=nextclaw-cli-app-BITGWcdZ.js.map
4990
+ //# sourceMappingURL=nextclaw-cli-app-CyPsZCXX.js.map