@nextclaw/service 0.1.10 → 0.1.11
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/commands/agent/cli-agent-runner.utils.d.ts +0 -5
- package/dist/commands/channel/channel-list-view.service.d.ts +7 -13
- package/dist/commands/channel/channel-list-view.service.js +15 -19
- package/dist/commands/channel/index.js +3 -8
- package/dist/commands/plugin/plugin-registry-loader.utils.d.ts +1 -2
- package/dist/service-runtime.service.js +2 -9
- package/package.json +19 -19
|
@@ -11,11 +11,6 @@ declare function runCliAgentCommand(params: {
|
|
|
11
11
|
kernel: NextclawKernel;
|
|
12
12
|
providerManager: LlmProviderRuntime;
|
|
13
13
|
extensionRegistry: NextclawExtensionRegistry;
|
|
14
|
-
loadResolvedConfig: () => Config;
|
|
15
|
-
resolveMessageToolHints: (params: {
|
|
16
|
-
channel: string;
|
|
17
|
-
accountId?: string | null;
|
|
18
|
-
}) => string[];
|
|
19
14
|
}): Promise<void>;
|
|
20
15
|
//#endregion
|
|
21
16
|
export { runCliAgentCommand };
|
|
@@ -4,25 +4,18 @@ import { PluginChannelBinding } from "@nextclaw/openclaw-compat";
|
|
|
4
4
|
//#region src/commands/channel/channel-list-view.service.d.ts
|
|
5
5
|
type ChannelListEntry = {
|
|
6
6
|
id: string;
|
|
7
|
-
label: string;
|
|
8
|
-
pluginId: string;
|
|
9
7
|
enabled: boolean;
|
|
10
|
-
outbound: {
|
|
11
|
-
text: boolean;
|
|
12
|
-
};
|
|
13
|
-
auth: {
|
|
14
|
-
login: boolean;
|
|
15
|
-
};
|
|
16
8
|
defaultAccountId?: string;
|
|
9
|
+
accounts?: ChannelListAccount[];
|
|
10
|
+
};
|
|
11
|
+
type ChannelListAccount = {
|
|
12
|
+
id: string;
|
|
13
|
+
userId?: string;
|
|
17
14
|
};
|
|
18
15
|
type ChannelListOutput = {
|
|
19
16
|
channels: ChannelListEntry[];
|
|
20
17
|
};
|
|
21
18
|
declare class ChannelListViewService {
|
|
22
|
-
private readonly params;
|
|
23
|
-
constructor(params: {
|
|
24
|
-
channelLabels: Record<string, string>;
|
|
25
|
-
});
|
|
26
19
|
build: (params: {
|
|
27
20
|
config: Config;
|
|
28
21
|
workspaceDir: string;
|
|
@@ -31,9 +24,10 @@ declare class ChannelListViewService {
|
|
|
31
24
|
private toManifestChannelSources;
|
|
32
25
|
private toPluginChannelSource;
|
|
33
26
|
private toChannelListEntry;
|
|
27
|
+
private resolveAccounts;
|
|
34
28
|
private mergeChannelSources;
|
|
35
29
|
private discoverExtensionManifests;
|
|
36
30
|
private resolveDefaultAccountId;
|
|
37
31
|
}
|
|
38
32
|
//#endregion
|
|
39
|
-
export { ChannelListEntry, ChannelListOutput, ChannelListViewService };
|
|
33
|
+
export { ChannelListAccount, ChannelListEntry, ChannelListOutput, ChannelListViewService };
|
|
@@ -10,9 +10,6 @@ function readString(value) {
|
|
|
10
10
|
return typeof value === "string" && value.trim().length > 0 ? value.trim() : void 0;
|
|
11
11
|
}
|
|
12
12
|
var ChannelListViewService = class {
|
|
13
|
-
constructor(params) {
|
|
14
|
-
this.params = params;
|
|
15
|
-
}
|
|
16
13
|
build = (params) => {
|
|
17
14
|
const { config, pluginBindings, workspaceDir } = params;
|
|
18
15
|
const sources = this.mergeChannelSources(pluginBindings.map(this.toPluginChannelSource), this.toManifestChannelSources(this.discoverExtensionManifests(config, workspaceDir)));
|
|
@@ -26,38 +23,37 @@ var ChannelListViewService = class {
|
|
|
26
23
|
for (const channel of channels) {
|
|
27
24
|
const channelId = readString(channel.id);
|
|
28
25
|
if (!channelId) continue;
|
|
29
|
-
sources.push({
|
|
30
|
-
pluginId: manifest.id,
|
|
31
|
-
id: channelId,
|
|
32
|
-
label: readString(channel.name) ?? this.params.channelLabels[channelId] ?? channelId,
|
|
33
|
-
outboundText: channel.outbound?.text === true,
|
|
34
|
-
login: Boolean(channel.auth)
|
|
35
|
-
});
|
|
26
|
+
sources.push({ id: channelId });
|
|
36
27
|
}
|
|
37
28
|
}
|
|
38
29
|
return sources;
|
|
39
30
|
};
|
|
40
31
|
toPluginChannelSource = (binding) => ({
|
|
41
32
|
id: binding.channelId,
|
|
42
|
-
label: readString(binding.channel.meta?.label) ?? this.params.channelLabels[binding.channelId] ?? binding.channelId,
|
|
43
|
-
pluginId: binding.pluginId,
|
|
44
|
-
outboundText: typeof binding.channel.outbound?.sendText === "function",
|
|
45
|
-
login: typeof binding.channel.auth?.login === "function",
|
|
46
33
|
resolveDefaultAccountId: (channelConfig) => this.resolveDefaultAccountId(binding, channelConfig)
|
|
47
34
|
});
|
|
48
35
|
toChannelListEntry = (source, rawChannelConfig) => {
|
|
49
36
|
const channelConfig = readRecord(rawChannelConfig);
|
|
50
37
|
const defaultAccountId = readString(channelConfig?.defaultAccountId) ?? source.resolveDefaultAccountId?.(channelConfig);
|
|
38
|
+
const accounts = this.resolveAccounts(channelConfig);
|
|
51
39
|
return {
|
|
52
40
|
id: source.id,
|
|
53
|
-
label: source.label,
|
|
54
|
-
pluginId: source.pluginId,
|
|
55
41
|
enabled: channelConfig?.enabled === true,
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
...defaultAccountId ? { defaultAccountId } : {}
|
|
42
|
+
...defaultAccountId ? { defaultAccountId } : {},
|
|
43
|
+
...accounts.length > 0 ? { accounts } : {}
|
|
59
44
|
};
|
|
60
45
|
};
|
|
46
|
+
resolveAccounts = (channelConfig) => {
|
|
47
|
+
const accounts = readRecord(channelConfig?.accounts);
|
|
48
|
+
if (!accounts) return [];
|
|
49
|
+
return Object.entries(accounts).map(([id, rawAccount]) => {
|
|
50
|
+
const userId = readString(readRecord(rawAccount)?.userId);
|
|
51
|
+
return {
|
|
52
|
+
id,
|
|
53
|
+
...userId ? { userId } : {}
|
|
54
|
+
};
|
|
55
|
+
}).sort((left, right) => left.id.localeCompare(right.id));
|
|
56
|
+
};
|
|
61
57
|
mergeChannelSources = (pluginSources, extensionSources) => {
|
|
62
58
|
const sourcesByChannelId = /* @__PURE__ */ new Map();
|
|
63
59
|
for (const source of [...pluginSources, ...extensionSources]) sourcesByChannelId.set(source.id, source);
|
|
@@ -24,7 +24,7 @@ function resolveChannelBindings(pluginRegistry) {
|
|
|
24
24
|
return getPluginChannelBindings(pluginRegistry);
|
|
25
25
|
}
|
|
26
26
|
var ChannelCommands = class {
|
|
27
|
-
channelListView = new ChannelListViewService(
|
|
27
|
+
channelListView = new ChannelListViewService();
|
|
28
28
|
constructor(deps) {
|
|
29
29
|
this.deps = deps;
|
|
30
30
|
}
|
|
@@ -61,13 +61,8 @@ var ChannelCommands = class {
|
|
|
61
61
|
}
|
|
62
62
|
console.log("Channels");
|
|
63
63
|
for (const channel of output.channels) {
|
|
64
|
-
const flags = [
|
|
65
|
-
|
|
66
|
-
channel.outbound.text ? "outbound:text" : void 0,
|
|
67
|
-
channel.auth.login ? "login" : void 0,
|
|
68
|
-
channel.defaultAccountId ? `defaultAccountId=${channel.defaultAccountId}` : void 0
|
|
69
|
-
].filter(Boolean);
|
|
70
|
-
console.log(`- ${channel.id} (${channel.label}) [${flags.join(", ")}] plugin=${channel.pluginId}`);
|
|
64
|
+
const flags = [channel.enabled ? "enabled" : "disabled", channel.defaultAccountId ? `defaultAccountId=${channel.defaultAccountId}` : void 0].filter(Boolean);
|
|
65
|
+
console.log(`- ${channel.id} [${flags.join(", ")}]`);
|
|
71
66
|
}
|
|
72
67
|
};
|
|
73
68
|
login = async (opts = {}) => {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Config } from "@nextclaw/core";
|
|
2
|
-
import * as _$_nextclaw_openclaw_compat0 from "@nextclaw/openclaw-compat";
|
|
3
2
|
import { PluginRegistry } from "@nextclaw/openclaw-compat";
|
|
4
3
|
|
|
5
4
|
//#region src/commands/plugin/plugin-registry-loader.utils.d.ts
|
|
@@ -9,7 +8,7 @@ declare function loadPluginRegistryProgressively(config: Config, workspaceDir: s
|
|
|
9
8
|
pluginId?: string;
|
|
10
9
|
}) => void;
|
|
11
10
|
}): Promise<PluginRegistry>;
|
|
12
|
-
declare function discoverPluginRegistryStatus(config: Config, workspaceDir: string):
|
|
11
|
+
declare function discoverPluginRegistryStatus(config: Config, workspaceDir: string): any;
|
|
13
12
|
declare function createEmptyPluginRegistry(): PluginRegistry;
|
|
14
13
|
//#endregion
|
|
15
14
|
export { createEmptyPluginRegistry, discoverPluginRegistryStatus, loadPluginRegistryProgressively };
|
|
@@ -44,7 +44,7 @@ import "./cli/commands/usage/index.js";
|
|
|
44
44
|
import { APP_NAME, DEFAULT_WORKSPACE_DIR, DEFAULT_WORKSPACE_PATH, expandHome, getConfigPath, getDataDir, getWorkspacePath, loadConfig, resolveConfigSecrets, saveConfig } from "@nextclaw/core";
|
|
45
45
|
import { NextclawKernel } from "@nextclaw/kernel";
|
|
46
46
|
import { RemoteRuntimeActions } from "@nextclaw/remote";
|
|
47
|
-
import { getPluginChannelBindings,
|
|
47
|
+
import { getPluginChannelBindings, setPluginRuntimeBridge } from "@nextclaw/openclaw-compat";
|
|
48
48
|
import { existsSync, mkdirSync } from "node:fs";
|
|
49
49
|
import { join } from "node:path";
|
|
50
50
|
import { spawn } from "node:child_process";
|
|
@@ -362,14 +362,7 @@ var NextclawServiceRuntime = class {
|
|
|
362
362
|
config,
|
|
363
363
|
kernel,
|
|
364
364
|
providerManager,
|
|
365
|
-
extensionRegistry
|
|
366
|
-
loadResolvedConfig: () => resolveConfigSecrets(loadConfig(), { configPath }),
|
|
367
|
-
resolveMessageToolHints: ({ channel, accountId }) => resolvePluginChannelMessageToolHints({
|
|
368
|
-
registry: pluginRegistry,
|
|
369
|
-
channel,
|
|
370
|
-
cfg: resolveConfigSecrets(loadConfig(), { configPath }),
|
|
371
|
-
accountId
|
|
372
|
-
})
|
|
365
|
+
extensionRegistry
|
|
373
366
|
});
|
|
374
367
|
} finally {
|
|
375
368
|
setPluginRuntimeBridge(null);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nextclaw/service",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.11",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "NextClaw long-running service host and runtime lifecycle.",
|
|
6
6
|
"type": "module",
|
|
@@ -35,24 +35,24 @@
|
|
|
35
35
|
"commander": "^12.1.0",
|
|
36
36
|
"jszip": "^3.10.1",
|
|
37
37
|
"yaml": "^2.8.1",
|
|
38
|
-
"@nextclaw/
|
|
39
|
-
"@nextclaw/
|
|
40
|
-
"@nextclaw/
|
|
41
|
-
"@nextclaw/
|
|
42
|
-
"@nextclaw/
|
|
43
|
-
"@nextclaw/ncp": "0.5.
|
|
44
|
-
"@nextclaw/
|
|
45
|
-
"@nextclaw/nextclaw-hermes-acp-bridge": "0.1.
|
|
46
|
-
"@nextclaw/ncp-http-agent-server": "0.3.
|
|
47
|
-
"@nextclaw/ncp-toolkit": "0.5.
|
|
48
|
-
"@nextclaw/ncp-
|
|
49
|
-
"@nextclaw/
|
|
50
|
-
"@nextclaw/
|
|
51
|
-
"@nextclaw/
|
|
52
|
-
"@nextclaw/
|
|
53
|
-
"@nextclaw/
|
|
54
|
-
"@nextclaw/
|
|
55
|
-
"@nextclaw/server": "0.12.
|
|
38
|
+
"@nextclaw/channel-extension-feishu": "0.1.3",
|
|
39
|
+
"@nextclaw/kernel": "0.1.8",
|
|
40
|
+
"@nextclaw/mcp": "0.1.84",
|
|
41
|
+
"@nextclaw/core": "0.12.19",
|
|
42
|
+
"@nextclaw/channel-extension-weixin": "0.1.6",
|
|
43
|
+
"@nextclaw/ncp": "0.5.12",
|
|
44
|
+
"@nextclaw/ncp-agent-runtime": "0.3.22",
|
|
45
|
+
"@nextclaw/nextclaw-hermes-acp-bridge": "0.1.11",
|
|
46
|
+
"@nextclaw/ncp-http-agent-server": "0.3.24",
|
|
47
|
+
"@nextclaw/ncp-toolkit": "0.5.17",
|
|
48
|
+
"@nextclaw/nextclaw-ncp-runtime-http-client": "0.1.11",
|
|
49
|
+
"@nextclaw/ncp-mcp": "0.1.86",
|
|
50
|
+
"@nextclaw/nextclaw-ncp-runtime-stdio-client": "0.1.12",
|
|
51
|
+
"@nextclaw/remote": "0.1.96",
|
|
52
|
+
"@nextclaw/shared": "0.1.6",
|
|
53
|
+
"@nextclaw/runtime": "0.2.51",
|
|
54
|
+
"@nextclaw/openclaw-compat": "1.0.19",
|
|
55
|
+
"@nextclaw/server": "0.12.19"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@types/node": "^20.17.6",
|