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