agent-loft 0.2.119 → 0.2.120
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/README.md +1 -1
- package/package.json +2 -1
- package/web/apple-touch-icon.png +0 -0
- package/web/css/loader.css +39 -137
- package/web/icon-maskable.svg +18 -9
- package/web/icon.svg +18 -9
- package/web/index.html +16 -1
- package/web/lib/dom.js +6 -7
- package/web/lib/loft-mark.js +4 -0
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
- **人在哪,台面就在哪**:电脑上用网页,手机上用 PWA 或飞书。同一个会话、同一个授权请求,在哪个渠道处理都行,其他地方自动同步。
|
|
20
20
|
- **跑在你自己的机器上**:代码、凭据和会话都留在本机,agent-loft 只是一层安全的遥控。
|
|
21
21
|
|
|
22
|
-
Logo
|
|
22
|
+
Logo 是白底的三向汇合:橘红、暖橙和珊瑚红三个单元,表达多个 agent 汇到同一处协作。图标源文件是 `web/icon.svg`,修改后运行 `npm run icons` 同步生成 iPhone、PWA、桌面端和两处 loading 的图形资源。
|
|
23
23
|
|
|
24
24
|
## 六大核心亮点
|
|
25
25
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-loft",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.120",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "多个 agent 的工作台:把本机 Claude Code / Codex 放到一处统一管理,用飞书和 Web 页面随时驱动——会话、审批、模型切换都共用",
|
|
6
6
|
"keywords": [
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"typecheck": "tsc --noEmit",
|
|
43
43
|
"test": "node --import tsx --test test/*.test.ts",
|
|
44
44
|
"build:editor": "node scripts/build-editor.mjs",
|
|
45
|
+
"icons": "node scripts/build-icons.mjs",
|
|
45
46
|
"prepublishOnly": "npm run typecheck"
|
|
46
47
|
},
|
|
47
48
|
"dependencies": {
|
package/web/apple-touch-icon.png
CHANGED
|
Binary file
|
package/web/css/loader.css
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/* ----------
|
|
2
|
-
.loft-loader
|
|
3
|
-
|
|
1
|
+
/* ---------- 汇合:开屏三臂向内聚拢,回复中轻转并依次呼吸 ---------- */
|
|
2
|
+
.loft-loader,
|
|
3
|
+
.loft-stars {
|
|
4
4
|
display: inline-block;
|
|
5
5
|
flex-shrink: 0;
|
|
6
6
|
width: var(--size);
|
|
@@ -8,161 +8,63 @@
|
|
|
8
8
|
line-height: 0;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
.loft-loader
|
|
12
|
-
|
|
13
|
-
}
|
|
11
|
+
.loft-loader { --size: 26px; }
|
|
12
|
+
.loft-loader.xl { --size: 72px; }
|
|
13
|
+
.loft-stars { --size: 18px; }
|
|
14
|
+
.loft-stars.lg { --size: 32px; }
|
|
14
15
|
|
|
15
|
-
.loft-loader svg
|
|
16
|
+
.loft-loader svg,
|
|
17
|
+
.loft-stars svg {
|
|
16
18
|
display: block;
|
|
17
19
|
width: 100%;
|
|
18
20
|
height: 100%;
|
|
19
21
|
overflow: visible;
|
|
20
22
|
}
|
|
21
23
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
animation-timing-function: cubic-bezier(0.45, 0, 0.25, 1);
|
|
28
|
-
animation-fill-mode: both;
|
|
29
|
-
animation-delay: calc(var(--t, 0ms) + var(--d, 0ms));
|
|
24
|
+
/* 以 SVG 的原点为中心,外层各自的 120° 旋转不受动画影响。 */
|
|
25
|
+
.lc-rotor,
|
|
26
|
+
.lc-arm {
|
|
27
|
+
transform-box: view-box;
|
|
28
|
+
transform-origin: 0 0;
|
|
30
29
|
}
|
|
30
|
+
.lc-arm-0 { --d: 0ms; }
|
|
31
|
+
.lc-arm-1 { --d: -600ms; }
|
|
32
|
+
.lc-arm-2 { --d: -1200ms; }
|
|
31
33
|
|
|
32
|
-
.loft-loader .
|
|
33
|
-
animation
|
|
34
|
+
.loft-loader .lc-arm {
|
|
35
|
+
animation: loft-converge 1.8s cubic-bezier(0.45, 0, 0.25, 1) infinite both;
|
|
36
|
+
animation-delay: calc(var(--t, 0ms) + var(--d));
|
|
34
37
|
}
|
|
35
38
|
|
|
36
|
-
|
|
37
|
-
|
|
39
|
+
@keyframes loft-converge {
|
|
40
|
+
0%, 100% { transform: translateY(-20px); opacity: 0.45; }
|
|
41
|
+
28%, 60% { transform: translateY(0); opacity: 1; }
|
|
38
42
|
}
|
|
39
43
|
|
|
40
|
-
.loft-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
.loft-loader .ll-r {
|
|
45
|
-
--d: 360ms;
|
|
44
|
+
.loft-stars .lc-rotor {
|
|
45
|
+
animation: loft-orbit 1.8s cubic-bezier(0.45, 0, 0.55, 1) infinite both;
|
|
46
|
+
animation-delay: var(--t, 0ms);
|
|
46
47
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
animation-
|
|
50
|
-
--d: 260ms;
|
|
48
|
+
.loft-stars .lc-arm {
|
|
49
|
+
animation: loft-signal 1.8s ease-in-out infinite both;
|
|
50
|
+
animation-delay: calc(var(--t, 0ms) + var(--d));
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
@keyframes loft-orbit {
|
|
54
|
+
from { transform: rotate(0deg); }
|
|
55
|
+
to { transform: rotate(360deg); }
|
|
56
56
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
70%,
|
|
61
|
-
100% {
|
|
62
|
-
transform: translateY(0) scale(0.72);
|
|
63
|
-
opacity: 0.4;
|
|
64
|
-
}
|
|
65
|
-
28% {
|
|
66
|
-
transform: translateY(-22px) scale(1.06);
|
|
67
|
-
opacity: 1;
|
|
68
|
-
}
|
|
69
|
-
48% {
|
|
70
|
-
transform: translateY(0) scale(0.92);
|
|
71
|
-
opacity: 0.85;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
@keyframes loft-plate {
|
|
76
|
-
0%,
|
|
77
|
-
100% {
|
|
78
|
-
opacity: 0.75;
|
|
79
|
-
}
|
|
80
|
-
45% {
|
|
81
|
-
opacity: 1;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
@keyframes loft-shadow {
|
|
86
|
-
0%,
|
|
87
|
-
100% {
|
|
88
|
-
transform: translateY(-6px);
|
|
89
|
-
opacity: 0.32;
|
|
90
|
-
}
|
|
91
|
-
50% {
|
|
92
|
-
transform: translateY(6px);
|
|
93
|
-
opacity: 0.12;
|
|
94
|
-
}
|
|
57
|
+
@keyframes loft-signal {
|
|
58
|
+
0%, 100% { opacity: 0.5; }
|
|
59
|
+
35%, 55% { opacity: 1; }
|
|
95
60
|
}
|
|
96
61
|
|
|
97
62
|
@media (prefers-reduced-motion: reduce) {
|
|
98
|
-
.loft-loader .
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}
|
|
102
|
-
.loft-loader .ll-shadow {
|
|
63
|
+
.loft-loader .lc-arm,
|
|
64
|
+
.loft-stars .lc-arm,
|
|
65
|
+
.loft-stars .lc-rotor {
|
|
103
66
|
animation: none;
|
|
104
|
-
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
/* 回复末尾的精简版:只有一颗星,旋转 + 放大缩小 */
|
|
109
|
-
.loft-stars {
|
|
110
|
-
display: inline-block;
|
|
111
|
-
flex-shrink: 0;
|
|
112
|
-
width: 18px;
|
|
113
|
-
height: 18px;
|
|
114
|
-
line-height: 0;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
/* 打开会话、读历史时用的大一号 */
|
|
118
|
-
.loft-stars.lg {
|
|
119
|
-
width: 32px;
|
|
120
|
-
height: 32px;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
.loft-stars svg {
|
|
124
|
-
display: block;
|
|
125
|
-
width: 100%;
|
|
126
|
-
height: 100%;
|
|
127
|
-
overflow: visible;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
.loft-stars path {
|
|
131
|
-
transform-box: fill-box;
|
|
132
|
-
transform-origin: 50% 50%;
|
|
133
|
-
animation: loft-twirl 1.8s cubic-bezier(0.45, 0, 0.25, 1) infinite both;
|
|
134
|
-
animation-delay: var(--t, 0ms);
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
/* 四角星转 90° 正好回到原样,所以每轮转 180° 能无缝接上 */
|
|
138
|
-
@keyframes loft-twirl {
|
|
139
|
-
0% {
|
|
140
|
-
transform: rotate(0deg) scale(0.6);
|
|
141
|
-
opacity: 0.55;
|
|
142
|
-
}
|
|
143
|
-
45% {
|
|
144
|
-
transform: rotate(110deg) scale(1.12);
|
|
145
|
-
opacity: 1;
|
|
146
|
-
}
|
|
147
|
-
100% {
|
|
148
|
-
transform: rotate(180deg) scale(0.6);
|
|
149
|
-
opacity: 0.55;
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
@media (prefers-reduced-motion: reduce) {
|
|
154
|
-
.loft-stars path {
|
|
155
|
-
animation-name: loft-star-calm;
|
|
156
|
-
animation-duration: 2.4s;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
@keyframes loft-star-calm {
|
|
161
|
-
0%,
|
|
162
|
-
100% {
|
|
163
|
-
opacity: 0.4;
|
|
164
|
-
}
|
|
165
|
-
40% {
|
|
67
|
+
transform: none;
|
|
166
68
|
opacity: 1;
|
|
167
69
|
}
|
|
168
70
|
}
|
package/web/icon-maskable.svg
CHANGED
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
|
|
2
|
-
|
|
3
|
-
<
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
<title>Agent Loft — 汇合</title>
|
|
3
|
+
<rect width="512" height="512" fill="#FFFFFF"/>
|
|
4
|
+
<defs>
|
|
5
|
+
<mask id="loft-center" maskUnits="userSpaceOnUse" x="-180" y="-180" width="360" height="360">
|
|
6
|
+
<rect x="-180" y="-180" width="360" height="360" fill="#FFFFFF"/>
|
|
7
|
+
<circle r="21" fill="#000000"/>
|
|
8
|
+
</mask>
|
|
9
|
+
</defs>
|
|
10
|
+
<g fill="#FF7444" color="#FF7444">
|
|
11
|
+
<g transform="translate(256 256)">
|
|
12
|
+
<g mask="url(#loft-center)">
|
|
13
|
+
<g class="lc-rotor">
|
|
14
|
+
<g class="lc-arm lc-arm-0"><rect x="-33" y="-133" width="66" height="139" rx="33" fill="#FF7444"/></g>
|
|
15
|
+
<g transform="rotate(120)"><g class="lc-arm lc-arm-1"><rect x="-33" y="-133" width="66" height="139" rx="33" fill="#FFB15B"/></g></g>
|
|
16
|
+
<g transform="rotate(240)"><g class="lc-arm lc-arm-2"><rect x="-33" y="-133" width="66" height="139" rx="33" fill="#F65364"/></g></g>
|
|
17
|
+
</g>
|
|
18
|
+
</g>
|
|
19
|
+
</g>
|
|
11
20
|
</g>
|
|
12
21
|
</svg>
|
package/web/icon.svg
CHANGED
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
|
|
2
|
-
|
|
3
|
-
<
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
<title>Agent Loft — 汇合</title>
|
|
3
|
+
<rect width="512" height="512" rx="114" fill="#FFFFFF"/>
|
|
4
|
+
<defs>
|
|
5
|
+
<mask id="loft-center" maskUnits="userSpaceOnUse" x="-180" y="-180" width="360" height="360">
|
|
6
|
+
<rect x="-180" y="-180" width="360" height="360" fill="#FFFFFF"/>
|
|
7
|
+
<circle r="21" fill="#000000"/>
|
|
8
|
+
</mask>
|
|
9
|
+
</defs>
|
|
10
|
+
<g fill="#FF7444" color="#FF7444">
|
|
11
|
+
<g transform="translate(256 256)">
|
|
12
|
+
<g mask="url(#loft-center)">
|
|
13
|
+
<g class="lc-rotor">
|
|
14
|
+
<g class="lc-arm lc-arm-0"><rect x="-33" y="-133" width="66" height="139" rx="33" fill="#FF7444"/></g>
|
|
15
|
+
<g transform="rotate(120)"><g class="lc-arm lc-arm-1"><rect x="-33" y="-133" width="66" height="139" rx="33" fill="#FFB15B"/></g></g>
|
|
16
|
+
<g transform="rotate(240)"><g class="lc-arm lc-arm-2"><rect x="-33" y="-133" width="66" height="139" rx="33" fill="#F65364"/></g></g>
|
|
17
|
+
</g>
|
|
18
|
+
</g>
|
|
19
|
+
</g>
|
|
11
20
|
</g>
|
|
12
21
|
</svg>
|
package/web/index.html
CHANGED
|
@@ -39,7 +39,22 @@
|
|
|
39
39
|
<link rel="stylesheet" href="/css/mobile.css" />
|
|
40
40
|
</head>
|
|
41
41
|
<body>
|
|
42
|
-
<div id="app"><div class="boot"><span class="loft-loader xl" role="img" aria-label="加载中"><svg
|
|
42
|
+
<div id="app"><div class="boot"><span class="loft-loader xl" role="img" aria-label="加载中"><svg xmlns="http://www.w3.org/2000/svg" viewBox="76 76 360 360" aria-hidden="true"><defs>
|
|
43
|
+
<mask id="loft-boot-center" maskUnits="userSpaceOnUse" x="-180" y="-180" width="360" height="360">
|
|
44
|
+
<rect x="-180" y="-180" width="360" height="360" fill="#FFFFFF"/>
|
|
45
|
+
<circle r="21" fill="#000000"/>
|
|
46
|
+
</mask>
|
|
47
|
+
</defs><g fill="#FF7444" color="#FF7444">
|
|
48
|
+
<g transform="translate(256 256)">
|
|
49
|
+
<g mask="url(#loft-boot-center)">
|
|
50
|
+
<g class="lc-rotor">
|
|
51
|
+
<g class="lc-arm lc-arm-0"><rect x="-33" y="-133" width="66" height="139" rx="33" fill="#FF7444"/></g>
|
|
52
|
+
<g transform="rotate(120)"><g class="lc-arm lc-arm-1"><rect x="-33" y="-133" width="66" height="139" rx="33" fill="#FFB15B"/></g></g>
|
|
53
|
+
<g transform="rotate(240)"><g class="lc-arm lc-arm-2"><rect x="-33" y="-133" width="66" height="139" rx="33" fill="#F65364"/></g></g>
|
|
54
|
+
</g>
|
|
55
|
+
</g>
|
|
56
|
+
</g>
|
|
57
|
+
</g></svg></span></div></div>
|
|
43
58
|
<script type="module" src="/app.js"></script>
|
|
44
59
|
</body>
|
|
45
60
|
</html>
|
package/web/lib/dom.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// ---------- 小工具 ----------
|
|
2
|
+
import { LOFT_MOTION_MS, loftLoaderSvg } from "./loft-mark.js";
|
|
2
3
|
|
|
3
4
|
export const $app = document.getElementById("app");
|
|
4
5
|
export const isTouch = matchMedia("(pointer: coarse)").matches;
|
|
@@ -95,23 +96,21 @@ ICON.dsh = `<svg viewBox="0 0 320 320"><image href="${new URL("../dsh.png", impo
|
|
|
95
96
|
ICON.pi = '<svg viewBox="0 0 64 64"><rect x="2" y="2" width="60" height="60" rx="14" fill="currentColor"/><path fill="none" stroke="var(--bg, #fff)" stroke-width="6" stroke-linecap="round" d="M15 21h34M25 21v24M40 21v18c0 4 2 6 6 6"/></svg>';
|
|
96
97
|
|
|
97
98
|
/**
|
|
98
|
-
*
|
|
99
|
-
*
|
|
99
|
+
* 汇合加载动画(回复末尾、打开会话时用);保留函数名供现有调用方使用。
|
|
100
|
+
* 每个实例的遮罩 id 唯一,隐藏或移除另一个实例不会影响当前图形。
|
|
100
101
|
* 动画按全局时钟设负的起始延迟:回复被授权卡片分成几段时,新一段的动画接着播、不会一抖一抖地重来。
|
|
101
102
|
*/
|
|
102
103
|
let loaderSeq = 0;
|
|
103
104
|
|
|
104
|
-
/** 只有 logo 中间那颗大星,一边旋转一边放大缩小 */
|
|
105
|
-
const STARS_MS = 1800;
|
|
106
105
|
export function starsLoader(cls = "") {
|
|
107
|
-
const id = `loft-
|
|
106
|
+
const id = `loft-reply-center-${++loaderSeq}`;
|
|
108
107
|
const el = h("span", {
|
|
109
108
|
class: `loft-stars${cls ? ` ${cls}` : ""}`,
|
|
110
109
|
role: "img",
|
|
111
110
|
"aria-label": "回复中",
|
|
112
|
-
html:
|
|
111
|
+
html: loftLoaderSvg(id),
|
|
113
112
|
});
|
|
114
|
-
el.style.setProperty("--t", `${-(performance.now() %
|
|
113
|
+
el.style.setProperty("--t", `${-(performance.now() % LOFT_MOTION_MS).toFixed(0)}ms`);
|
|
115
114
|
return el;
|
|
116
115
|
}
|
|
117
116
|
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// Generated by npm run icons from web/icon.svg.
|
|
2
|
+
export const LOFT_MOTION_MS = 1800;
|
|
3
|
+
const MARK = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"76 76 360 360\" aria-hidden=\"true\"><defs>\n <mask id=\"loft-center\" maskUnits=\"userSpaceOnUse\" x=\"-180\" y=\"-180\" width=\"360\" height=\"360\">\n <rect x=\"-180\" y=\"-180\" width=\"360\" height=\"360\" fill=\"#FFFFFF\"/>\n <circle r=\"21\" fill=\"#000000\"/>\n </mask>\n </defs><g fill=\"#FF7444\" color=\"#FF7444\">\n <g transform=\"translate(256 256)\">\n <g mask=\"url(#loft-center)\">\n <g class=\"lc-rotor\">\n <g class=\"lc-arm lc-arm-0\"><rect x=\"-33\" y=\"-133\" width=\"66\" height=\"139\" rx=\"33\" fill=\"#FF7444\"/></g>\n <g transform=\"rotate(120)\"><g class=\"lc-arm lc-arm-1\"><rect x=\"-33\" y=\"-133\" width=\"66\" height=\"139\" rx=\"33\" fill=\"#FFB15B\"/></g></g>\n <g transform=\"rotate(240)\"><g class=\"lc-arm lc-arm-2\"><rect x=\"-33\" y=\"-133\" width=\"66\" height=\"139\" rx=\"33\" fill=\"#F65364\"/></g></g>\n </g>\n </g>\n </g>\n </g></svg>";
|
|
4
|
+
export function loftLoaderSvg(id) { return MARK.replaceAll("loft-center", id); }
|