agent-loft 0.2.29 → 0.2.31

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 (69) hide show
  1. package/README.md +5 -0
  2. package/package.json +1 -1
  3. package/src/agents/claude/driver.ts +3 -2
  4. package/src/agents/claude/session.ts +11 -4
  5. package/src/agents/codex/session.ts +9 -3
  6. package/src/channels/feishu/bot.ts +8 -4
  7. package/src/channels/feishu/turn-stream.ts +3 -2
  8. package/src/channels/web/api.ts +4 -0
  9. package/src/channels/web/server.ts +14 -2
  10. package/src/channels/web/tasks-api.ts +94 -0
  11. package/src/core/chat-mode.ts +14 -14
  12. package/src/core/hub.ts +95 -16
  13. package/src/core/memory-mcp.ts +1 -1
  14. package/src/core/personal.ts +3 -1
  15. package/src/core/store.ts +2 -0
  16. package/src/core/task-prompt.ts +38 -0
  17. package/src/core/task-runner.ts +232 -0
  18. package/src/core/task-schedule.ts +250 -0
  19. package/src/core/tasks-bridge.ts +252 -0
  20. package/src/core/tasks-mcp.ts +55 -0
  21. package/src/core/tasks.ts +281 -0
  22. package/src/core/types.ts +2 -0
  23. package/src/main.ts +8 -0
  24. package/src/mcp/tasks-server.ts +206 -0
  25. package/web/app.js +8 -5560
  26. package/web/css/base.css +291 -0
  27. package/web/css/composer.css +506 -0
  28. package/web/css/loader.css +196 -0
  29. package/web/css/messages.css +734 -0
  30. package/web/css/mobile.css +100 -0
  31. package/web/css/overlay.css +437 -0
  32. package/web/css/schedule.css +93 -0
  33. package/web/css/settings.css +335 -0
  34. package/web/css/sidebar.css +593 -0
  35. package/web/css/tasks.css +455 -0
  36. package/web/css/topbar.css +205 -0
  37. package/web/index.html +12 -1
  38. package/web/lib/api.js +26 -0
  39. package/web/lib/dom.js +101 -0
  40. package/web/lib/markdown.js +52 -0
  41. package/web/lib/overlay.js +144 -0
  42. package/web/lib/push.js +70 -0
  43. package/web/lib/time.js +60 -0
  44. package/web/lib/ws.js +236 -0
  45. package/web/settings/agents.js +210 -0
  46. package/web/settings/commands.js +411 -0
  47. package/web/settings/common.js +42 -0
  48. package/web/settings/feishu.js +181 -0
  49. package/web/settings/general.js +184 -0
  50. package/web/settings/index.js +63 -0
  51. package/web/settings/memory.js +366 -0
  52. package/web/settings/notify.js +80 -0
  53. package/web/settings/security.js +188 -0
  54. package/web/settings/users.js +189 -0
  55. package/web/state.js +46 -0
  56. package/web/views/auth.js +61 -0
  57. package/web/views/composer.js +324 -0
  58. package/web/views/conv-actions.js +412 -0
  59. package/web/views/interaction.js +140 -0
  60. package/web/views/layout.js +197 -0
  61. package/web/views/messages.js +531 -0
  62. package/web/views/quota.js +145 -0
  63. package/web/views/schedule.js +120 -0
  64. package/web/views/sidebar.js +458 -0
  65. package/web/views/slash.js +185 -0
  66. package/web/views/tasks.js +460 -0
  67. package/web/views/topbar.js +400 -0
  68. package/web/views/voice.js +189 -0
  69. package/web/style.css +0 -3500
@@ -0,0 +1,291 @@
1
+ :root {
2
+ --bg: #ffffff;
3
+ --bg-side: #f9f9f9;
4
+ --bg-soft: #f4f4f4;
5
+ --bg-hover: #ececec;
6
+ --bg-input: #ffffff;
7
+ --fg: #0d0d0d;
8
+ --fg-soft: #5d5d5d;
9
+ --fg-faint: #8f8f8f;
10
+ --border: #e5e5e5;
11
+ --accent: #2563eb;
12
+ --accent-fg: #ffffff;
13
+ --link: #2563eb;
14
+ --danger: #d93f3f;
15
+ --warn-bg: #fff7e6;
16
+ --warn-border: #f5c26b;
17
+ --ask-bg: #f4f0ff;
18
+ --ask-border: #b9a6f5;
19
+ --ok: #1a9d55;
20
+ --user-bubble: #f0f0f0;
21
+ --code-bg: #f6f8fa;
22
+ --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
23
+ --radius: 14px;
24
+ --side-w: 272px;
25
+ --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
26
+ "Helvetica Neue", Arial, sans-serif;
27
+ --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
28
+ color-scheme: light dark;
29
+ }
30
+
31
+ @media (prefers-color-scheme: dark) {
32
+ :root {
33
+ --bg: #212121;
34
+ --bg-side: #171717;
35
+ --bg-soft: #2a2a2a;
36
+ --bg-hover: #333333;
37
+ --bg-input: #303030;
38
+ --fg: #ececec;
39
+ --fg-soft: #b4b4b4;
40
+ --fg-faint: #8a8a8a;
41
+ --border: #3a3a3a;
42
+ --link: #60a5fa;
43
+ --warn-bg: #3a2f1a;
44
+ --warn-border: #8a6a2a;
45
+ --ask-bg: #2c2640;
46
+ --ask-border: #6a58b0;
47
+ --user-bubble: #303030;
48
+ --code-bg: #171717;
49
+ --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
50
+ }
51
+ }
52
+
53
+ * {
54
+ box-sizing: border-box;
55
+ }
56
+
57
+ html,
58
+ body {
59
+ margin: 0;
60
+ height: 100%;
61
+ background: var(--bg);
62
+ color: var(--fg);
63
+ font-family: var(--font);
64
+ font-size: 15px;
65
+ line-height: 1.6;
66
+ -webkit-text-size-adjust: 100%;
67
+ -webkit-tap-highlight-color: transparent;
68
+ }
69
+
70
+ #app {
71
+ height: 100%;
72
+ height: 100dvh;
73
+ }
74
+
75
+ button {
76
+ font: inherit;
77
+ color: inherit;
78
+ cursor: pointer;
79
+ border: none;
80
+ background: none;
81
+ }
82
+
83
+ input,
84
+ textarea,
85
+ select {
86
+ font: inherit;
87
+ color: inherit;
88
+ }
89
+
90
+ .boot {
91
+ display: grid;
92
+ place-items: center;
93
+ height: 100%;
94
+ color: var(--fg-faint);
95
+ }
96
+
97
+ /* ---------- 登录 ---------- */
98
+
99
+ .auth {
100
+ display: grid;
101
+ place-items: center;
102
+ height: 100%;
103
+ padding: 24px;
104
+ }
105
+
106
+ .auth-card {
107
+ width: 100%;
108
+ max-width: 360px;
109
+ display: flex;
110
+ flex-direction: column;
111
+ gap: 14px;
112
+ }
113
+
114
+ .auth-card h1 {
115
+ font-size: 24px;
116
+ margin: 0 0 4px;
117
+ text-align: center;
118
+ }
119
+
120
+ .auth-card p {
121
+ margin: 0;
122
+ color: var(--fg-soft);
123
+ font-size: 14px;
124
+ text-align: center;
125
+ }
126
+
127
+ .field {
128
+ display: flex;
129
+ flex-direction: column;
130
+ gap: 6px;
131
+ }
132
+
133
+ .field > span {
134
+ font-size: 13px;
135
+ color: var(--fg-soft);
136
+ }
137
+
138
+ /* 设置页的模型 / 思考程度下拉:读取失败时里面会换成文本框 + 提示 */
139
+ .picker {
140
+ display: flex;
141
+ flex-direction: column;
142
+ gap: 6px;
143
+ }
144
+
145
+ .field small {
146
+ color: var(--fg-faint);
147
+ font-size: 12px;
148
+ }
149
+
150
+ .input,
151
+ .field input,
152
+ .field select,
153
+ .field textarea {
154
+ width: 100%;
155
+ padding: 10px 12px;
156
+ border: 1px solid var(--border);
157
+ border-radius: 10px;
158
+ background: var(--bg-input);
159
+ outline: none;
160
+ }
161
+
162
+ /* 原生下拉框各平台长得不一样(macOS 上忽略内边距、高度对不齐),统一成和输入框一样的外观 */
163
+ .field select,
164
+ select.input {
165
+ -webkit-appearance: none;
166
+ appearance: none;
167
+ height: 46px;
168
+ padding: 0 36px 0 12px;
169
+ line-height: 44px;
170
+ cursor: pointer;
171
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238f8f8f' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
172
+ background-repeat: no-repeat;
173
+ background-position: right 12px center;
174
+ background-size: 14px;
175
+ text-overflow: ellipsis;
176
+ }
177
+
178
+ .field select:disabled {
179
+ cursor: default;
180
+ opacity: 0.7;
181
+ }
182
+
183
+ /* 放在 .field 里的复选框 / 单选框不套用上面输入框的宽度和内边距:
184
+ 否则复选框被撑宽,旁边的文字会被挤成两行(比如飞书机器人的「可用的 Agent」) */
185
+ .field input[type="checkbox"],
186
+ .field input[type="radio"] {
187
+ width: auto;
188
+ padding: 0;
189
+ flex-shrink: 0;
190
+ }
191
+
192
+ .input:focus,
193
+ .field input:focus,
194
+ .field select:focus,
195
+ .field textarea:focus {
196
+ border-color: var(--accent);
197
+ }
198
+
199
+ .btn {
200
+ display: inline-flex;
201
+ align-items: center;
202
+ justify-content: center;
203
+ gap: 6px;
204
+ padding: 8px 14px;
205
+ border-radius: 10px;
206
+ border: 1px solid var(--border);
207
+ background: var(--bg);
208
+ font-size: 14px;
209
+ white-space: nowrap;
210
+ }
211
+
212
+ .btn:hover {
213
+ background: var(--bg-hover);
214
+ }
215
+
216
+ .btn svg {
217
+ width: 18px;
218
+ height: 18px;
219
+ }
220
+
221
+ .btn.primary {
222
+ background: var(--fg);
223
+ color: var(--bg);
224
+ border-color: var(--fg);
225
+ }
226
+
227
+ .btn.primary:hover {
228
+ opacity: 0.85;
229
+ }
230
+
231
+ .btn.accent {
232
+ background: var(--accent);
233
+ border-color: var(--accent);
234
+ color: var(--accent-fg);
235
+ }
236
+
237
+ .btn.danger {
238
+ color: var(--danger);
239
+ }
240
+
241
+ .btn.small {
242
+ padding: 4px 10px;
243
+ font-size: 13px;
244
+ border-radius: 8px;
245
+ }
246
+
247
+ .btn:disabled {
248
+ opacity: 0.5;
249
+ cursor: default;
250
+ }
251
+
252
+ .error-text {
253
+ color: var(--danger);
254
+ font-size: 13px;
255
+ min-height: 1em;
256
+ }
257
+
258
+ /* ---------- 滚动条:细、无边框、无轨道,像 Codex ---------- */
259
+ ::-webkit-scrollbar {
260
+ width: 8px;
261
+ height: 8px;
262
+ }
263
+ ::-webkit-scrollbar-track,
264
+ ::-webkit-scrollbar-corner {
265
+ background: transparent;
266
+ }
267
+ ::-webkit-scrollbar-thumb {
268
+ background: color-mix(in srgb, var(--fg-faint) 32%, transparent);
269
+ border-radius: 999px;
270
+ border: 2px solid transparent;
271
+ background-clip: content-box;
272
+ }
273
+ ::-webkit-scrollbar-thumb:hover {
274
+ background-color: color-mix(in srgb, var(--fg-faint) 55%, transparent);
275
+ }
276
+ ::-webkit-scrollbar-button {
277
+ display: none;
278
+ }
279
+ /* 不认 ::-webkit-scrollbar 的浏览器(Firefox)用标准属性;Chrome 里设了标准属性会盖掉上面的,所以分开 */
280
+ @supports not selector(::-webkit-scrollbar) {
281
+ * {
282
+ scrollbar-width: thin;
283
+ scrollbar-color: color-mix(in srgb, var(--fg-faint) 40%, transparent) transparent;
284
+ }
285
+ }
286
+
287
+ /* iOS 上双击会放大页面:关掉双击缩放(双指缩放照常) */
288
+ html,
289
+ body {
290
+ touch-action: manipulation;
291
+ }