openclaw-openagent 1.0.12 → 1.0.14
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/index.js +2 -0
- package/dist/src/config/config-schema.d.ts +9 -0
- package/dist/src/config/config-schema.js +6 -0
- package/dist/src/messaging/executor.d.ts +2 -3
- package/dist/src/messaging/executor.js +4 -31
- package/dist/src/plugin-ui/assets/openagent-override.js +124 -18
- package/dist/src/proxy/auth-proxy.js +5 -0
- package/dist/src/runtime/update-checker.d.ts +18 -0
- package/dist/src/runtime/update-checker.js +216 -0
- package/index.ts +3 -0
- package/package.json +1 -3
- package/src/app/channel-tools.ts +0 -249
- package/src/app/discovery-tools.ts +0 -273
- package/src/app/download-file-tool.ts +0 -133
- package/src/app/hooks.ts +0 -144
- package/src/app/index.ts +0 -84
- package/src/app/messaging-tools.ts +0 -79
- package/src/app/ops-tools.ts +0 -155
- package/src/app/remote-agent-tool.ts +0 -762
- package/src/app/types.ts +0 -68
- package/src/app/upload-file-tool.ts +0 -411
- package/src/app/verbose-preflight.ts +0 -190
- package/src/auth/config.ts +0 -266
- package/src/auth/credential-manager.ts +0 -146
- package/src/auth/index.ts +0 -24
- package/src/auth/verify.ts +0 -99
- package/src/channel.ts +0 -566
- package/src/compat.ts +0 -94
- package/src/config/config-schema.ts +0 -39
- package/src/messaging/aggregator.ts +0 -120
- package/src/messaging/collector.ts +0 -89
- package/src/messaging/executor.ts +0 -72
- package/src/messaging/inbound.ts +0 -150
- package/src/messaging/index.ts +0 -11
- package/src/messaging/mention-protocol.ts +0 -94
- package/src/messaging/process-c2c-request.ts +0 -564
- package/src/messaging/process-message.ts +0 -373
- package/src/messaging/scheduler.ts +0 -55
- package/src/messaging/types.ts +0 -38
- package/src/plugin-ui/adapters/oc-2026-04.js +0 -103
- package/src/plugin-ui/adapters/oc-2026-05.js +0 -125
- package/src/plugin-ui/adapters/oc-2026-06.js +0 -125
- package/src/plugin-ui/adapters/oc-unknown.js +0 -48
- package/src/plugin-ui/assets/agentbook-icon.svg +0 -5
- package/src/plugin-ui/assets/bg.png +0 -0
- package/src/plugin-ui/assets/icon.png +0 -0
- package/src/plugin-ui/assets/magic.svg +0 -5
- package/src/plugin-ui/assets/openagent-override.js +0 -11156
- package/src/plugin-ui/build.cjs +0 -463
- package/src/plugin-ui/index.ts +0 -18
- package/src/plugin-ui/modules/agent-book/panel/agent-book.js +0 -570
- package/src/plugin-ui/modules/agent-book/panel/agent-card.js +0 -170
- package/src/plugin-ui/modules/agent-book/panel/agent-data.js +0 -643
- package/src/plugin-ui/modules/agent-book/panel/inject-ui.js +0 -665
- package/src/plugin-ui/modules/agent-book/panel/mention-state.js +0 -206
- package/src/plugin-ui/modules/agent-book/panel/styles.js +0 -833
- package/src/plugin-ui/modules/agent-book/panel/theme-adapter.js +0 -86
- package/src/plugin-ui/modules/agent-book/remote-agent-tool/components-core.js +0 -295
- package/src/plugin-ui/modules/agent-book/remote-agent-tool/thought-chain-card.js +0 -211
- package/src/plugin-ui/modules/agent-book/scanner.js +0 -131
- package/src/plugin-ui/modules/agent-book/travelcard/travel-cards.js +0 -500
- package/src/plugin-ui/modules/agent-book/travelcard/travel-engine.js +0 -652
- package/src/plugin-ui/modules/agent-book/travelcard/travel-styles.js +0 -256
- package/src/plugin-ui/modules/loader/bootstrap.js +0 -38
- package/src/plugin-ui/modules/loader/shared-state.js +0 -838
- package/src/plugin-ui/modules/loader/ws-intercept.js +0 -199
- package/src/plugin-ui/modules/remote-agent/chunk-parser.js +0 -161
- package/src/plugin-ui/modules/remote-agent/execution-card.js +0 -530
- package/src/plugin-ui/modules/remote-agent/markdown-renderer.js +0 -256
- package/src/plugin-ui/modules/remote-agent/media-links.js +0 -151
- package/src/plugin-ui/modules/remote-agent/native-style-adapter.js +0 -134
- package/src/plugin-ui/modules/remote-agent/output-card.js +0 -342
- package/src/plugin-ui/modules/remote-agent/progress-store.js +0 -363
- package/src/plugin-ui/modules/remote-agent/render-hooks.js +0 -1700
- package/src/plugin-ui/modules/remote-agent/styles.js +0 -896
- package/src/plugin-ui/modules/remote-agent/tool-card-model.js +0 -130
- package/src/plugin-ui/postinstall-deploy.cjs +0 -52
- package/src/plugin-ui/ui-extension-loader/backup.ts +0 -92
- package/src/plugin-ui/ui-extension-loader/index.ts +0 -276
- package/src/plugin-ui/ui-extension-loader/locator.ts +0 -152
- package/src/plugin-ui/ui-extension-loader/manifest.ts +0 -57
- package/src/plugin-ui/ui-extension-loader/registry-regex.ts +0 -944
- package/src/plugin-ui/ui-extension-loader/removed-extensions.ts +0 -70
- package/src/plugin-ui/ui-extension-loader/types.ts +0 -72
- package/src/proxy/auth-proxy.ts +0 -409
- package/src/runtime/account.ts +0 -549
- package/src/runtime/index.ts +0 -7
- package/src/runtime/plugin-runtime.ts +0 -94
- package/src/runtime/registry.ts +0 -71
- package/src/sdk/CLASS_MAP.md +0 -143
- package/src/sdk/index.d.ts +0 -126
- package/src/sdk/index.js +0 -23990
- package/src/sdk/modules/cloud-search-module.js +0 -1117
- package/src/sdk/modules/follow-module.js +0 -1069
- package/src/sdk/modules/group-module.js +0 -7397
- package/src/sdk/modules/relationship-module.js +0 -2269
- package/src/sdk/modules/signaling-module.js +0 -1468
- package/src/sdk/modules/tim-upload-plugin.js +0 -730
- package/src/sdk/node-env/http-request.js +0 -90
- package/src/sdk/node-env/index.js +0 -57
- package/src/sdk/node-env/storage.js +0 -114
- package/src/sdk/package.json +0 -10
- package/src/sdk/tsconfig.json +0 -16
- package/src/state/pending-invocation-store.ts +0 -43
- package/src/state/store.ts +0 -756
- package/src/tim/c2c.ts +0 -451
- package/src/tim/channels.ts +0 -364
- package/src/tim/client.ts +0 -330
- package/src/tim/index.ts +0 -18
- package/src/tim/messages.ts +0 -166
- package/src/tim/sdk-logger-init.ts +0 -50
- package/src/tools.ts +0 -10
- package/src/transport/factory.ts +0 -95
- package/src/transport/oasn/index.ts +0 -17
- package/src/transport/oasn/oasn-agent-card.ts +0 -111
- package/src/transport/oasn/oasn-discovery.ts +0 -108
- package/src/transport/oasn/oasn-files.ts +0 -210
- package/src/transport/oasn/oasn-http.ts +0 -529
- package/src/transport/oasn/oasn-invocation.ts +0 -604
- package/src/transport/oasn/oasn-normalize.ts +0 -133
- package/src/transport/oasn/oasn-register.ts +0 -33
- package/src/transport/oasn/oasn-transport.ts +0 -318
- package/src/transport/oasn/oasn-types.ts +0 -404
- package/src/transport/tim/index.ts +0 -8
- package/src/transport/tim/tim-transport.ts +0 -515
- package/src/transport/types.ts +0 -538
- package/src/types/openclaw-plugin-sdk-media-store.d.ts +0 -9
- package/src/types/openclaw.d.ts +0 -97
- package/src/types/tencentcloud-chat.d.ts +0 -15
- package/src/util/http.ts +0 -113
- package/src/util/logger.ts +0 -131
- package/src/util/url-resolver.ts +0 -77
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Locator — 定位 OpenClaw control-ui 目录和文件
|
|
3
|
-
*
|
|
4
|
-
* 唯一定位方法:require.resolve('openclaw')
|
|
5
|
-
* 插件通过 symlink 依赖宿主 openclaw 包,如果 symlink 不存在,
|
|
6
|
-
* 插件的 import 语句就会失败,根本执行不到这里。
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import { existsSync, readdirSync } from 'node:fs';
|
|
10
|
-
import { dirname, join, resolve } from 'node:path';
|
|
11
|
-
import { createRequire } from 'node:module';
|
|
12
|
-
import { logger } from '../../util/logger.js';
|
|
13
|
-
|
|
14
|
-
function addControlUiCandidatesFromEntrypoint(candidates: string[], entryPoint: string | undefined): void {
|
|
15
|
-
if (!entryPoint) return;
|
|
16
|
-
|
|
17
|
-
const entryDir = dirname(resolve(entryPoint));
|
|
18
|
-
candidates.push(
|
|
19
|
-
// npm/global install: openclaw/dist/index.js -> openclaw/dist/control-ui
|
|
20
|
-
join(entryDir, 'control-ui'),
|
|
21
|
-
// package root entry: openclaw/openclaw.mjs or openclaw/index.js -> openclaw/dist/control-ui
|
|
22
|
-
join(entryDir, 'dist', 'control-ui'),
|
|
23
|
-
// package sub-entry fallback: openclaw/dist/index.js -> openclaw/dist/control-ui
|
|
24
|
-
join(dirname(entryDir), 'dist', 'control-ui'),
|
|
25
|
-
);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
function addDistCandidatesFromEntrypoint(candidates: string[], entryPoint: string | undefined): void {
|
|
29
|
-
if (!entryPoint) return;
|
|
30
|
-
|
|
31
|
-
const entryDir = dirname(resolve(entryPoint));
|
|
32
|
-
candidates.push(
|
|
33
|
-
// npm/global install: openclaw/dist/index.js -> openclaw/dist
|
|
34
|
-
entryDir,
|
|
35
|
-
// package root entry: openclaw/openclaw.mjs or openclaw/index.js -> openclaw/dist
|
|
36
|
-
join(entryDir, 'dist'),
|
|
37
|
-
// package sub-entry fallback: openclaw/dist/index.js -> openclaw/dist
|
|
38
|
-
join(dirname(entryDir), 'dist'),
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* 定位 control-ui 目录。
|
|
44
|
-
*
|
|
45
|
-
* require.resolve('openclaw')
|
|
46
|
-
* → /usr/lib/node_modules/openclaw/dist/index.js
|
|
47
|
-
* → dirname → dist/
|
|
48
|
-
* → join('control-ui') → dist/control-ui/
|
|
49
|
-
*/
|
|
50
|
-
export function resolveControlUiDir(): string | null {
|
|
51
|
-
const candidates: string[] = [];
|
|
52
|
-
|
|
53
|
-
// In local development it is possible for the plugin's peerDependency
|
|
54
|
-
// symlink to resolve to a different OpenClaw installation than the gateway
|
|
55
|
-
// process that is currently serving /chat. Prefer the actual process
|
|
56
|
-
// entrypoint when available.
|
|
57
|
-
addControlUiCandidatesFromEntrypoint(candidates, process.argv[1]);
|
|
58
|
-
|
|
59
|
-
try {
|
|
60
|
-
const require = createRequire(import.meta.url);
|
|
61
|
-
const entryPoint = require.resolve('openclaw');
|
|
62
|
-
addControlUiCandidatesFromEntrypoint(candidates, entryPoint);
|
|
63
|
-
} catch {
|
|
64
|
-
// Docker installs the plugin outside /app/node_modules, so resolving the
|
|
65
|
-
// host package from the plugin path can fail even though OpenClaw is
|
|
66
|
-
// running from /app. Fall through to cwd-based candidates below.
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// Docker image layout: process cwd is /app, UI lives at /app/dist/control-ui.
|
|
70
|
-
candidates.push(
|
|
71
|
-
join(process.cwd(), 'dist', 'control-ui'),
|
|
72
|
-
join(resolve(process.cwd(), '..'), 'dist', 'control-ui'),
|
|
73
|
-
);
|
|
74
|
-
|
|
75
|
-
for (const candidate of candidates) {
|
|
76
|
-
if (existsSync(candidate)) {
|
|
77
|
-
logger.debug(`[ui-ext] control-ui located: ${candidate}`);
|
|
78
|
-
return candidate;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
logger.warn('[ui-ext] Could not locate control-ui directory');
|
|
83
|
-
return null;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* 定位 OpenClaw dist 目录。
|
|
88
|
-
*
|
|
89
|
-
* control-ui 是 dist/control-ui 的子目录,后端 gateway-cli-*.js 也在同一个
|
|
90
|
-
* dist 下。这里优先从已解析出的 control-ui 反推,避免 Docker 场景下
|
|
91
|
-
* require.resolve('openclaw') 失效。
|
|
92
|
-
*/
|
|
93
|
-
export function resolveOpenClawDistDir(controlUiDir?: string | null): string | null {
|
|
94
|
-
const candidates: string[] = [];
|
|
95
|
-
|
|
96
|
-
if (controlUiDir) {
|
|
97
|
-
candidates.push(dirname(controlUiDir));
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
addDistCandidatesFromEntrypoint(candidates, process.argv[1]);
|
|
101
|
-
|
|
102
|
-
try {
|
|
103
|
-
const require = createRequire(import.meta.url);
|
|
104
|
-
const entryPoint = require.resolve('openclaw');
|
|
105
|
-
addDistCandidatesFromEntrypoint(candidates, entryPoint);
|
|
106
|
-
} catch {
|
|
107
|
-
// Docker 插件路径下可能无法 resolve 宿主 openclaw;继续走 cwd 兜底。
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
candidates.push(
|
|
111
|
-
join(process.cwd(), 'dist'),
|
|
112
|
-
join(resolve(process.cwd(), '..'), 'dist'),
|
|
113
|
-
);
|
|
114
|
-
|
|
115
|
-
for (const candidate of candidates) {
|
|
116
|
-
if (existsSync(candidate)) {
|
|
117
|
-
logger.debug(`[ui-ext] openclaw dist located: ${candidate}`);
|
|
118
|
-
return candidate;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
logger.warn('[ui-ext] Could not locate OpenClaw dist directory');
|
|
123
|
-
return null;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* 在目录中查找匹配前缀的第一个文件。
|
|
128
|
-
* 用于定位 Vite code-split 后的文件(如 index-D7mg1IkY.js)。
|
|
129
|
-
* @param suffix 文件后缀,默认 '.js',传 '.js.map' 可找 source map
|
|
130
|
-
*/
|
|
131
|
-
export function findFileByPrefix(dir: string, prefix: string, suffix = '.js'): string | null {
|
|
132
|
-
try {
|
|
133
|
-
const entries = readdirSync(dir);
|
|
134
|
-
const match = entries.find(e => e.startsWith(prefix) && e.endsWith(suffix));
|
|
135
|
-
if (match) {
|
|
136
|
-
logger.debug(`[ui-ext] Found file: ${match}`);
|
|
137
|
-
}
|
|
138
|
-
return match ? join(dir, match) : null;
|
|
139
|
-
} catch {
|
|
140
|
-
return null;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
/**
|
|
145
|
-
* 获取 bundle 文件名中的 hash 部分,用作 bundleHash。
|
|
146
|
-
* index-D7mg1IkY.js → D7mg1IkY
|
|
147
|
-
*/
|
|
148
|
-
export function extractBundleHash(bundlePath: string): string {
|
|
149
|
-
const filename = bundlePath.split('/').pop() ?? '';
|
|
150
|
-
const match = filename.match(/^index-(.+)\.js$/);
|
|
151
|
-
return match?.[1] ?? filename;
|
|
152
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Manifest — 清单文件读写
|
|
3
|
-
*
|
|
4
|
-
* 存储在 control-ui/openagent-manifest.json,
|
|
5
|
-
* 记录当前已加载的扩展点及其版本,用于 reconciliation。
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import { readFileSync, writeFileSync, unlinkSync, existsSync } from 'node:fs';
|
|
9
|
-
import { join } from 'node:path';
|
|
10
|
-
import { logger } from '../../util/logger.js';
|
|
11
|
-
|
|
12
|
-
const MANIFEST_FILENAME = 'openagent-manifest.json';
|
|
13
|
-
|
|
14
|
-
export interface ManifestData {
|
|
15
|
-
bundleHash: string;
|
|
16
|
-
/** 当前使用的注入策略。 */
|
|
17
|
-
strategy?: 'regex';
|
|
18
|
-
extensions: Record<string, { version: number }>;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* 读取清单文件。不存在或解析失败返回 null。
|
|
23
|
-
*/
|
|
24
|
-
export function readManifest(controlUiDir: string): ManifestData | null {
|
|
25
|
-
const filepath = join(controlUiDir, MANIFEST_FILENAME);
|
|
26
|
-
if (!existsSync(filepath)) {
|
|
27
|
-
return null;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
try {
|
|
31
|
-
const raw = readFileSync(filepath, 'utf-8');
|
|
32
|
-
return JSON.parse(raw) as ManifestData;
|
|
33
|
-
} catch (err) {
|
|
34
|
-
logger.warn(`[ui-ext] Failed to parse manifest: ${(err as Error).message}`);
|
|
35
|
-
return null;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* 写入清单文件。
|
|
41
|
-
*/
|
|
42
|
-
export function writeManifest(controlUiDir: string, data: ManifestData): void {
|
|
43
|
-
const filepath = join(controlUiDir, MANIFEST_FILENAME);
|
|
44
|
-
writeFileSync(filepath, JSON.stringify(data, null, 2), 'utf-8');
|
|
45
|
-
logger.debug('[ui-ext] Manifest written');
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* 删除清单文件。
|
|
50
|
-
*/
|
|
51
|
-
export function removeManifest(controlUiDir: string): void {
|
|
52
|
-
const filepath = join(controlUiDir, MANIFEST_FILENAME);
|
|
53
|
-
if (existsSync(filepath)) {
|
|
54
|
-
unlinkSync(filepath);
|
|
55
|
-
logger.debug('[ui-ext] Manifest removed');
|
|
56
|
-
}
|
|
57
|
-
}
|