@link-assistant/agent 0.0.8 → 0.0.11
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/EXAMPLES.md +80 -1
- package/MODELS.md +72 -24
- package/README.md +95 -2
- package/TOOLS.md +20 -0
- package/package.json +36 -2
- package/src/agent/agent.ts +68 -54
- package/src/auth/claude-oauth.ts +426 -0
- package/src/auth/index.ts +28 -26
- package/src/auth/plugins.ts +876 -0
- package/src/bun/index.ts +53 -43
- package/src/bus/global.ts +5 -5
- package/src/bus/index.ts +59 -53
- package/src/cli/bootstrap.js +12 -12
- package/src/cli/bootstrap.ts +6 -6
- package/src/cli/cmd/agent.ts +97 -92
- package/src/cli/cmd/auth.ts +468 -0
- package/src/cli/cmd/cmd.ts +2 -2
- package/src/cli/cmd/export.ts +41 -41
- package/src/cli/cmd/mcp.ts +210 -53
- package/src/cli/cmd/models.ts +30 -29
- package/src/cli/cmd/run.ts +269 -213
- package/src/cli/cmd/stats.ts +185 -146
- package/src/cli/error.ts +17 -13
- package/src/cli/ui.ts +78 -0
- package/src/command/index.ts +26 -26
- package/src/config/config.ts +528 -288
- package/src/config/markdown.ts +15 -15
- package/src/file/ripgrep.ts +201 -169
- package/src/file/time.ts +21 -18
- package/src/file/watcher.ts +51 -42
- package/src/file.ts +1 -1
- package/src/flag/flag.ts +26 -11
- package/src/format/formatter.ts +206 -162
- package/src/format/index.ts +61 -61
- package/src/global/index.ts +21 -21
- package/src/id/id.ts +47 -33
- package/src/index.js +554 -332
- package/src/json-standard/index.ts +173 -0
- package/src/mcp/index.ts +135 -128
- package/src/patch/index.ts +336 -267
- package/src/project/bootstrap.ts +15 -15
- package/src/project/instance.ts +43 -36
- package/src/project/project.ts +47 -47
- package/src/project/state.ts +37 -33
- package/src/provider/models-macro.ts +5 -5
- package/src/provider/models.ts +32 -32
- package/src/provider/opencode.js +19 -19
- package/src/provider/provider.ts +518 -277
- package/src/provider/transform.ts +143 -102
- package/src/server/project.ts +21 -21
- package/src/server/server.ts +111 -105
- package/src/session/agent.js +66 -60
- package/src/session/compaction.ts +136 -111
- package/src/session/index.ts +189 -156
- package/src/session/message-v2.ts +312 -268
- package/src/session/message.ts +73 -57
- package/src/session/processor.ts +180 -166
- package/src/session/prompt.ts +678 -533
- package/src/session/retry.ts +26 -23
- package/src/session/revert.ts +76 -62
- package/src/session/status.ts +26 -26
- package/src/session/summary.ts +97 -76
- package/src/session/system.ts +77 -63
- package/src/session/todo.ts +22 -16
- package/src/snapshot/index.ts +92 -76
- package/src/storage/storage.ts +157 -120
- package/src/tool/bash.ts +116 -106
- package/src/tool/batch.ts +73 -59
- package/src/tool/codesearch.ts +60 -53
- package/src/tool/edit.ts +319 -263
- package/src/tool/glob.ts +32 -28
- package/src/tool/grep.ts +72 -53
- package/src/tool/invalid.ts +7 -7
- package/src/tool/ls.ts +77 -64
- package/src/tool/multiedit.ts +30 -21
- package/src/tool/patch.ts +121 -94
- package/src/tool/read.ts +140 -122
- package/src/tool/registry.ts +38 -38
- package/src/tool/task.ts +93 -60
- package/src/tool/todo.ts +16 -16
- package/src/tool/tool.ts +45 -36
- package/src/tool/webfetch.ts +97 -74
- package/src/tool/websearch.ts +78 -64
- package/src/tool/write.ts +21 -15
- package/src/util/binary.ts +27 -19
- package/src/util/context.ts +8 -8
- package/src/util/defer.ts +7 -5
- package/src/util/error.ts +24 -19
- package/src/util/eventloop.ts +16 -10
- package/src/util/filesystem.ts +37 -33
- package/src/util/fn.ts +11 -8
- package/src/util/iife.ts +1 -1
- package/src/util/keybind.ts +44 -44
- package/src/util/lazy.ts +7 -7
- package/src/util/locale.ts +20 -16
- package/src/util/lock.ts +43 -38
- package/src/util/log.ts +95 -85
- package/src/util/queue.ts +8 -8
- package/src/util/rpc.ts +35 -23
- package/src/util/scrap.ts +4 -4
- package/src/util/signal.ts +5 -5
- package/src/util/timeout.ts +6 -6
- package/src/util/token.ts +2 -2
- package/src/util/wildcard.ts +38 -27
package/README.md
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
> 🚨 **SECURITY WARNING: 100% UNSAFE AND AUTONOMOUS** 🚨
|
|
9
9
|
>
|
|
10
10
|
> This agent operates with **ZERO RESTRICTIONS** and **FULL AUTONOMY**:
|
|
11
|
+
>
|
|
11
12
|
> - ❌ **No Sandbox** - Complete unrestricted file system access
|
|
12
13
|
> - ❌ **No Permissions System** - No approval required for any actions
|
|
13
14
|
> - ❌ **No Safety Guardrails** - Can execute ANY command with full privileges
|
|
@@ -21,7 +22,7 @@ This is an MVP implementation of an OpenCode-compatible CLI agent, focused on ma
|
|
|
21
22
|
|
|
22
23
|
- ✅ **JSON Input/Output**: Compatible with `opencode run --format json --model opencode/grok-code`
|
|
23
24
|
- ✅ **Plain Text Input**: Also accepts plain text messages (auto-converted to JSON format)
|
|
24
|
-
- ✅ **Flexible Model Selection**: Defaults to free OpenCode Zen Grok Code Fast 1, supports
|
|
25
|
+
- ✅ **Flexible Model Selection**: Defaults to free OpenCode Zen Grok Code Fast 1, supports [OpenCode Zen](https://opencode.ai/docs/zen/), [Claude OAuth](docs/claude-oauth.md), and [Groq](docs/groq.md) providers
|
|
25
26
|
- ✅ **No Restrictions**: Fully unrestricted file system and command execution access (no sandbox)
|
|
26
27
|
- ✅ **Minimal Footprint**: Built with Bun.sh for maximum efficiency
|
|
27
28
|
- ✅ **Full Tool Support**: 13 tools including websearch, codesearch, batch - all enabled by default
|
|
@@ -75,7 +76,7 @@ The agent streams events as they occur, providing the same real-time experience
|
|
|
75
76
|
- **Plain Text Input**: Also accepts plain text messages (auto-converted to JSON format)
|
|
76
77
|
- **Unrestricted Access**: Full file system and command execution access (no sandbox, no restrictions)
|
|
77
78
|
- **Tool Support**: 13 tools including websearch, codesearch, batch - all enabled by default
|
|
78
|
-
- **Flexible Model Selection**: Defaults to free Grok Code Fast 1, supports
|
|
79
|
+
- **Flexible Model Selection**: Defaults to free Grok Code Fast 1, supports [OpenCode Zen](https://opencode.ai/docs/zen/), [Claude OAuth](docs/claude-oauth.md), and [Groq](docs/groq.md) - see [MODELS.md](MODELS.md)
|
|
79
80
|
- **Bun.sh First**: Built with Bun for maximum efficiency and minimal resource usage
|
|
80
81
|
- **No TUI**: Pure JSON CLI interface for automation and integration
|
|
81
82
|
- **Public Domain**: Unlicense - use it however you want
|
|
@@ -83,6 +84,7 @@ The agent streams events as they occur, providing the same real-time experience
|
|
|
83
84
|
## Installation
|
|
84
85
|
|
|
85
86
|
**Requirements:**
|
|
87
|
+
|
|
86
88
|
- [Bun](https://bun.sh) >= 1.0.0 (Node.js and Deno are NOT supported)
|
|
87
89
|
|
|
88
90
|
```bash
|
|
@@ -103,16 +105,19 @@ After installation, the `agent` command will be available globally.
|
|
|
103
105
|
### Simplest Examples
|
|
104
106
|
|
|
105
107
|
**Plain text (easiest):**
|
|
108
|
+
|
|
106
109
|
```bash
|
|
107
110
|
echo "hi" | agent
|
|
108
111
|
```
|
|
109
112
|
|
|
110
113
|
**Simple JSON message:**
|
|
114
|
+
|
|
111
115
|
```bash
|
|
112
116
|
echo '{"message":"hi"}' | agent
|
|
113
117
|
```
|
|
114
118
|
|
|
115
119
|
**With custom model:**
|
|
120
|
+
|
|
116
121
|
```bash
|
|
117
122
|
echo "hi" | agent --model opencode/grok-code
|
|
118
123
|
```
|
|
@@ -120,17 +125,20 @@ echo "hi" | agent --model opencode/grok-code
|
|
|
120
125
|
### More Examples
|
|
121
126
|
|
|
122
127
|
**Plain Text Input:**
|
|
128
|
+
|
|
123
129
|
```bash
|
|
124
130
|
echo "hello world" | agent
|
|
125
131
|
echo "search the web for TypeScript news" | agent
|
|
126
132
|
```
|
|
127
133
|
|
|
128
134
|
**JSON Input with tool calls:**
|
|
135
|
+
|
|
129
136
|
```bash
|
|
130
137
|
echo '{"message":"run command","tools":[{"name":"bash","params":{"command":"ls -la"}}]}' | agent
|
|
131
138
|
```
|
|
132
139
|
|
|
133
140
|
**Using different models:**
|
|
141
|
+
|
|
134
142
|
```bash
|
|
135
143
|
# Default model (free Grok Code Fast 1)
|
|
136
144
|
echo "hi" | agent
|
|
@@ -144,9 +152,30 @@ echo "hi" | agent --model opencode/sonnet # Claude Sonnet 4.5
|
|
|
144
152
|
echo "hi" | agent --model opencode/haiku # Claude Haiku 4.5
|
|
145
153
|
echo "hi" | agent --model opencode/opus # Claude Opus 4.1
|
|
146
154
|
echo "hi" | agent --model opencode/gemini-3-pro # Gemini 3 Pro
|
|
155
|
+
|
|
156
|
+
# Groq models (requires GROQ_API_KEY)
|
|
157
|
+
echo "hi" | agent --model groq/llama-3.3-70b-versatile # Llama 3.3 70B
|
|
158
|
+
echo "hi" | agent --model groq/llama-3.1-8b-instant # Llama 3.1 8B (fast)
|
|
159
|
+
|
|
160
|
+
# Anthropic direct (requires ANTHROPIC_API_KEY)
|
|
161
|
+
echo "hi" | agent --model anthropic/claude-sonnet-4-5 # Claude Sonnet 4.5
|
|
162
|
+
echo "hi" | agent --model anthropic/claude-opus-4-1 # Claude Opus 4.1
|
|
163
|
+
|
|
164
|
+
# Anthropic OAuth (requires Claude Pro/Max subscription)
|
|
165
|
+
agent auth login # Select Anthropic > Claude Pro/Max
|
|
166
|
+
echo "hi" | agent --model anthropic/claude-sonnet-4-5 # Uses OAuth credentials
|
|
167
|
+
|
|
168
|
+
# Use existing Claude Code CLI credentials
|
|
169
|
+
echo "hi" | agent --use-existing-claude-oauth # Reads from ~/.claude/.credentials.json
|
|
170
|
+
|
|
171
|
+
# GitHub Copilot (requires Copilot subscription)
|
|
172
|
+
agent auth login # Select GitHub Copilot
|
|
173
|
+
echo "hi" | agent --model github-copilot/gpt-4o # Uses Copilot
|
|
147
174
|
```
|
|
148
175
|
|
|
149
176
|
See [MODELS.md](MODELS.md) for complete list of available models and pricing.
|
|
177
|
+
See [docs/groq.md](docs/groq.md) for Groq provider documentation.
|
|
178
|
+
See [docs/claude-oauth.md](docs/claude-oauth.md) for Claude OAuth provider documentation.
|
|
150
179
|
|
|
151
180
|
### CLI Options
|
|
152
181
|
|
|
@@ -156,22 +185,65 @@ agent [options]
|
|
|
156
185
|
Options:
|
|
157
186
|
--model Model to use in format providerID/modelID
|
|
158
187
|
Default: opencode/grok-code
|
|
188
|
+
--json-standard JSON output format standard
|
|
189
|
+
Choices: "opencode" (default), "claude" (experimental)
|
|
190
|
+
--use-existing-claude-oauth Use existing Claude OAuth credentials
|
|
191
|
+
from ~/.claude/.credentials.json
|
|
159
192
|
--system-message Full override of the system message
|
|
160
193
|
--system-message-file Full override of the system message from file
|
|
161
194
|
--append-system-message Append to the default system message
|
|
162
195
|
--append-system-message-file Append to the default system message from file
|
|
163
196
|
--help Show help
|
|
164
197
|
--version Show version number
|
|
198
|
+
|
|
199
|
+
Commands:
|
|
200
|
+
auth login Authenticate with a provider (Anthropic, GitHub Copilot, etc.)
|
|
201
|
+
auth logout Remove credentials for a provider
|
|
202
|
+
auth list List configured credentials
|
|
203
|
+
auth status Check authentication status (experimental)
|
|
204
|
+
mcp MCP server commands
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### JSON Output Standards
|
|
208
|
+
|
|
209
|
+
The agent supports two JSON output format standards via the `--json-standard` option:
|
|
210
|
+
|
|
211
|
+
#### OpenCode Standard (default)
|
|
212
|
+
|
|
213
|
+
The OpenCode format is the default JSON output format, compatible with `opencode run --format json`:
|
|
214
|
+
|
|
215
|
+
```bash
|
|
216
|
+
echo "hi" | agent --json-standard opencode
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
- **Format**: Pretty-printed JSON (human-readable with indentation)
|
|
220
|
+
- **Event Types**: `step_start`, `step_finish`, `text`, `tool_use`, `error`
|
|
221
|
+
- **Timestamps**: Unix milliseconds (number)
|
|
222
|
+
- **Session ID**: `sessionID` (camelCase)
|
|
223
|
+
|
|
224
|
+
#### Claude Standard (experimental)
|
|
225
|
+
|
|
226
|
+
The Claude format provides compatibility with Anthropic's Claude CLI `--output-format stream-json`:
|
|
227
|
+
|
|
228
|
+
```bash
|
|
229
|
+
echo "hi" | agent --json-standard claude
|
|
165
230
|
```
|
|
166
231
|
|
|
232
|
+
- **Format**: NDJSON (Newline-Delimited JSON - compact, one JSON per line)
|
|
233
|
+
- **Event Types**: `init`, `message`, `tool_use`, `tool_result`, `result`
|
|
234
|
+
- **Timestamps**: ISO 8601 strings
|
|
235
|
+
- **Session ID**: `session_id` (snake_case)
|
|
236
|
+
|
|
167
237
|
### Input Formats
|
|
168
238
|
|
|
169
239
|
**Plain Text (auto-converted):**
|
|
240
|
+
|
|
170
241
|
```bash
|
|
171
242
|
echo "your message here" | agent
|
|
172
243
|
```
|
|
173
244
|
|
|
174
245
|
**JSON Format:**
|
|
246
|
+
|
|
175
247
|
```json
|
|
176
248
|
{
|
|
177
249
|
"message": "Your message here",
|
|
@@ -189,23 +261,27 @@ echo "your message here" | agent
|
|
|
189
261
|
All 13 tools are **enabled by default** with **no configuration required**. See [TOOLS.md](TOOLS.md) for complete documentation.
|
|
190
262
|
|
|
191
263
|
### File Operations
|
|
264
|
+
|
|
192
265
|
- **`read`** - Read file contents
|
|
193
266
|
- **`write`** - Write files
|
|
194
267
|
- **`edit`** - Edit files with string replacement
|
|
195
268
|
- **`list`** - List directory contents
|
|
196
269
|
|
|
197
270
|
### Search Tools
|
|
271
|
+
|
|
198
272
|
- **`glob`** - File pattern matching (`**/*.js`)
|
|
199
273
|
- **`grep`** - Text search with regex support
|
|
200
274
|
- **`websearch`** ✨ - Web search via Exa API (no config needed!)
|
|
201
275
|
- **`codesearch`** ✨ - Code search via Exa API (no config needed!)
|
|
202
276
|
|
|
203
277
|
### Execution Tools
|
|
278
|
+
|
|
204
279
|
- **`bash`** - Execute shell commands
|
|
205
280
|
- **`batch`** ✨ - Batch multiple tool calls (no config needed!)
|
|
206
281
|
- **`task`** - Launch subagent tasks
|
|
207
282
|
|
|
208
283
|
### Utility Tools
|
|
284
|
+
|
|
209
285
|
- **`todo`** - Task tracking
|
|
210
286
|
- **`webfetch`** - Fetch and process URLs
|
|
211
287
|
|
|
@@ -222,21 +298,26 @@ See [EXAMPLES.md](EXAMPLES.md) for detailed usage examples of each tool with bot
|
|
|
222
298
|
bun test
|
|
223
299
|
|
|
224
300
|
# Run specific test file
|
|
301
|
+
bun test tests/mcp.test.js
|
|
225
302
|
bun test tests/websearch.tools.test.js
|
|
226
303
|
bun test tests/batch.tools.test.js
|
|
227
304
|
bun test tests/plaintext.input.test.js
|
|
228
305
|
```
|
|
229
306
|
|
|
307
|
+
For detailed testing information including how to run tests manually and trigger CI tests, see [TESTING.md](TESTING.md).
|
|
308
|
+
|
|
230
309
|
## Maintenance
|
|
231
310
|
|
|
232
311
|
### Development
|
|
233
312
|
|
|
234
313
|
Run the agent in development mode:
|
|
314
|
+
|
|
235
315
|
```bash
|
|
236
316
|
bun run dev
|
|
237
317
|
```
|
|
238
318
|
|
|
239
319
|
Or run directly:
|
|
320
|
+
|
|
240
321
|
```bash
|
|
241
322
|
bun run src/index.js
|
|
242
323
|
```
|
|
@@ -244,6 +325,7 @@ bun run src/index.js
|
|
|
244
325
|
### Testing
|
|
245
326
|
|
|
246
327
|
Simply run:
|
|
328
|
+
|
|
247
329
|
```bash
|
|
248
330
|
bun test
|
|
249
331
|
```
|
|
@@ -255,6 +337,7 @@ Bun automatically discovers and runs all `*.test.js` files in the project.
|
|
|
255
337
|
- ✅ 13 tool implementation tests
|
|
256
338
|
- ✅ Plain text input support test
|
|
257
339
|
- ✅ OpenCode compatibility tests for websearch/codesearch
|
|
340
|
+
- ✅ JSON standard unit tests (opencode and claude formats)
|
|
258
341
|
- ✅ All tests pass with 100% OpenCode JSON format compatibility
|
|
259
342
|
|
|
260
343
|
### Publishing
|
|
@@ -262,11 +345,13 @@ Bun automatically discovers and runs all `*.test.js` files in the project.
|
|
|
262
345
|
To publish a new version to npm:
|
|
263
346
|
|
|
264
347
|
1. **Update version** in `package.json`:
|
|
348
|
+
|
|
265
349
|
```bash
|
|
266
350
|
# Update version field manually (e.g., 0.0.3 -> 0.0.4)
|
|
267
351
|
```
|
|
268
352
|
|
|
269
353
|
2. **Commit changes**:
|
|
354
|
+
|
|
270
355
|
```bash
|
|
271
356
|
git add .
|
|
272
357
|
git commit -m "Release v0.0.4"
|
|
@@ -283,18 +368,22 @@ The package publishes source files directly (no build step required). Bun handle
|
|
|
283
368
|
## Key Features
|
|
284
369
|
|
|
285
370
|
### No Configuration Required
|
|
371
|
+
|
|
286
372
|
- **WebSearch/CodeSearch**: Work without `OPENCODE_EXPERIMENTAL_EXA` environment variable
|
|
287
373
|
- **Batch Tool**: Always enabled, no experimental flag needed
|
|
288
374
|
- **All Tools**: No config files, API keys handled automatically
|
|
289
375
|
|
|
290
376
|
### OpenCode 100% Compatible
|
|
377
|
+
|
|
291
378
|
- All tools produce JSON output matching OpenCode's exact format
|
|
292
379
|
- WebSearch and CodeSearch tools are verified 100% compatible
|
|
293
380
|
- Tool event structure matches OpenCode specifications
|
|
294
381
|
- Can be used as drop-in replacement for `opencode run --format json`
|
|
295
382
|
|
|
296
383
|
### Plain Text Support
|
|
384
|
+
|
|
297
385
|
Both plain text and JSON input work:
|
|
386
|
+
|
|
298
387
|
```bash
|
|
299
388
|
# Plain text
|
|
300
389
|
echo "hello" | bun run src/index.js
|
|
@@ -306,12 +395,15 @@ echo '{"message":"hello"}' | bun run src/index.js
|
|
|
306
395
|
Plain text is automatically converted to `{"message":"your text"}` format.
|
|
307
396
|
|
|
308
397
|
### JSON Event Streaming Output
|
|
398
|
+
|
|
309
399
|
JSON output is pretty-printed for easy readability while maintaining OpenCode compatibility:
|
|
400
|
+
|
|
310
401
|
```bash
|
|
311
402
|
echo "hi" | agent
|
|
312
403
|
```
|
|
313
404
|
|
|
314
405
|
Output (pretty-printed JSON events):
|
|
406
|
+
|
|
315
407
|
```json
|
|
316
408
|
{
|
|
317
409
|
"type": "step_start",
|
|
@@ -377,6 +469,7 @@ This repository includes official reference implementations as git submodules to
|
|
|
377
469
|
- **reference-qwen3-coder** - [Qwen3-Coder](https://github.com/QwenLM/Qwen3-Coder) - Official Qwen3 code model from Alibaba Cloud
|
|
378
470
|
|
|
379
471
|
To initialize all submodules:
|
|
472
|
+
|
|
380
473
|
```bash
|
|
381
474
|
git submodule update --init --recursive
|
|
382
475
|
```
|
package/TOOLS.md
CHANGED
|
@@ -7,24 +7,28 @@ This document lists all tools supported by `@link-assistant/agent`. All tools ar
|
|
|
7
7
|
## File Operations
|
|
8
8
|
|
|
9
9
|
### read
|
|
10
|
+
|
|
10
11
|
Reads file contents from the filesystem.
|
|
11
12
|
|
|
12
13
|
**Status:** ✅ Fully supported and tested
|
|
13
14
|
**Test:** [tests/read.tools.test.js](tests/read.tools.test.js)
|
|
14
15
|
|
|
15
16
|
### write
|
|
17
|
+
|
|
16
18
|
Writes content to files in the filesystem.
|
|
17
19
|
|
|
18
20
|
**Status:** ✅ Fully supported and tested
|
|
19
21
|
**Test:** [tests/write.tools.test.js](tests/write.tools.test.js)
|
|
20
22
|
|
|
21
23
|
### edit
|
|
24
|
+
|
|
22
25
|
Performs exact string replacements in files.
|
|
23
26
|
|
|
24
27
|
**Status:** ✅ Fully supported and tested
|
|
25
28
|
**Test:** [tests/edit.tools.test.js](tests/edit.tools.test.js)
|
|
26
29
|
|
|
27
30
|
### list (ls)
|
|
31
|
+
|
|
28
32
|
Lists files and directories.
|
|
29
33
|
|
|
30
34
|
**Status:** ✅ Fully supported and tested
|
|
@@ -33,18 +37,21 @@ Lists files and directories.
|
|
|
33
37
|
## Search Tools
|
|
34
38
|
|
|
35
39
|
### glob
|
|
40
|
+
|
|
36
41
|
Fast file pattern matching tool that works with any codebase size. Supports glob patterns like `**/*.js` or `src/**/*.ts`.
|
|
37
42
|
|
|
38
43
|
**Status:** ✅ Fully supported and tested
|
|
39
44
|
**Test:** [tests/glob.tools.test.js](tests/glob.tools.test.js)
|
|
40
45
|
|
|
41
46
|
### grep
|
|
47
|
+
|
|
42
48
|
Powerful search tool built on ripgrep. Supports full regex syntax and can filter by file type or glob pattern.
|
|
43
49
|
|
|
44
50
|
**Status:** ✅ Fully supported and tested
|
|
45
51
|
**Test:** [tests/grep.tools.test.js](tests/grep.tools.test.js)
|
|
46
52
|
|
|
47
53
|
### websearch
|
|
54
|
+
|
|
48
55
|
Searches the web using Exa API for current information. Always enabled, no environment variables required.
|
|
49
56
|
|
|
50
57
|
**Status:** ✅ Fully supported and tested
|
|
@@ -52,6 +59,7 @@ Searches the web using Exa API for current information. Always enabled, no envir
|
|
|
52
59
|
**OpenCode Compatibility:** ✅ 100% compatible
|
|
53
60
|
|
|
54
61
|
### codesearch
|
|
62
|
+
|
|
55
63
|
Searches code repositories and documentation using Exa API. Always enabled.
|
|
56
64
|
|
|
57
65
|
**Status:** ✅ Fully supported and tested
|
|
@@ -61,18 +69,21 @@ Searches code repositories and documentation using Exa API. Always enabled.
|
|
|
61
69
|
## Execution Tools
|
|
62
70
|
|
|
63
71
|
### bash
|
|
72
|
+
|
|
64
73
|
Executes bash commands in a persistent shell session with optional timeout.
|
|
65
74
|
|
|
66
75
|
**Status:** ✅ Fully supported and tested
|
|
67
76
|
**Test:** [tests/bash.tools.test.js](tests/bash.tools.test.js)
|
|
68
77
|
|
|
69
78
|
### batch
|
|
79
|
+
|
|
70
80
|
Batches multiple tool calls together for optimal performance. Executes multiple tools in a single operation. Always enabled.
|
|
71
81
|
|
|
72
82
|
**Status:** ✅ Fully supported and tested
|
|
73
83
|
**Test:** [tests/batch.tools.test.js](tests/batch.tools.test.js)
|
|
74
84
|
|
|
75
85
|
### task
|
|
86
|
+
|
|
76
87
|
Launches specialized agents to handle complex, multi-step tasks autonomously.
|
|
77
88
|
|
|
78
89
|
**Status:** ✅ Fully supported and tested
|
|
@@ -81,12 +92,14 @@ Launches specialized agents to handle complex, multi-step tasks autonomously.
|
|
|
81
92
|
## Utility Tools
|
|
82
93
|
|
|
83
94
|
### todo (todowrite/todoread)
|
|
95
|
+
|
|
84
96
|
Reads and writes TODO items for task tracking during execution.
|
|
85
97
|
|
|
86
98
|
**Status:** ✅ Fully supported and tested
|
|
87
99
|
**Test:** [tests/todo.tools.test.js](tests/todo.tools.test.js)
|
|
88
100
|
|
|
89
101
|
### webfetch
|
|
102
|
+
|
|
90
103
|
Fetches content from a specified URL and processes it using an AI model.
|
|
91
104
|
|
|
92
105
|
**Status:** ✅ Fully supported and tested
|
|
@@ -95,18 +108,22 @@ Fetches content from a specified URL and processes it using an AI model.
|
|
|
95
108
|
## Testing
|
|
96
109
|
|
|
97
110
|
### Run All Tool Tests
|
|
111
|
+
|
|
98
112
|
```bash
|
|
99
113
|
bun test tests/*.tools.test.js
|
|
100
114
|
```
|
|
101
115
|
|
|
102
116
|
### Run Specific Tool Test
|
|
117
|
+
|
|
103
118
|
```bash
|
|
104
119
|
bun test tests/bash.tools.test.js
|
|
105
120
|
bun test tests/websearch.tools.test.js
|
|
106
121
|
```
|
|
107
122
|
|
|
108
123
|
### Test Coverage
|
|
124
|
+
|
|
109
125
|
Each tool test verifies:
|
|
126
|
+
|
|
110
127
|
- ✅ Correct JSON output structure
|
|
111
128
|
- ✅ OpenCode compatibility (where applicable)
|
|
112
129
|
- ✅ Proper input/output handling
|
|
@@ -115,16 +132,19 @@ Each tool test verifies:
|
|
|
115
132
|
## Key Features
|
|
116
133
|
|
|
117
134
|
### No Configuration Required
|
|
135
|
+
|
|
118
136
|
- All tools work without environment variables or configuration files
|
|
119
137
|
- WebSearch and CodeSearch work without `OPENCODE_EXPERIMENTAL_EXA`
|
|
120
138
|
- Batch tool is always enabled, no experimental flag needed
|
|
121
139
|
|
|
122
140
|
### OpenCode Compatible
|
|
141
|
+
|
|
123
142
|
- All tools produce JSON output compatible with OpenCode's format
|
|
124
143
|
- WebSearch and CodeSearch tools are 100% compatible with OpenCode output
|
|
125
144
|
- Tool event structure matches OpenCode specifications
|
|
126
145
|
|
|
127
146
|
### Plain Text Input Support
|
|
147
|
+
|
|
128
148
|
`@link-assistant/agent` also accepts plain text input (not just JSON):
|
|
129
149
|
|
|
130
150
|
```bash
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@link-assistant/agent",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.11",
|
|
4
4
|
"description": "A minimal, public domain AI CLI agent compatible with OpenCode's JSON interface. Bun-only runtime.",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -8,7 +8,19 @@
|
|
|
8
8
|
"agent": "./src/index.js"
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
|
-
"dev": "bun run src/index.js"
|
|
11
|
+
"dev": "bun run src/index.js",
|
|
12
|
+
"test": "bun test",
|
|
13
|
+
"lint": "eslint .",
|
|
14
|
+
"lint:fix": "eslint . --fix",
|
|
15
|
+
"format": "prettier --write .",
|
|
16
|
+
"format:check": "prettier --check .",
|
|
17
|
+
"check:file-size": "node scripts/check-file-size.mjs",
|
|
18
|
+
"check": "npm run lint && npm run format:check && npm run check:file-size",
|
|
19
|
+
"prepare": "husky || true",
|
|
20
|
+
"changeset": "changeset",
|
|
21
|
+
"changeset:version": "node scripts/changeset-version.mjs",
|
|
22
|
+
"changeset:publish": "changeset publish",
|
|
23
|
+
"changeset:status": "changeset status --since=origin/main"
|
|
12
24
|
},
|
|
13
25
|
"engines": {
|
|
14
26
|
"bun": ">=1.0.0"
|
|
@@ -43,6 +55,7 @@
|
|
|
43
55
|
"@agentclientprotocol/sdk": "^0.5.1",
|
|
44
56
|
"@ai-sdk/mcp": "^0.0.8",
|
|
45
57
|
"@ai-sdk/xai": "^2.0.33",
|
|
58
|
+
"@clack/prompts": "^0.11.0",
|
|
46
59
|
"@hono/standard-validator": "^0.2.0",
|
|
47
60
|
"@hono/zod-validator": "^0.7.5",
|
|
48
61
|
"@modelcontextprotocol/sdk": "^1.22.0",
|
|
@@ -85,5 +98,26 @@
|
|
|
85
98
|
"yargs": "^18.0.0",
|
|
86
99
|
"zod": "^4.1.12"
|
|
87
100
|
},
|
|
101
|
+
"devDependencies": {
|
|
102
|
+
"@changesets/cli": "^2.29.7",
|
|
103
|
+
"@eslint/js": "^9.18.0",
|
|
104
|
+
"eslint": "^9.38.0",
|
|
105
|
+
"eslint-config-prettier": "^10.1.8",
|
|
106
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
107
|
+
"husky": "^9.1.7",
|
|
108
|
+
"lint-staged": "^16.2.6",
|
|
109
|
+
"prettier": "^3.6.2"
|
|
110
|
+
},
|
|
111
|
+
"lint-staged": {
|
|
112
|
+
"*.{js,mjs,cjs}": [
|
|
113
|
+
"eslint --fix --max-warnings 0",
|
|
114
|
+
"prettier --write",
|
|
115
|
+
"prettier --check"
|
|
116
|
+
],
|
|
117
|
+
"*.md": [
|
|
118
|
+
"prettier --write",
|
|
119
|
+
"prettier --check"
|
|
120
|
+
]
|
|
121
|
+
},
|
|
88
122
|
"license": "Unlicense"
|
|
89
123
|
}
|