agentcue 0.0.0-stage → 0.0.2
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/LICENSE +21 -0
- package/README.md +122 -2
- package/dist/cli.js +770 -0
- package/dist/client.js +489 -0
- package/dist/demo.html +110 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +661 -0
- package/dist/server/dispatcher.d.ts +40 -0
- package/dist/server/handler.d.ts +20 -0
- package/dist/server/server.d.ts +20 -0
- package/dist/shared/prompt.d.ts +2 -0
- package/dist/shared/types.d.ts +69 -0
- package/dist/vite.d.ts +60 -0
- package/dist/vite.js +636 -0
- package/logo.svg +18 -0
- package/package.json +48 -4
package/dist/client.js
ADDED
|
@@ -0,0 +1,489 @@
|
|
|
1
|
+
(()=>{var _e=`
|
|
2
|
+
:host {
|
|
3
|
+
all: initial;
|
|
4
|
+
position: fixed;
|
|
5
|
+
inset: 0;
|
|
6
|
+
z-index: 2147483647;
|
|
7
|
+
pointer-events: none;
|
|
8
|
+
font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
|
|
9
|
+
font-size: 13px;
|
|
10
|
+
line-height: 1.4;
|
|
11
|
+
color: #f4f4f6;
|
|
12
|
+
-webkit-font-smoothing: antialiased;
|
|
13
|
+
}
|
|
14
|
+
*, *::before, *::after { box-sizing: border-box; }
|
|
15
|
+
|
|
16
|
+
.hover-box {
|
|
17
|
+
position: fixed; pointer-events: none;
|
|
18
|
+
border: 1.5px solid #3b82f6; background: rgba(59, 130, 246, 0.08);
|
|
19
|
+
border-radius: 5px;
|
|
20
|
+
opacity: 0; visibility: hidden; transform: scale(0.985);
|
|
21
|
+
transition:
|
|
22
|
+
left 70ms cubic-bezier(0.22, 1, 0.36, 1),
|
|
23
|
+
top 70ms cubic-bezier(0.22, 1, 0.36, 1),
|
|
24
|
+
width 70ms cubic-bezier(0.22, 1, 0.36, 1),
|
|
25
|
+
height 70ms cubic-bezier(0.22, 1, 0.36, 1),
|
|
26
|
+
opacity 120ms ease, transform 120ms ease, visibility 0s linear 120ms;
|
|
27
|
+
}
|
|
28
|
+
.hover-box.visible {
|
|
29
|
+
opacity: 1; visibility: visible; transform: scale(1);
|
|
30
|
+
transition:
|
|
31
|
+
left 70ms cubic-bezier(0.22, 1, 0.36, 1),
|
|
32
|
+
top 70ms cubic-bezier(0.22, 1, 0.36, 1),
|
|
33
|
+
width 70ms cubic-bezier(0.22, 1, 0.36, 1),
|
|
34
|
+
height 70ms cubic-bezier(0.22, 1, 0.36, 1),
|
|
35
|
+
opacity 120ms ease, transform 120ms ease, visibility 0s linear 0s;
|
|
36
|
+
}
|
|
37
|
+
.hover-tag {
|
|
38
|
+
position: fixed; pointer-events: none;
|
|
39
|
+
background: rgba(18, 18, 22, 0.96); color: #e2e8f0;
|
|
40
|
+
border: 1px solid rgba(59, 130, 246, 0.42); border-radius: 6px;
|
|
41
|
+
padding: 2px 7px; font-size: 11px;
|
|
42
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
43
|
+
white-space: nowrap; max-width: 360px; overflow: hidden; text-overflow: ellipsis;
|
|
44
|
+
box-shadow: 0 6px 16px rgba(0, 0, 0, 0.38);
|
|
45
|
+
opacity: 0; visibility: hidden; transform: translateY(3px);
|
|
46
|
+
transition: opacity 110ms ease, transform 110ms ease, visibility 0s linear 110ms;
|
|
47
|
+
}
|
|
48
|
+
.hover-tag.visible {
|
|
49
|
+
opacity: 1; visibility: visible; transform: translateY(0);
|
|
50
|
+
transition: opacity 110ms ease, transform 110ms ease, visibility 0s linear 0s;
|
|
51
|
+
}
|
|
52
|
+
.hover-tag .hint-source { color: #93c5fd; margin-left: 6px; }
|
|
53
|
+
|
|
54
|
+
.pins-layer {
|
|
55
|
+
position: fixed; inset: 0; pointer-events: none;
|
|
56
|
+
opacity: 1; visibility: visible;
|
|
57
|
+
transition: opacity 180ms ease, visibility 0s linear 0s;
|
|
58
|
+
}
|
|
59
|
+
.pins-layer.hidden {
|
|
60
|
+
opacity: 0; visibility: hidden;
|
|
61
|
+
transition: opacity 160ms ease, visibility 0s linear 160ms;
|
|
62
|
+
}
|
|
63
|
+
.pin-badge {
|
|
64
|
+
position: fixed; width: 24px; height: 24px; margin: -12px 0 0 -12px;
|
|
65
|
+
border-radius: 999px; background: #2563eb; color: #fff; border: 2px solid #fff;
|
|
66
|
+
font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center;
|
|
67
|
+
cursor: pointer; pointer-events: auto; user-select: none;
|
|
68
|
+
box-shadow: 0 4px 12px rgba(37, 99, 235, 0.5), 0 1px 3px rgba(0, 0, 0, 0.4);
|
|
69
|
+
animation: pinPopIn 240ms cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
|
|
70
|
+
transition: transform 160ms cubic-bezier(0.22, 1, 0.36, 1), background 140ms ease, opacity 160ms ease, box-shadow 160ms ease;
|
|
71
|
+
}
|
|
72
|
+
@keyframes pinPopIn {
|
|
73
|
+
0% { opacity: 0; transform: scale(0.25); }
|
|
74
|
+
100% { opacity: 1; transform: scale(1); }
|
|
75
|
+
}
|
|
76
|
+
.pin-badge:hover { transform: scale(1.14); background: #1d4ed8; }
|
|
77
|
+
.pin-badge.active {
|
|
78
|
+
background: #f59e0b; transform: scale(1.1);
|
|
79
|
+
box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.28), 0 4px 12px rgba(0, 0, 0, 0.45);
|
|
80
|
+
}
|
|
81
|
+
.pin-badge.removing {
|
|
82
|
+
opacity: 0; transform: scale(0.25); pointer-events: none;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.popover {
|
|
86
|
+
position: fixed; width: 310px;
|
|
87
|
+
background: rgba(20, 20, 24, 0.97); backdrop-filter: blur(20px);
|
|
88
|
+
border: 1px solid rgba(255, 255, 255, 0.13); border-radius: 14px;
|
|
89
|
+
padding: 11px; pointer-events: none;
|
|
90
|
+
box-shadow: 0 20px 48px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(0, 0, 0, 0.3);
|
|
91
|
+
display: flex; flex-direction: column; gap: 8px;
|
|
92
|
+
opacity: 0; visibility: hidden;
|
|
93
|
+
transform: translateY(8px) scale(0.9);
|
|
94
|
+
transform-origin: 0px 20px;
|
|
95
|
+
transition:
|
|
96
|
+
opacity 170ms cubic-bezier(0.4, 0, 0.2, 1),
|
|
97
|
+
transform 190ms cubic-bezier(0.4, 0, 0.2, 1),
|
|
98
|
+
left 180ms cubic-bezier(0.22, 1, 0.36, 1),
|
|
99
|
+
top 180ms cubic-bezier(0.22, 1, 0.36, 1),
|
|
100
|
+
visibility 0s linear 190ms;
|
|
101
|
+
}
|
|
102
|
+
.popover.no-glide {
|
|
103
|
+
transition:
|
|
104
|
+
opacity 170ms cubic-bezier(0.4, 0, 0.2, 1),
|
|
105
|
+
transform 190ms cubic-bezier(0.4, 0, 0.2, 1),
|
|
106
|
+
visibility 0s linear 190ms;
|
|
107
|
+
}
|
|
108
|
+
.popover.visible {
|
|
109
|
+
opacity: 1; visibility: visible; pointer-events: auto;
|
|
110
|
+
transform: translateY(0) scale(1);
|
|
111
|
+
transition:
|
|
112
|
+
opacity 200ms cubic-bezier(0.22, 1, 0.36, 1),
|
|
113
|
+
transform 240ms cubic-bezier(0.22, 1, 0.36, 1),
|
|
114
|
+
left 180ms cubic-bezier(0.22, 1, 0.36, 1),
|
|
115
|
+
top 180ms cubic-bezier(0.22, 1, 0.36, 1),
|
|
116
|
+
visibility 0s linear 0s;
|
|
117
|
+
}
|
|
118
|
+
.popover.visible.no-glide {
|
|
119
|
+
transition:
|
|
120
|
+
opacity 200ms cubic-bezier(0.22, 1, 0.36, 1),
|
|
121
|
+
transform 240ms cubic-bezier(0.22, 1, 0.36, 1),
|
|
122
|
+
visibility 0s linear 0s;
|
|
123
|
+
}
|
|
124
|
+
.popover-header { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
|
|
125
|
+
.popover-target {
|
|
126
|
+
display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 11px;
|
|
127
|
+
color: #a1a1aa; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
128
|
+
}
|
|
129
|
+
.popover-target .num {
|
|
130
|
+
background: rgba(59, 130, 246, 0.22); color: #93c5fd;
|
|
131
|
+
padding: 1px 6px; border-radius: 999px; font-weight: 700; flex-shrink: 0;
|
|
132
|
+
}
|
|
133
|
+
.popover-target .sel { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
134
|
+
.icon-btn {
|
|
135
|
+
background: transparent; border: none; color: #a1a1aa; cursor: pointer;
|
|
136
|
+
padding: 4px 6px; border-radius: 6px; font-size: 11px; display: inline-flex; align-items: center;
|
|
137
|
+
transition: background 120ms ease, color 120ms ease;
|
|
138
|
+
}
|
|
139
|
+
.icon-btn:hover { background: rgba(255, 255, 255, 0.1); color: #f87171; }
|
|
140
|
+
.popover textarea {
|
|
141
|
+
width: 100%; min-height: 58px; max-height: 140px; resize: vertical;
|
|
142
|
+
background: rgba(0, 0, 0, 0.38); border: 1px solid rgba(255, 255, 255, 0.12);
|
|
143
|
+
border-radius: 8px; padding: 7px 9px; color: #f4f4f6;
|
|
144
|
+
font-family: inherit; font-size: 12.5px; line-height: 1.45; outline: none;
|
|
145
|
+
transition: border-color 140ms ease, box-shadow 140ms ease;
|
|
146
|
+
}
|
|
147
|
+
.popover textarea:focus { border-color: #3b82f6; box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.22); }
|
|
148
|
+
.popover textarea::placeholder { color: #71717a; }
|
|
149
|
+
.popover-footer { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
|
|
150
|
+
.popover-hints { font-size: 10.5px; color: #71717a; }
|
|
151
|
+
.popover-actions { display: flex; align-items: center; gap: 5px; }
|
|
152
|
+
.btn-sm {
|
|
153
|
+
border: 1px solid rgba(255, 255, 255, 0.14); background: rgba(255, 255, 255, 0.07);
|
|
154
|
+
color: #e4e4e7; border-radius: 7px; padding: 4px 9px; font-size: 11px; font-weight: 500; cursor: pointer;
|
|
155
|
+
transition: background 120ms ease, transform 100ms ease;
|
|
156
|
+
}
|
|
157
|
+
.btn-sm:hover { background: rgba(255, 255, 255, 0.14); }
|
|
158
|
+
.btn-sm:active { transform: scale(0.96); }
|
|
159
|
+
.btn-sm.primary { background: #2563eb; border-color: #3b82f6; color: #fff; }
|
|
160
|
+
.btn-sm.primary:hover { background: #1d4ed8; }
|
|
161
|
+
|
|
162
|
+
.capsule-wrap {
|
|
163
|
+
position: fixed; right: 16px; bottom: 16px;
|
|
164
|
+
display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none;
|
|
165
|
+
}
|
|
166
|
+
.toast {
|
|
167
|
+
pointer-events: none; max-width: 360px;
|
|
168
|
+
background: rgba(22, 22, 26, 0.96); border: 1px solid rgba(255, 255, 255, 0.12);
|
|
169
|
+
border-radius: 10px; padding: 6px 11px; font-size: 11.5px; color: #e4e4e7;
|
|
170
|
+
box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
|
|
171
|
+
opacity: 0; visibility: hidden; transform: translateY(6px) scale(0.95);
|
|
172
|
+
transition: opacity 180ms cubic-bezier(0.22, 1, 0.36, 1), transform 180ms cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 180ms;
|
|
173
|
+
}
|
|
174
|
+
.toast.visible {
|
|
175
|
+
pointer-events: auto; opacity: 1; visibility: visible; transform: translateY(0) scale(1);
|
|
176
|
+
transition: opacity 180ms cubic-bezier(0.22, 1, 0.36, 1), transform 180ms cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0s;
|
|
177
|
+
}
|
|
178
|
+
.toast.error { border-color: rgba(248, 113, 113, 0.5); color: #fecaca; }
|
|
179
|
+
|
|
180
|
+
.agent-menu {
|
|
181
|
+
pointer-events: none;
|
|
182
|
+
background: rgba(22, 22, 26, 0.97); backdrop-filter: blur(18px);
|
|
183
|
+
border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 12px;
|
|
184
|
+
padding: 5px; min-width: 170px; margin-right: 44px;
|
|
185
|
+
box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55);
|
|
186
|
+
display: flex; flex-direction: column; gap: 2px;
|
|
187
|
+
opacity: 0; visibility: hidden;
|
|
188
|
+
transform: translateY(8px) scale(0.92);
|
|
189
|
+
transform-origin: bottom right;
|
|
190
|
+
transition:
|
|
191
|
+
opacity 160ms cubic-bezier(0.22, 1, 0.36, 1),
|
|
192
|
+
transform 190ms cubic-bezier(0.22, 1, 0.36, 1),
|
|
193
|
+
visibility 0s linear 190ms;
|
|
194
|
+
}
|
|
195
|
+
.agent-menu.visible {
|
|
196
|
+
pointer-events: auto; opacity: 1; visibility: visible;
|
|
197
|
+
transform: translateY(0) scale(1);
|
|
198
|
+
transition:
|
|
199
|
+
opacity 170ms cubic-bezier(0.22, 1, 0.36, 1),
|
|
200
|
+
transform 210ms cubic-bezier(0.22, 1, 0.36, 1),
|
|
201
|
+
visibility 0s linear 0s;
|
|
202
|
+
}
|
|
203
|
+
.agent-menu-header {
|
|
204
|
+
display: flex; align-items: center; justify-content: space-between;
|
|
205
|
+
padding: 3px 8px 4px; font-size: 10px; font-weight: 600; color: #71717a;
|
|
206
|
+
letter-spacing: 0.04em; text-transform: uppercase;
|
|
207
|
+
}
|
|
208
|
+
.agent-opt {
|
|
209
|
+
display: flex; align-items: center; justify-content: space-between; gap: 10px;
|
|
210
|
+
width: 100%; border: none; background: transparent; color: #d4d4d8;
|
|
211
|
+
padding: 5px 8px; border-radius: 8px; font-size: 12px; font-weight: 500;
|
|
212
|
+
cursor: pointer; text-align: left;
|
|
213
|
+
transition: background 110ms ease, color 110ms ease;
|
|
214
|
+
}
|
|
215
|
+
.agent-opt:hover { background: rgba(255, 255, 255, 0.09); color: #fff; }
|
|
216
|
+
.agent-opt.selected { background: rgba(59, 130, 246, 0.18); color: #93c5fd; }
|
|
217
|
+
.agent-opt-left { display: flex; align-items: center; gap: 6px; }
|
|
218
|
+
.agent-opt-dot {
|
|
219
|
+
width: 5px; height: 5px; border-radius: 999px; background: transparent;
|
|
220
|
+
}
|
|
221
|
+
.agent-opt.selected .agent-opt-dot { background: #60a5fa; }
|
|
222
|
+
.agent-opt-kbd {
|
|
223
|
+
font-size: 10px; color: #71717a; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
224
|
+
background: rgba(255, 255, 255, 0.06); padding: 1px 5px; border-radius: 4px;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.toolbar-stage {
|
|
228
|
+
position: relative; display: flex; align-items: center; justify-content: flex-end;
|
|
229
|
+
min-height: 42px;
|
|
230
|
+
}
|
|
231
|
+
.launcher {
|
|
232
|
+
pointer-events: auto; position: absolute; right: 0;
|
|
233
|
+
display: inline-flex; align-items: center; justify-content: center; gap: 6px;
|
|
234
|
+
min-width: 42px; height: 42px; padding: 0 13px;
|
|
235
|
+
background: rgba(22, 22, 26, 0.95); backdrop-filter: blur(18px);
|
|
236
|
+
border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 999px;
|
|
237
|
+
color: #f4f4f6; font-size: 13px; font-weight: 600; cursor: pointer;
|
|
238
|
+
box-shadow: 0 10px 28px rgba(0, 0, 0, 0.48);
|
|
239
|
+
opacity: 1; visibility: visible; transform: scale(1);
|
|
240
|
+
transform-origin: center;
|
|
241
|
+
transition:
|
|
242
|
+
transform 250ms cubic-bezier(0.22, 1, 0.36, 1),
|
|
243
|
+
opacity 180ms ease,
|
|
244
|
+
border-color 140ms ease,
|
|
245
|
+
background 140ms ease,
|
|
246
|
+
visibility 0s linear 0s;
|
|
247
|
+
}
|
|
248
|
+
.launcher:hover {
|
|
249
|
+
transform: translateY(-1px) scale(1.03);
|
|
250
|
+
background: rgba(30, 30, 36, 0.98);
|
|
251
|
+
border-color: rgba(255, 255, 255, 0.24);
|
|
252
|
+
}
|
|
253
|
+
.launcher.hidden {
|
|
254
|
+
pointer-events: none; opacity: 0; visibility: hidden;
|
|
255
|
+
transform: scale(0.55);
|
|
256
|
+
transition:
|
|
257
|
+
transform 210ms cubic-bezier(0.4, 0, 0.2, 1),
|
|
258
|
+
opacity 140ms ease,
|
|
259
|
+
visibility 0s linear 210ms;
|
|
260
|
+
}
|
|
261
|
+
.launcher-logo { width: 16px; height: 16px; flex-shrink: 0; display: block; }
|
|
262
|
+
.launcher-text { font-size: 11.5px; font-weight: 500; color: #cbd5e1; white-space: nowrap; }
|
|
263
|
+
.launcher-text:empty { display: none; }
|
|
264
|
+
.launcher-count {
|
|
265
|
+
position: absolute; top: -4px; right: -3px;
|
|
266
|
+
min-width: 18px; height: 18px; padding: 0 5px;
|
|
267
|
+
border-radius: 999px; background: #2563eb; color: #fff;
|
|
268
|
+
font-size: 10px; font-weight: 700; display: none;
|
|
269
|
+
align-items: center; justify-content: center;
|
|
270
|
+
border: 1.5px solid #16161a;
|
|
271
|
+
}
|
|
272
|
+
.launcher-count.visible { display: inline-flex; }
|
|
273
|
+
|
|
274
|
+
.capsule {
|
|
275
|
+
pointer-events: none;
|
|
276
|
+
display: flex; align-items: center; height: 42px; padding: 0 8px;
|
|
277
|
+
background: rgba(22, 22, 26, 0.96); backdrop-filter: blur(18px);
|
|
278
|
+
border: 1px solid rgba(255, 255, 255, 0.11); border-radius: 999px;
|
|
279
|
+
box-shadow: 0 12px 34px rgba(0, 0, 0, 0.55), 0 1px 0 rgba(255, 255, 255, 0.05) inset;
|
|
280
|
+
max-width: 42px; opacity: 0; visibility: hidden;
|
|
281
|
+
transform: scaleX(0.6) scaleY(0.82);
|
|
282
|
+
transform-origin: calc(100% - 21px) 50%;
|
|
283
|
+
transition:
|
|
284
|
+
max-width 240ms cubic-bezier(0.4, 0, 0.2, 1),
|
|
285
|
+
transform 220ms cubic-bezier(0.4, 0, 0.2, 1),
|
|
286
|
+
opacity 160ms ease,
|
|
287
|
+
visibility 0s linear 240ms;
|
|
288
|
+
}
|
|
289
|
+
.capsule.expanded {
|
|
290
|
+
pointer-events: auto;
|
|
291
|
+
max-width: 460px; opacity: 1; visibility: visible;
|
|
292
|
+
transform: scaleX(1) scaleY(1);
|
|
293
|
+
transition:
|
|
294
|
+
max-width 300ms cubic-bezier(0.22, 1, 0.36, 1),
|
|
295
|
+
transform 280ms cubic-bezier(0.22, 1, 0.36, 1),
|
|
296
|
+
opacity 180ms ease,
|
|
297
|
+
visibility 0s linear 0s;
|
|
298
|
+
}
|
|
299
|
+
.capsule-inner {
|
|
300
|
+
display: flex; align-items: center; gap: 3px;
|
|
301
|
+
opacity: 0; transform: translateX(8px) scale(0.95);
|
|
302
|
+
transition: opacity 130ms ease, transform 180ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
303
|
+
}
|
|
304
|
+
.capsule.expanded .capsule-inner {
|
|
305
|
+
opacity: 1; transform: translateX(0) scale(1);
|
|
306
|
+
transition: opacity 190ms ease 45ms, transform 240ms cubic-bezier(0.22, 1, 0.36, 1) 35ms;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
.status-dot {
|
|
310
|
+
width: 6px; height: 6px; border-radius: 999px; background: #10b981; flex-shrink: 0;
|
|
311
|
+
}
|
|
312
|
+
.status-dot.offline { background: #f59e0b; }
|
|
313
|
+
.status-dot.running { background: #38bdf8; animation: pulse 1s ease-in-out infinite; }
|
|
314
|
+
.status-dot.error { background: #ef4444; }
|
|
315
|
+
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.45; transform: scale(0.82); } }
|
|
316
|
+
|
|
317
|
+
.tool-btn {
|
|
318
|
+
position: relative;
|
|
319
|
+
display: inline-flex; align-items: center; justify-content: center; gap: 5px;
|
|
320
|
+
width: 32px; height: 32px; padding: 0;
|
|
321
|
+
border-radius: 999px; border: none; background: transparent;
|
|
322
|
+
color: rgba(244, 244, 246, 0.78); font-size: 12px; font-weight: 500;
|
|
323
|
+
cursor: pointer; user-select: none; flex-shrink: 0;
|
|
324
|
+
transition: background 130ms ease, color 130ms ease, transform 110ms ease, opacity 130ms ease;
|
|
325
|
+
}
|
|
326
|
+
.tool-btn svg { width: 15px; height: 15px; stroke-width: 1.85; flex-shrink: 0; }
|
|
327
|
+
.tool-btn:hover:not(:disabled) {
|
|
328
|
+
background: rgba(255, 255, 255, 0.1);
|
|
329
|
+
color: #ffffff;
|
|
330
|
+
}
|
|
331
|
+
.tool-btn:active:not(:disabled) { transform: scale(0.92); }
|
|
332
|
+
.tool-btn:disabled { opacity: 0.32; cursor: not-allowed; }
|
|
333
|
+
.tool-btn.pick-active {
|
|
334
|
+
color: #60a5fa;
|
|
335
|
+
background: rgba(59, 130, 246, 0.16);
|
|
336
|
+
}
|
|
337
|
+
.tool-btn.cont-active {
|
|
338
|
+
color: #d8b4fe;
|
|
339
|
+
background: rgba(168, 85, 247, 0.18);
|
|
340
|
+
}
|
|
341
|
+
.tool-btn.hide-active {
|
|
342
|
+
color: #fbbf24;
|
|
343
|
+
background: rgba(245, 158, 11, 0.16);
|
|
344
|
+
}
|
|
345
|
+
.tool-btn.copy-btn .icon-copy,
|
|
346
|
+
.tool-btn.copy-btn .icon-check {
|
|
347
|
+
transition: transform 220ms cubic-bezier(0.34, 1.56, 0.64, 1), opacity 150ms ease;
|
|
348
|
+
}
|
|
349
|
+
.tool-btn.copy-btn .icon-check {
|
|
350
|
+
position: absolute; opacity: 0; transform: scale(0.35) rotate(-20deg);
|
|
351
|
+
}
|
|
352
|
+
.tool-btn.copy-btn.copied {
|
|
353
|
+
color: #34d399;
|
|
354
|
+
background: rgba(16, 185, 129, 0.16);
|
|
355
|
+
}
|
|
356
|
+
.tool-btn.copy-btn.copied .icon-copy {
|
|
357
|
+
opacity: 0; transform: scale(0.35) rotate(20deg);
|
|
358
|
+
}
|
|
359
|
+
.tool-btn.copy-btn.copied .icon-check {
|
|
360
|
+
opacity: 1; transform: scale(1) rotate(0deg);
|
|
361
|
+
}
|
|
362
|
+
.tool-btn.agent-btn {
|
|
363
|
+
width: auto; padding: 0 9px; gap: 5px;
|
|
364
|
+
background: rgba(255, 255, 255, 0.06);
|
|
365
|
+
border: 1px solid rgba(255, 255, 255, 0.08);
|
|
366
|
+
color: #f4f4f6; font-size: 11.5px; font-weight: 500;
|
|
367
|
+
}
|
|
368
|
+
.tool-btn.agent-btn:hover {
|
|
369
|
+
background: rgba(255, 255, 255, 0.12);
|
|
370
|
+
border-color: rgba(255, 255, 255, 0.18);
|
|
371
|
+
}
|
|
372
|
+
.tool-btn.agent-btn.menu-open {
|
|
373
|
+
background: rgba(59, 130, 246, 0.18);
|
|
374
|
+
border-color: rgba(96, 165, 250, 0.45);
|
|
375
|
+
color: #93c5fd;
|
|
376
|
+
}
|
|
377
|
+
.agent-name { max-width: 82px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
378
|
+
.kbd {
|
|
379
|
+
font-size: 9.5px; opacity: 0.6;
|
|
380
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
381
|
+
}
|
|
382
|
+
.tool-btn.send-btn {
|
|
383
|
+
width: auto; min-width: 32px; padding: 0 8px;
|
|
384
|
+
background: rgba(16, 185, 129, 0.18);
|
|
385
|
+
color: #34d399; font-weight: 600;
|
|
386
|
+
}
|
|
387
|
+
.tool-btn.send-btn:not(:disabled) {
|
|
388
|
+
background: #10b981; color: #052e16;
|
|
389
|
+
}
|
|
390
|
+
.tool-btn.send-btn:hover:not(:disabled) { background: #34d399; }
|
|
391
|
+
.send-count {
|
|
392
|
+
font-size: 11px; font-weight: 700; line-height: 1;
|
|
393
|
+
}
|
|
394
|
+
.send-count:empty { display: none; }
|
|
395
|
+
|
|
396
|
+
.tool-btn[data-tip]::after {
|
|
397
|
+
content: attr(data-tip);
|
|
398
|
+
position: absolute; bottom: calc(100% + 9px); left: 50%;
|
|
399
|
+
transform: translateX(-50%) translateY(4px) scale(0.95);
|
|
400
|
+
background: rgba(18, 18, 22, 0.96); color: #f4f4f6;
|
|
401
|
+
border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 6px;
|
|
402
|
+
padding: 3px 7px; font-size: 10.5px; font-weight: 500; white-space: nowrap;
|
|
403
|
+
box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
|
|
404
|
+
pointer-events: none; opacity: 0; visibility: hidden;
|
|
405
|
+
transition: opacity 120ms ease, transform 120ms ease, visibility 0s linear 120ms;
|
|
406
|
+
}
|
|
407
|
+
.tool-btn[data-tip]:hover::after {
|
|
408
|
+
opacity: 1; visibility: visible;
|
|
409
|
+
transform: translateX(-50%) translateY(0) scale(1);
|
|
410
|
+
transition: opacity 120ms ease 80ms, transform 120ms ease 80ms, visibility 0s linear 80ms;
|
|
411
|
+
}
|
|
412
|
+
.sep { width: 1px; height: 16px; background: rgba(255, 255, 255, 0.12); margin: 0 3px; flex-shrink: 0; }
|
|
413
|
+
`;var rt=["display","fontSize","fontWeight","color","backgroundColor","padding","margin","borderRadius","gap"];function pe(n){if(typeof CSS<"u"&&typeof CSS.escape==="function")return CSS.escape(n);return n.replace(/([^a-zA-Z0-9_-])/g,"\\$1")}function ue(n){if(!n)return!1;if(n.includes(":")||/^radix-|^headlessui-|^\d+$/.test(n))return!1;return n.length<=48}function He(n,i=2){return Array.from(n.classList).filter((s)=>s.length>1&&s.length<=36&&!/^css-[a-z0-9]+$|^sc-[a-zA-Z0-9]+$|^svelte-[a-z0-9]+$/.test(s)).slice(0,i)}function at(n,i=!1){let o=n.tagName.toLowerCase();if(n.id&&ue(n.id))return`#${pe(n.id)}`;let s=n.getAttribute("data-testid")||n.getAttribute("data-test-id");if(s){let l=n.hasAttribute("data-testid")?"data-testid":"data-test-id";return`${o}[${l}="${s.replace(/"/g,"\\\"")}"]`}let t=He(n,2),c=t.length>0?`${o}.${t.map((l)=>pe(l)).join(".")}`:o;if(i&&n.parentElement){let l=Array.from(n.parentElement.children).filter((p)=>p.tagName===n.tagName);if(l.length>1){let p=l.indexOf(n)+1;c+=`:nth-of-type(${p})`}}return c}function lt(n){let i=n.ownerDocument;if(n.id&&ue(n.id))return`#${pe(n.id)}`;let o=[],s=n,t=0;while(s&&s.tagName.toLowerCase()!=="html"&&t<6){if(s.tagName.toLowerCase()==="body"){o.unshift("body");break}let l=at(s,!0);o.unshift(l);let p=o.join(" > ");try{if(i.querySelectorAll(p).length===1)return p}catch{}if(l.startsWith("#"))break;s=s.parentElement,t++}return o.join(" > ")||n.tagName.toLowerCase()}function ct(n){let i=[],o=n,s=0;while(o&&s<5){let t=o.tagName.toLowerCase();if(t==="html")break;if(t==="body"){i.unshift("body");break}let c=He(o,1),l=o.id&&ue(o.id)?`${t}#${o.id}`:c.length>0?`${t}.${c[0]}`:t;i.unshift(l),o=o.parentElement,s++}return i.join(" > ")}function dt(n,i=500){let o=n.cloneNode(!0),s=o.tagName.toLowerCase()==="svg"?[o]:Array.from(o.querySelectorAll("svg"));for(let c of s)if(c.innerHTML.length>80)c.innerHTML="<!-- svg -->";let t=o.outerHTML.replace(/\s+/g," ").trim();if(t.length<=i)return t;return`${t.slice(0,i-15)}...<!--truncated-->`}function pt(n){let i=n.split(`
|
|
414
|
+
`);for(let o of i){if(o.includes("react-stack-top-frame")||o.includes("node_modules")||o.includes("react_jsx")||o.includes("react-dom")||o.includes("/@vite/")||o.includes("__agentcue"))continue;let s=o.match(/https?:\/\/[^/]+\/([^\s:)]+):(\d+)(?::\d+)?/);if(s){let t=s[1].split("?")[0];if(t.startsWith("@fs/"))t=`/${t.slice(4)}`;return`${t}:${s[2]}`}}return}function ut(n){let i,o=[],s=n;for(let d=0;d<12&&s&&!i;d++){let u=s.getAttribute("data-source");if(u){i=u;break}let v=s.getAttribute("data-astro-source-file");if(v){let L=s.getAttribute("data-astro-source-loc");i=L?`${v}:${L}`:v;break}let g=s.getAttribute("data-inspector-relative-path")||s.getAttribute("data-v-inspector-file");if(g){let L=s.getAttribute("data-inspector-line")||s.getAttribute("data-v-inspector-line");i=L?`${g}:${L}`:g;break}s=s.parentElement}let t=n,c=t.__svelte_meta;if(!i&&c?.loc?.file){let{file:d,line:u}=c.loc;i=u!=null?`${d}:${u}`:d}let l=t.__vueParentComponent,p=0;while(l&&p<6){let d=l.type?.__name||l.type?.name;if(d&&!o.includes(`<${d}>`))o.unshift(`<${d}>`);if(!i&&l.type?.__file)i=l.type.__file;l=l.parent,p++}let m=Object.keys(n).find((d)=>d.startsWith("__reactFiber$")||d.startsWith("__reactInternalInstance$"));if(m){let d=t[m],u=0;while(d&&u<12){if(!i&&d._debugSource?.fileName){let{fileName:v,lineNumber:g}=d._debugSource;i=g!=null?`${v}:${g}`:v}if(!i&&d._debugStack?.stack)i=pt(d._debugStack.stack);if(d.type&&typeof d.type==="function"){let v=d.type,g=v.displayName||v.name;if(g&&/^[A-Z]/.test(g)&&o.length<4&&o[0]!==`<${g}>`)o.unshift(`<${g}>`)}d=d.return,u++}}return{sourceHint:i,componentStack:o.length>0?o.join(" > "):void 0}}function J(n){let i=n.ownerDocument.defaultView,o=i?i.getComputedStyle(n):null,s={};if(o)for(let d of rt){let u=d.replace(/[A-Z]/g,(g)=>`-${g.toLowerCase()}`),v=o.getPropertyValue(u);if(v)s[u]=v}let t=n.getBoundingClientRect(),c=(n.textContent||"").replace(/\s+/g," ").trim(),l=c.length>140?`${c.slice(0,140)}…`:c,{sourceHint:p,componentStack:m}=ut(n);return{tagName:n.tagName.toLowerCase(),selector:lt(n),breadcrumb:ct(n),outerHTML:dt(n),textExcerpt:l,computedStyles:s,boundingBox:{x:t.left,y:t.top,width:t.width,height:t.height},sourceHint:p,componentStack:m}}function Ne(n,i,o){let s="status-dot",t=`Agent: ${o} · A`,c="";if(!n)s="status-dot offline",t=`Offline (Copy only) · ${o} (A)`;else if(i?.activeCue){s="status-dot running";let l=i.queuedCount>0?` (+${i.queuedCount})`:"";c=`${i.activeCue.agent} editing…${l}`,t=`${c} · A`}else if(i?.status==="error"&&i.lastResult)s="status-dot error",t=`Error ✗ · ${o} (A)`;else if(i?.status==="done"&&i.lastResult)t=`Done ✓ (${(i.lastResult.durationMs/1000).toFixed(1)}s) · ${o} (A)`;return{dotClass:s,statusTip:t,compactRunning:c}}function ge(n,i,o){return{agent:n,continueSession:i,pageUrl:window.location.href,pageTitle:document.title,pins:o.map((s,t)=>({index:t+1,note:s.note.trim(),context:s.context}))}}var Be="agentcue:active-sessions";function De(){try{let n=sessionStorage.getItem(Be);return n?new Set(JSON.parse(n)):new Set}catch{return new Set}}function Q(n){try{sessionStorage.setItem(Be,JSON.stringify([...n]))}catch{}}function ze(n,i,o,s,t){let c=new Set(o.map((l)=>l.id));for(let[l,p]of i)if(!c.has(l))i.delete(l),p.classList.add("removing"),setTimeout(()=>p.remove(),170);o.forEach((l,p)=>{let{x:m,y:d}=Ye(l),u=i.get(l.id);if(!u)u=document.createElement("div"),u.className="pin-badge",u.addEventListener("click",(v)=>{v.stopPropagation(),t(l.id)}),i.set(l.id,u),n.appendChild(u);u.classList.toggle("active",l.id===s),u.textContent=String(p+1),u.style.left=`${Math.round(m)}px`,u.style.top=`${Math.round(d)}px`,u.title=l.note||l.context.selector})}function Oe(n,i,o,s,t){n.textContent=s,i.innerHTML="",o.forEach((c,l)=>{let p=document.createElement("button");p.className=c===s?"agent-opt selected":"agent-opt",p.innerHTML=`<span class="agent-opt-left"><span class="agent-opt-dot"></span><span>${c}</span></span><span class="agent-opt-kbd">${l+1}</span>`,p.addEventListener("click",(m)=>{m.stopPropagation(),t(c)}),i.appendChild(p)})}function P(n,i,o){return Math.max(i,Math.min(o,n))}function Re(){return typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform)}function je(n){for(let i of n.composedPath())if(i instanceof HTMLElement){let o=i.tagName;if(o==="INPUT"||o==="TEXTAREA"||o==="SELECT"||i.isContentEditable)return!0}return!1}function Ye(n){let i=n.el.getBoundingClientRect();if(i.width===0&&i.height===0)return{x:P(n.context.boundingBox.x+16,16,window.innerWidth-16),y:P(n.context.boundingBox.y+16,16,window.innerHeight-16)};return{x:P(i.left+i.width*n.relX,14,window.innerWidth-14),y:P(i.top+i.height*n.relY,14,window.innerHeight-14)}}function fe(n,i,o=!1){let{x:s,y:t}=Ye(i),c=310,l=165,p=s+18,m="0px";if(p+310>window.innerWidth-12)p=Math.max(12,s-310-18),m="100%";let d=t-16,u="20px";if(d+165>window.innerHeight-64)d=Math.max(12,window.innerHeight-165-64),u=`${P(Math.round(t-d),16,149)}px`;n.classList.toggle("no-glide",!o),n.style.transformOrigin=`${m} ${u}`,n.style.left=`${Math.round(p)}px`,n.style.top=`${Math.round(d)}px`}function Ke(n,i,o,s){if(!s||!o){n.classList.remove("visible"),i.classList.remove("visible");return}let t=o.getBoundingClientRect();if(t.width<=0||t.height<=0){n.classList.remove("visible"),i.classList.remove("visible");return}let c=o===document.body||o===document.documentElement,l=c?Math.max(4,Math.round(t.left)):Math.round(t.left),p=c?Math.max(4,Math.round(t.top)):Math.round(t.top),m=c?Math.min(window.innerWidth-4,Math.round(t.right)):Math.round(t.right),d=c?Math.min(window.innerHeight-4,Math.round(t.bottom)):Math.round(t.bottom);n.style.left=`${l}px`,n.style.top=`${p}px`,n.style.width=`${Math.max(0,m-l)}px`,n.style.height=`${Math.max(0,d-p)}px`,n.classList.add("visible");let u=J(o),v=`${u.tagName}${o.id?`#${o.id}`:o.classList[0]?`.${o.classList[0]}`:""} · ${Math.round(t.width)}×${Math.round(t.height)}`,g=u.sourceHint||u.componentStack||"";if(i.innerHTML="",i.appendChild(document.createTextNode(v)),g){let O=document.createElement("span");O.className="hint-source",O.textContent=g,i.appendChild(O)}let L=p>=28?p-24:d<=window.innerHeight-32?d+6:p+8;i.style.left=`${P(c?l+8:l,8,window.innerWidth-240)}px`,i.style.top=`${Math.round(L)}px`,i.classList.add("visible")}var gt='<svg class="launcher-logo" viewBox="0 0 24 24" fill="none" aria-hidden="true"><path d="M19 9.5V7a3 3 0 0 0-3-3H7a3 3 0 0 0-3 3v9a3 3 0 0 0 3 3h2.5" stroke="#60a5fa" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round"/><circle cx="9.5" cy="9.5" r="1.75" fill="#60a5fa"/><path d="M15.5 10C16.15 14.05 16.95 14.85 21 15.5C16.95 16.15 16.15 16.95 15.5 21C14.85 16.95 14.05 16.15 10 15.5C14.05 14.85 14.85 14.05 15.5 10Z" fill="currentColor"/></svg>',me='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-linecap="round"><line x1="9" y1="6" x2="9" y2="18"/><line x1="15" y1="6" x2="15" y2="18"/></svg>',Fe='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="3"/><line x1="3" y1="9" x2="21" y2="9"/><line x1="9" y1="21" x2="9" y2="9"/></svg>',be='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"><path d="M2 12s3.6-7 10-7 10 7 10 7-3.6 7-10 7-10-7-10-7Z"/><circle cx="12" cy="12" r="3"/></svg>',Ue='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"><path d="M10.7 5.1A11 11 0 0 1 12 5c6.4 0 10 7 10 7a13.2 13.2 0 0 1-1.7 2.7"/><path d="M6.6 6.6C4 8.4 2 12 2 12s3.6 7 10 7a9.8 9.8 0 0 0 5.4-1.6"/><line x1="2" y1="2" x2="22" y2="22"/></svg>';function Ge(n,i){let o=document.createElement("agentcue-root"),s=o.attachShadow({mode:"open"});s.innerHTML=`
|
|
415
|
+
<style>${_e}</style>
|
|
416
|
+
<div class="hover-box" id="hoverBox"></div>
|
|
417
|
+
<div class="hover-tag" id="hoverTag"></div>
|
|
418
|
+
<div class="pins-layer" id="pinsLayer"></div>
|
|
419
|
+
<div class="popover no-glide" id="popover">
|
|
420
|
+
<div class="popover-header">
|
|
421
|
+
<div class="popover-target">
|
|
422
|
+
<span class="num" id="popNum">#1</span>
|
|
423
|
+
<span class="sel" id="popSel">button</span>
|
|
424
|
+
</div>
|
|
425
|
+
<button class="icon-btn" id="popDelete" title="Delete Pin">Delete</button>
|
|
426
|
+
</div>
|
|
427
|
+
<textarea id="popInput" rows="2" placeholder="Describe the UI change…"></textarea>
|
|
428
|
+
<div class="popover-footer">
|
|
429
|
+
<span class="popover-hints">↵ Save & next · ⇧↵ Newline</span>
|
|
430
|
+
<div class="popover-actions">
|
|
431
|
+
<button class="btn-sm" id="popSave">Save</button>
|
|
432
|
+
<button class="btn-sm primary" id="popSend">Send ${n}</button>
|
|
433
|
+
</div>
|
|
434
|
+
</div>
|
|
435
|
+
</div>
|
|
436
|
+
<div class="capsule-wrap">
|
|
437
|
+
<div class="toast" id="toast"></div>
|
|
438
|
+
<div class="agent-menu" id="agentMenu">
|
|
439
|
+
<div class="agent-menu-header">
|
|
440
|
+
<span>Agent Target</span>
|
|
441
|
+
<span>A / 1-5</span>
|
|
442
|
+
</div>
|
|
443
|
+
<div id="agentMenuList"></div>
|
|
444
|
+
</div>
|
|
445
|
+
<div class="toolbar-stage">
|
|
446
|
+
<button class="launcher" id="launcherBtn" title="Activate agentcue (${i})">
|
|
447
|
+
<span class="status-dot offline" id="launcherDot"></span>
|
|
448
|
+
${gt}
|
|
449
|
+
<span class="launcher-text" id="launcherText"></span>
|
|
450
|
+
<span class="launcher-count" id="launcherCount">0</span>
|
|
451
|
+
</button>
|
|
452
|
+
<div class="capsule" id="capsule">
|
|
453
|
+
<div class="capsule-inner">
|
|
454
|
+
<button class="tool-btn" id="pickBtn" data-tip="Pick Mode · P">${me}</button>
|
|
455
|
+
<button class="tool-btn" id="hideBtn" data-tip="Hide Pins · H" disabled>${be}</button>
|
|
456
|
+
<button class="tool-btn copy-btn" id="copyBtn" data-tip="Copy Markdown · C" disabled>
|
|
457
|
+
<svg class="icon-copy" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg>
|
|
458
|
+
<svg class="icon-check" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>
|
|
459
|
+
</button>
|
|
460
|
+
<button class="tool-btn" id="clearBtn" data-tip="Clear Pins · X" disabled>
|
|
461
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"><path d="M3 6h18"/><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"/><path d="M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/></svg>
|
|
462
|
+
</button>
|
|
463
|
+
<button class="tool-btn send-btn" id="sendBtn" data-tip="Send Cue · S / ${n}" disabled>
|
|
464
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h14"/><path d="m12 5 7 7-7 7"/></svg>
|
|
465
|
+
<span class="send-count" id="sendCount"></span>
|
|
466
|
+
</button>
|
|
467
|
+
<div class="sep"></div>
|
|
468
|
+
<button class="tool-btn agent-btn" id="agentBtn" data-tip="Switch Agent · A">
|
|
469
|
+
<span class="status-dot offline" id="statusDot"></span>
|
|
470
|
+
<span class="agent-name" id="agentLabel">agy</span>
|
|
471
|
+
<span class="kbd">A</span>
|
|
472
|
+
</button>
|
|
473
|
+
<button class="tool-btn" id="contBtn" data-tip="New Session (first Cue) · R">
|
|
474
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"><path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"/><path d="M3 3v5h5"/></svg>
|
|
475
|
+
</button>
|
|
476
|
+
<div class="sep"></div>
|
|
477
|
+
<button class="tool-btn" id="collapseBtn" data-tip="Collapse · Esc">
|
|
478
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>
|
|
479
|
+
</button>
|
|
480
|
+
</div>
|
|
481
|
+
</div>
|
|
482
|
+
</div>
|
|
483
|
+
</div>
|
|
484
|
+
`,document.documentElement.appendChild(o);let t=(c)=>s.getElementById(c);return{host:o,hoverBox:t("hoverBox"),hoverTag:t("hoverTag"),pinsLayer:t("pinsLayer"),popover:t("popover"),popNum:t("popNum"),popSel:t("popSel"),popDelete:t("popDelete"),popInput:t("popInput"),popSave:t("popSave"),popSend:t("popSend"),toastEl:t("toast"),agentMenu:t("agentMenu"),agentMenuList:t("agentMenuList"),launcherBtn:t("launcherBtn"),launcherDot:t("launcherDot"),launcherText:t("launcherText"),launcherCount:t("launcherCount"),capsule:t("capsule"),statusDot:t("statusDot"),pickBtn:t("pickBtn"),agentBtn:t("agentBtn"),agentLabel:t("agentLabel"),contBtn:t("contBtn"),hideBtn:t("hideBtn"),copyBtn:t("copyBtn"),clearBtn:t("clearBtn"),sendBtn:t("sendBtn"),sendCount:t("sendCount"),collapseBtn:t("collapseBtn")}}function ft(n){let i=Object.entries(n).filter(([,o])=>o&&o!=="none"&&o!=="normal"&&o!=="0px");if(i.length===0)return"";return i.map(([o,s])=>`${o}: ${s}`).join("; ")}function mt(n){let{context:i,note:o,index:s}=n,t=[];if(t.push(`### Pin #${s}: ${o.trim()}`),i.sourceHint)t.push(`- **Source hint**: \`${i.sourceHint}\``);if(i.componentStack)t.push(`- **Component tree**: \`${i.componentStack}\``);t.push(`- **Selector**: \`${i.selector}\``),t.push(`- **DOM path**: \`${i.breadcrumb}\``);let{width:c,height:l,x:p,y:m}=i.boundingBox;if(t.push(`- **Box**: ${Math.round(c)}×${Math.round(l)}px at (${Math.round(p)}, ${Math.round(m)})`),i.textExcerpt)t.push(`- **Visible text**: ${JSON.stringify(i.textExcerpt)}`);let d=ft(i.computedStyles);if(d)t.push(`- **Computed styles**: \`${d}\``);return t.push("- **DOM snippet**:"),t.push("```html"),t.push(i.outerHTML),t.push("```"),t.join(`
|
|
485
|
+
`)}function Xe(n){let o=["Apply the following visual UI changes directly to the source files in this workspace.","Locate the exact source files using the selectors, visible text, DOM structure, and source hints below, then make minimal, clean edits.","",`- **Page**: \`${(()=>{try{let t=new URL(n.pageUrl);return`${t.pathname}${t.search}${t.hash}`||"/"}catch{return n.pageUrl||"/"}})()}\`${n.pageTitle?` (${n.pageTitle})`:""}`,`- **Total Pins**: ${n.pins.length}`].join(`
|
|
486
|
+
`),s=n.pins.map((t,c)=>mt({...t,index:c+1}));return[o,...s].join(`
|
|
487
|
+
|
|
488
|
+
`)+`
|
|
489
|
+
`}var ee=["agy","claude","cursor-agent","codex","pi"];var he="agentcue:selected-agent";function We(n){let i=Re(),o=i?"⌘↵":"Ctrl+↵",s=i?"⌘⇧F":"Ctrl+Shift+F",{host:t,hoverBox:c,hoverTag:l,pinsLayer:p,popover:m,popNum:d,popSel:u,popDelete:v,popInput:g,popSave:L,popSend:O,toastEl:te,agentMenu:xe,agentMenuList:qe,launcherBtn:ve,launcherDot:Ve,launcherText:Ze,launcherCount:ye,capsule:Je,statusDot:Qe,pickBtn:F,agentBtn:U,agentLabel:et,contBtn:ne,hideBtn:R,copyBtn:D,clearBtn:we,sendBtn:ke,sendCount:tt,collapseBtn:nt}=Ge(o,s),k=!1,S=!1,C=!1,G=!1,H=!1,ie=[...ee],x=localStorage.getItem(he)||"agy";if(!ee.includes(x))x="agy";let M=De(),Ee=null,f=[],it=new Map,b=null,X=null,W=new Map,q=new Map,Se=new Set,oe=null,se=null;function re(){return ie.length>0?ie:[...ee]}function z(e,r=!1,a=3200){if(oe)clearTimeout(oe);te.textContent=e,te.className=r?"toast visible error":"toast visible",oe=setTimeout(()=>{te.className="toast"},a)}function I(e){H=e,xe.classList.toggle("visible",e),U.classList.toggle("menu-open",e)}function ae(e,r=!0){if(x=e,localStorage.setItem(he,x),le(),T(),j(),r)I(!1)}function Ce(){if(!M.has(x)){z(`Next Cue for ${x} will already start a new session`);return}M.delete(x),Q(M),T(),z(`Session reset · Next Cue starts a new ${x} session`)}function ot(e=1){let r=re(),a=r.indexOf(x),w=r[(a+e+r.length)%r.length];ae(w,!1)}function le(){let e=re();if(!e.includes(x))x=e[0];Oe(et,qe,e,x,(r)=>ae(r,!0))}function j(){let{dotClass:e,statusTip:r,compactRunning:a}=Ne(G,Ee,x);Qe.className=e,Ve.className=e,U.setAttribute("data-tip",r),Ze.textContent=a}function T(){ve.classList.toggle("hidden",k),Je.classList.toggle("expanded",k),p.classList.toggle("hidden",C);let e=k&&S;F.classList.toggle("pick-active",e),F.innerHTML=e?me:Fe,F.setAttribute("data-tip",e?"Pause Pick · P":"Resume Pick · P");let r=M.has(x);ne.classList.toggle("cont-active",r),ne.setAttribute("data-tip",r?"Reset Session (in session) · R":"New Session (1st Cue)"),document.documentElement.style.cursor=e?"crosshair":"";let a=f.filter((y)=>y.note.trim().length>0).length,h=b!==null&&g.value.trim().length>0?f.filter((y)=>y.id!==b&&y.note.trim().length>0).length+1:a;ye.textContent=String(a),ye.classList.toggle("visible",!k&&a>0),R.innerHTML=C?Ue:be,R.classList.toggle("hide-active",C),R.setAttribute("data-tip",C?"Show Pins · H":"Hide Pins · H"),R.disabled=f.length===0,tt.textContent=h>0?String(h):"",ke.disabled=h===0,D.disabled=h===0,we.disabled=f.length===0}function N(e=!1){if(ze(p,it,f,b,(r)=>{if(!k)_(!0);Me(r)}),b){let r=f.find((a)=>a.id===b);if(r)fe(m,r,e)}T()}function B(e){X=e,Ke(c,l,e,k&&S&&b===null)}function Me(e){let r=f.findIndex((h)=>h.id===e);if(r===-1)return;let a=f[r],w=m.classList.contains("visible");if(C=!1,I(!1),b=e,d.textContent=`#${r+1}`,u.textContent=a.context.sourceHint||a.context.selector,g.value=a.note,fe(m,a,w),!w)m.offsetWidth;m.classList.add("visible"),B(null),N(w),g.focus(),g.selectionStart=g.value.length}function A(e){if(!b)return;let r=f.find((a)=>a.id===b);if(r){if(e)r.note=g.value.trim();if(!r.note.trim())f=f.filter((a)=>a.id!==r.id)}b=null,m.classList.remove("visible"),g.blur(),N()}function Le(e){if(!e&&b)A(!0);if(S=e,!S)B(null);T()}function _(e){if(e)k=!0,C=!1,S=!0,T();else{if(b)A(!0);I(!1),S=!1,k=!1,B(null),T()}}function Te(){b=null,m.classList.remove("visible"),f=[],C=!1,N()}function Ae(){if(f.length===0)return;if(!C&&b)A(!0);C=!C,T()}function Pe(){if(b)A(!0);return f.filter((e)=>e.note.trim().length>0)}async function $e(){let e=Pe();if(e.length===0)return;let r=Xe(ge(x,M.has(x),e));if(await navigator.clipboard.writeText(r),se)clearTimeout(se);D.classList.add("copied"),D.setAttribute("data-tip","Copied ✓"),se=setTimeout(()=>{D.classList.remove("copied"),D.setAttribute("data-tip","Copy Markdown · C")},1600)}function V(e,r,a=!1){if(a)M.delete(x),Q(M);let w=new Set(f.map((h)=>h.id));for(let h of e)if(!w.has(h.id))f.push(h);_(!0),N(),z(`Cue failed — Pins restored: ${r}`,!0,6500)}async function Y(){let e=Pe();if(e.length===0)return;if(!G){z("Local agentcue daemon is offline. Use Copy or start `npx agentcue`.",!0,5000);return}let r=M.has(x),a=!r;M.add(x),Q(M);let w=ge(x,r,e),h=[...e];f=[],_(!1),N();try{let y=await fetch(`${n}/api/cue`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(w)}),E=await y.json();if(!y.ok||!E.cueId){V(h,E.error||`HTTP ${y.status}`,a);return}if(q.has(E.cueId)){let K=q.get(E.cueId);q.delete(E.cueId),V(h,K,a);return}if(!Se.delete(E.cueId)){W.set(E.cueId,h);let K=E.queuePosition&&E.queuePosition>1?` (queued #${E.queuePosition})`:"",Z=r?" (continue)":" (new session)";z(`Sent ${h.length} Pin(s) → ${x}${Z}${K}`)}}catch(y){V(h,y instanceof Error?y.message:"Network error",a)}}ve.addEventListener("click",()=>_(!0)),nt.addEventListener("click",()=>_(!1)),F.addEventListener("click",()=>Le(!S)),U.addEventListener("click",(e)=>{e.stopPropagation(),I(!H)}),ne.addEventListener("click",()=>Ce()),R.addEventListener("click",()=>Ae()),D.addEventListener("click",()=>void $e()),we.addEventListener("click",()=>Te()),ke.addEventListener("click",()=>void Y()),g.addEventListener("input",()=>T()),g.addEventListener("keydown",(e)=>{if(e.key==="Enter"&&(e.metaKey||e.ctrlKey)){e.preventDefault(),e.stopPropagation(),Y();return}if(e.key==="Enter"&&!e.shiftKey){e.preventDefault(),e.stopPropagation(),A(!0);return}if(e.key==="Escape")e.preventDefault(),e.stopPropagation(),A(!1)}),L.addEventListener("click",()=>A(!0)),O.addEventListener("click",()=>void Y()),v.addEventListener("click",()=>{if(!b)return;f=f.filter((e)=>e.id!==b),b=null,m.classList.remove("visible"),g.blur(),N()});function ce(e){return e.composedPath().includes(t)}window.addEventListener("mousemove",(e)=>{if(!k||!S||b!==null||ce(e)){if(ce(e))B(null);return}let r=document.elementFromPoint(e.clientX,e.clientY),a=r===document.documentElement?document.body||r:r;if(a&&a!==t){if(a!==X)B(a)}else B(null)},{passive:!0});for(let e of["pointerdown","mousedown","mouseup","click"])window.addEventListener(e,(r)=>{if(H&&e==="pointerdown"&&!r.composedPath().includes(xe)&&!r.composedPath().includes(U))I(!1);if(!k||!S||ce(r))return;if(r.preventDefault(),r.stopPropagation(),r.stopImmediatePropagation(),e!=="click")return;if(b!==null)A(!0);let a=r,w=document.elementFromPoint(a.clientX,a.clientY),h=w===document.documentElement?document.body||w:w;if(!h||h===t)return;let y=h.getBoundingClientRect(),E=y.width>0?P((a.clientX-y.left)/y.width,0.1,0.9):0.5,K=y.height>0?P((a.clientY-y.top)/y.height,0.1,0.9):0.5,Z={id:`${Date.now()}-${Math.random().toString(36).slice(2,7)}`,el:h,relX:E,relY:K,note:"",context:J(h)};f.push(Z),Me(Z.id)},{capture:!0});window.addEventListener("keydown",(e)=>{if((e.metaKey||e.ctrlKey)&&e.shiftKey&&e.code==="KeyF"){e.preventDefault(),e.stopPropagation(),_(!k);return}if(!k)return;if((e.metaKey||e.ctrlKey)&&e.key==="Enter"){if(b!==null||f.some((r)=>r.note.trim().length>0))e.preventDefault(),e.stopPropagation(),Y();return}if(e.key==="Escape"){if(e.preventDefault(),e.stopPropagation(),b!==null)A(!1);else if(H)I(!1);else _(!1);return}if(!e.metaKey&&!e.ctrlKey&&!e.altKey&&b===null&&!je(e)){if(e.code==="KeyA")e.preventDefault(),I(!H);else if(H&&(e.key==="ArrowDown"||e.key==="ArrowUp"))e.preventDefault(),ot(e.key==="ArrowDown"?1:-1);else if(H&&e.key==="Enter")e.preventDefault(),I(!1);else if(/^Digit[1-9]$/.test(e.code)){let r=Number(e.code.slice(5))-1,a=re();if(r<a.length)e.preventDefault(),ae(a[r],!0)}else if(e.code==="KeyP")e.preventDefault(),Le(!S);else if(e.code==="KeyR")e.preventDefault(),Ce();else if(e.code==="KeyS"&&f.some((r)=>r.note.trim().length>0))e.preventDefault(),Y();else if(e.code==="KeyC"&&f.some((r)=>r.note.trim().length>0))e.preventDefault(),$e();else if(e.code==="KeyX"&&f.length>0)e.preventDefault(),Te();else if(e.code==="KeyH"&&f.length>0)e.preventDefault(),Ae()}},{capture:!0});let de=!1,Ie=()=>{if(de)return;de=!0,requestAnimationFrame(()=>{if(de=!1,f.length>0)N(!1);if(k&&S&&X)B(X)})};window.addEventListener("scroll",Ie,{capture:!0,passive:!0}),window.addEventListener("resize",Ie,{passive:!0});function st(){let e=new EventSource(`${n}/api/events`);e.onopen=()=>{G=!0,j()},e.onmessage=(r)=>{try{let a=JSON.parse(r.data);if(a.type==="state"){if(Ee=a.state,a.state.agents.length>0){if(ie=a.state.agents,!localStorage.getItem(he)&&a.state.defaultAgent)x=a.state.defaultAgent;le()}j()}else if(a.type==="cue:done"){if(!W.delete(a.cueId))Se.add(a.cueId);z(`${a.agent} finished in ${(a.durationMs/1000).toFixed(1)}s ✓`)}else if(a.type==="cue:error"){let w=W.get(a.cueId);if(W.delete(a.cueId),w)V(w,a.error);else q.set(a.cueId,a.error)}}catch{}},e.onerror=()=>{G=!1,j()}}return le(),T(),j(),st(),{togglePickMode:()=>_(!k)}}function bt(){if(typeof window<"u"&&window.__AGENTCUE_ORIGIN__)return window.__AGENTCUE_ORIGIN__.replace(/\/+$/,"");let n=document.currentScript;if(n?.src)try{let i=new URL(n.src,typeof window<"u"?window.location.href:"http://localhost:4318"),o=i.pathname.replace(/\/client\.js$/,"").replace(/\/+$/,"");return`${i.origin}${o}`}catch{}return"http://localhost:4318"}function ht(){if(typeof window>"u"||typeof document>"u")return;if(window.__AGENTCUE_INSTANCE__){window.__AGENTCUE_INSTANCE__.togglePickMode();return}let n=bt(),i=()=>{if(!window.__AGENTCUE_INSTANCE__)window.__AGENTCUE_INSTANCE__=We(n)};if(document.documentElement)i();else window.addEventListener("DOMContentLoaded",i,{once:!0})}ht();})();
|
package/dist/demo.html
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<title>agentcue Playground</title>
|
|
7
|
+
<style>
|
|
8
|
+
:root {
|
|
9
|
+
--bg: #f8fafc;
|
|
10
|
+
--surface: #ffffff;
|
|
11
|
+
--text: #0f172a;
|
|
12
|
+
--muted: #64748b;
|
|
13
|
+
--accent: #2563eb;
|
|
14
|
+
--border: #e2e8f0;
|
|
15
|
+
}
|
|
16
|
+
* { box-sizing: border-box; }
|
|
17
|
+
body {
|
|
18
|
+
margin: 0;
|
|
19
|
+
font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
|
|
20
|
+
background: var(--bg);
|
|
21
|
+
color: var(--text);
|
|
22
|
+
line-height: 1.5;
|
|
23
|
+
}
|
|
24
|
+
.container { max-width: 920px; margin: 0 auto; padding: 28px 24px 96px; }
|
|
25
|
+
.nav {
|
|
26
|
+
display: flex; align-items: center; justify-content: space-between;
|
|
27
|
+
padding-bottom: 24px; border-bottom: 1px solid var(--border);
|
|
28
|
+
}
|
|
29
|
+
.brand { font-weight: 700; font-size: 18px; letter-spacing: -0.02em; }
|
|
30
|
+
.nav-links { display: flex; gap: 20px; align-items: center; }
|
|
31
|
+
.nav-links a { color: var(--muted); text-decoration: none; font-size: 14px; }
|
|
32
|
+
.hero { padding: 56px 0 42px; text-align: left; }
|
|
33
|
+
.badge {
|
|
34
|
+
display: inline-block; padding: 4px 10px; border-radius: 999px;
|
|
35
|
+
background: #dbeafe; color: #1d4ed8; font-size: 12px; font-weight: 600;
|
|
36
|
+
margin-bottom: 14px;
|
|
37
|
+
}
|
|
38
|
+
.hero h1 {
|
|
39
|
+
font-size: 40px; line-height: 1.15; margin: 0 0 14px; letter-spacing: -0.03em;
|
|
40
|
+
}
|
|
41
|
+
.hero p { font-size: 17px; color: var(--muted); max-width: 600px; margin: 0 0 26px; }
|
|
42
|
+
.hero-actions { display: flex; gap: 12px; }
|
|
43
|
+
.btn-primary {
|
|
44
|
+
background: var(--accent); color: #fff; border: none; border-radius: 8px;
|
|
45
|
+
padding: 11px 20px; font-size: 14px; font-weight: 600; cursor: pointer;
|
|
46
|
+
}
|
|
47
|
+
.btn-secondary {
|
|
48
|
+
background: var(--surface); color: var(--text); border: 1px solid var(--border);
|
|
49
|
+
border-radius: 8px; padding: 11px 20px; font-size: 14px; font-weight: 500; cursor: pointer;
|
|
50
|
+
}
|
|
51
|
+
.grid {
|
|
52
|
+
display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 20px;
|
|
53
|
+
}
|
|
54
|
+
.card {
|
|
55
|
+
background: var(--surface); border: 1px solid var(--border);
|
|
56
|
+
border-radius: 12px; padding: 20px;
|
|
57
|
+
}
|
|
58
|
+
.card h3 { margin: 0 0 6px; font-size: 16px; }
|
|
59
|
+
.card p { margin: 0; font-size: 13.5px; color: var(--muted); }
|
|
60
|
+
.metric { font-size: 28px; font-weight: 700; margin-top: 12px; color: var(--text); }
|
|
61
|
+
</style>
|
|
62
|
+
</head>
|
|
63
|
+
<body data-source="examples/html/index.html">
|
|
64
|
+
<div class="container">
|
|
65
|
+
<header class="nav" id="top-nav">
|
|
66
|
+
<div class="brand">Acme Studio</div>
|
|
67
|
+
<nav class="nav-links">
|
|
68
|
+
<a href="#features">Features</a>
|
|
69
|
+
<a href="#pricing">Pricing</a>
|
|
70
|
+
<a href="#docs">Docs</a>
|
|
71
|
+
</nav>
|
|
72
|
+
</header>
|
|
73
|
+
|
|
74
|
+
<section class="hero" id="hero-section">
|
|
75
|
+
<span class="badge" id="hero-badge">Beta v0.0.1 Playground</span>
|
|
76
|
+
<h1 id="hero-title">Point at any UI element and cue your coding agent.</h1>
|
|
77
|
+
<p id="hero-subtitle">
|
|
78
|
+
Press <strong>Cmd/Ctrl + Shift + F</strong> (or click the <strong>✦</strong> icon in the bottom-right corner)
|
|
79
|
+
to activate, click two or three elements on this page, add short notes, and press
|
|
80
|
+
<strong>S</strong> (or <strong>Cmd/Ctrl + Enter</strong>). Your selected Agent CLI will edit
|
|
81
|
+
<code>examples/html/index.html</code> and this page will auto-reload!
|
|
82
|
+
</p>
|
|
83
|
+
<div class="hero-actions">
|
|
84
|
+
<button class="btn-primary" id="primary-cta" onclick="alert('Normal click! Activate agentcue (Cmd/Ctrl+Shift+F) to annotate instead.')">
|
|
85
|
+
Start Free Trial
|
|
86
|
+
</button>
|
|
87
|
+
<button class="btn-secondary" id="secondary-cta">Book a Demo</button>
|
|
88
|
+
</div>
|
|
89
|
+
</section>
|
|
90
|
+
|
|
91
|
+
<section class="grid" id="metrics-grid">
|
|
92
|
+
<article class="card" data-testid="card-latency">
|
|
93
|
+
<h3>Dispatch Speed</h3>
|
|
94
|
+
<p>Zero copy-paste switching between browser and terminal.</p>
|
|
95
|
+
<div class="metric">120ms</div>
|
|
96
|
+
</article>
|
|
97
|
+
<article class="card" data-testid="card-agents">
|
|
98
|
+
<h3>Connected Agents</h3>
|
|
99
|
+
<p>Switch seamlessly between agy, claude, cursor-agent, codex, and pi.</p>
|
|
100
|
+
<div class="metric">5 CLIs</div>
|
|
101
|
+
</article>
|
|
102
|
+
<article class="card" data-testid="card-bundle">
|
|
103
|
+
<h3>Overlay Footprint</h3>
|
|
104
|
+
<p>Framework-agnostic Shadow DOM script with zero CSS leaks.</p>
|
|
105
|
+
<div class="metric">< 15 KB</div>
|
|
106
|
+
</article>
|
|
107
|
+
</section>
|
|
108
|
+
</div>
|
|
109
|
+
</body>
|
|
110
|
+
</html>
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export * from "./shared/types.ts";
|
|
2
|
+
export { formatCuePrompt } from "./shared/prompt.ts";
|
|
3
|
+
export { buildAgentCommand, createDispatcher, createSpawnExecutor, detectAvailableAgents, isBinaryInPath, type AgentCommandSpec, type AgentExecutor, type AgentInvocation, type AgentRunResult, type Dispatcher, type DispatcherOptions, } from "./server/dispatcher.ts";
|
|
4
|
+
export { createBridgeHandler, type BridgeHandler, type BridgeHandlerOptions, } from "./server/handler.ts";
|
|
5
|
+
export { startServer, type RunningServer, type ServerOptions, } from "./server/server.ts";
|