pneuma-skills 2.9.0 → 2.9.2

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.
@@ -1,8 +1,8 @@
1
1
  /**
2
- * ClaudeCodeBackend — AgentBackend 的 Claude Code 实现。
2
+ * ClaudeCodeBackend — Claude Code implementation of AgentBackend.
3
3
  *
4
- * 包装 CliLauncher,实现标准 AgentBackend 接口。
5
- * Claude Code 协议为事实标准。
4
+ * Wraps CliLauncher and implements the standard AgentBackend interface.
5
+ * Uses the Claude Code protocol as the source of truth.
6
6
  */
7
7
 
8
8
  import type {
@@ -74,7 +74,7 @@ export class ClaudeCodeBackend implements AgentBackend {
74
74
  this.launcher.onSessionExited(cb);
75
75
  }
76
76
 
77
- /** SdkSessionInfo → AgentSessionInfo 映射 */
77
+ /** SdkSessionInfo → AgentSessionInfo mapping */
78
78
  private toAgentSessionInfo(info: SdkSessionInfo): AgentSessionInfo {
79
79
  return {
80
80
  sessionId: info.sessionId,
@@ -1,12 +1,12 @@
1
1
  /**
2
- * AgentBackend 契约测试
2
+ * AgentBackend contract tests
3
3
  *
4
- * 验证 AgentBackend 接口约束:
5
- * - 生命周期管理 (launch/kill/getSession)
6
- * - 能力声明完整性
7
- * - 协议适配器契约
4
+ * Validates AgentBackend interface constraints:
5
+ * - Lifecycle management (launch/kill/getSession)
6
+ * - Capability declaration completeness
7
+ * - Protocol adapter contract
8
8
  *
9
- * 基于 Claude Code 作为事实标准设计。
9
+ * Designed with Claude Code as the de facto standard.
10
10
  */
11
11
 
12
12
  import { describe, test, expect } from "bun:test";
@@ -18,7 +18,7 @@ import type {
18
18
  AgentProtocolAdapter,
19
19
  } from "../types/index.js";
20
20
 
21
- // ── Mock AgentBackend (模拟 ClaudeCodeBackend 的行为) ────────────────────────
21
+ // ── Mock AgentBackend (simulates ClaudeCodeBackend behavior) ─────────────────
22
22
 
23
23
  function createMockBackend(): AgentBackend {
24
24
  const sessions = new Map<string, AgentSessionInfo>();
@@ -90,7 +90,7 @@ function createMockBackend(): AgentBackend {
90
90
  };
91
91
  }
92
92
 
93
- // ── AgentBackend 生命周期 ────────────────────────────────────────────────────
93
+ // ── AgentBackend lifecycle ───────────────────────────────────────────────────
94
94
 
95
95
  describe("AgentBackend lifecycle", () => {
96
96
  test("launch creates a session in starting state", () => {
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Mode Loader — External mode registration tests
3
3
  *
4
- * 验证 registerExternalMode loadModeManifest 对外部 mode 的支持。
4
+ * Validates registerExternalMode and loadModeManifest support for external modes.
5
5
  */
6
6
 
7
7
  import { describe, test, expect } from "bun:test";
@@ -1,20 +1,20 @@
1
1
  /**
2
- * Mode Loader 测试
2
+ * Mode Loader tests
3
3
  *
4
- * 验证 mode 加载机制:
5
- * - 加载内置 mode 成功
6
- * - 加载未知 mode 报错
7
- * - 加载的 mode 符合 ModeDefinition 契约
4
+ * Validates mode loading mechanics:
5
+ * - Successfully loads built-in modes
6
+ * - Throws error for unknown modes
7
+ * - Loaded modes conform to the ModeDefinition contract
8
8
  */
9
9
 
10
10
  import { describe, test, expect } from "bun:test";
11
11
  import type { ModeDefinition } from "../types/index.js";
12
12
 
13
- // ── Mode Loader 本身还未实现,这里用 mock 定义预期行为 ─────────────────────────
13
+ // ── Mode Loader not yet implemented; using mocks to define expected behavior ──
14
14
 
15
15
  /**
16
- * Mock mode loader — 定义 loadMode 的预期行为。
17
- * 实际实现在 core/mode-loader.ts (v1.0 代码阶段创建)
16
+ * Mock mode loader — defines the expected behavior of loadMode.
17
+ * Actual implementation is in core/mode-loader.ts (created during v1.0 code phase).
18
18
  */
19
19
  const builtinModes: Record<string, ModeDefinition> = {};
20
20
 
@@ -35,7 +35,7 @@ function listModes(): string[] {
35
35
  return Object.keys(builtinModes);
36
36
  }
37
37
 
38
- // ── 辅助:创建最小合法 ModeDefinition ────────────────────────────────────────
38
+ // ── Helper: create minimal valid ModeDefinition ─────────────────────────────
39
39
 
40
40
  function createMockModeDefinition(name: string): ModeDefinition {
41
41
  return {
@@ -1,16 +1,16 @@
1
1
  /**
2
- * ModeManifest 契约测试
2
+ * ModeManifest contract tests
3
3
  *
4
- * 验证 ModeManifest 类型约束:
5
- * - 必填字段完整性
6
- * - 可选字段默认值语义
7
- * - 字段值的业务约束
4
+ * Validates ModeManifest type constraints:
5
+ * - Required field completeness
6
+ * - Optional field default value semantics
7
+ * - Business constraints on field values
8
8
  */
9
9
 
10
10
  import { describe, test, expect } from "bun:test";
11
11
  import type { ModeManifest, SkillConfig, ViewerConfig } from "../types/index.js";
12
12
 
13
- // ── 辅助:创建最小合法 manifest ──────────────────────────────────────────────
13
+ // ── Helper: create minimal valid manifest ────────────────────────────────────
14
14
 
15
15
  function createMinimalManifest(overrides?: Partial<ModeManifest>): ModeManifest {
16
16
  return {
@@ -31,7 +31,7 @@ function createMinimalManifest(overrides?: Partial<ModeManifest>): ModeManifest
31
31
  };
32
32
  }
33
33
 
34
- // ── ModeManifest 必填字段 ────────────────────────────────────────────────────
34
+ // ── ModeManifest required fields ─────────────────────────────────────────────
35
35
 
36
36
  describe("ModeManifest required fields", () => {
37
37
  test("minimal manifest has all required fields", () => {
@@ -1,11 +1,11 @@
1
1
  /**
2
- * Mode Resolver 测试
2
+ * Mode Resolver tests
3
3
  *
4
- * 验证 mode 来源解析:
5
- * - builtin mode 名称识别
6
- * - local path 解析 (绝对路径、相对路径、~ 展开)
7
- * - github 格式解析
8
- * - 错误处理
4
+ * Validates mode source resolution:
5
+ * - Built-in mode name recognition
6
+ * - Local path resolution (absolute paths, relative paths, ~ expansion)
7
+ * - GitHub format parsing
8
+ * - Error handling
9
9
  */
10
10
 
11
11
  import { describe, test, expect } from "bun:test";
@@ -1,13 +1,13 @@
1
1
  /**
2
- * ViewerContract 契约测试
2
+ * ViewerContract contract tests
3
3
  *
4
- * 验证 ViewerContract 接口约束:
5
- * - PreviewComponent 是有效的 React 组件类型
6
- * - extractContext 返回格式正确的上下文字符串
7
- * - updateStrategy 是合法枚举值
8
- * - workspace model 约束
9
- * - action descriptors 结构
10
- * - 向后兼容
4
+ * Validates ViewerContract interface constraints:
5
+ * - PreviewComponent is a valid React component type
6
+ * - extractContext returns a properly formatted context string
7
+ * - updateStrategy is a valid enum value
8
+ * - workspace model constraints
9
+ * - action descriptor structure
10
+ * - backward compatibility
11
11
  */
12
12
 
13
13
  import { describe, test, expect } from "bun:test";
@@ -21,7 +21,7 @@ import type {
21
21
  ViewerActionDescriptor,
22
22
  } from "../types/index.js";
23
23
 
24
- // ── 辅助:创建 mock viewer ─────────────────────────────────────────────────
24
+ // ── Helper: create mock viewer ───────────────────────────────────────────────
25
25
 
26
26
  function createMockViewer(
27
27
  overrides?: Partial<ViewerContract>,
@@ -34,7 +34,7 @@ function createMockViewer(
34
34
  };
35
35
  }
36
36
 
37
- // ── ViewerContract 基本约束 ─────────────────────────────────────────────────
37
+ // ── ViewerContract basic constraints ─────────────────────────────────────────
38
38
 
39
39
  describe("ViewerContract", () => {
40
40
  test("PreviewComponent is a function (React component)", () => {
@@ -91,7 +91,7 @@ describe("ViewerContract", () => {
91
91
  });
92
92
  });
93
93
 
94
- // ── ViewerPreviewProps 完整性 ───────────────────────────────────────────────
94
+ // ── ViewerPreviewProps completeness ──────────────────────────────────────────
95
95
 
96
96
  describe("ViewerPreviewProps shape", () => {
97
97
  test("contains all required fields", () => {
@@ -118,7 +118,7 @@ describe("ViewerPreviewProps shape", () => {
118
118
  });
119
119
  });
120
120
 
121
- // ── extractContext 边界条件 ──────────────────────────────────────────────────
121
+ // ── extractContext edge cases ────────────────────────────────────────────────
122
122
 
123
123
  describe("extractContext edge cases", () => {
124
124
  test("handles selection without file context", () => {
@@ -1,21 +1,21 @@
1
1
  /**
2
- * Mode Loader — 解析、安装、加载 Mode。
2
+ * Mode Loader — resolve, install, and load Modes.
3
3
  *
4
- * 支持三种来源:
5
- * - builtin: 内置 mode,从 modes/ 目录动态 import
6
- * - local: 本地文件系统路径
7
- * - github: GitHub 仓库 (通过 mode-resolver 克隆到本地缓存)
4
+ * Supports three sources:
5
+ * - builtin: built-in modes, dynamically imported from the modes/ directory
6
+ * - local: local filesystem path
7
+ * - github: GitHub repository (cloned to local cache via mode-resolver)
8
8
  *
9
- * 核心流程: resolveMode → ensureInstalled → loadFromSource
9
+ * Core flow: resolveMode → ensureInstalled → loadFromSource
10
10
  */
11
11
 
12
12
  import type { ModeManifest } from "./types/mode-manifest.js";
13
13
  import type { ModeDefinition } from "./types/mode-definition.js";
14
14
 
15
15
  /**
16
- * Mode 来源类型:
17
- * - "builtin" — 内置 mode,从 modes/ 目录动态 import
18
- * - "external" — 外部 mode,从绝对路径动态 import (local path github clone)
16
+ * Mode source type:
17
+ * - "builtin" — built-in mode, dynamically imported from the modes/ directory
18
+ * - "external" — external mode, dynamically imported from an absolute path (local path or github clone)
19
19
  */
20
20
  type ModeSource =
21
21
  | {
@@ -31,7 +31,7 @@ type ModeSource =
31
31
  definitionLoader: () => Promise<ModeDefinition>;
32
32
  };
33
33
 
34
- /** 内置 mode 注册表全部使用动态 import */
34
+ /** Built-in mode registryall use dynamic import */
35
35
  const builtinModes: Record<string, ModeSource> = {
36
36
  doc: {
37
37
  type: "builtin",
@@ -84,14 +84,14 @@ const builtinModes: Record<string, ModeSource> = {
84
84
  },
85
85
  };
86
86
 
87
- /** 外部 mode 注册表 CLI 在启动时通过 registerExternalMode 注册 */
87
+ /** External mode registryregistered by the CLI at startup via registerExternalMode */
88
88
  const externalModes: Record<string, ModeSource> = {};
89
89
 
90
90
  // ── Public API ───────────────────────────────────────────────────────────────
91
91
 
92
92
  /**
93
- * 加载 Mode 的完整定义 (manifest + viewer)
94
- * 前端使用需要 PreviewComponent
93
+ * Load a Mode's full definition (manifest + viewer).
94
+ * Used by the frontend requires PreviewComponent.
95
95
  */
96
96
  export async function loadMode(name: string): Promise<ModeDefinition> {
97
97
  const source = resolveMode(name);
@@ -100,8 +100,8 @@ export async function loadMode(name: string): Promise<ModeDefinition> {
100
100
  }
101
101
 
102
102
  /**
103
- * 只加载 Mode manifest (不含 React 组件)
104
- * 后端使用只需要配置信息。
103
+ * Load only the Mode's manifest (without React components).
104
+ * Used by the backend only needs config information.
105
105
  */
106
106
  export async function loadModeManifest(name: string): Promise<ModeManifest> {
107
107
  const source = resolveMode(name);
@@ -110,27 +110,27 @@ export async function loadModeManifest(name: string): Promise<ModeManifest> {
110
110
  }
111
111
 
112
112
  /**
113
- * 列出所有已注册的 mode 名称 (包括 builtin 和已注册的 external)
113
+ * List all registered mode names (including builtin and registered external).
114
114
  */
115
115
  export function listModes(): string[] {
116
116
  return [...Object.keys(builtinModes), ...Object.keys(externalModes)];
117
117
  }
118
118
 
119
119
  /**
120
- * 列出内置 mode 名称。
120
+ * List built-in mode names.
121
121
  */
122
122
  export function listBuiltinModes(): string[] {
123
123
  return Object.keys(builtinModes);
124
124
  }
125
125
 
126
126
  /**
127
- * 注册外部 mode ( CLI 在启动时调用)
127
+ * Register an external mode (called by the CLI at startup).
128
128
  *
129
- * Backend context (Bun): 直接用 import() 加载绝对路径。
130
- * Frontend context (browser/Vite): /@fs/ URL 加载。
129
+ * Backend context (Bun): uses import() with absolute path.
130
+ * Frontend context (browser/Vite): uses /@fs/ URL.
131
131
  *
132
- * @param name — Mode 名称 (用于注册和查找)
133
- * @param absPath — Mode 包的绝对路径
132
+ * @param name — Mode name (for registration and lookup)
133
+ * @param absPath — Absolute path to the Mode package
134
134
  */
135
135
  export function registerExternalMode(name: string, absPath: string): void {
136
136
  const isBrowser = typeof window !== "undefined";
@@ -185,7 +185,7 @@ export function registerExternalMode(name: string, absPath: string): void {
185
185
 
186
186
  // ── Internal ─────────────────────────────────────────────────────────────────
187
187
 
188
- /** 解析 mode 来源 ( builtin external 注册表) */
188
+ /** Resolve mode source (checks builtin and external registries) */
189
189
  function resolveMode(name: string): ModeSource {
190
190
  // Check external modes first (allows overriding builtin names)
191
191
  const external = externalModes[name];
@@ -200,13 +200,13 @@ function resolveMode(name: string): ModeSource {
200
200
  );
201
201
  }
202
202
 
203
- /** 确保 mode 已安装 (builtin 直接跳过,external 已由 mode-resolver 处理) */
203
+ /** Ensure mode is installed (builtin skips directly, external already handled by mode-resolver) */
204
204
  async function ensureInstalled(_source: ModeSource): Promise<void> {
205
205
  // Both builtin and external modes are already resolved to local paths
206
206
  return;
207
207
  }
208
208
 
209
- /** 从已安装的 source 加载完整 ModeDefinition */
209
+ /** Load full ModeDefinition from an installed source */
210
210
  async function loadDefinition(source: ModeSource): Promise<ModeDefinition> {
211
211
  return source.definitionLoader();
212
212
  }
@@ -1,12 +1,12 @@
1
1
  /**
2
- * Mode Resolver — 解析 mode 来源并确保本地可用。
2
+ * Mode Resolver — resolve mode sources and ensure local availability.
3
3
  *
4
- * 支持三种 mode 来源:
5
- * - builtin: "doc", "slide" — 内置 mode,从 modes/ 目录加载
6
- * - local: "/abs/path" "./rel/path" — 本地文件系统路径
7
- * - github: "github:user/repo" "github:user/repo#branch" — GitHub 仓库
4
+ * Supports three mode sources:
5
+ * - builtin: "doc", "slide" — built-in modes, loaded from the modes/ directory
6
+ * - local: "/abs/path" or "./rel/path" — local filesystem path
7
+ * - github: "github:user/repo" or "github:user/repo#branch" — GitHub repository
8
8
  *
9
- * GitHub 仓库会被 clone ~/.pneuma/modes/{user}-{repo}/ 缓存目录。
9
+ * GitHub repositories are cloned to the ~/.pneuma/modes/{user}-{repo}/ cache directory.
10
10
  */
11
11
 
12
12
  import { resolve, join, basename } from "node:path";
@@ -1,14 +1,14 @@
1
1
  /**
2
- * AgentBackend — Agent 运行时抽象
2
+ * AgentBackend — Agent runtime abstraction
3
3
  *
4
- * 当前实现以 Claude Code 作为首个参考 backend,但对外契约已经拆成两层:
5
- * - AgentBackend: 生命周期与能力声明
6
- * - AgentProtocolAdapter: 后端私有协议到运行时标准消息的翻译
4
+ * The current implementation uses Claude Code as the first reference backend, but the external contract is split into two layers:
5
+ * - AgentBackend: lifecycle and capability declarations
6
+ * - AgentProtocolAdapter: translation from backend-specific protocol to runtime standard messages
7
7
  *
8
- * 前端和大部分服务端逻辑依赖的是标准 session 状态,而不是具体 backend wire protocol
8
+ * The frontend and most server-side logic depend on normalized session state, not a specific backend's wire protocol.
9
9
  */
10
10
 
11
- // ── Agent 生命周期 ───────────────────────────────────────────────────────────
11
+ // ── Agent Lifecycle ──────────────────────────────────────────────────────────
12
12
 
13
13
  export type AgentBackendType = "claude-code" | "codex";
14
14
 
@@ -19,108 +19,108 @@ export interface AgentBackendDescriptor {
19
19
  implemented: boolean;
20
20
  }
21
21
 
22
- /** Agent 会话信息 */
22
+ /** Agent session info */
23
23
  export interface AgentSessionInfo {
24
- /** Server 路由用 session ID (UUID) */
24
+ /** Server routing session ID (UUID) */
25
25
  sessionId: string;
26
- /** Agent 内部的 session ID (用于 resume,如 Claude Code --resume) */
26
+ /** Agent's internal session ID (for resume, e.g. Claude Code's --resume) */
27
27
  agentSessionId?: string;
28
- /** 进程 PID (如果是子进程模式) */
28
+ /** Process PID (if using child process mode) */
29
29
  pid?: number;
30
- /** 会话状态 */
30
+ /** Session state */
31
31
  state: "starting" | "connected" | "running" | "exited";
32
- /** 退出码 (state=exited 时有值) */
32
+ /** Exit code (present when state=exited) */
33
33
  exitCode?: number | null;
34
- /** 工作目录 */
34
+ /** Working directory */
35
35
  cwd: string;
36
- /** 创建时间 */
36
+ /** Creation timestamp */
37
37
  createdAt: number;
38
38
  }
39
39
 
40
- /** Agent 启动选项 */
40
+ /** Agent launch options */
41
41
  export interface AgentLaunchOptions {
42
- /** 工作目录 */
42
+ /** Working directory */
43
43
  cwd: string;
44
- /** 权限模式 */
44
+ /** Permission mode */
45
45
  permissionMode?: string;
46
- /** 模型 */
46
+ /** Model */
47
47
  model?: string;
48
- /** 复用已有的 server session ID (而非生成新的) */
48
+ /** Reuse an existing server session ID (instead of generating a new one) */
49
49
  sessionId?: string;
50
- /** Agent 内部 session ID (用于恢复之前的会话) */
50
+ /** Agent's internal session ID (for resuming a previous session) */
51
51
  resumeSessionId?: string;
52
- /** 额外环境变量 */
52
+ /** Additional environment variables */
53
53
  env?: Record<string, string>;
54
54
  }
55
55
 
56
- /** Agent 后端管理 Agent 进程的生命周期 */
56
+ /** Agent backendmanages the Agent process lifecycle */
57
57
  export interface AgentBackend {
58
- /** 后端唯一标识 */
58
+ /** Unique backend identifier */
59
59
  readonly name: AgentBackendType;
60
60
 
61
- /** 能力声明 */
61
+ /** Capability declarations */
62
62
  readonly capabilities: AgentCapabilities;
63
63
 
64
- /** 启动一个新的 Agent 会话 */
64
+ /** Launch a new Agent session */
65
65
  launch(options: AgentLaunchOptions): AgentSessionInfo;
66
66
 
67
- /** 获取会话信息 */
67
+ /** Get session info */
68
68
  getSession(sessionId: string): AgentSessionInfo | undefined;
69
69
 
70
- /** 会话是否存活 */
70
+ /** Check if a session is alive */
71
71
  isAlive(sessionId: string): boolean;
72
72
 
73
- /** 标记会话为已连接 (WS 建立时调用) */
73
+ /** Mark session as connected (called when WS is established) */
74
74
  markConnected(sessionId: string): void;
75
75
 
76
- /** 存储 Agent 内部 session ID ( Agent 初始化消息中获取) */
76
+ /** Store the Agent's internal session ID (obtained from the Agent's init message) */
77
77
  setAgentSessionId(sessionId: string, agentSessionId: string): void;
78
78
 
79
- /** 终止一个会话 */
79
+ /** Kill a session */
80
80
  kill(sessionId: string): Promise<boolean>;
81
81
 
82
- /** 终止所有会话 */
82
+ /** Kill all sessions */
83
83
  killAll(): Promise<void>;
84
84
 
85
- /** 注册退出回调 */
85
+ /** Register exit callback */
86
86
  onSessionExited(cb: (sessionId: string, exitCode: number | null) => void): void;
87
87
  }
88
88
 
89
- /** Agent 能力声明描述此 Agent 支持哪些功能 */
89
+ /** Agent capability declarations describes which features this Agent supports */
90
90
  export interface AgentCapabilities {
91
- /** 支持 token 级流式输出 */
91
+ /** Supports token-level streaming output */
92
92
  streaming: boolean;
93
- /** 支持会话恢复 (--resume) */
93
+ /** Supports session resume (--resume) */
94
94
  resume: boolean;
95
- /** 支持权限审批流程 (control_request → permission_request) */
95
+ /** Supports permission approval flow (control_request → permission_request) */
96
96
  permissions: boolean;
97
- /** 支持工具执行进度报告 (tool_progress) */
97
+ /** Supports tool execution progress reporting (tool_progress) */
98
98
  toolProgress: boolean;
99
- /** 支持运行时切换模型 */
99
+ /** Supports runtime model switching */
100
100
  modelSwitch: boolean;
101
101
  }
102
102
 
103
- // ── Agent 协议适配 ───────────────────────────────────────────────────────────
103
+ // ── Agent Protocol Adaptation ────────────────────────────────────────────────
104
104
 
105
105
  /**
106
- * 标准消息类型 — ws-bridge 和前端之间的运行时格式。
106
+ * Standard message types runtime format between ws-bridge and the frontend.
107
107
  *
108
- * v1 仍然直接复用现有 session/browser 类型,而不是单独抽一层 StandardMessage AST
109
- * 这保持 Claude 路径零回归,也给第二个 backend 留出了适配点。
108
+ * v1 still directly reuses existing session/browser types rather than extracting a separate StandardMessage AST.
109
+ * This keeps the Claude path zero-regression and leaves an adaptation point for the second backend.
110
110
  *
111
- * 当第二个 backend 需要的消息映射明显超出当前类型表达能力时,再提取更正式的标准消息子集。
111
+ * When the second backend's message mapping clearly exceeds the current type's expressiveness, a more formal standard message subset will be extracted.
112
112
  */
113
113
 
114
114
  /**
115
- * AgentProtocolAdapter — 消息协议适配器
115
+ * AgentProtocolAdapter — message protocol adapter
116
116
  *
117
- * 负责将 Agent 的原始消息格式与 ws-bridge 的运行时格式互转。
118
- * Claude Code 当前基本是 NDJSON 直通,未来其他 backend 则通过各自 adapter 适配。
117
+ * Translates between the Agent's raw message format and the ws-bridge runtime format.
118
+ * Claude Code currently uses near-passthrough NDJSON; other backends adapt through their own adapters.
119
119
  */
120
120
  export interface AgentProtocolAdapter {
121
- /** Agent 发来的原始数据解析为结构化消息 (null = 跳过此消息) */
121
+ /** Parse raw data from the Agent into structured messages (null = skip this message) */
122
122
  parseIncoming(raw: string): unknown | null;
123
123
 
124
- /** 将标准消息编码为 Agent 可接收的格式 */
124
+ /** Encode standard messages into a format the Agent can accept */
125
125
  encodeOutgoing(msg: unknown): string;
126
126
  }
@@ -1,10 +1,10 @@
1
1
  /**
2
- * Core type exports — Pneuma Skills v1.0 契约层
2
+ * Core type exports — Pneuma Skills v1.0 contract layer
3
3
  *
4
- * 三层契约:
5
- * - Layer 4: ModeManifest + ModeDefinition (能力描述协议)
6
- * - Layer 3: ViewerContract (内容查看器契约)
7
- * - Layer 2: AgentBackend + AgentProtocolAdapter (Agent 通信抽象)
4
+ * Three-layer contracts:
5
+ * - Layer 4: ModeManifest + ModeDefinition (capability declaration protocol)
6
+ * - Layer 3: ViewerContract (content viewer contract)
7
+ * - Layer 2: AgentBackend + AgentProtocolAdapter (Agent communication abstraction)
8
8
  */
9
9
 
10
10
  export type {
@@ -1,8 +1,8 @@
1
1
  /**
2
- * ModeDefinition — 运行时 Mode 对象
2
+ * ModeDefinition — Runtime Mode object
3
3
  *
4
- * ModeManifest (声明式配置) ViewerContract (UI 组件) 绑定在一起。
5
- * Mode 包的入口文件默认导出。
4
+ * Binds ModeManifest (declarative config) and ViewerContract (UI component) together.
5
+ * Default-exported from the Mode package's entry file.
6
6
  *
7
7
  * @example
8
8
  * ```typescript
@@ -21,10 +21,10 @@
21
21
  import type { ModeManifest } from "./mode-manifest.js";
22
22
  import type { ViewerContract } from "./viewer-contract.js";
23
23
 
24
- /** 运行时的完整 Mode 定义 */
24
+ /** Complete runtime Mode definition */
25
25
  export interface ModeDefinition {
26
- /** 声明式配置 */
26
+ /** Declarative configuration */
27
27
  manifest: ModeManifest;
28
- /** 内容查看器实现 */
28
+ /** Content viewer implementation */
29
29
  viewer: ViewerContract;
30
30
  }