@x-otto/interchange 0.1.0-alpha.0 → 0.1.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,13 +1,13 @@
1
- # @otto/interchange
1
+ # @x-otto/interchange
2
2
 
3
3
  > Provider-neutral protocol type single source of truth. Message, StreamEvent, Model, Tool, Session Event types — zero dependencies.
4
4
 
5
- `@otto/interchange` (formerly `@otto/protocol`, renamed/merged) is the zero-dependency pure type leaf package that defines the canonical protocol types shared across the entire monorepo: `Message`, `StreamEvent`, `Model`, `Usage`, `ToolCall`, `AgentSessionEvent`, `GrillQuestion`, sigil input types, and more. Every package that deals with LLM provider communication, session events, or user input contracts imports from here.
5
+ `@x-otto/interchange` (formerly `@x-otto/protocol`, renamed/merged) is the zero-dependency pure type leaf package that defines the canonical protocol types shared across the entire monorepo: `Message`, `StreamEvent`, `Model`, `Usage`, `ToolCall`, `AgentSessionEvent`, `GrillQuestion`, sigil input types, and more. Every package that deals with LLM provider communication, session events, or user input contracts imports from here.
6
6
 
7
7
  ## Installation
8
8
 
9
9
  ```bash
10
- pnpm add @otto/interchange
10
+ pnpm add @x-otto/interchange
11
11
  ```
12
12
 
13
13
  ## Usage
@@ -26,8 +26,8 @@ import type {
26
26
  NormalizedImage,
27
27
  SigilEntry,
28
28
  SigilKind,
29
- } from '@otto/interchange'
30
- import { hasToolCalls, normalizeImageData, sigilOf } from '@otto/interchange'
29
+ } from '@x-otto/interchange'
30
+ import { hasToolCalls, normalizeImageData, sigilOf } from '@x-otto/interchange'
31
31
 
32
32
  // Inspect a message for tool calls
33
33
  const msg: AssistantMessage = { role: 'assistant', content: [...] }
package/dist/index.d.ts CHANGED
@@ -164,7 +164,7 @@ interface ToolResultMessage<T extends unknown = unknown> {
164
164
  }
165
165
  /**
166
166
  * RFC-144 M1:mid-conversation system 通知消息——**真正进 provider 请求**的协议消息类型
167
- * (区别于 `@otto/hook-contracts` 的 `SystemAgentMessage`,后者是 hooks/UI 域、
167
+ * (区别于 `@x-otto/hook-contracts` 的 `SystemAgentMessage`,后者是 hooks/UI 域、
168
168
  * convertToLLM 类型边界显式过滤、绝不进 provider 请求)。
169
169
  *
170
170
  * 用途:lifecycleAsync 工具(RFC-144)真正完成时,追加一条独立消息告知 LLM"运营方观察到
@@ -198,14 +198,14 @@ interface SystemNotificationMessage {
198
198
  type Message = UserMessage | AssistantMessage | ToolResultMessage | SystemNotificationMessage;
199
199
  /**
200
200
  * 历史压缩摘要消息的标记前缀——单一真相源(跨包协议常量)。
201
- * 生产者 @otto/memory 注入摘要消息时用、压缩去重(isSummaryMessage)时识别;消费者
202
- * @otto/agent 的 ContextPipeline 从会话树恢复摘要时用同一前缀重建摘要消息。放在协议叶子,
201
+ * 生产者 @x-otto/memory 注入摘要消息时用、压缩去重(isSummaryMessage)时识别;消费者
202
+ * @x-otto/agent 的 ContextPipeline 从会话树恢复摘要时用同一前缀重建摘要消息。放在协议叶子,
203
203
  * 避免双份字面量漂移导致 isSummaryMessage 失配。
204
204
  */
205
205
  declare const CONVERSATION_SUMMARY_PREFIX = "[Conversation Summary]";
206
206
  /**
207
207
  * 从 assistant 消息的内容块中提取全部 tool_call 项(终局架构 review 2026-07-10 P0-3:
208
- * 从 @otto/ai 物理迁移——此前是 @otto/ai 唯一自己实现(非 re-export)的两个函数,只依赖
208
+ * 从 @x-otto/ai 物理迁移——此前是 @x-otto/ai 唯一自己实现(非 re-export)的两个函数,只依赖
209
209
  * AssistantMessage/ToolCall,真源本就该在协议叶子而非模型注册中枢)。
210
210
  */
211
211
  declare function getToolCallsByAssistantMessage(message: AssistantMessage): ToolCall[];
@@ -971,7 +971,7 @@ type AgentSessionEventMap = { [E in AgentSessionEvent as E['type']]: (event: E)
971
971
  /**
972
972
  * engine-command.ts — RFC-090:renderer→engine 命令协议
973
973
  *
974
- * `EngineCommand` 是可序列化的联合类型,engine/renderer 共享于 @otto/interchange。
974
+ * `EngineCommand` 是可序列化的联合类型,engine/renderer 共享于 @x-otto/interchange。
975
975
  * 硬上限 15 种 command kind。同进程 transport 无需序列化(直接函数调用);
976
976
  * 进程分离(RFC-091)后通过 stdin/stdout/WebSocket 传输。
977
977
  */
@@ -1007,7 +1007,7 @@ type EngineCommand = {
1007
1007
  }
1008
1008
  /**
1009
1009
  * RFC-303 D8 修正:`replacement` 运行时语义是 `AgentMessage[]`(会话压缩后的替换消息数组),
1010
- * 但 `AgentMessage` 定义在 `@otto/hook-contracts`(依赖本包 type-only),本包不能反向引用其
1010
+ * 但 `AgentMessage` 定义在 `@x-otto/hook-contracts`(依赖本包 type-only),本包不能反向引用其
1011
1011
  * 类型——故用 `unknown[]`(准确反映"数组"而非之前声明的 `string`)。此前声明为 `string` 是
1012
1012
  * 未被检查出的类型错误:发送侧靠 `as unknown as string` 双重断言掩盖真实值仍是数组;接收侧
1013
1013
  * `engine-main.ts` 曾用 `String(cmd.replacement)` 把数组转成 `"[object Object]"`,破坏数据
@@ -1037,9 +1037,9 @@ type EngineCommand = {
1037
1037
  //#region src/todo.d.ts
1038
1038
  /**
1039
1039
  * Todo 状态与条目 — 单一真源,供 write_todos 等工具跨层消费。
1040
- * 原在 @otto/orchestration-contracts 与本包各有一份逐字相同的镜像定义
1040
+ * 原在 @x-otto/orchestration-contracts 与本包各有一份逐字相同的镜像定义
1041
1041
  * (M-C 沉入 protocol 时未删旧副本,post-RFC-092 review F4 发现并归一)。
1042
- * @otto/orchestration-contracts/src/primitives.ts 现从本文件 re-export,不再自行定义。
1042
+ * @x-otto/orchestration-contracts/src/primitives.ts 现从本文件 re-export,不再自行定义。
1043
1043
  */
1044
1044
  type TodoStatus = 'pending' | 'in_progress' | 'done' | 'skipped' | 'failed';
1045
1045
  interface TodoItem {
@@ -1202,7 +1202,7 @@ interface SigilResolveContext {
1202
1202
  maxOutput: number;
1203
1203
  }
1204
1204
  /**
1205
- * 插件输入注册表(UI 无关,由 createApp() 创建单例,实现留 @otto/coding)。
1205
+ * 插件输入注册表(UI 无关,由 createApp() 创建单例,实现留 @x-otto/coding)。
1206
1206
  *
1207
1207
  * 静态 push 供给(register)+ 动态 pull 供给(registerProvider,服务 @file
1208
1208
  * 大候选集懒查,RFC §1.3.1 F-domain / RFC-044 M044-07)。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@x-otto/interchange",
3
- "version": "0.1.0-alpha.0",
3
+ "version": "0.1.0-alpha.1",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -25,4 +25,4 @@
25
25
  "test": "vitest run",
26
26
  "clean": "rm -rf dist"
27
27
  }
28
- }
28
+ }