Adds Agent Console (@magpie-community/page-agent-console 1.0.0), a community page plugin that drives the Agent CLIs on this computer (Claude Code, Codex, ACP agents) through a local daemon on 127.0.0.1, with its source in packages/agent-console and a registry entry. Claude Code is the user's own `claude` CLI driven over stream-json (daemon/src/providers/claude/cli.ts); no Anthropic SDK is installed, bundled or in the branch's history. Cold install ~45 MB (node-pty ~26 MB), stated in the README and registry summary in en and zh. By qingnian108 (#535). What was run at 8e8f910 (mote, macOS, throwaway HOME, no real accounts): - packages/agent-console: `npm ci --ignore-scripts --workspaces=false`; `node scripts/verify-build.mjs`: all five bundles byte-identical (daemon/dist/main.js 08c95aa3…, app/app.js 9a6911f3…); `vitest run`: 45 files, 254 passed, 17 skipped; `npm run check` clean. - Real Claude Code 2.1.316 (npm @anthropic-ai/claude-code, sandbox HOME/CLAUDE_CONFIG_DIR, local fake Messages API): `AC_REAL_CLAUDE=… vitest run --config vitest.real.config.ts test/real/claude-cli.real.test.ts`: 4 of 4 (initialize lists 51 slash commands, streaming turn, Bash permission approved and denied, interrupt, --resume with set_model). - Probe: the driver's exact argv with `--permission-mode bypassPermissions --allow-dangerously-skip-permissions`: the tool runs with no can_use_tool request. - Repo root: `HOME=$(mktemp -d) bun test`: 4006 tests, 0 fail; `bun scripts/check.mjs` exit 0. - Install as magpie does: `npm pack --ignore-scripts` (552 KB) then `bun add --ignore-scripts`: 45 MB node_modules, no @anthropic-ai/*, index.mjs imports. - Read every changed line since 41c7a94: argv values limited to SAFE_ARG tokens (no cmd.exe metacharacters reach the shim path), no new network hosts, no install scripts, no eval; no commit in main..8e8f910 contains claude-agent-sdk. Not tried: magpie's desktop window loading the page; a Windows .cmd/.ps1 claude shim end to end.
199 lines
8.1 KiB
CSS
199 lines
8.1 KiB
CSS
/* Input area (§8.6 Composer) */
|
|
.composer { flex: none; padding: 0 16px 12px; }
|
|
.cp-card {
|
|
width: 100%; max-width: 680px; margin: 0 auto;
|
|
background: var(--surface); border-radius: var(--r-l); border: 1px solid transparent;
|
|
padding: 8px 10px 6px; transition: border-color var(--dur-2) var(--ease);
|
|
}
|
|
.cp-card:focus-within { border-color: color-mix(in oklab, var(--fg) 18%, var(--bg)); }
|
|
.cp-card.waiting { box-shadow: inset 2px 0 0 var(--warn); }
|
|
.cp-card.danger { box-shadow: inset 2px 0 0 var(--danger); }
|
|
.cp-danger {
|
|
max-width: 680px; margin: 0 auto 6px; display: flex; align-items: center; gap: 6px;
|
|
color: var(--danger); font-size: var(--fs-s); padding: 0 2px;
|
|
}
|
|
.att-note { padding: 6px 10px 0; color: var(--muted); font-size: var(--fs-s); }
|
|
.cp-ta-wrap { position: relative; }
|
|
.slash-pop {
|
|
position: absolute; left: 0; right: 0; bottom: 100%; margin-bottom: 6px;
|
|
max-height: min(240px, 40vh); overflow: hidden; display: flex; flex-direction: column;
|
|
z-index: 20;
|
|
}
|
|
.slash-pop .ap-scroll { max-height: inherit; }
|
|
.slash-pop .slash-h {
|
|
padding: 4px 10px 2px; font-size: var(--fs-xs); color: var(--muted); text-transform: uppercase;
|
|
letter-spacing: 0.04em;
|
|
}
|
|
.slash-pop .mi.slash-item {
|
|
height: auto; min-height: 28px; padding: 4px 10px; flex-direction: column; align-items: flex-start;
|
|
gap: 0;
|
|
}
|
|
.slash-pop .slash-name { font-weight: 500; }
|
|
.slash-pop .slash-desc { font-size: var(--fs-xs); color: var(--muted); line-height: 1.3; }
|
|
.slash-pop .slash-hint { font-size: var(--fs-xs); color: var(--muted); font-family: var(--mono, monospace); }
|
|
.slash-pop .mi.slash-item.sel { background: var(--surface-hover); }
|
|
|
|
.cp-ta {
|
|
width: 100%; border: 0; resize: none; background: none; outline: none;
|
|
font-size: var(--fs-m); line-height: 1.55; max-height: calc(1.7em * 10); overflow-y: auto;
|
|
display: block;
|
|
}
|
|
.cp-ta::placeholder { color: var(--muted); }
|
|
.cp-bar {
|
|
display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px;
|
|
margin-top: 4px; min-width: 0;
|
|
}
|
|
|
|
/* Pill controls */
|
|
.pill-wrap { position: relative; flex: 0 1 auto; min-width: 0; max-width: 100%; }
|
|
.pill {
|
|
display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px;
|
|
border-radius: var(--r-full); background: var(--surface-hover); color: var(--fg);
|
|
font-size: var(--fs-s); max-width: min(220px, 100%); min-width: 0;
|
|
}
|
|
.pill .p-a { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
|
|
.pill .p-t { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1 1 auto; }
|
|
.pill.sel {
|
|
appearance: none; border: 0; padding: 0 22px 0 10px; cursor: pointer;
|
|
max-width: min(140px, 100%); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
|
|
background: var(--surface-hover) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23737373' d='M1 1l4 4 4-4'/%3E%3C/svg%3E") no-repeat right 8px center;
|
|
}
|
|
.pill.sel.danger { color: var(--danger); }
|
|
.pill.cursor-shield { padding: 0 8px; color: var(--muted); border: 0; cursor: pointer; }
|
|
.pill.cursor-shield.on { color: var(--ok, #3ecf8e); background: color-mix(in oklab, var(--ok, #3ecf8e) 14%, var(--surface-hover)); }
|
|
.pill.sel.cursor-fast { max-width: min(72px, 100%); }
|
|
.cp-bar > .ibtn { flex: none; }
|
|
|
|
/* When the composer gets narrow (depends on the middle column's width, not the window) */
|
|
.cp-card { container-type: inline-size; container-name: composer; }
|
|
@container composer (max-width: 520px) {
|
|
.pill .p-t { display: none; }
|
|
.pill { max-width: min(160px, 100%); }
|
|
.pill.sel { max-width: min(104px, 100%); font-size: 11px; padding-right: 20px; }
|
|
}
|
|
@container composer (max-width: 380px) {
|
|
.pill { max-width: min(120px, 100%); padding: 0 8px; }
|
|
.pill.sel { max-width: min(80px, 100%); padding-left: 7px; padding-right: 18px; }
|
|
}
|
|
|
|
/* Agent·model popover */
|
|
.pop {
|
|
position: absolute; bottom: 32px; left: 0; z-index: 55; width: 260px;
|
|
background: var(--bg); border-radius: var(--r-m); box-shadow: var(--shadow-pop);
|
|
padding: 4px; max-height: 60vh; overflow-y: auto;
|
|
}
|
|
.agent-picker {
|
|
width: min(300px, calc(100vw - 32px)); padding: 0; overflow: hidden;
|
|
display: flex; flex-direction: column; max-height: min(420px, 60vh);
|
|
}
|
|
.agent-picker .ap-search {
|
|
display: flex; align-items: center; gap: 8px; padding: 8px 10px;
|
|
border-bottom: 1px solid var(--line); flex: none; color: var(--muted);
|
|
}
|
|
.agent-picker .ap-search-in {
|
|
flex: 1; min-width: 0; border: 0; background: none; outline: none;
|
|
font-size: var(--fs-s); color: var(--fg);
|
|
}
|
|
.agent-picker .ap-search-in::placeholder { color: var(--muted); }
|
|
.agent-picker .ap-scroll {
|
|
overflow-y: auto; padding: 4px; flex: 1; min-height: 0;
|
|
}
|
|
.agent-picker .ap-empty {
|
|
padding: 12px 10px; font-size: var(--fs-s); color: var(--muted); text-align: center;
|
|
}
|
|
.agent-picker .ap-back {
|
|
font-weight: 600; margin-bottom: 2px;
|
|
}
|
|
.agent-picker .ap-back-icon {
|
|
display: inline-flex; transform: rotate(180deg); margin-right: 2px;
|
|
}
|
|
.agent-picker .mi-row {
|
|
display: flex; align-items: center; gap: 6px; width: 100%; text-align: left;
|
|
}
|
|
/* Provider list: name on the left, meta on the right, so tags like "Experimental" don't squeeze out the name */
|
|
.agent-picker .provider-pick-row {
|
|
justify-content: space-between;
|
|
gap: 8px;
|
|
}
|
|
.agent-picker .provider-pick-name {
|
|
flex: 0 1 auto;
|
|
min-width: 5.5rem;
|
|
max-width: 58%;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
font-weight: 500;
|
|
color: inherit;
|
|
}
|
|
.agent-picker .provider-pick-meta {
|
|
flex: 0 0 auto;
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: flex-end;
|
|
gap: 6px;
|
|
min-width: 0;
|
|
margin-left: auto;
|
|
}
|
|
.agent-picker .provider-pick-meta .dlg-hint {
|
|
flex: none;
|
|
font-size: 10px;
|
|
max-width: 5rem;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
}
|
|
/* Model search rows still use mi-name / mi-sub */
|
|
.agent-picker .mi-row .mi-name {
|
|
flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
|
|
}
|
|
.agent-picker .mi-row .mi-sub {
|
|
flex: none; max-width: 38%; font-size: 11px; color: var(--muted);
|
|
overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
|
|
}
|
|
.agent-picker .model-pick-row {
|
|
min-width: 0;
|
|
}
|
|
.agent-picker .model-pick-name {
|
|
flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
|
|
}
|
|
.agent-picker .model-pick-default {
|
|
flex: 0 1 58%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
|
|
}
|
|
.agent-picker .mi-meta { flex: none; font-size: 11px; color: var(--muted); white-space: nowrap; }
|
|
.agent-picker .mi-tag { flex: none; font-size: 10px; color: var(--accent); }
|
|
.agent-picker .mi-caret { flex: none; color: var(--muted); display: inline-flex; }
|
|
.agent-picker .mi-check { flex: none; margin-left: auto; color: var(--accent); }
|
|
|
|
.ap-sec { padding: 4px 0; }
|
|
.ap-sec .tinput { height: 26px; margin-bottom: 4px; }
|
|
.ap-sec .mi { height: 26px; font-size: var(--fs-s); }
|
|
|
|
/* Attachment strip */
|
|
.att-bar { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 0 6px; }
|
|
.att {
|
|
display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 8px;
|
|
background: var(--surface-hover); border-radius: var(--r-s); font-size: var(--fs-s);
|
|
}
|
|
.att img { width: 22px; height: 22px; object-fit: cover; border-radius: 4px; }
|
|
.att.up { opacity: .6; }
|
|
.att-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
.att-x { color: var(--muted); font-size: 14px; line-height: 1; }
|
|
.att-x:hover { color: var(--fg); }
|
|
|
|
.cp-right { margin-left: auto; flex: none; display: flex; align-items: center; gap: 8px; }
|
|
.cp-clock { font-size: var(--fs-s); color: var(--muted); }
|
|
.cp-send, .cp-stop {
|
|
width: 28px; height: 28px; border-radius: 50%; flex: none;
|
|
display: inline-flex; align-items: center; justify-content: center;
|
|
transition: filter var(--dur-1), opacity var(--dur-1);
|
|
}
|
|
.cp-send { background: var(--accent); color: var(--accent-fg); }
|
|
.cp-send:hover { filter: brightness(1.08); }
|
|
.cp-send[disabled] { opacity: .3; cursor: default; filter: none; }
|
|
.cp-stop { background: var(--fg); color: var(--bg); }
|
|
.cp-stop:hover { filter: brightness(1.15); }
|
|
|
|
@media (max-width: 560px) {
|
|
.composer { padding: 0 10px 10px; }
|
|
}
|