@nextclaw/service 0.1.6 → 0.1.8

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 (80) hide show
  1. package/dist/cli/commands/agent/agent-runtime.utils.js +2 -2
  2. package/dist/cli/commands/agent/cli-agent-runner.utils.js +2 -2
  3. package/dist/cli/commands/agent/index.js +1 -1
  4. package/dist/cli/commands/config/services/config-commands.service.js +1 -1
  5. package/dist/cli/commands/cron/services/cron-commands.service.js +2 -2
  6. package/dist/cli/commands/cron/services/cron-local.service.d.ts +1 -1
  7. package/dist/cli/commands/cron/services/cron-local.service.js +1 -1
  8. package/dist/cli/commands/restart/index.js +2 -2
  9. package/dist/cli/commands/skills/marketplace.metadata.js +1 -1
  10. package/dist/cli/commands/skills/marketplace.service.js +2 -2
  11. package/dist/cli/commands/skills/skills-query.service.js +1 -1
  12. package/dist/commands/channel/index.js +2 -2
  13. package/dist/commands/plugin/development-source/dev-plugin-overrides.utils.js +3 -3
  14. package/dist/commands/plugin/development-source/{first-party-plugin-load-paths.d.ts → first-party-plugin-load-paths.utils.d.ts} +1 -1
  15. package/dist/commands/plugin/development-source/{first-party-plugin-load-paths.js → first-party-plugin-load-paths.utils.js} +3 -3
  16. package/dist/commands/plugin/index.d.ts +1 -1
  17. package/dist/commands/plugin/index.js +5 -5
  18. package/dist/commands/plugin/plugin-command-utils.d.ts +1 -1
  19. package/dist/commands/plugin/plugin-mutation-actions.js +2 -2
  20. package/dist/commands/plugin/{plugin-registry-loader.d.ts → plugin-registry-loader.utils.d.ts} +1 -1
  21. package/dist/commands/plugin/{plugin-registry-loader.js → plugin-registry-loader.utils.js} +2 -2
  22. package/dist/commands/remote/services/remote-service-control.service.js +1 -1
  23. package/dist/commands/remote/utils/remote-runtime-support.utils.js +1 -1
  24. package/dist/commands/service/services/autostart/host-autostart-runtime.service.js +2 -2
  25. package/dist/commands/service/services/autostart/linux-systemd-autostart.service.js +2 -2
  26. package/dist/commands/service/services/autostart/macos-launch-agent-autostart.service.js +2 -2
  27. package/dist/commands/service/services/autostart/windows-task-autostart.service.js +2 -2
  28. package/dist/index.d.ts +2 -2
  29. package/dist/launcher/npm-runtime-bundle-layout.store.js +1 -1
  30. package/dist/launcher/npm-runtime-bundle.service.js +1 -1
  31. package/dist/launcher/npm-runtime-launcher.service.js +5 -5
  32. package/dist/launcher/npm-runtime-update-command.service.js +2 -2
  33. package/dist/launcher/npm-runtime-update-source.service.js +2 -2
  34. package/dist/launcher/npm-runtime-update-state.store.js +1 -1
  35. package/dist/launcher/npm-runtime-update.manager.js +1 -1
  36. package/dist/launcher/npm-runtime-update.service.js +2 -2
  37. package/dist/service-runtime.service.d.ts +0 -2
  38. package/dist/service-runtime.service.js +31 -33
  39. package/dist/shared/controllers/gateway.controller.js +1 -1
  40. package/dist/shared/services/extensions/extension-lifecycle.service.js +1 -1
  41. package/dist/shared/services/extensions/service-extension-runtime.service.d.ts +1 -1
  42. package/dist/shared/services/extensions/service-extension-runtime.service.js +7 -6
  43. package/dist/shared/services/gateway/gateway-restart-wake.service.js +2 -1
  44. package/dist/shared/services/gateway/managers/gateway-plugin.manager.js +17 -3
  45. package/dist/shared/services/gateway/managers/gateway-remote.manager.d.ts +2 -2
  46. package/dist/shared/services/gateway/managers/gateway-remote.manager.js +1 -1
  47. package/dist/shared/services/gateway/nextclaw-gateway-runtime.service.d.ts +1 -1
  48. package/dist/shared/services/gateway/nextclaw-gateway-runtime.service.js +10 -10
  49. package/dist/shared/services/gateway/service-bootstrap-status.service.d.ts +1 -1
  50. package/dist/shared/services/gateway/service-startup-support.service.d.ts +1 -1
  51. package/dist/shared/services/marketplace/service-marketplace-installer.service.js +2 -2
  52. package/dist/shared/services/plugin/utils/plugin-runtime-bridge.utils.js +1 -1
  53. package/dist/shared/services/restart/restart-sentinel.service.js +1 -1
  54. package/dist/shared/services/runtime/runtime-command.service.d.ts +3 -0
  55. package/dist/shared/services/runtime/runtime-command.service.js +27 -3
  56. package/dist/shared/services/runtime/service-managed-startup.service.d.ts +4 -28
  57. package/dist/shared/services/runtime/service-managed-startup.service.js +61 -65
  58. package/dist/shared/services/runtime/utils/managed-service-routing.utils.d.ts +30 -0
  59. package/dist/shared/services/runtime/utils/managed-service-routing.utils.js +62 -0
  60. package/dist/shared/services/runtime/utils/service-remote-runtime.utils.js +2 -2
  61. package/dist/shared/services/session/service-deferred-ncp-agent.service.d.ts +1 -1
  62. package/dist/shared/services/ui/companion-runtime.service.d.ts +2 -0
  63. package/dist/shared/services/ui/companion-runtime.service.js +40 -8
  64. package/dist/shared/services/ui/local-ui-discovery.service.js +1 -1
  65. package/dist/shared/services/ui/npm-runtime-update-host.service.js +2 -2
  66. package/dist/shared/services/ui/runtime-control-host.service.js +1 -1
  67. package/dist/shared/services/ui/service-remote-access.service.js +1 -1
  68. package/dist/shared/services/workspace/workspace-manager.service.js +3 -3
  69. package/dist/shared/stores/companion-runtime.store.js +1 -1
  70. package/dist/shared/stores/local-ui-runtime.store.js +1 -1
  71. package/dist/shared/stores/managed-service-state.store.js +1 -1
  72. package/dist/shared/types/cli.types.d.ts +1 -14
  73. package/dist/shared/utils/cli.utils.js +2 -2
  74. package/dist/shared/utils/marketplace/cli-subcommand-launch.utils.js +1 -1
  75. package/dist/shared/utils/package/package-manifest.utils.js +2 -2
  76. package/package.json +21 -19
  77. package/dist/cli/commands/companion/index.d.ts +0 -15
  78. package/dist/cli/commands/companion/index.js +0 -24
  79. package/dist/cli/commands/companion/services/companion-process.service.d.ts +0 -17
  80. package/dist/cli/commands/companion/services/companion-process.service.js +0 -49
@@ -1,13 +1,22 @@
1
1
  import { isProcessRunning } from "../../utils/cli.utils.js";
2
- import { companionRuntimeStore } from "../../stores/companion-runtime.store.js";
3
2
  import { localUiDiscoveryService } from "./local-ui-discovery.service.js";
3
+ import { companionRuntimeStore } from "../../stores/companion-runtime.store.js";
4
4
  import { createRequire } from "node:module";
5
- import { spawn } from "node:child_process";
6
- import { dirname, resolve } from "node:path";
7
5
  import { APP_NAME, getConfigPath, loadConfig, saveConfig } from "@nextclaw/core";
8
6
  import { existsSync } from "node:fs";
7
+ import { dirname, resolve } from "node:path";
8
+ import { spawn } from "node:child_process";
9
9
  //#region src/shared/services/ui/companion-runtime.service.ts
10
10
  const require = createRequire(import.meta.url);
11
+ var CompanionUnavailableError = class extends Error {
12
+ constructor(message) {
13
+ super(message);
14
+ this.name = "CompanionUnavailableError";
15
+ }
16
+ };
17
+ function isCompanionUnavailableError(error) {
18
+ return error instanceof CompanionUnavailableError;
19
+ }
11
20
  var CompanionRuntimeService = class {
12
21
  constructor(runtimeStore = companionRuntimeStore, uiDiscoveryService = localUiDiscoveryService) {
13
22
  this.runtimeStore = runtimeStore;
@@ -25,12 +34,21 @@ var CompanionRuntimeService = class {
25
34
  resolveDiscoveredBaseUrl = () => {
26
35
  return this.uiDiscoveryService.resolveApiBase();
27
36
  };
37
+ isAvailable = () => {
38
+ try {
39
+ this.resolveLaunchSpec();
40
+ return true;
41
+ } catch (error) {
42
+ if (isCompanionUnavailableError(error)) return false;
43
+ throw error;
44
+ }
45
+ };
28
46
  applyConfig = async (config) => {
29
47
  if (!config.companion.enabled) {
30
48
  await this.ensureStopped();
31
49
  return;
32
50
  }
33
- await this.ensureStarted({ baseUrl: this.uiDiscoveryService.resolveLocalOrigin(config) });
51
+ await this.ensureStartedIfAvailable({ baseUrl: this.uiDiscoveryService.resolveLocalOrigin(config) });
34
52
  };
35
53
  updateEnabled = async (enabled, options = {}) => {
36
54
  const config = loadConfig(getConfigPath());
@@ -45,11 +63,11 @@ var CompanionRuntimeService = class {
45
63
  if (enabled) {
46
64
  const explicitBaseUrl = options.baseUrl?.trim();
47
65
  if (explicitBaseUrl) {
48
- await this.ensureStarted({ baseUrl: explicitBaseUrl });
66
+ await this.ensureStartedIfAvailable({ baseUrl: explicitBaseUrl });
49
67
  return next;
50
68
  }
51
69
  const discoveredBaseUrl = this.uiDiscoveryService.resolveApiBase();
52
- if (discoveredBaseUrl) await this.ensureStarted({ baseUrl: discoveredBaseUrl });
70
+ if (discoveredBaseUrl) await this.ensureStartedIfAvailable({ baseUrl: discoveredBaseUrl });
53
71
  return next;
54
72
  }
55
73
  await this.ensureStopped();
@@ -120,11 +138,25 @@ var CompanionRuntimeService = class {
120
138
  killProcess = (pid, force) => {
121
139
  process.kill(pid, force ? "SIGKILL" : "SIGTERM");
122
140
  };
141
+ ensureStartedIfAvailable = async (options) => {
142
+ try {
143
+ return await this.ensureStarted(options);
144
+ } catch (error) {
145
+ if (!isCompanionUnavailableError(error)) throw error;
146
+ console.warn(error.message);
147
+ return null;
148
+ }
149
+ };
123
150
  resolveLaunchSpec = () => {
124
- const packageJsonPath = require.resolve("@nextclaw/companion/package.json");
151
+ let packageJsonPath;
152
+ try {
153
+ packageJsonPath = require.resolve("@nextclaw/companion/package.json");
154
+ } catch {
155
+ throw new CompanionUnavailableError("@nextclaw/companion is not installed. Install it separately to use the companion shell.");
156
+ }
125
157
  const packageRoot = dirname(packageJsonPath);
126
158
  const mainPath = resolve(packageRoot, "dist", "src", "main.js");
127
- if (!existsSync(mainPath)) throw new Error(`Companion app build is missing at ${mainPath}. Build @nextclaw/companion first.`);
159
+ if (!existsSync(mainPath)) throw new CompanionUnavailableError(`Companion app build is missing at ${mainPath}. Install or build @nextclaw/companion separately to use the companion shell.`);
128
160
  return {
129
161
  command: createRequire(packageJsonPath)("electron"),
130
162
  args: [packageRoot]
@@ -1,6 +1,6 @@
1
1
  import { isProcessRunning } from "../../utils/cli.utils.js";
2
- import { localUiRuntimeStore } from "../../stores/local-ui-runtime.store.js";
3
2
  import { managedServiceStateStore } from "../../stores/managed-service-state.store.js";
3
+ import { localUiRuntimeStore } from "../../stores/local-ui-runtime.store.js";
4
4
  import { resolveLocalUiBaseUrl } from "@nextclaw/core";
5
5
  //#region src/shared/services/ui/local-ui-discovery.service.ts
6
6
  var LocalUiDiscoveryService = class {
@@ -1,9 +1,9 @@
1
1
  import { NpmRuntimeBundleLayoutStore } from "../../../launcher/npm-runtime-bundle-layout.store.js";
2
2
  import { NpmRuntimeBundleService } from "../../../launcher/npm-runtime-bundle.service.js";
3
- import { NpmRuntimeUpdateSourceService } from "../../../launcher/npm-runtime-update-source.service.js";
4
- import { NpmRuntimeUpdateStateStore } from "../../../launcher/npm-runtime-update-state.store.js";
5
3
  import { NpmRuntimeUpdateManager } from "../../../launcher/npm-runtime-update.manager.js";
6
4
  import { NpmRuntimeUpdateService } from "../../../launcher/npm-runtime-update.service.js";
5
+ import { NpmRuntimeUpdateSourceService } from "../../../launcher/npm-runtime-update-source.service.js";
6
+ import { NpmRuntimeUpdateStateStore } from "../../../launcher/npm-runtime-update-state.store.js";
7
7
  import { NextclawDistributionService } from "../runtime/nextclaw-distribution.service.js";
8
8
  import { requestManagedServiceRestart } from "./service-remote-access.service.js";
9
9
  import { eventKeys } from "@nextclaw/shared";
@@ -1,6 +1,6 @@
1
- import { pendingRestartStore } from "../../stores/pending-restart.store.js";
2
1
  import { controlRemoteService, resolveRemoteServiceView } from "../../../commands/remote/services/remote-service-control.service.js";
3
2
  import { requestManagedServiceRestart } from "./service-remote-access.service.js";
3
+ import { pendingRestartStore } from "../../stores/pending-restart.store.js";
4
4
  //#region src/shared/services/ui/runtime-control-host.service.ts
5
5
  const MANAGED_SERVICE_OWNER_LABEL = "Managed local service";
6
6
  const DESKTOP_APP_ONLY_REASON = "App restart is only available in the desktop shell.";
@@ -1,7 +1,7 @@
1
- import { RemoteAccessHost } from "../../../commands/remote/services/remote-access-host.service.js";
2
1
  import { RemoteCommands } from "../../../commands/remote/index.js";
3
2
  import { PlatformAuthCommands } from "../../../commands/platform-auth/services/platform-auth-commands.service.js";
4
3
  import "../../../commands/platform-auth/index.js";
4
+ import { RemoteAccessHost } from "../../../commands/remote/services/remote-access-host.service.js";
5
5
  //#region src/shared/services/ui/service-remote-access.service.ts
6
6
  function requestManagedServiceRestart(requestRestart, options = {}) {
7
7
  const uiPort = typeof options.uiPort === "number" && Number.isFinite(options.uiPort) ? Math.floor(options.uiPort) : void 0;
@@ -1,9 +1,9 @@
1
1
  import { findExecutableOnPath } from "../../utils/cli.utils.js";
2
- import { spawnSync } from "node:child_process";
3
- import { fileURLToPath } from "node:url";
4
- import { dirname, join, resolve } from "node:path";
5
2
  import { APP_NAME, getDataDir } from "@nextclaw/core";
6
3
  import { cpSync, existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
4
+ import { dirname, join, resolve } from "node:path";
5
+ import { fileURLToPath } from "node:url";
6
+ import { spawnSync } from "node:child_process";
7
7
  //#region src/shared/services/workspace/workspace-manager.service.ts
8
8
  var WorkspaceManager = class {
9
9
  constructor(logo) {
@@ -1,6 +1,6 @@
1
- import { resolve } from "node:path";
2
1
  import { getDataDir } from "@nextclaw/core";
3
2
  import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
3
+ import { resolve } from "node:path";
4
4
  //#region src/shared/stores/companion-runtime.store.ts
5
5
  var CompanionRuntimeStore = class {
6
6
  get path() {
@@ -1,7 +1,7 @@
1
1
  import { resolveUiApiBase } from "../utils/cli.utils.js";
2
- import { resolve } from "node:path";
3
2
  import { getDataDir } from "@nextclaw/core";
4
3
  import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
4
+ import { resolve } from "node:path";
5
5
  //#region src/shared/stores/local-ui-runtime.store.ts
6
6
  var LocalUiRuntimeStore = class {
7
7
  get path() {
@@ -1,6 +1,6 @@
1
- import { resolve } from "node:path";
2
1
  import { getDataDir } from "@nextclaw/core";
3
2
  import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
3
+ import { resolve } from "node:path";
4
4
  //#region src/shared/stores/managed-service-state.store.ts
5
5
  var ManagedServiceStateStore = class {
6
6
  get path() {
@@ -16,19 +16,6 @@ type StartCommandOptions = {
16
16
  open?: boolean;
17
17
  startTimeout?: string | number;
18
18
  };
19
- type CompanionStartCommandOptions = {
20
- baseUrl?: string;
21
- };
22
- type CompanionEnableCommandOptions = {
23
- baseUrl?: string;
24
- };
25
- type CompanionDisableCommandOptions = Record<string, never>;
26
- type CompanionStatusCommandOptions = {
27
- json?: boolean;
28
- };
29
- type CompanionStopCommandOptions = {
30
- force?: boolean;
31
- };
32
19
  type ServiceAutostartCommandOptions = {
33
20
  user?: boolean;
34
21
  system?: boolean;
@@ -292,4 +279,4 @@ type RequestRestartParams = {
292
279
  mode?: "execute" | "notify";
293
280
  };
294
281
  //#endregion
295
- export { AccountCommandOptions, AccountSetUsernameCommandOptions, AgentCommandOptions, AgentsListCommandOptions, AgentsNewCommandOptions, AgentsRemoveCommandOptions, AgentsRuntimesCommandOptions, AgentsUpdateCommandOptions, ChannelsAddOptions, ChannelsLoginOptions, CompanionDisableCommandOptions, CompanionEnableCommandOptions, CompanionStartCommandOptions, CompanionStatusCommandOptions, CompanionStopCommandOptions, ConfigGetOptions, ConfigSetOptions, CronAddOptions, DoctorCommandOptions, GatewayCommandOptions, HealthProbe, LoginCommandOptions, LogsTailCommandOptions, MarketplaceSkillsRecommendCommandOptions, MarketplaceSkillsSearchCommandOptions, McpAddCommandOptions, McpDoctorOptions, McpListOptions, PluginsInfoOptions, PluginsInstallOptions, PluginsListOptions, PluginsUninstallOptions, type RemoteConnectCommandOptions, type RemoteDoctorCommandOptions, type RemoteEnableCommandOptions, type RemoteStatusCommandOptions, RequestRestartParams, RuntimeStatusReport, SecretsApplyOptions, SecretsAuditOptions, SecretsConfigureOptions, SecretsReloadOptions, ServiceAutostartCommandOptions, SkillsInfoCommandOptions, SkillsInstalledCommandOptions, StartCommandOptions, StatusCommandOptions, UiCommandOptions, UpdateCommandOptions, UsageCommandOptions };
282
+ export { AccountCommandOptions, AccountSetUsernameCommandOptions, AgentCommandOptions, AgentsListCommandOptions, AgentsNewCommandOptions, AgentsRemoveCommandOptions, AgentsRuntimesCommandOptions, AgentsUpdateCommandOptions, ChannelsAddOptions, ChannelsLoginOptions, ConfigGetOptions, ConfigSetOptions, CronAddOptions, DoctorCommandOptions, GatewayCommandOptions, HealthProbe, LoginCommandOptions, LogsTailCommandOptions, MarketplaceSkillsRecommendCommandOptions, MarketplaceSkillsSearchCommandOptions, McpAddCommandOptions, McpDoctorOptions, McpListOptions, PluginsInfoOptions, PluginsInstallOptions, PluginsListOptions, PluginsUninstallOptions, type RemoteConnectCommandOptions, type RemoteDoctorCommandOptions, type RemoteEnableCommandOptions, type RemoteStatusCommandOptions, RequestRestartParams, RuntimeStatusReport, SecretsApplyOptions, SecretsAuditOptions, SecretsConfigureOptions, SecretsReloadOptions, ServiceAutostartCommandOptions, SkillsInfoCommandOptions, SkillsInstalledCommandOptions, StartCommandOptions, StatusCommandOptions, UiCommandOptions, UpdateCommandOptions, UsageCommandOptions };
@@ -1,8 +1,8 @@
1
1
  import { getPackageVersion } from "./package/package-manifest.utils.js";
2
- import { spawn, spawnSync } from "node:child_process";
3
- import { join, resolve } from "node:path";
4
2
  import { createExternalCommandEnv, getLogsPath, resolveLocalUiBaseUrl } from "@nextclaw/core";
5
3
  import { existsSync } from "node:fs";
4
+ import { join, resolve } from "node:path";
5
+ import { spawn, spawnSync } from "node:child_process";
6
6
  import { isIP } from "node:net";
7
7
  //#region src/shared/utils/cli.utils.ts
8
8
  function resolveUiConfig(config, overrides) {
@@ -1,6 +1,6 @@
1
1
  import { createRequire } from "node:module";
2
- import { fileURLToPath } from "node:url";
3
2
  import { extname, resolve } from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
4
  //#region src/shared/utils/marketplace/cli-subcommand-launch.utils.ts
5
5
  const require = createRequire(import.meta.url);
6
6
  const TYPESCRIPT_EXTENSIONS = new Set([
@@ -1,7 +1,7 @@
1
- import { fileURLToPath } from "node:url";
2
- import { join, resolve } from "node:path";
3
1
  import { getPackageVersion as getPackageVersion$1 } from "@nextclaw/core";
4
2
  import { readFileSync } from "node:fs";
3
+ import { join, resolve } from "node:path";
4
+ import { fileURLToPath } from "node:url";
5
5
  //#region src/shared/utils/package/package-manifest.utils.ts
6
6
  function readPackageManifest(pkgPath) {
7
7
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nextclaw/service",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "private": false,
5
5
  "description": "NextClaw long-running service host and runtime lifecycle.",
6
6
  "type": "module",
@@ -26,6 +26,7 @@
26
26
  ],
27
27
  "nextclaw": {
28
28
  "builtinExtensions": [
29
+ "@nextclaw/channel-extension-feishu",
29
30
  "@nextclaw/channel-extension-weixin"
30
31
  ]
31
32
  },
@@ -34,23 +35,24 @@
34
35
  "commander": "^12.1.0",
35
36
  "jszip": "^3.10.1",
36
37
  "yaml": "^2.8.1",
37
- "@nextclaw/channel-extension-weixin": "0.1.2",
38
- "@nextclaw/core": "0.12.15",
39
- "@nextclaw/ncp-agent-runtime": "0.3.18",
40
- "@nextclaw/kernel": "0.1.4",
41
- "@nextclaw/ncp-http-agent-server": "0.3.20",
42
- "@nextclaw/ncp": "0.5.8",
43
- "@nextclaw/ncp-mcp": "0.1.82",
44
- "@nextclaw/nextclaw-ncp-runtime-http-client": "0.1.7",
45
- "@nextclaw/ncp-toolkit": "0.5.13",
46
- "@nextclaw/mcp": "0.1.80",
47
- "@nextclaw/openclaw-compat": "1.0.15",
48
- "@nextclaw/remote": "0.1.92",
49
- "@nextclaw/nextclaw-ncp-runtime-stdio-client": "0.1.8",
50
- "@nextclaw/shared": "0.1.2",
51
- "@nextclaw/server": "0.12.15",
52
- "@nextclaw/runtime": "0.2.47",
53
- "@nextclaw/nextclaw-hermes-acp-bridge": "0.1.7"
38
+ "@nextclaw/channel-extension-feishu": "0.1.1",
39
+ "@nextclaw/core": "0.12.17",
40
+ "@nextclaw/kernel": "0.1.6",
41
+ "@nextclaw/mcp": "0.1.82",
42
+ "@nextclaw/channel-extension-weixin": "0.1.4",
43
+ "@nextclaw/ncp-http-agent-server": "0.3.22",
44
+ "@nextclaw/ncp": "0.5.10",
45
+ "@nextclaw/ncp-toolkit": "0.5.15",
46
+ "@nextclaw/openclaw-compat": "1.0.17",
47
+ "@nextclaw/nextclaw-hermes-acp-bridge": "0.1.9",
48
+ "@nextclaw/nextclaw-ncp-runtime-stdio-client": "0.1.10",
49
+ "@nextclaw/ncp-agent-runtime": "0.3.20",
50
+ "@nextclaw/nextclaw-ncp-runtime-http-client": "0.1.9",
51
+ "@nextclaw/remote": "0.1.94",
52
+ "@nextclaw/ncp-mcp": "0.1.84",
53
+ "@nextclaw/runtime": "0.2.49",
54
+ "@nextclaw/shared": "0.1.4",
55
+ "@nextclaw/server": "0.12.17"
54
56
  },
55
57
  "devDependencies": {
56
58
  "@types/node": "^20.17.6",
@@ -60,7 +62,7 @@
60
62
  "vitest": "^4.1.2"
61
63
  },
62
64
  "scripts": {
63
- "build": "tsdown $(find src -name '*.ts' ! -name '*.test.ts' ! -path '*/tests/*') --dts --clean --target es2022 --no-fixedExtension --unbundle",
65
+ "build": "tsdown \"src/**/*.ts\" \"!src/**/*.test.ts\" \"!src/**/tests/**\" --dts --clean --target es2022 --no-fixedExtension --unbundle",
64
66
  "lint": "eslint .",
65
67
  "tsc": "tsc -p tsconfig.json",
66
68
  "test": "vitest"
@@ -1,15 +0,0 @@
1
- import { CompanionDisableCommandOptions, CompanionEnableCommandOptions, CompanionStartCommandOptions, CompanionStatusCommandOptions, CompanionStopCommandOptions } from "../../../shared/types/cli.types.js";
2
- import { CompanionProcessService } from "./services/companion-process.service.js";
3
-
4
- //#region src/cli/commands/companion/index.d.ts
5
- declare class CompanionCommands {
6
- private readonly companionProcessService;
7
- constructor(companionProcessService?: CompanionProcessService);
8
- readonly start: (options?: CompanionStartCommandOptions) => Promise<void>;
9
- readonly enable: (options?: CompanionEnableCommandOptions) => Promise<void>;
10
- readonly disable: (options?: CompanionDisableCommandOptions) => Promise<void>;
11
- readonly status: (options?: CompanionStatusCommandOptions) => Promise<void>;
12
- readonly stop: (options?: CompanionStopCommandOptions) => Promise<void>;
13
- }
14
- //#endregion
15
- export { CompanionCommands };
@@ -1,24 +0,0 @@
1
- import { CompanionProcessService } from "./services/companion-process.service.js";
2
- //#region src/cli/commands/companion/index.ts
3
- var CompanionCommands = class {
4
- constructor(companionProcessService = new CompanionProcessService()) {
5
- this.companionProcessService = companionProcessService;
6
- }
7
- start = async (options = {}) => {
8
- await this.companionProcessService.start(options);
9
- };
10
- enable = async (options = {}) => {
11
- await this.companionProcessService.enable(options);
12
- };
13
- disable = async (options = {}) => {
14
- await this.companionProcessService.disable(options);
15
- };
16
- status = async (options = {}) => {
17
- await this.companionProcessService.status(options);
18
- };
19
- stop = async (options = {}) => {
20
- await this.companionProcessService.stop(options);
21
- };
22
- };
23
- //#endregion
24
- export { CompanionCommands };
@@ -1,17 +0,0 @@
1
- import { CompanionDisableCommandOptions, CompanionEnableCommandOptions, CompanionStartCommandOptions, CompanionStatusCommandOptions, CompanionStopCommandOptions } from "../../../../shared/types/cli.types.js";
2
- import { CompanionRuntimeService } from "../../../../shared/services/ui/companion-runtime.service.js";
3
-
4
- //#region src/cli/commands/companion/services/companion-process.service.d.ts
5
- declare class CompanionProcessService {
6
- private readonly runtimeService;
7
- constructor(runtimeService?: CompanionRuntimeService);
8
- readonly start: (options?: CompanionStartCommandOptions) => Promise<void>;
9
- readonly status: (options?: CompanionStatusCommandOptions) => Promise<void>;
10
- readonly stop: (options?: CompanionStopCommandOptions) => Promise<void>;
11
- readonly enable: (options?: CompanionEnableCommandOptions) => Promise<void>;
12
- readonly disable: (_options?: CompanionDisableCommandOptions) => Promise<void>;
13
- private readonly resolveBaseUrl;
14
- private readonly printConfigEnabled;
15
- }
16
- //#endregion
17
- export { CompanionProcessService };
@@ -1,49 +0,0 @@
1
- import { companionRuntimeService } from "../../../../shared/services/ui/companion-runtime.service.js";
2
- import "@nextclaw/core";
3
- //#region src/cli/commands/companion/services/companion-process.service.ts
4
- var CompanionProcessService = class {
5
- constructor(runtimeService = companionRuntimeService) {
6
- this.runtimeService = runtimeService;
7
- }
8
- start = async (options = {}) => {
9
- const state = await this.runtimeService.ensureStarted({ baseUrl: this.resolveBaseUrl(options) });
10
- this.runtimeService.printStarted(state);
11
- };
12
- status = async (options = {}) => {
13
- this.runtimeService.printStatus(options);
14
- };
15
- stop = async (options = {}) => {
16
- const stopped = await this.runtimeService.ensureStopped(options);
17
- this.runtimeService.printStopped(stopped);
18
- };
19
- enable = async (options = {}) => {
20
- const nextConfig = await this.runtimeService.updateEnabled(true, options);
21
- this.printConfigEnabled(nextConfig, options.baseUrl);
22
- };
23
- disable = async (_options = {}) => {
24
- const nextConfig = await this.runtimeService.updateEnabled(false);
25
- console.log(nextConfig.companion.enabled ? "Companion remains enabled." : "Companion feature disabled. It will stay off until you enable it again.");
26
- };
27
- resolveBaseUrl = (options) => {
28
- const explicitBaseUrl = options.baseUrl?.trim();
29
- if (explicitBaseUrl) return explicitBaseUrl.replace(/\/+$/, "");
30
- const discoveredBaseUrl = this.runtimeService.resolveDiscoveredBaseUrl();
31
- if (discoveredBaseUrl) return discoveredBaseUrl;
32
- const runningState = this.runtimeService.getRunningState();
33
- if (runningState) return runningState.baseUrl;
34
- throw new Error("Cannot resolve NextClaw UI base URL. Start NextClaw first or pass --base-url.");
35
- };
36
- printConfigEnabled = (config, baseUrl) => {
37
- if (this.runtimeService.getRunningState()) {
38
- console.log("Companion feature enabled and companion started.");
39
- return;
40
- }
41
- if (baseUrl?.trim()) {
42
- console.log("Companion feature enabled.");
43
- return;
44
- }
45
- console.log(config.companion.enabled ? "Companion feature enabled. It will auto-start the next time a local NextClaw runtime is available." : "Companion feature is not enabled.");
46
- };
47
- };
48
- //#endregion
49
- export { CompanionProcessService };