Skip to content

Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins

5.6 KB
Raw Blame
<!-- status: draft -->
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>附件 · 目录</title>
<style>
  :root{
    --bg:#0e0e0e; --surface:#161616; --surface-2:#1b1b1b; --line:#2a2a2a; --line-2:#353535;
    --text:#ededed; --text-2:#b0b0b0; --muted:#7d7d7d; --faint:#5c5c5c;
    --ok:#40c977; --warn:#ff8549; --error:#ff6764;
    --api:#40c977; --host:#4c8dff; --plugin:#c27aff; --slot:#ff8549;
    --font:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif;
    --mono:ui-monospace,"SF Mono","Cascadia Code",Consolas,monospace;
  }
  *{box-sizing:border-box}
  html,body{margin:0}
  body{background:var(--bg);color:var(--text);font-family:var(--font);font-size:14px;line-height:1.65;-webkit-font-smoothing:antialiased}
  code{font-family:var(--mono);font-size:12.5px;color:var(--text-2)}
  .plan-nav{display:flex;flex-wrap:wrap;align-items:center;gap:4px;padding:10px 28px;background:#0c0c0c;border-bottom:1px solid var(--line);font-size:13px}
  .plan-nav a{color:var(--text-2);text-decoration:none;padding:3px 8px;border-radius:6px}
  .plan-nav a:hover{background:var(--surface);color:var(--text)}
  .plan-nav a[aria-current="page"]{background:var(--surface);color:var(--text);box-shadow:inset 0 0 0 1px var(--line-2)}
  .plan-nav .sep{color:var(--faint);padding:0 2px}
  .plan-nav .spacer{flex:1}
  .top{border-bottom:1px solid var(--line);padding:24px 28px 20px;background:linear-gradient(180deg,#141414,#0e0e0e)}
  .top .crumb{font-family:var(--mono);font-size:11.5px;color:var(--faint);letter-spacing:.06em}
  .top h1{margin:6px 0;font-size:21px}
  .top p{margin:0;color:var(--text-2);max-width:80ch}
  .top .meta{margin-top:8px;color:var(--faint);font-size:12.5px}
  main{max-width:880px;margin:0 auto;padding:24px 28px 80px}
  h2{font-size:15px;margin:28px 0 10px;padding-top:14px;border-top:1px solid var(--line)}
  h2:first-child{margin-top:0;border-top:0;padding-top:0}
  .cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:12px}
  .card{display:block;padding:14px 16px;border-radius:11px;background:var(--surface);border:1px solid var(--line);text-decoration:none;color:inherit}
  .card:hover{border-color:var(--line-2);background:#191919}
  .card .name{font-family:var(--mono);font-size:12.5px;color:var(--text-2)}
  .card .what{margin:6px 0 0;font-size:13.5px}
  .card .files{margin:8px 0 0;font-family:var(--mono);font-size:11.5px;color:var(--faint)}
  ul{margin:0;padding-left:1.2em}
  li{margin:3px 0}
  .callout{margin:12px 0;padding:11px 13px;border-radius:9px;background:var(--surface);color:var(--text-2);font-size:13px;border-left:2px solid var(--line-2)}
  .callout.warn{border-left-color:var(--warn)}
  .callout.stop{border-left-color:var(--error)}
  .callout b{color:var(--text)}
</style>
</head>
<body>

<nav class="plan-nav">
  <a href="../../index.html">插件插槽目录</a>
  <span class="sep">/</span>
  <a href="index.html">附件</a>
  <span class="spacer"></span>
  <a href="index.html" aria-current="page">目录</a>
  <a href="requirements.html">需求</a>
  <a href="data-flow.html">数据流</a>
</nav>

<header class="top">
  <div class="crumb">docs/plugin-plan · render · attachments</div>
  <h1>附件 · 目录</h1>
  <p>附件区三动作:<code>attachments.add</code> / <code>attachments.list</code> / <code>attachments.remove</code>。只收内容或凭证,不收地址;宿主落暂存区;各自只看得见、动得了自己的。这是 render 相关接口,不是 UI 槽。</p>
  <div class="meta">status: draft · issue #545 · #561 · S1 红线:禁 path / file:// / URL 引用</div>
</header>

<main>

  <h2>这个目录里有什么</h2>
  <div class="cards">
    <a class="card" href="requirements.html">
      <div class="name">requirements.html</div>
      <p class="what">要什么:三动作、入参形状、暂存区、可见性边界、S1 红线、本轮拍板。</p>
      <p class="files">范围 · 契约形状 · 谁能用 · 场景 · 明确不做 · 本轮拍板</p>
    </a>
    <a class="card" href="data-flow.html">
      <div class="name">data-flow.html</div>
      <p class="what">数据怎么走:内容怎么进暂存区、列表怎么裁、移除怎么限、出错怎么办。</p>
      <p class="files">接口约定 · 数据怎么走 · 出错怎么办 · 不提供什么 · 相关条目 · 还没定的事</p>
    </a>
  </div>

  <h2>为什么没有 demo</h2>
  <div class="callout warn"><b>接口类,省略 demo。</b>本目录钉的是入参与边界,没有可挂载的界面槽。附件区长什么样见 <code>ui/composer/demo.html</code>(场景 6 的加 / 列 / 移);这里不重复界面。</div>

  <h2>一句话回顾</h2>
  <ul>
    <li>入参只有三样:<code>{ name, mimeType, content|token }</code>——名字、类型、内容本体或取内容的凭证。</li>
    <li class=""><b>S1 红线:禁 path / file:// / URL 引用。</b>不许只交一个地址让宿主去读盘或上网;裸路径附件直接拒绝。</li>
    <li>内容由宿主落进<b>暂存区</b>,插件不再自己保管地址。</li>
    <li><code>list</code> 只见自己加的;<code>remove</code> 只能动自己加的。用户和别家的碰不到。</li>
    <li>出站分层:<code>attachments.add</code> 核心 H;<code>list</code> / <code>remove</code> 可选 H;裸路径附件拒绝。</li>
  </ul>

  <h2>还没定的事</h2>
  <p style="color:var(--muted);font-size:13px">token 的具体形态(一次性凭证还是宿主句柄)、暂存区大小上限——见 data-flow.html「还没定的事」。</p>

</main>
</body>
</html>