rird 1.1.16 → 2.1.225

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 (354) hide show
  1. package/bin/rird +28 -0
  2. package/package.json +17 -105
  3. package/postinstall.mjs +2 -0
  4. package/AGENTS.md +0 -27
  5. package/Dockerfile +0 -18
  6. package/README.md +0 -15
  7. package/bin/pty-wrapper.js +0 -285
  8. package/bunfig.toml +0 -4
  9. package/facebook_ads_library.png +0 -0
  10. package/nul`nif +0 -0
  11. package/parsers-config.ts +0 -239
  12. package/rird-1.0.199.tgz +0 -0
  13. package/rird-1.0.205.tgz +0 -0
  14. package/script/build-windows.ts +0 -53
  15. package/script/build.ts +0 -165
  16. package/script/postinstall.mjs +0 -567
  17. package/script/publish-registries.ts +0 -187
  18. package/script/publish.ts +0 -85
  19. package/script/schema.ts +0 -47
  20. package/src/acp/README.md +0 -164
  21. package/src/acp/agent.ts +0 -1063
  22. package/src/acp/session.ts +0 -101
  23. package/src/acp/types.ts +0 -22
  24. package/src/agent/agent.ts +0 -367
  25. package/src/agent/generate.txt +0 -75
  26. package/src/agent/prompt/compaction.txt +0 -12
  27. package/src/agent/prompt/explore.txt +0 -18
  28. package/src/agent/prompt/summary.txt +0 -10
  29. package/src/agent/prompt/title.txt +0 -36
  30. package/src/auth/index.ts +0 -70
  31. package/src/bun/index.ts +0 -114
  32. package/src/bus/bus-event.ts +0 -43
  33. package/src/bus/global.ts +0 -10
  34. package/src/bus/index.ts +0 -105
  35. package/src/cli/bootstrap.ts +0 -17
  36. package/src/cli/cmd/acp.ts +0 -88
  37. package/src/cli/cmd/activate.ts +0 -50
  38. package/src/cli/cmd/agent.ts +0 -256
  39. package/src/cli/cmd/auth.ts +0 -409
  40. package/src/cli/cmd/cmd.ts +0 -7
  41. package/src/cli/cmd/debug/config.ts +0 -15
  42. package/src/cli/cmd/debug/file.ts +0 -91
  43. package/src/cli/cmd/debug/index.ts +0 -43
  44. package/src/cli/cmd/debug/lsp.ts +0 -48
  45. package/src/cli/cmd/debug/ripgrep.ts +0 -83
  46. package/src/cli/cmd/debug/scrap.ts +0 -15
  47. package/src/cli/cmd/debug/skill.ts +0 -15
  48. package/src/cli/cmd/debug/snapshot.ts +0 -48
  49. package/src/cli/cmd/export.ts +0 -88
  50. package/src/cli/cmd/generate.ts +0 -38
  51. package/src/cli/cmd/github.ts +0 -1400
  52. package/src/cli/cmd/import.ts +0 -98
  53. package/src/cli/cmd/mcp.ts +0 -654
  54. package/src/cli/cmd/models.ts +0 -77
  55. package/src/cli/cmd/pr.ts +0 -112
  56. package/src/cli/cmd/run.ts +0 -368
  57. package/src/cli/cmd/serve.ts +0 -31
  58. package/src/cli/cmd/session.ts +0 -106
  59. package/src/cli/cmd/stats.ts +0 -298
  60. package/src/cli/cmd/tui/app.tsx +0 -696
  61. package/src/cli/cmd/tui/attach.ts +0 -30
  62. package/src/cli/cmd/tui/component/border.tsx +0 -21
  63. package/src/cli/cmd/tui/component/dialog-agent.tsx +0 -31
  64. package/src/cli/cmd/tui/component/dialog-command.tsx +0 -124
  65. package/src/cli/cmd/tui/component/dialog-mcp.tsx +0 -86
  66. package/src/cli/cmd/tui/component/dialog-model.tsx +0 -236
  67. package/src/cli/cmd/tui/component/dialog-provider.tsx +0 -242
  68. package/src/cli/cmd/tui/component/dialog-session-list.tsx +0 -102
  69. package/src/cli/cmd/tui/component/dialog-session-rename.tsx +0 -31
  70. package/src/cli/cmd/tui/component/dialog-stash.tsx +0 -86
  71. package/src/cli/cmd/tui/component/dialog-status.tsx +0 -162
  72. package/src/cli/cmd/tui/component/dialog-tag.tsx +0 -44
  73. package/src/cli/cmd/tui/component/dialog-theme-list.tsx +0 -50
  74. package/src/cli/cmd/tui/component/did-you-know.tsx +0 -85
  75. package/src/cli/cmd/tui/component/logo.tsx +0 -48
  76. package/src/cli/cmd/tui/component/prompt/autocomplete.tsx +0 -574
  77. package/src/cli/cmd/tui/component/prompt/history.tsx +0 -108
  78. package/src/cli/cmd/tui/component/prompt/index.tsx +0 -1089
  79. package/src/cli/cmd/tui/component/prompt/stash.tsx +0 -101
  80. package/src/cli/cmd/tui/component/tips.ts +0 -27
  81. package/src/cli/cmd/tui/component/todo-item.tsx +0 -32
  82. package/src/cli/cmd/tui/context/args.tsx +0 -14
  83. package/src/cli/cmd/tui/context/directory.ts +0 -13
  84. package/src/cli/cmd/tui/context/exit.tsx +0 -23
  85. package/src/cli/cmd/tui/context/helper.tsx +0 -25
  86. package/src/cli/cmd/tui/context/keybind.tsx +0 -101
  87. package/src/cli/cmd/tui/context/kv.tsx +0 -49
  88. package/src/cli/cmd/tui/context/local.tsx +0 -345
  89. package/src/cli/cmd/tui/context/prompt.tsx +0 -18
  90. package/src/cli/cmd/tui/context/route.tsx +0 -46
  91. package/src/cli/cmd/tui/context/sdk.tsx +0 -74
  92. package/src/cli/cmd/tui/context/sync.tsx +0 -372
  93. package/src/cli/cmd/tui/context/theme/aura.json +0 -69
  94. package/src/cli/cmd/tui/context/theme/ayu.json +0 -80
  95. package/src/cli/cmd/tui/context/theme/catppuccin-frappe.json +0 -233
  96. package/src/cli/cmd/tui/context/theme/catppuccin-macchiato.json +0 -233
  97. package/src/cli/cmd/tui/context/theme/catppuccin.json +0 -112
  98. package/src/cli/cmd/tui/context/theme/cobalt2.json +0 -228
  99. package/src/cli/cmd/tui/context/theme/cursor.json +0 -249
  100. package/src/cli/cmd/tui/context/theme/dracula.json +0 -219
  101. package/src/cli/cmd/tui/context/theme/everforest.json +0 -241
  102. package/src/cli/cmd/tui/context/theme/flexoki.json +0 -237
  103. package/src/cli/cmd/tui/context/theme/github.json +0 -233
  104. package/src/cli/cmd/tui/context/theme/gruvbox.json +0 -95
  105. package/src/cli/cmd/tui/context/theme/kanagawa.json +0 -77
  106. package/src/cli/cmd/tui/context/theme/lucent-orng.json +0 -227
  107. package/src/cli/cmd/tui/context/theme/material.json +0 -235
  108. package/src/cli/cmd/tui/context/theme/matrix.json +0 -77
  109. package/src/cli/cmd/tui/context/theme/mercury.json +0 -252
  110. package/src/cli/cmd/tui/context/theme/monokai.json +0 -221
  111. package/src/cli/cmd/tui/context/theme/nightowl.json +0 -221
  112. package/src/cli/cmd/tui/context/theme/nord.json +0 -223
  113. package/src/cli/cmd/tui/context/theme/one-dark.json +0 -84
  114. package/src/cli/cmd/tui/context/theme/orng.json +0 -245
  115. package/src/cli/cmd/tui/context/theme/palenight.json +0 -222
  116. package/src/cli/cmd/tui/context/theme/rird.json +0 -245
  117. package/src/cli/cmd/tui/context/theme/rosepine.json +0 -234
  118. package/src/cli/cmd/tui/context/theme/solarized.json +0 -223
  119. package/src/cli/cmd/tui/context/theme/synthwave84.json +0 -226
  120. package/src/cli/cmd/tui/context/theme/tokyonight.json +0 -243
  121. package/src/cli/cmd/tui/context/theme/vercel.json +0 -245
  122. package/src/cli/cmd/tui/context/theme/vesper.json +0 -218
  123. package/src/cli/cmd/tui/context/theme/zenburn.json +0 -223
  124. package/src/cli/cmd/tui/context/theme.tsx +0 -1109
  125. package/src/cli/cmd/tui/event.ts +0 -40
  126. package/src/cli/cmd/tui/routes/home.tsx +0 -138
  127. package/src/cli/cmd/tui/routes/session/dialog-fork-from-timeline.tsx +0 -64
  128. package/src/cli/cmd/tui/routes/session/dialog-message.tsx +0 -109
  129. package/src/cli/cmd/tui/routes/session/dialog-subagent.tsx +0 -26
  130. package/src/cli/cmd/tui/routes/session/dialog-timeline.tsx +0 -47
  131. package/src/cli/cmd/tui/routes/session/footer.tsx +0 -88
  132. package/src/cli/cmd/tui/routes/session/header.tsx +0 -125
  133. package/src/cli/cmd/tui/routes/session/index.tsx +0 -1868
  134. package/src/cli/cmd/tui/routes/session/sidebar.tsx +0 -322
  135. package/src/cli/cmd/tui/spawn.ts +0 -60
  136. package/src/cli/cmd/tui/thread.ts +0 -142
  137. package/src/cli/cmd/tui/ui/dialog-alert.tsx +0 -57
  138. package/src/cli/cmd/tui/ui/dialog-confirm.tsx +0 -83
  139. package/src/cli/cmd/tui/ui/dialog-help.tsx +0 -38
  140. package/src/cli/cmd/tui/ui/dialog-prompt.tsx +0 -77
  141. package/src/cli/cmd/tui/ui/dialog-select.tsx +0 -332
  142. package/src/cli/cmd/tui/ui/dialog.tsx +0 -170
  143. package/src/cli/cmd/tui/ui/spinner.ts +0 -368
  144. package/src/cli/cmd/tui/ui/toast.tsx +0 -100
  145. package/src/cli/cmd/tui/util/clipboard.ts +0 -127
  146. package/src/cli/cmd/tui/util/editor.ts +0 -32
  147. package/src/cli/cmd/tui/util/terminal.ts +0 -114
  148. package/src/cli/cmd/tui/worker.ts +0 -63
  149. package/src/cli/cmd/uninstall.ts +0 -344
  150. package/src/cli/cmd/upgrade.ts +0 -100
  151. package/src/cli/cmd/web.ts +0 -84
  152. package/src/cli/error.ts +0 -69
  153. package/src/cli/ui.ts +0 -100
  154. package/src/cli/upgrade.ts +0 -25
  155. package/src/command/index.ts +0 -80
  156. package/src/command/template/initialize.txt +0 -10
  157. package/src/command/template/review.txt +0 -97
  158. package/src/config/config.ts +0 -996
  159. package/src/config/markdown.ts +0 -41
  160. package/src/env/index.ts +0 -26
  161. package/src/file/ignore.ts +0 -83
  162. package/src/file/index.ts +0 -328
  163. package/src/file/ripgrep.ts +0 -393
  164. package/src/file/time.ts +0 -64
  165. package/src/file/watcher.ts +0 -103
  166. package/src/flag/flag.ts +0 -84
  167. package/src/format/formatter.ts +0 -315
  168. package/src/format/index.ts +0 -137
  169. package/src/global/index.ts +0 -101
  170. package/src/id/id.ts +0 -73
  171. package/src/ide/index.ts +0 -76
  172. package/src/index.ts +0 -250
  173. package/src/installation/index.ts +0 -238
  174. package/src/lsp/client.ts +0 -229
  175. package/src/lsp/index.ts +0 -485
  176. package/src/lsp/language.ts +0 -116
  177. package/src/lsp/server.ts +0 -1895
  178. package/src/mcp/auth.ts +0 -135
  179. package/src/mcp/index.ts +0 -1077
  180. package/src/mcp/intent-analyzer.ts +0 -376
  181. package/src/mcp/oauth-callback.ts +0 -200
  182. package/src/mcp/oauth-provider.ts +0 -154
  183. package/src/patch/index.ts +0 -632
  184. package/src/permission/index.ts +0 -199
  185. package/src/plugin/index.ts +0 -91
  186. package/src/project/bootstrap.ts +0 -33
  187. package/src/project/instance.ts +0 -78
  188. package/src/project/project.ts +0 -236
  189. package/src/project/state.ts +0 -65
  190. package/src/project/vcs.ts +0 -76
  191. package/src/provider/auth.ts +0 -143
  192. package/src/provider/models-macro.ts +0 -11
  193. package/src/provider/models.ts +0 -106
  194. package/src/provider/provider.ts +0 -1121
  195. package/src/provider/sdk/openai-compatible/src/README.md +0 -5
  196. package/src/provider/sdk/openai-compatible/src/index.ts +0 -2
  197. package/src/provider/sdk/openai-compatible/src/openai-compatible-provider.ts +0 -100
  198. package/src/provider/sdk/openai-compatible/src/responses/convert-to-openai-responses-input.ts +0 -303
  199. package/src/provider/sdk/openai-compatible/src/responses/map-openai-responses-finish-reason.ts +0 -22
  200. package/src/provider/sdk/openai-compatible/src/responses/openai-config.ts +0 -18
  201. package/src/provider/sdk/openai-compatible/src/responses/openai-error.ts +0 -22
  202. package/src/provider/sdk/openai-compatible/src/responses/openai-responses-api-types.ts +0 -207
  203. package/src/provider/sdk/openai-compatible/src/responses/openai-responses-language-model.ts +0 -1713
  204. package/src/provider/sdk/openai-compatible/src/responses/openai-responses-prepare-tools.ts +0 -177
  205. package/src/provider/sdk/openai-compatible/src/responses/openai-responses-settings.ts +0 -1
  206. package/src/provider/sdk/openai-compatible/src/responses/tool/code-interpreter.ts +0 -88
  207. package/src/provider/sdk/openai-compatible/src/responses/tool/file-search.ts +0 -128
  208. package/src/provider/sdk/openai-compatible/src/responses/tool/image-generation.ts +0 -115
  209. package/src/provider/sdk/openai-compatible/src/responses/tool/local-shell.ts +0 -65
  210. package/src/provider/sdk/openai-compatible/src/responses/tool/web-search-preview.ts +0 -104
  211. package/src/provider/sdk/openai-compatible/src/responses/tool/web-search.ts +0 -103
  212. package/src/provider/transform.ts +0 -455
  213. package/src/pty/index.ts +0 -231
  214. package/src/security/guardrails.test.ts +0 -341
  215. package/src/security/guardrails.ts +0 -558
  216. package/src/security/index.ts +0 -19
  217. package/src/server/error.ts +0 -36
  218. package/src/server/project.ts +0 -79
  219. package/src/server/server.ts +0 -2642
  220. package/src/server/tui.ts +0 -71
  221. package/src/session/compaction.ts +0 -223
  222. package/src/session/index.ts +0 -461
  223. package/src/session/llm.ts +0 -201
  224. package/src/session/message-v2.ts +0 -690
  225. package/src/session/message.ts +0 -189
  226. package/src/session/processor.ts +0 -409
  227. package/src/session/prompt/act-switch.txt +0 -5
  228. package/src/session/prompt/anthropic-20250930.txt +0 -166
  229. package/src/session/prompt/anthropic.txt +0 -85
  230. package/src/session/prompt/anthropic_spoof.txt +0 -1
  231. package/src/session/prompt/beast.txt +0 -103
  232. package/src/session/prompt/codex.txt +0 -304
  233. package/src/session/prompt/copilot-gpt-5.txt +0 -138
  234. package/src/session/prompt/gemini.txt +0 -85
  235. package/src/session/prompt/max-steps.txt +0 -16
  236. package/src/session/prompt/plan-reminder-anthropic.txt +0 -35
  237. package/src/session/prompt/plan.txt +0 -24
  238. package/src/session/prompt/polaris.txt +0 -84
  239. package/src/session/prompt/qwen.txt +0 -106
  240. package/src/session/prompt.ts +0 -1529
  241. package/src/session/retry.ts +0 -86
  242. package/src/session/revert.ts +0 -108
  243. package/src/session/sensitive-filter.test.ts +0 -327
  244. package/src/session/sensitive-filter.ts +0 -466
  245. package/src/session/status.ts +0 -76
  246. package/src/session/summary.ts +0 -194
  247. package/src/session/system.ts +0 -122
  248. package/src/session/todo.ts +0 -37
  249. package/src/share/share-next.ts +0 -194
  250. package/src/share/share.ts +0 -87
  251. package/src/shell/shell.ts +0 -67
  252. package/src/skill/index.ts +0 -1
  253. package/src/skill/skill.ts +0 -83
  254. package/src/snapshot/index.ts +0 -197
  255. package/src/storage/storage.ts +0 -226
  256. package/src/tests/agent.test.ts +0 -308
  257. package/src/tests/build-guards.test.ts +0 -267
  258. package/src/tests/config.test.ts +0 -664
  259. package/src/tests/tool-registry.test.ts +0 -589
  260. package/src/tool/bash.ts +0 -314
  261. package/src/tool/bash.txt +0 -158
  262. package/src/tool/batch.ts +0 -175
  263. package/src/tool/batch.txt +0 -24
  264. package/src/tool/codesearch.ts +0 -168
  265. package/src/tool/codesearch.txt +0 -12
  266. package/src/tool/edit.ts +0 -675
  267. package/src/tool/edit.txt +0 -10
  268. package/src/tool/glob.ts +0 -65
  269. package/src/tool/glob.txt +0 -6
  270. package/src/tool/grep.ts +0 -121
  271. package/src/tool/grep.txt +0 -8
  272. package/src/tool/invalid.ts +0 -17
  273. package/src/tool/ls.ts +0 -110
  274. package/src/tool/ls.txt +0 -1
  275. package/src/tool/lsp-diagnostics.ts +0 -26
  276. package/src/tool/lsp-diagnostics.txt +0 -1
  277. package/src/tool/lsp-hover.ts +0 -31
  278. package/src/tool/lsp-hover.txt +0 -1
  279. package/src/tool/lsp.ts +0 -87
  280. package/src/tool/lsp.txt +0 -19
  281. package/src/tool/multiedit.ts +0 -46
  282. package/src/tool/multiedit.txt +0 -41
  283. package/src/tool/patch.ts +0 -233
  284. package/src/tool/patch.txt +0 -1
  285. package/src/tool/read.ts +0 -219
  286. package/src/tool/read.txt +0 -12
  287. package/src/tool/registry.ts +0 -162
  288. package/src/tool/skill.ts +0 -100
  289. package/src/tool/task.ts +0 -136
  290. package/src/tool/task.txt +0 -51
  291. package/src/tool/todo.ts +0 -39
  292. package/src/tool/todoread.txt +0 -14
  293. package/src/tool/todowrite.txt +0 -167
  294. package/src/tool/tool.ts +0 -71
  295. package/src/tool/webfetch.ts +0 -198
  296. package/src/tool/webfetch.txt +0 -13
  297. package/src/tool/websearch.ts +0 -180
  298. package/src/tool/websearch.txt +0 -11
  299. package/src/tool/write.ts +0 -110
  300. package/src/tool/write.txt +0 -8
  301. package/src/util/archive.ts +0 -16
  302. package/src/util/color.ts +0 -19
  303. package/src/util/context.ts +0 -25
  304. package/src/util/defer.ts +0 -12
  305. package/src/util/eventloop.ts +0 -20
  306. package/src/util/filesystem.ts +0 -83
  307. package/src/util/fn.ts +0 -11
  308. package/src/util/iife.ts +0 -3
  309. package/src/util/keybind.ts +0 -102
  310. package/src/util/lazy.ts +0 -11
  311. package/src/util/license.ts +0 -339
  312. package/src/util/locale.ts +0 -81
  313. package/src/util/lock.ts +0 -98
  314. package/src/util/log.ts +0 -180
  315. package/src/util/queue.ts +0 -32
  316. package/src/util/rpc.ts +0 -42
  317. package/src/util/scrap.ts +0 -10
  318. package/src/util/signal.ts +0 -12
  319. package/src/util/timeout.ts +0 -14
  320. package/src/util/token.ts +0 -7
  321. package/src/util/wildcard.ts +0 -54
  322. package/sst-env.d.ts +0 -9
  323. package/test/agent/agent.test.ts +0 -146
  324. package/test/bun.test.ts +0 -53
  325. package/test/cli/github-remote.test.ts +0 -80
  326. package/test/config/agent-color.test.ts +0 -66
  327. package/test/config/config.test.ts +0 -535
  328. package/test/config/markdown.test.ts +0 -89
  329. package/test/file/ignore.test.ts +0 -10
  330. package/test/fixture/fixture.ts +0 -37
  331. package/test/fixture/lsp/fake-lsp-server.js +0 -77
  332. package/test/ide/ide.test.ts +0 -82
  333. package/test/keybind.test.ts +0 -421
  334. package/test/lsp/client.test.ts +0 -95
  335. package/test/mcp/headers.test.ts +0 -153
  336. package/test/patch/patch.test.ts +0 -348
  337. package/test/preload.ts +0 -57
  338. package/test/project/project.test.ts +0 -74
  339. package/test/provider/provider.test.ts +0 -1810
  340. package/test/provider/transform.test.ts +0 -411
  341. package/test/session/retry.test.ts +0 -111
  342. package/test/session/session.test.ts +0 -71
  343. package/test/skill/skill.test.ts +0 -131
  344. package/test/snapshot/snapshot.test.ts +0 -940
  345. package/test/tool/__snapshots__/tool.test.ts.snap +0 -9
  346. package/test/tool/bash.test.ts +0 -434
  347. package/test/tool/grep.test.ts +0 -108
  348. package/test/tool/patch.test.ts +0 -259
  349. package/test/tool/read.test.ts +0 -42
  350. package/test/util/iife.test.ts +0 -36
  351. package/test/util/lazy.test.ts +0 -50
  352. package/test/util/timeout.test.ts +0 -21
  353. package/test/util/wildcard.test.ts +0 -55
  354. package/tsconfig.json +0 -16
package/bin/rird CHANGED
@@ -156,6 +156,7 @@ if (command === "activate") {
156
156
  license_key: key.trim(), valid: true,
157
157
  email: result.user ? result.user.email : null,
158
158
  plan: result.user ? result.user.plan : null,
159
+ providers: result.providers || null,
159
160
  cached_at: new Date().toISOString()
160
161
  }))
161
162
  process.exit(0)
@@ -291,6 +292,33 @@ if (command === "activate") {
291
292
  // Enable RIRD search tools
292
293
  env.RIRD_ENABLE_SEARCH = "true"
293
294
 
295
+ // Inject provider API keys from license cache
296
+ const licenseCachePath = path.join(rirdHome, "license_cache.json")
297
+ if (fs.existsSync(licenseCachePath)) {
298
+ try {
299
+ const licenseCache = JSON.parse(fs.readFileSync(licenseCachePath, "utf-8"))
300
+ if (licenseCache.providers) {
301
+ if (licenseCache.providers.deepseek && licenseCache.providers.deepseek.apiKey) {
302
+ env.DEEPSEEK_API_KEY = licenseCache.providers.deepseek.apiKey
303
+ }
304
+ if (licenseCache.providers.siliconflow && licenseCache.providers.siliconflow.apiKey) {
305
+ env.SILICONFLOW_API_KEY = licenseCache.providers.siliconflow.apiKey
306
+ }
307
+ if (licenseCache.providers.openai && licenseCache.providers.openai.apiKey) {
308
+ env.OPENAI_API_KEY = licenseCache.providers.openai.apiKey
309
+ }
310
+ if (licenseCache.providers.anthropic && licenseCache.providers.anthropic.apiKey) {
311
+ env.ANTHROPIC_API_KEY = licenseCache.providers.anthropic.apiKey
312
+ }
313
+ if (licenseCache.providers.google && licenseCache.providers.google.apiKey) {
314
+ env.GOOGLE_GENERATIVE_AI_API_KEY = licenseCache.providers.google.apiKey
315
+ }
316
+ }
317
+ } catch (e) {
318
+ // Ignore cache read errors
319
+ }
320
+ }
321
+
294
322
  function run(binPath) {
295
323
  const result = childProcess.spawnSync(binPath, args, {
296
324
  stdio: "inherit",
package/package.json CHANGED
@@ -1,111 +1,23 @@
1
- {
2
- "$schema": "https://json.schemastore.org/package.json",
3
- "version": "1.1.16",
1
+ {
4
2
  "name": "rird",
5
- "type": "module",
6
- "scripts": {
7
- "typecheck": "tsgo --noEmit",
8
- "test": "bun test",
9
- "build": "bun run script/build.ts",
10
- "dev": "bun run --conditions=browser ./src/index.ts",
11
- "random": "echo 'Random script updated at $(date)' && echo 'Change queued successfully' && echo 'Another change made' && echo 'Yet another change' && echo 'One more change' && echo 'Final change' && echo 'Another final change' && echo 'Yet another final change'",
12
- "clean": "echo 'Cleaning up...' && rm -rf node_modules dist",
13
- "lint": "echo 'Running lint checks...' && bun test --coverage",
14
- "format": "echo 'Formatting code...' && bun run --prettier --write src/**/*.ts",
15
- "docs": "echo 'Generating documentation...' && find src -name '*.ts' -exec echo 'Processing: {}' \\;",
16
- "deploy": "echo 'Deploying application...' && bun run build && echo 'Deployment completed successfully'"
17
- },
3
+ "version": "2.1.225",
18
4
  "bin": {
19
5
  "rird": "./bin/rird"
20
6
  },
21
- "exports": {
22
- "./*": "./src/*.ts"
23
- },
24
- "devDependencies": {
25
- "@babel/core": "7.28.4",
26
- "@octokit/webhooks-types": "7.6.1",
27
- "@parcel/watcher-darwin-arm64": "2.5.1",
28
- "@parcel/watcher-darwin-x64": "2.5.1",
29
- "@parcel/watcher-linux-arm64-glibc": "2.5.1",
30
- "@parcel/watcher-linux-arm64-musl": "2.5.1",
31
- "@parcel/watcher-linux-x64-glibc": "2.5.1",
32
- "@parcel/watcher-linux-x64-musl": "2.5.1",
33
- "@parcel/watcher-win32-x64": "2.5.1",
34
- "@standard-schema/spec": "1.0.0",
35
- "@tsconfig/bun": "catalog:",
36
- "@types/babel__core": "7.20.5",
37
- "@types/bun": "catalog:",
38
- "@types/turndown": "5.0.5",
39
- "@types/yargs": "17.0.33",
40
- "typescript": "catalog:",
41
- "@typescript/native-preview": "catalog:",
42
- "vscode-languageserver-types": "3.17.5",
43
- "why-is-node-running": "3.2.2",
44
- "zod-to-json-schema": "3.24.5",
45
- "@opencode-ai/script": "workspace:*"
7
+ "scripts": {
8
+ "postinstall": "node ./postinstall.mjs"
46
9
  },
47
- "dependencies": {
48
- "@actions/core": "1.11.1",
49
- "@actions/github": "6.0.1",
50
- "@agentclientprotocol/sdk": "0.5.1",
51
- "@ai-sdk/amazon-bedrock": "3.0.57",
52
- "@ai-sdk/anthropic": "2.0.50",
53
- "@ai-sdk/azure": "2.0.73",
54
- "@ai-sdk/google": "2.0.44",
55
- "@ai-sdk/google-vertex": "3.0.81",
56
- "@ai-sdk/mcp": "0.0.8",
57
- "@ai-sdk/mistral": "2.0.26",
58
- "@ai-sdk/openai": "2.0.71",
59
- "@ai-sdk/openai-compatible": "1.0.27",
60
- "@ai-sdk/provider": "2.0.0",
61
- "@ai-sdk/provider-utils": "3.0.18",
62
- "@ai-sdk/xai": "2.0.42",
63
- "@clack/prompts": "1.0.0-alpha.1",
64
- "@hono/standard-validator": "0.1.5",
65
- "@hono/zod-validator": "catalog:",
66
- "@modelcontextprotocol/sdk": "1.15.1",
67
- "@octokit/graphql": "9.0.2",
68
- "@octokit/rest": "catalog:",
69
- "@openauthjs/openauth": "catalog:",
70
- "@opencode-ai/plugin": "workspace:*",
71
- "@opencode-ai/script": "workspace:*",
72
- "@opencode-ai/sdk": "workspace:*",
73
- "@opencode-ai/util": "workspace:*",
74
- "@openrouter/ai-sdk-provider": "1.5.2",
75
- "@opentui/core": "0.1.63",
76
- "@opentui/solid": "0.1.63",
77
- "@parcel/watcher": "2.5.1",
78
- "@pierre/diffs": "catalog:",
79
- "@solid-primitives/event-bus": "1.1.2",
80
- "@standard-schema/spec": "1.0.0",
81
- "@zip.js/zip.js": "2.7.62",
82
- "ai": "catalog:",
83
- "bun-pty": "0.4.2",
84
- "chokidar": "4.0.3",
85
- "clipboardy": "4.0.0",
86
- "decimal.js": "10.5.0",
87
- "diff": "catalog:",
88
- "fuzzysort": "3.1.0",
89
- "gray-matter": "4.0.3",
90
- "hono": "catalog:",
91
- "hono-openapi": "catalog:",
92
- "ignore": "7.0.5",
93
- "jsonc-parser": "3.3.1",
94
- "minimatch": "10.0.3",
95
- "open": "10.1.2",
96
- "opentui-spinner": "0.0.6",
97
- "partial-json": "0.1.7",
98
- "remeda": "catalog:",
99
- "solid-js": "catalog:",
100
- "strip-ansi": "7.1.2",
101
- "tree-sitter-bash": "0.25.0",
102
- "turndown": "7.2.0",
103
- "ulid": "catalog:",
104
- "vscode-jsonrpc": "8.2.1",
105
- "web-tree-sitter": "0.25.10",
106
- "xdg-basedir": "5.1.0",
107
- "yargs": "18.0.0",
108
- "zod": "catalog:",
109
- "zod-to-json-schema": "3.24.5"
10
+ "optionalDependencies": {
11
+ "rird-linux-arm64": "2.1.225",
12
+ "rird-linux-x64": "2.1.225",
13
+ "rird-linux-x64-baseline": "2.1.225",
14
+ "rird-linux-arm64-musl": "2.1.225",
15
+ "rird-linux-x64-musl": "2.1.225",
16
+ "rird-linux-x64-baseline-musl": "2.1.225",
17
+ "rird-darwin-arm64": "2.1.225",
18
+ "rird-darwin-x64": "2.1.225",
19
+ "rird-darwin-x64-baseline": "2.1.225",
20
+ "rird-windows-x64": "2.1.225",
21
+ "rird-windows-x64-baseline": "2.1.225"
110
22
  }
111
- }
23
+ }
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ console.log('RIRD installed successfully');
package/AGENTS.md DELETED
@@ -1,27 +0,0 @@
1
- # RIRD agent guidelines
2
-
3
- ## Build/Test Commands
4
-
5
- - **Install**: `bun install`
6
- - **Run**: `bun run index.ts`
7
- - **Typecheck**: `bun run typecheck` (npm run typecheck)
8
- - **Test**: `bun test` (runs all tests)
9
- - **Single test**: `bun test test/tool/tool.test.ts` (specific test file)
10
-
11
- ## Code Style
12
-
13
- - **Runtime**: Bun with TypeScript ESM modules
14
- - **Imports**: Use relative imports for local modules, named imports preferred
15
- - **Types**: Zod schemas for validation, TypeScript interfaces for structure
16
- - **Naming**: camelCase for variables/functions, PascalCase for classes/namespaces
17
- - **Error handling**: Use Result patterns, avoid throwing exceptions in tools
18
- - **File structure**: Namespace-based organization (e.g., `Tool.define()`, `Session.create()`)
19
-
20
- ## Architecture
21
-
22
- - **Tools**: Implement `Tool.Info` interface with `execute()` method
23
- - **Context**: Pass `sessionID` in tool context, use `App.provide()` for DI
24
- - **Validation**: All inputs validated with Zod schemas
25
- - **Logging**: Use `Log.create({ service: "name" })` pattern
26
- - **Storage**: Use `Storage` namespace for persistence
27
- - **API Client**: Go TUI communicates with TypeScript server via stainless SDK. When adding/modifying server endpoints in `packages/opencode/src/server/server.ts`, ask the user to generate a new client SDK to proceed with client-side changes.
package/Dockerfile DELETED
@@ -1,18 +0,0 @@
1
- FROM alpine AS base
2
-
3
- # Disable the runtime transpiler cache by default inside Docker containers.
4
- # On ephemeral containers, the cache is not useful
5
- ARG BUN_RUNTIME_TRANSPILER_CACHE_PATH=0
6
- ENV BUN_RUNTIME_TRANSPILER_CACHE_PATH=${BUN_RUNTIME_TRANSPILER_CACHE_PATH}
7
- RUN apk add libgcc libstdc++ ripgrep
8
-
9
- FROM base AS build-amd64
10
- COPY dist/opencode-linux-x64-baseline-musl/bin/opencode /usr/local/bin/opencode
11
-
12
- FROM base AS build-arm64
13
- COPY dist/opencode-linux-arm64-musl/bin/opencode /usr/local/bin/opencode
14
-
15
- ARG TARGETARCH
16
- FROM build-${TARGETARCH}
17
- RUN opencode --version
18
- ENTRYPOINT ["opencode"]
package/README.md DELETED
@@ -1,15 +0,0 @@
1
- # js
2
-
3
- To install dependencies:
4
-
5
- ```bash
6
- bun install
7
- ```
8
-
9
- To run:
10
-
11
- ```bash
12
- bun run index.ts
13
- ```
14
-
15
- This project was created using `bun init` in bun v1.2.12. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.
@@ -1,285 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- /**
4
- * PTY Wrapper for RIRD
5
- *
6
- * Intercepts OpenCode binary output and replaces branding strings.
7
- * Works on Windows, macOS, and Linux.
8
- *
9
- * Usage:
10
- * node pty-wrapper.js <path-to-binary> [args...]
11
- *
12
- * Environment:
13
- * RIRD_NO_PTY=1 - Disable PTY, use simple pipes (fallback mode)
14
- */
15
-
16
- const childProcess = require("child_process")
17
- const fs = require("fs")
18
- const path = require("path")
19
- const os = require("os")
20
-
21
- // Branding replacements for output - order matters (specific patterns first)
22
- const REPLACEMENTS = [
23
- // URLs and paths
24
- { from: /sst\/opencode/gi, to: "rird.ai" },
25
- { from: /opencode\.ai/gi, to: "rird.ai" },
26
- { from: /rird\.ai\/desktop/gi, to: "rird.ai" },
27
- { from: /https?:\/\/[^\s]*opencode[^\s]*/gi, to: (match) => match.replace(/opencode/gi, "rird") },
28
- // Known fake/test model names
29
- { from: /OpenCode Zen/gi, to: "RIRD AI" },
30
- { from: /OpenCode\/Zen/gi, to: "RIRD AI" },
31
- { from: /opencode-zen/gi, to: "rird-brain" },
32
- { from: /Big Pickle/gi, to: "RIRD AI" },
33
- { from: /big-pickle/gi, to: "rird-brain" },
34
- { from: /gpt-5-nano/gi, to: "RIRD Brain" },
35
- { from: /GPT-5 Nano/gi, to: "RIRD Brain" },
36
- // Provider/model name patterns (catch OpenCode/anything)
37
- { from: /OpenCode\s*\/\s*(\w+)/gi, to: "RIRD/$1" },
38
- // Generic branding
39
- { from: /OpenCode/g, to: "RIRD" },
40
- { from: /opencode/g, to: "rird" },
41
- ]
42
-
43
- /**
44
- * Replace branding strings in a buffer/string
45
- */
46
- function replaceBranding(data) {
47
- let str = data.toString()
48
- for (const { from, to } of REPLACEMENTS) {
49
- str = str.replace(from, to)
50
- }
51
- return str
52
- }
53
-
54
- /**
55
- * Try to load node-pty dynamically
56
- */
57
- function tryLoadPty() {
58
- try {
59
- // Try bun-pty first (listed in package.json)
60
- return require("bun-pty")
61
- } catch (e1) {
62
- try {
63
- // Fall back to node-pty
64
- return require("node-pty")
65
- } catch (e2) {
66
- return null
67
- }
68
- }
69
- }
70
-
71
- /**
72
- * Run with PTY (interactive TUI support)
73
- */
74
- function runWithPty(pty, binaryPath, args, env) {
75
- const isWindows = os.platform() === "win32"
76
- const shell = isWindows ? "cmd.exe" : undefined
77
-
78
- // Get terminal size
79
- const cols = process.stdout.columns || 80
80
- const rows = process.stdout.rows || 24
81
-
82
- // Spawn PTY
83
- const ptyProcess = pty.spawn(binaryPath, args, {
84
- name: "xterm-256color",
85
- cols: cols,
86
- rows: rows,
87
- cwd: process.cwd(),
88
- env: env,
89
- // Windows-specific options
90
- ...(isWindows && {
91
- useConpty: true,
92
- conptyInheritCursor: true,
93
- }),
94
- })
95
-
96
- // Handle output with branding replacement
97
- ptyProcess.onData((data) => {
98
- const replaced = replaceBranding(data)
99
- process.stdout.write(replaced)
100
- })
101
-
102
- // Handle input
103
- if (process.stdin.isTTY) {
104
- process.stdin.setRawMode(true)
105
- }
106
- process.stdin.resume()
107
- process.stdin.on("data", (data) => {
108
- ptyProcess.write(data.toString())
109
- })
110
-
111
- // Handle terminal resize
112
- process.stdout.on("resize", () => {
113
- ptyProcess.resize(
114
- process.stdout.columns || 80,
115
- process.stdout.rows || 24
116
- )
117
- })
118
-
119
- // Handle exit
120
- ptyProcess.onExit(({ exitCode }) => {
121
- if (process.stdin.isTTY) {
122
- process.stdin.setRawMode(false)
123
- }
124
- process.exit(exitCode)
125
- })
126
-
127
- // Handle signals
128
- process.on("SIGINT", () => {
129
- ptyProcess.kill("SIGINT")
130
- })
131
- process.on("SIGTERM", () => {
132
- ptyProcess.kill("SIGTERM")
133
- })
134
- }
135
-
136
- /**
137
- * Run with simple pipes (fallback mode, less interactive)
138
- */
139
- function runWithPipes(binaryPath, args, env) {
140
- const isWindows = os.platform() === "win32"
141
-
142
- // Use spawn with pipe for stdout/stderr to intercept output
143
- const child = childProcess.spawn(binaryPath, args, {
144
- env: env,
145
- cwd: process.cwd(),
146
- stdio: ["pipe", "pipe", "pipe"],
147
- // Windows needs shell for some binaries
148
- ...(isWindows && { shell: false }),
149
- })
150
-
151
- // Buffer for incomplete ANSI sequences
152
- let stdoutBuffer = ""
153
- let stderrBuffer = ""
154
-
155
- // Process stdout
156
- child.stdout.on("data", (data) => {
157
- stdoutBuffer += data.toString()
158
- // Process complete lines or flush on certain patterns
159
- const replaced = replaceBranding(stdoutBuffer)
160
- process.stdout.write(replaced)
161
- stdoutBuffer = ""
162
- })
163
-
164
- // Process stderr
165
- child.stderr.on("data", (data) => {
166
- stderrBuffer += data.toString()
167
- const replaced = replaceBranding(stderrBuffer)
168
- process.stderr.write(replaced)
169
- stderrBuffer = ""
170
- })
171
-
172
- // Forward stdin
173
- process.stdin.pipe(child.stdin)
174
-
175
- // Handle exit
176
- child.on("exit", (code) => {
177
- // Flush any remaining buffers
178
- if (stdoutBuffer) {
179
- process.stdout.write(replaceBranding(stdoutBuffer))
180
- }
181
- if (stderrBuffer) {
182
- process.stderr.write(replaceBranding(stderrBuffer))
183
- }
184
- process.exit(code || 0)
185
- })
186
-
187
- child.on("error", (err) => {
188
- console.error("Failed to start process:", err.message)
189
- process.exit(1)
190
- })
191
-
192
- // Handle signals
193
- process.on("SIGINT", () => {
194
- child.kill("SIGINT")
195
- })
196
- process.on("SIGTERM", () => {
197
- child.kill("SIGTERM")
198
- })
199
- }
200
-
201
- /**
202
- * Run with inherited stdio (no branding replacement, but full interactivity)
203
- * Used when PTY fails and pipes don't work well
204
- */
205
- function runWithInherited(binaryPath, args, env) {
206
- const result = childProcess.spawnSync(binaryPath, args, {
207
- stdio: "inherit",
208
- env: env,
209
- cwd: process.cwd(),
210
- })
211
-
212
- if (result.error) {
213
- console.error("Failed to start process:", result.error.message)
214
- process.exit(1)
215
- }
216
-
217
- process.exit(result.status || 0)
218
- }
219
-
220
- /**
221
- * Main entry point
222
- */
223
- function main() {
224
- const args = process.argv.slice(2)
225
-
226
- if (args.length === 0) {
227
- console.error("Usage: pty-wrapper.js <binary> [args...]")
228
- process.exit(1)
229
- }
230
-
231
- const binaryPath = args[0]
232
- const binaryArgs = args.slice(1)
233
-
234
- // Verify binary exists
235
- if (!fs.existsSync(binaryPath)) {
236
- console.error("Binary not found:", binaryPath)
237
- process.exit(1)
238
- }
239
-
240
- // Prepare environment
241
- const env = { ...process.env }
242
-
243
- // Check for fallback mode
244
- const usePipes = process.env.RIRD_NO_PTY === "1"
245
- const useInherited = process.env.RIRD_INHERITED === "1"
246
-
247
- if (useInherited) {
248
- // No branding replacement, full interactivity
249
- runWithInherited(binaryPath, binaryArgs, env)
250
- return
251
- }
252
-
253
- if (usePipes) {
254
- // Simple pipes mode
255
- runWithPipes(binaryPath, binaryArgs, env)
256
- return
257
- }
258
-
259
- // Try PTY first
260
- const pty = tryLoadPty()
261
-
262
- if (pty && process.stdout.isTTY) {
263
- try {
264
- runWithPty(pty, binaryPath, binaryArgs, env)
265
- return
266
- } catch (err) {
267
- // PTY failed, fall through to pipes
268
- console.error("PTY initialization failed, falling back to pipes:", err.message)
269
- }
270
- }
271
-
272
- // Fall back to pipes
273
- runWithPipes(binaryPath, binaryArgs, env)
274
- }
275
-
276
- // Export for testing
277
- module.exports = {
278
- replaceBranding,
279
- REPLACEMENTS,
280
- }
281
-
282
- // Run if executed directly
283
- if (require.main === module) {
284
- main()
285
- }
package/bunfig.toml DELETED
@@ -1,4 +0,0 @@
1
- preload = ["@opentui/solid/preload"]
2
-
3
- [test]
4
- preload = ["./test/preload.ts"]
Binary file
package/nul`nif DELETED
File without changes