Files
plugins/packages/aelios/page/style.css
T
sakisakisa-design 33027a8fb8 aelios 0.1.0: Aelios memory recall and opt-in recording as gateway hooks (#549)
New package @magpie-community/gateway-aelios 0.1.0: asynchronous gateway hooks for Aelios memory, by sakisakisa-design (Aelios's author).

- Recall before each human turn, appended after the last user message. Recording of completed turns is opt-in (record: false by default).
- Traffic goes only to the user's own serverUrl (HTTPS or loopback HTTP, redirects refused, a key required). Only local and magpie-key origins by default.
- Local admission: an authenticated, dialogue-free GET /v1/hook/identities decides which model maps to which identity. Unmatched turns, or an unavailable list, send no dialogue.
- The request is slimmed (system prompts, thinking and tool results dropped, historical credentials masked). The recorded reply is slimmed to text and tool calls before the secret check and the send.
- Settings page served by a loopback Bun service (Host, Origin null and per-process token checks).
- The cleanMessageText/appendMemory logic ported from AGPL Aelios is relicensed MIT by its sole author (PR thread).

Run at the reviewed head 620cd47 on mote (macOS, Bun 1.4.2):
- bun test packages/aelios: 178 pass. Full HOME=$(mktemp -d) bun test: 4176 pass, 0 fail. Merged onto main 39de030: 4179 pass, 0 fail. check.mjs: exit 0 at both.
- Broken by hand: recording the raw reply turns 5 tests red; admitting every model turns 11 red.
- Probe against a fake Aelios: no thinking, reasoning, signature or encrypted_content is recorded for Anthropic, Responses or Chat. A secret in visible text skips the record. An unmatched model, or an identities endpoint answering 404, malformed JSON or a network error, sends only the GET.
- Real magpie Bun host (origin/main ceeb73a0f, GatewayBegin/Finish): recall injected, the slimmed record sent, nothing for an unmatched model or a remote origin.
- PR CI: test red only on gcp-ai's browser test 40s timeout (#471, unrelated, passes on mote).

Not tried: a real Aelios deployment, or a real agent behind a running magpie.
2026-10-31 14:52:01 +08:00

95 lines
4.6 KiB
CSS

/* Magpie's bridge supplies base typography, colours and controls. */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
main { max-width: 720px; }
.page-head { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 18px; }
.page-head > div { flex: 1; min-width: 0; }
.page-head h1 { font-size: 15px; }
.page-head p { margin: 2px 0 0; }
.badge { flex: none; padding-top: 2px; color: var(--magpie-muted); font-size: 11.5px; }
.badge[data-dirty="true"] { color: var(--magpie-accent); }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.panel { padding: 0 0 18px; }
.panel + .panel { padding-top: 18px; border-top: 1px solid var(--magpie-line); }
.section-head h2 { margin: 0; }
.section-head p { margin: 3px 0 14px; color: var(--magpie-muted); }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.wide { grid-column: 1 / -1; }
label { display: block; min-width: 0; }
label > span { display: block; margin-bottom: 5px; font-size: 12px; }
label > small, small { display: block; margin-top: 5px; }
label input:not([type="checkbox"]) { display: block; width: 100%; min-width: 0; }
input::placeholder { color: var(--magpie-faint); }
.secret { display: flex; align-items: center; gap: 6px; }
.secret input { flex: 1; min-width: 0; }
.secret button { flex: none; }
.toggle-row { display: flex; align-items: center; gap: 12px; min-height: 30px; padding: 5px 0; cursor: pointer; }
.toggle-row > span { flex: 1; min-width: 0; }
.toggle-row strong { display: block; font-size: 12px; font-weight: 500; }
.toggle-row small { margin-top: 2px; }
/* magpie's switch, as Plugins draws it */
input[role="switch"] {
appearance: none; -webkit-appearance: none; position: relative; flex: none;
width: 32px; height: 19px; margin: 0; padding: 0; border: 0; border-radius: 10px;
background: var(--magpie-line); cursor: pointer;
transition: background .2s cubic-bezier(.2, .8, .2, 1);
}
input[role="switch"]::before {
content: ""; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px;
border-radius: 50%; background: #fff; box-shadow: 0 1px 2px #00000040;
transition: transform .22s cubic-bezier(.2, .8, .2, 1);
}
input[role="switch"]:checked { background: var(--magpie-fg); }
input[role="switch"]:checked::before { transform: translateX(13px); }
input[role="switch"]:disabled { opacity: .5; cursor: default; }
#configured-url { overflow-wrap: anywhere; }
#connection-editor summary { cursor: pointer; }
#connect { margin-top: 14px; }
.advanced section { margin-top: 18px; }
.notice { margin: 0 0 12px; color: var(--magpie-muted); font-size: 12px; max-width: 74ch; }
#routes { display: grid; gap: 10px; }
.route {
position: relative; padding: 10px 12px;
border: 1px solid var(--magpie-line); border-radius: 10px; background: var(--magpie-card);
}
.route legend { padding: 0 4px; color: var(--magpie-muted); font-size: 11px; }
.route-actions { position: absolute; top: 6px; right: 8px; display: flex; gap: 2px; }
.route-action {
width: 24px; height: 22px; padding: 0; font-size: 12px; line-height: 1;
color: var(--magpie-muted); background: transparent; border-color: transparent;
}
.route-action:hover:not(:disabled) { color: var(--magpie-fg); border-color: var(--magpie-line); }
.route-fields { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 10px; }
.empty { margin: 0 0 12px; color: var(--magpie-muted); font-size: 12px; }
.route-limit { margin-top: 8px; }
#add-route { margin-top: 10px; }
.advanced { padding: 0 0 18px; }
.advanced summary { cursor: pointer; font-size: 12px; color: var(--magpie-muted); }
.advanced[open] summary { margin-bottom: 10px; }
footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; border-top: 1px solid var(--magpie-line); }
footer > div { min-width: 0; }
footer small { margin-top: 0; }
.actions { flex: none; display: flex; gap: 8px; }
#save { background: var(--magpie-accent); color: var(--magpie-accent-fg); border-color: transparent; font-weight: 500; }
#save:hover:not(:disabled) { filter: brightness(1.08); }
#result { margin: 0 0 8px; padding: 6px 9px; border-radius: 6px; background: var(--magpie-accent-soft); color: var(--magpie-fg); font-size: 12px; }
#result[data-error="true"] { background: color-mix(in srgb, var(--magpie-red) 12%, var(--magpie-card)); color: var(--magpie-red); }
.privacy { margin: 14px 0 0; color: var(--magpie-muted); font-size: 11.5px; max-width: 74ch; }
@media (max-width: 620px) {
.fields, .route-fields { grid-template-columns: 1fr; }
.wide { grid-column: auto; }
footer { align-items: stretch; flex-direction: column; }
.actions { justify-content: flex-end; }
}