diff --git a/README.md b/README.md index 9624d840..9d8a0cb9 100644 --- a/README.md +++ b/README.md @@ -86,8 +86,9 @@ flowchart LR | App | Declared by | Its tools (run by) | What it puts on the glance screen | | --- | --- | --- | --- | | Rinx (native) | `native-apps.json` `agent.octos` (the four `octos.*` services) and `agent.generic_tools` | octos's generic tools in its list; its own assistant UI | – | -| News (`os.news`) | `apps/news/bundle/tools.json`, the manifest's `agent` block | `news.list`, `news.read` (the `news` host service) | – | +| News (`os.news`) | `apps/news/bundle/tools.json`, the manifest's `agent` block and `glance` | `news.list`, `news.read`, `news.notify` (the `news` host service) | a notice card with a notification | | Mail (`os.mail`) | `apps/mail/bundle/tools.json`, the manifest's `agent` block and `glance` | `mail.notify` (the `mail` host service) | a notice card with a notification | +| Photos, Maps, YouTube (`os.photos`, `os.maps`, `os.youtube`) and Camera (`os.camera`, phone only) | each app's `bundle/tools.json`, the manifest's `agent` block and `glance` | `.notify` (`photos.notify`, …; the shell's notice service, `crates/shell/src/glance_notice.rs`, since these apps have no service of their own) | a notice card with a notification | | Calendar (`os.calendar`, desktop only) | `apps/calendar/bundle/tools.json`, the manifest's `agent` block and `glance` | `calendar.events`, `calendar.add_event`, `calendar.remove_event` (destructive: the person approves it), `calendar.notify`, `calendar.agenda` (the `calendar` host service) | an event card or an agenda card, with a notification | A script app has an agent when its manifest declares `octos.*` names or an `agent` block (`"tools": ["ask_user_question"]` names the kernel tools it may use), or its bundle ships `tools.json` (each tool `.` with its schemas, `risk`, `confirm` and `shareable`). Its peer is `card.`. The person allows the agent once, on the first-use sheet (from the shell's "Ask " panel, the app's own `octos` call or the system agent's `agents.ask`). From then on the shell prepares the peer at startup, with the app's tools registered, so the system agent's `peer_list` shows it. Besides its own tools, an app agent gets the host read tools `files.list`, `files.read` and `files.search` over its account folder. On the phone, which builds `toolbox-peers` by default, it also gets the system toolbox's tools when its manifest asks for `research` or `crawl`, which no app does yet. `AGENT.md`, skills and triggers ([ADR 0002](docs/adr/0002-event-driven-app-agents.md)) are not built: an app agent runs only when the system agent, the person or a card asks it. @@ -104,7 +105,7 @@ sequenceDiagram actor P as Person participant S as System agent participant B as Shell: app-peers broker - participant A as Mail's agent (peer card.os.mail) + participant A as Mail's agent (kernel-issued peer) participant R as Shell: tool relay participant M as Mail's host service participant G as Shell: glance service @@ -115,19 +116,24 @@ sequenceDiagram R->>R: grant, consent, schema, budget R->>M: run on Mail's host service M->>G: glance.publish as os.mail: notice.card, notify - G-->>P: notification (a desktop toast, the phone's shade) + G-->>P: desktop: a toast and the glance panel; phone: a shade notification M-->>R: {card_id} R-->>A: peer/tool/result A-->>S: the turn's result on the blackboard (peer_gather) - P->>G: opens the card, types in its chat - G->>A: a turn in the person's lane (sys.chat) - A-->>G: the reply, drawn as AI-written ``` -- The model never writes card code: `mail.notify`, `calendar.notify` and `calendar.agenda` fill a fixed L0 card the app's host service ships (`apps/mail/host-service/resources/notice.card`, `apps/calendar/host-service/resources/*.card`) and publish it as the app. -- `mail.notify` and `calendar.add_event` are `act` tools and run without a sheet; octos asks for approval only for destructive and outward tools, which go to the shell's approval router ([below](#a-tool-call-with-an-approval)). +The model supplies text, never card code. The host fills fixed templates: + +- **Notice cards.** Mail, News, Photos and the other `.notify` tools use the shell’s [`notice.card`](crates/shell/resources/glance/notice.card). The shell supplies the app’s icon and name; the call supplies the title and body. Reusing a `card_id` replaces the app’s earlier notice. +- **Calendar cards.** `calendar.notify` and `calendar.agenda` use Calendar’s [event and agenda templates](apps/calendar/host-service/resources). + +Mail and News forward `notify` from their host services to the shell. For apps without their own service, the shell’s [`glance_notice.rs`](crates/shell/src/glance_notice.rs) handles the call directly. In either case, the shell publishes as the app and requires its `glance` grant (`glance::publish_for`). + +Pressing one of these cards opens the app. To discuss a Mail notice with Mail’s agent, open “Ask Mail” ([below](#talking-to-an-apps-agent-yourself)). [In-card chat](#in-card-chat) describes the separate chat feature and its current availability. + +`mail.notify` and `calendar.add_event` are `act` tools and normally run without a per-call sheet. Destructive and outward calls enter the approval path; the shell’s approval router decides which requests need a person ([below](#a-tool-call-with-an-approval)). ### One app agent, two lanes @@ -173,8 +179,8 @@ The person is not limited to the system agent: they can talk to any app's own ag | Surface | Where it is | How it opens | | --- | --- | --- | | **"Ask "** (`crates/shell/src/app_chat/`) | A shell panel for every app with an agent, whether or not the app draws a chat of its own: the system chat's pane drawn as the app's conversation (`app_panel: true`). On a desktop it stands right of the system chat, so the two lanes show side by side. | The bar's "Ask " button (shown while the focused window's app has an agent), Shift+F8, or the menu row "Ask this app's agent". With an app without an agent focused, the shell says "No app agent here". On the phone the pane is drawn as a full-screen sheet, but no touch control opens it on `main` yet. | -| **A card's in-card chat** (`sys.chat`, `crates/shell/src/glance_chat.rs`) | A glance card the app published | The person types in the card's chat. Only the publishing app's own agent answers, and its reply is marked AI-written ([below](#cards-and-questions)). | -| **The app's own UI** | A native module's `open_conversation`, a script app's `octos.session.open`, a process app's peer link | Inside the app. Rinx draws its own assistant UI; none of the system apps (News, Mail, Calendar) draws a chat, so for them the panel and their cards are the way in. | +| **A card’s in-card chat** (`sys.chat`, `crates/shell/src/glance_chat.rs`) | A glance card that declares a chat | The person types in the card; the publishing app’s own agent answers, with its reply marked AI-written. See [in-card chat](#in-card-chat) for current availability and the demo. | +| **The app's own UI** | A native module's `open_conversation`, a script app's `octos.session.open`, a process app's peer link | Inside the app. Rinx draws its own assistant UI; none of the system apps draws a chat, so for them the "Ask " panel is the way in. | How the "Ask " panel behaves: @@ -231,10 +237,36 @@ sequenceDiagram ### Cards and questions -- **Glance cards** (`crates/shell/src/glance.rs`): an app with the `glance` capability publishes with `glance.publish` (`glance.withdraw`, `glance.list`), as itself: the shell takes the publisher from the caller, never from the arguments. A card is an L0 `source` filled from `data` (presentation only, checked with Octoscript's L0 checker) or a Splash `script`. Limits: 6 publishes a minute and 4 cards per app, 32 kept, 6 shown by priority, then recency. A card published with `notify` also posts a notification: on a desktop the toast opens that card in its own card window (`glance_sheet.rs`), and the glance panel (`glance_panel.rs`; the bar's bell, F9) opens on every new card; on a phone the shade's notification opens the glance page. -- **Interactive cards** ([#153](https://github.com/OctoSense-org/OctoSense/pull/153)): an app's glance cards run under the app's own policy, as the app's UI does in the Card runner. What the person does on a card is the app's own action, through the app's capability gate and host services, not an agent tool call, so it needs no extra shell approval. -- **In-card chat** ([#263](https://github.com/OctoSense-org/OctoSense/pull/263)): an L0 card may declare `sys.chat(app, thread, fields)` and draw `ChatEntry` rows, and show text the model wrote (`class: model-copy`), marked AI-written and never acted on. The transcript is the host's ([`crates/l0-chat`](crates/l0-chat/README.md), `crates/shell/src/glance_chat.rs`): only the publishing app's own agent, only what the person typed is written as theirs, and the agent answers in the person's lane. Threads are kept in the app's account folder (`apps//accounts//chat/.json`). -- **Questions** (octos's `ask_user_question`) are routed by the turn's trigger: a turn from the person's lane (or the app) asks in the app's conversation, a turn from the system agent's lane asks in the system chat. Only the person answers, on a shell surface. +#### Publishing and opening cards + +An app with the `glance` capability publishes as itself with `glance.publish`; it can also use `glance.withdraw` and `glance.list`. The shell takes the publisher from the caller, never from the arguments. A card is either an L0 `source` filled from `data` (presentation only, checked by Octoscript’s L0 checker) or a Splash `script`. + +The limits are 6 publishes per minute and 4 cards per app. The shell keeps 32 cards and shows 6, ordered by priority, then recency. See [`glance.rs`](crates/shell/src/glance.rs). + +| Surface | What happens | +| --- | --- | +| Desktop panel | A new card opens the glance panel unless a card window is already open. The bar’s bell or F9 also opens the panel. | +| Desktop notification | A card published with `notify` also posts a toast. Selecting the toast opens the card in its own window. While the panel is open, toasts stack to its left. | +| Desktop dismissal | Each card has a dismiss button: `glance::dismiss` removes it as if the app had withdrawn it. The panel has a separate close button. | +| Phone | `notify` posts a shade notification. Selecting it opens the glance page. | + +The desktop surfaces are implemented in [`glance_panel.rs`](crates/shell/src/glance_panel.rs), [`glance_sheet.rs`](crates/shell/src/glance_sheet.rs) and [`notifications.rs`](crates/shell/src/shell/notifications.rs) (`keep_clear_of`, [#273](https://github.com/OctoSense-org/OctoSense/pull/273)). + +#### Interactive cards + +A card runs under its app’s own policy, as the app’s UI does in the Card runner. A person’s action on a card passes through the app’s capability gate and host services. It is an app action, so it needs no extra shell approval for an agent tool call ([#153](https://github.com/OctoSense-org/OctoSense/pull/153)). + +#### In-card chat + +**Current availability:** none of the cards published by app agents on `main` declares a chat. The only shipped card with a chat is [`mail-request.card`](crates/shell/resources/glance/mail-request.card), enabled by `OCTOSENSE_GLANCE_DEMO=mail`; it gives canned replies. + +An L0 card can declare `sys.chat(app, thread, fields)` and draw `ChatEntry` rows. It can also display model-written text (`class: model-copy`), which is marked AI-written and never executed as an action ([#263](https://github.com/OctoSense-org/OctoSense/pull/263)). + +The host owns the transcript. Only the publishing app’s own agent answers, in the person’s lane, and only text the person typed is recorded as theirs. Threads are stored in `apps//accounts//chat/.json`. See [`crates/l0-chat`](crates/l0-chat/README.md) and [`glance_chat.rs`](crates/shell/src/glance_chat.rs). + +#### Questions + +Questions (`ask_user_question`) follow the turn’s trigger. A turn from the person’s lane or the app asks in the app’s conversation; a turn from the system agent’s lane asks in the system chat. Only the person answers, on a shell surface. ## Layout diff --git a/README.zh-CN.md b/README.zh-CN.md index 8b735c1c..240a6809 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -86,8 +86,9 @@ flowchart LR | 应用 | 声明方式 | 它的工具(由谁执行) | 它放到 glance 屏幕上的内容 | | --- | --- | --- | --- | | Rinx(原生) | `native-apps.json` 的 `agent.octos`(四个 `octos.*` 服务)和 `agent.generic_tools` | 其列表中的 octos 通用工具;它自己的助手界面 | – | -| 新闻(`os.news`) | `apps/news/bundle/tools.json`、manifest 中的 `agent` 块 | `news.list`、`news.read`(`news` 宿主服务) | – | +| 新闻(`os.news`) | `apps/news/bundle/tools.json`、manifest 中的 `agent` 块和 `glance` | `news.list`、`news.read`、`news.notify`(`news` 宿主服务) | 一张通知卡片,并发出一条通知 | | 邮件(`os.mail`) | `apps/mail/bundle/tools.json`、manifest 中的 `agent` 块和 `glance` | `mail.notify`(`mail` 宿主服务) | 一张通知卡片,并发出一条通知 | +| 照片、地图、YouTube(`os.photos`、`os.maps`、`os.youtube`)和相机(`os.camera`,仅手机端) | 各应用的 `bundle/tools.json`、manifest 中的 `agent` 块和 `glance` | `.notify`(`photos.notify` 等;由 Shell 的通知服务应答,`crates/shell/src/glance_notice.rs`,因为这些应用没有自己的服务) | 一张通知卡片,并发出一条通知 | | 日历(`os.calendar`,仅桌面端) | `apps/calendar/bundle/tools.json`、manifest 中的 `agent` 块和 `glance` | `calendar.events`、`calendar.add_event`、`calendar.remove_event`(破坏性操作:由用户批准)、`calendar.notify`、`calendar.agenda`(`calendar` 宿主服务) | 一张日程卡片或议程卡片,并发出一条通知 | 脚本应用在以下情况下拥有 Agent:manifest 声明了 `octos.*` 名称或 `agent` 块(`"tools": ["ask_user_question"]` 列出它可以使用的内核工具),或者应用包附带 `tools.json`(每个工具名为 `.`,带 schema、`risk`、`confirm` 和 `shareable`)。它的 peer 是 `card.<应用 id>`。用户只需在首次使用面板上允许一次(从 Shell 的 “Ask ” 面板、应用自己的 `octos` 调用,或系统 Agent 的 `agents.ask` 打开)。此后 Shell 在启动时就准备好这个 peer 并注册应用的工具,所以系统 Agent 的 `peer_list` 能看到它。除了自己的工具,应用 Agent 还能用宿主的只读工具 `files.list`、`files.read` 和 `files.search` 读取其账号文件夹。手机默认构建 `toolbox-peers`,因此在手机上,manifest 申请了 `research` 或 `crawl` 的应用 Agent 还会得到系统工具箱的工具;目前还没有应用申请。`AGENT.md`、技能和触发器([ADR 0002(英文)](docs/adr/0002-event-driven-app-agents.md))尚未实现:应用 Agent 只在系统 Agent、用户或卡片请求时运行。 @@ -104,7 +105,7 @@ sequenceDiagram actor P as Person participant S as System agent participant B as Shell: app-peers broker - participant A as Mail's agent (peer card.os.mail) + participant A as Mail's agent (kernel-issued peer) participant R as Shell: tool relay participant M as Mail's host service participant G as Shell: glance service @@ -115,19 +116,24 @@ sequenceDiagram R->>R: grant, consent, schema, budget R->>M: run on Mail's host service M->>G: glance.publish as os.mail: notice.card, notify - G-->>P: notification (a desktop toast, the phone's shade) + G-->>P: desktop: a toast and the glance panel; phone: a shade notification M-->>R: {card_id} R-->>A: peer/tool/result A-->>S: the turn's result on the blackboard (peer_gather) - P->>G: opens the card, types in its chat - G->>A: a turn in the person's lane (sys.chat) - A-->>G: the reply, drawn as AI-written ``` -- 模型从不编写卡片代码:`mail.notify`、`calendar.notify` 和 `calendar.agenda` 填充应用宿主服务自带的固定 L0 卡片(`apps/mail/host-service/resources/notice.card`、`apps/calendar/host-service/resources/*.card`),并以该应用的身份发布。 -- `mail.notify` 和 `calendar.add_event` 是 `act` 工具,运行时不弹面板;octos 只对破坏性和对外的工具请求审批,这些审批交给 Shell 的审批路由([见下文](#一次带审批的工具调用))。 +模型只提供文字,从不编写卡片代码。宿主填充固定模板: + +- **通知卡片。** 邮件、新闻、照片及其他 `.notify` 工具使用 Shell 的 [`notice.card`](crates/shell/resources/glance/notice.card)。Shell 提供应用图标和名称;调用提供标题和正文。重复使用同一个 `card_id` 会替换该应用之前的通知。 +- **日历卡片。** `calendar.notify` 和 `calendar.agenda` 使用日历自己的[日程与议程模板](apps/calendar/host-service/resources)。 + +邮件和新闻的宿主服务把 `notify` 转交给 Shell。没有独立宿主服务的应用则由 Shell 的 [`glance_notice.rs`](crates/shell/src/glance_notice.rs) 直接处理。无论哪种方式,Shell 都以应用的身份发布,并要求应用获准使用 `glance`(`glance::publish_for`)。 + +点击这些卡片会打开应用。要就邮件通知与邮件的 Agent 对话,请打开 “Ask Mail”([见下文](#直接与应用的-agent-对话))。独立的[卡内对话](#卡内对话)功能及其当前可用情况见后文。 + +`mail.notify` 和 `calendar.add_event` 是 `act` 工具,通常不需要逐次调用的审批面板。破坏性和对外调用进入审批流程;Shell 的审批路由决定哪些请求需要用户处理([见下文](#一次带审批的工具调用))。 ### 一个应用 Agent,两条通道 @@ -173,8 +179,8 @@ flowchart TB | 入口 | 位置 | 如何打开 | | --- | --- | --- | | **“Ask ”**(`crates/shell/src/app_chat/`) | Shell 为每个拥有 Agent 的应用提供的面板,不论应用自己是否绘制对话界面:它就是系统对话的窗格,以应用对话的形式绘制(`app_panel: true`)。在桌面端,它位于系统对话的右侧,两条通道并排显示。 | 顶栏的 “Ask ” 按钮(当前聚焦窗口的应用拥有 Agent 时显示)、Shift+F8,或菜单项 “Ask this app's agent”。如果聚焦的应用没有 Agent,Shell 会提示 “No app agent here”。在手机上,这个窗格绘制为全屏面板,但 `main` 上还没有可以打开它的触控入口。 | -| **卡片的卡内对话**(`sys.chat`,`crates/shell/src/glance_chat.rs`) | 应用发布的一张 glance 卡片 | 用户在卡片的对话里输入。只有发布卡片的应用自己的 Agent 会回答,它的回复标为 AI 撰写([见下文](#卡片与提问))。 | -| **应用自己的界面** | 原生模块的 `open_conversation`、脚本应用的 `octos.session.open`、进程应用的 peer link | 在应用内。Rinx 绘制自己的助手界面;系统应用(新闻、邮件、日历)都不绘制对话界面,所以对它们来说,入口就是这个面板和它们的卡片。 | +| **卡片的卡内对话**(`sys.chat`,`crates/shell/src/glance_chat.rs`) | 声明了对话的 glance 卡片 | 用户在卡片中输入,由发布卡片的应用自己的 Agent 回答,回复标为 AI 撰写。当前可用情况和演示见[卡内对话](#卡内对话)。 | +| **应用自己的界面** | 原生模块的 `open_conversation`、脚本应用的 `octos.session.open`、进程应用的 peer link | 在应用内。Rinx 绘制自己的助手界面;系统应用都不绘制对话界面,所以对它们来说,入口就是 “Ask ” 面板。 | “Ask ” 面板的行为: @@ -231,10 +237,36 @@ sequenceDiagram ### 卡片与提问 -- **Glance 卡片**(`crates/shell/src/glance.rs`):拥有 `glance` 权限的应用用 `glance.publish`(以及 `glance.withdraw`、`glance.list`)以自己的身份发布卡片:Shell 从调用方取得发布者,从不读取参数里的发布者。卡片要么是由 `data` 填充的 L0 `source`(只有呈现,由 Octoscript 的 L0 检查器检查),要么是 Splash `script`。限制:每个应用每分钟发布 6 次、最多保留 4 张卡片,总共保留 32 张,按优先级再按时间显示 6 张。以 `notify` 发布的卡片还会发出一条通知:桌面端点击 toast 会在单独的卡片窗口中打开这张卡片(`glance_sheet.rs`),每来一张新卡片 glance 面板(`glance_panel.rs`;顶栏的铃铛、F9)都会打开;手机上点通知栏里的通知会打开 glance 页面。 -- **交互式卡片**([#153](https://github.com/OctoSense-org/OctoSense/pull/153)):应用的 glance 卡片在应用自己的策略下运行,与应用界面在 Card runner 中一样。用户在卡片上的操作是应用自己的操作,经过应用的能力闸门和宿主服务,而不是 Agent 的工具调用,因此不需要额外的 Shell 审批。 -- **卡内对话**([#263](https://github.com/OctoSense-org/OctoSense/pull/263)):L0 卡片可以声明 `sys.chat(app, thread, fields)` 并绘制 `ChatEntry` 行,也可以显示模型写的文字(`class: model-copy`),这些文字标为 AI 撰写,且从不被当作操作执行。对话记录归宿主所有([`crates/l0-chat`](crates/l0-chat/README.md)、`crates/shell/src/glance_chat.rs`):只能与发布卡片的应用自己的 Agent 对话,只有用户亲手输入的内容才记为用户的话,Agent 在用户的通道里回答。对话按线程保存在应用的账号文件夹中(`apps//accounts//chat/.json`)。 -- **提问**(octos 的 `ask_user_question`)按这一轮的触发方路由:来自用户通道(或应用)的一轮在应用的对话中提问,来自系统 Agent 通道的一轮在系统对话中提问。只有用户能回答,而且只能在 Shell 的界面上回答。 +#### 发布与打开卡片 + +拥有 `glance` 权限的应用通过 `glance.publish` 以自己的身份发布卡片,也可以使用 `glance.withdraw` 和 `glance.list`。Shell 从调用方取得发布者,从不读取参数中的发布者。卡片可以是由 `data` 填充的 L0 `source`(只用于呈现,由 Octoscript 的 L0 检查器检查),也可以是 Splash `script`。 + +每个应用每分钟最多发布 6 次、保留 4 张卡片。Shell 总共保留 32 张,按优先级、再按时间显示 6 张。详见 [`glance.rs`](crates/shell/src/glance.rs)。 + +| 界面 | 行为 | +| --- | --- | +| 桌面面板 | 新卡片会打开 glance 面板,除非已有卡片窗口打开。顶栏铃铛或 F9 也可以打开面板。 | +| 桌面通知 | 以 `notify` 发布的卡片还会弹出 toast。点击 toast 会在独立窗口中打开卡片。面板打开时,toast 叠放在面板左侧。 | +| 桌面关闭操作 | 每张卡片都有移除按钮:`glance::dismiss` 会移除卡片,效果如同应用撤回了它。面板本身另有关闭按钮。 | +| 手机 | `notify` 在通知栏发出通知,点击后打开 glance 页面。 | + +桌面界面实现在 [`glance_panel.rs`](crates/shell/src/glance_panel.rs)、[`glance_sheet.rs`](crates/shell/src/glance_sheet.rs) 和 [`notifications.rs`](crates/shell/src/shell/notifications.rs) 中(`keep_clear_of`,[#273](https://github.com/OctoSense-org/OctoSense/pull/273))。 + +#### 交互式卡片 + +卡片在应用自己的策略下运行,与应用界面在 Card runner 中一样。用户在卡片上的操作经过应用的能力闸门和宿主服务。这属于应用操作,因此不需要额外进行 Agent 工具调用的 Shell 审批([#153](https://github.com/OctoSense-org/OctoSense/pull/153))。 + +#### 卡内对话 + +**当前可用情况:**`main` 上应用 Agent 发布的卡片都没有声明对话。唯一带对话的内置卡片是 [`mail-request.card`](crates/shell/resources/glance/mail-request.card),通过 `OCTOSENSE_GLANCE_DEMO=mail` 启用,使用固定的演示回复。 + +L0 卡片可以声明 `sys.chat(app, thread, fields)` 并绘制 `ChatEntry` 行。它也可以显示模型撰写的文字(`class: model-copy`),这些文字会标为 AI 撰写,且从不作为操作执行([#263](https://github.com/OctoSense-org/OctoSense/pull/263))。 + +对话记录归宿主所有。只有发布卡片的应用自己的 Agent 可以回答,回答在用户通道中进行;只有用户亲手输入的内容才会记为用户的话。线程保存在 `apps//accounts//chat/.json`。详见 [`crates/l0-chat`](crates/l0-chat/README.md) 和 [`glance_chat.rs`](crates/shell/src/glance_chat.rs)。 + +#### 提问 + +提问(`ask_user_question`)按这一轮的触发方路由。来自用户通道或应用的回合在应用对话中提问;来自系统 Agent 通道的回合在系统对话中提问。只有用户能回答,而且只能在 Shell 界面上回答。 ## 目录结构 diff --git a/apps/README.md b/apps/README.md index 9a332793..30e69033 100644 --- a/apps/README.md +++ b/apps/README.md @@ -391,8 +391,9 @@ model lane and tools. Which system apps have one, and how - **Talking to it yourself.** The person can chat with the app's agent directly, not only through the system agent: in the "Ask " panel, which the shell draws for every app with an agent (none of these apps - draws a chat of its own), or in a card's in-card chat. Those turns run - in the person's lane, beside the system agent's, with the app's tools. + draws a chat of its own). Those turns run in the person's lane, beside + the system agent's, with the app's tools. For the separate `sys.chat` + feature, see [in-card chat availability](../README.md#in-card-chat). The panel's Stop stops only the person's own turn. On the phone no touch control opens the panel yet. See the root [README](../README.md#talking-to-an-apps-agent-yourself). @@ -414,8 +415,6 @@ model lane and tools. Which system apps have one, and how is published with `notify` through the shell's `glance` service as the app (the app needs the `glance` capability). The model only supplies the text; it never writes card code. - A card can hold an in-card chat with the app's own agent (`sys.chat`, - [`../crates/l0-chat`](../crates/l0-chat/README.md)). - **Trying it** on the desktop: open the assistant (F8) and ask the system agent to have an app's agent (Mail, Calendar, News, Photos, Maps or YouTube) put a card on the glance screen; diff --git a/apps/README.zh-CN.md b/apps/README.zh-CN.md index 29c98f05..81bd86d9 100644 --- a/apps/README.zh-CN.md +++ b/apps/README.zh-CN.md @@ -339,9 +339,10 @@ Shell 把日历 Agent 的 `calendar.*` 工具当作这个系统应用自己的 然后把 peer 的 slug 交给系统 Agent,让请求在同一轮里继续。只有系统 Agent、用户或卡片的卡内对话发起请求时才会 开始一轮:还没有触发器或定时任务(ADR 0002 M3,计划中)。 - **直接与它对话。** 用户可以直接与应用的 Agent 对话,而不只是通过系统 Agent:在 Shell - 为每个拥有 Agent 的应用提供的 “Ask ” 面板里(这些应用都不绘制自己的对话界面), - 或在卡片的卡内对话里。这些回合在用户的通道里运行,与系统 Agent 的通道并列,带着应用的 - 工具。面板的“停止”只停止用户自己的回合。手机上还没有打开这个面板的触控入口。详见根目录的 + 为每个拥有 Agent 的应用提供的 “Ask ” 面板里(这些应用都不绘制自己的对话界面)。 + 这些回合在用户的通道里运行,与系统 Agent 的通道并列,带着应用的工具。 + 独立的 `sys.chat` 功能见[卡内对话的可用情况](../README.zh-CN.md#卡内对话)。 + 面板的“停止”只停止用户自己的回合。手机上还没有打开这个面板的触控入口。详见根目录的 [README](../README.zh-CN.md#直接与应用的-agent-对话)。 - **它的工具在应用的宿主服务上运行**,以应用的身份运行,在此之前 Shell 的中转已检查授权、 schema 和预算。octos 只对破坏性和对外的工具请求审批(这里是 `calendar.remove_event`), @@ -354,8 +355,7 @@ Shell 把日历 Agent 的 `calendar.*` 工具当作这个系统应用自己的 `card_id` 会替换该应用之前的通知。邮件和新闻的服务把 `notify` 交给 Shell;照片、地图、YouTube 和相机没有自己的服务,由 Shell 的通知服务应答。`calendar.notify` 和 `calendar.agenda` 填充日历 自己的日程卡片和议程卡片。每张卡片都以应用的身份、带 `notify` 通过 Shell 的 `glance` 服务发布 - (应用需要 `glance` 权限)。模型只提供文字,从不编写卡片代码。卡片里可以有与应用自己的 Agent 的卡内对话 - (`sys.chat`,[`../crates/l0-chat`](../crates/l0-chat/README.md))。 + (应用需要 `glance` 权限)。模型只提供文字,从不编写卡片代码。 - **试一试**(桌面端):打开助手(F8),请系统 Agent 让某个应用的 Agent(邮件、日历、新闻、照片、 地图或 YouTube)在 glance 屏幕上放一张卡片;在弹出的面板上允许该 Agent。邮件需要一个已登录的账户(下文的演示邮箱即可)。 邮件更完整的操作卡片([计划(英文)](mail/docs/2026-10-01-email-action-card-plan.md))目前只是 diff --git a/docs/images/agents-card-flow.png b/docs/images/agents-card-flow.png index 83b96f0c..2525c2f5 100644 Binary files a/docs/images/agents-card-flow.png and b/docs/images/agents-card-flow.png differ