@nextclaw/service 0.1.3 → 0.1.4

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.
@@ -4,6 +4,7 @@ import { UpdateSnapshot } from "@nextclaw/kernel/update-contract";
4
4
  //#region src/launcher/npm-runtime-update-command.service.d.ts
5
5
  type NpmRuntimeUpdateCommandServiceOptions = {
6
6
  launcherVersion?: string;
7
+ packagedPublicKeyPath?: string;
7
8
  };
8
9
  declare class NpmRuntimeUpdateCommandService {
9
10
  private readonly options;
@@ -18,7 +18,7 @@ var NpmRuntimeUpdateCommandService = class {
18
18
  return snapshot;
19
19
  };
20
20
  runManaged = async (opts) => {
21
- const source = new NpmRuntimeUpdateSourceService();
21
+ const source = new NpmRuntimeUpdateSourceService({ packagedPublicKeyPath: this.options.packagedPublicKeyPath });
22
22
  const launcherVersion = this.options.launcherVersion ?? getPackageVersion();
23
23
  const channel = source.resolveChannel(opts.channel, launcherVersion);
24
24
  const manifestUrl = source.resolveManifestUrl(channel, opts.manifestUrl);
@@ -4,12 +4,14 @@ type NpmRuntimeUpdateSourceServiceOptions = {
4
4
  env?: NodeJS.ProcessEnv;
5
5
  platform?: NodeJS.Platform;
6
6
  arch?: string;
7
+ packagedPublicKeyPath?: string;
7
8
  };
8
9
  declare function inferDefaultNpmRuntimeReleaseChannel(launcherVersion?: string | null): NpmRuntimeReleaseChannel;
9
10
  declare class NpmRuntimeUpdateSourceService {
10
11
  private readonly env;
11
12
  private readonly platform;
12
13
  private readonly arch;
14
+ private readonly packagedPublicKeyPath?;
13
15
  constructor(options?: NpmRuntimeUpdateSourceServiceOptions);
14
16
  resolveChannel: (explicitChannel?: unknown, launcherVersion?: string | null) => NpmRuntimeReleaseChannel;
15
17
  resolveManifestUrl: (channel: NpmRuntimeReleaseChannel, explicitManifestUrl?: unknown) => string | null;
@@ -27,10 +27,12 @@ var NpmRuntimeUpdateSourceService = class {
27
27
  env;
28
28
  platform;
29
29
  arch;
30
+ packagedPublicKeyPath;
30
31
  constructor(options = {}) {
31
32
  this.env = options.env ?? process.env;
32
33
  this.platform = options.platform ?? process.platform;
33
34
  this.arch = options.arch ?? process.arch;
35
+ this.packagedPublicKeyPath = options.packagedPublicKeyPath;
34
36
  }
35
37
  resolveChannel = (explicitChannel, launcherVersion) => {
36
38
  if (explicitChannel !== void 0 || this.env.NEXTCLAW_UPDATE_CHANNEL !== void 0) return normalizeChannel(explicitChannel ?? this.env.NEXTCLAW_UPDATE_CHANNEL);
@@ -47,7 +49,7 @@ var NpmRuntimeUpdateSourceService = class {
47
49
  if (explicitPublicKey) return explicitPublicKey;
48
50
  const publicKeyPath = normalizeOptionalString(this.env.NEXTCLAW_UPDATE_BUNDLE_PUBLIC_KEY_PATH);
49
51
  if (!publicKeyPath || !existsSync(publicKeyPath)) {
50
- const packagedPublicKeyPath = resolvePackagedPublicKeyPath();
52
+ const packagedPublicKeyPath = this.packagedPublicKeyPath ?? resolvePackagedPublicKeyPath();
51
53
  return existsSync(packagedPublicKeyPath) ? readFileSync(packagedPublicKeyPath, "utf8").trim() : null;
52
54
  }
53
55
  return readFileSync(publicKeyPath, "utf8").trim();
@@ -24,6 +24,7 @@ import { RemoteRuntimeActions } from "@nextclaw/remote";
24
24
  type NextclawServiceRuntimeOptions = {
25
25
  logo?: string;
26
26
  version?: string;
27
+ packagedPublicKeyPath?: string;
27
28
  };
28
29
  type NextclawServiceRuntimeAccount = {
29
30
  status: (opts?: {
@@ -60,6 +61,7 @@ type NextclawServiceCommands = {
60
61
  declare class NextclawServiceRuntime {
61
62
  private logo;
62
63
  private productVersion;
64
+ private packagedPublicKeyPath?;
63
65
  private restartCoordinator;
64
66
  private serviceRestartTask;
65
67
  private selfRelaunchArmed;
@@ -54,6 +54,7 @@ const FORCED_PUBLIC_UI_HOST = "0.0.0.0";
54
54
  var NextclawServiceRuntime = class {
55
55
  logo;
56
56
  productVersion;
57
+ packagedPublicKeyPath;
57
58
  restartCoordinator;
58
59
  serviceRestartTask = null;
59
60
  selfRelaunchArmed = false;
@@ -68,6 +69,7 @@ var NextclawServiceRuntime = class {
68
69
  logStartupTrace("cli.runtime.constructor.begin");
69
70
  this.logo = options.logo ?? "🤖";
70
71
  this.productVersion = options.version ?? getPackageVersion$1();
72
+ this.packagedPublicKeyPath = options.packagedPublicKeyPath;
71
73
  this.workspaceManager = measureStartupSync("cli.runtime.workspace_manager", () => new WorkspaceManager(this.logo));
72
74
  this.runtimeCommandService = measureStartupSync("cli.runtime.runtime_command_service", () => new RuntimeCommandService({
73
75
  requestRestart: (params) => this.requestRestart(params),
@@ -381,7 +383,10 @@ var NextclawServiceRuntime = class {
381
383
  update = async (opts) => {
382
384
  const versionBefore = this.version;
383
385
  if (!opts.json) console.log(`Current npm launcher version: ${versionBefore}`);
384
- const snapshot = await new NpmRuntimeUpdateCommandService({ launcherVersion: versionBefore }).run(opts);
386
+ const snapshot = await new NpmRuntimeUpdateCommandService({
387
+ launcherVersion: versionBefore,
388
+ packagedPublicKeyPath: this.packagedPublicKeyPath
389
+ }).run(opts);
385
390
  if (snapshot.status === "blocked" || snapshot.status === "failed") process.exit(1);
386
391
  const state = managedServiceStateStore.read();
387
392
  if (snapshot.requiresRestart && state && isProcessRunning(state.pid)) console.log(`Tip: restart ${APP_NAME} to apply the update.`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nextclaw/service",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "private": false,
5
5
  "description": "NextClaw long-running service host and runtime lifecycle.",
6
6
  "type": "module",
@@ -34,23 +34,23 @@
34
34
  "commander": "^12.1.0",
35
35
  "jszip": "^3.10.1",
36
36
  "yaml": "^2.8.1",
37
- "@nextclaw/kernel": "0.1.3",
38
- "@nextclaw/mcp": "0.1.79",
39
37
  "@nextclaw/channel-extension-weixin": "0.1.1",
40
38
  "@nextclaw/core": "0.12.14",
39
+ "@nextclaw/kernel": "0.1.3",
40
+ "@nextclaw/mcp": "0.1.79",
41
+ "@nextclaw/ncp": "0.5.7",
41
42
  "@nextclaw/ncp-agent-runtime": "0.3.17",
42
43
  "@nextclaw/ncp-http-agent-server": "0.3.19",
43
44
  "@nextclaw/ncp-mcp": "0.1.81",
44
- "@nextclaw/ncp": "0.5.7",
45
+ "@nextclaw/ncp-toolkit": "0.5.12",
45
46
  "@nextclaw/nextclaw-hermes-acp-bridge": "0.1.6",
46
47
  "@nextclaw/nextclaw-ncp-runtime-http-client": "0.1.6",
47
- "@nextclaw/ncp-toolkit": "0.5.12",
48
48
  "@nextclaw/nextclaw-ncp-runtime-stdio-client": "0.1.7",
49
49
  "@nextclaw/openclaw-compat": "1.0.14",
50
- "@nextclaw/server": "0.12.14",
51
50
  "@nextclaw/remote": "0.1.91",
51
+ "@nextclaw/runtime": "0.2.46",
52
52
  "@nextclaw/shared": "0.1.1",
53
- "@nextclaw/runtime": "0.2.46"
53
+ "@nextclaw/server": "0.12.14"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@types/node": "^20.17.6",