merge: integrate remote main
This commit is contained in:
@@ -9,12 +9,15 @@
|
||||
| Code-owned official Plugin activation | System-included Data Service or Account Library entry for Game Resource / Project Scaffold | existing delivery/acquisition + project enablement + exact MakeLore resource package | Delivery/acquisition and project enablement remain separate. Once enabled, all three identities enter every parent Agent without assignment; child Agents remain empty. No device download, update, Beta, artifact signature, or device-uninstall action exists for these code-owned identities. Project Scaffold may execute only its bundled `.mjs`; historical Hosted Web Search entries are ignored. |
|
||||
| Selected-model Web Search | Parent Pi turn with an explicitly supported selected model | `makelore_web_search` core tool → frozen model/provider/credential request with provider-native forced search → ordinary model response/usage | No Marketplace Release, Account Library, Admission, Hosted Web Search client, Plugin Charge, or `agent_browser` fallback participates. Unsupported selected models expose no tool; child workers receive none. |
|
||||
| Conversation-driven Device Package install | Agent tool inspects npm/Git/absolute local Plugin/loose Skill source | Main preview → distinct later user confirmation → immutable device-package generation → new/idle parent worker resources | Renderer has no install picker. Lifecycle scripts never run. Pi extensions and non-empty Skill `scripts/` are disclosed as desktop-user executable code before confirmation. Active workers retain their frozen generation until the turn settles; child workers remain empty. |
|
||||
| Effective Plugin worker snapshot | Installed trusted package or code-owned official definition + project selection + applicable Agent assignments + current server policy | effective resolver → Registry/resource loader/Extension Host/tool catalog → parent Pi worker | One frozen snapshot supplies Skills, tools, package roots, and runtime authorization. Data Service, Game Resource, and Project Scaffold derive their applicable resource set directly from project enablement; assignments remain authoritative only for other Plugin identities that use that scope. Disable, account/project switch, logout, Renderer crash, Main shutdown, or worker generation change invalidates future actions without mutating persisted unknown assignments; child workers receive no Plugin projection. |
|
||||
| Hosted Game Resource operation and delivery | Eligible parent `makelore.game-resource` generate call plus one explicit confirmation | frozen Plugin adapter → Main delivery coordinator → one `GameResourceClient` submission → internal status polling → all terminal downloads → `assets/generated/game-resource/<executionId>/` in the frozen original project | Server policy owns pricing, payer, Admission and Provider receipt state; Main owns the durable local delivery receipt and filesystem. `submission_unknown` is not replayed as a fresh request. Restart/retry resumes download/save only, the shared project write lease is held only during terminal materialization, and the Agent receives one progress/result card rather than status/save tools or a second confirmation. |
|
||||
| Effective Plugin worker snapshot | Installed trusted package or code-owned official definition + project selection + applicable Agent assignments + current server policy | effective resolver → Registry/resource loader/Extension Host/tool catalog → parent Pi worker | One frozen snapshot supplies Skills, tools, package roots, and runtime authorization. Data Service、Game Resource 与 Project Scaffold 直接按项目启用状态取得资源;Agent assignment 只对采用该范围的其他 Plugin 保持权威。Disable、账号/项目切换、logout、Renderer crash、Main shutdown 或 worker generation 变化会使后续动作失效,但不改写持久化的未知 assignment;child worker 不接收 Plugin 投影。 |
|
||||
| Plugin workspace navigation | Project Configuration `插件` ResourceCard or compatibility URL | `/project-config/plugins` → Project Configuration remains mounted → same-page wide Plugin sheet → unified Plugin stores/Main routes | Code sidebar has no standalone Plugin entry. `/plugins` and old Plugin URLs only preserve query/filter intent while redirecting; embedding does not merge acquisition, install, project enablement, assignment, runtime authorization, or billing lifecycles. |
|
||||
| Hosted Game Resource operation and delivery | Eligible parent `makelore.game-resource` generate call plus one explicit confirmation | frozen Plugin adapter → Main delivery coordinator → one `GameResourceClient` submission → internal status polling → all terminal downloads → `assets/generated/game-resource/<executionId>/` in the frozen original project | Server policy owns pricing、payer、Admission 与 Provider receipt state;Main owns the durable local delivery receipt and filesystem. `submission_unknown` 不会作为新请求重放。重启或重试只恢复下载/保存,共享项目写租约仅在终态落盘期间持有;Agent 只收到一张进度/结果卡片,不暴露 status/save 工具,也不要求第二次确认。 |
|
||||
| 桌面认证生命周期 | Renderer 登录、刷新与注销请求 | Host API → Main Works Session → Works Square `/api/auth/{login,mobile-login,refresh,logout}` → one-feel auth | Main 加密持有并先持久化轮换 token;客户端不携带 OAuth client secret;连续 7 天未使用才清除会话,终止性 `400`/`401` fail closed |
|
||||
| 用户模块入口策略 | 会话恢复 / 登录 / 刷新 | Electron Main → Works `/api/auth/me` → 四布尔安全投影 → Renderer auth store → 卡片/路由/provider gate | 缺失对象或字段默认 `true`;`design` 映射 `painting`;终止性 `401` 清理 Main/Renderer 会话;全局 `/settings` 不受 Code gate |
|
||||
| 项目创建 | 新建项目对话框 | Host API → Main 项目初始化 | 固定 `interactive_ai_app` 或 `custom`,只生成 `.makelore/project.json` 与 `knowledge/`;历史双类型在读取边界归一,不因读取改写 |
|
||||
| 显式项目脚手架 | 用户在已获取且项目启用的 Project Scaffold Plugin 下明确要求初始化 | Main-owned effective resolver 自动向该项目父 Agent 提供 Skill → Pi `bash` + 项目 write lease → `MAKELORE_NODE_EXECUTABLE` → bundled `makelore-project-scaffold` 脚本 | 不要求伙伴分配;child 仍为空。固定六文件目标;全量预检、不覆盖、受控失败只回滚本次路径;不安装依赖、不联网、不构建、不上传、不提审;下载 artifact 不参与 |
|
||||
| Account Token Points V2 | 已登录账号菜单、窗口 focus 或重新可见 | Renderer → Main `/api/works/billing/points` → Works Square `/api/billing/points` → safe balance projection | 可管理会员的账号获得规范字符串点数与套餐/周期元数据;非管理者的精确字段全部置空,只投影 `shared_available`、共享/青少年类型和升级责任。旧 rolling-window usage API 与 stale event 不再参与。 |
|
||||
| 用户模块入口策略 | 会话恢复 / 登录 / 刷新 | Electron Main → Works `/api/auth/me` → 三布尔安全投影 → Renderer auth store → 卡片/路由/provider gate | 缺失对象或字段默认 `true`;`design` 映射 `painting`;额外旧字段被忽略;终止性 `401` 清理 Main/Renderer 会话;全局 `/settings` 不受 Code gate |
|
||||
| 项目创建 | 新建项目对话框中的目录选择 | Renderer 内部默认 `interactive_ai_app` → Host API → Main 生成 UUID 并原子初始化 | 普通用户不选择类型、模板或项目身份;只生成 `.makelore/project.json` 与 `knowledge/`,随后直接进入 `/chat`。既有 `custom`/历史类型和底层兼容入口仍保留 |
|
||||
| 旧项目身份补齐 | 有效 `.makelore/project.json` 仅缺 `projectId` | Main serialized config read/repair → canonical UUID persisted once | 并发读取共享同一次修复;原始 UUID、bind/independent-copy 控件不进入普通 UI。其他缺失或无效 metadata 仍是配置错误;`initialized` 不阻断有效项目 |
|
||||
| 显式项目脚手架 | 用户在已获取且项目启用的 Project Scaffold Plugin 下明确要求初始化 | Main-owned effective resolver 自动向该项目父 Agent 提供 Skill → Pi `bash` + 项目 write lease → `MAKELORE_NODE_EXECUTABLE` → bundled `makelore-project-scaffold` 脚本 | 不要求伙伴分配,也不是项目创建或聊天前置条件;child 仍为空。固定六文件目标;全量预检、不覆盖、受控失败只回滚本次路径;不安装依赖、不联网、不构建、不上传、不提审;下载 artifact 不参与。 |
|
||||
| 一键提交 | `ProjectPublishAction` | Renderer capability → Host API → Main 本地 npm/Vite build → built snapshot preflight → source+built+contract 上传 | 只对规范交互式 AI 应用(含读取时归一的历史别名)开放;首次 create 通过单一 multipart 合同原子提交文字资料与必选 PNG/JPEG/WebP 封面,创建失败或冲突不上传版本;已有 draft/published 只提交版本并沿用云端资料/封面,不做无条件 metadata PATCH |
|
||||
| 构建产物预检 | Main-owned built snapshot | 一次性 loopback origin → fresh Electron WebContents/CDP(桌面、移动) | 检查错误、白屏和外域;不调用 Playwright,检查与上传归档相同字节,但不产生可信 receipt |
|
||||
| 提交绑定 | 云端成功上传响应 | Main → submission binding v2 | 只持久化成功的 app/version/review/hash;落盘失败返回固定告警但不反转提交 |
|
||||
@@ -27,18 +30,18 @@
|
||||
| AI 编程上下文压缩 | Renderer compact action / Pi compaction events | correlated compact RPC → target projector → Snapshot/Patch timeline | Pi `0.84.2` 的手动 compact 不发 `agent_settled`;RPC success 或权威 compaction failure 终结 compact 并 exactly-once 释放对应 ownership,不提前结算普通 prompt |
|
||||
| AI 编程 Provider 错误 | Pi logical-thread Provider 请求 | selected thread-local credential store → Main AI proxy → Works 模型上游 → projector safe error | 确定性的 Works user-context 缺失使缓存 gateway credential 过期、返回非重试认证失败且不重放请求;Renderer 只看到固定 Provider-auth 提示,不能把它解释为 Pi 崩溃 |
|
||||
| AI 编程子 Agent | parent logical thread `subagent.v1` tool call | explicit extension → authenticated Main bridge → scheduler → independent ephemeral Pi child process | child 并发最多 4、单次最多 8、禁止递归;child 使用 FIFO 进程预算 8,shared parent 逻辑线程不各占一个 process lease;coding child 与 parent 共用项目 write lease,父 abort/crash/generation 失效必须清理 child 与 permit |
|
||||
| 共享开发浏览器 | 用户面板打开或 parent Agent `agent_browser open` | 当前项目身份 → Main-owned browser route/module → sandboxed `WebContentsView` + bounded CDP → 同一 Renderer 右侧 viewport/Console/Network | Agent 发起打开后先通知 Renderer 展示并最多等待 5 秒取得当前 generation 的可见 bounds;项目 id 仅允许具备 Renderer capability 的请求使用。非 Web、文件注入、跨目标及宿主级 CDP 被拒绝;诊断 owner 释放到零后停止采集。 |
|
||||
| 客户端更新检查 | 设置页 | Renderer update store → IPC → Main AppUpdater → 目标 feed | Main 记录并重抛原始错误;Renderer 只显示去重、脱敏的单条提示,稳定源缺包不伪装为最新版 |
|
||||
| Design Workspace load | Canvas/Sidebar | Renderer Host API → Main-owned Works Square V2 adapter → current Workspace/Direction/Living Form projection | 一个 Workspace 公开一个 current Direction 与 persistent Agent Session;conversation timeline 是交互历史,不是独立 authority object |
|
||||
| Design Workspace load | Canvas 中央区与右侧 Works rail | Renderer Host API → Main-owned Works Square V2 adapter → current Workspace/Direction/Living Form projection | 一个 Workspace 公开一个 current Direction 与 persistent Agent Session;右 rail 只选择/创建/删除 Workspace,conversation timeline 是交互历史,不是独立 authority object |
|
||||
| Design input and reconciliation | Chat/direct edit/decision/proposal/lock/Asset binding/restore | Renderer draft → Main → `design.input.apply` → canonical Direction projection | 全部进入同一 reducer;accepted 前 draft 保持本地,revision conflict 刷新权威投影,unknown result 复用原 command/operation identity |
|
||||
| Design activity and reply streaming | Direction Gateway journal | Main 固定活动阶段归一化 → Renderer operation-scoped activity;committed assistant delta → matching provisional assistant bubble → canonical Turn | `design.assistant.progress` 只显示在对应 optimistic user message 下方,不成为消息或右侧摘要;`design.assistant.delta` 只投影已提交回复。两者都按 Workspace、Direction、operation identity 和 replay cursor 收敛,均不改写 Specification |
|
||||
| 设计有限请求生命周期 | Renderer Workspace JSON 调用 / shared Works token refresh | Main deadline → Electron transport → safe-read-only Node fallback → Host API timeout envelope | 包括取凭据、请求头和响应 body 的完整生命周期最多 30 秒;超时 abort transport 并稳定返回 `504 DESIGN_WORKSPACE_REQUEST_TIMEOUT`;透明 fallback 只允许 `GET`/`HEAD`/`OPTIONS`,mutation 不隐式重放 |
|
||||
| Design Asset binding | 当前 Workspace 已完成图片 / 本地上传 | canonical Asset → typed `asset_binding` input → Current Specification revision | 图片/视频用途由 Specification medium 和 binding role 决定;只提交真实 Workspace Asset identity,不使用本地路径或自然语言占位 |
|
||||
| Design reference alias editing | Active plan 的 final Prompt 与 binding-only reference row | `@图片N` token/add/replace/remove → typed field/collection operations → Current Specification revision | Prompt 决定图片如何参与生成;row 只管理稳定 reference/Asset identity。未绑定 alias 定点要求上传并阻止 Quote;删除时原子移除 binding 并重排后续 alias,既有 alias 不重复插入 |
|
||||
| Design Quote and confirmation | 当前 exact Specification revision | `design.quote.request` → immutable public Quote projection → `design.generation.confirm` with Quote ID | Renderer 只展示 output summary、warnings、expiry、Token Points;Provider Prompt/model/route/storage/internal billing 不下发或编辑 |
|
||||
| Design Task and Asset sync | Direction event stream / Workspace resource events / explicit refresh | Renderer Task/Asset projections | Task/Asset events独立于 Living Form;transport order 和 progress 不改写 Specification,也不授权新生成操作 |
|
||||
| 设计项目删除 | Canvas 侧栏精确项目名确认 | Renderer → Main Host API → Works Square Workspace DELETE | 删除成功后清理当前 Workspace/Direction/resources 并选择最近更新的剩余项目;结算与软删除语义由服务端负责 |
|
||||
| Prompt Museum 浏览与使用 | Canvas 侧栏“获取灵感” | Renderer → Main Host API → Works Square list/detail;选中 Prompt → 进程内 pending state → 当前 Canvas 输入框 | 只发送白名单筛选/游标;Works Token 留在 Main,Prompt 不自动发送,Museum 不包含客户端静态数据集 |
|
||||
| Learning 项目浏览 | Learning 项目列表 / README 详情 | Renderer → typed Host API → Main fixed list/detail routes → Works Square published projects;README 图片节点 → 远程 HTTPS origin | 保留登录与 `module_access.learning`;Main 严格投影分页项目 DTO,README 禁用原始 HTML,仅图片节点可直连无凭据 HTTPS URL;封面和历史媒体仍使用受控媒体读取 |
|
||||
| Learning 项目下载 | README 详情页“下载项目” | Renderer → Host API → Main 原生保存对话框 → Works archive stream → 临时文件 → 原子重命名 | 不校验 `Content-Length`、`archiveBytes`、实际流字节数或客户端大小上限;最多五跳同 Works origin 重定向且不向重定向请求携带 Bearer;SHA-256 与 ZIP 签名匹配后才保存,Renderer 只得到 `saved` 或 `cancelled` |
|
||||
| 历史 Prompt Museum URL | `/image-prompts/*` | App replace-redirect → `/image-canvas` | 当前 Canvas 无“获取灵感”入口,App 不挂载或 lazy-load Museum 页面;保留的 Main API/auth/media 与 shared DTO 是 dormant 兼容/安全基础设施 |
|
||||
| Robot 引导式热点配网 V1(已实现、默认开启) | Robot Binding 页面 | 用户选择引导配网 → 进入固件配网模式 → Renderer 经 Host API 请求 Main 扫描 → 用户选择短效候选 → Windows/macOS Adapter 连接并核验当前 SSID → Main 打开固定 Portal → 用户在 Portal 配置 Wi-Fi → 电脑恢复互联网 → 现有六位 Binding | 精确环境值 `0` 或 capability 读取失败回退直接六位码;系统 Wi-Fi 保留兜底,Makelore 不收集 Wi-Fi 密码、不修改固件,热点发现/`bound` 都不等于可信身份或 online/ready |
|
||||
|
||||
## State Ownership
|
||||
@@ -46,13 +49,14 @@
|
||||
- Main 持有刷新凭据、发布 Token、固定 npm runtime、源码/构建归档、临时目录、幂等键和 submission binding v2;Renderer 不持有归档路径、构建 origin 或自动部署状态。
|
||||
- 项目内 `.makelore/project.json` 是 `ProjectType`、Agent 与 Coding 项目配置的唯一权威;Main 在配置写入和目录复用时保持 `ProjectType` 不可变,并在打包时重新读取校验。历史 `mini_game` / `mini_program` 只在内存中归一为 `interactive_ai_app`,读取和脚手架运行不改写原文件。
|
||||
- Renderer 仅持有短效公开会话状态和提交展示状态。
|
||||
- Renderer 可持久化当前账号的四布尔模块入口策略,但不持有原始 Works profile 或 Token。新账号不继承上一账号缓存;网络/暂时上游失败可保留同会话已知策略,终止性 `401` 不得回退到默认开启。
|
||||
- Renderer 可持久化当前账号的三布尔模块入口策略,但不持有原始 Works profile 或 Token。新账号不继承上一账号缓存;网络/暂时上游失败可保留同会话已知策略,终止性 `401` 不得回退到默认开启。
|
||||
- 本地构建临时目录、HTTP origin 和预检 WebContents/partition 只属于一次调用;预检读取与 `built_archive` 相同的内存字节,但结果不写为可信上传 receipt,也不覆盖生产 opaque-origin。
|
||||
- 旧 schema v1 `submitted` 记录迁移并保留;旧 `armed`、`waiting_for_package`、`waiting_for_login`、`uploading`、`failed` 归一为 `legacy_retired`,不再启动 watcher 或上传任务。
|
||||
- AI Design Current Specification 与 current Direction 是语义权威;conversation timeline 只保存交互历史,immutable Quote 绑定精确 Specification revision,Task/Asset 属于 Workspace resource projection。
|
||||
- AI 绘画 Main 持有 Workspace 请求 deadline、底层 transport fallback 和共享 Works token refresh flight。共同等待者必须在同一有限期限内 settle,refresh flight 结束后必须释放,后续刷新可重新发起;底层 mutation transport failure 不得自动产生第二次上游请求。
|
||||
- Prompt Museum pending Prompt 是 Renderer 进程内一次性导航状态;Canvas 消费后立即清除,不进入 Workspace/Specification,直到用户主动提交 Design input。
|
||||
- Learning 不再维护客户端课程库、生成任务、player registration、进度或 runtime 状态。Main 在一次下载调用内持有当前账号快照、Works 凭据、保存路径和临时文件;账号变化或校验失败会中止并清理临时文件。历史课程数据不会被新逻辑读取,也不会自动删除。
|
||||
- 旧 Prompt Museum Store/API 不参与当前 Renderer 导航或 Canvas 状态;保留代码不得被解释为可达产品流程。
|
||||
- Retired Learning data is outside the active client state model. Historical downloaded
|
||||
course data is not read, migrated, or automatically deleted.
|
||||
- 图生图参考图与视频首帧都先归一为当前 Workspace Asset,再通过 typed binding 写入 Specification;本地路径不会进入 canonical contract。
|
||||
- Development 与 packaged Canvas 都使用 Main-owned Works Square V2 adapter。V1 DTO/local semantic adapter 与 local/cloud mode switches 已删除,不存在失败回退。
|
||||
- 注销和退出关闭本地 event stream、清除 drafts/pending state 和凭据;服务端 current Direction Session 与 semantic history 保持持久化。
|
||||
@@ -70,14 +74,13 @@
|
||||
## External Interfaces
|
||||
|
||||
- Works Square 项目创建、版本上传、构建状态与 Release 状态 API。
|
||||
- Works Square `/api/auth/me` 模块权限 API;Electron Main 持有 Bearer 并只向 Renderer 投影 `programming`/`design`/`learning`/`robot` 对应的四个布尔值。
|
||||
- Works Square `/api/auth/me` 模块权限 API;Electron Main 持有 Bearer 并只向 Renderer 投影 `programming`/`design`/`robot` 对应的三个布尔值,额外旧字段被忽略。
|
||||
- 本机 Host API 的发布路由;发布路由要求 Renderer capability。
|
||||
- 本机 `/api/coding/*` project/Agent/Conversation、Snapshot/patch-batch SSE、prompt/compact/fork/recover、attachment/file/interaction/diagnostics 路由,以及 Main-owned AI 模型代理。
|
||||
- Main-owned electron-updater IPC 与 Works Square 平台/架构稳定 feed;正式安装产物发布不由 Renderer 控制。
|
||||
- 服务端安全投影后的公共 `play_url`;只接受同源 HTTPS、精确 App 路径和可信版本状态。
|
||||
- Works Square Design V2 Workspace/Direction/Living Form API、持久 Agent Gateway Session、Direction event stream,以及 `design.input.apply`、`design.quote.request`、`design.generation.confirm` stable-operation contract。
|
||||
- Works Square Prompt Museum list/detail API;Main 添加当前账号 Bearer Token,Renderer 只使用 Host API 投影。
|
||||
- Works Square Learning project list/detail/media/archive API;Main 添加当前账号 Bearer Token,并限制固定路径、DTO、封面/历史媒体 MIME/大小、归档重定向、摘要和 ZIP 签名;归档大小字段只作展示,不参与下载门禁。README 中经服务端校验的无凭据 HTTPS 图片由 Renderer 图片节点直接请求。
|
||||
- Dormant Works Square Prompt Museum list/detail/media compatibility API;Main 继续持有 Bearer 与媒体校验,当前 App 没有可达 Renderer 消费者。
|
||||
- 已实现的本机 Robot provisioning capability、固定 portal-open 与 hotspot scan/connect Host API。它们是本地 Main 操作,不读取 Works access token、不调用上游,也不接受任意 URL/SSID/BSSID/interface/profile。
|
||||
|
||||
## Last Updated
|
||||
|
||||
Reference in New Issue
Block a user