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.
- package/AGENTS.md +0 -0
- package/Dockerfile +0 -0
- package/README.md +0 -0
- package/bin/pty-wrapper.js +0 -0
- package/bin/rird +289 -0
- package/bunfig.toml +0 -0
- package/facebook_ads_library.png +0 -0
- package/nul`nif +0 -0
- package/package.json +3 -3
- package/parsers-config.ts +0 -0
- package/rird-1.0.199.tgz +0 -0
- package/rird-1.0.205.tgz +0 -0
- package/script/build-windows.ts +2 -3
- package/script/build.ts +8 -10
- package/script/postinstall.mjs +23 -0
- package/script/publish-registries.ts +0 -0
- package/script/publish.ts +20 -7
- package/script/schema.ts +0 -0
- package/src/acp/README.md +0 -0
- package/src/acp/agent.ts +1063 -1063
- package/src/acp/session.ts +101 -101
- package/src/acp/types.ts +22 -22
- package/src/agent/agent.ts +367 -367
- package/src/agent/generate.txt +75 -75
- package/src/agent/prompt/compaction.txt +12 -12
- package/src/agent/prompt/explore.txt +18 -18
- package/src/agent/prompt/summary.txt +10 -10
- package/src/agent/prompt/title.txt +36 -36
- package/src/auth/index.ts +70 -70
- package/src/bun/index.ts +114 -114
- package/src/bus/bus-event.ts +43 -43
- package/src/bus/global.ts +10 -10
- package/src/bus/index.ts +105 -105
- package/src/cli/bootstrap.ts +17 -17
- package/src/cli/cmd/acp.ts +88 -88
- package/src/cli/cmd/activate.ts +50 -0
- package/src/cli/cmd/agent.ts +256 -256
- package/src/cli/cmd/auth.ts +409 -409
- package/src/cli/cmd/cmd.ts +7 -7
- package/src/cli/cmd/debug/config.ts +15 -15
- package/src/cli/cmd/debug/file.ts +91 -91
- package/src/cli/cmd/debug/index.ts +43 -43
- package/src/cli/cmd/debug/lsp.ts +48 -48
- package/src/cli/cmd/debug/ripgrep.ts +83 -83
- package/src/cli/cmd/debug/scrap.ts +15 -15
- package/src/cli/cmd/debug/skill.ts +15 -15
- package/src/cli/cmd/debug/snapshot.ts +48 -48
- package/src/cli/cmd/export.ts +88 -88
- package/src/cli/cmd/generate.ts +38 -38
- package/src/cli/cmd/github.ts +1400 -1400
- package/src/cli/cmd/import.ts +98 -98
- package/src/cli/cmd/mcp.ts +654 -654
- package/src/cli/cmd/models.ts +77 -77
- package/src/cli/cmd/pr.ts +112 -112
- package/src/cli/cmd/run.ts +368 -368
- package/src/cli/cmd/serve.ts +31 -31
- package/src/cli/cmd/session.ts +106 -106
- package/src/cli/cmd/stats.ts +298 -298
- package/src/cli/cmd/tui/app.tsx +696 -696
- package/src/cli/cmd/tui/attach.ts +30 -30
- package/src/cli/cmd/tui/component/border.tsx +21 -21
- package/src/cli/cmd/tui/component/dialog-agent.tsx +31 -31
- package/src/cli/cmd/tui/component/dialog-command.tsx +124 -124
- package/src/cli/cmd/tui/component/dialog-mcp.tsx +86 -86
- package/src/cli/cmd/tui/component/dialog-model.tsx +236 -268
- package/src/cli/cmd/tui/component/dialog-provider.tsx +242 -242
- package/src/cli/cmd/tui/component/dialog-session-list.tsx +102 -102
- package/src/cli/cmd/tui/component/dialog-session-rename.tsx +31 -31
- package/src/cli/cmd/tui/component/dialog-stash.tsx +86 -86
- package/src/cli/cmd/tui/component/dialog-status.tsx +162 -162
- package/src/cli/cmd/tui/component/dialog-tag.tsx +44 -44
- package/src/cli/cmd/tui/component/dialog-theme-list.tsx +50 -50
- package/src/cli/cmd/tui/component/did-you-know.tsx +85 -85
- package/src/cli/cmd/tui/component/logo.tsx +48 -35
- package/src/cli/cmd/tui/component/prompt/autocomplete.tsx +574 -574
- package/src/cli/cmd/tui/component/prompt/history.tsx +108 -108
- package/src/cli/cmd/tui/component/prompt/index.tsx +1090 -1090
- package/src/cli/cmd/tui/component/prompt/stash.tsx +101 -101
- package/src/cli/cmd/tui/component/tips.ts +27 -27
- package/src/cli/cmd/tui/component/todo-item.tsx +32 -32
- package/src/cli/cmd/tui/context/args.tsx +14 -14
- package/src/cli/cmd/tui/context/directory.ts +13 -13
- package/src/cli/cmd/tui/context/exit.tsx +23 -23
- package/src/cli/cmd/tui/context/helper.tsx +25 -25
- package/src/cli/cmd/tui/context/keybind.tsx +101 -101
- package/src/cli/cmd/tui/context/kv.tsx +49 -49
- package/src/cli/cmd/tui/context/local.tsx +345 -379
- package/src/cli/cmd/tui/context/prompt.tsx +18 -18
- package/src/cli/cmd/tui/context/route.tsx +46 -46
- package/src/cli/cmd/tui/context/sdk.tsx +74 -74
- package/src/cli/cmd/tui/context/sync.tsx +372 -372
- package/src/cli/cmd/tui/context/theme/aura.json +0 -0
- package/src/cli/cmd/tui/context/theme/ayu.json +0 -0
- package/src/cli/cmd/tui/context/theme/catppuccin-frappe.json +0 -0
- package/src/cli/cmd/tui/context/theme/catppuccin-macchiato.json +0 -0
- package/src/cli/cmd/tui/context/theme/catppuccin.json +0 -0
- package/src/cli/cmd/tui/context/theme/cobalt2.json +0 -0
- package/src/cli/cmd/tui/context/theme/cursor.json +0 -0
- package/src/cli/cmd/tui/context/theme/dracula.json +0 -0
- package/src/cli/cmd/tui/context/theme/everforest.json +0 -0
- package/src/cli/cmd/tui/context/theme/flexoki.json +0 -0
- package/src/cli/cmd/tui/context/theme/github.json +0 -0
- package/src/cli/cmd/tui/context/theme/gruvbox.json +0 -0
- package/src/cli/cmd/tui/context/theme/kanagawa.json +0 -0
- package/src/cli/cmd/tui/context/theme/lucent-orng.json +0 -0
- package/src/cli/cmd/tui/context/theme/material.json +0 -0
- package/src/cli/cmd/tui/context/theme/matrix.json +0 -0
- package/src/cli/cmd/tui/context/theme/mercury.json +0 -0
- package/src/cli/cmd/tui/context/theme/monokai.json +0 -0
- package/src/cli/cmd/tui/context/theme/nightowl.json +0 -0
- package/src/cli/cmd/tui/context/theme/nord.json +0 -0
- package/src/cli/cmd/tui/context/theme/one-dark.json +0 -0
- package/src/cli/cmd/tui/context/theme/orng.json +0 -0
- package/src/cli/cmd/tui/context/theme/palenight.json +0 -0
- package/src/cli/cmd/tui/context/theme/rird.json +0 -0
- package/src/cli/cmd/tui/context/theme/rosepine.json +0 -0
- package/src/cli/cmd/tui/context/theme/solarized.json +0 -0
- package/src/cli/cmd/tui/context/theme/synthwave84.json +0 -0
- package/src/cli/cmd/tui/context/theme/tokyonight.json +0 -0
- package/src/cli/cmd/tui/context/theme/vercel.json +0 -0
- package/src/cli/cmd/tui/context/theme/vesper.json +0 -0
- package/src/cli/cmd/tui/context/theme/zenburn.json +0 -0
- package/src/cli/cmd/tui/context/theme.tsx +1109 -1109
- package/src/cli/cmd/tui/event.ts +40 -40
- package/src/cli/cmd/tui/routes/home.tsx +138 -138
- package/src/cli/cmd/tui/routes/session/dialog-fork-from-timeline.tsx +64 -64
- package/src/cli/cmd/tui/routes/session/dialog-message.tsx +109 -109
- package/src/cli/cmd/tui/routes/session/dialog-subagent.tsx +26 -26
- package/src/cli/cmd/tui/routes/session/dialog-timeline.tsx +47 -47
- package/src/cli/cmd/tui/routes/session/footer.tsx +88 -88
- package/src/cli/cmd/tui/routes/session/header.tsx +125 -125
- package/src/cli/cmd/tui/routes/session/index.tsx +1868 -1864
- package/src/cli/cmd/tui/routes/session/sidebar.tsx +318 -318
- package/src/cli/cmd/tui/spawn.ts +60 -60
- package/src/cli/cmd/tui/thread.ts +142 -142
- package/src/cli/cmd/tui/ui/dialog-alert.tsx +57 -57
- package/src/cli/cmd/tui/ui/dialog-confirm.tsx +83 -83
- package/src/cli/cmd/tui/ui/dialog-help.tsx +38 -38
- package/src/cli/cmd/tui/ui/dialog-prompt.tsx +77 -77
- package/src/cli/cmd/tui/ui/dialog-select.tsx +332 -332
- package/src/cli/cmd/tui/ui/dialog.tsx +170 -170
- package/src/cli/cmd/tui/ui/spinner.ts +368 -368
- package/src/cli/cmd/tui/ui/toast.tsx +100 -100
- package/src/cli/cmd/tui/util/clipboard.ts +127 -127
- package/src/cli/cmd/tui/util/editor.ts +32 -32
- package/src/cli/cmd/tui/util/terminal.ts +114 -114
- package/src/cli/cmd/tui/worker.ts +63 -63
- package/src/cli/cmd/uninstall.ts +344 -344
- package/src/cli/cmd/upgrade.ts +100 -100
- package/src/cli/cmd/web.ts +84 -84
- package/src/cli/error.ts +56 -56
- package/src/cli/ui.ts +100 -84
- package/src/cli/upgrade.ts +25 -25
- package/src/command/index.ts +80 -80
- package/src/command/template/initialize.txt +10 -10
- package/src/command/template/review.txt +97 -97
- package/src/config/config.ts +990 -995
- package/src/config/markdown.ts +41 -41
- package/src/env/index.ts +26 -26
- package/src/file/ignore.ts +83 -83
- package/src/file/index.ts +328 -328
- package/src/file/ripgrep.ts +393 -393
- package/src/file/time.ts +64 -64
- package/src/file/watcher.ts +103 -103
- package/src/flag/flag.ts +48 -46
- package/src/format/formatter.ts +315 -315
- package/src/format/index.ts +137 -137
- package/src/global/index.ts +101 -52
- package/src/id/id.ts +73 -73
- package/src/ide/index.ts +76 -76
- package/src/index.ts +251 -240
- package/src/installation/index.ts +238 -239
- package/src/lsp/client.ts +229 -229
- package/src/lsp/index.ts +485 -485
- package/src/lsp/language.ts +116 -116
- package/src/lsp/server.ts +1895 -1895
- package/src/mcp/auth.ts +135 -135
- package/src/mcp/index.ts +1080 -690
- package/src/mcp/intent-analyzer.ts +376 -0
- package/src/mcp/oauth-callback.ts +200 -200
- package/src/mcp/oauth-provider.ts +154 -154
- package/src/patch/index.ts +632 -622
- package/src/permission/index.ts +199 -199
- package/src/plugin/index.ts +91 -91
- package/src/project/bootstrap.ts +33 -31
- package/src/project/instance.ts +78 -78
- package/src/project/project.ts +236 -221
- package/src/project/state.ts +65 -65
- package/src/project/vcs.ts +76 -76
- package/src/provider/auth.ts +143 -143
- package/src/provider/models-macro.ts +11 -11
- package/src/provider/models.ts +106 -106
- package/src/provider/provider.ts +1118 -1071
- package/src/provider/sdk/openai-compatible/src/README.md +0 -0
- package/src/provider/sdk/openai-compatible/src/index.ts +2 -2
- package/src/provider/sdk/openai-compatible/src/openai-compatible-provider.ts +100 -100
- package/src/provider/sdk/openai-compatible/src/responses/convert-to-openai-responses-input.ts +303 -303
- package/src/provider/sdk/openai-compatible/src/responses/map-openai-responses-finish-reason.ts +22 -22
- package/src/provider/sdk/openai-compatible/src/responses/openai-config.ts +18 -18
- package/src/provider/sdk/openai-compatible/src/responses/openai-error.ts +22 -22
- package/src/provider/sdk/openai-compatible/src/responses/openai-responses-api-types.ts +207 -207
- package/src/provider/sdk/openai-compatible/src/responses/openai-responses-language-model.ts +1713 -1713
- package/src/provider/sdk/openai-compatible/src/responses/openai-responses-prepare-tools.ts +177 -177
- package/src/provider/sdk/openai-compatible/src/responses/openai-responses-settings.ts +1 -1
- package/src/provider/sdk/openai-compatible/src/responses/tool/code-interpreter.ts +88 -88
- package/src/provider/sdk/openai-compatible/src/responses/tool/file-search.ts +128 -128
- package/src/provider/sdk/openai-compatible/src/responses/tool/image-generation.ts +115 -115
- package/src/provider/sdk/openai-compatible/src/responses/tool/local-shell.ts +65 -65
- package/src/provider/sdk/openai-compatible/src/responses/tool/web-search-preview.ts +104 -104
- package/src/provider/sdk/openai-compatible/src/responses/tool/web-search.ts +103 -103
- package/src/provider/transform.ts +455 -455
- package/src/pty/index.ts +231 -231
- package/src/security/guardrails.test.ts +341 -341
- package/src/security/guardrails.ts +558 -558
- package/src/security/index.ts +19 -19
- package/src/server/error.ts +36 -36
- package/src/server/project.ts +79 -79
- package/src/server/server.ts +2642 -2642
- package/src/server/tui.ts +71 -71
- package/src/session/compaction.ts +223 -223
- package/src/session/index.ts +461 -461
- package/src/session/llm.ts +201 -201
- package/src/session/message-v2.ts +690 -690
- package/src/session/message.ts +189 -189
- package/src/session/processor.ts +409 -409
- package/src/session/prompt/act-switch.txt +5 -5
- package/src/session/prompt/anthropic-20250930.txt +166 -166
- package/src/session/prompt/anthropic.txt +85 -85
- package/src/session/prompt/anthropic_spoof.txt +1 -1
- package/src/session/prompt/beast.txt +103 -103
- package/src/session/prompt/codex.txt +304 -304
- package/src/session/prompt/copilot-gpt-5.txt +138 -138
- package/src/session/prompt/gemini.txt +85 -85
- package/src/session/prompt/max-steps.txt +16 -16
- package/src/session/prompt/plan-reminder-anthropic.txt +35 -35
- package/src/session/prompt/plan.txt +24 -24
- package/src/session/prompt/polaris.txt +84 -84
- package/src/session/prompt/qwen.txt +106 -106
- package/src/session/prompt.ts +1529 -1509
- package/src/session/retry.ts +86 -86
- package/src/session/revert.ts +108 -108
- package/src/session/sensitive-filter.test.ts +327 -327
- package/src/session/sensitive-filter.ts +466 -466
- package/src/session/status.ts +76 -76
- package/src/session/summary.ts +194 -194
- package/src/session/system.ts +122 -120
- package/src/session/todo.ts +37 -37
- package/src/share/share-next.ts +194 -194
- package/src/share/share.ts +87 -87
- package/src/shell/shell.ts +67 -67
- package/src/skill/index.ts +1 -1
- package/src/skill/skill.ts +83 -83
- package/src/snapshot/index.ts +197 -197
- package/src/storage/storage.ts +226 -226
- package/src/tests/agent.test.ts +308 -308
- package/src/tests/build-guards.test.ts +267 -267
- package/src/tests/config.test.ts +664 -664
- package/src/tests/tool-registry.test.ts +589 -589
- package/src/tool/bash.ts +314 -317
- package/src/tool/bash.txt +158 -158
- package/src/tool/batch.ts +175 -175
- package/src/tool/batch.txt +24 -24
- package/src/tool/codesearch.ts +168 -168
- package/src/tool/codesearch.txt +12 -12
- package/src/tool/edit.ts +675 -675
- package/src/tool/edit.txt +10 -10
- package/src/tool/glob.ts +65 -65
- package/src/tool/glob.txt +6 -6
- package/src/tool/grep.ts +121 -121
- package/src/tool/grep.txt +8 -8
- package/src/tool/invalid.ts +17 -17
- package/src/tool/ls.ts +110 -110
- package/src/tool/ls.txt +1 -1
- package/src/tool/lsp-diagnostics.ts +26 -26
- package/src/tool/lsp-diagnostics.txt +1 -1
- package/src/tool/lsp-hover.ts +31 -31
- package/src/tool/lsp-hover.txt +1 -1
- package/src/tool/lsp.ts +87 -87
- package/src/tool/lsp.txt +19 -19
- package/src/tool/multiedit.ts +46 -46
- package/src/tool/multiedit.txt +41 -41
- package/src/tool/patch.ts +233 -233
- package/src/tool/patch.txt +1 -1
- package/src/tool/read.ts +219 -219
- package/src/tool/read.txt +12 -12
- package/src/tool/registry.ts +162 -162
- package/src/tool/skill.ts +100 -100
- package/src/tool/task.ts +136 -136
- package/src/tool/task.txt +51 -51
- package/src/tool/todo.ts +39 -39
- package/src/tool/todoread.txt +14 -14
- package/src/tool/todowrite.txt +167 -167
- package/src/tool/tool.ts +71 -71
- package/src/tool/webfetch.ts +198 -198
- package/src/tool/webfetch.txt +13 -13
- package/src/tool/websearch.ts +180 -180
- package/src/tool/websearch.txt +11 -11
- package/src/tool/write.ts +110 -110
- package/src/tool/write.txt +8 -8
- package/src/util/archive.ts +16 -16
- package/src/util/color.ts +19 -19
- package/src/util/context.ts +25 -25
- package/src/util/defer.ts +12 -12
- package/src/util/eventloop.ts +20 -20
- package/src/util/filesystem.ts +83 -83
- package/src/util/fn.ts +11 -11
- package/src/util/iife.ts +3 -3
- package/src/util/keybind.ts +102 -102
- package/src/util/lazy.ts +11 -11
- package/src/util/license.ts +339 -325
- package/src/util/locale.ts +81 -81
- package/src/util/lock.ts +98 -98
- package/src/util/log.ts +180 -180
- package/src/util/queue.ts +32 -32
- package/src/util/rpc.ts +42 -42
- package/src/util/scrap.ts +10 -10
- package/src/util/signal.ts +12 -12
- package/src/util/timeout.ts +14 -14
- package/src/util/token.ts +7 -7
- package/src/util/wildcard.ts +54 -54
- package/sst-env.d.ts +0 -0
- package/test/agent/agent.test.ts +1 -1
- package/test/bun.test.ts +0 -0
- package/test/cli/github-remote.test.ts +0 -0
- package/test/config/agent-color.test.ts +0 -0
- package/test/config/config.test.ts +1 -1
- package/test/config/markdown.test.ts +0 -0
- package/test/file/ignore.test.ts +0 -0
- package/test/fixture/fixture.ts +3 -2
- package/test/fixture/lsp/fake-lsp-server.js +0 -0
- package/test/ide/ide.test.ts +1 -1
- package/test/keybind.test.ts +0 -0
- package/test/lsp/client.test.ts +0 -0
- package/test/mcp/headers.test.ts +0 -0
- package/test/patch/patch.test.ts +0 -0
- package/test/preload.ts +0 -0
- package/test/project/project.test.ts +4 -2
- package/test/provider/provider.test.ts +4 -3
- package/test/provider/transform.test.ts +0 -0
- package/test/session/retry.test.ts +0 -0
- package/test/session/session.test.ts +0 -0
- package/test/skill/skill.test.ts +1 -1
- package/test/snapshot/snapshot.test.ts +29 -28
- package/test/tool/__snapshots__/tool.test.ts.snap +0 -0
- package/test/tool/bash.test.ts +0 -0
- package/test/tool/grep.test.ts +0 -0
- package/test/tool/patch.test.ts +0 -0
- package/test/tool/read.test.ts +0 -0
- package/test/util/iife.test.ts +0 -0
- package/test/util/lazy.test.ts +0 -0
- package/test/util/timeout.test.ts +0 -0
- package/test/util/wildcard.test.ts +0 -0
- package/tsconfig.json +0 -0
- 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
|
package/bin/pty-wrapper.js
CHANGED
|
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
|
package/facebook_ads_library.png
CHANGED
|
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.
|
|
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/
|
|
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
|
package/rird-1.0.205.tgz
ADDED
|
Binary file
|
package/script/build-windows.ts
CHANGED
|
@@ -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"
|
|
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")
|
|
137
|
-
outfile: `dist/${name}/bin/
|
|
138
|
-
execArgv: [`--user-agent=
|
|
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
|
-
|
|
141
|
+
RIRD_VERSION: `'${pkg.version}'`,
|
|
144
142
|
OTUI_TREE_SITTER_WORKER_PATH: bunfsRoot + workerRelativePath,
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
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
|
|
package/script/postinstall.mjs
CHANGED
|
@@ -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
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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/${
|
|
36
|
+
[pkg.name]: `./bin/${targetName}`,
|
|
29
37
|
},
|
|
30
38
|
scripts: {
|
|
31
39
|
postinstall: "bun ./postinstall.mjs || node ./postinstall.mjs",
|
|
32
40
|
},
|
|
33
|
-
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
|