rird 1.0.205 → 1.1.4

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/AGENTS.md +0 -0
  2. package/Dockerfile +0 -0
  3. package/README.md +0 -0
  4. package/bin/pty-wrapper.js +0 -0
  5. package/bin/rird +289 -0
  6. package/bunfig.toml +0 -0
  7. package/facebook_ads_library.png +0 -0
  8. package/nul`nif +0 -0
  9. package/package.json +3 -3
  10. package/parsers-config.ts +0 -0
  11. package/rird-1.0.199.tgz +0 -0
  12. package/rird-1.0.205.tgz +0 -0
  13. package/script/build-windows.ts +2 -3
  14. package/script/build.ts +8 -10
  15. package/script/postinstall.mjs +23 -0
  16. package/script/publish-registries.ts +0 -0
  17. package/script/publish.ts +20 -7
  18. package/script/schema.ts +0 -0
  19. package/src/acp/README.md +0 -0
  20. package/src/acp/agent.ts +1063 -1063
  21. package/src/acp/session.ts +101 -101
  22. package/src/acp/types.ts +22 -22
  23. package/src/agent/agent.ts +367 -367
  24. package/src/agent/generate.txt +75 -75
  25. package/src/agent/prompt/compaction.txt +12 -12
  26. package/src/agent/prompt/explore.txt +18 -18
  27. package/src/agent/prompt/summary.txt +10 -10
  28. package/src/agent/prompt/title.txt +36 -36
  29. package/src/auth/index.ts +70 -70
  30. package/src/bun/index.ts +114 -114
  31. package/src/bus/bus-event.ts +43 -43
  32. package/src/bus/global.ts +10 -10
  33. package/src/bus/index.ts +105 -105
  34. package/src/cli/bootstrap.ts +17 -17
  35. package/src/cli/cmd/acp.ts +88 -88
  36. package/src/cli/cmd/activate.ts +50 -0
  37. package/src/cli/cmd/agent.ts +256 -256
  38. package/src/cli/cmd/auth.ts +409 -409
  39. package/src/cli/cmd/cmd.ts +7 -7
  40. package/src/cli/cmd/debug/config.ts +15 -15
  41. package/src/cli/cmd/debug/file.ts +91 -91
  42. package/src/cli/cmd/debug/index.ts +43 -43
  43. package/src/cli/cmd/debug/lsp.ts +48 -48
  44. package/src/cli/cmd/debug/ripgrep.ts +83 -83
  45. package/src/cli/cmd/debug/scrap.ts +15 -15
  46. package/src/cli/cmd/debug/skill.ts +15 -15
  47. package/src/cli/cmd/debug/snapshot.ts +48 -48
  48. package/src/cli/cmd/export.ts +88 -88
  49. package/src/cli/cmd/generate.ts +38 -38
  50. package/src/cli/cmd/github.ts +1400 -1400
  51. package/src/cli/cmd/import.ts +98 -98
  52. package/src/cli/cmd/mcp.ts +654 -654
  53. package/src/cli/cmd/models.ts +77 -77
  54. package/src/cli/cmd/pr.ts +112 -112
  55. package/src/cli/cmd/run.ts +368 -368
  56. package/src/cli/cmd/serve.ts +31 -31
  57. package/src/cli/cmd/session.ts +106 -106
  58. package/src/cli/cmd/stats.ts +298 -298
  59. package/src/cli/cmd/tui/app.tsx +696 -696
  60. package/src/cli/cmd/tui/attach.ts +30 -30
  61. package/src/cli/cmd/tui/component/border.tsx +21 -21
  62. package/src/cli/cmd/tui/component/dialog-agent.tsx +31 -31
  63. package/src/cli/cmd/tui/component/dialog-command.tsx +124 -124
  64. package/src/cli/cmd/tui/component/dialog-mcp.tsx +86 -86
  65. package/src/cli/cmd/tui/component/dialog-model.tsx +236 -268
  66. package/src/cli/cmd/tui/component/dialog-provider.tsx +242 -242
  67. package/src/cli/cmd/tui/component/dialog-session-list.tsx +102 -102
  68. package/src/cli/cmd/tui/component/dialog-session-rename.tsx +31 -31
  69. package/src/cli/cmd/tui/component/dialog-stash.tsx +86 -86
  70. package/src/cli/cmd/tui/component/dialog-status.tsx +162 -162
  71. package/src/cli/cmd/tui/component/dialog-tag.tsx +44 -44
  72. package/src/cli/cmd/tui/component/dialog-theme-list.tsx +50 -50
  73. package/src/cli/cmd/tui/component/did-you-know.tsx +85 -85
  74. package/src/cli/cmd/tui/component/logo.tsx +48 -35
  75. package/src/cli/cmd/tui/component/prompt/autocomplete.tsx +574 -574
  76. package/src/cli/cmd/tui/component/prompt/history.tsx +108 -108
  77. package/src/cli/cmd/tui/component/prompt/index.tsx +1090 -1090
  78. package/src/cli/cmd/tui/component/prompt/stash.tsx +101 -101
  79. package/src/cli/cmd/tui/component/tips.ts +27 -27
  80. package/src/cli/cmd/tui/component/todo-item.tsx +32 -32
  81. package/src/cli/cmd/tui/context/args.tsx +14 -14
  82. package/src/cli/cmd/tui/context/directory.ts +13 -13
  83. package/src/cli/cmd/tui/context/exit.tsx +23 -23
  84. package/src/cli/cmd/tui/context/helper.tsx +25 -25
  85. package/src/cli/cmd/tui/context/keybind.tsx +101 -101
  86. package/src/cli/cmd/tui/context/kv.tsx +49 -49
  87. package/src/cli/cmd/tui/context/local.tsx +345 -379
  88. package/src/cli/cmd/tui/context/prompt.tsx +18 -18
  89. package/src/cli/cmd/tui/context/route.tsx +46 -46
  90. package/src/cli/cmd/tui/context/sdk.tsx +74 -74
  91. package/src/cli/cmd/tui/context/sync.tsx +372 -372
  92. package/src/cli/cmd/tui/context/theme/aura.json +0 -0
  93. package/src/cli/cmd/tui/context/theme/ayu.json +0 -0
  94. package/src/cli/cmd/tui/context/theme/catppuccin-frappe.json +0 -0
  95. package/src/cli/cmd/tui/context/theme/catppuccin-macchiato.json +0 -0
  96. package/src/cli/cmd/tui/context/theme/catppuccin.json +0 -0
  97. package/src/cli/cmd/tui/context/theme/cobalt2.json +0 -0
  98. package/src/cli/cmd/tui/context/theme/cursor.json +0 -0
  99. package/src/cli/cmd/tui/context/theme/dracula.json +0 -0
  100. package/src/cli/cmd/tui/context/theme/everforest.json +0 -0
  101. package/src/cli/cmd/tui/context/theme/flexoki.json +0 -0
  102. package/src/cli/cmd/tui/context/theme/github.json +0 -0
  103. package/src/cli/cmd/tui/context/theme/gruvbox.json +0 -0
  104. package/src/cli/cmd/tui/context/theme/kanagawa.json +0 -0
  105. package/src/cli/cmd/tui/context/theme/lucent-orng.json +0 -0
  106. package/src/cli/cmd/tui/context/theme/material.json +0 -0
  107. package/src/cli/cmd/tui/context/theme/matrix.json +0 -0
  108. package/src/cli/cmd/tui/context/theme/mercury.json +0 -0
  109. package/src/cli/cmd/tui/context/theme/monokai.json +0 -0
  110. package/src/cli/cmd/tui/context/theme/nightowl.json +0 -0
  111. package/src/cli/cmd/tui/context/theme/nord.json +0 -0
  112. package/src/cli/cmd/tui/context/theme/one-dark.json +0 -0
  113. package/src/cli/cmd/tui/context/theme/orng.json +0 -0
  114. package/src/cli/cmd/tui/context/theme/palenight.json +0 -0
  115. package/src/cli/cmd/tui/context/theme/rird.json +0 -0
  116. package/src/cli/cmd/tui/context/theme/rosepine.json +0 -0
  117. package/src/cli/cmd/tui/context/theme/solarized.json +0 -0
  118. package/src/cli/cmd/tui/context/theme/synthwave84.json +0 -0
  119. package/src/cli/cmd/tui/context/theme/tokyonight.json +0 -0
  120. package/src/cli/cmd/tui/context/theme/vercel.json +0 -0
  121. package/src/cli/cmd/tui/context/theme/vesper.json +0 -0
  122. package/src/cli/cmd/tui/context/theme/zenburn.json +0 -0
  123. package/src/cli/cmd/tui/context/theme.tsx +1109 -1109
  124. package/src/cli/cmd/tui/event.ts +40 -40
  125. package/src/cli/cmd/tui/routes/home.tsx +138 -138
  126. package/src/cli/cmd/tui/routes/session/dialog-fork-from-timeline.tsx +64 -64
  127. package/src/cli/cmd/tui/routes/session/dialog-message.tsx +109 -109
  128. package/src/cli/cmd/tui/routes/session/dialog-subagent.tsx +26 -26
  129. package/src/cli/cmd/tui/routes/session/dialog-timeline.tsx +47 -47
  130. package/src/cli/cmd/tui/routes/session/footer.tsx +88 -88
  131. package/src/cli/cmd/tui/routes/session/header.tsx +125 -125
  132. package/src/cli/cmd/tui/routes/session/index.tsx +1868 -1864
  133. package/src/cli/cmd/tui/routes/session/sidebar.tsx +318 -318
  134. package/src/cli/cmd/tui/spawn.ts +60 -60
  135. package/src/cli/cmd/tui/thread.ts +142 -142
  136. package/src/cli/cmd/tui/ui/dialog-alert.tsx +57 -57
  137. package/src/cli/cmd/tui/ui/dialog-confirm.tsx +83 -83
  138. package/src/cli/cmd/tui/ui/dialog-help.tsx +38 -38
  139. package/src/cli/cmd/tui/ui/dialog-prompt.tsx +77 -77
  140. package/src/cli/cmd/tui/ui/dialog-select.tsx +332 -332
  141. package/src/cli/cmd/tui/ui/dialog.tsx +170 -170
  142. package/src/cli/cmd/tui/ui/spinner.ts +368 -368
  143. package/src/cli/cmd/tui/ui/toast.tsx +100 -100
  144. package/src/cli/cmd/tui/util/clipboard.ts +127 -127
  145. package/src/cli/cmd/tui/util/editor.ts +32 -32
  146. package/src/cli/cmd/tui/util/terminal.ts +114 -114
  147. package/src/cli/cmd/tui/worker.ts +63 -63
  148. package/src/cli/cmd/uninstall.ts +344 -344
  149. package/src/cli/cmd/upgrade.ts +100 -100
  150. package/src/cli/cmd/web.ts +84 -84
  151. package/src/cli/error.ts +56 -56
  152. package/src/cli/ui.ts +100 -84
  153. package/src/cli/upgrade.ts +25 -25
  154. package/src/command/index.ts +80 -80
  155. package/src/command/template/initialize.txt +10 -10
  156. package/src/command/template/review.txt +97 -97
  157. package/src/config/config.ts +990 -995
  158. package/src/config/markdown.ts +41 -41
  159. package/src/env/index.ts +26 -26
  160. package/src/file/ignore.ts +83 -83
  161. package/src/file/index.ts +328 -328
  162. package/src/file/ripgrep.ts +393 -393
  163. package/src/file/time.ts +64 -64
  164. package/src/file/watcher.ts +103 -103
  165. package/src/flag/flag.ts +48 -46
  166. package/src/format/formatter.ts +315 -315
  167. package/src/format/index.ts +137 -137
  168. package/src/global/index.ts +101 -52
  169. package/src/id/id.ts +73 -73
  170. package/src/ide/index.ts +76 -76
  171. package/src/index.ts +251 -240
  172. package/src/installation/index.ts +238 -239
  173. package/src/lsp/client.ts +229 -229
  174. package/src/lsp/index.ts +485 -485
  175. package/src/lsp/language.ts +116 -116
  176. package/src/lsp/server.ts +1895 -1895
  177. package/src/mcp/auth.ts +135 -135
  178. package/src/mcp/index.ts +1080 -690
  179. package/src/mcp/intent-analyzer.ts +376 -0
  180. package/src/mcp/oauth-callback.ts +200 -200
  181. package/src/mcp/oauth-provider.ts +154 -154
  182. package/src/patch/index.ts +632 -622
  183. package/src/permission/index.ts +199 -199
  184. package/src/plugin/index.ts +91 -91
  185. package/src/project/bootstrap.ts +33 -31
  186. package/src/project/instance.ts +78 -78
  187. package/src/project/project.ts +236 -221
  188. package/src/project/state.ts +65 -65
  189. package/src/project/vcs.ts +76 -76
  190. package/src/provider/auth.ts +143 -143
  191. package/src/provider/models-macro.ts +11 -11
  192. package/src/provider/models.ts +106 -106
  193. package/src/provider/provider.ts +1118 -1071
  194. package/src/provider/sdk/openai-compatible/src/README.md +0 -0
  195. package/src/provider/sdk/openai-compatible/src/index.ts +2 -2
  196. package/src/provider/sdk/openai-compatible/src/openai-compatible-provider.ts +100 -100
  197. package/src/provider/sdk/openai-compatible/src/responses/convert-to-openai-responses-input.ts +303 -303
  198. package/src/provider/sdk/openai-compatible/src/responses/map-openai-responses-finish-reason.ts +22 -22
  199. package/src/provider/sdk/openai-compatible/src/responses/openai-config.ts +18 -18
  200. package/src/provider/sdk/openai-compatible/src/responses/openai-error.ts +22 -22
  201. package/src/provider/sdk/openai-compatible/src/responses/openai-responses-api-types.ts +207 -207
  202. package/src/provider/sdk/openai-compatible/src/responses/openai-responses-language-model.ts +1713 -1713
  203. package/src/provider/sdk/openai-compatible/src/responses/openai-responses-prepare-tools.ts +177 -177
  204. package/src/provider/sdk/openai-compatible/src/responses/openai-responses-settings.ts +1 -1
  205. package/src/provider/sdk/openai-compatible/src/responses/tool/code-interpreter.ts +88 -88
  206. package/src/provider/sdk/openai-compatible/src/responses/tool/file-search.ts +128 -128
  207. package/src/provider/sdk/openai-compatible/src/responses/tool/image-generation.ts +115 -115
  208. package/src/provider/sdk/openai-compatible/src/responses/tool/local-shell.ts +65 -65
  209. package/src/provider/sdk/openai-compatible/src/responses/tool/web-search-preview.ts +104 -104
  210. package/src/provider/sdk/openai-compatible/src/responses/tool/web-search.ts +103 -103
  211. package/src/provider/transform.ts +455 -455
  212. package/src/pty/index.ts +231 -231
  213. package/src/security/guardrails.test.ts +341 -341
  214. package/src/security/guardrails.ts +558 -558
  215. package/src/security/index.ts +19 -19
  216. package/src/server/error.ts +36 -36
  217. package/src/server/project.ts +79 -79
  218. package/src/server/server.ts +2642 -2642
  219. package/src/server/tui.ts +71 -71
  220. package/src/session/compaction.ts +223 -223
  221. package/src/session/index.ts +461 -461
  222. package/src/session/llm.ts +201 -201
  223. package/src/session/message-v2.ts +690 -690
  224. package/src/session/message.ts +189 -189
  225. package/src/session/processor.ts +409 -409
  226. package/src/session/prompt/act-switch.txt +5 -5
  227. package/src/session/prompt/anthropic-20250930.txt +166 -166
  228. package/src/session/prompt/anthropic.txt +85 -85
  229. package/src/session/prompt/anthropic_spoof.txt +1 -1
  230. package/src/session/prompt/beast.txt +103 -103
  231. package/src/session/prompt/codex.txt +304 -304
  232. package/src/session/prompt/copilot-gpt-5.txt +138 -138
  233. package/src/session/prompt/gemini.txt +85 -85
  234. package/src/session/prompt/max-steps.txt +16 -16
  235. package/src/session/prompt/plan-reminder-anthropic.txt +35 -35
  236. package/src/session/prompt/plan.txt +24 -24
  237. package/src/session/prompt/polaris.txt +84 -84
  238. package/src/session/prompt/qwen.txt +106 -106
  239. package/src/session/prompt.ts +1529 -1509
  240. package/src/session/retry.ts +86 -86
  241. package/src/session/revert.ts +108 -108
  242. package/src/session/sensitive-filter.test.ts +327 -327
  243. package/src/session/sensitive-filter.ts +466 -466
  244. package/src/session/status.ts +76 -76
  245. package/src/session/summary.ts +194 -194
  246. package/src/session/system.ts +122 -120
  247. package/src/session/todo.ts +37 -37
  248. package/src/share/share-next.ts +194 -194
  249. package/src/share/share.ts +87 -87
  250. package/src/shell/shell.ts +67 -67
  251. package/src/skill/index.ts +1 -1
  252. package/src/skill/skill.ts +83 -83
  253. package/src/snapshot/index.ts +197 -197
  254. package/src/storage/storage.ts +226 -226
  255. package/src/tests/agent.test.ts +308 -308
  256. package/src/tests/build-guards.test.ts +267 -267
  257. package/src/tests/config.test.ts +664 -664
  258. package/src/tests/tool-registry.test.ts +589 -589
  259. package/src/tool/bash.ts +314 -317
  260. package/src/tool/bash.txt +158 -158
  261. package/src/tool/batch.ts +175 -175
  262. package/src/tool/batch.txt +24 -24
  263. package/src/tool/codesearch.ts +168 -168
  264. package/src/tool/codesearch.txt +12 -12
  265. package/src/tool/edit.ts +675 -675
  266. package/src/tool/edit.txt +10 -10
  267. package/src/tool/glob.ts +65 -65
  268. package/src/tool/glob.txt +6 -6
  269. package/src/tool/grep.ts +121 -121
  270. package/src/tool/grep.txt +8 -8
  271. package/src/tool/invalid.ts +17 -17
  272. package/src/tool/ls.ts +110 -110
  273. package/src/tool/ls.txt +1 -1
  274. package/src/tool/lsp-diagnostics.ts +26 -26
  275. package/src/tool/lsp-diagnostics.txt +1 -1
  276. package/src/tool/lsp-hover.ts +31 -31
  277. package/src/tool/lsp-hover.txt +1 -1
  278. package/src/tool/lsp.ts +87 -87
  279. package/src/tool/lsp.txt +19 -19
  280. package/src/tool/multiedit.ts +46 -46
  281. package/src/tool/multiedit.txt +41 -41
  282. package/src/tool/patch.ts +233 -233
  283. package/src/tool/patch.txt +1 -1
  284. package/src/tool/read.ts +219 -219
  285. package/src/tool/read.txt +12 -12
  286. package/src/tool/registry.ts +162 -162
  287. package/src/tool/skill.ts +100 -100
  288. package/src/tool/task.ts +136 -136
  289. package/src/tool/task.txt +51 -51
  290. package/src/tool/todo.ts +39 -39
  291. package/src/tool/todoread.txt +14 -14
  292. package/src/tool/todowrite.txt +167 -167
  293. package/src/tool/tool.ts +71 -71
  294. package/src/tool/webfetch.ts +198 -198
  295. package/src/tool/webfetch.txt +13 -13
  296. package/src/tool/websearch.ts +180 -180
  297. package/src/tool/websearch.txt +11 -11
  298. package/src/tool/write.ts +110 -110
  299. package/src/tool/write.txt +8 -8
  300. package/src/util/archive.ts +16 -16
  301. package/src/util/color.ts +19 -19
  302. package/src/util/context.ts +25 -25
  303. package/src/util/defer.ts +12 -12
  304. package/src/util/eventloop.ts +20 -20
  305. package/src/util/filesystem.ts +83 -83
  306. package/src/util/fn.ts +11 -11
  307. package/src/util/iife.ts +3 -3
  308. package/src/util/keybind.ts +102 -102
  309. package/src/util/lazy.ts +11 -11
  310. package/src/util/license.ts +339 -325
  311. package/src/util/locale.ts +81 -81
  312. package/src/util/lock.ts +98 -98
  313. package/src/util/log.ts +180 -180
  314. package/src/util/queue.ts +32 -32
  315. package/src/util/rpc.ts +42 -42
  316. package/src/util/scrap.ts +10 -10
  317. package/src/util/signal.ts +12 -12
  318. package/src/util/timeout.ts +14 -14
  319. package/src/util/token.ts +7 -7
  320. package/src/util/wildcard.ts +54 -54
  321. package/sst-env.d.ts +0 -0
  322. package/test/agent/agent.test.ts +1 -1
  323. package/test/bun.test.ts +0 -0
  324. package/test/cli/github-remote.test.ts +0 -0
  325. package/test/config/agent-color.test.ts +0 -0
  326. package/test/config/config.test.ts +1 -1
  327. package/test/config/markdown.test.ts +0 -0
  328. package/test/file/ignore.test.ts +0 -0
  329. package/test/fixture/fixture.ts +3 -2
  330. package/test/fixture/lsp/fake-lsp-server.js +0 -0
  331. package/test/ide/ide.test.ts +1 -1
  332. package/test/keybind.test.ts +0 -0
  333. package/test/lsp/client.test.ts +0 -0
  334. package/test/mcp/headers.test.ts +0 -0
  335. package/test/patch/patch.test.ts +0 -0
  336. package/test/preload.ts +0 -0
  337. package/test/project/project.test.ts +4 -2
  338. package/test/provider/provider.test.ts +4 -3
  339. package/test/provider/transform.test.ts +0 -0
  340. package/test/session/retry.test.ts +0 -0
  341. package/test/session/session.test.ts +0 -0
  342. package/test/skill/skill.test.ts +1 -1
  343. package/test/snapshot/snapshot.test.ts +29 -28
  344. package/test/tool/__snapshots__/tool.test.ts.snap +0 -0
  345. package/test/tool/bash.test.ts +0 -0
  346. package/test/tool/grep.test.ts +0 -0
  347. package/test/tool/patch.test.ts +0 -0
  348. package/test/tool/read.test.ts +0 -0
  349. package/test/util/iife.test.ts +0 -0
  350. package/test/util/lazy.test.ts +0 -0
  351. package/test/util/timeout.test.ts +0 -0
  352. package/test/util/wildcard.test.ts +0 -0
  353. package/tsconfig.json +0 -0
  354. package/bin/opencode +0 -352
package/AGENTS.md CHANGED
File without changes
package/Dockerfile CHANGED
File without changes
package/README.md CHANGED
File without changes
File without changes
package/bin/rird ADDED
@@ -0,0 +1,289 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { createRequire } from "module"
4
+ import { fileURLToPath } from "url"
5
+ import { dirname } from "path"
6
+
7
+ const require = createRequire(import.meta.url)
8
+ const __filename = fileURLToPath(import.meta.url)
9
+ const __dirname = dirname(__filename)
10
+
11
+ const childProcess = require("child_process")
12
+ const fs = require("fs")
13
+ const path = require("path")
14
+ const os = require("os")
15
+
16
+ // Handle CLI commands before passing to binary
17
+ const command = process.argv[2]
18
+
19
+ // Version
20
+ if (command === "--version" || command === "-v") {
21
+ const pkg = require("../package.json")
22
+ console.log("RIRD v" + pkg.version)
23
+ process.exit(0)
24
+ }
25
+
26
+ // Help
27
+ if (command === "--help" || command === "-h" || command === "help") {
28
+ console.log("")
29
+ console.log(" RIRD AI")
30
+ console.log(" rird.ai")
31
+ console.log("")
32
+ console.log("Usage: rird [command]")
33
+ console.log("")
34
+ console.log(" rird Start RIRD AI")
35
+ console.log(" rird <task> Run with task description")
36
+ console.log(" rird activate <key> Activate license")
37
+ console.log(" rird status Check license status")
38
+ console.log(" rird upgrade Update to latest version")
39
+ console.log(" rird --help Show help")
40
+ console.log(" rird --version Show version")
41
+ console.log("")
42
+ process.exit(0)
43
+ }
44
+
45
+ // Upgrade
46
+ if (command === "upgrade" || command === "update") {
47
+ console.log("")
48
+ console.log(" RIRD AI")
49
+ console.log(" Upgrading to latest version...")
50
+ console.log("")
51
+
52
+ // Check if npm is available
53
+ let hasNpm = false
54
+ try {
55
+ childProcess.execSync("npm --version", { stdio: "ignore" })
56
+ hasNpm = true
57
+ } catch (e) {}
58
+
59
+ let result
60
+
61
+ if (hasNpm) {
62
+ console.log("Running: npm install -g rird@latest")
63
+ console.log("")
64
+ result = childProcess.spawnSync(
65
+ "npm",
66
+ ["install", "-g", "rird@latest"],
67
+ { stdio: "inherit", shell: true }
68
+ )
69
+ } else {
70
+ // Fallback to curl for Unix/macOS if npm is missing
71
+ console.log("Running: curl -fsSL https://rird.ai/install.sh | bash")
72
+ result = childProcess.spawnSync(
73
+ "bash",
74
+ ["-c", "curl -fsSL https://rird.ai/install.sh | bash"],
75
+ { stdio: "inherit" }
76
+ )
77
+ }
78
+
79
+ if (result.error || result.status !== 0) {
80
+ console.error("Upgrade failed. Please try running the install command manually.")
81
+ process.exit(1)
82
+ }
83
+ process.exit(0)
84
+ }
85
+
86
+ // Activate - save license key and validate
87
+ if (command === "activate") {
88
+ const key = process.argv[3]
89
+
90
+ console.log("")
91
+ console.log(" RIRD AI")
92
+ console.log(" Activating license...")
93
+ console.log("")
94
+
95
+ if (!key || key.length < 10) {
96
+ console.error(" Error: Invalid license key format")
97
+ console.log("")
98
+ console.log(" Usage: rird activate YOUR_LICENSE_KEY")
99
+ console.log(" Get your key at: https://rird.ai")
100
+ console.log("")
101
+ process.exit(1)
102
+ }
103
+
104
+ const rirdHome = process.env.RIRD_HOME || path.join(os.homedir(), ".rird")
105
+ const licensePath = path.join(rirdHome, "license.key")
106
+ const cachePath = path.join(rirdHome, "license_cache.json")
107
+
108
+ if (!fs.existsSync(rirdHome)) {
109
+ fs.mkdirSync(rirdHome, { recursive: true })
110
+ }
111
+
112
+ fs.writeFileSync(licensePath, key.trim())
113
+ console.log(" License key saved")
114
+
115
+ if (fs.existsSync(cachePath)) {
116
+ fs.unlinkSync(cachePath)
117
+ }
118
+
119
+ console.log(" Validating license...")
120
+
121
+ const https = require("https")
122
+ const crypto = require("crypto")
123
+
124
+ const parts = [os.hostname(), os.platform(), os.arch(), os.totalmem().toString(), os.cpus().length.toString()]
125
+ const fingerprint = crypto.createHash("sha256").update(parts.join("|")).digest("hex").substring(0, 32)
126
+
127
+ const postData = JSON.stringify({
128
+ license_key: key.trim(),
129
+ device_fingerprint: fingerprint,
130
+ version: require("../package.json").version,
131
+ platform: os.platform()
132
+ })
133
+
134
+ const options = {
135
+ hostname: "rird.ai",
136
+ port: 443,
137
+ path: "/api/desktop/validate-license",
138
+ method: "POST",
139
+ headers: { "Content-Type": "application/json", "Content-Length": Buffer.byteLength(postData) }
140
+ }
141
+
142
+ const req = https.request(options, (res) => {
143
+ let data = ""
144
+ res.on("data", (chunk) => data += chunk)
145
+ res.on("end", () => {
146
+ try {
147
+ const result = JSON.parse(data)
148
+ if (res.statusCode === 200 && result.valid) {
149
+ console.log("")
150
+ console.log(" License activated!")
151
+ if (result.user && result.user.email) console.log(" Welcome, " + result.user.email)
152
+ console.log("")
153
+ console.log(" Run 'rird' to get started")
154
+ console.log("")
155
+ fs.writeFileSync(cachePath, JSON.stringify({
156
+ license_key: key.trim(), valid: true,
157
+ email: result.user ? result.user.email : null,
158
+ plan: result.user ? result.user.plan : null,
159
+ cached_at: new Date().toISOString()
160
+ }))
161
+ process.exit(0)
162
+ } else {
163
+ console.error("")
164
+ console.error(" Activation failed: " + (result.error || "Invalid license"))
165
+ console.log(" Check your key and try again")
166
+ console.log("")
167
+ process.exit(1)
168
+ }
169
+ } catch (e) {
170
+ console.error(" Error parsing response:", e.message)
171
+ process.exit(1)
172
+ }
173
+ })
174
+ })
175
+
176
+ req.on("error", (e) => {
177
+ console.error("")
178
+ console.error(" Could not reach license server: " + e.message)
179
+ console.log("")
180
+ process.exit(1)
181
+ })
182
+
183
+ req.write(postData)
184
+ req.end()
185
+ } else if (command === "status") {
186
+ console.log("")
187
+ console.log(" RIRD AI")
188
+ console.log(" Checking license status...")
189
+ console.log("")
190
+
191
+ const rirdHome = process.env.RIRD_HOME || path.join(os.homedir(), ".rird")
192
+ const licensePath = path.join(rirdHome, "license.key")
193
+ const cachePath = path.join(rirdHome, "license_cache.json")
194
+
195
+ if (!fs.existsSync(licensePath)) {
196
+ console.log(" Status: Not activated")
197
+ console.log("")
198
+ console.log(" Run: rird activate YOUR_LICENSE_KEY")
199
+ console.log(" Get your key at: https://rird.ai")
200
+ console.log("")
201
+ process.exit(0)
202
+ }
203
+
204
+ const key = fs.readFileSync(licensePath, "utf-8").trim()
205
+
206
+ if (fs.existsSync(cachePath)) {
207
+ try {
208
+ const cache = JSON.parse(fs.readFileSync(cachePath, "utf-8"))
209
+ if (cache.valid && cache.license_key === key) {
210
+ console.log(" Status: Active")
211
+ if (cache.email) console.log(" Account: " + cache.email)
212
+ if (cache.plan) console.log(" Plan: " + cache.plan)
213
+ console.log("")
214
+ process.exit(0)
215
+ }
216
+ } catch (e) {}
217
+ }
218
+
219
+ console.log(" Status: License key found, checking online...")
220
+ console.log("")
221
+ process.exit(0)
222
+ } else {
223
+ // Only run the binary if NOT processing a special command
224
+ const envPath = process.env.RIRD_BIN_PATH
225
+ if (envPath) {
226
+ run(envPath)
227
+ }
228
+
229
+ const scriptPath = fs.realpathSync(__filename)
230
+ const scriptDir = path.dirname(scriptPath)
231
+
232
+ const platformMap = {
233
+ darwin: "darwin",
234
+ linux: "linux",
235
+ win32: "windows",
236
+ }
237
+ const archMap = {
238
+ x64: "x64",
239
+ arm64: "arm64",
240
+ arm: "arm",
241
+ }
242
+
243
+ let platform = platformMap[os.platform()]
244
+ if (!platform) {
245
+ platform = os.platform()
246
+ }
247
+ let arch = archMap[os.arch()]
248
+ if (!arch) {
249
+ arch = os.arch()
250
+ }
251
+ const base = "rird-" + platform + "-" + arch
252
+ const binary = platform === "windows" ? "rird.exe" : "rird"
253
+
254
+ function findBinary(startDir) {
255
+ let current = startDir
256
+ for (;;) {
257
+ const modules = path.join(current, "node_modules")
258
+ if (fs.existsSync(modules)) {
259
+ const entries = fs.readdirSync(modules)
260
+ for (const entry of entries) {
261
+ if (!entry.startsWith(base)) {
262
+ continue
263
+ }
264
+ const candidate = path.join(modules, entry, "bin", binary)
265
+ if (fs.existsSync(candidate)) {
266
+ return candidate
267
+ }
268
+ }
269
+ }
270
+ const parent = path.dirname(current)
271
+ if (parent === current) {
272
+ return
273
+ }
274
+ current = parent
275
+ }
276
+ }
277
+
278
+ const resolved = findBinary(scriptDir)
279
+ if (!resolved) {
280
+ console.error(
281
+ 'It seems that your package manager failed to install the right version of the RIRD CLI for your platform. You can try manually installing the "' +
282
+ base +
283
+ '" package',
284
+ )
285
+ process.exit(1)
286
+ }
287
+
288
+ run(resolved)
289
+ }
package/bunfig.toml CHANGED
File without changes
File without changes
package/nul`nif CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
- "version": "1.0.205",
3
+ "version": "1.1.4",
4
4
  "name": "rird",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -16,7 +16,7 @@
16
16
  "deploy": "echo 'Deploying application...' && bun run build && echo 'Deployment completed successfully'"
17
17
  },
18
18
  "bin": {
19
- "rird": "./bin/opencode"
19
+ "rird": "./bin/rird"
20
20
  },
21
21
  "exports": {
22
22
  "./*": "./src/*.ts"
@@ -108,4 +108,4 @@
108
108
  "zod": "catalog:",
109
109
  "zod-to-json-schema": "3.24.5"
110
110
  }
111
- }
111
+ }
package/parsers-config.ts CHANGED
File without changes
package/rird-1.0.199.tgz CHANGED
File without changes
Binary file
@@ -29,13 +29,12 @@ await Bun.build({
29
29
  compile: {
30
30
  autoloadBunfig: false,
31
31
  autoloadDotenv: false,
32
- autoloadTsconfig: true,
33
32
  autoloadPackageJson: true,
34
- target: "bun-windows-x64" as any,
33
+ target: "bun-windows-x64",
35
34
  outfile: `dist/${name}/bin/opencode`,
36
35
  execArgv: [`--user-agent=opencode/${version}`, "--"],
37
36
  windows: {},
38
- },
37
+ } as any,
39
38
  entrypoints: ["./src/index.ts", parserWorker, workerPath],
40
39
  define: {
41
40
  OPENCODE_VERSION: `'${version}'`,
package/script/build.ts CHANGED
@@ -130,21 +130,19 @@ for (const item of targets) {
130
130
  compile: {
131
131
  autoloadBunfig: false,
132
132
  autoloadDotenv: false,
133
- //@ts-ignore (bun types aren't up to date)
134
- autoloadTsconfig: true,
135
133
  autoloadPackageJson: true,
136
- target: name.replace(pkg.name, "bun") as any,
137
- outfile: `dist/${name}/bin/opencode`,
138
- execArgv: [`--user-agent=opencode/${Script.version}`, "--"],
134
+ target: name.replace(pkg.name, "bun"),
135
+ outfile: `dist/${name}/bin/rird`,
136
+ execArgv: [`--user-agent=rird/${Script.version}`, "--"],
139
137
  windows: {},
140
- },
138
+ } as any,
141
139
  entrypoints: ["./src/index.ts", parserWorker, workerPath],
142
140
  define: {
143
- OPENCODE_VERSION: `'${Script.version}'`,
141
+ RIRD_VERSION: `'${pkg.version}'`,
144
142
  OTUI_TREE_SITTER_WORKER_PATH: bunfsRoot + workerRelativePath,
145
- OPENCODE_WORKER_PATH: workerPath,
146
- OPENCODE_CHANNEL: `'${Script.channel}'`,
147
- OPENCODE_LIBC: item.os === "linux" ? `'${item.abi ?? "glibc"}'` : "",
143
+ RIRD_WORKER_PATH: workerPath,
144
+ RIRD_CHANNEL: `'${Script.channel}'`,
145
+ RIRD_LIBC: item.os === "linux" ? `'${item.abi ?? "glibc"}'` : "",
148
146
  },
149
147
  })
150
148
 
@@ -309,6 +309,16 @@ function createConfig(pythonCmd) {
309
309
  "- Launch and interact with desktop applications",
310
310
  "- Take screenshots and analyze what's on screen",
311
311
  "",
312
+ "=== RESEARCH STRATEGY ===",
313
+ "For ANY task that asks to 'find URLs', 'output URLs', 'list profiles', or 'get X items':",
314
+ "1. ALWAYS START with websearch - it is instant and bypasses detection.",
315
+ "2. Only fall back to browser automation if websearch fails or task requires interaction (login, forms).",
316
+ "",
317
+ "=== TOOL PRIORITY ===",
318
+ "1. websearch: Use for finding URLs, profiles, and public info.",
319
+ "2. Browser (stealth-browser): Use for interaction, scrolling, and map searching.",
320
+ "3. Computer Use: Use for desktop applications when enabled.",
321
+ "",
312
322
  "=== HOW I WORK ===",
313
323
  "1. WEB SEARCH:",
314
324
  " - Finding URLs, quick facts, lists of companies or profiles",
@@ -334,6 +344,15 @@ function createConfig(pythonCmd) {
334
344
  "- Extract data from websites",
335
345
  "- Read and write files on your computer",
336
346
  "",
347
+ "=== RESEARCH STRATEGY ===",
348
+ "For ANY task that asks to 'find URLs', 'output URLs', 'list profiles', or 'get X items':",
349
+ "1. ALWAYS START with websearch - it is instant and bypasses detection.",
350
+ "2. Only fall back to browser automation if websearch fails or task requires interaction (login, forms).",
351
+ "",
352
+ "=== TOOL PRIORITY ===",
353
+ "1. websearch: Use for finding URLs, profiles, and public info.",
354
+ "2. Browser (stealth-browser): Use for interaction, scrolling, and map searching.",
355
+ "",
337
356
  "=== HOW I WORK ===",
338
357
  "1. WEB SEARCH:",
339
358
  " - Finding URLs, quick facts, lists of companies or profiles",
@@ -408,6 +427,10 @@ function createConfig(pythonCmd) {
408
427
  webfetch: "allow",
409
428
  external_directory: "allow"
410
429
  },
430
+ tools: {
431
+ websearch: true,
432
+ codesearch: true
433
+ },
411
434
  autoupdate: false,
412
435
  $schema: "https://rird.ai/config.json"
413
436
  }
File without changes
package/script/publish.ts CHANGED
@@ -3,21 +3,29 @@ import { $ } from "bun"
3
3
  import pkg from "../package.json"
4
4
  import { Script } from "@opencode-ai/script"
5
5
  import { fileURLToPath } from "url"
6
+ import fs from "fs"
7
+ import path from "path"
6
8
 
7
9
  const dir = fileURLToPath(new URL("..", import.meta.url))
8
10
  process.chdir(dir)
9
11
 
10
12
  const { binaries } = await import("./build.ts")
11
13
  {
12
- const name = `${pkg.name}-${process.platform}-${process.arch}`
13
- console.log(`smoke test: running dist/${name}/bin/opencode --version`)
14
- await $`./dist/${name}/bin/opencode --version`
14
+ const platform = process.platform === "win32" ? "windows" : process.platform
15
+ const name = `${pkg.name}-${platform}-${process.arch}`
16
+ const binary = process.platform === "win32" ? "opencode.exe" : "opencode"
17
+ console.log(`smoke test: running dist/${name}/bin/${binary} --version`)
18
+ await $`./dist/${name}/bin/${binary} --version`
15
19
  }
16
20
 
17
21
  await $`mkdir -p ./dist/${pkg.name}`
18
- await $`cp -r ./bin ./dist/${pkg.name}/bin`
22
+ fs.cpSync("./bin", `./dist/${pkg.name}/bin`, { recursive: true })
19
23
  // Rename bin/opencode to bin/rird so the npm bin config works
20
- await $`mv ./dist/${pkg.name}/bin/opencode ./dist/${pkg.name}/bin/${pkg.name}`
24
+ const targetName = process.platform === "win32" ? `${pkg.name}.exe` : pkg.name
25
+ fs.renameSync(
26
+ path.join(dir, `./dist/${pkg.name}/bin/opencode`),
27
+ path.join(dir, `./dist/${pkg.name}/bin/${targetName}`)
28
+ )
21
29
  await $`cp ./script/postinstall.mjs ./dist/${pkg.name}/postinstall.mjs`
22
30
 
23
31
  await Bun.file(`./dist/${pkg.name}/package.json`).write(
@@ -25,12 +33,12 @@ await Bun.file(`./dist/${pkg.name}/package.json`).write(
25
33
  {
26
34
  name: pkg.name + "-ai",
27
35
  bin: {
28
- [pkg.name]: `./bin/${pkg.name}`,
36
+ [pkg.name]: `./bin/${targetName}`,
29
37
  },
30
38
  scripts: {
31
39
  postinstall: "bun ./postinstall.mjs || node ./postinstall.mjs",
32
40
  },
33
- version: Script.version,
41
+ version: pkg.version,
34
42
  optionalDependencies: binaries,
35
43
  },
36
44
  null,
@@ -44,6 +52,11 @@ const tasks = Object.entries(binaries).map(async ([name]) => {
44
52
  if (process.platform !== "win32") {
45
53
  await $`chmod -R 755 .`.cwd(`./dist/${name}`)
46
54
  }
55
+ // Force correct version in individual package.json files
56
+ const pkgJson = await Bun.file(`./dist/${name}/package.json`).json()
57
+ pkgJson.version = pkg.version
58
+ await Bun.file(`./dist/${name}/package.json`).write(JSON.stringify(pkgJson, null, 2))
59
+
47
60
  await $`bun pm pack`.cwd(`./dist/${name}`)
48
61
  for (const tag of tags) {
49
62
  await $`npm publish *.tgz --access public --tag ${tag}`.cwd(`./dist/${name}`)
package/script/schema.ts CHANGED
File without changes
package/src/acp/README.md CHANGED
File without changes