@tuan_son.dinh/gsd 2.6.2 → 2.7.0

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 (1024) hide show
  1. package/README.md +1 -0
  2. package/dist/cli.js +24 -10
  3. package/dist/loader.js +21 -3
  4. package/dist/logo.d.ts +3 -3
  5. package/dist/logo.js +2 -2
  6. package/dist/onboarding.d.ts +3 -3
  7. package/dist/onboarding.js +3 -4
  8. package/dist/pi-migration.d.ts +5 -1
  9. package/dist/pi-migration.js +19 -2
  10. package/dist/resource-loader.d.ts +2 -1
  11. package/dist/resource-loader.js +60 -4
  12. package/dist/wizard.d.ts +1 -1
  13. package/package.json +12 -6
  14. package/packages/pi-agent-core/dist/agent-loop.d.ts +21 -0
  15. package/packages/pi-agent-core/dist/agent-loop.d.ts.map +1 -0
  16. package/packages/pi-agent-core/dist/agent-loop.js +308 -0
  17. package/packages/pi-agent-core/dist/agent-loop.js.map +1 -0
  18. package/packages/pi-agent-core/dist/agent.d.ts +162 -0
  19. package/packages/pi-agent-core/dist/agent.d.ts.map +1 -0
  20. package/packages/pi-agent-core/dist/agent.js +399 -0
  21. package/packages/pi-agent-core/dist/agent.js.map +1 -0
  22. package/packages/pi-agent-core/dist/index.d.ts +5 -0
  23. package/packages/pi-agent-core/dist/index.d.ts.map +1 -0
  24. package/packages/pi-agent-core/dist/index.js +9 -0
  25. package/packages/pi-agent-core/dist/index.js.map +1 -0
  26. package/packages/pi-agent-core/dist/proxy.d.ts +85 -0
  27. package/packages/pi-agent-core/dist/proxy.d.ts.map +1 -0
  28. package/packages/pi-agent-core/dist/proxy.js +268 -0
  29. package/packages/pi-agent-core/dist/proxy.js.map +1 -0
  30. package/packages/pi-agent-core/dist/types.d.ts +178 -0
  31. package/packages/pi-agent-core/dist/types.d.ts.map +1 -0
  32. package/packages/pi-agent-core/dist/types.js +2 -0
  33. package/packages/pi-agent-core/dist/types.js.map +1 -0
  34. package/packages/pi-agent-core/package.json +14 -0
  35. package/packages/pi-agent-core/src/agent-loop.ts +417 -0
  36. package/packages/pi-agent-core/src/agent.ts +568 -0
  37. package/packages/pi-agent-core/src/index.ts +8 -0
  38. package/packages/pi-agent-core/src/proxy.ts +340 -0
  39. package/packages/pi-agent-core/src/types.ts +194 -0
  40. package/packages/pi-agent-core/tsconfig.json +27 -0
  41. package/packages/pi-ai/bedrock-provider.d.ts +1 -0
  42. package/packages/pi-ai/bedrock-provider.js +1 -0
  43. package/packages/pi-ai/dist/api-registry.d.ts +20 -0
  44. package/packages/pi-ai/dist/api-registry.d.ts.map +1 -0
  45. package/packages/pi-ai/dist/api-registry.js +44 -0
  46. package/packages/pi-ai/dist/api-registry.js.map +1 -0
  47. package/packages/pi-ai/dist/bedrock-provider.d.ts +5 -0
  48. package/packages/pi-ai/dist/bedrock-provider.d.ts.map +1 -0
  49. package/packages/pi-ai/dist/bedrock-provider.js +6 -0
  50. package/packages/pi-ai/dist/bedrock-provider.js.map +1 -0
  51. package/packages/pi-ai/dist/cli.d.ts +3 -0
  52. package/packages/pi-ai/dist/cli.d.ts.map +1 -0
  53. package/packages/pi-ai/dist/cli.js +116 -0
  54. package/packages/pi-ai/dist/cli.js.map +1 -0
  55. package/packages/pi-ai/dist/env-api-keys.d.ts +9 -0
  56. package/packages/pi-ai/dist/env-api-keys.d.ts.map +1 -0
  57. package/packages/pi-ai/dist/env-api-keys.js +104 -0
  58. package/packages/pi-ai/dist/env-api-keys.js.map +1 -0
  59. package/packages/pi-ai/dist/index.d.ts +23 -0
  60. package/packages/pi-ai/dist/index.d.ts.map +1 -0
  61. package/packages/pi-ai/dist/index.js +21 -0
  62. package/packages/pi-ai/dist/index.js.map +1 -0
  63. package/packages/pi-ai/dist/models.d.ts +24 -0
  64. package/packages/pi-ai/dist/models.d.ts.map +1 -0
  65. package/packages/pi-ai/dist/models.generated.d.ts +13572 -0
  66. package/packages/pi-ai/dist/models.generated.d.ts.map +1 -0
  67. package/packages/pi-ai/dist/models.generated.js +13368 -0
  68. package/packages/pi-ai/dist/models.generated.js.map +1 -0
  69. package/packages/pi-ai/dist/models.js +55 -0
  70. package/packages/pi-ai/dist/models.js.map +1 -0
  71. package/packages/pi-ai/dist/oauth.d.ts +2 -0
  72. package/packages/pi-ai/dist/oauth.d.ts.map +1 -0
  73. package/packages/pi-ai/dist/oauth.js +2 -0
  74. package/packages/pi-ai/dist/oauth.js.map +1 -0
  75. package/packages/pi-ai/dist/providers/amazon-bedrock.d.ts +15 -0
  76. package/packages/pi-ai/dist/providers/amazon-bedrock.d.ts.map +1 -0
  77. package/packages/pi-ai/dist/providers/amazon-bedrock.js +600 -0
  78. package/packages/pi-ai/dist/providers/amazon-bedrock.js.map +1 -0
  79. package/packages/pi-ai/dist/providers/anthropic.d.ts +33 -0
  80. package/packages/pi-ai/dist/providers/anthropic.d.ts.map +1 -0
  81. package/packages/pi-ai/dist/providers/anthropic.js +732 -0
  82. package/packages/pi-ai/dist/providers/anthropic.js.map +1 -0
  83. package/packages/pi-ai/dist/providers/azure-openai-responses.d.ts +15 -0
  84. package/packages/pi-ai/dist/providers/azure-openai-responses.d.ts.map +1 -0
  85. package/packages/pi-ai/dist/providers/azure-openai-responses.js +187 -0
  86. package/packages/pi-ai/dist/providers/azure-openai-responses.js.map +1 -0
  87. package/packages/pi-ai/dist/providers/github-copilot-headers.d.ts +8 -0
  88. package/packages/pi-ai/dist/providers/github-copilot-headers.d.ts.map +1 -0
  89. package/packages/pi-ai/dist/providers/github-copilot-headers.js +29 -0
  90. package/packages/pi-ai/dist/providers/github-copilot-headers.js.map +1 -0
  91. package/packages/pi-ai/dist/providers/google-gemini-cli.d.ts +74 -0
  92. package/packages/pi-ai/dist/providers/google-gemini-cli.d.ts.map +1 -0
  93. package/packages/pi-ai/dist/providers/google-gemini-cli.js +757 -0
  94. package/packages/pi-ai/dist/providers/google-gemini-cli.js.map +1 -0
  95. package/packages/pi-ai/dist/providers/google-shared.d.ts +65 -0
  96. package/packages/pi-ai/dist/providers/google-shared.d.ts.map +1 -0
  97. package/packages/pi-ai/dist/providers/google-shared.js +300 -0
  98. package/packages/pi-ai/dist/providers/google-shared.js.map +1 -0
  99. package/packages/pi-ai/dist/providers/google-vertex.d.ts +15 -0
  100. package/packages/pi-ai/dist/providers/google-vertex.d.ts.map +1 -0
  101. package/packages/pi-ai/dist/providers/google-vertex.js +374 -0
  102. package/packages/pi-ai/dist/providers/google-vertex.js.map +1 -0
  103. package/packages/pi-ai/dist/providers/google.d.ts +13 -0
  104. package/packages/pi-ai/dist/providers/google.d.ts.map +1 -0
  105. package/packages/pi-ai/dist/providers/google.js +355 -0
  106. package/packages/pi-ai/dist/providers/google.js.map +1 -0
  107. package/packages/pi-ai/dist/providers/mistral.d.ts +22 -0
  108. package/packages/pi-ai/dist/providers/mistral.d.ts.map +1 -0
  109. package/packages/pi-ai/dist/providers/mistral.js +498 -0
  110. package/packages/pi-ai/dist/providers/mistral.js.map +1 -0
  111. package/packages/pi-ai/dist/providers/openai-codex-responses.d.ts +9 -0
  112. package/packages/pi-ai/dist/providers/openai-codex-responses.d.ts.map +1 -0
  113. package/packages/pi-ai/dist/providers/openai-codex-responses.js +704 -0
  114. package/packages/pi-ai/dist/providers/openai-codex-responses.js.map +1 -0
  115. package/packages/pi-ai/dist/providers/openai-completions.d.ts +15 -0
  116. package/packages/pi-ai/dist/providers/openai-completions.d.ts.map +1 -0
  117. package/packages/pi-ai/dist/providers/openai-completions.js +705 -0
  118. package/packages/pi-ai/dist/providers/openai-completions.js.map +1 -0
  119. package/packages/pi-ai/dist/providers/openai-responses-shared.d.ts +17 -0
  120. package/packages/pi-ai/dist/providers/openai-responses-shared.d.ts.map +1 -0
  121. package/packages/pi-ai/dist/providers/openai-responses-shared.js +442 -0
  122. package/packages/pi-ai/dist/providers/openai-responses-shared.js.map +1 -0
  123. package/packages/pi-ai/dist/providers/openai-responses.d.ts +13 -0
  124. package/packages/pi-ai/dist/providers/openai-responses.d.ts.map +1 -0
  125. package/packages/pi-ai/dist/providers/openai-responses.js +201 -0
  126. package/packages/pi-ai/dist/providers/openai-responses.js.map +1 -0
  127. package/packages/pi-ai/dist/providers/register-builtins.d.ts +11 -0
  128. package/packages/pi-ai/dist/providers/register-builtins.d.ts.map +1 -0
  129. package/packages/pi-ai/dist/providers/register-builtins.js +138 -0
  130. package/packages/pi-ai/dist/providers/register-builtins.js.map +1 -0
  131. package/packages/pi-ai/dist/providers/simple-options.d.ts +8 -0
  132. package/packages/pi-ai/dist/providers/simple-options.d.ts.map +1 -0
  133. package/packages/pi-ai/dist/providers/simple-options.js +35 -0
  134. package/packages/pi-ai/dist/providers/simple-options.js.map +1 -0
  135. package/packages/pi-ai/dist/providers/transform-messages.d.ts +8 -0
  136. package/packages/pi-ai/dist/providers/transform-messages.d.ts.map +1 -0
  137. package/packages/pi-ai/dist/providers/transform-messages.js +155 -0
  138. package/packages/pi-ai/dist/providers/transform-messages.js.map +1 -0
  139. package/packages/pi-ai/dist/stream.d.ts +8 -0
  140. package/packages/pi-ai/dist/stream.d.ts.map +1 -0
  141. package/packages/pi-ai/dist/stream.js +27 -0
  142. package/packages/pi-ai/dist/stream.js.map +1 -0
  143. package/packages/pi-ai/dist/types.d.ts +285 -0
  144. package/packages/pi-ai/dist/types.d.ts.map +1 -0
  145. package/packages/pi-ai/dist/types.js +2 -0
  146. package/packages/pi-ai/dist/types.js.map +1 -0
  147. package/packages/pi-ai/dist/utils/event-stream.d.ts +21 -0
  148. package/packages/pi-ai/dist/utils/event-stream.d.ts.map +1 -0
  149. package/packages/pi-ai/dist/utils/event-stream.js +77 -0
  150. package/packages/pi-ai/dist/utils/event-stream.js.map +1 -0
  151. package/packages/pi-ai/dist/utils/hash.d.ts +3 -0
  152. package/packages/pi-ai/dist/utils/hash.d.ts.map +1 -0
  153. package/packages/pi-ai/dist/utils/hash.js +14 -0
  154. package/packages/pi-ai/dist/utils/hash.js.map +1 -0
  155. package/packages/pi-ai/dist/utils/json-parse.d.ts +9 -0
  156. package/packages/pi-ai/dist/utils/json-parse.d.ts.map +1 -0
  157. package/packages/pi-ai/dist/utils/json-parse.js +29 -0
  158. package/packages/pi-ai/dist/utils/json-parse.js.map +1 -0
  159. package/packages/pi-ai/dist/utils/oauth/anthropic.d.ts +17 -0
  160. package/packages/pi-ai/dist/utils/oauth/anthropic.d.ts.map +1 -0
  161. package/packages/pi-ai/dist/utils/oauth/anthropic.js +104 -0
  162. package/packages/pi-ai/dist/utils/oauth/anthropic.js.map +1 -0
  163. package/packages/pi-ai/dist/utils/oauth/github-copilot.d.ts +30 -0
  164. package/packages/pi-ai/dist/utils/oauth/github-copilot.d.ts.map +1 -0
  165. package/packages/pi-ai/dist/utils/oauth/github-copilot.js +281 -0
  166. package/packages/pi-ai/dist/utils/oauth/github-copilot.js.map +1 -0
  167. package/packages/pi-ai/dist/utils/oauth/google-antigravity.d.ts +26 -0
  168. package/packages/pi-ai/dist/utils/oauth/google-antigravity.d.ts.map +1 -0
  169. package/packages/pi-ai/dist/utils/oauth/google-antigravity.js +373 -0
  170. package/packages/pi-ai/dist/utils/oauth/google-antigravity.js.map +1 -0
  171. package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.d.ts +26 -0
  172. package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.d.ts.map +1 -0
  173. package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.js +478 -0
  174. package/packages/pi-ai/dist/utils/oauth/google-gemini-cli.js.map +1 -0
  175. package/packages/pi-ai/dist/utils/oauth/index.d.ts +61 -0
  176. package/packages/pi-ai/dist/utils/oauth/index.d.ts.map +1 -0
  177. package/packages/pi-ai/dist/utils/oauth/index.js +131 -0
  178. package/packages/pi-ai/dist/utils/oauth/index.js.map +1 -0
  179. package/packages/pi-ai/dist/utils/oauth/openai-codex.d.ts +34 -0
  180. package/packages/pi-ai/dist/utils/oauth/openai-codex.d.ts.map +1 -0
  181. package/packages/pi-ai/dist/utils/oauth/openai-codex.js +380 -0
  182. package/packages/pi-ai/dist/utils/oauth/openai-codex.js.map +1 -0
  183. package/packages/pi-ai/dist/utils/oauth/pkce.d.ts +13 -0
  184. package/packages/pi-ai/dist/utils/oauth/pkce.d.ts.map +1 -0
  185. package/packages/pi-ai/dist/utils/oauth/pkce.js +31 -0
  186. package/packages/pi-ai/dist/utils/oauth/pkce.js.map +1 -0
  187. package/packages/pi-ai/dist/utils/oauth/types.d.ts +47 -0
  188. package/packages/pi-ai/dist/utils/oauth/types.d.ts.map +1 -0
  189. package/packages/pi-ai/dist/utils/oauth/types.js +2 -0
  190. package/packages/pi-ai/dist/utils/oauth/types.js.map +1 -0
  191. package/packages/pi-ai/dist/utils/overflow.d.ts +52 -0
  192. package/packages/pi-ai/dist/utils/overflow.d.ts.map +1 -0
  193. package/packages/pi-ai/dist/utils/overflow.js +117 -0
  194. package/packages/pi-ai/dist/utils/overflow.js.map +1 -0
  195. package/packages/pi-ai/dist/utils/sanitize-unicode.d.ts +22 -0
  196. package/packages/pi-ai/dist/utils/sanitize-unicode.d.ts.map +1 -0
  197. package/packages/pi-ai/dist/utils/sanitize-unicode.js +26 -0
  198. package/packages/pi-ai/dist/utils/sanitize-unicode.js.map +1 -0
  199. package/packages/pi-ai/dist/utils/typebox-helpers.d.ts +17 -0
  200. package/packages/pi-ai/dist/utils/typebox-helpers.d.ts.map +1 -0
  201. package/packages/pi-ai/dist/utils/typebox-helpers.js +21 -0
  202. package/packages/pi-ai/dist/utils/typebox-helpers.js.map +1 -0
  203. package/packages/pi-ai/dist/utils/validation.d.ts +18 -0
  204. package/packages/pi-ai/dist/utils/validation.d.ts.map +1 -0
  205. package/packages/pi-ai/dist/utils/validation.js +72 -0
  206. package/packages/pi-ai/dist/utils/validation.js.map +1 -0
  207. package/packages/pi-ai/package.json +40 -0
  208. package/packages/pi-ai/src/api-registry.ts +98 -0
  209. package/packages/pi-ai/src/bedrock-provider.ts +6 -0
  210. package/packages/pi-ai/src/cli.ts +133 -0
  211. package/packages/pi-ai/src/env-api-keys.ts +129 -0
  212. package/packages/pi-ai/src/index.ts +32 -0
  213. package/packages/pi-ai/src/models.generated.ts +13370 -0
  214. package/packages/pi-ai/src/models.ts +77 -0
  215. package/packages/pi-ai/src/oauth.ts +1 -0
  216. package/packages/pi-ai/src/providers/amazon-bedrock.ts +751 -0
  217. package/packages/pi-ai/src/providers/anthropic.ts +883 -0
  218. package/packages/pi-ai/src/providers/azure-openai-responses.ts +259 -0
  219. package/packages/pi-ai/src/providers/github-copilot-headers.ts +37 -0
  220. package/packages/pi-ai/src/providers/google-gemini-cli.ts +967 -0
  221. package/packages/pi-ai/src/providers/google-shared.ts +313 -0
  222. package/packages/pi-ai/src/providers/google-vertex.ts +485 -0
  223. package/packages/pi-ai/src/providers/google.ts +455 -0
  224. package/packages/pi-ai/src/providers/mistral.ts +582 -0
  225. package/packages/pi-ai/src/providers/openai-codex-responses.ts +875 -0
  226. package/packages/pi-ai/src/providers/openai-completions.ts +820 -0
  227. package/packages/pi-ai/src/providers/openai-responses-shared.ts +496 -0
  228. package/packages/pi-ai/src/providers/openai-responses.ts +262 -0
  229. package/packages/pi-ai/src/providers/register-builtins.ts +186 -0
  230. package/packages/pi-ai/src/providers/simple-options.ts +46 -0
  231. package/packages/pi-ai/src/providers/transform-messages.ts +172 -0
  232. package/packages/pi-ai/src/stream.ts +59 -0
  233. package/packages/pi-ai/src/types.ts +321 -0
  234. package/packages/pi-ai/src/utils/event-stream.ts +87 -0
  235. package/packages/pi-ai/src/utils/hash.ts +13 -0
  236. package/packages/pi-ai/src/utils/json-parse.ts +28 -0
  237. package/packages/pi-ai/src/utils/oauth/anthropic.ts +138 -0
  238. package/packages/pi-ai/src/utils/oauth/github-copilot.ts +381 -0
  239. package/packages/pi-ai/src/utils/oauth/google-antigravity.ts +457 -0
  240. package/packages/pi-ai/src/utils/oauth/google-gemini-cli.ts +599 -0
  241. package/packages/pi-ai/src/utils/oauth/index.ts +162 -0
  242. package/packages/pi-ai/src/utils/oauth/openai-codex.ts +455 -0
  243. package/packages/pi-ai/src/utils/oauth/pkce.ts +34 -0
  244. package/packages/pi-ai/src/utils/oauth/types.ts +59 -0
  245. package/packages/pi-ai/src/utils/overflow.ts +123 -0
  246. package/packages/pi-ai/src/utils/sanitize-unicode.ts +25 -0
  247. package/packages/pi-ai/src/utils/typebox-helpers.ts +24 -0
  248. package/packages/pi-ai/src/utils/validation.ts +84 -0
  249. package/packages/pi-ai/tsconfig.json +27 -0
  250. package/packages/pi-coding-agent/dist/cli/args.d.ts +48 -0
  251. package/packages/pi-coding-agent/dist/cli/args.d.ts.map +1 -0
  252. package/packages/pi-coding-agent/dist/cli/args.js +299 -0
  253. package/packages/pi-coding-agent/dist/cli/args.js.map +1 -0
  254. package/packages/pi-coding-agent/dist/cli/config-selector.d.ts +14 -0
  255. package/packages/pi-coding-agent/dist/cli/config-selector.d.ts.map +1 -0
  256. package/packages/pi-coding-agent/dist/cli/config-selector.js +31 -0
  257. package/packages/pi-coding-agent/dist/cli/config-selector.js.map +1 -0
  258. package/packages/pi-coding-agent/dist/cli/file-processor.d.ts +15 -0
  259. package/packages/pi-coding-agent/dist/cli/file-processor.d.ts.map +1 -0
  260. package/packages/pi-coding-agent/dist/cli/file-processor.js +79 -0
  261. package/packages/pi-coding-agent/dist/cli/file-processor.js.map +1 -0
  262. package/packages/pi-coding-agent/dist/cli/list-models.d.ts +9 -0
  263. package/packages/pi-coding-agent/dist/cli/list-models.d.ts.map +1 -0
  264. package/packages/pi-coding-agent/dist/cli/list-models.js +92 -0
  265. package/packages/pi-coding-agent/dist/cli/list-models.js.map +1 -0
  266. package/packages/pi-coding-agent/dist/cli/session-picker.d.ts +9 -0
  267. package/packages/pi-coding-agent/dist/cli/session-picker.d.ts.map +1 -0
  268. package/packages/pi-coding-agent/dist/cli/session-picker.js +34 -0
  269. package/packages/pi-coding-agent/dist/cli/session-picker.js.map +1 -0
  270. package/packages/pi-coding-agent/dist/cli.d.ts +3 -0
  271. package/packages/pi-coding-agent/dist/cli.d.ts.map +1 -0
  272. package/packages/pi-coding-agent/dist/cli.js +16 -0
  273. package/packages/pi-coding-agent/dist/cli.js.map +1 -0
  274. package/packages/pi-coding-agent/dist/config.d.ts +68 -0
  275. package/packages/pi-coding-agent/dist/config.d.ts.map +1 -0
  276. package/packages/pi-coding-agent/dist/config.js +203 -0
  277. package/packages/pi-coding-agent/dist/config.js.map +1 -0
  278. package/packages/pi-coding-agent/dist/core/agent-session.d.ts +618 -0
  279. package/packages/pi-coding-agent/dist/core/agent-session.d.ts.map +1 -0
  280. package/packages/pi-coding-agent/dist/core/agent-session.js +2481 -0
  281. package/packages/pi-coding-agent/dist/core/agent-session.js.map +1 -0
  282. package/packages/pi-coding-agent/dist/core/auth-storage.d.ts +134 -0
  283. package/packages/pi-coding-agent/dist/core/auth-storage.d.ts.map +1 -0
  284. package/packages/pi-coding-agent/dist/core/auth-storage.js +415 -0
  285. package/packages/pi-coding-agent/dist/core/auth-storage.js.map +1 -0
  286. package/packages/pi-coding-agent/dist/core/bash-executor.d.ts +47 -0
  287. package/packages/pi-coding-agent/dist/core/bash-executor.d.ts.map +1 -0
  288. package/packages/pi-coding-agent/dist/core/bash-executor.js +212 -0
  289. package/packages/pi-coding-agent/dist/core/bash-executor.js.map +1 -0
  290. package/packages/pi-coding-agent/dist/core/compaction/branch-summarization.d.ts +86 -0
  291. package/packages/pi-coding-agent/dist/core/compaction/branch-summarization.d.ts.map +1 -0
  292. package/packages/pi-coding-agent/dist/core/compaction/branch-summarization.js +242 -0
  293. package/packages/pi-coding-agent/dist/core/compaction/branch-summarization.js.map +1 -0
  294. package/packages/pi-coding-agent/dist/core/compaction/compaction.d.ts +121 -0
  295. package/packages/pi-coding-agent/dist/core/compaction/compaction.d.ts.map +1 -0
  296. package/packages/pi-coding-agent/dist/core/compaction/compaction.js +610 -0
  297. package/packages/pi-coding-agent/dist/core/compaction/compaction.js.map +1 -0
  298. package/packages/pi-coding-agent/dist/core/compaction/index.d.ts +7 -0
  299. package/packages/pi-coding-agent/dist/core/compaction/index.d.ts.map +1 -0
  300. package/packages/pi-coding-agent/dist/core/compaction/index.js +7 -0
  301. package/packages/pi-coding-agent/dist/core/compaction/index.js.map +1 -0
  302. package/packages/pi-coding-agent/dist/core/compaction/utils.d.ts +38 -0
  303. package/packages/pi-coding-agent/dist/core/compaction/utils.d.ts.map +1 -0
  304. package/packages/pi-coding-agent/dist/core/compaction/utils.js +153 -0
  305. package/packages/pi-coding-agent/dist/core/compaction/utils.js.map +1 -0
  306. package/packages/pi-coding-agent/dist/core/defaults.d.ts +3 -0
  307. package/packages/pi-coding-agent/dist/core/defaults.d.ts.map +1 -0
  308. package/packages/pi-coding-agent/dist/core/defaults.js +2 -0
  309. package/packages/pi-coding-agent/dist/core/defaults.js.map +1 -0
  310. package/packages/pi-coding-agent/dist/core/diagnostics.d.ts +15 -0
  311. package/packages/pi-coding-agent/dist/core/diagnostics.d.ts.map +1 -0
  312. package/packages/pi-coding-agent/dist/core/diagnostics.js +2 -0
  313. package/packages/pi-coding-agent/dist/core/diagnostics.js.map +1 -0
  314. package/packages/pi-coding-agent/dist/core/event-bus.d.ts +9 -0
  315. package/packages/pi-coding-agent/dist/core/event-bus.d.ts.map +1 -0
  316. package/packages/pi-coding-agent/dist/core/event-bus.js +25 -0
  317. package/packages/pi-coding-agent/dist/core/event-bus.js.map +1 -0
  318. package/packages/pi-coding-agent/dist/core/exec.d.ts +29 -0
  319. package/packages/pi-coding-agent/dist/core/exec.d.ts.map +1 -0
  320. package/packages/pi-coding-agent/dist/core/exec.js +71 -0
  321. package/packages/pi-coding-agent/dist/core/exec.js.map +1 -0
  322. package/packages/pi-coding-agent/dist/core/export-html/ansi-to-html.d.ts +22 -0
  323. package/packages/pi-coding-agent/dist/core/export-html/ansi-to-html.d.ts.map +1 -0
  324. package/packages/pi-coding-agent/dist/core/export-html/ansi-to-html.js +249 -0
  325. package/packages/pi-coding-agent/dist/core/export-html/ansi-to-html.js.map +1 -0
  326. package/packages/pi-coding-agent/dist/core/export-html/index.d.ts +37 -0
  327. package/packages/pi-coding-agent/dist/core/export-html/index.d.ts.map +1 -0
  328. package/packages/pi-coding-agent/dist/core/export-html/index.js +223 -0
  329. package/packages/pi-coding-agent/dist/core/export-html/index.js.map +1 -0
  330. package/packages/pi-coding-agent/dist/core/export-html/template.css +971 -0
  331. package/packages/pi-coding-agent/dist/core/export-html/template.html +54 -0
  332. package/packages/pi-coding-agent/dist/core/export-html/template.js +1583 -0
  333. package/packages/pi-coding-agent/dist/core/export-html/tool-renderer.d.ts +38 -0
  334. package/packages/pi-coding-agent/dist/core/export-html/tool-renderer.d.ts.map +1 -0
  335. package/packages/pi-coding-agent/dist/core/export-html/tool-renderer.js +70 -0
  336. package/packages/pi-coding-agent/dist/core/export-html/tool-renderer.js.map +1 -0
  337. package/packages/pi-coding-agent/dist/core/export-html/vendor/.gitkeep +0 -0
  338. package/packages/pi-coding-agent/dist/core/extensions/index.d.ts +11 -0
  339. package/packages/pi-coding-agent/dist/core/extensions/index.d.ts.map +1 -0
  340. package/packages/pi-coding-agent/dist/core/extensions/index.js +9 -0
  341. package/packages/pi-coding-agent/dist/core/extensions/index.js.map +1 -0
  342. package/packages/pi-coding-agent/dist/core/extensions/loader.d.ts +25 -0
  343. package/packages/pi-coding-agent/dist/core/extensions/loader.d.ts.map +1 -0
  344. package/packages/pi-coding-agent/dist/core/extensions/loader.js +426 -0
  345. package/packages/pi-coding-agent/dist/core/extensions/loader.js.map +1 -0
  346. package/packages/pi-coding-agent/dist/core/extensions/runner.d.ts +147 -0
  347. package/packages/pi-coding-agent/dist/core/extensions/runner.d.ts.map +1 -0
  348. package/packages/pi-coding-agent/dist/core/extensions/runner.js +672 -0
  349. package/packages/pi-coding-agent/dist/core/extensions/runner.js.map +1 -0
  350. package/packages/pi-coding-agent/dist/core/extensions/types.d.ts +1040 -0
  351. package/packages/pi-coding-agent/dist/core/extensions/types.d.ts.map +1 -0
  352. package/packages/pi-coding-agent/dist/core/extensions/types.js +35 -0
  353. package/packages/pi-coding-agent/dist/core/extensions/types.js.map +1 -0
  354. package/packages/pi-coding-agent/dist/core/extensions/wrapper.d.ts +27 -0
  355. package/packages/pi-coding-agent/dist/core/extensions/wrapper.d.ts.map +1 -0
  356. package/packages/pi-coding-agent/dist/core/extensions/wrapper.js +102 -0
  357. package/packages/pi-coding-agent/dist/core/extensions/wrapper.js.map +1 -0
  358. package/packages/pi-coding-agent/dist/core/footer-data-provider.d.ts +32 -0
  359. package/packages/pi-coding-agent/dist/core/footer-data-provider.d.ts.map +1 -0
  360. package/packages/pi-coding-agent/dist/core/footer-data-provider.js +134 -0
  361. package/packages/pi-coding-agent/dist/core/footer-data-provider.js.map +1 -0
  362. package/packages/pi-coding-agent/dist/core/index.d.ts +9 -0
  363. package/packages/pi-coding-agent/dist/core/index.d.ts.map +1 -0
  364. package/packages/pi-coding-agent/dist/core/index.js +9 -0
  365. package/packages/pi-coding-agent/dist/core/index.js.map +1 -0
  366. package/packages/pi-coding-agent/dist/core/keybindings.d.ts +55 -0
  367. package/packages/pi-coding-agent/dist/core/keybindings.d.ts.map +1 -0
  368. package/packages/pi-coding-agent/dist/core/keybindings.js +151 -0
  369. package/packages/pi-coding-agent/dist/core/keybindings.js.map +1 -0
  370. package/packages/pi-coding-agent/dist/core/messages.d.ts +77 -0
  371. package/packages/pi-coding-agent/dist/core/messages.d.ts.map +1 -0
  372. package/packages/pi-coding-agent/dist/core/messages.js +123 -0
  373. package/packages/pi-coding-agent/dist/core/messages.js.map +1 -0
  374. package/packages/pi-coding-agent/dist/core/model-registry.d.ts +113 -0
  375. package/packages/pi-coding-agent/dist/core/model-registry.d.ts.map +1 -0
  376. package/packages/pi-coding-agent/dist/core/model-registry.js +537 -0
  377. package/packages/pi-coding-agent/dist/core/model-registry.js.map +1 -0
  378. package/packages/pi-coding-agent/dist/core/model-resolver.d.ts +104 -0
  379. package/packages/pi-coding-agent/dist/core/model-resolver.d.ts.map +1 -0
  380. package/packages/pi-coding-agent/dist/core/model-resolver.js +462 -0
  381. package/packages/pi-coding-agent/dist/core/model-resolver.js.map +1 -0
  382. package/packages/pi-coding-agent/dist/core/package-manager.d.ts +156 -0
  383. package/packages/pi-coding-agent/dist/core/package-manager.d.ts.map +1 -0
  384. package/packages/pi-coding-agent/dist/core/package-manager.js +1442 -0
  385. package/packages/pi-coding-agent/dist/core/package-manager.js.map +1 -0
  386. package/packages/pi-coding-agent/dist/core/prompt-templates.d.ts +50 -0
  387. package/packages/pi-coding-agent/dist/core/prompt-templates.d.ts.map +1 -0
  388. package/packages/pi-coding-agent/dist/core/prompt-templates.js +251 -0
  389. package/packages/pi-coding-agent/dist/core/prompt-templates.js.map +1 -0
  390. package/packages/pi-coding-agent/dist/core/resolve-config-value.d.ts +17 -0
  391. package/packages/pi-coding-agent/dist/core/resolve-config-value.d.ts.map +1 -0
  392. package/packages/pi-coding-agent/dist/core/resolve-config-value.js +59 -0
  393. package/packages/pi-coding-agent/dist/core/resolve-config-value.js.map +1 -0
  394. package/packages/pi-coding-agent/dist/core/resource-loader.d.ts +184 -0
  395. package/packages/pi-coding-agent/dist/core/resource-loader.d.ts.map +1 -0
  396. package/packages/pi-coding-agent/dist/core/resource-loader.js +633 -0
  397. package/packages/pi-coding-agent/dist/core/resource-loader.js.map +1 -0
  398. package/packages/pi-coding-agent/dist/core/sdk.d.ts +90 -0
  399. package/packages/pi-coding-agent/dist/core/sdk.d.ts.map +1 -0
  400. package/packages/pi-coding-agent/dist/core/sdk.js +242 -0
  401. package/packages/pi-coding-agent/dist/core/sdk.js.map +1 -0
  402. package/packages/pi-coding-agent/dist/core/session-manager.d.ts +323 -0
  403. package/packages/pi-coding-agent/dist/core/session-manager.d.ts.map +1 -0
  404. package/packages/pi-coding-agent/dist/core/session-manager.js +1094 -0
  405. package/packages/pi-coding-agent/dist/core/session-manager.js.map +1 -0
  406. package/packages/pi-coding-agent/dist/core/settings-manager.d.ts +232 -0
  407. package/packages/pi-coding-agent/dist/core/settings-manager.d.ts.map +1 -0
  408. package/packages/pi-coding-agent/dist/core/settings-manager.js +682 -0
  409. package/packages/pi-coding-agent/dist/core/settings-manager.js.map +1 -0
  410. package/packages/pi-coding-agent/dist/core/skills.d.ts +58 -0
  411. package/packages/pi-coding-agent/dist/core/skills.d.ts.map +1 -0
  412. package/packages/pi-coding-agent/dist/core/skills.js +364 -0
  413. package/packages/pi-coding-agent/dist/core/skills.js.map +1 -0
  414. package/packages/pi-coding-agent/dist/core/slash-commands.d.ts +15 -0
  415. package/packages/pi-coding-agent/dist/core/slash-commands.d.ts.map +1 -0
  416. package/packages/pi-coding-agent/dist/core/slash-commands.js +22 -0
  417. package/packages/pi-coding-agent/dist/core/slash-commands.js.map +1 -0
  418. package/packages/pi-coding-agent/dist/core/system-prompt.d.ts +28 -0
  419. package/packages/pi-coding-agent/dist/core/system-prompt.d.ts.map +1 -0
  420. package/packages/pi-coding-agent/dist/core/system-prompt.js +159 -0
  421. package/packages/pi-coding-agent/dist/core/system-prompt.js.map +1 -0
  422. package/packages/pi-coding-agent/dist/core/timings.d.ts +7 -0
  423. package/packages/pi-coding-agent/dist/core/timings.d.ts.map +1 -0
  424. package/packages/pi-coding-agent/dist/core/timings.js +25 -0
  425. package/packages/pi-coding-agent/dist/core/timings.js.map +1 -0
  426. package/packages/pi-coding-agent/dist/core/tools/bash.d.ts +55 -0
  427. package/packages/pi-coding-agent/dist/core/tools/bash.d.ts.map +1 -0
  428. package/packages/pi-coding-agent/dist/core/tools/bash.js +269 -0
  429. package/packages/pi-coding-agent/dist/core/tools/bash.js.map +1 -0
  430. package/packages/pi-coding-agent/dist/core/tools/edit-diff.d.ts +63 -0
  431. package/packages/pi-coding-agent/dist/core/tools/edit-diff.d.ts.map +1 -0
  432. package/packages/pi-coding-agent/dist/core/tools/edit-diff.js +243 -0
  433. package/packages/pi-coding-agent/dist/core/tools/edit-diff.js.map +1 -0
  434. package/packages/pi-coding-agent/dist/core/tools/edit.d.ts +39 -0
  435. package/packages/pi-coding-agent/dist/core/tools/edit.d.ts.map +1 -0
  436. package/packages/pi-coding-agent/dist/core/tools/edit.js +146 -0
  437. package/packages/pi-coding-agent/dist/core/tools/edit.js.map +1 -0
  438. package/packages/pi-coding-agent/dist/core/tools/find.d.ts +39 -0
  439. package/packages/pi-coding-agent/dist/core/tools/find.d.ts.map +1 -0
  440. package/packages/pi-coding-agent/dist/core/tools/find.js +206 -0
  441. package/packages/pi-coding-agent/dist/core/tools/find.js.map +1 -0
  442. package/packages/pi-coding-agent/dist/core/tools/grep.d.ts +45 -0
  443. package/packages/pi-coding-agent/dist/core/tools/grep.d.ts.map +1 -0
  444. package/packages/pi-coding-agent/dist/core/tools/grep.js +239 -0
  445. package/packages/pi-coding-agent/dist/core/tools/grep.js.map +1 -0
  446. package/packages/pi-coding-agent/dist/core/tools/index.d.ts +73 -0
  447. package/packages/pi-coding-agent/dist/core/tools/index.d.ts.map +1 -0
  448. package/packages/pi-coding-agent/dist/core/tools/index.js +61 -0
  449. package/packages/pi-coding-agent/dist/core/tools/index.js.map +1 -0
  450. package/packages/pi-coding-agent/dist/core/tools/ls.d.ts +40 -0
  451. package/packages/pi-coding-agent/dist/core/tools/ls.d.ts.map +1 -0
  452. package/packages/pi-coding-agent/dist/core/tools/ls.js +118 -0
  453. package/packages/pi-coding-agent/dist/core/tools/ls.js.map +1 -0
  454. package/packages/pi-coding-agent/dist/core/tools/path-utils.d.ts +8 -0
  455. package/packages/pi-coding-agent/dist/core/tools/path-utils.d.ts.map +1 -0
  456. package/packages/pi-coding-agent/dist/core/tools/path-utils.js +81 -0
  457. package/packages/pi-coding-agent/dist/core/tools/path-utils.js.map +1 -0
  458. package/packages/pi-coding-agent/dist/core/tools/read.d.ts +39 -0
  459. package/packages/pi-coding-agent/dist/core/tools/read.d.ts.map +1 -0
  460. package/packages/pi-coding-agent/dist/core/tools/read.js +166 -0
  461. package/packages/pi-coding-agent/dist/core/tools/read.js.map +1 -0
  462. package/packages/pi-coding-agent/dist/core/tools/truncate.d.ts +70 -0
  463. package/packages/pi-coding-agent/dist/core/tools/truncate.d.ts.map +1 -0
  464. package/packages/pi-coding-agent/dist/core/tools/truncate.js +205 -0
  465. package/packages/pi-coding-agent/dist/core/tools/truncate.js.map +1 -0
  466. package/packages/pi-coding-agent/dist/core/tools/write.d.ts +29 -0
  467. package/packages/pi-coding-agent/dist/core/tools/write.d.ts.map +1 -0
  468. package/packages/pi-coding-agent/dist/core/tools/write.js +78 -0
  469. package/packages/pi-coding-agent/dist/core/tools/write.js.map +1 -0
  470. package/packages/pi-coding-agent/dist/index.d.ts +27 -0
  471. package/packages/pi-coding-agent/dist/index.d.ts.map +1 -0
  472. package/packages/pi-coding-agent/dist/index.js +42 -0
  473. package/packages/pi-coding-agent/dist/index.js.map +1 -0
  474. package/packages/pi-coding-agent/dist/main.d.ts +8 -0
  475. package/packages/pi-coding-agent/dist/main.d.ts.map +1 -0
  476. package/packages/pi-coding-agent/dist/main.js +691 -0
  477. package/packages/pi-coding-agent/dist/main.js.map +1 -0
  478. package/packages/pi-coding-agent/dist/migrations.d.ts +33 -0
  479. package/packages/pi-coding-agent/dist/migrations.d.ts.map +1 -0
  480. package/packages/pi-coding-agent/dist/migrations.js +261 -0
  481. package/packages/pi-coding-agent/dist/migrations.js.map +1 -0
  482. package/packages/pi-coding-agent/dist/modes/index.d.ts +9 -0
  483. package/packages/pi-coding-agent/dist/modes/index.d.ts.map +1 -0
  484. package/packages/pi-coding-agent/dist/modes/index.js +8 -0
  485. package/packages/pi-coding-agent/dist/modes/index.js.map +1 -0
  486. package/packages/pi-coding-agent/dist/modes/interactive/components/armin.d.ts +34 -0
  487. package/packages/pi-coding-agent/dist/modes/interactive/components/armin.d.ts.map +1 -0
  488. package/packages/pi-coding-agent/dist/modes/interactive/components/armin.js +329 -0
  489. package/packages/pi-coding-agent/dist/modes/interactive/components/armin.js.map +1 -0
  490. package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.d.ts +16 -0
  491. package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.d.ts.map +1 -0
  492. package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.js +92 -0
  493. package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.js.map +1 -0
  494. package/packages/pi-coding-agent/dist/modes/interactive/components/bash-execution.d.ts +35 -0
  495. package/packages/pi-coding-agent/dist/modes/interactive/components/bash-execution.d.ts.map +1 -0
  496. package/packages/pi-coding-agent/dist/modes/interactive/components/bash-execution.js +156 -0
  497. package/packages/pi-coding-agent/dist/modes/interactive/components/bash-execution.js.map +1 -0
  498. package/packages/pi-coding-agent/dist/modes/interactive/components/bordered-loader.d.ts +16 -0
  499. package/packages/pi-coding-agent/dist/modes/interactive/components/bordered-loader.d.ts.map +1 -0
  500. package/packages/pi-coding-agent/dist/modes/interactive/components/bordered-loader.js +48 -0
  501. package/packages/pi-coding-agent/dist/modes/interactive/components/bordered-loader.js.map +1 -0
  502. package/packages/pi-coding-agent/dist/modes/interactive/components/branch-summary-message.d.ts +16 -0
  503. package/packages/pi-coding-agent/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -0
  504. package/packages/pi-coding-agent/dist/modes/interactive/components/branch-summary-message.js +42 -0
  505. package/packages/pi-coding-agent/dist/modes/interactive/components/branch-summary-message.js.map +1 -0
  506. package/packages/pi-coding-agent/dist/modes/interactive/components/compaction-summary-message.d.ts +16 -0
  507. package/packages/pi-coding-agent/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -0
  508. package/packages/pi-coding-agent/dist/modes/interactive/components/compaction-summary-message.js +43 -0
  509. package/packages/pi-coding-agent/dist/modes/interactive/components/compaction-summary-message.js.map +1 -0
  510. package/packages/pi-coding-agent/dist/modes/interactive/components/config-selector.d.ts +71 -0
  511. package/packages/pi-coding-agent/dist/modes/interactive/components/config-selector.d.ts.map +1 -0
  512. package/packages/pi-coding-agent/dist/modes/interactive/components/config-selector.js +470 -0
  513. package/packages/pi-coding-agent/dist/modes/interactive/components/config-selector.js.map +1 -0
  514. package/packages/pi-coding-agent/dist/modes/interactive/components/countdown-timer.d.ts +14 -0
  515. package/packages/pi-coding-agent/dist/modes/interactive/components/countdown-timer.d.ts.map +1 -0
  516. package/packages/pi-coding-agent/dist/modes/interactive/components/countdown-timer.js +28 -0
  517. package/packages/pi-coding-agent/dist/modes/interactive/components/countdown-timer.js.map +1 -0
  518. package/packages/pi-coding-agent/dist/modes/interactive/components/custom-editor.d.ts +21 -0
  519. package/packages/pi-coding-agent/dist/modes/interactive/components/custom-editor.d.ts.map +1 -0
  520. package/packages/pi-coding-agent/dist/modes/interactive/components/custom-editor.js +63 -0
  521. package/packages/pi-coding-agent/dist/modes/interactive/components/custom-editor.js.map +1 -0
  522. package/packages/pi-coding-agent/dist/modes/interactive/components/custom-message.d.ts +20 -0
  523. package/packages/pi-coding-agent/dist/modes/interactive/components/custom-message.d.ts.map +1 -0
  524. package/packages/pi-coding-agent/dist/modes/interactive/components/custom-message.js +74 -0
  525. package/packages/pi-coding-agent/dist/modes/interactive/components/custom-message.js.map +1 -0
  526. package/packages/pi-coding-agent/dist/modes/interactive/components/daxnuts.d.ts +23 -0
  527. package/packages/pi-coding-agent/dist/modes/interactive/components/daxnuts.d.ts.map +1 -0
  528. package/packages/pi-coding-agent/dist/modes/interactive/components/daxnuts.js +138 -0
  529. package/packages/pi-coding-agent/dist/modes/interactive/components/daxnuts.js.map +1 -0
  530. package/packages/pi-coding-agent/dist/modes/interactive/components/diff.d.ts +12 -0
  531. package/packages/pi-coding-agent/dist/modes/interactive/components/diff.d.ts.map +1 -0
  532. package/packages/pi-coding-agent/dist/modes/interactive/components/diff.js +133 -0
  533. package/packages/pi-coding-agent/dist/modes/interactive/components/diff.js.map +1 -0
  534. package/packages/pi-coding-agent/dist/modes/interactive/components/dynamic-border.d.ts +15 -0
  535. package/packages/pi-coding-agent/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -0
  536. package/packages/pi-coding-agent/dist/modes/interactive/components/dynamic-border.js +20 -0
  537. package/packages/pi-coding-agent/dist/modes/interactive/components/dynamic-border.js.map +1 -0
  538. package/packages/pi-coding-agent/dist/modes/interactive/components/extension-editor.d.ts +20 -0
  539. package/packages/pi-coding-agent/dist/modes/interactive/components/extension-editor.d.ts.map +1 -0
  540. package/packages/pi-coding-agent/dist/modes/interactive/components/extension-editor.js +106 -0
  541. package/packages/pi-coding-agent/dist/modes/interactive/components/extension-editor.js.map +1 -0
  542. package/packages/pi-coding-agent/dist/modes/interactive/components/extension-input.d.ts +23 -0
  543. package/packages/pi-coding-agent/dist/modes/interactive/components/extension-input.d.ts.map +1 -0
  544. package/packages/pi-coding-agent/dist/modes/interactive/components/extension-input.js +55 -0
  545. package/packages/pi-coding-agent/dist/modes/interactive/components/extension-input.js.map +1 -0
  546. package/packages/pi-coding-agent/dist/modes/interactive/components/extension-selector.d.ts +24 -0
  547. package/packages/pi-coding-agent/dist/modes/interactive/components/extension-selector.d.ts.map +1 -0
  548. package/packages/pi-coding-agent/dist/modes/interactive/components/extension-selector.js +71 -0
  549. package/packages/pi-coding-agent/dist/modes/interactive/components/extension-selector.js.map +1 -0
  550. package/packages/pi-coding-agent/dist/modes/interactive/components/footer.d.ts +26 -0
  551. package/packages/pi-coding-agent/dist/modes/interactive/components/footer.d.ts.map +1 -0
  552. package/packages/pi-coding-agent/dist/modes/interactive/components/footer.js +196 -0
  553. package/packages/pi-coding-agent/dist/modes/interactive/components/footer.js.map +1 -0
  554. package/packages/pi-coding-agent/dist/modes/interactive/components/index.d.ts +32 -0
  555. package/packages/pi-coding-agent/dist/modes/interactive/components/index.d.ts.map +1 -0
  556. package/packages/pi-coding-agent/dist/modes/interactive/components/index.js +33 -0
  557. package/packages/pi-coding-agent/dist/modes/interactive/components/index.js.map +1 -0
  558. package/packages/pi-coding-agent/dist/modes/interactive/components/keybinding-hints.d.ts +41 -0
  559. package/packages/pi-coding-agent/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -0
  560. package/packages/pi-coding-agent/dist/modes/interactive/components/keybinding-hints.js +61 -0
  561. package/packages/pi-coding-agent/dist/modes/interactive/components/keybinding-hints.js.map +1 -0
  562. package/packages/pi-coding-agent/dist/modes/interactive/components/login-dialog.d.ts +42 -0
  563. package/packages/pi-coding-agent/dist/modes/interactive/components/login-dialog.d.ts.map +1 -0
  564. package/packages/pi-coding-agent/dist/modes/interactive/components/login-dialog.js +139 -0
  565. package/packages/pi-coding-agent/dist/modes/interactive/components/login-dialog.js.map +1 -0
  566. package/packages/pi-coding-agent/dist/modes/interactive/components/model-selector.d.ts +47 -0
  567. package/packages/pi-coding-agent/dist/modes/interactive/components/model-selector.d.ts.map +1 -0
  568. package/packages/pi-coding-agent/dist/modes/interactive/components/model-selector.js +259 -0
  569. package/packages/pi-coding-agent/dist/modes/interactive/components/model-selector.js.map +1 -0
  570. package/packages/pi-coding-agent/dist/modes/interactive/components/oauth-selector.d.ts +19 -0
  571. package/packages/pi-coding-agent/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -0
  572. package/packages/pi-coding-agent/dist/modes/interactive/components/oauth-selector.js +92 -0
  573. package/packages/pi-coding-agent/dist/modes/interactive/components/oauth-selector.js.map +1 -0
  574. package/packages/pi-coding-agent/dist/modes/interactive/components/scoped-models-selector.d.ts +49 -0
  575. package/packages/pi-coding-agent/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -0
  576. package/packages/pi-coding-agent/dist/modes/interactive/components/scoped-models-selector.js +271 -0
  577. package/packages/pi-coding-agent/dist/modes/interactive/components/scoped-models-selector.js.map +1 -0
  578. package/packages/pi-coding-agent/dist/modes/interactive/components/session-selector-search.d.ts +23 -0
  579. package/packages/pi-coding-agent/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -0
  580. package/packages/pi-coding-agent/dist/modes/interactive/components/session-selector-search.js +155 -0
  581. package/packages/pi-coding-agent/dist/modes/interactive/components/session-selector-search.js.map +1 -0
  582. package/packages/pi-coding-agent/dist/modes/interactive/components/session-selector.d.ts +95 -0
  583. package/packages/pi-coding-agent/dist/modes/interactive/components/session-selector.d.ts.map +1 -0
  584. package/packages/pi-coding-agent/dist/modes/interactive/components/session-selector.js +825 -0
  585. package/packages/pi-coding-agent/dist/modes/interactive/components/session-selector.js.map +1 -0
  586. package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.d.ts +58 -0
  587. package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.d.ts.map +1 -0
  588. package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.js +295 -0
  589. package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.js.map +1 -0
  590. package/packages/pi-coding-agent/dist/modes/interactive/components/show-images-selector.d.ts +10 -0
  591. package/packages/pi-coding-agent/dist/modes/interactive/components/show-images-selector.d.ts.map +1 -0
  592. package/packages/pi-coding-agent/dist/modes/interactive/components/show-images-selector.js +34 -0
  593. package/packages/pi-coding-agent/dist/modes/interactive/components/show-images-selector.js.map +1 -0
  594. package/packages/pi-coding-agent/dist/modes/interactive/components/skill-invocation-message.d.ts +17 -0
  595. package/packages/pi-coding-agent/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -0
  596. package/packages/pi-coding-agent/dist/modes/interactive/components/skill-invocation-message.js +45 -0
  597. package/packages/pi-coding-agent/dist/modes/interactive/components/skill-invocation-message.js.map +1 -0
  598. package/packages/pi-coding-agent/dist/modes/interactive/components/theme-selector.d.ts +11 -0
  599. package/packages/pi-coding-agent/dist/modes/interactive/components/theme-selector.d.ts.map +1 -0
  600. package/packages/pi-coding-agent/dist/modes/interactive/components/theme-selector.js +44 -0
  601. package/packages/pi-coding-agent/dist/modes/interactive/components/theme-selector.js.map +1 -0
  602. package/packages/pi-coding-agent/dist/modes/interactive/components/thinking-selector.d.ts +11 -0
  603. package/packages/pi-coding-agent/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -0
  604. package/packages/pi-coding-agent/dist/modes/interactive/components/thinking-selector.js +46 -0
  605. package/packages/pi-coding-agent/dist/modes/interactive/components/thinking-selector.js.map +1 -0
  606. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts +77 -0
  607. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts.map +1 -0
  608. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js +773 -0
  609. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -0
  610. package/packages/pi-coding-agent/dist/modes/interactive/components/tree-selector.d.ts +87 -0
  611. package/packages/pi-coding-agent/dist/modes/interactive/components/tree-selector.d.ts.map +1 -0
  612. package/packages/pi-coding-agent/dist/modes/interactive/components/tree-selector.js +1026 -0
  613. package/packages/pi-coding-agent/dist/modes/interactive/components/tree-selector.js.map +1 -0
  614. package/packages/pi-coding-agent/dist/modes/interactive/components/user-message-selector.d.ts +30 -0
  615. package/packages/pi-coding-agent/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -0
  616. package/packages/pi-coding-agent/dist/modes/interactive/components/user-message-selector.js +110 -0
  617. package/packages/pi-coding-agent/dist/modes/interactive/components/user-message-selector.js.map +1 -0
  618. package/packages/pi-coding-agent/dist/modes/interactive/components/user-message.d.ts +9 -0
  619. package/packages/pi-coding-agent/dist/modes/interactive/components/user-message.d.ts.map +1 -0
  620. package/packages/pi-coding-agent/dist/modes/interactive/components/user-message.js +27 -0
  621. package/packages/pi-coding-agent/dist/modes/interactive/components/user-message.js.map +1 -0
  622. package/packages/pi-coding-agent/dist/modes/interactive/components/visual-truncate.d.ts +24 -0
  623. package/packages/pi-coding-agent/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -0
  624. package/packages/pi-coding-agent/dist/modes/interactive/components/visual-truncate.js +33 -0
  625. package/packages/pi-coding-agent/dist/modes/interactive/components/visual-truncate.js.map +1 -0
  626. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts +330 -0
  627. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -0
  628. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js +3755 -0
  629. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -0
  630. package/packages/pi-coding-agent/dist/modes/interactive/theme/dark.json +86 -0
  631. package/packages/pi-coding-agent/dist/modes/interactive/theme/light.json +85 -0
  632. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-schema.json +335 -0
  633. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts +78 -0
  634. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts.map +1 -0
  635. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.js +944 -0
  636. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.js.map +1 -0
  637. package/packages/pi-coding-agent/dist/modes/print-mode.d.ts +28 -0
  638. package/packages/pi-coding-agent/dist/modes/print-mode.d.ts.map +1 -0
  639. package/packages/pi-coding-agent/dist/modes/print-mode.js +101 -0
  640. package/packages/pi-coding-agent/dist/modes/print-mode.js.map +1 -0
  641. package/packages/pi-coding-agent/dist/modes/rpc/jsonl.d.ts +17 -0
  642. package/packages/pi-coding-agent/dist/modes/rpc/jsonl.d.ts.map +1 -0
  643. package/packages/pi-coding-agent/dist/modes/rpc/jsonl.js +49 -0
  644. package/packages/pi-coding-agent/dist/modes/rpc/jsonl.js.map +1 -0
  645. package/packages/pi-coding-agent/dist/modes/rpc/rpc-client.d.ts +217 -0
  646. package/packages/pi-coding-agent/dist/modes/rpc/rpc-client.d.ts.map +1 -0
  647. package/packages/pi-coding-agent/dist/modes/rpc/rpc-client.js +400 -0
  648. package/packages/pi-coding-agent/dist/modes/rpc/rpc-client.js.map +1 -0
  649. package/packages/pi-coding-agent/dist/modes/rpc/rpc-mode.d.ts +20 -0
  650. package/packages/pi-coding-agent/dist/modes/rpc/rpc-mode.d.ts.map +1 -0
  651. package/packages/pi-coding-agent/dist/modes/rpc/rpc-mode.js +509 -0
  652. package/packages/pi-coding-agent/dist/modes/rpc/rpc-mode.js.map +1 -0
  653. package/packages/pi-coding-agent/dist/modes/rpc/rpc-types.d.ts +409 -0
  654. package/packages/pi-coding-agent/dist/modes/rpc/rpc-types.d.ts.map +1 -0
  655. package/packages/pi-coding-agent/dist/modes/rpc/rpc-types.js +8 -0
  656. package/packages/pi-coding-agent/dist/modes/rpc/rpc-types.js.map +1 -0
  657. package/packages/pi-coding-agent/dist/utils/changelog.d.ts +21 -0
  658. package/packages/pi-coding-agent/dist/utils/changelog.d.ts.map +1 -0
  659. package/packages/pi-coding-agent/dist/utils/changelog.js +87 -0
  660. package/packages/pi-coding-agent/dist/utils/changelog.js.map +1 -0
  661. package/packages/pi-coding-agent/dist/utils/clipboard-image.d.ts +11 -0
  662. package/packages/pi-coding-agent/dist/utils/clipboard-image.d.ts.map +1 -0
  663. package/packages/pi-coding-agent/dist/utils/clipboard-image.js +162 -0
  664. package/packages/pi-coding-agent/dist/utils/clipboard-image.js.map +1 -0
  665. package/packages/pi-coding-agent/dist/utils/clipboard-native.d.ts +7 -0
  666. package/packages/pi-coding-agent/dist/utils/clipboard-native.d.ts.map +1 -0
  667. package/packages/pi-coding-agent/dist/utils/clipboard-native.js +14 -0
  668. package/packages/pi-coding-agent/dist/utils/clipboard-native.js.map +1 -0
  669. package/packages/pi-coding-agent/dist/utils/clipboard.d.ts +2 -0
  670. package/packages/pi-coding-agent/dist/utils/clipboard.d.ts.map +1 -0
  671. package/packages/pi-coding-agent/dist/utils/clipboard.js +67 -0
  672. package/packages/pi-coding-agent/dist/utils/clipboard.js.map +1 -0
  673. package/packages/pi-coding-agent/dist/utils/frontmatter.d.ts +8 -0
  674. package/packages/pi-coding-agent/dist/utils/frontmatter.d.ts.map +1 -0
  675. package/packages/pi-coding-agent/dist/utils/frontmatter.js +26 -0
  676. package/packages/pi-coding-agent/dist/utils/frontmatter.js.map +1 -0
  677. package/packages/pi-coding-agent/dist/utils/git.d.ts +26 -0
  678. package/packages/pi-coding-agent/dist/utils/git.d.ts.map +1 -0
  679. package/packages/pi-coding-agent/dist/utils/git.js +163 -0
  680. package/packages/pi-coding-agent/dist/utils/git.js.map +1 -0
  681. package/packages/pi-coding-agent/dist/utils/image-convert.d.ts +9 -0
  682. package/packages/pi-coding-agent/dist/utils/image-convert.d.ts.map +1 -0
  683. package/packages/pi-coding-agent/dist/utils/image-convert.js +35 -0
  684. package/packages/pi-coding-agent/dist/utils/image-convert.js.map +1 -0
  685. package/packages/pi-coding-agent/dist/utils/image-resize.d.ts +36 -0
  686. package/packages/pi-coding-agent/dist/utils/image-resize.d.ts.map +1 -0
  687. package/packages/pi-coding-agent/dist/utils/image-resize.js +181 -0
  688. package/packages/pi-coding-agent/dist/utils/image-resize.js.map +1 -0
  689. package/packages/pi-coding-agent/dist/utils/mime.d.ts +2 -0
  690. package/packages/pi-coding-agent/dist/utils/mime.d.ts.map +1 -0
  691. package/packages/pi-coding-agent/dist/utils/mime.js +26 -0
  692. package/packages/pi-coding-agent/dist/utils/mime.js.map +1 -0
  693. package/packages/pi-coding-agent/dist/utils/photon.d.ts +21 -0
  694. package/packages/pi-coding-agent/dist/utils/photon.d.ts.map +1 -0
  695. package/packages/pi-coding-agent/dist/utils/photon.js +121 -0
  696. package/packages/pi-coding-agent/dist/utils/photon.js.map +1 -0
  697. package/packages/pi-coding-agent/dist/utils/shell.d.ts +26 -0
  698. package/packages/pi-coding-agent/dist/utils/shell.d.ts.map +1 -0
  699. package/packages/pi-coding-agent/dist/utils/shell.js +186 -0
  700. package/packages/pi-coding-agent/dist/utils/shell.js.map +1 -0
  701. package/packages/pi-coding-agent/dist/utils/sleep.d.ts +5 -0
  702. package/packages/pi-coding-agent/dist/utils/sleep.d.ts.map +1 -0
  703. package/packages/pi-coding-agent/dist/utils/sleep.js +17 -0
  704. package/packages/pi-coding-agent/dist/utils/sleep.js.map +1 -0
  705. package/packages/pi-coding-agent/dist/utils/tools-manager.d.ts +3 -0
  706. package/packages/pi-coding-agent/dist/utils/tools-manager.d.ts.map +1 -0
  707. package/packages/pi-coding-agent/dist/utils/tools-manager.js +251 -0
  708. package/packages/pi-coding-agent/dist/utils/tools-manager.js.map +1 -0
  709. package/packages/pi-coding-agent/package.json +55 -0
  710. package/packages/pi-coding-agent/src/cli/args.ts +316 -0
  711. package/packages/pi-coding-agent/src/cli/config-selector.ts +52 -0
  712. package/packages/pi-coding-agent/src/cli/file-processor.ts +96 -0
  713. package/packages/pi-coding-agent/src/cli/list-models.ts +104 -0
  714. package/packages/pi-coding-agent/src/cli/session-picker.ts +51 -0
  715. package/packages/pi-coding-agent/src/cli.ts +18 -0
  716. package/packages/pi-coding-agent/src/config.ts +241 -0
  717. package/packages/pi-coding-agent/src/core/agent-session.ts +3050 -0
  718. package/packages/pi-coding-agent/src/core/auth-storage.ts +489 -0
  719. package/packages/pi-coding-agent/src/core/bash-executor.ts +278 -0
  720. package/packages/pi-coding-agent/src/core/compaction/branch-summarization.ts +352 -0
  721. package/packages/pi-coding-agent/src/core/compaction/compaction.ts +813 -0
  722. package/packages/pi-coding-agent/src/core/compaction/index.ts +7 -0
  723. package/packages/pi-coding-agent/src/core/compaction/utils.ts +170 -0
  724. package/packages/pi-coding-agent/src/core/defaults.ts +3 -0
  725. package/packages/pi-coding-agent/src/core/diagnostics.ts +15 -0
  726. package/packages/pi-coding-agent/src/core/event-bus.ts +33 -0
  727. package/packages/pi-coding-agent/src/core/exec.ts +104 -0
  728. package/packages/pi-coding-agent/src/core/export-html/ansi-to-html.ts +258 -0
  729. package/packages/pi-coding-agent/src/core/export-html/index.ts +306 -0
  730. package/packages/pi-coding-agent/src/core/export-html/template.css +971 -0
  731. package/packages/pi-coding-agent/src/core/export-html/template.html +54 -0
  732. package/packages/pi-coding-agent/src/core/export-html/template.js +1583 -0
  733. package/packages/pi-coding-agent/src/core/export-html/tool-renderer.ts +114 -0
  734. package/packages/pi-coding-agent/src/core/export-html/vendor/.gitkeep +0 -0
  735. package/packages/pi-coding-agent/src/core/extensions/index.ts +171 -0
  736. package/packages/pi-coding-agent/src/core/extensions/loader.ts +545 -0
  737. package/packages/pi-coding-agent/src/core/extensions/runner.ts +884 -0
  738. package/packages/pi-coding-agent/src/core/extensions/types.ts +1411 -0
  739. package/packages/pi-coding-agent/src/core/extensions/wrapper.ts +118 -0
  740. package/packages/pi-coding-agent/src/core/footer-data-provider.ts +144 -0
  741. package/packages/pi-coding-agent/src/core/index.ts +61 -0
  742. package/packages/pi-coding-agent/src/core/keybindings.ts +211 -0
  743. package/packages/pi-coding-agent/src/core/messages.ts +195 -0
  744. package/packages/pi-coding-agent/src/core/model-registry.ts +694 -0
  745. package/packages/pi-coding-agent/src/core/model-resolver.ts +594 -0
  746. package/packages/pi-coding-agent/src/core/package-manager.ts +1794 -0
  747. package/packages/pi-coding-agent/src/core/prompt-templates.ts +299 -0
  748. package/packages/pi-coding-agent/src/core/resolve-config-value.ts +64 -0
  749. package/packages/pi-coding-agent/src/core/resource-loader.ts +868 -0
  750. package/packages/pi-coding-agent/src/core/sdk.ts +373 -0
  751. package/packages/pi-coding-agent/src/core/session-manager.ts +1410 -0
  752. package/packages/pi-coding-agent/src/core/settings-manager.ts +942 -0
  753. package/packages/pi-coding-agent/src/core/skills.ts +459 -0
  754. package/packages/pi-coding-agent/src/core/slash-commands.ts +38 -0
  755. package/packages/pi-coding-agent/src/core/system-prompt.ts +218 -0
  756. package/packages/pi-coding-agent/src/core/timings.ts +25 -0
  757. package/packages/pi-coding-agent/src/core/tools/bash.ts +347 -0
  758. package/packages/pi-coding-agent/src/core/tools/edit-diff.ts +308 -0
  759. package/packages/pi-coding-agent/src/core/tools/edit.ts +227 -0
  760. package/packages/pi-coding-agent/src/core/tools/find.ts +273 -0
  761. package/packages/pi-coding-agent/src/core/tools/grep.ts +346 -0
  762. package/packages/pi-coding-agent/src/core/tools/index.ts +139 -0
  763. package/packages/pi-coding-agent/src/core/tools/ls.ts +170 -0
  764. package/packages/pi-coding-agent/src/core/tools/path-utils.ts +94 -0
  765. package/packages/pi-coding-agent/src/core/tools/read.ts +222 -0
  766. package/packages/pi-coding-agent/src/core/tools/truncate.ts +265 -0
  767. package/packages/pi-coding-agent/src/core/tools/write.ts +118 -0
  768. package/packages/pi-coding-agent/src/index.ts +333 -0
  769. package/packages/pi-coding-agent/src/main.ts +821 -0
  770. package/packages/pi-coding-agent/src/migrations.ts +295 -0
  771. package/packages/pi-coding-agent/src/modes/index.ts +9 -0
  772. package/packages/pi-coding-agent/src/modes/interactive/components/armin.ts +382 -0
  773. package/packages/pi-coding-agent/src/modes/interactive/components/assistant-message.ts +115 -0
  774. package/packages/pi-coding-agent/src/modes/interactive/components/bash-execution.ts +210 -0
  775. package/packages/pi-coding-agent/src/modes/interactive/components/bordered-loader.ts +66 -0
  776. package/packages/pi-coding-agent/src/modes/interactive/components/branch-summary-message.ts +58 -0
  777. package/packages/pi-coding-agent/src/modes/interactive/components/compaction-summary-message.ts +59 -0
  778. package/packages/pi-coding-agent/src/modes/interactive/components/config-selector.ts +592 -0
  779. package/packages/pi-coding-agent/src/modes/interactive/components/countdown-timer.ts +38 -0
  780. package/packages/pi-coding-agent/src/modes/interactive/components/custom-editor.ts +80 -0
  781. package/packages/pi-coding-agent/src/modes/interactive/components/custom-message.ts +99 -0
  782. package/packages/pi-coding-agent/src/modes/interactive/components/daxnuts.ts +164 -0
  783. package/packages/pi-coding-agent/src/modes/interactive/components/diff.ts +147 -0
  784. package/packages/pi-coding-agent/src/modes/interactive/components/dynamic-border.ts +25 -0
  785. package/packages/pi-coding-agent/src/modes/interactive/components/extension-editor.ts +147 -0
  786. package/packages/pi-coding-agent/src/modes/interactive/components/extension-input.ts +85 -0
  787. package/packages/pi-coding-agent/src/modes/interactive/components/extension-selector.ts +107 -0
  788. package/packages/pi-coding-agent/src/modes/interactive/components/footer.ts +216 -0
  789. package/packages/pi-coding-agent/src/modes/interactive/components/index.ts +32 -0
  790. package/packages/pi-coding-agent/src/modes/interactive/components/keybinding-hints.ts +66 -0
  791. package/packages/pi-coding-agent/src/modes/interactive/components/login-dialog.ts +174 -0
  792. package/packages/pi-coding-agent/src/modes/interactive/components/model-selector.ts +329 -0
  793. package/packages/pi-coding-agent/src/modes/interactive/components/oauth-selector.ts +121 -0
  794. package/packages/pi-coding-agent/src/modes/interactive/components/scoped-models-selector.ts +346 -0
  795. package/packages/pi-coding-agent/src/modes/interactive/components/session-selector-search.ts +194 -0
  796. package/packages/pi-coding-agent/src/modes/interactive/components/session-selector.ts +1019 -0
  797. package/packages/pi-coding-agent/src/modes/interactive/components/settings-selector.ts +421 -0
  798. package/packages/pi-coding-agent/src/modes/interactive/components/show-images-selector.ts +45 -0
  799. package/packages/pi-coding-agent/src/modes/interactive/components/skill-invocation-message.ts +55 -0
  800. package/packages/pi-coding-agent/src/modes/interactive/components/theme-selector.ts +62 -0
  801. package/packages/pi-coding-agent/src/modes/interactive/components/thinking-selector.ts +64 -0
  802. package/packages/pi-coding-agent/src/modes/interactive/components/tool-execution.ts +916 -0
  803. package/packages/pi-coding-agent/src/modes/interactive/components/tree-selector.ts +1184 -0
  804. package/packages/pi-coding-agent/src/modes/interactive/components/user-message-selector.ts +143 -0
  805. package/packages/pi-coding-agent/src/modes/interactive/components/user-message.ts +32 -0
  806. package/packages/pi-coding-agent/src/modes/interactive/components/visual-truncate.ts +50 -0
  807. package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +4464 -0
  808. package/packages/pi-coding-agent/src/modes/interactive/theme/dark.json +86 -0
  809. package/packages/pi-coding-agent/src/modes/interactive/theme/light.json +85 -0
  810. package/packages/pi-coding-agent/src/modes/interactive/theme/theme-schema.json +335 -0
  811. package/packages/pi-coding-agent/src/modes/interactive/theme/theme.ts +1105 -0
  812. package/packages/pi-coding-agent/src/modes/print-mode.ts +124 -0
  813. package/packages/pi-coding-agent/src/modes/rpc/jsonl.ts +58 -0
  814. package/packages/pi-coding-agent/src/modes/rpc/rpc-client.ts +505 -0
  815. package/packages/pi-coding-agent/src/modes/rpc/rpc-mode.ts +638 -0
  816. package/packages/pi-coding-agent/src/modes/rpc/rpc-types.ts +263 -0
  817. package/packages/pi-coding-agent/src/utils/changelog.ts +99 -0
  818. package/packages/pi-coding-agent/src/utils/clipboard-image.ts +207 -0
  819. package/packages/pi-coding-agent/src/utils/clipboard-native.ts +21 -0
  820. package/packages/pi-coding-agent/src/utils/clipboard.ts +62 -0
  821. package/packages/pi-coding-agent/src/utils/frontmatter.ts +39 -0
  822. package/packages/pi-coding-agent/src/utils/git.ts +192 -0
  823. package/packages/pi-coding-agent/src/utils/image-convert.ts +38 -0
  824. package/packages/pi-coding-agent/src/utils/image-resize.ts +231 -0
  825. package/packages/pi-coding-agent/src/utils/mime.ts +30 -0
  826. package/packages/pi-coding-agent/src/utils/photon.ts +139 -0
  827. package/packages/pi-coding-agent/src/utils/shell.ts +202 -0
  828. package/packages/pi-coding-agent/src/utils/sleep.ts +18 -0
  829. package/packages/pi-coding-agent/src/utils/tools-manager.ts +286 -0
  830. package/packages/pi-coding-agent/tsconfig.json +27 -0
  831. package/packages/pi-tui/dist/autocomplete.d.ts +50 -0
  832. package/packages/pi-tui/dist/autocomplete.d.ts.map +1 -0
  833. package/packages/pi-tui/dist/autocomplete.js +593 -0
  834. package/packages/pi-tui/dist/autocomplete.js.map +1 -0
  835. package/packages/pi-tui/dist/components/box.d.ts +22 -0
  836. package/packages/pi-tui/dist/components/box.d.ts.map +1 -0
  837. package/packages/pi-tui/dist/components/box.js +99 -0
  838. package/packages/pi-tui/dist/components/box.js.map +1 -0
  839. package/packages/pi-tui/dist/components/cancellable-loader.d.ts +22 -0
  840. package/packages/pi-tui/dist/components/cancellable-loader.d.ts.map +1 -0
  841. package/packages/pi-tui/dist/components/cancellable-loader.js +36 -0
  842. package/packages/pi-tui/dist/components/cancellable-loader.js.map +1 -0
  843. package/packages/pi-tui/dist/components/editor.d.ts +219 -0
  844. package/packages/pi-tui/dist/components/editor.d.ts.map +1 -0
  845. package/packages/pi-tui/dist/components/editor.js +1693 -0
  846. package/packages/pi-tui/dist/components/editor.js.map +1 -0
  847. package/packages/pi-tui/dist/components/image.d.ts +28 -0
  848. package/packages/pi-tui/dist/components/image.d.ts.map +1 -0
  849. package/packages/pi-tui/dist/components/image.js +61 -0
  850. package/packages/pi-tui/dist/components/image.js.map +1 -0
  851. package/packages/pi-tui/dist/components/input.d.ts +37 -0
  852. package/packages/pi-tui/dist/components/input.d.ts.map +1 -0
  853. package/packages/pi-tui/dist/components/input.js +443 -0
  854. package/packages/pi-tui/dist/components/input.js.map +1 -0
  855. package/packages/pi-tui/dist/components/loader.d.ts +21 -0
  856. package/packages/pi-tui/dist/components/loader.d.ts.map +1 -0
  857. package/packages/pi-tui/dist/components/loader.js +46 -0
  858. package/packages/pi-tui/dist/components/loader.js.map +1 -0
  859. package/packages/pi-tui/dist/components/markdown.d.ts +95 -0
  860. package/packages/pi-tui/dist/components/markdown.d.ts.map +1 -0
  861. package/packages/pi-tui/dist/components/markdown.js +641 -0
  862. package/packages/pi-tui/dist/components/markdown.js.map +1 -0
  863. package/packages/pi-tui/dist/components/select-list.d.ts +32 -0
  864. package/packages/pi-tui/dist/components/select-list.d.ts.map +1 -0
  865. package/packages/pi-tui/dist/components/select-list.js +148 -0
  866. package/packages/pi-tui/dist/components/select-list.js.map +1 -0
  867. package/packages/pi-tui/dist/components/settings-list.d.ts +50 -0
  868. package/packages/pi-tui/dist/components/settings-list.d.ts.map +1 -0
  869. package/packages/pi-tui/dist/components/settings-list.js +177 -0
  870. package/packages/pi-tui/dist/components/settings-list.js.map +1 -0
  871. package/packages/pi-tui/dist/components/spacer.d.ts +12 -0
  872. package/packages/pi-tui/dist/components/spacer.d.ts.map +1 -0
  873. package/packages/pi-tui/dist/components/spacer.js +22 -0
  874. package/packages/pi-tui/dist/components/spacer.js.map +1 -0
  875. package/packages/pi-tui/dist/components/text.d.ts +19 -0
  876. package/packages/pi-tui/dist/components/text.d.ts.map +1 -0
  877. package/packages/pi-tui/dist/components/text.js +81 -0
  878. package/packages/pi-tui/dist/components/text.js.map +1 -0
  879. package/packages/pi-tui/dist/components/truncated-text.d.ts +13 -0
  880. package/packages/pi-tui/dist/components/truncated-text.d.ts.map +1 -0
  881. package/packages/pi-tui/dist/components/truncated-text.js +48 -0
  882. package/packages/pi-tui/dist/components/truncated-text.js.map +1 -0
  883. package/packages/pi-tui/dist/editor-component.d.ts +39 -0
  884. package/packages/pi-tui/dist/editor-component.d.ts.map +1 -0
  885. package/packages/pi-tui/dist/editor-component.js +2 -0
  886. package/packages/pi-tui/dist/editor-component.js.map +1 -0
  887. package/packages/pi-tui/dist/fuzzy.d.ts +16 -0
  888. package/packages/pi-tui/dist/fuzzy.d.ts.map +1 -0
  889. package/packages/pi-tui/dist/fuzzy.js +107 -0
  890. package/packages/pi-tui/dist/fuzzy.js.map +1 -0
  891. package/packages/pi-tui/dist/index.d.ts +23 -0
  892. package/packages/pi-tui/dist/index.d.ts.map +1 -0
  893. package/packages/pi-tui/dist/index.js +32 -0
  894. package/packages/pi-tui/dist/index.js.map +1 -0
  895. package/packages/pi-tui/dist/keybindings.d.ts +39 -0
  896. package/packages/pi-tui/dist/keybindings.d.ts.map +1 -0
  897. package/packages/pi-tui/dist/keybindings.js +116 -0
  898. package/packages/pi-tui/dist/keybindings.js.map +1 -0
  899. package/packages/pi-tui/dist/keys.d.ts +170 -0
  900. package/packages/pi-tui/dist/keys.d.ts.map +1 -0
  901. package/packages/pi-tui/dist/keys.js +1046 -0
  902. package/packages/pi-tui/dist/keys.js.map +1 -0
  903. package/packages/pi-tui/dist/kill-ring.d.ts +28 -0
  904. package/packages/pi-tui/dist/kill-ring.d.ts.map +1 -0
  905. package/packages/pi-tui/dist/kill-ring.js +46 -0
  906. package/packages/pi-tui/dist/kill-ring.js.map +1 -0
  907. package/packages/pi-tui/dist/stdin-buffer.d.ts +48 -0
  908. package/packages/pi-tui/dist/stdin-buffer.d.ts.map +1 -0
  909. package/packages/pi-tui/dist/stdin-buffer.js +316 -0
  910. package/packages/pi-tui/dist/stdin-buffer.js.map +1 -0
  911. package/packages/pi-tui/dist/terminal-image.d.ts +68 -0
  912. package/packages/pi-tui/dist/terminal-image.d.ts.map +1 -0
  913. package/packages/pi-tui/dist/terminal-image.js +288 -0
  914. package/packages/pi-tui/dist/terminal-image.js.map +1 -0
  915. package/packages/pi-tui/dist/terminal.d.ts +85 -0
  916. package/packages/pi-tui/dist/terminal.d.ts.map +1 -0
  917. package/packages/pi-tui/dist/terminal.js +271 -0
  918. package/packages/pi-tui/dist/terminal.js.map +1 -0
  919. package/packages/pi-tui/dist/tui.d.ts +220 -0
  920. package/packages/pi-tui/dist/tui.d.ts.map +1 -0
  921. package/packages/pi-tui/dist/tui.js +976 -0
  922. package/packages/pi-tui/dist/tui.js.map +1 -0
  923. package/packages/pi-tui/dist/undo-stack.d.ts +17 -0
  924. package/packages/pi-tui/dist/undo-stack.d.ts.map +1 -0
  925. package/packages/pi-tui/dist/undo-stack.js +27 -0
  926. package/packages/pi-tui/dist/undo-stack.js.map +1 -0
  927. package/packages/pi-tui/dist/utils.d.ts +78 -0
  928. package/packages/pi-tui/dist/utils.d.ts.map +1 -0
  929. package/packages/pi-tui/dist/utils.js +817 -0
  930. package/packages/pi-tui/dist/utils.js.map +1 -0
  931. package/packages/pi-tui/package.json +21 -0
  932. package/packages/pi-tui/src/autocomplete.ts +736 -0
  933. package/packages/pi-tui/src/components/box.ts +137 -0
  934. package/packages/pi-tui/src/components/cancellable-loader.ts +40 -0
  935. package/packages/pi-tui/src/components/editor.ts +2035 -0
  936. package/packages/pi-tui/src/components/image.ts +104 -0
  937. package/packages/pi-tui/src/components/input.ts +521 -0
  938. package/packages/pi-tui/src/components/loader.ts +55 -0
  939. package/packages/pi-tui/src/components/markdown.ts +806 -0
  940. package/packages/pi-tui/src/components/select-list.ts +188 -0
  941. package/packages/pi-tui/src/components/settings-list.ts +250 -0
  942. package/packages/pi-tui/src/components/spacer.ts +28 -0
  943. package/packages/pi-tui/src/components/text.ts +106 -0
  944. package/packages/pi-tui/src/components/truncated-text.ts +65 -0
  945. package/packages/pi-tui/src/editor-component.ts +74 -0
  946. package/packages/pi-tui/src/fuzzy.ts +133 -0
  947. package/packages/pi-tui/src/index.ts +93 -0
  948. package/packages/pi-tui/src/keybindings.ts +189 -0
  949. package/packages/pi-tui/src/keys.ts +1255 -0
  950. package/packages/pi-tui/src/kill-ring.ts +46 -0
  951. package/packages/pi-tui/src/stdin-buffer.ts +386 -0
  952. package/packages/pi-tui/src/terminal-image.ts +381 -0
  953. package/packages/pi-tui/src/terminal.ts +349 -0
  954. package/packages/pi-tui/src/tui.ts +1212 -0
  955. package/packages/pi-tui/src/undo-stack.ts +28 -0
  956. package/packages/pi-tui/src/utils.ts +905 -0
  957. package/packages/pi-tui/tsconfig.json +27 -0
  958. package/pkg/dist/modes/interactive/theme/dark.json +6 -6
  959. package/pkg/dist/modes/interactive/theme/light.json +6 -5
  960. package/pkg/dist/modes/interactive/theme/theme.d.ts +2 -2
  961. package/pkg/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  962. package/pkg/dist/modes/interactive/theme/theme.js +1 -6
  963. package/pkg/dist/modes/interactive/theme/theme.js.map +1 -1
  964. package/scripts/postinstall.js +2 -17
  965. package/src/resources/extensions/ask-user-questions.ts +2 -2
  966. package/src/resources/extensions/bg-shell/index.ts +4 -4
  967. package/src/resources/extensions/browser-tools/index.ts +3 -3
  968. package/src/resources/extensions/context7/index.ts +3 -3
  969. package/src/resources/extensions/get-secrets-from-user.ts +331 -59
  970. package/src/resources/extensions/google-search/index.ts +20 -7
  971. package/src/resources/extensions/gsd/activity-log.ts +1 -1
  972. package/src/resources/extensions/gsd/auto.ts +106 -21
  973. package/src/resources/extensions/gsd/commands.ts +2 -2
  974. package/src/resources/extensions/gsd/dashboard-overlay.ts +2 -2
  975. package/src/resources/extensions/gsd/docs/preferences-reference.md +45 -1
  976. package/src/resources/extensions/gsd/doctor.ts +23 -4
  977. package/src/resources/extensions/gsd/files.ts +115 -1
  978. package/src/resources/extensions/gsd/git-service.ts +64 -111
  979. package/src/resources/extensions/gsd/guided-flow.ts +3 -2
  980. package/src/resources/extensions/gsd/index.ts +18 -7
  981. package/src/resources/extensions/gsd/metrics.ts +1 -1
  982. package/src/resources/extensions/gsd/migrate/command.ts +1 -1
  983. package/src/resources/extensions/gsd/preferences.ts +72 -10
  984. package/src/resources/extensions/gsd/prompts/guided-plan-milestone.md +4 -0
  985. package/src/resources/extensions/gsd/prompts/plan-milestone.md +17 -0
  986. package/src/resources/extensions/gsd/session-forensics.ts +19 -6
  987. package/src/resources/extensions/gsd/skill-discovery.ts +1 -1
  988. package/src/resources/extensions/gsd/templates/secrets-manifest.md +22 -0
  989. package/src/resources/extensions/gsd/tests/auto-secrets-gate.test.ts +196 -0
  990. package/src/resources/extensions/gsd/tests/collect-from-manifest.test.ts +469 -0
  991. package/src/resources/extensions/gsd/tests/doctor-fixlevel.test.ts +170 -0
  992. package/src/resources/extensions/gsd/tests/git-service.test.ts +43 -0
  993. package/src/resources/extensions/gsd/tests/manifest-status.test.ts +283 -0
  994. package/src/resources/extensions/gsd/tests/parsers.test.ts +401 -65
  995. package/src/resources/extensions/gsd/tests/resolve-ts-hooks.mjs +2 -1
  996. package/src/resources/extensions/gsd/tests/secure-env-collect.test.ts +185 -0
  997. package/src/resources/extensions/gsd/types.ts +27 -0
  998. package/src/resources/extensions/gsd/worktree-command.ts +2 -2
  999. package/src/resources/extensions/mac-tools/index.ts +2 -2
  1000. package/src/resources/extensions/mcporter/index.ts +3 -3
  1001. package/src/resources/extensions/remote-questions/remote-command.ts +3 -3
  1002. package/src/resources/extensions/search-the-web/command-search-provider.ts +2 -2
  1003. package/src/resources/extensions/search-the-web/index.ts +1 -1
  1004. package/src/resources/extensions/search-the-web/provider.ts +1 -1
  1005. package/src/resources/extensions/search-the-web/tool-fetch-page.ts +3 -3
  1006. package/src/resources/extensions/search-the-web/tool-llm-context.ts +4 -4
  1007. package/src/resources/extensions/search-the-web/tool-search.ts +4 -4
  1008. package/src/resources/extensions/shared/confirm-ui.ts +3 -3
  1009. package/src/resources/extensions/shared/interview-ui.ts +3 -3
  1010. package/src/resources/extensions/shared/next-action-ui.ts +3 -3
  1011. package/src/resources/extensions/shared/progress-widget.ts +2 -2
  1012. package/src/resources/extensions/shared/thinking-widget.ts +3 -3
  1013. package/src/resources/extensions/shared/ui.ts +4 -4
  1014. package/src/resources/extensions/shared/wizard-ui.ts +4 -4
  1015. package/src/resources/extensions/slash-commands/audit.ts +1 -1
  1016. package/src/resources/extensions/slash-commands/clear.ts +1 -1
  1017. package/src/resources/extensions/slash-commands/create-extension.ts +2 -2
  1018. package/src/resources/extensions/slash-commands/create-slash-command.ts +2 -2
  1019. package/src/resources/extensions/slash-commands/index.ts +1 -1
  1020. package/src/resources/extensions/subagent/agents.ts +1 -1
  1021. package/src/resources/extensions/subagent/index.ts +5 -5
  1022. package/src/resources/extensions/voice/index.ts +3 -3
  1023. package/patches/@mariozechner+pi-coding-agent+0.57.1.patch +0 -78
  1024. package/patches/@mariozechner+pi-tui+0.57.1.patch +0 -47
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings-manager.js","sourceRoot":"","sources":["../../src/core/settings-manager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AA6F5D,+FAA+F;AAC/F,SAAS,iBAAiB,CAAC,IAAc,EAAE,SAAmB;IAC7D,MAAM,MAAM,GAAa,EAAE,GAAG,IAAI,EAAE,CAAC;IAErC,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,SAAS,CAAuB,EAAE,CAAC;QAChE,MAAM,aAAa,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC;QACrC,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;QAE5B,IAAI,aAAa,KAAK,SAAS,EAAE,CAAC;YACjC,SAAS;QACV,CAAC;QAED,wCAAwC;QACx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I,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QAC/F,IAAI,CAAC,YAAY,CAAC,wBAAwB,CAAC,CAAC;QAC5C,IAAI,CAAC,IAAI,EAAE,CAAC;IACb,CAAC;IAED,kBAAkB;QACjB,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,eAAe,IAAI,IAAI,CAAC;IACxD,CAAC;CACD","sourcesContent":["import type { Transport } from \"@gsd/pi-ai\";\nimport { existsSync, mkdirSync, readFileSync, writeFileSync } from \"fs\";\nimport { dirname, join } from \"path\";\nimport lockfile from \"proper-lockfile\";\nimport { CONFIG_DIR_NAME, getAgentDir } from \"../config.js\";\n\nexport interface CompactionSettings {\n\tenabled?: boolean; // default: true\n\treserveTokens?: number; // default: 16384\n\tkeepRecentTokens?: number; // default: 20000\n}\n\nexport interface BranchSummarySettings {\n\treserveTokens?: number; // default: 16384 (tokens reserved for prompt + LLM response)\n\tskipPrompt?: boolean; // default: false - when true, skips \"Summarize branch?\" prompt and defaults to no summary\n}\n\nexport interface RetrySettings {\n\tenabled?: boolean; // default: true\n\tmaxRetries?: number; // default: 3\n\tbaseDelayMs?: number; // default: 2000 (exponential backoff: 2s, 4s, 8s)\n\tmaxDelayMs?: number; // default: 60000 (max server-requested delay before failing)\n}\n\nexport interface TerminalSettings {\n\tshowImages?: boolean; // default: true (only relevant if terminal supports images)\n\tclearOnShrink?: boolean; // default: false (clear empty rows when content shrinks)\n}\n\nexport interface ImageSettings {\n\tautoResize?: boolean; // default: true (resize images to 2000x2000 max for better model compatibility)\n\tblockImages?: boolean; // default: false - when true, prevents all images from being sent to LLM providers\n}\n\nexport interface ThinkingBudgetsSettings {\n\tminimal?: number;\n\tlow?: number;\n\tmedium?: number;\n\thigh?: number;\n}\n\nexport interface MarkdownSettings {\n\tcodeBlockIndent?: string; // default: \" \"\n}\n\nexport type TransportSetting = Transport;\n\n/**\n * Package source for npm/git packages.\n * - String form: load all resources from the package\n * - Object form: filter which resources to load\n */\nexport type PackageSource =\n\t| string\n\t| {\n\t\t\tsource: string;\n\t\t\textensions?: string[];\n\t\t\tskills?: string[];\n\t\t\tprompts?: string[];\n\t\t\tthemes?: string[];\n\t };\n\nexport interface Settings {\n\tlastChangelogVersion?: string;\n\tdefaultProvider?: string;\n\tdefaultModel?: string;\n\tdefaultThinkingLevel?: \"off\" | \"minimal\" | \"low\" | \"medium\" | \"high\" | \"xhigh\";\n\ttransport?: TransportSetting; // default: \"sse\"\n\tsteeringMode?: \"all\" | \"one-at-a-time\";\n\tfollowUpMode?: \"all\" | \"one-at-a-time\";\n\ttheme?: string;\n\tcompaction?: CompactionSettings;\n\tbranchSummary?: BranchSummarySettings;\n\tretry?: RetrySettings;\n\thideThinkingBlock?: boolean;\n\tshellPath?: string; // Custom shell path (e.g., for Cygwin users on Windows)\n\tquietStartup?: boolean;\n\tshellCommandPrefix?: string; // Prefix prepended to every bash command (e.g., \"shopt -s expand_aliases\" for alias support)\n\tcollapseChangelog?: boolean; // Show condensed changelog after update (use /changelog for full)\n\tpackages?: PackageSource[]; // Array of npm/git package sources (string or object with filtering)\n\textensions?: string[]; // Array of local extension file paths or directories\n\tskills?: string[]; // Array of local skill file paths or directories\n\tprompts?: string[]; // Array of local prompt template paths or directories\n\tthemes?: string[]; // Array of local theme file paths or directories\n\tenableSkillCommands?: boolean; // default: true - register skills as /skill:name commands\n\tterminal?: TerminalSettings;\n\timages?: ImageSettings;\n\tenabledModels?: string[]; // Model patterns for cycling (same format as --models CLI flag)\n\tdoubleEscapeAction?: \"fork\" | \"tree\" | \"none\"; // Action for double-escape with empty editor (default: \"tree\")\n\ttreeFilterMode?: \"default\" | \"no-tools\" | \"user-only\" | \"labeled-only\" | \"all\"; // Default filter when opening /tree\n\tthinkingBudgets?: ThinkingBudgetsSettings; // Custom token budgets for thinking levels\n\teditorPaddingX?: number; // Horizontal padding for input editor (default: 0)\n\tautocompleteMaxVisible?: number; // Max visible items in autocomplete dropdown (default: 5)\n\tshowHardwareCursor?: boolean; // Show terminal cursor while still positioning it for IME\n\tmarkdown?: MarkdownSettings;\n}\n\n/** Deep merge settings: project/overrides take precedence, nested objects merge recursively */\nfunction deepMergeSettings(base: Settings, overrides: Settings): Settings {\n\tconst result: Settings = { ...base };\n\n\tfor (const key of Object.keys(overrides) as (keyof Settings)[]) {\n\t\tconst overrideValue = overrides[key];\n\t\tconst baseValue = base[key];\n\n\t\tif (overrideValue === undefined) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// For nested objects, merge recursively\n\t\tif (\n\t\t\ttypeof overrideValue === \"object\" &&\n\t\t\toverrideValue !== null &&\n\t\t\t!Array.isArray(overrideValue) &&\n\t\t\ttypeof baseValue === \"object\" &&\n\t\t\tbaseValue !== null &&\n\t\t\t!Array.isArray(baseValue)\n\t\t) {\n\t\t\t(result as Record<string, unknown>)[key] = { ...baseValue, ...overrideValue };\n\t\t} else {\n\t\t\t// For primitives and arrays, override value wins\n\t\t\t(result as Record<string, unknown>)[key] = overrideValue;\n\t\t}\n\t}\n\n\treturn result;\n}\n\nexport type SettingsScope = \"global\" | \"project\";\n\nexport interface SettingsStorage {\n\twithLock(scope: SettingsScope, fn: (current: string | undefined) => string | undefined): void;\n}\n\nexport interface SettingsError {\n\tscope: SettingsScope;\n\terror: Error;\n}\n\nexport class FileSettingsStorage implements SettingsStorage {\n\tprivate globalSettingsPath: string;\n\tprivate projectSettingsPath: string;\n\n\tconstructor(cwd: string = process.cwd(), agentDir: string = getAgentDir()) {\n\t\tthis.globalSettingsPath = join(agentDir, \"settings.json\");\n\t\tthis.projectSettingsPath = join(cwd, CONFIG_DIR_NAME, \"settings.json\");\n\t}\n\n\tprivate acquireLockSyncWithRetry(path: string): () => void {\n\t\tconst maxAttempts = 10;\n\t\tconst delayMs = 20;\n\t\tlet lastError: unknown;\n\n\t\tfor (let attempt = 1; attempt <= maxAttempts; attempt++) {\n\t\t\ttry {\n\t\t\t\treturn lockfile.lockSync(path, { realpath: false });\n\t\t\t} catch (error) {\n\t\t\t\tconst code =\n\t\t\t\t\ttypeof error === \"object\" && error !== null && \"code\" in error\n\t\t\t\t\t\t? String((error as { code?: unknown }).code)\n\t\t\t\t\t\t: undefined;\n\t\t\t\tif (code !== \"ELOCKED\" || attempt === maxAttempts) {\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\t\t\t\tlastError = error;\n\t\t\t\tconst start = Date.now();\n\t\t\t\twhile (Date.now() - start < delayMs) {\n\t\t\t\t\t// Sleep synchronously to avoid changing callers to async.\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthrow (lastError as Error) ?? new Error(\"Failed to acquire settings lock\");\n\t}\n\n\twithLock(scope: SettingsScope, fn: (current: string | undefined) => string | undefined): void {\n\t\tconst path = scope === \"global\" ? this.globalSettingsPath : this.projectSettingsPath;\n\t\tconst dir = dirname(path);\n\n\t\tlet release: (() => void) | undefined;\n\t\ttry {\n\t\t\t// Only create directory and lock if file exists or we need to write\n\t\t\tconst fileExists = existsSync(path);\n\t\t\tif (fileExists) {\n\t\t\t\trelease = this.acquireLockSyncWithRetry(path);\n\t\t\t}\n\t\t\tconst current = fileExists ? readFileSync(path, \"utf-8\") : undefined;\n\t\t\tconst next = fn(current);\n\t\t\tif (next !== undefined) {\n\t\t\t\t// Only create directory when we actually need to write\n\t\t\t\tif (!existsSync(dir)) {\n\t\t\t\t\tmkdirSync(dir, { recursive: true });\n\t\t\t\t}\n\t\t\t\tif (!release) {\n\t\t\t\t\trelease = this.acquireLockSyncWithRetry(path);\n\t\t\t\t}\n\t\t\t\twriteFileSync(path, next, \"utf-8\");\n\t\t\t}\n\t\t} finally {\n\t\t\tif (release) {\n\t\t\t\trelease();\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport class InMemorySettingsStorage implements SettingsStorage {\n\tprivate global: string | undefined;\n\tprivate project: string | undefined;\n\n\twithLock(scope: SettingsScope, fn: (current: string | undefined) => string | undefined): void {\n\t\tconst current = scope === \"global\" ? this.global : this.project;\n\t\tconst next = fn(current);\n\t\tif (next !== undefined) {\n\t\t\tif (scope === \"global\") {\n\t\t\t\tthis.global = next;\n\t\t\t} else {\n\t\t\t\tthis.project = next;\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport class SettingsManager {\n\tprivate storage: SettingsStorage;\n\tprivate globalSettings: Settings;\n\tprivate projectSettings: Settings;\n\tprivate settings: Settings;\n\tprivate modifiedFields = new Set<keyof Settings>(); // Track global fields modified during session\n\tprivate modifiedNestedFields = new Map<keyof Settings, Set<string>>(); // Track global nested field modifications\n\tprivate modifiedProjectFields = new Set<keyof Settings>(); // Track project fields modified during session\n\tprivate modifiedProjectNestedFields = new Map<keyof Settings, Set<string>>(); // Track project nested field modifications\n\tprivate globalSettingsLoadError: Error | null = null; // Track if global settings file had parse errors\n\tprivate projectSettingsLoadError: Error | null = null; // Track if project settings file had parse errors\n\tprivate writeQueue: Promise<void> = Promise.resolve();\n\tprivate errors: SettingsError[];\n\n\tprivate constructor(\n\t\tstorage: SettingsStorage,\n\t\tinitialGlobal: Settings,\n\t\tinitialProject: Settings,\n\t\tglobalLoadError: Error | null = null,\n\t\tprojectLoadError: Error | null = null,\n\t\tinitialErrors: SettingsError[] = [],\n\t) {\n\t\tthis.storage = storage;\n\t\tthis.globalSettings = initialGlobal;\n\t\tthis.projectSettings = initialProject;\n\t\tthis.globalSettingsLoadError = globalLoadError;\n\t\tthis.projectSettingsLoadError = projectLoadError;\n\t\tthis.errors = [...initialErrors];\n\t\tthis.settings = deepMergeSettings(this.globalSettings, this.projectSettings);\n\t}\n\n\t/** Create a SettingsManager that loads from files */\n\tstatic create(cwd: string = process.cwd(), agentDir: string = getAgentDir()): SettingsManager {\n\t\tconst storage = new FileSettingsStorage(cwd, agentDir);\n\t\treturn SettingsManager.fromStorage(storage);\n\t}\n\n\t/** Create a SettingsManager from an arbitrary storage backend */\n\tstatic fromStorage(storage: SettingsStorage): SettingsManager {\n\t\tconst globalLoad = SettingsManager.tryLoadFromStorage(storage, \"global\");\n\t\tconst projectLoad = SettingsManager.tryLoadFromStorage(storage, \"project\");\n\t\tconst initialErrors: SettingsError[] = [];\n\t\tif (globalLoad.error) {\n\t\t\tinitialErrors.push({ scope: \"global\", error: globalLoad.error });\n\t\t}\n\t\tif (projectLoad.error) {\n\t\t\tinitialErrors.push({ scope: \"project\", error: projectLoad.error });\n\t\t}\n\n\t\treturn new SettingsManager(\n\t\t\tstorage,\n\t\t\tglobalLoad.settings,\n\t\t\tprojectLoad.settings,\n\t\t\tglobalLoad.error,\n\t\t\tprojectLoad.error,\n\t\t\tinitialErrors,\n\t\t);\n\t}\n\n\t/** Create an in-memory SettingsManager (no file I/O) */\n\tstatic inMemory(settings: Partial<Settings> = {}): SettingsManager {\n\t\tconst storage = new InMemorySettingsStorage();\n\t\treturn new SettingsManager(storage, settings, {});\n\t}\n\n\tprivate static loadFromStorage(storage: SettingsStorage, scope: SettingsScope): Settings {\n\t\tlet content: string | undefined;\n\t\tstorage.withLock(scope, (current) => {\n\t\t\tcontent = current;\n\t\t\treturn undefined;\n\t\t});\n\n\t\tif (!content) {\n\t\t\treturn {};\n\t\t}\n\t\tconst settings = JSON.parse(content);\n\t\treturn SettingsManager.migrateSettings(settings);\n\t}\n\n\tprivate static tryLoadFromStorage(\n\t\tstorage: SettingsStorage,\n\t\tscope: SettingsScope,\n\t): { settings: Settings; error: Error | null } {\n\t\ttry {\n\t\t\treturn { settings: SettingsManager.loadFromStorage(storage, scope), error: null };\n\t\t} catch (error) {\n\t\t\treturn { settings: {}, error: error as Error };\n\t\t}\n\t}\n\n\t/** Migrate old settings format to new format */\n\tprivate static migrateSettings(settings: Record<string, unknown>): Settings {\n\t\t// Migrate queueMode -> steeringMode\n\t\tif (\"queueMode\" in settings && !(\"steeringMode\" in settings)) {\n\t\t\tsettings.steeringMode = settings.queueMode;\n\t\t\tdelete settings.queueMode;\n\t\t}\n\n\t\t// Migrate legacy websockets boolean -> transport enum\n\t\tif (!(\"transport\" in settings) && typeof settings.websockets === \"boolean\") {\n\t\t\tsettings.transport = settings.websockets ? \"websocket\" : \"sse\";\n\t\t\tdelete settings.websockets;\n\t\t}\n\n\t\t// Migrate old skills object format to new array format\n\t\tif (\n\t\t\t\"skills\" in settings &&\n\t\t\ttypeof settings.skills === \"object\" &&\n\t\t\tsettings.skills !== null &&\n\t\t\t!Array.isArray(settings.skills)\n\t\t) {\n\t\t\tconst skillsSettings = settings.skills as {\n\t\t\t\tenableSkillCommands?: boolean;\n\t\t\t\tcustomDirectories?: unknown;\n\t\t\t};\n\t\t\tif (skillsSettings.enableSkillCommands !== undefined && settings.enableSkillCommands === undefined) {\n\t\t\t\tsettings.enableSkillCommands = skillsSettings.enableSkillCommands;\n\t\t\t}\n\t\t\tif (Array.isArray(skillsSettings.customDirectories) && skillsSettings.customDirectories.length > 0) {\n\t\t\t\tsettings.skills = skillsSettings.customDirectories;\n\t\t\t} else {\n\t\t\t\tdelete settings.skills;\n\t\t\t}\n\t\t}\n\n\t\treturn settings as Settings;\n\t}\n\n\tgetGlobalSettings(): Settings {\n\t\treturn structuredClone(this.globalSettings);\n\t}\n\n\tgetProjectSettings(): Settings {\n\t\treturn structuredClone(this.projectSettings);\n\t}\n\n\treload(): void {\n\t\tconst globalLoad = SettingsManager.tryLoadFromStorage(this.storage, \"global\");\n\t\tif (!globalLoad.error) {\n\t\t\tthis.globalSettings = globalLoad.settings;\n\t\t\tthis.globalSettingsLoadError = null;\n\t\t} else {\n\t\t\tthis.globalSettingsLoadError = globalLoad.error;\n\t\t\tthis.recordError(\"global\", globalLoad.error);\n\t\t}\n\n\t\tthis.modifiedFields.clear();\n\t\tthis.modifiedNestedFields.clear();\n\t\tthis.modifiedProjectFields.clear();\n\t\tthis.modifiedProjectNestedFields.clear();\n\n\t\tconst projectLoad = SettingsManager.tryLoadFromStorage(this.storage, \"project\");\n\t\tif (!projectLoad.error) {\n\t\t\tthis.projectSettings = projectLoad.settings;\n\t\t\tthis.projectSettingsLoadError = null;\n\t\t} else {\n\t\t\tthis.projectSettingsLoadError = projectLoad.error;\n\t\t\tthis.recordError(\"project\", projectLoad.error);\n\t\t}\n\n\t\tthis.settings = deepMergeSettings(this.globalSettings, this.projectSettings);\n\t}\n\n\t/** Apply additional overrides on top of current settings */\n\tapplyOverrides(overrides: Partial<Settings>): void {\n\t\tthis.settings = deepMergeSettings(this.settings, overrides);\n\t}\n\n\t/** Mark a global field as modified during this session */\n\tprivate markModified(field: keyof Settings, nestedKey?: string): void {\n\t\tthis.modifiedFields.add(field);\n\t\tif (nestedKey) {\n\t\t\tif (!this.modifiedNestedFields.has(field)) {\n\t\t\t\tthis.modifiedNestedFields.set(field, new Set());\n\t\t\t}\n\t\t\tthis.modifiedNestedFields.get(field)!.add(nestedKey);\n\t\t}\n\t}\n\n\t/** Mark a project field as modified during this session */\n\tprivate markProjectModified(field: keyof Settings, nestedKey?: string): void {\n\t\tthis.modifiedProjectFields.add(field);\n\t\tif (nestedKey) {\n\t\t\tif (!this.modifiedProjectNestedFields.has(field)) {\n\t\t\t\tthis.modifiedProjectNestedFields.set(field, new Set());\n\t\t\t}\n\t\t\tthis.modifiedProjectNestedFields.get(field)!.add(nestedKey);\n\t\t}\n\t}\n\n\tprivate recordError(scope: SettingsScope, error: unknown): void {\n\t\tconst normalizedError = error instanceof Error ? error : new Error(String(error));\n\t\tthis.errors.push({ scope, error: normalizedError });\n\t}\n\n\tprivate clearModifiedScope(scope: SettingsScope): void {\n\t\tif (scope === \"global\") {\n\t\t\tthis.modifiedFields.clear();\n\t\t\tthis.modifiedNestedFields.clear();\n\t\t\treturn;\n\t\t}\n\n\t\tthis.modifiedProjectFields.clear();\n\t\tthis.modifiedProjectNestedFields.clear();\n\t}\n\n\tprivate enqueueWrite(scope: SettingsScope, task: () => void): void {\n\t\tthis.writeQueue = this.writeQueue\n\t\t\t.then(() => {\n\t\t\t\ttask();\n\t\t\t\tthis.clearModifiedScope(scope);\n\t\t\t})\n\t\t\t.catch((error) => {\n\t\t\t\tthis.recordError(scope, error);\n\t\t\t});\n\t}\n\n\tprivate cloneModifiedNestedFields(source: Map<keyof Settings, Set<string>>): Map<keyof Settings, Set<string>> {\n\t\tconst snapshot = new Map<keyof Settings, Set<string>>();\n\t\tfor (const [key, value] of source.entries()) {\n\t\t\tsnapshot.set(key, new Set(value));\n\t\t}\n\t\treturn snapshot;\n\t}\n\n\tprivate persistScopedSettings(\n\t\tscope: SettingsScope,\n\t\tsnapshotSettings: Settings,\n\t\tmodifiedFields: Set<keyof Settings>,\n\t\tmodifiedNestedFields: Map<keyof Settings, Set<string>>,\n\t): void {\n\t\tthis.storage.withLock(scope, (current) => {\n\t\t\tconst currentFileSettings = current\n\t\t\t\t? SettingsManager.migrateSettings(JSON.parse(current) as Record<string, unknown>)\n\t\t\t\t: {};\n\t\t\tconst mergedSettings: Settings = { ...currentFileSettings };\n\t\t\tfor (const field of modifiedFields) {\n\t\t\t\tconst value = snapshotSettings[field];\n\t\t\t\tif (modifiedNestedFields.has(field) && typeof value === \"object\" && value !== null) {\n\t\t\t\t\tconst nestedModified = modifiedNestedFields.get(field)!;\n\t\t\t\t\tconst baseNested = (currentFileSettings[field] as Record<string, unknown>) ?? {};\n\t\t\t\t\tconst inMemoryNested = value as Record<string, unknown>;\n\t\t\t\t\tconst mergedNested = { ...baseNested };\n\t\t\t\t\tfor (const nestedKey of nestedModified) {\n\t\t\t\t\t\tmergedNested[nestedKey] = inMemoryNested[nestedKey];\n\t\t\t\t\t}\n\t\t\t\t\t(mergedSettings as Record<string, unknown>)[field] = mergedNested;\n\t\t\t\t} else {\n\t\t\t\t\t(mergedSettings as Record<string, unknown>)[field] = value;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn JSON.stringify(mergedSettings, null, 2);\n\t\t});\n\t}\n\n\tprivate save(): void {\n\t\tthis.settings = deepMergeSettings(this.globalSettings, this.projectSettings);\n\n\t\tif (this.globalSettingsLoadError) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst snapshotGlobalSettings = structuredClone(this.globalSettings);\n\t\tconst modifiedFields = new Set(this.modifiedFields);\n\t\tconst modifiedNestedFields = this.cloneModifiedNestedFields(this.modifiedNestedFields);\n\n\t\tthis.enqueueWrite(\"global\", () => {\n\t\t\tthis.persistScopedSettings(\"global\", snapshotGlobalSettings, modifiedFields, modifiedNestedFields);\n\t\t});\n\t}\n\n\tprivate saveProjectSettings(settings: Settings): void {\n\t\tthis.projectSettings = structuredClone(settings);\n\t\tthis.settings = deepMergeSettings(this.globalSettings, this.projectSettings);\n\n\t\tif (this.projectSettingsLoadError) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst snapshotProjectSettings = structuredClone(this.projectSettings);\n\t\tconst modifiedFields = new Set(this.modifiedProjectFields);\n\t\tconst modifiedNestedFields = this.cloneModifiedNestedFields(this.modifiedProjectNestedFields);\n\t\tthis.enqueueWrite(\"project\", () => {\n\t\t\tthis.persistScopedSettings(\"project\", snapshotProjectSettings, modifiedFields, modifiedNestedFields);\n\t\t});\n\t}\n\n\tasync flush(): Promise<void> {\n\t\tawait this.writeQueue;\n\t}\n\n\tdrainErrors(): SettingsError[] {\n\t\tconst drained = [...this.errors];\n\t\tthis.errors = [];\n\t\treturn drained;\n\t}\n\n\tgetLastChangelogVersion(): string | undefined {\n\t\treturn this.settings.lastChangelogVersion;\n\t}\n\n\tsetLastChangelogVersion(version: string): void {\n\t\tthis.globalSettings.lastChangelogVersion = version;\n\t\tthis.markModified(\"lastChangelogVersion\");\n\t\tthis.save();\n\t}\n\n\tgetDefaultProvider(): string | undefined {\n\t\treturn this.settings.defaultProvider;\n\t}\n\n\tgetDefaultModel(): string | undefined {\n\t\treturn this.settings.defaultModel;\n\t}\n\n\tsetDefaultProvider(provider: string): void {\n\t\tthis.globalSettings.defaultProvider = provider;\n\t\tthis.markModified(\"defaultProvider\");\n\t\tthis.save();\n\t}\n\n\tsetDefaultModel(modelId: string): void {\n\t\tthis.globalSettings.defaultModel = modelId;\n\t\tthis.markModified(\"defaultModel\");\n\t\tthis.save();\n\t}\n\n\tsetDefaultModelAndProvider(provider: string, modelId: string): void {\n\t\tthis.globalSettings.defaultProvider = provider;\n\t\tthis.globalSettings.defaultModel = modelId;\n\t\tthis.markModified(\"defaultProvider\");\n\t\tthis.markModified(\"defaultModel\");\n\t\tthis.save();\n\t}\n\n\tgetSteeringMode(): \"all\" | \"one-at-a-time\" {\n\t\treturn this.settings.steeringMode || \"one-at-a-time\";\n\t}\n\n\tsetSteeringMode(mode: \"all\" | \"one-at-a-time\"): void {\n\t\tthis.globalSettings.steeringMode = mode;\n\t\tthis.markModified(\"steeringMode\");\n\t\tthis.save();\n\t}\n\n\tgetFollowUpMode(): \"all\" | \"one-at-a-time\" {\n\t\treturn this.settings.followUpMode || \"one-at-a-time\";\n\t}\n\n\tsetFollowUpMode(mode: \"all\" | \"one-at-a-time\"): void {\n\t\tthis.globalSettings.followUpMode = mode;\n\t\tthis.markModified(\"followUpMode\");\n\t\tthis.save();\n\t}\n\n\tgetTheme(): string | undefined {\n\t\treturn this.settings.theme;\n\t}\n\n\tsetTheme(theme: string): void {\n\t\tthis.globalSettings.theme = theme;\n\t\tthis.markModified(\"theme\");\n\t\tthis.save();\n\t}\n\n\tgetDefaultThinkingLevel(): \"off\" | \"minimal\" | \"low\" | \"medium\" | \"high\" | \"xhigh\" | undefined {\n\t\treturn this.settings.defaultThinkingLevel;\n\t}\n\n\tsetDefaultThinkingLevel(level: \"off\" | \"minimal\" | \"low\" | \"medium\" | \"high\" | \"xhigh\"): void {\n\t\tthis.globalSettings.defaultThinkingLevel = level;\n\t\tthis.markModified(\"defaultThinkingLevel\");\n\t\tthis.save();\n\t}\n\n\tgetTransport(): TransportSetting {\n\t\treturn this.settings.transport ?? \"sse\";\n\t}\n\n\tsetTransport(transport: TransportSetting): void {\n\t\tthis.globalSettings.transport = transport;\n\t\tthis.markModified(\"transport\");\n\t\tthis.save();\n\t}\n\n\tgetCompactionEnabled(): boolean {\n\t\treturn this.settings.compaction?.enabled ?? true;\n\t}\n\n\tsetCompactionEnabled(enabled: boolean): void {\n\t\tif (!this.globalSettings.compaction) {\n\t\t\tthis.globalSettings.compaction = {};\n\t\t}\n\t\tthis.globalSettings.compaction.enabled = enabled;\n\t\tthis.markModified(\"compaction\", \"enabled\");\n\t\tthis.save();\n\t}\n\n\tgetCompactionReserveTokens(): number {\n\t\treturn this.settings.compaction?.reserveTokens ?? 16384;\n\t}\n\n\tgetCompactionKeepRecentTokens(): number {\n\t\treturn this.settings.compaction?.keepRecentTokens ?? 20000;\n\t}\n\n\tgetCompactionSettings(): { enabled: boolean; reserveTokens: number; keepRecentTokens: number } {\n\t\treturn {\n\t\t\tenabled: this.getCompactionEnabled(),\n\t\t\treserveTokens: this.getCompactionReserveTokens(),\n\t\t\tkeepRecentTokens: this.getCompactionKeepRecentTokens(),\n\t\t};\n\t}\n\n\tgetBranchSummarySettings(): { reserveTokens: number; skipPrompt: boolean } {\n\t\treturn {\n\t\t\treserveTokens: this.settings.branchSummary?.reserveTokens ?? 16384,\n\t\t\tskipPrompt: this.settings.branchSummary?.skipPrompt ?? false,\n\t\t};\n\t}\n\n\tgetBranchSummarySkipPrompt(): boolean {\n\t\treturn this.settings.branchSummary?.skipPrompt ?? false;\n\t}\n\n\tgetRetryEnabled(): boolean {\n\t\treturn this.settings.retry?.enabled ?? true;\n\t}\n\n\tsetRetryEnabled(enabled: boolean): void {\n\t\tif (!this.globalSettings.retry) {\n\t\t\tthis.globalSettings.retry = {};\n\t\t}\n\t\tthis.globalSettings.retry.enabled = enabled;\n\t\tthis.markModified(\"retry\", \"enabled\");\n\t\tthis.save();\n\t}\n\n\tgetRetrySettings(): { enabled: boolean; maxRetries: number; baseDelayMs: number; maxDelayMs: number } {\n\t\treturn {\n\t\t\tenabled: this.getRetryEnabled(),\n\t\t\tmaxRetries: this.settings.retry?.maxRetries ?? 3,\n\t\t\tbaseDelayMs: this.settings.retry?.baseDelayMs ?? 2000,\n\t\t\tmaxDelayMs: this.settings.retry?.maxDelayMs ?? 60000,\n\t\t};\n\t}\n\n\tgetHideThinkingBlock(): boolean {\n\t\treturn this.settings.hideThinkingBlock ?? false;\n\t}\n\n\tsetHideThinkingBlock(hide: boolean): void {\n\t\tthis.globalSettings.hideThinkingBlock = hide;\n\t\tthis.markModified(\"hideThinkingBlock\");\n\t\tthis.save();\n\t}\n\n\tgetShellPath(): string | undefined {\n\t\treturn this.settings.shellPath;\n\t}\n\n\tsetShellPath(path: string | undefined): void {\n\t\tthis.globalSettings.shellPath = path;\n\t\tthis.markModified(\"shellPath\");\n\t\tthis.save();\n\t}\n\n\tgetQuietStartup(): boolean {\n\t\treturn this.settings.quietStartup ?? false;\n\t}\n\n\tsetQuietStartup(quiet: boolean): void {\n\t\tthis.globalSettings.quietStartup = quiet;\n\t\tthis.markModified(\"quietStartup\");\n\t\tthis.save();\n\t}\n\n\tgetShellCommandPrefix(): string | undefined {\n\t\treturn this.settings.shellCommandPrefix;\n\t}\n\n\tsetShellCommandPrefix(prefix: string | undefined): void {\n\t\tthis.globalSettings.shellCommandPrefix = prefix;\n\t\tthis.markModified(\"shellCommandPrefix\");\n\t\tthis.save();\n\t}\n\n\tgetCollapseChangelog(): boolean {\n\t\treturn this.settings.collapseChangelog ?? false;\n\t}\n\n\tsetCollapseChangelog(collapse: boolean): void {\n\t\tthis.globalSettings.collapseChangelog = collapse;\n\t\tthis.markModified(\"collapseChangelog\");\n\t\tthis.save();\n\t}\n\n\tgetPackages(): PackageSource[] {\n\t\treturn [...(this.settings.packages ?? [])];\n\t}\n\n\tsetPackages(packages: PackageSource[]): void {\n\t\tthis.globalSettings.packages = packages;\n\t\tthis.markModified(\"packages\");\n\t\tthis.save();\n\t}\n\n\tsetProjectPackages(packages: PackageSource[]): void {\n\t\tconst projectSettings = structuredClone(this.projectSettings);\n\t\tprojectSettings.packages = packages;\n\t\tthis.markProjectModified(\"packages\");\n\t\tthis.saveProjectSettings(projectSettings);\n\t}\n\n\tgetExtensionPaths(): string[] {\n\t\treturn [...(this.settings.extensions ?? [])];\n\t}\n\n\tsetExtensionPaths(paths: string[]): void {\n\t\tthis.globalSettings.extensions = paths;\n\t\tthis.markModified(\"extensions\");\n\t\tthis.save();\n\t}\n\n\tsetProjectExtensionPaths(paths: string[]): void {\n\t\tconst projectSettings = structuredClone(this.projectSettings);\n\t\tprojectSettings.extensions = paths;\n\t\tthis.markProjectModified(\"extensions\");\n\t\tthis.saveProjectSettings(projectSettings);\n\t}\n\n\tgetSkillPaths(): string[] {\n\t\treturn [...(this.settings.skills ?? [])];\n\t}\n\n\tsetSkillPaths(paths: string[]): void {\n\t\tthis.globalSettings.skills = paths;\n\t\tthis.markModified(\"skills\");\n\t\tthis.save();\n\t}\n\n\tsetProjectSkillPaths(paths: string[]): void {\n\t\tconst projectSettings = structuredClone(this.projectSettings);\n\t\tprojectSettings.skills = paths;\n\t\tthis.markProjectModified(\"skills\");\n\t\tthis.saveProjectSettings(projectSettings);\n\t}\n\n\tgetPromptTemplatePaths(): string[] {\n\t\treturn [...(this.settings.prompts ?? [])];\n\t}\n\n\tsetPromptTemplatePaths(paths: string[]): void {\n\t\tthis.globalSettings.prompts = paths;\n\t\tthis.markModified(\"prompts\");\n\t\tthis.save();\n\t}\n\n\tsetProjectPromptTemplatePaths(paths: string[]): void {\n\t\tconst projectSettings = structuredClone(this.projectSettings);\n\t\tprojectSettings.prompts = paths;\n\t\tthis.markProjectModified(\"prompts\");\n\t\tthis.saveProjectSettings(projectSettings);\n\t}\n\n\tgetThemePaths(): string[] {\n\t\treturn [...(this.settings.themes ?? [])];\n\t}\n\n\tsetThemePaths(paths: string[]): void {\n\t\tthis.globalSettings.themes = paths;\n\t\tthis.markModified(\"themes\");\n\t\tthis.save();\n\t}\n\n\tsetProjectThemePaths(paths: string[]): void {\n\t\tconst projectSettings = structuredClone(this.projectSettings);\n\t\tprojectSettings.themes = paths;\n\t\tthis.markProjectModified(\"themes\");\n\t\tthis.saveProjectSettings(projectSettings);\n\t}\n\n\tgetEnableSkillCommands(): boolean {\n\t\treturn this.settings.enableSkillCommands ?? true;\n\t}\n\n\tsetEnableSkillCommands(enabled: boolean): void {\n\t\tthis.globalSettings.enableSkillCommands = enabled;\n\t\tthis.markModified(\"enableSkillCommands\");\n\t\tthis.save();\n\t}\n\n\tgetThinkingBudgets(): ThinkingBudgetsSettings | undefined {\n\t\treturn this.settings.thinkingBudgets;\n\t}\n\n\tgetShowImages(): boolean {\n\t\treturn this.settings.terminal?.showImages ?? true;\n\t}\n\n\tsetShowImages(show: boolean): void {\n\t\tif (!this.globalSettings.terminal) {\n\t\t\tthis.globalSettings.terminal = {};\n\t\t}\n\t\tthis.globalSettings.terminal.showImages = show;\n\t\tthis.markModified(\"terminal\", \"showImages\");\n\t\tthis.save();\n\t}\n\n\tgetClearOnShrink(): boolean {\n\t\t// Settings takes precedence, then env var, then default false\n\t\tif (this.settings.terminal?.clearOnShrink !== undefined) {\n\t\t\treturn this.settings.terminal.clearOnShrink;\n\t\t}\n\t\treturn process.env.PI_CLEAR_ON_SHRINK === \"1\";\n\t}\n\n\tsetClearOnShrink(enabled: boolean): void {\n\t\tif (!this.globalSettings.terminal) {\n\t\t\tthis.globalSettings.terminal = {};\n\t\t}\n\t\tthis.globalSettings.terminal.clearOnShrink = enabled;\n\t\tthis.markModified(\"terminal\", \"clearOnShrink\");\n\t\tthis.save();\n\t}\n\n\tgetImageAutoResize(): boolean {\n\t\treturn this.settings.images?.autoResize ?? true;\n\t}\n\n\tsetImageAutoResize(enabled: boolean): void {\n\t\tif (!this.globalSettings.images) {\n\t\t\tthis.globalSettings.images = {};\n\t\t}\n\t\tthis.globalSettings.images.autoResize = enabled;\n\t\tthis.markModified(\"images\", \"autoResize\");\n\t\tthis.save();\n\t}\n\n\tgetBlockImages(): boolean {\n\t\treturn this.settings.images?.blockImages ?? false;\n\t}\n\n\tsetBlockImages(blocked: boolean): void {\n\t\tif (!this.globalSettings.images) {\n\t\t\tthis.globalSettings.images = {};\n\t\t}\n\t\tthis.globalSettings.images.blockImages = blocked;\n\t\tthis.markModified(\"images\", \"blockImages\");\n\t\tthis.save();\n\t}\n\n\tgetEnabledModels(): string[] | undefined {\n\t\treturn this.settings.enabledModels;\n\t}\n\n\tsetEnabledModels(patterns: string[] | undefined): void {\n\t\tthis.globalSettings.enabledModels = patterns;\n\t\tthis.markModified(\"enabledModels\");\n\t\tthis.save();\n\t}\n\n\tgetDoubleEscapeAction(): \"fork\" | \"tree\" | \"none\" {\n\t\treturn this.settings.doubleEscapeAction ?? \"tree\";\n\t}\n\n\tsetDoubleEscapeAction(action: \"fork\" | \"tree\" | \"none\"): void {\n\t\tthis.globalSettings.doubleEscapeAction = action;\n\t\tthis.markModified(\"doubleEscapeAction\");\n\t\tthis.save();\n\t}\n\n\tgetTreeFilterMode(): \"default\" | \"no-tools\" | \"user-only\" | \"labeled-only\" | \"all\" {\n\t\tconst mode = this.settings.treeFilterMode;\n\t\tconst valid = [\"default\", \"no-tools\", \"user-only\", \"labeled-only\", \"all\"];\n\t\treturn mode && valid.includes(mode) ? mode : \"default\";\n\t}\n\n\tsetTreeFilterMode(mode: \"default\" | \"no-tools\" | \"user-only\" | \"labeled-only\" | \"all\"): void {\n\t\tthis.globalSettings.treeFilterMode = mode;\n\t\tthis.markModified(\"treeFilterMode\");\n\t\tthis.save();\n\t}\n\n\tgetShowHardwareCursor(): boolean {\n\t\treturn this.settings.showHardwareCursor ?? process.env.PI_HARDWARE_CURSOR === \"1\";\n\t}\n\n\tsetShowHardwareCursor(enabled: boolean): void {\n\t\tthis.globalSettings.showHardwareCursor = enabled;\n\t\tthis.markModified(\"showHardwareCursor\");\n\t\tthis.save();\n\t}\n\n\tgetEditorPaddingX(): number {\n\t\treturn this.settings.editorPaddingX ?? 0;\n\t}\n\n\tsetEditorPaddingX(padding: number): void {\n\t\tthis.globalSettings.editorPaddingX = Math.max(0, Math.min(3, Math.floor(padding)));\n\t\tthis.markModified(\"editorPaddingX\");\n\t\tthis.save();\n\t}\n\n\tgetAutocompleteMaxVisible(): number {\n\t\treturn this.settings.autocompleteMaxVisible ?? 5;\n\t}\n\n\tsetAutocompleteMaxVisible(maxVisible: number): void {\n\t\tthis.globalSettings.autocompleteMaxVisible = Math.max(3, Math.min(20, Math.floor(maxVisible)));\n\t\tthis.markModified(\"autocompleteMaxVisible\");\n\t\tthis.save();\n\t}\n\n\tgetCodeBlockIndent(): string {\n\t\treturn this.settings.markdown?.codeBlockIndent ?? \" \";\n\t}\n}\n"]}
@@ -0,0 +1,58 @@
1
+ import type { ResourceDiagnostic } from "./diagnostics.js";
2
+ export interface SkillFrontmatter {
3
+ name?: string;
4
+ description?: string;
5
+ "disable-model-invocation"?: boolean;
6
+ [key: string]: unknown;
7
+ }
8
+ export interface Skill {
9
+ name: string;
10
+ description: string;
11
+ filePath: string;
12
+ baseDir: string;
13
+ source: string;
14
+ disableModelInvocation: boolean;
15
+ }
16
+ export interface LoadSkillsResult {
17
+ skills: Skill[];
18
+ diagnostics: ResourceDiagnostic[];
19
+ }
20
+ export interface LoadSkillsFromDirOptions {
21
+ /** Directory to scan for skills */
22
+ dir: string;
23
+ /** Source identifier for these skills */
24
+ source: string;
25
+ }
26
+ /**
27
+ * Load skills from a directory.
28
+ *
29
+ * Discovery rules:
30
+ * - direct .md children in the root
31
+ * - recursive SKILL.md under subdirectories
32
+ */
33
+ export declare function loadSkillsFromDir(options: LoadSkillsFromDirOptions): LoadSkillsResult;
34
+ /**
35
+ * Format skills for inclusion in a system prompt.
36
+ * Uses XML format per Agent Skills standard.
37
+ * See: https://agentskills.io/integrate-skills
38
+ *
39
+ * Skills with disableModelInvocation=true are excluded from the prompt
40
+ * (they can only be invoked explicitly via /skill:name commands).
41
+ */
42
+ export declare function formatSkillsForPrompt(skills: Skill[]): string;
43
+ export interface LoadSkillsOptions {
44
+ /** Working directory for project-local skills. Default: process.cwd() */
45
+ cwd?: string;
46
+ /** Agent config directory for global skills. Default: ~/.pi/agent */
47
+ agentDir?: string;
48
+ /** Explicit skill paths (files or directories) */
49
+ skillPaths?: string[];
50
+ /** Include default skills directories. Default: true */
51
+ includeDefaults?: boolean;
52
+ }
53
+ /**
54
+ * Load skills from all configured locations.
55
+ * Returns skills and any validation diagnostics.
56
+ */
57
+ export declare function loadSkills(options?: LoadSkillsOptions): LoadSkillsResult;
58
+ //# sourceMappingURL=skills.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../../src/core/skills.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AA2D3D,MAAM,WAAW,gBAAgB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,KAAK;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,sBAAsB,EAAE,OAAO,CAAC;CAChC;AAED,MAAM,WAAW,gBAAgB;IAChC,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,WAAW,EAAE,kBAAkB,EAAE,CAAC;CAClC;AA+CD,MAAM,WAAW,wBAAwB;IACxC,mCAAmC;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,yCAAyC;IACzC,MAAM,EAAE,MAAM,CAAC;CACf;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,GAAG,gBAAgB,CAGrF;AAqID;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,CA0B7D;AAWD,MAAM,WAAW,iBAAiB;IACjC,yEAAyE;IACzE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,qEAAqE;IACrE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kDAAkD;IAClD,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,wDAAwD;IACxD,eAAe,CAAC,EAAE,OAAO,CAAC;CAC1B;AAeD;;;GAGG;AACH,wBAAgB,UAAU,CAAC,OAAO,GAAE,iBAAsB,GAAG,gBAAgB,CAwG5E"}
@@ -0,0 +1,364 @@
1
+ import { existsSync, readdirSync, readFileSync, realpathSync, statSync } from "fs";
2
+ import ignore from "ignore";
3
+ import { homedir } from "os";
4
+ import { basename, dirname, isAbsolute, join, relative, resolve, sep } from "path";
5
+ import { CONFIG_DIR_NAME, getAgentDir } from "../config.js";
6
+ import { parseFrontmatter } from "../utils/frontmatter.js";
7
+ /** Max name length per spec */
8
+ const MAX_NAME_LENGTH = 64;
9
+ /** Max description length per spec */
10
+ const MAX_DESCRIPTION_LENGTH = 1024;
11
+ const IGNORE_FILE_NAMES = [".gitignore", ".ignore", ".fdignore"];
12
+ function toPosixPath(p) {
13
+ return p.split(sep).join("/");
14
+ }
15
+ function prefixIgnorePattern(line, prefix) {
16
+ const trimmed = line.trim();
17
+ if (!trimmed)
18
+ return null;
19
+ if (trimmed.startsWith("#") && !trimmed.startsWith("\\#"))
20
+ return null;
21
+ let pattern = line;
22
+ let negated = false;
23
+ if (pattern.startsWith("!")) {
24
+ negated = true;
25
+ pattern = pattern.slice(1);
26
+ }
27
+ else if (pattern.startsWith("\\!")) {
28
+ pattern = pattern.slice(1);
29
+ }
30
+ if (pattern.startsWith("/")) {
31
+ pattern = pattern.slice(1);
32
+ }
33
+ const prefixed = prefix ? `${prefix}${pattern}` : pattern;
34
+ return negated ? `!${prefixed}` : prefixed;
35
+ }
36
+ function addIgnoreRules(ig, dir, rootDir) {
37
+ const relativeDir = relative(rootDir, dir);
38
+ const prefix = relativeDir ? `${toPosixPath(relativeDir)}/` : "";
39
+ for (const filename of IGNORE_FILE_NAMES) {
40
+ const ignorePath = join(dir, filename);
41
+ if (!existsSync(ignorePath))
42
+ continue;
43
+ try {
44
+ const content = readFileSync(ignorePath, "utf-8");
45
+ const patterns = content
46
+ .split(/\r?\n/)
47
+ .map((line) => prefixIgnorePattern(line, prefix))
48
+ .filter((line) => Boolean(line));
49
+ if (patterns.length > 0) {
50
+ ig.add(patterns);
51
+ }
52
+ }
53
+ catch { }
54
+ }
55
+ }
56
+ /**
57
+ * Validate skill name per Agent Skills spec.
58
+ * Returns array of validation error messages (empty if valid).
59
+ */
60
+ function validateName(name, parentDirName) {
61
+ const errors = [];
62
+ if (name !== parentDirName) {
63
+ errors.push(`name "${name}" does not match parent directory "${parentDirName}"`);
64
+ }
65
+ if (name.length > MAX_NAME_LENGTH) {
66
+ errors.push(`name exceeds ${MAX_NAME_LENGTH} characters (${name.length})`);
67
+ }
68
+ if (!/^[a-z0-9-]+$/.test(name)) {
69
+ errors.push(`name contains invalid characters (must be lowercase a-z, 0-9, hyphens only)`);
70
+ }
71
+ if (name.startsWith("-") || name.endsWith("-")) {
72
+ errors.push(`name must not start or end with a hyphen`);
73
+ }
74
+ if (name.includes("--")) {
75
+ errors.push(`name must not contain consecutive hyphens`);
76
+ }
77
+ return errors;
78
+ }
79
+ /**
80
+ * Validate description per Agent Skills spec.
81
+ */
82
+ function validateDescription(description) {
83
+ const errors = [];
84
+ if (!description || description.trim() === "") {
85
+ errors.push("description is required");
86
+ }
87
+ else if (description.length > MAX_DESCRIPTION_LENGTH) {
88
+ errors.push(`description exceeds ${MAX_DESCRIPTION_LENGTH} characters (${description.length})`);
89
+ }
90
+ return errors;
91
+ }
92
+ /**
93
+ * Load skills from a directory.
94
+ *
95
+ * Discovery rules:
96
+ * - direct .md children in the root
97
+ * - recursive SKILL.md under subdirectories
98
+ */
99
+ export function loadSkillsFromDir(options) {
100
+ const { dir, source } = options;
101
+ return loadSkillsFromDirInternal(dir, source, true);
102
+ }
103
+ function loadSkillsFromDirInternal(dir, source, includeRootFiles, ignoreMatcher, rootDir) {
104
+ const skills = [];
105
+ const diagnostics = [];
106
+ if (!existsSync(dir)) {
107
+ return { skills, diagnostics };
108
+ }
109
+ const root = rootDir ?? dir;
110
+ const ig = ignoreMatcher ?? ignore();
111
+ addIgnoreRules(ig, dir, root);
112
+ try {
113
+ const entries = readdirSync(dir, { withFileTypes: true });
114
+ for (const entry of entries) {
115
+ if (entry.name.startsWith(".")) {
116
+ continue;
117
+ }
118
+ // Skip node_modules to avoid scanning dependencies
119
+ if (entry.name === "node_modules") {
120
+ continue;
121
+ }
122
+ const fullPath = join(dir, entry.name);
123
+ // For symlinks, check if they point to a directory and follow them
124
+ let isDirectory = entry.isDirectory();
125
+ let isFile = entry.isFile();
126
+ if (entry.isSymbolicLink()) {
127
+ try {
128
+ const stats = statSync(fullPath);
129
+ isDirectory = stats.isDirectory();
130
+ isFile = stats.isFile();
131
+ }
132
+ catch {
133
+ // Broken symlink, skip it
134
+ continue;
135
+ }
136
+ }
137
+ const relPath = toPosixPath(relative(root, fullPath));
138
+ const ignorePath = isDirectory ? `${relPath}/` : relPath;
139
+ if (ig.ignores(ignorePath)) {
140
+ continue;
141
+ }
142
+ if (isDirectory) {
143
+ const subResult = loadSkillsFromDirInternal(fullPath, source, false, ig, root);
144
+ skills.push(...subResult.skills);
145
+ diagnostics.push(...subResult.diagnostics);
146
+ continue;
147
+ }
148
+ if (!isFile) {
149
+ continue;
150
+ }
151
+ const isRootMd = includeRootFiles && entry.name.endsWith(".md");
152
+ const isSkillMd = !includeRootFiles && entry.name === "SKILL.md";
153
+ if (!isRootMd && !isSkillMd) {
154
+ continue;
155
+ }
156
+ const result = loadSkillFromFile(fullPath, source);
157
+ if (result.skill) {
158
+ skills.push(result.skill);
159
+ }
160
+ diagnostics.push(...result.diagnostics);
161
+ }
162
+ }
163
+ catch { }
164
+ return { skills, diagnostics };
165
+ }
166
+ function loadSkillFromFile(filePath, source) {
167
+ const diagnostics = [];
168
+ try {
169
+ const rawContent = readFileSync(filePath, "utf-8");
170
+ const { frontmatter } = parseFrontmatter(rawContent);
171
+ const skillDir = dirname(filePath);
172
+ const parentDirName = basename(skillDir);
173
+ // Validate description
174
+ const descErrors = validateDescription(frontmatter.description);
175
+ for (const error of descErrors) {
176
+ diagnostics.push({ type: "warning", message: error, path: filePath });
177
+ }
178
+ // Use name from frontmatter, or fall back to parent directory name
179
+ const name = frontmatter.name || parentDirName;
180
+ // Validate name
181
+ const nameErrors = validateName(name, parentDirName);
182
+ for (const error of nameErrors) {
183
+ diagnostics.push({ type: "warning", message: error, path: filePath });
184
+ }
185
+ // Still load the skill even with warnings (unless description is completely missing)
186
+ if (!frontmatter.description || frontmatter.description.trim() === "") {
187
+ return { skill: null, diagnostics };
188
+ }
189
+ return {
190
+ skill: {
191
+ name,
192
+ description: frontmatter.description,
193
+ filePath,
194
+ baseDir: skillDir,
195
+ source,
196
+ disableModelInvocation: frontmatter["disable-model-invocation"] === true,
197
+ },
198
+ diagnostics,
199
+ };
200
+ }
201
+ catch (error) {
202
+ const message = error instanceof Error ? error.message : "failed to parse skill file";
203
+ diagnostics.push({ type: "warning", message, path: filePath });
204
+ return { skill: null, diagnostics };
205
+ }
206
+ }
207
+ /**
208
+ * Format skills for inclusion in a system prompt.
209
+ * Uses XML format per Agent Skills standard.
210
+ * See: https://agentskills.io/integrate-skills
211
+ *
212
+ * Skills with disableModelInvocation=true are excluded from the prompt
213
+ * (they can only be invoked explicitly via /skill:name commands).
214
+ */
215
+ export function formatSkillsForPrompt(skills) {
216
+ const visibleSkills = skills.filter((s) => !s.disableModelInvocation);
217
+ if (visibleSkills.length === 0) {
218
+ return "";
219
+ }
220
+ const lines = [
221
+ "\n\nThe following skills provide specialized instructions for specific tasks.",
222
+ "Use the read tool to load a skill's file when the task matches its description.",
223
+ "When a skill file references a relative path, resolve it against the skill directory (parent of SKILL.md / dirname of the path) and use that absolute path in tool commands.",
224
+ "",
225
+ "<available_skills>",
226
+ ];
227
+ for (const skill of visibleSkills) {
228
+ lines.push(" <skill>");
229
+ lines.push(` <name>${escapeXml(skill.name)}</name>`);
230
+ lines.push(` <description>${escapeXml(skill.description)}</description>`);
231
+ lines.push(` <location>${escapeXml(skill.filePath)}</location>`);
232
+ lines.push(" </skill>");
233
+ }
234
+ lines.push("</available_skills>");
235
+ return lines.join("\n");
236
+ }
237
+ function escapeXml(str) {
238
+ return str
239
+ .replace(/&/g, "&amp;")
240
+ .replace(/</g, "&lt;")
241
+ .replace(/>/g, "&gt;")
242
+ .replace(/"/g, "&quot;")
243
+ .replace(/'/g, "&apos;");
244
+ }
245
+ function normalizePath(input) {
246
+ const trimmed = input.trim();
247
+ if (trimmed === "~")
248
+ return homedir();
249
+ if (trimmed.startsWith("~/"))
250
+ return join(homedir(), trimmed.slice(2));
251
+ if (trimmed.startsWith("~"))
252
+ return join(homedir(), trimmed.slice(1));
253
+ return trimmed;
254
+ }
255
+ function resolveSkillPath(p, cwd) {
256
+ const normalized = normalizePath(p);
257
+ return isAbsolute(normalized) ? normalized : resolve(cwd, normalized);
258
+ }
259
+ /**
260
+ * Load skills from all configured locations.
261
+ * Returns skills and any validation diagnostics.
262
+ */
263
+ export function loadSkills(options = {}) {
264
+ const { cwd = process.cwd(), agentDir, skillPaths = [], includeDefaults = true } = options;
265
+ // Resolve agentDir - if not provided, use default from config
266
+ const resolvedAgentDir = agentDir ?? getAgentDir();
267
+ const skillMap = new Map();
268
+ const realPathSet = new Set();
269
+ const allDiagnostics = [];
270
+ const collisionDiagnostics = [];
271
+ function addSkills(result) {
272
+ allDiagnostics.push(...result.diagnostics);
273
+ for (const skill of result.skills) {
274
+ // Resolve symlinks to detect duplicate files
275
+ let realPath;
276
+ try {
277
+ realPath = realpathSync(skill.filePath);
278
+ }
279
+ catch {
280
+ realPath = skill.filePath;
281
+ }
282
+ // Skip silently if we've already loaded this exact file (via symlink)
283
+ if (realPathSet.has(realPath)) {
284
+ continue;
285
+ }
286
+ const existing = skillMap.get(skill.name);
287
+ if (existing) {
288
+ collisionDiagnostics.push({
289
+ type: "collision",
290
+ message: `name "${skill.name}" collision`,
291
+ path: skill.filePath,
292
+ collision: {
293
+ resourceType: "skill",
294
+ name: skill.name,
295
+ winnerPath: existing.filePath,
296
+ loserPath: skill.filePath,
297
+ },
298
+ });
299
+ }
300
+ else {
301
+ skillMap.set(skill.name, skill);
302
+ realPathSet.add(realPath);
303
+ }
304
+ }
305
+ }
306
+ if (includeDefaults) {
307
+ addSkills(loadSkillsFromDirInternal(join(resolvedAgentDir, "skills"), "user", true));
308
+ addSkills(loadSkillsFromDirInternal(resolve(cwd, CONFIG_DIR_NAME, "skills"), "project", true));
309
+ }
310
+ const userSkillsDir = join(resolvedAgentDir, "skills");
311
+ const projectSkillsDir = resolve(cwd, CONFIG_DIR_NAME, "skills");
312
+ const isUnderPath = (target, root) => {
313
+ const normalizedRoot = resolve(root);
314
+ if (target === normalizedRoot) {
315
+ return true;
316
+ }
317
+ const prefix = normalizedRoot.endsWith(sep) ? normalizedRoot : `${normalizedRoot}${sep}`;
318
+ return target.startsWith(prefix);
319
+ };
320
+ const getSource = (resolvedPath) => {
321
+ if (!includeDefaults) {
322
+ if (isUnderPath(resolvedPath, userSkillsDir))
323
+ return "user";
324
+ if (isUnderPath(resolvedPath, projectSkillsDir))
325
+ return "project";
326
+ }
327
+ return "path";
328
+ };
329
+ for (const rawPath of skillPaths) {
330
+ const resolvedPath = resolveSkillPath(rawPath, cwd);
331
+ if (!existsSync(resolvedPath)) {
332
+ allDiagnostics.push({ type: "warning", message: "skill path does not exist", path: resolvedPath });
333
+ continue;
334
+ }
335
+ try {
336
+ const stats = statSync(resolvedPath);
337
+ const source = getSource(resolvedPath);
338
+ if (stats.isDirectory()) {
339
+ addSkills(loadSkillsFromDirInternal(resolvedPath, source, true));
340
+ }
341
+ else if (stats.isFile() && resolvedPath.endsWith(".md")) {
342
+ const result = loadSkillFromFile(resolvedPath, source);
343
+ if (result.skill) {
344
+ addSkills({ skills: [result.skill], diagnostics: result.diagnostics });
345
+ }
346
+ else {
347
+ allDiagnostics.push(...result.diagnostics);
348
+ }
349
+ }
350
+ else {
351
+ allDiagnostics.push({ type: "warning", message: "skill path is not a markdown file", path: resolvedPath });
352
+ }
353
+ }
354
+ catch (error) {
355
+ const message = error instanceof Error ? error.message : "failed to read skill path";
356
+ allDiagnostics.push({ type: "warning", message, path: resolvedPath });
357
+ }
358
+ }
359
+ return {
360
+ skills: Array.from(skillMap.values()),
361
+ diagnostics: [...allDiagnostics, ...collisionDiagnostics],
362
+ };
363
+ }
364
+ //# sourceMappingURL=skills.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skills.js","sourceRoot":"","sources":["../../src/core/skills.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AACnF,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AACnF,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAG3D,+BAA+B;AAC/B,MAAM,eAAe,GAAG,EAAE,CAAC;AAE3B,sCAAsC;AACtC,MAAM,sBAAsB,GAAG,IAAI,CAAC;AAEpC,MAAM,iBAAiB,GAAG,CAAC,YAAY,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC;AAIjE,SAAS,WAAW,CAAC,CAAS;IAC7B,OAAO,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/B,CAAC;AAED,SAAS,mBAAmB,CAAC,IAAY,EAAE,MAAc;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CAAC;IACF,CAAC;IAED,OAAO;QACN,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;QACrC,WAAW,EAAE,CAAC,GAAG,cAAc,EAAE,GAAG,oBAAoB,CAAC;KACzD,CAAC;AACH,CAAC","sourcesContent":["import { existsSync, readdirSync, readFileSync, realpathSync, statSync } from \"fs\";\nimport ignore from \"ignore\";\nimport { homedir } from \"os\";\nimport { basename, dirname, isAbsolute, join, relative, resolve, sep } from \"path\";\nimport { CONFIG_DIR_NAME, getAgentDir } from \"../config.js\";\nimport { parseFrontmatter } from \"../utils/frontmatter.js\";\nimport type { ResourceDiagnostic } from \"./diagnostics.js\";\n\n/** Max name length per spec */\nconst MAX_NAME_LENGTH = 64;\n\n/** Max description length per spec */\nconst MAX_DESCRIPTION_LENGTH = 1024;\n\nconst IGNORE_FILE_NAMES = [\".gitignore\", \".ignore\", \".fdignore\"];\n\ntype IgnoreMatcher = ReturnType<typeof ignore>;\n\nfunction toPosixPath(p: string): string {\n\treturn p.split(sep).join(\"/\");\n}\n\nfunction prefixIgnorePattern(line: string, prefix: string): string | null {\n\tconst trimmed = line.trim();\n\tif (!trimmed) return null;\n\tif (trimmed.startsWith(\"#\") && !trimmed.startsWith(\"\\\\#\")) return null;\n\n\tlet pattern = line;\n\tlet negated = false;\n\n\tif (pattern.startsWith(\"!\")) {\n\t\tnegated = true;\n\t\tpattern = pattern.slice(1);\n\t} else if (pattern.startsWith(\"\\\\!\")) {\n\t\tpattern = pattern.slice(1);\n\t}\n\n\tif (pattern.startsWith(\"/\")) {\n\t\tpattern = pattern.slice(1);\n\t}\n\n\tconst prefixed = prefix ? `${prefix}${pattern}` : pattern;\n\treturn negated ? `!${prefixed}` : prefixed;\n}\n\nfunction addIgnoreRules(ig: IgnoreMatcher, dir: string, rootDir: string): void {\n\tconst relativeDir = relative(rootDir, dir);\n\tconst prefix = relativeDir ? `${toPosixPath(relativeDir)}/` : \"\";\n\n\tfor (const filename of IGNORE_FILE_NAMES) {\n\t\tconst ignorePath = join(dir, filename);\n\t\tif (!existsSync(ignorePath)) continue;\n\t\ttry {\n\t\t\tconst content = readFileSync(ignorePath, \"utf-8\");\n\t\t\tconst patterns = content\n\t\t\t\t.split(/\\r?\\n/)\n\t\t\t\t.map((line) => prefixIgnorePattern(line, prefix))\n\t\t\t\t.filter((line): line is string => Boolean(line));\n\t\t\tif (patterns.length > 0) {\n\t\t\t\tig.add(patterns);\n\t\t\t}\n\t\t} catch {}\n\t}\n}\n\nexport interface SkillFrontmatter {\n\tname?: string;\n\tdescription?: string;\n\t\"disable-model-invocation\"?: boolean;\n\t[key: string]: unknown;\n}\n\nexport interface Skill {\n\tname: string;\n\tdescription: string;\n\tfilePath: string;\n\tbaseDir: string;\n\tsource: string;\n\tdisableModelInvocation: boolean;\n}\n\nexport interface LoadSkillsResult {\n\tskills: Skill[];\n\tdiagnostics: ResourceDiagnostic[];\n}\n\n/**\n * Validate skill name per Agent Skills spec.\n * Returns array of validation error messages (empty if valid).\n */\nfunction validateName(name: string, parentDirName: string): string[] {\n\tconst errors: string[] = [];\n\n\tif (name !== parentDirName) {\n\t\terrors.push(`name \"${name}\" does not match parent directory \"${parentDirName}\"`);\n\t}\n\n\tif (name.length > MAX_NAME_LENGTH) {\n\t\terrors.push(`name exceeds ${MAX_NAME_LENGTH} characters (${name.length})`);\n\t}\n\n\tif (!/^[a-z0-9-]+$/.test(name)) {\n\t\terrors.push(`name contains invalid characters (must be lowercase a-z, 0-9, hyphens only)`);\n\t}\n\n\tif (name.startsWith(\"-\") || name.endsWith(\"-\")) {\n\t\terrors.push(`name must not start or end with a hyphen`);\n\t}\n\n\tif (name.includes(\"--\")) {\n\t\terrors.push(`name must not contain consecutive hyphens`);\n\t}\n\n\treturn errors;\n}\n\n/**\n * Validate description per Agent Skills spec.\n */\nfunction validateDescription(description: string | undefined): string[] {\n\tconst errors: string[] = [];\n\n\tif (!description || description.trim() === \"\") {\n\t\terrors.push(\"description is required\");\n\t} else if (description.length > MAX_DESCRIPTION_LENGTH) {\n\t\terrors.push(`description exceeds ${MAX_DESCRIPTION_LENGTH} characters (${description.length})`);\n\t}\n\n\treturn errors;\n}\n\nexport interface LoadSkillsFromDirOptions {\n\t/** Directory to scan for skills */\n\tdir: string;\n\t/** Source identifier for these skills */\n\tsource: string;\n}\n\n/**\n * Load skills from a directory.\n *\n * Discovery rules:\n * - direct .md children in the root\n * - recursive SKILL.md under subdirectories\n */\nexport function loadSkillsFromDir(options: LoadSkillsFromDirOptions): LoadSkillsResult {\n\tconst { dir, source } = options;\n\treturn loadSkillsFromDirInternal(dir, source, true);\n}\n\nfunction loadSkillsFromDirInternal(\n\tdir: string,\n\tsource: string,\n\tincludeRootFiles: boolean,\n\tignoreMatcher?: IgnoreMatcher,\n\trootDir?: string,\n): LoadSkillsResult {\n\tconst skills: Skill[] = [];\n\tconst diagnostics: ResourceDiagnostic[] = [];\n\n\tif (!existsSync(dir)) {\n\t\treturn { skills, diagnostics };\n\t}\n\n\tconst root = rootDir ?? dir;\n\tconst ig = ignoreMatcher ?? ignore();\n\taddIgnoreRules(ig, dir, root);\n\n\ttry {\n\t\tconst entries = readdirSync(dir, { withFileTypes: true });\n\n\t\tfor (const entry of entries) {\n\t\t\tif (entry.name.startsWith(\".\")) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Skip node_modules to avoid scanning dependencies\n\t\t\tif (entry.name === \"node_modules\") {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst fullPath = join(dir, entry.name);\n\n\t\t\t// For symlinks, check if they point to a directory and follow them\n\t\t\tlet isDirectory = entry.isDirectory();\n\t\t\tlet isFile = entry.isFile();\n\t\t\tif (entry.isSymbolicLink()) {\n\t\t\t\ttry {\n\t\t\t\t\tconst stats = statSync(fullPath);\n\t\t\t\t\tisDirectory = stats.isDirectory();\n\t\t\t\t\tisFile = stats.isFile();\n\t\t\t\t} catch {\n\t\t\t\t\t// Broken symlink, skip it\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst relPath = toPosixPath(relative(root, fullPath));\n\t\t\tconst ignorePath = isDirectory ? `${relPath}/` : relPath;\n\t\t\tif (ig.ignores(ignorePath)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (isDirectory) {\n\t\t\t\tconst subResult = loadSkillsFromDirInternal(fullPath, source, false, ig, root);\n\t\t\t\tskills.push(...subResult.skills);\n\t\t\t\tdiagnostics.push(...subResult.diagnostics);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (!isFile) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst isRootMd = includeRootFiles && entry.name.endsWith(\".md\");\n\t\t\tconst isSkillMd = !includeRootFiles && entry.name === \"SKILL.md\";\n\t\t\tif (!isRootMd && !isSkillMd) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst result = loadSkillFromFile(fullPath, source);\n\t\t\tif (result.skill) {\n\t\t\t\tskills.push(result.skill);\n\t\t\t}\n\t\t\tdiagnostics.push(...result.diagnostics);\n\t\t}\n\t} catch {}\n\n\treturn { skills, diagnostics };\n}\n\nfunction loadSkillFromFile(\n\tfilePath: string,\n\tsource: string,\n): { skill: Skill | null; diagnostics: ResourceDiagnostic[] } {\n\tconst diagnostics: ResourceDiagnostic[] = [];\n\n\ttry {\n\t\tconst rawContent = readFileSync(filePath, \"utf-8\");\n\t\tconst { frontmatter } = parseFrontmatter<SkillFrontmatter>(rawContent);\n\t\tconst skillDir = dirname(filePath);\n\t\tconst parentDirName = basename(skillDir);\n\n\t\t// Validate description\n\t\tconst descErrors = validateDescription(frontmatter.description);\n\t\tfor (const error of descErrors) {\n\t\t\tdiagnostics.push({ type: \"warning\", message: error, path: filePath });\n\t\t}\n\n\t\t// Use name from frontmatter, or fall back to parent directory name\n\t\tconst name = frontmatter.name || parentDirName;\n\n\t\t// Validate name\n\t\tconst nameErrors = validateName(name, parentDirName);\n\t\tfor (const error of nameErrors) {\n\t\t\tdiagnostics.push({ type: \"warning\", message: error, path: filePath });\n\t\t}\n\n\t\t// Still load the skill even with warnings (unless description is completely missing)\n\t\tif (!frontmatter.description || frontmatter.description.trim() === \"\") {\n\t\t\treturn { skill: null, diagnostics };\n\t\t}\n\n\t\treturn {\n\t\t\tskill: {\n\t\t\t\tname,\n\t\t\t\tdescription: frontmatter.description,\n\t\t\t\tfilePath,\n\t\t\t\tbaseDir: skillDir,\n\t\t\t\tsource,\n\t\t\t\tdisableModelInvocation: frontmatter[\"disable-model-invocation\"] === true,\n\t\t\t},\n\t\t\tdiagnostics,\n\t\t};\n\t} catch (error) {\n\t\tconst message = error instanceof Error ? error.message : \"failed to parse skill file\";\n\t\tdiagnostics.push({ type: \"warning\", message, path: filePath });\n\t\treturn { skill: null, diagnostics };\n\t}\n}\n\n/**\n * Format skills for inclusion in a system prompt.\n * Uses XML format per Agent Skills standard.\n * See: https://agentskills.io/integrate-skills\n *\n * Skills with disableModelInvocation=true are excluded from the prompt\n * (they can only be invoked explicitly via /skill:name commands).\n */\nexport function formatSkillsForPrompt(skills: Skill[]): string {\n\tconst visibleSkills = skills.filter((s) => !s.disableModelInvocation);\n\n\tif (visibleSkills.length === 0) {\n\t\treturn \"\";\n\t}\n\n\tconst lines = [\n\t\t\"\\n\\nThe following skills provide specialized instructions for specific tasks.\",\n\t\t\"Use the read tool to load a skill's file when the task matches its description.\",\n\t\t\"When a skill file references a relative path, resolve it against the skill directory (parent of SKILL.md / dirname of the path) and use that absolute path in tool commands.\",\n\t\t\"\",\n\t\t\"<available_skills>\",\n\t];\n\n\tfor (const skill of visibleSkills) {\n\t\tlines.push(\" <skill>\");\n\t\tlines.push(` <name>${escapeXml(skill.name)}</name>`);\n\t\tlines.push(` <description>${escapeXml(skill.description)}</description>`);\n\t\tlines.push(` <location>${escapeXml(skill.filePath)}</location>`);\n\t\tlines.push(\" </skill>\");\n\t}\n\n\tlines.push(\"</available_skills>\");\n\n\treturn lines.join(\"\\n\");\n}\n\nfunction escapeXml(str: string): string {\n\treturn str\n\t\t.replace(/&/g, \"&amp;\")\n\t\t.replace(/</g, \"&lt;\")\n\t\t.replace(/>/g, \"&gt;\")\n\t\t.replace(/\"/g, \"&quot;\")\n\t\t.replace(/'/g, \"&apos;\");\n}\n\nexport interface LoadSkillsOptions {\n\t/** Working directory for project-local skills. Default: process.cwd() */\n\tcwd?: string;\n\t/** Agent config directory for global skills. Default: ~/.pi/agent */\n\tagentDir?: string;\n\t/** Explicit skill paths (files or directories) */\n\tskillPaths?: string[];\n\t/** Include default skills directories. Default: true */\n\tincludeDefaults?: boolean;\n}\n\nfunction normalizePath(input: string): string {\n\tconst trimmed = input.trim();\n\tif (trimmed === \"~\") return homedir();\n\tif (trimmed.startsWith(\"~/\")) return join(homedir(), trimmed.slice(2));\n\tif (trimmed.startsWith(\"~\")) return join(homedir(), trimmed.slice(1));\n\treturn trimmed;\n}\n\nfunction resolveSkillPath(p: string, cwd: string): string {\n\tconst normalized = normalizePath(p);\n\treturn isAbsolute(normalized) ? normalized : resolve(cwd, normalized);\n}\n\n/**\n * Load skills from all configured locations.\n * Returns skills and any validation diagnostics.\n */\nexport function loadSkills(options: LoadSkillsOptions = {}): LoadSkillsResult {\n\tconst { cwd = process.cwd(), agentDir, skillPaths = [], includeDefaults = true } = options;\n\n\t// Resolve agentDir - if not provided, use default from config\n\tconst resolvedAgentDir = agentDir ?? getAgentDir();\n\n\tconst skillMap = new Map<string, Skill>();\n\tconst realPathSet = new Set<string>();\n\tconst allDiagnostics: ResourceDiagnostic[] = [];\n\tconst collisionDiagnostics: ResourceDiagnostic[] = [];\n\n\tfunction addSkills(result: LoadSkillsResult) {\n\t\tallDiagnostics.push(...result.diagnostics);\n\t\tfor (const skill of result.skills) {\n\t\t\t// Resolve symlinks to detect duplicate files\n\t\t\tlet realPath: string;\n\t\t\ttry {\n\t\t\t\trealPath = realpathSync(skill.filePath);\n\t\t\t} catch {\n\t\t\t\trealPath = skill.filePath;\n\t\t\t}\n\n\t\t\t// Skip silently if we've already loaded this exact file (via symlink)\n\t\t\tif (realPathSet.has(realPath)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst existing = skillMap.get(skill.name);\n\t\t\tif (existing) {\n\t\t\t\tcollisionDiagnostics.push({\n\t\t\t\t\ttype: \"collision\",\n\t\t\t\t\tmessage: `name \"${skill.name}\" collision`,\n\t\t\t\t\tpath: skill.filePath,\n\t\t\t\t\tcollision: {\n\t\t\t\t\t\tresourceType: \"skill\",\n\t\t\t\t\t\tname: skill.name,\n\t\t\t\t\t\twinnerPath: existing.filePath,\n\t\t\t\t\t\tloserPath: skill.filePath,\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tskillMap.set(skill.name, skill);\n\t\t\t\trealPathSet.add(realPath);\n\t\t\t}\n\t\t}\n\t}\n\n\tif (includeDefaults) {\n\t\taddSkills(loadSkillsFromDirInternal(join(resolvedAgentDir, \"skills\"), \"user\", true));\n\t\taddSkills(loadSkillsFromDirInternal(resolve(cwd, CONFIG_DIR_NAME, \"skills\"), \"project\", true));\n\t}\n\n\tconst userSkillsDir = join(resolvedAgentDir, \"skills\");\n\tconst projectSkillsDir = resolve(cwd, CONFIG_DIR_NAME, \"skills\");\n\n\tconst isUnderPath = (target: string, root: string): boolean => {\n\t\tconst normalizedRoot = resolve(root);\n\t\tif (target === normalizedRoot) {\n\t\t\treturn true;\n\t\t}\n\t\tconst prefix = normalizedRoot.endsWith(sep) ? normalizedRoot : `${normalizedRoot}${sep}`;\n\t\treturn target.startsWith(prefix);\n\t};\n\n\tconst getSource = (resolvedPath: string): \"user\" | \"project\" | \"path\" => {\n\t\tif (!includeDefaults) {\n\t\t\tif (isUnderPath(resolvedPath, userSkillsDir)) return \"user\";\n\t\t\tif (isUnderPath(resolvedPath, projectSkillsDir)) return \"project\";\n\t\t}\n\t\treturn \"path\";\n\t};\n\n\tfor (const rawPath of skillPaths) {\n\t\tconst resolvedPath = resolveSkillPath(rawPath, cwd);\n\t\tif (!existsSync(resolvedPath)) {\n\t\t\tallDiagnostics.push({ type: \"warning\", message: \"skill path does not exist\", path: resolvedPath });\n\t\t\tcontinue;\n\t\t}\n\n\t\ttry {\n\t\t\tconst stats = statSync(resolvedPath);\n\t\t\tconst source = getSource(resolvedPath);\n\t\t\tif (stats.isDirectory()) {\n\t\t\t\taddSkills(loadSkillsFromDirInternal(resolvedPath, source, true));\n\t\t\t} else if (stats.isFile() && resolvedPath.endsWith(\".md\")) {\n\t\t\t\tconst result = loadSkillFromFile(resolvedPath, source);\n\t\t\t\tif (result.skill) {\n\t\t\t\t\taddSkills({ skills: [result.skill], diagnostics: result.diagnostics });\n\t\t\t\t} else {\n\t\t\t\t\tallDiagnostics.push(...result.diagnostics);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tallDiagnostics.push({ type: \"warning\", message: \"skill path is not a markdown file\", path: resolvedPath });\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tconst message = error instanceof Error ? error.message : \"failed to read skill path\";\n\t\t\tallDiagnostics.push({ type: \"warning\", message, path: resolvedPath });\n\t\t}\n\t}\n\n\treturn {\n\t\tskills: Array.from(skillMap.values()),\n\t\tdiagnostics: [...allDiagnostics, ...collisionDiagnostics],\n\t};\n}\n"]}
@@ -0,0 +1,15 @@
1
+ export type SlashCommandSource = "extension" | "prompt" | "skill";
2
+ export type SlashCommandLocation = "user" | "project" | "path";
3
+ export interface SlashCommandInfo {
4
+ name: string;
5
+ description?: string;
6
+ source: SlashCommandSource;
7
+ location?: SlashCommandLocation;
8
+ path?: string;
9
+ }
10
+ export interface BuiltinSlashCommand {
11
+ name: string;
12
+ description: string;
13
+ }
14
+ export declare const BUILTIN_SLASH_COMMANDS: ReadonlyArray<BuiltinSlashCommand>;
15
+ //# sourceMappingURL=slash-commands.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slash-commands.d.ts","sourceRoot":"","sources":["../../src/core/slash-commands.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG,QAAQ,GAAG,OAAO,CAAC;AAElE,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC;AAE/D,MAAM,WAAW,gBAAgB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,QAAQ,CAAC,EAAE,oBAAoB,CAAC;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,mBAAmB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,sBAAsB,EAAE,aAAa,CAAC,mBAAmB,CAoBrE,CAAC"}