openclaw-openagent 1.0.0

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 (113) hide show
  1. package/index.ts +114 -0
  2. package/openclaw.plugin.json +159 -0
  3. package/package.json +79 -0
  4. package/skills/clawlink/SKILL.md +145 -0
  5. package/skills/clawlink/SKILL.md.bak +165 -0
  6. package/src/app/channel-tools.ts +249 -0
  7. package/src/app/discovery-tools.ts +273 -0
  8. package/src/app/hooks.ts +60 -0
  9. package/src/app/index.ts +78 -0
  10. package/src/app/messaging-tools.ts +79 -0
  11. package/src/app/ops-tools.ts +155 -0
  12. package/src/app/remote-agent-tool.ts +476 -0
  13. package/src/app/types.ts +67 -0
  14. package/src/app/verbose-preflight.ts +190 -0
  15. package/src/auth/config.ts +197 -0
  16. package/src/auth/credential-manager.ts +146 -0
  17. package/src/auth/index.ts +24 -0
  18. package/src/auth/verify.ts +99 -0
  19. package/src/channel.ts +565 -0
  20. package/src/compat.ts +82 -0
  21. package/src/config/config-schema.ts +39 -0
  22. package/src/messaging/aggregator.ts +120 -0
  23. package/src/messaging/collector.ts +89 -0
  24. package/src/messaging/executor.ts +72 -0
  25. package/src/messaging/inbound.ts +150 -0
  26. package/src/messaging/index.ts +11 -0
  27. package/src/messaging/mention-protocol.ts +94 -0
  28. package/src/messaging/process-c2c-request.ts +564 -0
  29. package/src/messaging/process-message.ts +373 -0
  30. package/src/messaging/scheduler.ts +55 -0
  31. package/src/messaging/types.ts +38 -0
  32. package/src/plugin-ui/assets/agentbook-icon.svg +5 -0
  33. package/src/plugin-ui/assets/magic.svg +5 -0
  34. package/src/plugin-ui/assets/openagent-override.js +9329 -0
  35. package/src/plugin-ui/build.cjs +175 -0
  36. package/src/plugin-ui/index.ts +18 -0
  37. package/src/plugin-ui/modules/agent-book/panel/agent-book.js +458 -0
  38. package/src/plugin-ui/modules/agent-book/panel/agent-card.js +154 -0
  39. package/src/plugin-ui/modules/agent-book/panel/agent-data.js +644 -0
  40. package/src/plugin-ui/modules/agent-book/panel/inject-ui.js +456 -0
  41. package/src/plugin-ui/modules/agent-book/panel/mention-state.js +206 -0
  42. package/src/plugin-ui/modules/agent-book/panel/styles.js +670 -0
  43. package/src/plugin-ui/modules/agent-book/remote-agent-tool/components-core.js +293 -0
  44. package/src/plugin-ui/modules/agent-book/remote-agent-tool/thought-chain-card.js +208 -0
  45. package/src/plugin-ui/modules/agent-book/scanner.js +119 -0
  46. package/src/plugin-ui/modules/agent-book/travelcard/travel-cards.js +500 -0
  47. package/src/plugin-ui/modules/agent-book/travelcard/travel-engine.js +652 -0
  48. package/src/plugin-ui/modules/agent-book/travelcard/travel-styles.js +251 -0
  49. package/src/plugin-ui/modules/loader/bootstrap.js +38 -0
  50. package/src/plugin-ui/modules/loader/shared-state.js +560 -0
  51. package/src/plugin-ui/modules/loader/ws-intercept.js +199 -0
  52. package/src/plugin-ui/modules/remote-agent/chunk-parser.js +161 -0
  53. package/src/plugin-ui/modules/remote-agent/execution-card.js +269 -0
  54. package/src/plugin-ui/modules/remote-agent/markdown-renderer.js +256 -0
  55. package/src/plugin-ui/modules/remote-agent/native-style-adapter.js +146 -0
  56. package/src/plugin-ui/modules/remote-agent/output-card.js +259 -0
  57. package/src/plugin-ui/modules/remote-agent/progress-store.js +363 -0
  58. package/src/plugin-ui/modules/remote-agent/render-hooks.js +1609 -0
  59. package/src/plugin-ui/modules/remote-agent/styles.js +668 -0
  60. package/src/plugin-ui/modules/remote-agent/tool-card-model.js +56 -0
  61. package/src/plugin-ui/ui-extension-loader/backup.ts +92 -0
  62. package/src/plugin-ui/ui-extension-loader/index.ts +276 -0
  63. package/src/plugin-ui/ui-extension-loader/locator.ts +152 -0
  64. package/src/plugin-ui/ui-extension-loader/manifest.ts +57 -0
  65. package/src/plugin-ui/ui-extension-loader/registry-regex.ts +729 -0
  66. package/src/plugin-ui/ui-extension-loader/removed-extensions.ts +70 -0
  67. package/src/plugin-ui/ui-extension-loader/types.ts +68 -0
  68. package/src/proxy/auth-proxy.ts +356 -0
  69. package/src/runtime/account.ts +572 -0
  70. package/src/runtime/index.ts +7 -0
  71. package/src/runtime/plugin-runtime.ts +94 -0
  72. package/src/runtime/registry.ts +71 -0
  73. package/src/sdk/CLASS_MAP.md +143 -0
  74. package/src/sdk/index.d.ts +126 -0
  75. package/src/sdk/index.js +23990 -0
  76. package/src/sdk/modules/cloud-search-module.js +1117 -0
  77. package/src/sdk/modules/follow-module.js +1069 -0
  78. package/src/sdk/modules/group-module.js +7397 -0
  79. package/src/sdk/modules/relationship-module.js +2269 -0
  80. package/src/sdk/modules/signaling-module.js +1468 -0
  81. package/src/sdk/modules/tim-upload-plugin.js +730 -0
  82. package/src/sdk/node-env/http-request.js +90 -0
  83. package/src/sdk/node-env/index.js +57 -0
  84. package/src/sdk/node-env/storage.js +114 -0
  85. package/src/sdk/package.json +10 -0
  86. package/src/sdk/tsconfig.json +16 -0
  87. package/src/state/pending-invocation-store.ts +43 -0
  88. package/src/state/store.ts +676 -0
  89. package/src/tim/c2c.ts +451 -0
  90. package/src/tim/channels.ts +364 -0
  91. package/src/tim/client.ts +330 -0
  92. package/src/tim/index.ts +18 -0
  93. package/src/tim/messages.ts +166 -0
  94. package/src/tim/sdk-logger-init.ts +50 -0
  95. package/src/tools.ts +10 -0
  96. package/src/transport/factory.ts +95 -0
  97. package/src/transport/oasn/index.ts +17 -0
  98. package/src/transport/oasn/oasn-agent-card.ts +111 -0
  99. package/src/transport/oasn/oasn-discovery.ts +108 -0
  100. package/src/transport/oasn/oasn-files.ts +210 -0
  101. package/src/transport/oasn/oasn-http.ts +483 -0
  102. package/src/transport/oasn/oasn-invocation.ts +527 -0
  103. package/src/transport/oasn/oasn-normalize.ts +159 -0
  104. package/src/transport/oasn/oasn-register.ts +106 -0
  105. package/src/transport/oasn/oasn-transport.ts +341 -0
  106. package/src/transport/oasn/oasn-types.ts +353 -0
  107. package/src/transport/tim/index.ts +8 -0
  108. package/src/transport/tim/tim-transport.ts +515 -0
  109. package/src/transport/types.ts +541 -0
  110. package/src/types/openclaw.d.ts +97 -0
  111. package/src/types/tencentcloud-chat.d.ts +15 -0
  112. package/src/util/http.ts +113 -0
  113. package/src/util/logger.ts +131 -0
@@ -0,0 +1,251 @@
1
+ // ── 1. CSS 注入 ──
2
+ const _tripCSS = document.createElement('style');
3
+ _tripCSS.textContent = `
4
+ /* ── 行程文字:普通文字灰色,特殊标注(粗体/链接/标题)黑色 ── */
5
+ .trip-styled li, .trip-styled p { color: #888 !important; }
6
+ .trip-styled li strong, .trip-styled li b,
7
+ .trip-styled p strong, .trip-styled p b,
8
+ .trip-styled li a, .trip-styled p a { color: #111 !important; }
9
+ .trip-styled h1, .trip-styled h2, .trip-styled h3,
10
+ .trip-styled h4, .trip-styled h5, .trip-styled h6 { color: #111 !important; }
11
+ .trip-styled ul { padding-left: 20px; }
12
+ sh_card, tr_card, i_card, la_card, fr_card, bg_card, time_data_card {
13
+ display: none !important;
14
+ }
15
+
16
+ /* ── TransportCard ── */
17
+ .trip-transport-card {
18
+ margin: 12px 0 12px 20px;
19
+ border-radius: 12px;
20
+ border: 1px solid rgb(229,229,229);
21
+ background: #fff;
22
+ overflow: hidden;
23
+ cursor: pointer;
24
+ transition: box-shadow 0.2s;
25
+ max-width: 380px;
26
+ }
27
+ .trip-transport-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
28
+ .trip-tc-inner {
29
+ display: flex; flex-direction: column; padding: 16px;
30
+ }
31
+ .trip-tc-station-row {
32
+ display: flex; flex-direction: row; align-items: flex-start; width: 100%;
33
+ }
34
+ .trip-tc-left { display: flex; flex-direction: column; width: max(159px, 50%); }
35
+ .trip-tc-left-top { display: flex; flex-direction: row; align-items: center; }
36
+ .trip-tc-time {
37
+ font-size: 20px; font-weight: 500; line-height: 28px;
38
+ color: rgb(17,17,17); white-space: nowrap; flex-shrink: 0;
39
+ }
40
+ .trip-tc-arrow-area {
41
+ display: flex; flex-direction: row; align-items: center;
42
+ min-width: 90px; margin-left: 8px; position: relative; flex: 1;
43
+ }
44
+ .trip-tc-arrow-line { flex: 1; display: block; min-width: 40px; }
45
+ .trip-tc-duration {
46
+ display: flex; flex-direction: row; align-items: center;
47
+ background: rgb(255,255,255); color: rgb(85,85,85);
48
+ font-size: 12px; white-space: nowrap;
49
+ position: absolute; left: 50%; transform: translateX(-50%);
50
+ padding: 0 4px;
51
+ }
52
+ .trip-tc-station {
53
+ font-size: 14px; line-height: 21px; font-weight: 400;
54
+ color: rgb(17,17,17); margin-top: 2px; margin-right: 4px;
55
+ overflow: hidden; text-overflow: ellipsis;
56
+ display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
57
+ }
58
+ .trip-tc-right { display: flex; flex-direction: column; margin-left: 8px; }
59
+ .trip-tc-superscript { color: #FF7D00; font-size: 10px; vertical-align: super; margin-left: 1px; }
60
+ .trip-tc-desc {
61
+ display: flex; flex-direction: row; flex-wrap: wrap; align-items: center;
62
+ margin-top: 4px;
63
+ color: rgb(85,85,85); font-size: 14px; line-height: 21px;
64
+ }
65
+ .trip-tc-desc-tag { display: inline-flex; align-items: center; font-size: 14px; line-height: 21px; }
66
+ .trip-tc-desc-tag-positive { color: rgb(6,135,90); flex-shrink: 0; }
67
+ .trip-tc-desc-divider {
68
+ color: rgb(213,213,213); font-size: 12px; line-height: 18px;
69
+ margin: 0 8px; position: relative; top: -1px;
70
+ }
71
+ .trip-tc-icon { font-family: 'crn_font_xtaro_route'; margin-right: 2px; font-size: 14px; }
72
+
73
+ /* ── ImageCard ── */
74
+ .trip-img-card {
75
+ display: flex; flex-direction: row; gap: 6px;
76
+ overflow-x: auto; padding: 8px 0; margin-left: 20px;
77
+ scrollbar-width: thin;
78
+ }
79
+ .trip-img-item {
80
+ position: relative; width: 191px; height: 100px; border-radius: 8px;
81
+ flex-shrink: 0; overflow: hidden;
82
+ }
83
+ .trip-img-fallback-item {
84
+ width: 240px; height: auto; min-height: 88px;
85
+ background: #fff; border: 1px solid #e5e8ef;
86
+ box-shadow: 0 2px 8px rgba(17,24,39,0.04);
87
+ padding: 10px 12px; display: flex; flex-direction: column; gap: 5px;
88
+ }
89
+ .trip-img-fallback-title {
90
+ font-size: 14px; font-weight: 600; color: #1f2937; line-height: 20px;
91
+ }
92
+ .trip-img-fallback-desc {
93
+ font-size: 13px; color: #6b7280; line-height: 19px;
94
+ display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
95
+ overflow: hidden;
96
+ }
97
+ .trip-img-fallback-score {
98
+ align-self: flex-start; margin-top: 2px;
99
+ font-size: 12px; color: #f97316; background: #fff7ed;
100
+ border-radius: 999px; padding: 2px 7px;
101
+ }
102
+ .trip-img-item img {
103
+ width: 191px; height: 100px; border-radius: 8px; object-fit: cover;
104
+ display: block;
105
+ }
106
+ .trip-img-overlay {
107
+ position: absolute; bottom: 0; left: 0; right: 0;
108
+ background-image: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,0.7));
109
+ padding: 4px 8px;
110
+ }
111
+ .trip-img-name {
112
+ color: #fff; font-size: 13px; font-weight: 500; line-height: 18px;
113
+ overflow: hidden; text-overflow: ellipsis;
114
+ display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
115
+ }
116
+ .trip-img-score {
117
+ display: inline-flex; align-items: center; gap: 2px;
118
+ background: rgba(0,0,0,0.4); border-radius: 4px; padding: 1px 4px;
119
+ position: absolute; top: 4px; right: 4px;
120
+ }
121
+ .trip-img-score-icon { color: rgb(255,116,123); font-size: 10px; }
122
+ .trip-img-score-text { color: rgb(255,116,123); font-size: 10px; }
123
+
124
+ /* ── TimeDataCard ── */
125
+ .trip-day-card {
126
+ display: flex; align-items: center; gap: 8px;
127
+ margin: 20px 0 8px 0; padding: 0;
128
+ }
129
+ .trip-day-badge {
130
+ display: inline-flex; align-items: center; justify-content: center;
131
+ background: linear-gradient(135deg, #006ff6 0%, #4d9eff 100%);
132
+ color: #fff; font-size: 13px; font-weight: 600;
133
+ padding: 4px 14px; border-radius: 16px;
134
+ letter-spacing: 0.5px;
135
+ }
136
+ .trip-day-line { flex: 1; height: 1px; background: #e5e6eb; }
137
+
138
+ /* ── ShoppingCard (线路概览表格) ── */
139
+ .trip-sh-card { margin: 16px 0 16px 20px; }
140
+ .trip-sh-title {
141
+ font-size: 20px; font-weight: 500; color: #051a37;
142
+ line-height: 26px; margin-bottom: 12px; display: block;
143
+ }
144
+ .trip-sh-table {
145
+ width: 100%; max-width: 400px;
146
+ border: 1px solid rgb(229,229,229); border-radius: 8px;
147
+ overflow: hidden; background: #fff;
148
+ }
149
+ .trip-sh-row { display: flex; flex-direction: row; }
150
+ .trip-sh-row + .trip-sh-row { border-top: 1px solid #d4d7de; }
151
+ .trip-sh-day-cell {
152
+ width: 72px; flex-shrink: 0; display: flex; flex-direction: column;
153
+ align-items: center; justify-content: center; padding: 12px;
154
+ border-right: 1px solid #d4d7de;
155
+ }
156
+ .trip-sh-day-title { font-size: 12px; color: rgb(133,146,166); }
157
+ .trip-sh-day-num { font-size: 24px; font-weight: 700; color: rgb(17,17,17); }
158
+ .trip-sh-detail {
159
+ flex: 1; padding: 12px 16px; display: flex; flex-direction: column;
160
+ justify-content: center;
161
+ }
162
+ .trip-sh-districts {
163
+ display: flex; flex-direction: row; flex-wrap: wrap; align-items: center;
164
+ }
165
+ .trip-sh-district { font-size: 16px; font-weight: 500; color: #0f294d; }
166
+ .trip-sh-district-arrow { font-size: 16px; color: #8592a6; margin: 0 4px; }
167
+ .trip-sh-pois {
168
+ display: flex; flex-direction: row; flex-wrap: wrap;
169
+ align-items: center; margin-top: 4px;
170
+ }
171
+ .trip-sh-poi { font-size: 14px; color: #4E5969; line-height: 22px; }
172
+ .trip-sh-poi-arrow { font-size: 14px; color: #8592a6; margin: 0 6px; }
173
+
174
+ /* ── HotelAreaCard ── */
175
+ .trip-hotel-card {
176
+ border-radius: 8px; border: 1px solid #f0f2f5;
177
+ overflow: hidden; background: #fff; margin: 8px 0;
178
+ }
179
+ .trip-hotel-header {
180
+ padding: 10px 12px; background: rgba(0,111,246,0.03);
181
+ border-bottom: 1px solid #f0f2f5;
182
+ display: flex; align-items: center; gap: 6px;
183
+ }
184
+ .trip-hotel-icon {
185
+ font-family: 'crn_font_xtaro_route'; font-size: 14px; color: #006ff6;
186
+ }
187
+ .trip-hotel-title { font-size: 14px; font-weight: 600; color: #111; }
188
+ .trip-hotel-desc {
189
+ font-size: 13px; color: #6b7280; line-height: 20px;
190
+ padding: 10px 12px 12px;
191
+ }
192
+
193
+ /* ── FoodCard ── */
194
+ .trip-food-card { margin: 8px 0 8px 20px; }
195
+ .trip-food-title {
196
+ font-size: 18px; font-weight: 500; color: #111;
197
+ line-height: 26px; display: block; margin-bottom: 8px;
198
+ }
199
+ .trip-food-item {
200
+ display: flex; align-items: flex-start; gap: 8px;
201
+ padding: 4px 0;
202
+ }
203
+ .trip-food-dot {
204
+ width: 6px; height: 6px; border-radius: 50%; margin-top: 10px; flex-shrink: 0;
205
+ }
206
+ .trip-food-dot-food { background: #F77234; }
207
+ .trip-food-dot-rest { background: #006ff6; }
208
+ .trip-food-name { font-size: 16px; color: #111; line-height: 24px; }
209
+ .trip-food-meta { font-size: 11px; color: #888; margin-left: 6px; }
210
+
211
+ /* ── BudgetCard ── */
212
+ .trip-budget-card { margin: 16px 0; }
213
+ .trip-budget-title { font-size: 17px; font-weight: 700; color: #111; line-height: 22px; }
214
+ .trip-budget-desc { font-size: 13px; color: #333; margin: 6px 0 0 0; line-height: 1.7; }
215
+ .trip-budget-chart {
216
+ margin-top: 12px; margin-left: 20px; background: #fff; max-width: 320px;
217
+ border: 1px solid #e8e8e8; border-radius: 10px; padding: 14px 16px;
218
+ }
219
+ .trip-budget-header {
220
+ display: flex; justify-content: space-between; align-items: center;
221
+ }
222
+ .trip-budget-person { font-size: 14px; font-weight: 600; color: #111; line-height: 20px; }
223
+ .trip-budget-total { font-size: 15px; font-weight: 700; color: #111; line-height: 22px; }
224
+ .trip-budget-parts { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
225
+ .trip-budget-part {
226
+ display: flex; flex-direction: row; align-items: center;
227
+ }
228
+ .trip-budget-part-icon { width: 16px; height: 16px; margin-right: 4px; font-size: 14px; text-align: center; }
229
+ .trip-budget-part-name { font-size: 13px; font-weight: 600; color: #111; line-height: 20px; white-space: nowrap; }
230
+ .trip-budget-bar {
231
+ flex: 1; height: 6px; border-radius: 3px; margin: 0 10px;
232
+ overflow: hidden; min-width: 40px; max-width: 140px;
233
+ }
234
+ .trip-budget-bar-fill { height: 100%; border-radius: 3px; min-width: 4%; }
235
+ .trip-budget-part-price {
236
+ font-size: 13px; color: #111; line-height: 20px;
237
+ min-width: 55px; text-align: right;
238
+ }
239
+
240
+ /* ── 暗色主题适配 ── */
241
+ @media (prefers-color-scheme: dark) {
242
+ .trip-transport-card, .trip-sh-table, .trip-hotel-card, .trip-img-fallback-item { background: #1e1e1e; border-color: #333; }
243
+ .trip-tc-time, .trip-tc-station, .trip-sh-district, .trip-hotel-title,
244
+ .trip-img-fallback-title, .trip-food-name, .trip-budget-title, .trip-budget-person, .trip-budget-total,
245
+ .trip-budget-part-name, .trip-budget-part-price, .trip-sh-day-num { color: #e0e0e0; }
246
+ .trip-img-fallback-desc, .trip-hotel-desc { color: #9ca3af; }
247
+ .trip-sh-row + .trip-sh-row, .trip-sh-day-cell { border-color: #333; }
248
+ .trip-hotel-header { background: rgba(0,111,246,0.08); border-color: #333; }
249
+ }
250
+ `;
251
+ document.head.appendChild(_tripCSS);
@@ -0,0 +1,38 @@
1
+ // MutationObserver for faster trigger — with debounce to prevent infinite loops.
2
+ // Without debounce, _clScan modifies DOM → triggers observer → _clScan → ...
3
+ var _clDebounceTimer = null;
4
+ var _clObserverTarget = null;
5
+
6
+ const _clObserver = new MutationObserver(() => {
7
+ if (_clDebounceTimer) clearTimeout(_clDebounceTimer);
8
+ _clDebounceTimer = setTimeout(_debouncedClScan, 50); // Reduced from 500ms to 50ms to fix UI flash
9
+ });
10
+
11
+ function _debouncedClScan() {
12
+ // Disconnect observer during scan to prevent feedback loop
13
+ _clObserver.disconnect();
14
+ try {
15
+ _clScan();
16
+ } catch (err) {
17
+ console.warn('[openagent] scanner error:', err.message);
18
+ }
19
+ // Reconnect observer after scan completes
20
+ if (_clObserverTarget) {
21
+ _clObserver.observe(_clObserverTarget, { childList: true, subtree: true });
22
+ }
23
+ }
24
+
25
+ function _startClObserver() {
26
+ _clObserverTarget = document.querySelector('openclaw-app') || document.body;
27
+ _clObserver.observe(_clObserverTarget, { childList: true, subtree: true });
28
+ setTimeout(_debouncedClScan, 2000);
29
+ /* muted */ void 0;
30
+ }
31
+
32
+ if (document.readyState === 'loading') {
33
+ document.addEventListener('DOMContentLoaded', _startClObserver);
34
+ } else {
35
+ setTimeout(_startClObserver, 500);
36
+ }
37
+
38
+ /* muted */ void 0;