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