xibecode 1.0.3 → 1.0.6

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.
Files changed (268) hide show
  1. package/dist/commands/chat.d.ts.map +1 -1
  2. package/dist/commands/chat.js +10 -7
  3. package/dist/commands/chat.js.map +1 -1
  4. package/dist/commands/diagnostics.js +1 -1
  5. package/dist/commands/diagnostics.js.map +1 -1
  6. package/dist/commands/mcp.js +1 -1
  7. package/dist/commands/mcp.js.map +1 -1
  8. package/dist/commands/resume.js +1 -1
  9. package/dist/commands/resume.js.map +1 -1
  10. package/dist/commands/run-pr.d.ts.map +1 -1
  11. package/dist/commands/run-pr.js +10 -9
  12. package/dist/commands/run-pr.js.map +1 -1
  13. package/dist/commands/run.d.ts.map +1 -1
  14. package/dist/commands/run.js +14 -13
  15. package/dist/commands/run.js.map +1 -1
  16. package/dist/commands/skills.d.ts.map +1 -1
  17. package/dist/commands/skills.js +3 -2
  18. package/dist/commands/skills.js.map +1 -1
  19. package/dist/components/AssistantMarkdown.js +1 -1
  20. package/dist/components/AssistantMarkdown.js.map +1 -1
  21. package/dist/ui/claude-style-chat.d.ts.map +1 -1
  22. package/dist/ui/claude-style-chat.js +12 -10
  23. package/dist/ui/claude-style-chat.js.map +1 -1
  24. package/dist/utils/built-in-skills-dir.d.ts +7 -0
  25. package/dist/utils/built-in-skills-dir.d.ts.map +1 -0
  26. package/dist/utils/built-in-skills-dir.js +11 -0
  27. package/dist/utils/built-in-skills-dir.js.map +1 -0
  28. package/dist/utils/config.d.ts +2 -119
  29. package/dist/utils/config.d.ts.map +1 -1
  30. package/dist/utils/config.js +3 -88
  31. package/dist/utils/config.js.map +1 -1
  32. package/package.json +11 -17
  33. package/dist/commands/punycode.d.ts +0 -5
  34. package/dist/commands/punycode.d.ts.map +0 -1
  35. package/dist/commands/punycode.js +0 -48
  36. package/dist/commands/punycode.js.map +0 -1
  37. package/dist/commands/tui.d.ts +0 -9
  38. package/dist/commands/tui.d.ts.map +0 -1
  39. package/dist/commands/tui.js +0 -83
  40. package/dist/commands/tui.js.map +0 -1
  41. package/dist/core/agent-tool-policies.d.ts +0 -5
  42. package/dist/core/agent-tool-policies.d.ts.map +0 -1
  43. package/dist/core/agent-tool-policies.js +0 -18
  44. package/dist/core/agent-tool-policies.js.map +0 -1
  45. package/dist/core/agent.d.ts +0 -181
  46. package/dist/core/agent.d.ts.map +0 -1
  47. package/dist/core/agent.js +0 -1777
  48. package/dist/core/agent.js.map +0 -1
  49. package/dist/core/background-agent.d.ts +0 -23
  50. package/dist/core/background-agent.d.ts.map +0 -1
  51. package/dist/core/background-agent.js +0 -175
  52. package/dist/core/background-agent.js.map +0 -1
  53. package/dist/core/code-graph.d.ts +0 -18
  54. package/dist/core/code-graph.d.ts.map +0 -1
  55. package/dist/core/code-graph.js +0 -105
  56. package/dist/core/code-graph.js.map +0 -1
  57. package/dist/core/conflict-solver.d.ts +0 -26
  58. package/dist/core/conflict-solver.d.ts.map +0 -1
  59. package/dist/core/conflict-solver.js +0 -108
  60. package/dist/core/conflict-solver.js.map +0 -1
  61. package/dist/core/context-compactor.d.ts +0 -10
  62. package/dist/core/context-compactor.d.ts.map +0 -1
  63. package/dist/core/context-compactor.js +0 -158
  64. package/dist/core/context-compactor.js.map +0 -1
  65. package/dist/core/context-pruner.d.ts +0 -19
  66. package/dist/core/context-pruner.d.ts.map +0 -1
  67. package/dist/core/context-pruner.js +0 -103
  68. package/dist/core/context-pruner.js.map +0 -1
  69. package/dist/core/context.d.ts +0 -82
  70. package/dist/core/context.d.ts.map +0 -1
  71. package/dist/core/context.js +0 -273
  72. package/dist/core/context.js.map +0 -1
  73. package/dist/core/conversation-recovery.d.ts +0 -9
  74. package/dist/core/conversation-recovery.d.ts.map +0 -1
  75. package/dist/core/conversation-recovery.js +0 -15
  76. package/dist/core/conversation-recovery.js.map +0 -1
  77. package/dist/core/debug-workflow.d.ts +0 -9
  78. package/dist/core/debug-workflow.d.ts.map +0 -1
  79. package/dist/core/debug-workflow.js +0 -19
  80. package/dist/core/debug-workflow.js.map +0 -1
  81. package/dist/core/docs-scraper.d.ts +0 -40
  82. package/dist/core/docs-scraper.d.ts.map +0 -1
  83. package/dist/core/docs-scraper.js +0 -386
  84. package/dist/core/docs-scraper.js.map +0 -1
  85. package/dist/core/editor.d.ts +0 -87
  86. package/dist/core/editor.d.ts.map +0 -1
  87. package/dist/core/editor.js +0 -377
  88. package/dist/core/editor.js.map +0 -1
  89. package/dist/core/export.d.ts +0 -11
  90. package/dist/core/export.d.ts.map +0 -1
  91. package/dist/core/export.js +0 -54
  92. package/dist/core/export.js.map +0 -1
  93. package/dist/core/history-manager.d.ts +0 -75
  94. package/dist/core/history-manager.d.ts.map +0 -1
  95. package/dist/core/history-manager.js +0 -146
  96. package/dist/core/history-manager.js.map +0 -1
  97. package/dist/core/marketplace-client.d.ts +0 -52
  98. package/dist/core/marketplace-client.d.ts.map +0 -1
  99. package/dist/core/marketplace-client.js +0 -71
  100. package/dist/core/marketplace-client.js.map +0 -1
  101. package/dist/core/mcp/mcp-config.d.ts +0 -10
  102. package/dist/core/mcp/mcp-config.d.ts.map +0 -1
  103. package/dist/core/mcp/mcp-config.js +0 -70
  104. package/dist/core/mcp/mcp-config.js.map +0 -1
  105. package/dist/core/mcp/mcp-policy.d.ts +0 -17
  106. package/dist/core/mcp/mcp-policy.d.ts.map +0 -1
  107. package/dist/core/mcp/mcp-policy.js +0 -56
  108. package/dist/core/mcp/mcp-policy.js.map +0 -1
  109. package/dist/core/mcp/oauth-flow.d.ts +0 -30
  110. package/dist/core/mcp/oauth-flow.d.ts.map +0 -1
  111. package/dist/core/mcp/oauth-flow.js +0 -230
  112. package/dist/core/mcp/oauth-flow.js.map +0 -1
  113. package/dist/core/mcp/oauth-store.d.ts +0 -13
  114. package/dist/core/mcp/oauth-store.d.ts.map +0 -1
  115. package/dist/core/mcp/oauth-store.js +0 -68
  116. package/dist/core/mcp/oauth-store.js.map +0 -1
  117. package/dist/core/mcp/resolve-mcp-servers.d.ts +0 -16
  118. package/dist/core/mcp/resolve-mcp-servers.d.ts.map +0 -1
  119. package/dist/core/mcp/resolve-mcp-servers.js +0 -83
  120. package/dist/core/mcp/resolve-mcp-servers.js.map +0 -1
  121. package/dist/core/mcp-client.d.ts +0 -99
  122. package/dist/core/mcp-client.d.ts.map +0 -1
  123. package/dist/core/mcp-client.js +0 -317
  124. package/dist/core/mcp-client.js.map +0 -1
  125. package/dist/core/memory-promotions.d.ts +0 -15
  126. package/dist/core/memory-promotions.d.ts.map +0 -1
  127. package/dist/core/memory-promotions.js +0 -38
  128. package/dist/core/memory-promotions.js.map +0 -1
  129. package/dist/core/memory.d.ts +0 -32
  130. package/dist/core/memory.d.ts.map +0 -1
  131. package/dist/core/memory.js +0 -121
  132. package/dist/core/memory.js.map +0 -1
  133. package/dist/core/modes.d.ts +0 -432
  134. package/dist/core/modes.d.ts.map +0 -1
  135. package/dist/core/modes.js +0 -1094
  136. package/dist/core/modes.js.map +0 -1
  137. package/dist/core/pattern-miner.d.ts +0 -43
  138. package/dist/core/pattern-miner.d.ts.map +0 -1
  139. package/dist/core/pattern-miner.js +0 -123
  140. package/dist/core/pattern-miner.js.map +0 -1
  141. package/dist/core/permission-store.d.ts +0 -15
  142. package/dist/core/permission-store.d.ts.map +0 -1
  143. package/dist/core/permission-store.js +0 -30
  144. package/dist/core/permission-store.js.map +0 -1
  145. package/dist/core/permissions.d.ts +0 -33
  146. package/dist/core/permissions.d.ts.map +0 -1
  147. package/dist/core/permissions.js +0 -141
  148. package/dist/core/permissions.js.map +0 -1
  149. package/dist/core/plan-artifacts.d.ts +0 -10
  150. package/dist/core/plan-artifacts.d.ts.map +0 -1
  151. package/dist/core/plan-artifacts.js +0 -60
  152. package/dist/core/plan-artifacts.js.map +0 -1
  153. package/dist/core/plan-session.d.ts +0 -25
  154. package/dist/core/plan-session.d.ts.map +0 -1
  155. package/dist/core/plan-session.js +0 -99
  156. package/dist/core/plan-session.js.map +0 -1
  157. package/dist/core/planMode.d.ts +0 -51
  158. package/dist/core/planMode.d.ts.map +0 -1
  159. package/dist/core/planMode.js +0 -245
  160. package/dist/core/planMode.js.map +0 -1
  161. package/dist/core/plugins.d.ts +0 -96
  162. package/dist/core/plugins.d.ts.map +0 -1
  163. package/dist/core/plugins.js +0 -204
  164. package/dist/core/plugins.js.map +0 -1
  165. package/dist/core/session-bridge.d.ts +0 -128
  166. package/dist/core/session-bridge.d.ts.map +0 -1
  167. package/dist/core/session-bridge.js +0 -328
  168. package/dist/core/session-bridge.js.map +0 -1
  169. package/dist/core/session-manager.d.ts +0 -80
  170. package/dist/core/session-manager.d.ts.map +0 -1
  171. package/dist/core/session-manager.js +0 -166
  172. package/dist/core/session-manager.js.map +0 -1
  173. package/dist/core/session-memory.d.ts +0 -45
  174. package/dist/core/session-memory.d.ts.map +0 -1
  175. package/dist/core/session-memory.js +0 -103
  176. package/dist/core/session-memory.js.map +0 -1
  177. package/dist/core/skill-selection.d.ts +0 -36
  178. package/dist/core/skill-selection.d.ts.map +0 -1
  179. package/dist/core/skill-selection.js +0 -172
  180. package/dist/core/skill-selection.js.map +0 -1
  181. package/dist/core/skills-sh-client.d.ts +0 -19
  182. package/dist/core/skills-sh-client.d.ts.map +0 -1
  183. package/dist/core/skills-sh-client.js +0 -75
  184. package/dist/core/skills-sh-client.js.map +0 -1
  185. package/dist/core/skills.d.ts +0 -97
  186. package/dist/core/skills.d.ts.map +0 -1
  187. package/dist/core/skills.js +0 -339
  188. package/dist/core/skills.js.map +0 -1
  189. package/dist/core/swarm.d.ts +0 -34
  190. package/dist/core/swarm.d.ts.map +0 -1
  191. package/dist/core/swarm.js +0 -111
  192. package/dist/core/swarm.js.map +0 -1
  193. package/dist/core/task-status.d.ts +0 -13
  194. package/dist/core/task-status.d.ts.map +0 -1
  195. package/dist/core/task-status.js +0 -17
  196. package/dist/core/task-status.js.map +0 -1
  197. package/dist/core/tool-orchestrator.d.ts +0 -30
  198. package/dist/core/tool-orchestrator.d.ts.map +0 -1
  199. package/dist/core/tool-orchestrator.js +0 -89
  200. package/dist/core/tool-orchestrator.js.map +0 -1
  201. package/dist/core/tools.d.ts +0 -462
  202. package/dist/core/tools.d.ts.map +0 -1
  203. package/dist/core/tools.js +0 -2916
  204. package/dist/core/tools.js.map +0 -1
  205. package/dist/core/transcript-cleanup.d.ts +0 -8
  206. package/dist/core/transcript-cleanup.d.ts.map +0 -1
  207. package/dist/core/transcript-cleanup.js +0 -52
  208. package/dist/core/transcript-cleanup.js.map +0 -1
  209. package/dist/core/visual-feedback.d.ts +0 -20
  210. package/dist/core/visual-feedback.d.ts.map +0 -1
  211. package/dist/core/visual-feedback.js +0 -117
  212. package/dist/core/visual-feedback.js.map +0 -1
  213. package/dist/tools/browser.d.ts +0 -120
  214. package/dist/tools/browser.d.ts.map +0 -1
  215. package/dist/tools/browser.js +0 -439
  216. package/dist/tools/browser.js.map +0 -1
  217. package/dist/tools/test-generator.d.ts +0 -157
  218. package/dist/tools/test-generator.d.ts.map +0 -1
  219. package/dist/tools/test-generator.js +0 -893
  220. package/dist/tools/test-generator.js.map +0 -1
  221. package/dist/tui/InkApp.d.ts +0 -21
  222. package/dist/tui/InkApp.d.ts.map +0 -1
  223. package/dist/tui/InkApp.js +0 -146
  224. package/dist/tui/InkApp.js.map +0 -1
  225. package/dist/tui/MarkdownMessage.d.ts +0 -16
  226. package/dist/tui/MarkdownMessage.d.ts.map +0 -1
  227. package/dist/tui/MarkdownMessage.js +0 -63
  228. package/dist/tui/MarkdownMessage.js.map +0 -1
  229. package/dist/tui/blessed-chat.d.ts +0 -9
  230. package/dist/tui/blessed-chat.d.ts.map +0 -1
  231. package/dist/tui/blessed-chat.js +0 -887
  232. package/dist/tui/blessed-chat.js.map +0 -1
  233. package/dist/tui/markdown-to-blessed.d.ts +0 -6
  234. package/dist/tui/markdown-to-blessed.d.ts.map +0 -1
  235. package/dist/tui/markdown-to-blessed.js +0 -26
  236. package/dist/tui/markdown-to-blessed.js.map +0 -1
  237. package/dist/ui/ink/App.d.ts +0 -25
  238. package/dist/ui/ink/App.d.ts.map +0 -1
  239. package/dist/ui/ink/App.js +0 -372
  240. package/dist/ui/ink/App.js.map +0 -1
  241. package/dist/utils/at-references.d.ts +0 -14
  242. package/dist/utils/at-references.d.ts.map +0 -1
  243. package/dist/utils/at-references.js +0 -47
  244. package/dist/utils/at-references.js.map +0 -1
  245. package/dist/utils/auto-memory.d.ts +0 -24
  246. package/dist/utils/auto-memory.d.ts.map +0 -1
  247. package/dist/utils/auto-memory.js +0 -153
  248. package/dist/utils/auto-memory.js.map +0 -1
  249. package/dist/utils/git.d.ts +0 -89
  250. package/dist/utils/git.d.ts.map +0 -1
  251. package/dist/utils/git.js +0 -444
  252. package/dist/utils/git.js.map +0 -1
  253. package/dist/utils/mcp-servers-file.d.ts +0 -46
  254. package/dist/utils/mcp-servers-file.d.ts.map +0 -1
  255. package/dist/utils/mcp-servers-file.js +0 -212
  256. package/dist/utils/mcp-servers-file.js.map +0 -1
  257. package/dist/utils/safety.d.ts +0 -60
  258. package/dist/utils/safety.d.ts.map +0 -1
  259. package/dist/utils/safety.js +0 -254
  260. package/dist/utils/safety.js.map +0 -1
  261. package/dist/utils/smithery.d.ts +0 -25
  262. package/dist/utils/smithery.d.ts.map +0 -1
  263. package/dist/utils/smithery.js +0 -50
  264. package/dist/utils/smithery.js.map +0 -1
  265. package/dist/utils/testRunner.d.ts +0 -44
  266. package/dist/utils/testRunner.d.ts.map +0 -1
  267. package/dist/utils/testRunner.js +0 -270
  268. package/dist/utils/testRunner.js.map +0 -1
@@ -1,432 +0,0 @@
1
- /**
2
- * Multi-mode architecture for XibeCode
3
- *
4
- * Defines 13 specialized agent modes (personas) with distinct capabilities,
5
- * tool permissions, and behavioral characteristics. Each mode represents a
6
- * different AI personality optimized for specific types of tasks.
7
- *
8
- * @module modes
9
- * @category Core Systems
10
- * @since 0.1.0
11
- */
12
- /**
13
- * Agent operating modes (personas)
14
- *
15
- * XibeCode operates in one of 13 specialized modes, each with a unique persona:
16
- *
17
- * **Planning & Analysis:**
18
- * - `plan` - Aria the Architect: Read-only planning and analysis
19
- * - `researcher` - Sanvi the Scholar: Deep research and investigation
20
- *
21
- * **Development:**
22
- * - `agent` - Full-capability autonomous coding agent
23
- * - `engineer` - Alex the Implementer: Feature implementation
24
- * - `architect` - Anna the Designer: System architecture design
25
- *
26
- * **Quality & Testing:**
27
- * - `tester` - Tess the QA Engineer: Test writing and execution
28
- * - `debugger` - Dex the Detective: Bug investigation and fixing
29
- * - `review` - Nova the Critic: Code review and quality checks
30
- * - `security` - Sentinel the Guardian: Security audits and hardening
31
- *
32
- * **Specialized Roles:**
33
- * - `seo` - Siri the Optimizer: SEO analysis and optimization
34
- * - `data` - David the Analyst: Data analysis and insights
35
- * - `product` - Agni the Strategist: Product strategy and roadmap
36
- * - `team_leader` - Arya the Leader: Task delegation and orchestration
37
- *
38
- * @example
39
- * ```typescript
40
- * let mode: AgentMode = 'plan'; // Start in planning mode
41
- * mode = 'agent'; // Switch to full coding mode
42
- * mode = 'tester'; // Switch to testing mode
43
- * ```
44
- *
45
- * @category Types
46
- * @since 0.1.0
47
- */
48
- export type AgentMode = 'plan' | 'agent' | 'tester' | 'debugger' | 'security' | 'pentest' | 'review' | 'team_leader' | 'seo' | 'product' | 'architect' | 'engineer' | 'data' | 'researcher';
49
- /**
50
- * Modes currently enabled for users to select.
51
- * Other modes remain defined internally but are temporarily disabled.
52
- */
53
- export declare const ENABLED_MODES: readonly AgentMode[];
54
- export declare function isEnabledMode(mode: string): mode is (typeof ENABLED_MODES)[number];
55
- /**
56
- * Tool category classifications
57
- *
58
- * Tools are grouped into categories for permission management. Each mode
59
- * specifies which categories of tools it can access.
60
- *
61
- * **Categories:**
62
- * - `read_only` - File reading, no modifications
63
- * - `write_fs` - File writing and modification
64
- * - `git_read` - Git status, diff, log (read-only)
65
- * - `git_mutation` - Git commit, reset (modifying)
66
- * - `shell_command` - Execute shell commands
67
- * - `tests` - Run tests and get results
68
- * - `network` - Web search, HTTP requests
69
- * - `context` - Code search, context discovery
70
- * - `swarm` - Subagent delegation (`delegate_subtask`, `run_swarm`)
71
- *
72
- * @example
73
- * ```typescript
74
- * const planModeCategories: ToolCategory[] = [
75
- * 'read_only',
76
- * 'git_read',
77
- * 'context'
78
- * ];
79
- * ```
80
- *
81
- * @category Types
82
- * @since 0.1.0
83
- */
84
- export type ToolCategory = 'read_only' | 'write_fs' | 'git_read' | 'git_mutation' | 'shell_command' | 'tests' | 'network' | 'context' | 'swarm';
85
- /**
86
- * Mode capabilities and configuration
87
- *
88
- * Defines the capabilities, permissions, and characteristics of an agent mode.
89
- * Each mode has a unique persona with specific tool access, behavioral traits,
90
- * and risk tolerance.
91
- *
92
- * Used by the mode system to:
93
- * - Control tool permissions
94
- * - Display persona information in UI
95
- * - Configure default behavior (dry-run, confirmations)
96
- * - Inject mode-specific instructions into system prompt
97
- *
98
- * @example
99
- * ```typescript
100
- * const planMode: ModeCapabilities = {
101
- * name: 'Plan',
102
- * personaName: 'Aria',
103
- * personaRole: 'the Architect',
104
- * allowedCategories: ['read_only', 'git_read', 'context'],
105
- * canModify: false,
106
- * defaultDryRun: true,
107
- * riskTolerance: 'low',
108
- * // ... other fields
109
- * };
110
- * ```
111
- *
112
- * @category Interfaces
113
- * @since 0.1.0
114
- */
115
- export interface ModeCapabilities {
116
- /**
117
- * Human-readable mode name
118
- *
119
- * Displayed in UI and documentation. Should be concise (one word).
120
- *
121
- * @example "Plan", "Agent", "Tester"
122
- */
123
- name: string;
124
- /**
125
- * Short description of what this mode does
126
- *
127
- * Brief explanation of the mode's purpose and capabilities.
128
- *
129
- * @example "Analyze and create plans without modifying code"
130
- */
131
- description: string;
132
- /**
133
- * Agent persona name
134
- *
135
- * Friendly name for the AI personality in this mode.
136
- *
137
- * @example "Aria", "Blaze", "Tess"
138
- */
139
- personaName: string;
140
- /**
141
- * Agent persona role description
142
- *
143
- * Role descriptor used in prompts (with "the" prefix).
144
- *
145
- * @example "the Architect", "the Builder", "the QA Engineer"
146
- */
147
- personaRole: string;
148
- /**
149
- * Tool categories allowed in this mode
150
- *
151
- * List of tool category strings that determine which tools the agent
152
- * can access in this mode.
153
- *
154
- * @example ['read_only', 'git_read', 'context']
155
- */
156
- allowedCategories: ToolCategory[];
157
- /**
158
- * Whether this mode can modify files
159
- *
160
- * If false, file write operations are blocked. Used as an additional
161
- * safety check beyond tool categories.
162
- */
163
- canModify: boolean;
164
- /**
165
- * Whether dry-run is enabled by default
166
- *
167
- * If true, operations are previewed without execution unless explicitly
168
- * overridden. Useful for planning and review modes.
169
- */
170
- defaultDryRun: boolean;
171
- /**
172
- * Color for TUI display
173
- *
174
- * Hex color code used to style this mode in the terminal UI.
175
- *
176
- * @example "#40C4FF" (light blue), "#FF5252" (red)
177
- */
178
- displayColor: string;
179
- /**
180
- * Icon/emoji for TUI display
181
- *
182
- * Emoji icon representing this mode in the terminal UI.
183
- *
184
- * @example "📋" (plan), "🔥" (agent), "🧪" (tester)
185
- */
186
- icon: string;
187
- /**
188
- * Additional system prompt instructions
189
- *
190
- * Mode-specific instructions injected into the AI's system prompt.
191
- * Defines the mode's personality, goals, and behavioral guidelines.
192
- *
193
- * Should include:
194
- * - Mode description and role
195
- * - Key responsibilities
196
- * - Best practices
197
- * - When to transition to other modes
198
- */
199
- promptSuffix: string;
200
- /**
201
- * Risk tolerance level for operations
202
- *
203
- * Determines how cautious the agent should be:
204
- * - `low` - Minimize risks, prefer read-only operations
205
- * - `medium` - Balanced approach, reversible changes OK
206
- * - `high` - Accept higher risks for full capabilities
207
- */
208
- riskTolerance: 'low' | 'medium' | 'high';
209
- /**
210
- * Whether mode transitions require user confirmation
211
- *
212
- * If true, user must approve before switching to/from this mode.
213
- * Used for high-risk modes to prevent unwanted transitions.
214
- */
215
- requiresConfirmation: boolean;
216
- }
217
- /**
218
- * Configuration for all 13 agent modes
219
- *
220
- * Central registry of mode capabilities, personas, and permissions.
221
- * Maps each AgentMode to its complete configuration including:
222
- * - Persona details (name, role, icon)
223
- * - Tool permissions (allowed categories)
224
- * - Behavioral settings (dry-run, risk tolerance)
225
- * - System prompt instructions
226
- *
227
- * @example
228
- * ```typescript
229
- * // Get configuration for a mode
230
- * const planConfig = MODE_CONFIG['plan'];
231
- * console.log(planConfig.personaName); // "Aria"
232
- * console.log(planConfig.allowedCategories); // ['read_only', 'git_read', 'context']
233
- *
234
- * // Check if mode can modify files
235
- * const agentConfig = MODE_CONFIG['agent'];
236
- * if (agentConfig.canModify) {
237
- * // Allow file modifications
238
- * }
239
- * ```
240
- *
241
- * @category Configuration
242
- * @since 0.1.0
243
- */
244
- export declare const MODE_CONFIG: Record<AgentMode, ModeCapabilities>;
245
- export declare function getToolCategory(toolName: string): ToolCategory | undefined;
246
- /**
247
- * Check if a tool is allowed in the given mode
248
- *
249
- * Validates tool permissions based on the mode's allowed categories.
250
- * Tools are categorized (e.g., 'read_only', 'write_fs') and each mode
251
- * specifies which categories it can access.
252
- *
253
- * @example
254
- * ```typescript
255
- * // Check if 'write_file' is allowed in 'plan' mode
256
- * const check = isToolAllowed('plan', 'write_file');
257
- * if (!check.allowed) {
258
- * console.error(check.reason);
259
- * // "Tool 'write_file' (write_fs) is not allowed in plan mode"
260
- * }
261
- *
262
- * // Check if 'read_file' is allowed in 'plan' mode
263
- * const readCheck = isToolAllowed('plan', 'read_file');
264
- * console.log(readCheck.allowed); // true
265
- * ```
266
- *
267
- * @param mode - Current agent mode
268
- * @param toolName - Name of the tool to check
269
- * @returns Object with allowed status and optional reason if blocked
270
- *
271
- * @category Permission Control
272
- * @since 0.1.0
273
- */
274
- export declare function isToolAllowed(mode: AgentMode, toolName: string): {
275
- allowed: boolean;
276
- reason?: string;
277
- };
278
- export declare function getAllowedTools(mode: AgentMode): string[];
279
- export declare function requiresModeTransitionConfirmation(fromMode: AgentMode, toMode: AgentMode): boolean;
280
- export declare function getModeTransitionMessage(fromMode: AgentMode, toMode: AgentMode): string;
281
- /**
282
- * Mode state for tracking in agent session
283
- *
284
- * Maintains the current mode and transition history throughout the agent's
285
- * execution. Used to:
286
- * - Track mode changes over time
287
- * - Implement transition confirmation workflows
288
- * - Analyze mode usage patterns
289
- * - Prevent invalid or rapid mode switching
290
- *
291
- * @example
292
- * ```typescript
293
- * const state: ModeState = {
294
- * current: 'agent',
295
- * previous: 'plan',
296
- * history: [
297
- * { mode: 'plan', timestamp: Date.now() - 60000, reason: 'Initial planning' },
298
- * { mode: 'agent', timestamp: Date.now(), reason: 'Ready to implement' }
299
- * ]
300
- * };
301
- * ```
302
- *
303
- * @category Interfaces
304
- * @since 0.3.0
305
- */
306
- export interface ModeState {
307
- /** Current active mode */
308
- current: AgentMode;
309
- /** Previously active mode (if any) */
310
- previous?: AgentMode;
311
- /** Complete history of mode transitions */
312
- history: Array<{
313
- mode: AgentMode;
314
- timestamp: number;
315
- reason?: string;
316
- }>;
317
- /** Transition currently in progress (awaiting confirmation) */
318
- transitionInProgress?: {
319
- from: AgentMode;
320
- to: AgentMode;
321
- awaitingConfirmation: boolean;
322
- };
323
- /** Pending transition request not yet processed */
324
- pendingRequest?: ModeTransitionRequest;
325
- }
326
- /**
327
- * Mode transition request
328
- *
329
- * Represents a request to change modes, including metadata about the
330
- * request source and reason.
331
- *
332
- * @example
333
- * ```typescript
334
- * const request: ModeTransitionRequest = {
335
- * targetMode: 'debugger',
336
- * reason: 'Need to investigate failing tests',
337
- * source: 'model', // AI requested the transition
338
- * timestamp: Date.now()
339
- * };
340
- * ```
341
- *
342
- * @category Interfaces
343
- * @since 0.3.0
344
- */
345
- export interface ModeTransitionRequest {
346
- /** Mode to transition to */
347
- targetMode: AgentMode;
348
- /** Reason for the transition */
349
- reason: string;
350
- /** Source of the request */
351
- source: 'model' | 'user' | 'system';
352
- /** When the request was made (Unix timestamp) */
353
- timestamp: number;
354
- }
355
- /**
356
- * Auto-approval policy for mode transitions
357
- *
358
- * Controls when mode transitions require user confirmation:
359
- * - `never` - Always require confirmation
360
- * - `prompt-only` - Require confirmation for escalation (read → write)
361
- * - `always-for-debugger` - Auto-approve transitions to debugger mode
362
- * - `always` - Auto-approve all transitions (⚠️ use with caution)
363
- *
364
- * @category Types
365
- * @since 0.3.0
366
- */
367
- export type AutoApprovalPolicy = 'never' | 'prompt-only' | 'always-for-debugger' | 'always';
368
- /**
369
- * Mode transition policy configuration
370
- */
371
- export interface ModeTransitionPolicy {
372
- autoApprovalPolicy: AutoApprovalPolicy;
373
- allowAutoEscalation: boolean;
374
- }
375
- export declare function createModeState(initialMode?: AgentMode): ModeState;
376
- export declare function transitionMode(state: ModeState, newMode: AgentMode, reason?: string): ModeState;
377
- /**
378
- * Mode Orchestrator - manages mode transitions and policies
379
- */
380
- export declare class ModeOrchestrator {
381
- private policy;
382
- constructor(policy?: ModeTransitionPolicy);
383
- /**
384
- * Request a mode change
385
- */
386
- requestModeChange(state: ModeState, targetMode: AgentMode, reason: string, source?: 'model' | 'user' | 'system'): ModeState;
387
- /**
388
- * Evaluate if a mode transition should be auto-approved
389
- */
390
- evaluateModeChangeRequest(state: ModeState): {
391
- approved: boolean;
392
- requiresConfirmation: boolean;
393
- reason?: string;
394
- };
395
- /**
396
- * Clear pending mode change request
397
- */
398
- clearPendingRequest(state: ModeState): ModeState;
399
- /**
400
- * Update policy
401
- */
402
- updatePolicy(policy: Partial<ModeTransitionPolicy>): void;
403
- /**
404
- * Get current policy
405
- */
406
- getPolicy(): ModeTransitionPolicy;
407
- }
408
- /**
409
- * Parse mode request from text (looks for [[REQUEST_MODE: ...]] tags)
410
- */
411
- export declare function parseModeRequest(text: string): {
412
- mode: AgentMode;
413
- reason: string;
414
- } | null;
415
- /**
416
- * Strip mode request tags from text (for display)
417
- */
418
- export declare function stripModeRequests(text: string): string;
419
- /**
420
- * Parse task completion from text (looks for [[TASK_COMPLETE | summary=...]] tags)
421
- */
422
- export declare function parseTaskComplete(text: string): {
423
- summary: string;
424
- evidence?: string;
425
- } | null;
426
- /**
427
- * Strip task complete tags from text (for display)
428
- */
429
- export declare function stripTaskComplete(text: string): string;
430
- export declare function isValidMode(mode: string): mode is AgentMode;
431
- export declare function getAllModes(): AgentMode[];
432
- //# sourceMappingURL=modes.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"modes.d.ts","sourceRoot":"","sources":["../../src/core/modes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,MAAM,MAAM,SAAS,GACjB,MAAM,GACN,OAAO,GACP,QAAQ,GACR,UAAU,GACV,UAAU,GACV,SAAS,GACT,QAAQ,GACR,aAAa,GACb,KAAK,GACL,SAAS,GACT,WAAW,GACX,UAAU,GACV,MAAM,GACN,YAAY,CAAC;AAEjB;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,SAAS,SAAS,EAAyC,CAAC;AAExF,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAElF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,MAAM,YAAY,GACpB,WAAW,GACX,UAAU,GACV,UAAU,GACV,cAAc,GACd,eAAe,GACf,OAAO,GACP,SAAS,GACT,SAAS,GACT,OAAO,CAAC;AAEZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;;;OAMG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;;;;OAMG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;;;;OAMG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;;;;OAMG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;;;;;OAOG;IACH,iBAAiB,EAAE,YAAY,EAAE,CAAC;IAElC;;;;;OAKG;IACH,SAAS,EAAE,OAAO,CAAC;IAEnB;;;;;OAKG;IACH,aAAa,EAAE,OAAO,CAAC;IAEvB;;;;;;OAMG;IAC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