openclaw-openagent 1.0.13 → 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.
Files changed (128) hide show
  1. package/dist/src/messaging/executor.d.ts +2 -3
  2. package/dist/src/messaging/executor.js +4 -31
  3. package/dist/src/plugin-ui/assets/openagent-override.js +4 -5
  4. package/dist/src/runtime/update-checker.d.ts +1 -1
  5. package/dist/src/runtime/update-checker.js +9 -46
  6. package/package.json +1 -3
  7. package/src/app/channel-tools.ts +0 -249
  8. package/src/app/discovery-tools.ts +0 -273
  9. package/src/app/download-file-tool.ts +0 -133
  10. package/src/app/hooks.ts +0 -144
  11. package/src/app/index.ts +0 -84
  12. package/src/app/messaging-tools.ts +0 -79
  13. package/src/app/ops-tools.ts +0 -155
  14. package/src/app/remote-agent-tool.ts +0 -762
  15. package/src/app/types.ts +0 -68
  16. package/src/app/upload-file-tool.ts +0 -411
  17. package/src/app/verbose-preflight.ts +0 -190
  18. package/src/auth/config.ts +0 -266
  19. package/src/auth/credential-manager.ts +0 -146
  20. package/src/auth/index.ts +0 -24
  21. package/src/auth/verify.ts +0 -99
  22. package/src/channel.ts +0 -566
  23. package/src/compat.ts +0 -94
  24. package/src/config/config-schema.ts +0 -45
  25. package/src/messaging/aggregator.ts +0 -120
  26. package/src/messaging/collector.ts +0 -89
  27. package/src/messaging/executor.ts +0 -72
  28. package/src/messaging/inbound.ts +0 -150
  29. package/src/messaging/index.ts +0 -11
  30. package/src/messaging/mention-protocol.ts +0 -94
  31. package/src/messaging/process-c2c-request.ts +0 -564
  32. package/src/messaging/process-message.ts +0 -373
  33. package/src/messaging/scheduler.ts +0 -55
  34. package/src/messaging/types.ts +0 -38
  35. package/src/plugin-ui/adapters/oc-2026-04.js +0 -103
  36. package/src/plugin-ui/adapters/oc-2026-05.js +0 -125
  37. package/src/plugin-ui/adapters/oc-2026-06.js +0 -125
  38. package/src/plugin-ui/adapters/oc-unknown.js +0 -48
  39. package/src/plugin-ui/assets/agentbook-icon.svg +0 -5
  40. package/src/plugin-ui/assets/bg.png +0 -0
  41. package/src/plugin-ui/assets/icon.png +0 -0
  42. package/src/plugin-ui/assets/magic.svg +0 -5
  43. package/src/plugin-ui/assets/openagent-override.js +0 -11263
  44. package/src/plugin-ui/build.cjs +0 -463
  45. package/src/plugin-ui/index.ts +0 -18
  46. package/src/plugin-ui/modules/agent-book/panel/agent-book.js +0 -570
  47. package/src/plugin-ui/modules/agent-book/panel/agent-card.js +0 -170
  48. package/src/plugin-ui/modules/agent-book/panel/agent-data.js +0 -643
  49. package/src/plugin-ui/modules/agent-book/panel/inject-ui.js +0 -665
  50. package/src/plugin-ui/modules/agent-book/panel/mention-state.js +0 -206
  51. package/src/plugin-ui/modules/agent-book/panel/styles.js +0 -832
  52. package/src/plugin-ui/modules/agent-book/panel/theme-adapter.js +0 -86
  53. package/src/plugin-ui/modules/agent-book/remote-agent-tool/components-core.js +0 -295
  54. package/src/plugin-ui/modules/agent-book/remote-agent-tool/thought-chain-card.js +0 -211
  55. package/src/plugin-ui/modules/agent-book/scanner.js +0 -131
  56. package/src/plugin-ui/modules/agent-book/travelcard/travel-cards.js +0 -500
  57. package/src/plugin-ui/modules/agent-book/travelcard/travel-engine.js +0 -652
  58. package/src/plugin-ui/modules/agent-book/travelcard/travel-styles.js +0 -262
  59. package/src/plugin-ui/modules/loader/bootstrap.js +0 -133
  60. package/src/plugin-ui/modules/loader/shared-state.js +0 -838
  61. package/src/plugin-ui/modules/loader/ws-intercept.js +0 -199
  62. package/src/plugin-ui/modules/remote-agent/chunk-parser.js +0 -161
  63. package/src/plugin-ui/modules/remote-agent/execution-card.js +0 -530
  64. package/src/plugin-ui/modules/remote-agent/markdown-renderer.js +0 -256
  65. package/src/plugin-ui/modules/remote-agent/media-links.js +0 -151
  66. package/src/plugin-ui/modules/remote-agent/native-style-adapter.js +0 -134
  67. package/src/plugin-ui/modules/remote-agent/output-card.js +0 -342
  68. package/src/plugin-ui/modules/remote-agent/progress-store.js +0 -363
  69. package/src/plugin-ui/modules/remote-agent/render-hooks.js +0 -1700
  70. package/src/plugin-ui/modules/remote-agent/styles.js +0 -903
  71. package/src/plugin-ui/modules/remote-agent/tool-card-model.js +0 -130
  72. package/src/plugin-ui/postinstall-deploy.cjs +0 -52
  73. package/src/plugin-ui/ui-extension-loader/backup.ts +0 -92
  74. package/src/plugin-ui/ui-extension-loader/index.ts +0 -276
  75. package/src/plugin-ui/ui-extension-loader/locator.ts +0 -152
  76. package/src/plugin-ui/ui-extension-loader/manifest.ts +0 -57
  77. package/src/plugin-ui/ui-extension-loader/registry-regex.ts +0 -944
  78. package/src/plugin-ui/ui-extension-loader/removed-extensions.ts +0 -70
  79. package/src/plugin-ui/ui-extension-loader/types.ts +0 -72
  80. package/src/proxy/auth-proxy.ts +0 -414
  81. package/src/runtime/account.ts +0 -549
  82. package/src/runtime/index.ts +0 -7
  83. package/src/runtime/plugin-runtime.ts +0 -94
  84. package/src/runtime/registry.ts +0 -71
  85. package/src/runtime/update-checker.ts +0 -286
  86. package/src/sdk/CLASS_MAP.md +0 -143
  87. package/src/sdk/index.d.ts +0 -126
  88. package/src/sdk/index.js +0 -23990
  89. package/src/sdk/modules/cloud-search-module.js +0 -1117
  90. package/src/sdk/modules/follow-module.js +0 -1069
  91. package/src/sdk/modules/group-module.js +0 -7397
  92. package/src/sdk/modules/relationship-module.js +0 -2269
  93. package/src/sdk/modules/signaling-module.js +0 -1468
  94. package/src/sdk/modules/tim-upload-plugin.js +0 -730
  95. package/src/sdk/node-env/http-request.js +0 -90
  96. package/src/sdk/node-env/index.js +0 -57
  97. package/src/sdk/node-env/storage.js +0 -114
  98. package/src/sdk/package.json +0 -10
  99. package/src/sdk/tsconfig.json +0 -16
  100. package/src/state/pending-invocation-store.ts +0 -43
  101. package/src/state/store.ts +0 -756
  102. package/src/tim/c2c.ts +0 -451
  103. package/src/tim/channels.ts +0 -364
  104. package/src/tim/client.ts +0 -330
  105. package/src/tim/index.ts +0 -18
  106. package/src/tim/messages.ts +0 -166
  107. package/src/tim/sdk-logger-init.ts +0 -50
  108. package/src/tools.ts +0 -10
  109. package/src/transport/factory.ts +0 -95
  110. package/src/transport/oasn/index.ts +0 -17
  111. package/src/transport/oasn/oasn-agent-card.ts +0 -111
  112. package/src/transport/oasn/oasn-discovery.ts +0 -108
  113. package/src/transport/oasn/oasn-files.ts +0 -210
  114. package/src/transport/oasn/oasn-http.ts +0 -529
  115. package/src/transport/oasn/oasn-invocation.ts +0 -604
  116. package/src/transport/oasn/oasn-normalize.ts +0 -133
  117. package/src/transport/oasn/oasn-register.ts +0 -33
  118. package/src/transport/oasn/oasn-transport.ts +0 -318
  119. package/src/transport/oasn/oasn-types.ts +0 -404
  120. package/src/transport/tim/index.ts +0 -8
  121. package/src/transport/tim/tim-transport.ts +0 -515
  122. package/src/transport/types.ts +0 -538
  123. package/src/types/openclaw-plugin-sdk-media-store.d.ts +0 -9
  124. package/src/types/openclaw.d.ts +0 -97
  125. package/src/types/tencentcloud-chat.d.ts +0 -15
  126. package/src/util/http.ts +0 -113
  127. package/src/util/logger.ts +0 -131
  128. 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
- }