@fish-under-sea/magpie-purge 0.2.0 → 0.3.1
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 +81 -10
- package/THIRD_PARTY_NOTICES.md +14 -2
- package/lib/bundled.mjs +88 -0
- package/lib/inventory.mjs +1 -0
- package/lib/plan.mjs +3 -1
- package/lib/state.mjs +13 -6
- package/package.json +6 -3
- package/page/app.js +173 -40
- package/page/index.html +69 -54
- package/page/style.css +306 -106
- package/personas/prompt-forge.md +26 -0
- package/preview/catalog.demo.js +98 -52
- package/preview/host.html +17 -4
- package/preview/purge-preview.html +1564 -0
- package/skills/credential-breaker.md +93 -0
- package/skills/engagement-lead.md +80 -0
- package/skills/entry-hunter.md +74 -0
- package/skills/intranet-pivot.md +98 -0
- package/skills/nsfw-prompt-smith.md +103 -0
- package/skills/payload-delivery.md +94 -0
- package/skills/recon-specialist.md +83 -0
- package/skills/tunnel-engineer.md +106 -0
- package/skills/vuln-striker.md +76 -0
- package/tools/build-preview.mjs +115 -0
package/page/app.js
CHANGED
|
@@ -11,13 +11,17 @@
|
|
|
11
11
|
const bridge = window.magpie
|
|
12
12
|
const $ = (id) => document.getElementById(id)
|
|
13
13
|
const KINDS = {
|
|
14
|
-
'session-archive': { label: '会话导出包',
|
|
15
|
-
'cordis-plugin': { label: 'DSH 插件包',
|
|
16
|
-
persona: { label: '人设',
|
|
17
|
-
skill: { label: '技能',
|
|
18
|
-
manifest: { label: '清单',
|
|
19
|
-
text: { label: '文本',
|
|
14
|
+
'session-archive': { label: '会话导出包', cls: 'material' },
|
|
15
|
+
'cordis-plugin': { label: 'DSH 插件包', cls: 'material' },
|
|
16
|
+
persona: { label: '人设', cls: 'persona' },
|
|
17
|
+
skill: { label: '技能', cls: 'skill' },
|
|
18
|
+
manifest: { label: '清单', cls: 'material' },
|
|
19
|
+
text: { label: '文本', cls: 'skill' },
|
|
20
20
|
}
|
|
21
|
+
/** 三类语义色:人设 / 技能 / 素材。六种类型各给一色会变成彩虹,信息量却没增加。 */
|
|
22
|
+
const kindClass = (kind) => KINDS[kind]?.cls || 'material'
|
|
23
|
+
/** builtinFolder 从内置条目的 root 里取出它所在的目录名(skills / personas)。 */
|
|
24
|
+
const builtinFolder = (e) => String(e.source?.root || '').split(/[\\/]/).filter(Boolean).pop() || 'skills'
|
|
21
25
|
const MODE_HELP = {
|
|
22
26
|
off: '请求原样放行,什么也不改。',
|
|
23
27
|
strict: '整段可控 system 换成人设;原 system 里的工具说明文本也会一起没了。',
|
|
@@ -153,38 +157,152 @@
|
|
|
153
157
|
host.replaceChildren(el('p', { class: 'empty', text: '没有匹配的条目。清掉搜索,或往来源目录里放点东西再扫一次。' }))
|
|
154
158
|
return
|
|
155
159
|
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
160
|
+
// 分组比逐行挂「内置」胶囊干净:内置是「这一整组都随包来」,说一次就够。
|
|
161
|
+
const groups = [
|
|
162
|
+
{ key: 'builtin', label: '内置专家与技能', rows: rows.filter((e) => e.builtin) },
|
|
163
|
+
{ key: 'mine', label: '我的来源', rows: rows.filter((e) => !e.builtin) },
|
|
164
|
+
].filter((g) => g.rows.length)
|
|
165
|
+
|
|
166
|
+
const nodes = []
|
|
167
|
+
for (const group of groups) {
|
|
168
|
+
nodes.push(el('div', { class: 'group-head' },
|
|
169
|
+
el('span', { text: group.label }),
|
|
170
|
+
el('span', { class: 'n', text: String(group.rows.length) }),
|
|
171
|
+
))
|
|
172
|
+
for (const e of group.rows) nodes.push(rowOf(e))
|
|
173
|
+
}
|
|
174
|
+
host.replaceChildren(...nodes)
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/** rowOf 画一行条目;状态只用「未启用 / 已启用 / 拒绝」三种胶囊,不再叠「内置」。 */
|
|
178
|
+
function rowOf(e) {
|
|
179
|
+
const kind = KINDS[e.kind] || { label: e.kind }
|
|
180
|
+
const badge = e.status === 'rejected'
|
|
181
|
+
? el('span', { class: 'badge reject', text: '拒绝' })
|
|
182
|
+
: !e.injectable ? null
|
|
183
|
+
: isEnabled(e.id) ? null : el('span', { class: 'badge off', text: '未启用' })
|
|
184
|
+
return el('button', {
|
|
185
|
+
type: 'button',
|
|
186
|
+
class: 'row',
|
|
187
|
+
role: 'option',
|
|
188
|
+
'aria-selected': selected === e.id,
|
|
189
|
+
onclick: () => { selected = selected === e.id ? '' : e.id; render() },
|
|
190
|
+
},
|
|
191
|
+
el('span', { class: 'spine', style: `--spine:var(--kind-${kindClass(e.kind)})` }),
|
|
192
|
+
el('span', {},
|
|
193
|
+
el('span', { class: 'title' }, e.name, badge || null),
|
|
194
|
+
el('span', { class: 'meta', text: `${kind.label} · ${e.builtin ? '随插件' : e.source?.rel ?? ''}` }),
|
|
195
|
+
),
|
|
196
|
+
el('span', { class: 'side' }, e.version > 1 ? `v${e.version} ` : '',
|
|
197
|
+
el('span', { class: 'meta', text: e.injectable ? `${e.chars || 0} 字` : fmtSize(e.size || 0) })),
|
|
198
|
+
)
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* renderAssembly 是右栏默认内容:把「这次会拼成什么」按顺序摊开。
|
|
203
|
+
*
|
|
204
|
+
* 为什么值得占这一整栏:这个插件的产物就是一段被拼起来的 system 文本,
|
|
205
|
+
* 但它平时在请求里,用户看不见。摊开成积木(人设 → 技能 → 宿主原文),
|
|
206
|
+
* 一眼能看出顺序对不对、谁没启用、总量吃不吃得下预算。
|
|
207
|
+
*/
|
|
208
|
+
function renderAssembly() {
|
|
209
|
+
const host = $('assembly')
|
|
210
|
+
const plan = catalog?.plan
|
|
211
|
+
const last = catalog?.last
|
|
212
|
+
if (!plan) {
|
|
213
|
+
host.replaceChildren(el('h2', {}, '注入组装'))
|
|
214
|
+
host.append(el('p', { class: 'empty', text: '还没有判定:等后端第一次扫描。' }))
|
|
215
|
+
return
|
|
216
|
+
}
|
|
217
|
+
const personaEntry = findEntry(plan.personaId)
|
|
218
|
+
const skills = (plan.skills || []).map((s) => findEntry(s.id) || s)
|
|
219
|
+
const total = (personaEntry?.chars || 0) + skills.reduce((n, s) => n + (s.chars || 0), 0)
|
|
220
|
+
|
|
221
|
+
const rows = []
|
|
222
|
+
if (plan.ready && personaEntry) {
|
|
223
|
+
rows.push(stackRow('01', 'persona', personaEntry.name, personaEntry.meta?.description || '人设正文', `${personaEntry.chars || 0} 字`))
|
|
224
|
+
skills.forEach((s, i) => rows.push(stackRow(String(i + 2).padStart(2, '0'), 'skill', s.name, s.meta?.description || '技能正文', `${s.chars || 0} 字`)))
|
|
225
|
+
rows.push(el('div', { class: 'stack-row is-host' },
|
|
226
|
+
el('span', { class: 'ord', text: String(skills.length + 2).padStart(2, '0') }),
|
|
227
|
+
el('span', { class: 'body' },
|
|
228
|
+
el('span', { class: 'name', text: '宿主自己的 system' }),
|
|
229
|
+
el('span', { class: 'desc', text: plan.mode === 'strict' ? 'strict:整段换掉,不会保留' : '原样保留,接在上面这些之后' }),
|
|
230
|
+
),
|
|
231
|
+
el('span', { class: 'size', text: plan.mode === 'strict' ? '—' : '保留' }),
|
|
232
|
+
))
|
|
233
|
+
} else {
|
|
234
|
+
rows.push(el('div', { class: 'stack-row is-empty' },
|
|
235
|
+
el('span', { class: 'ord', text: '—' }),
|
|
236
|
+
el('span', { class: 'body' },
|
|
237
|
+
el('span', { class: 'name', text: '还没有可组装的内容' }),
|
|
238
|
+
// 具体原因在顶部状态条里已经说过一遍,这里只说「这里将来会显示什么」,不重复。
|
|
239
|
+
el('span', { class: 'desc', text: '按上面的提示处理后,这段会显示人设与技能的拼装顺序' }),
|
|
240
|
+
),
|
|
241
|
+
el('span', { class: 'size', text: '' }),
|
|
242
|
+
))
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
host.replaceChildren(...[
|
|
246
|
+
el('h2', {}, '注入组装',
|
|
247
|
+
el('span', { class: 'h2-sub', text: plan.ready ? '下一次请求会拼成这段' : '这次放行,下面是原因' })),
|
|
248
|
+
el('div', { class: 'stack-view' }, ...rows),
|
|
249
|
+
el('div', { class: 'stack-foot' },
|
|
250
|
+
el('span', { text: plan.ready ? `合计 ${total.toLocaleString('zh-CN')} 字符 · 预算 65,536` : `模式 ${plan.mode}` }),
|
|
251
|
+
last?.at ? el('span', { text: last.skipped ? `上次 ${fmtTime(last.at)} · 未注入` : `上次 ${fmtTime(last.at)} · ${last.agent || '—'}` }) : null,
|
|
252
|
+
),
|
|
253
|
+
renderExpertPicker(),
|
|
254
|
+
].filter(Boolean))
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* renderExpertPicker 是「一键启用专家」:这里是每天重复最多的动作。
|
|
259
|
+
* 不用逐条点开再点启用——九个专家的开关摊在同一行,点一下就切。
|
|
260
|
+
* 只列技能:人设是「谁来写」,走另一条路(详情里的「设为当前人设」)。
|
|
261
|
+
*/
|
|
262
|
+
function renderExpertPicker() {
|
|
263
|
+
const skills = entries().filter((e) => e.injectable && e.kind === 'skill' && e.builtin)
|
|
264
|
+
const mine = entries().filter((e) => e.injectable && e.kind === 'skill' && !e.builtin)
|
|
265
|
+
const all = [...skills, ...mine]
|
|
266
|
+
if (!all.length) return null
|
|
267
|
+
const chip = (e) => {
|
|
268
|
+
const on = isEnabled(e.id)
|
|
162
269
|
return el('button', {
|
|
163
270
|
type: 'button',
|
|
164
|
-
class: '
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
onclick: () => {
|
|
168
|
-
},
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
271
|
+
class: `pick${on ? ' is-on' : ''}`,
|
|
272
|
+
'aria-pressed': on ? 'true' : 'false',
|
|
273
|
+
title: on ? `停用「${e.name}」` : `启用「${e.name}」`,
|
|
274
|
+
onclick: () => save({ enabled: { ...(options.enabled || {}), [e.id]: !on } }, on ? `已停用「${e.name}」` : `已启用「${e.name}」`),
|
|
275
|
+
}, on ? '✓ ' : '', e.name)
|
|
276
|
+
}
|
|
277
|
+
return el('section', { class: 'picker', 'aria-label': '启用专家' },
|
|
278
|
+
el('h3', {}, '启用的专家',
|
|
279
|
+
el('span', { class: 'h2-sub', text: '点一下即生效,不必逐条打开' })),
|
|
280
|
+
el('div', { class: 'picks' }, ...all.map(chip)),
|
|
281
|
+
)
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/** stackRow 是组装里的一层:序号 + 名字 + 一句描述 + 体积。 */
|
|
285
|
+
function stackRow(ord, cls, name, desc, size) {
|
|
286
|
+
return el('div', { class: `stack-row is-${cls}` },
|
|
287
|
+
el('span', { class: 'ord', text: ord }),
|
|
288
|
+
el('span', { class: 'body' },
|
|
289
|
+
el('span', { class: 'name', text: name }),
|
|
290
|
+
el('span', { class: 'desc', text: desc }),
|
|
291
|
+
),
|
|
292
|
+
el('span', { class: 'size', text: size }),
|
|
293
|
+
)
|
|
178
294
|
}
|
|
179
295
|
|
|
180
296
|
function renderInspector() {
|
|
181
297
|
const host = $('inspect')
|
|
182
298
|
const e = findEntry(selected)
|
|
183
299
|
if (!e) {
|
|
184
|
-
|
|
300
|
+
// 没选中时让位给「组装预览」:右栏不留一片空白,那是最浪费的一屏。
|
|
301
|
+
host.replaceChildren()
|
|
185
302
|
return
|
|
186
303
|
}
|
|
187
|
-
const kind = KINDS[e.kind] || { label: e.kind
|
|
304
|
+
const kind = KINDS[e.kind] || { label: e.kind }
|
|
305
|
+
const kindCls = kindClass(e.kind)
|
|
188
306
|
const inline = e.source?.root === 'inline' || e.meta?.format === 'inline'
|
|
189
307
|
// 只有复制进插件自己的 state/imports 的副本才谈得上「删副本」:来源目录里的原件不动。
|
|
190
308
|
const imported = Boolean(e.source?.root && /[\\/]state[\\/]imports\/?$/.test(e.source.root))
|
|
@@ -194,12 +312,15 @@
|
|
|
194
312
|
const text = inline ? String(e.text || '') : ''
|
|
195
313
|
|
|
196
314
|
const actions = []
|
|
197
|
-
|
|
315
|
+
// 人设才有「设为当前人设」;技能是「启用/停用」。混着写会让人以为技能能当人设用。
|
|
316
|
+
if (e.injectable && e.kind === 'persona') {
|
|
198
317
|
actions.push(el('button', {
|
|
199
318
|
type: 'button',
|
|
200
319
|
class: options.persona === e.id ? 'primary' : '',
|
|
201
320
|
onclick: () => save({ persona: e.id }, `已把「${e.name}」设为当前人设`),
|
|
202
321
|
}, options.persona === e.id ? '当前人设' : '设为当前人设'))
|
|
322
|
+
}
|
|
323
|
+
if (e.injectable) {
|
|
203
324
|
actions.push(el('button', {
|
|
204
325
|
type: 'button',
|
|
205
326
|
onclick: () => save({ enabled: { ...(options.enabled || {}), [e.id]: !enabled } }, enabled ? `已停用「${e.name}」` : `已启用「${e.name}」`),
|
|
@@ -208,7 +329,7 @@
|
|
|
208
329
|
if (pinned) {
|
|
209
330
|
actions.push(el('button', {
|
|
210
331
|
type: 'button',
|
|
211
|
-
class: '
|
|
332
|
+
class: 'quiet',
|
|
212
333
|
onclick: () => {
|
|
213
334
|
const next = { ...(options.pinned || {}) }
|
|
214
335
|
delete next[e.id]
|
|
@@ -256,20 +377,25 @@
|
|
|
256
377
|
|
|
257
378
|
// replaceChildren 会把 null 变成 "null" 字符串,所以先过滤。
|
|
258
379
|
host.replaceChildren(...[
|
|
259
|
-
el('div', {
|
|
260
|
-
el('
|
|
261
|
-
|
|
262
|
-
el('p', { class: 'note', text: e.meta?.description || (e.injectable ? '可写进 system 段的人设/技能文本。' : NOT_INJECTABLE) }),
|
|
263
|
-
),
|
|
264
|
-
el('span', { class: 'kind', style: `color:${kind.color}` }, kind.label),
|
|
380
|
+
el('div', {},
|
|
381
|
+
el('h2', {}, e.name, el('span', { class: `kind ${kindCls}` }, kind.label)),
|
|
382
|
+
el('p', { class: 'sub-note', text: e.meta?.description || (e.injectable ? '可写进 system 段的人设/技能文本。' : NOT_INJECTABLE) }),
|
|
265
383
|
),
|
|
384
|
+
// 内置专家:说清它是随包来的,不是用户导入的,所以没有「删除」只有「停用」。
|
|
385
|
+
// 「何时用」与「提炼自」分两行:一行里塞两件事读起来像免责声明。
|
|
386
|
+
e.builtin && e.meta?.whenToUse
|
|
387
|
+
? el('p', { class: 'sub-note', text: `何时用:${e.meta.whenToUse}` })
|
|
388
|
+
: null,
|
|
389
|
+
e.builtin && e.meta?.source
|
|
390
|
+
? el('p', { class: 'sub-note', text: `提炼自 ${e.meta.source}` })
|
|
391
|
+
: null,
|
|
266
392
|
el('dl', { class: 'facts' },
|
|
267
|
-
el('dt', { text: '来源' }), el('dd', { text: e.source?.root === 'inline' ? '页面导入(存在 options 里)' : e.source?.root || '—' }),
|
|
393
|
+
el('dt', { text: '来源' }), el('dd', { text: e.source?.root === 'inline' ? '页面导入(存在 options 里)' : e.builtin ? `插件内置 ${builtinFolder(e)}/` : e.source?.root || '—' }),
|
|
268
394
|
el('dt', { text: '路径' }), el('dd', {}, el('code', { text: e.source?.rel || '—' })),
|
|
269
395
|
el('dt', { text: '大小' }), el('dd', { text: e.injectable ? `${e.chars || 0} 字符(上限 64 KB)` : fmtSize(e.size || 0) }),
|
|
270
396
|
el('dt', { text: '摘要' }), el('dd', {}, el('code', { text: short(e.digest) })),
|
|
271
397
|
el('dt', { text: '版本' }), el('dd', { text: `v${e.version ?? 1}${history.length ? ` · 保留 ${history.length} 个旧版` : ''}` }),
|
|
272
|
-
el('dt', { text: '导入于' }), el('dd', { text: fmtTime(e.importedAt) }),
|
|
398
|
+
el('dt', { text: '导入于' }), el('dd', { text: e.builtin ? '随插件' : fmtTime(e.importedAt) }),
|
|
273
399
|
e.meta?.sessions !== undefined ? el('dt', { text: '会话数' }) : null,
|
|
274
400
|
e.meta?.sessions !== undefined ? el('dd', { text: String(e.meta.sessions) }) : null,
|
|
275
401
|
e.meta?.turns !== undefined ? el('dt', { text: '选定轮次' }) : null,
|
|
@@ -291,6 +417,8 @@
|
|
|
291
417
|
function renderRejects() {
|
|
292
418
|
const host = $('rejects')
|
|
293
419
|
const rows = Array.isArray(catalog?.rejected) ? catalog.rejected : []
|
|
420
|
+
const badge = $('rejects-count')
|
|
421
|
+
if (badge) badge.textContent = rows.length ? `${rows.length}` : ''
|
|
294
422
|
if (!rows.length) {
|
|
295
423
|
const n = entries().length
|
|
296
424
|
host.replaceChildren(el('li', {
|
|
@@ -337,7 +465,12 @@
|
|
|
337
465
|
renderPlan()
|
|
338
466
|
renderFilters()
|
|
339
467
|
renderList()
|
|
468
|
+
// 选着条目就看详情,没选就回组装预览:右栏永远有东西,不留空屏。
|
|
469
|
+
renderAssembly()
|
|
340
470
|
renderInspector()
|
|
471
|
+
const picked = Boolean(findEntry(selected))
|
|
472
|
+
$('assembly').hidden = picked
|
|
473
|
+
$('inspect').hidden = !picked
|
|
341
474
|
renderRejects()
|
|
342
475
|
renderLast()
|
|
343
476
|
renderSources()
|
|
@@ -403,14 +536,14 @@
|
|
|
403
536
|
|
|
404
537
|
const rows = [
|
|
405
538
|
el('span', { class: 'dot' }),
|
|
406
|
-
el('span', { class: ready ? 'who' : 'empty' }, ready
|
|
539
|
+
el('span', { class: ready ? 'who' : 'who is-empty' }, ready
|
|
407
540
|
? `下一次 agent 请求会注入「${plan.personaName || plan.personaId}」`
|
|
408
541
|
: '现在不会注入:请求原样放行'),
|
|
409
542
|
el('span', { class: 'actions' },
|
|
410
543
|
el('span', { class: 'tag', text: `模式 ${plan.mode} · ${fromText[plan.modeFrom] || plan.modeFrom || '默认'}` }),
|
|
411
544
|
ready && plan.skills?.length ? el('span', { class: 'tag', text: `技能 ${plan.skills.length} 条` }) : null,
|
|
412
545
|
...fix,
|
|
413
|
-
el('button', { type: 'button', class: '
|
|
546
|
+
el('button', { type: 'button', class: 'quiet', onclick: () => refresh() }, '重扫确认'),
|
|
414
547
|
),
|
|
415
548
|
el('span', { class: 'why', text: ready
|
|
416
549
|
? `人设来源:${fromText[plan.personaFrom] || plan.personaFrom}${catalog?.purge?.bound ? ';agent-purge 的 state.json 已读到' : ';没读到 agent-purge 的 state.json'}`
|
package/page/index.html
CHANGED
|
@@ -11,82 +11,97 @@
|
|
|
11
11
|
</head>
|
|
12
12
|
<body>
|
|
13
13
|
|
|
14
|
-
<header class="
|
|
14
|
+
<header class="top">
|
|
15
15
|
<div class="brand">
|
|
16
|
-
<img class="mark" src="icon.svg" alt="" width="
|
|
17
|
-
<div>
|
|
18
|
-
<h1>破甲
|
|
19
|
-
<p class="
|
|
16
|
+
<img class="mark" src="icon.svg" alt="" width="28" height="28">
|
|
17
|
+
<div class="brand-text">
|
|
18
|
+
<h1>破甲 <span class="brand-tail">Purge</span></h1>
|
|
19
|
+
<p class="tagline">本地 purge 目录 → 网关 system 改写</p>
|
|
20
20
|
</div>
|
|
21
21
|
</div>
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
<div class="
|
|
25
|
-
<
|
|
26
|
-
<
|
|
27
|
-
<
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
22
|
+
|
|
23
|
+
<div class="top-controls">
|
|
24
|
+
<div class="controls-row">
|
|
25
|
+
<label class="field">
|
|
26
|
+
<span class="field-label" id="mode-label">改写模式</span>
|
|
27
|
+
<select id="mode" aria-labelledby="mode-label">
|
|
28
|
+
<option value="">跟随 agent-purge</option>
|
|
29
|
+
<option value="off">off · 不动请求</option>
|
|
30
|
+
<option value="strict">strict · 只留人设</option>
|
|
31
|
+
<option value="replace">replace · 人设 + 去掉自称</option>
|
|
32
|
+
<option value="append">append · 人设 + 原样保留</option>
|
|
33
|
+
</select>
|
|
34
|
+
</label>
|
|
35
|
+
<button id="refresh" type="button" class="quiet">重新扫描</button>
|
|
33
36
|
</div>
|
|
34
|
-
<
|
|
37
|
+
<p class="top-hint" id="mode-help"></p>
|
|
35
38
|
</div>
|
|
36
39
|
</header>
|
|
37
40
|
|
|
38
|
-
<p class="boundary" id="boundary">
|
|
39
|
-
只处理经过 magpie 网关的 agent 请求;客户端自己写死的行为、不经过网关的流量改不到。
|
|
40
|
-
strict 会连原 system 里的工具说明文本一起换掉,结构化工具定义不在网关这一层。
|
|
41
|
-
页面不读磁盘:条目由插件后端扫描后写成快照,页面只显示它。
|
|
42
|
-
</p>
|
|
43
|
-
|
|
44
41
|
<section class="plan" id="plan" aria-label="当前注入状态" aria-live="polite"></section>
|
|
45
42
|
|
|
46
|
-
<div class="
|
|
47
|
-
<section aria-label="条目列表">
|
|
48
|
-
<div class="rail-
|
|
43
|
+
<div class="work">
|
|
44
|
+
<section class="rail" aria-label="条目列表">
|
|
45
|
+
<div class="rail-tools">
|
|
49
46
|
<input id="q" type="search" placeholder="搜名字、来源或类型" aria-label="搜索条目" autocomplete="off">
|
|
50
47
|
<div id="filters" class="chips" role="group" aria-label="按类型筛选"></div>
|
|
51
|
-
<p class="count" id="count">正在读快照…</p>
|
|
52
48
|
</div>
|
|
49
|
+
<p class="rail-count" id="count">正在读快照…</p>
|
|
53
50
|
<div id="list" class="list" role="listbox" aria-label="条目"></div>
|
|
54
51
|
</section>
|
|
55
52
|
|
|
56
|
-
<section class="
|
|
53
|
+
<section class="panel" id="panel" aria-label="注入组装与条目详情" aria-live="polite">
|
|
54
|
+
<div id="assembly"></div>
|
|
55
|
+
<div id="inspect"></div>
|
|
56
|
+
</section>
|
|
57
57
|
</div>
|
|
58
58
|
|
|
59
|
-
<
|
|
60
|
-
<
|
|
61
|
-
<
|
|
62
|
-
<div class="
|
|
63
|
-
<
|
|
64
|
-
<
|
|
65
|
-
<
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
59
|
+
<footer class="foot">
|
|
60
|
+
<details class="fold">
|
|
61
|
+
<summary>导入与来源</summary>
|
|
62
|
+
<div class="fold-body">
|
|
63
|
+
<label class="field">
|
|
64
|
+
<span class="field-label">文件路径</span>
|
|
65
|
+
<div class="inline-row">
|
|
66
|
+
<input id="import-path" type="text" placeholder="人设、技能、ZIP 导出包" aria-label="要导入的文件路径" spellcheck="false">
|
|
67
|
+
<button id="import-run" type="button">导入</button>
|
|
68
|
+
</div>
|
|
69
|
+
</label>
|
|
70
|
+
<p class="note">只认 <code>.md</code> <code>.markdown</code> <code>.txt</code> <code>.json</code> <code>.zip</code>;复制进插件的 <code>state/imports</code> 后再清点,原文件不动。</p>
|
|
71
|
+
|
|
72
|
+
<label class="field">
|
|
73
|
+
<span class="field-label">从本机选文件</span>
|
|
69
74
|
<input id="import-file" type="file" accept=".md,.markdown,.txt" aria-label="从本机选一个人设或技能文件">
|
|
70
|
-
</
|
|
75
|
+
</label>
|
|
71
76
|
<p class="note">选文件时正文直接存进插件的 options(<code>inline</code>),不复制、不落盘。</p>
|
|
72
|
-
|
|
73
|
-
<
|
|
74
|
-
|
|
75
|
-
<
|
|
76
|
-
</
|
|
77
|
+
|
|
78
|
+
<label class="field">
|
|
79
|
+
<span class="field-label">来源目录(一行一个)</span>
|
|
80
|
+
<textarea id="sources" rows="3" spellcheck="false" aria-label="来源目录,一行一个" placeholder="D:\purge ~/.agent-purge"></textarea>
|
|
81
|
+
</label>
|
|
82
|
+
<button id="sources-save" type="button">保存来源并重扫</button>
|
|
77
83
|
</div>
|
|
78
|
-
</
|
|
84
|
+
</details>
|
|
79
85
|
|
|
80
|
-
<
|
|
81
|
-
<
|
|
82
|
-
<ul id="rejects"></ul>
|
|
83
|
-
</
|
|
86
|
+
<details class="fold">
|
|
87
|
+
<summary>校验记录 <span class="fold-count" id="rejects-count"></span></summary>
|
|
88
|
+
<div class="fold-body"><ul id="rejects"></ul></div>
|
|
89
|
+
</details>
|
|
84
90
|
|
|
85
|
-
<
|
|
86
|
-
<
|
|
87
|
-
<div id="last" class="stack"></div>
|
|
88
|
-
</
|
|
89
|
-
|
|
91
|
+
<details class="fold">
|
|
92
|
+
<summary>最近一次生效</summary>
|
|
93
|
+
<div class="fold-body"><div id="last" class="stack"></div></div>
|
|
94
|
+
</details>
|
|
95
|
+
|
|
96
|
+
<details class="fold">
|
|
97
|
+
<summary>边界</summary>
|
|
98
|
+
<div class="fold-body">
|
|
99
|
+
<p class="note">只处理经过 magpie 网关的 agent 请求;客户端自己写死的行为、不经过网关的流量改不到。</p>
|
|
100
|
+
<p class="note"><code>strict</code> 会连原 system 里的工具说明文本一起换掉——结构化工具定义不在网关这一层。</p>
|
|
101
|
+
<p class="note">页面不读磁盘:条目由插件后端扫描后写成快照,页面只显示它。</p>
|
|
102
|
+
</div>
|
|
103
|
+
</details>
|
|
104
|
+
</footer>
|
|
90
105
|
|
|
91
106
|
<p id="status" class="status" role="status" aria-live="polite" hidden></p>
|
|
92
107
|
|