@qwen-code/arena-agent 0.0.7-preview.0 → 0.0.8-dev.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/.env.example +15 -5
  2. package/README.md +127 -16
  3. package/dist/agent.d.ts +23 -4
  4. package/dist/agent.js +287 -95
  5. package/dist/agent.js.map +1 -1
  6. package/dist/anthropic.d.ts +16 -0
  7. package/dist/anthropic.js +391 -0
  8. package/dist/anthropic.js.map +1 -0
  9. package/dist/attachments.d.ts +29 -0
  10. package/dist/attachments.js +222 -0
  11. package/dist/attachments.js.map +1 -0
  12. package/dist/canonical-data.d.ts +2 -0
  13. package/dist/canonical-data.js +4 -0
  14. package/dist/canonical-data.js.map +1 -0
  15. package/dist/cli.js +55 -13
  16. package/dist/cli.js.map +1 -1
  17. package/dist/compaction.d.ts +16 -0
  18. package/dist/compaction.js +183 -0
  19. package/dist/compaction.js.map +1 -0
  20. package/dist/config.d.ts +6 -1
  21. package/dist/config.js +28 -2
  22. package/dist/config.js.map +1 -1
  23. package/dist/history.d.ts +3 -3
  24. package/dist/history.js +4 -4
  25. package/dist/history.js.map +1 -1
  26. package/dist/index.d.ts +9 -0
  27. package/dist/index.js +9 -0
  28. package/dist/index.js.map +1 -0
  29. package/dist/mock.js +24 -1
  30. package/dist/mock.js.map +1 -1
  31. package/dist/protocol.d.ts +5 -2
  32. package/dist/protocol.js +20 -1
  33. package/dist/protocol.js.map +1 -1
  34. package/dist/provider.d.ts +4 -0
  35. package/dist/provider.js +163 -4
  36. package/dist/provider.js.map +1 -1
  37. package/dist/repo.js +2 -5
  38. package/dist/repo.js.map +1 -1
  39. package/dist/server.js +9 -174
  40. package/dist/server.js.map +1 -1
  41. package/dist/spec.d.ts +7 -9
  42. package/dist/spec.js +128 -27
  43. package/dist/spec.js.map +1 -1
  44. package/dist/tools.d.ts +13 -3
  45. package/dist/tools.js +289 -29
  46. package/dist/tools.js.map +1 -1
  47. package/dist/tui.js +48 -12
  48. package/dist/tui.js.map +1 -1
  49. package/dist/types.d.ts +26 -9
  50. package/dist/web/app.js +2 -3
  51. package/dist/web/app.js.map +1 -1
  52. package/package.json +22 -8
  53. package/spec/tools.json +0 -418
package/spec/tools.json DELETED
@@ -1,418 +0,0 @@
1
- {
2
- "incremental_output": true,
3
- "max_tokens": 131072,
4
- "temperature": 1,
5
- "tools": [
6
- {
7
- "type": "function",
8
- "function": {
9
- "name": "bash",
10
- "description": "Run a bash command in the sandboxed workspace. Commands run in the provided cwd, defaulting to the workspace root /home/user, without a controlling terminal and with stdin closed. Working directory changes, shell variables, aliases, functions, history, exported environment changes, and background process state are not preserved across calls. Only files inside the workspace root (/home/user) are captured in persisted snapshots; files written outside that root are not persisted. The following directory names are excluded from snapshots and will not persist: .arena, .cache, .mypy_cache, .next, .nox, .npm, .nuxt, .output, .parcel-cache, .pytest_cache, .ruff_cache, .svelte-kit, .tox, .turbo, .venv, .vite, __pycache__, build, coverage, dist, node_modules, out, target. Sensitive credential paths are also excluded from snapshots: .git/config, .git/credentials, .git-credentials, .netrc.",
11
- "parameters": {
12
- "$schema": "http://json-schema.org/draft-07/schema#",
13
- "type": "object",
14
- "properties": {
15
- "command": {
16
- "description": "The bash command to execute.",
17
- "type": "string",
18
- "maxLength": 64000
19
- },
20
- "cwd": {
21
- "description": "Working directory for this command. Defaults to /home/user.",
22
- "default": "/home/user",
23
- "type": "string",
24
- "minLength": 1
25
- },
26
- "timeout": {
27
- "description": "Maximum seconds before the command is terminated. Default 30, max 1800.",
28
- "default": 30,
29
- "type": "integer",
30
- "minimum": 1,
31
- "maximum": 1800
32
- }
33
- },
34
- "required": [
35
- "command"
36
- ],
37
- "additionalProperties": false
38
- }
39
- }
40
- },
41
- {
42
- "type": "function",
43
- "function": {
44
- "name": "ask_user",
45
- "description": "Surfaces an UI component to the user with the purpose of asking clarifying questions with predefined options. Each question supports 2-4 predefined options plus an optional free-text input. Use this to help resolve important ambiguities and questions that impede the succesful completion of the given task.",
46
- "parameters": {
47
- "$schema": "http://json-schema.org/draft-07/schema#",
48
- "type": "object",
49
- "properties": {
50
- "questions": {
51
- "description": "List of questions to ask the user. Try to keep this to 4 or fewer questions.",
52
- "minItems": 1,
53
- "maxItems": 6,
54
- "type": "array",
55
- "items": {
56
- "type": "object",
57
- "properties": {
58
- "id": {
59
- "description": "Unique question identifier",
60
- "type": "string",
61
- "minLength": 1
62
- },
63
- "question": {
64
- "description": "The question text to display",
65
- "type": "string",
66
- "minLength": 1
67
- },
68
- "options": {
69
- "description": "List of options to choose from. Try to keep this to 4 or fewer options.",
70
- "minItems": 2,
71
- "maxItems": 6,
72
- "type": "array",
73
- "items": {
74
- "type": "object",
75
- "properties": {
76
- "id": {
77
- "description": "Unique option identifier",
78
- "type": "string",
79
- "minLength": 1
80
- },
81
- "label": {
82
- "description": "Short option title",
83
- "type": "string",
84
- "minLength": 1
85
- },
86
- "description": {
87
- "description": "Longer explanation",
88
- "type": "string"
89
- }
90
- },
91
- "required": [
92
- "id",
93
- "label"
94
- ],
95
- "additionalProperties": false
96
- }
97
- },
98
- "allowCustomResponse": {
99
- "description": "Whether the user can write a custom response",
100
- "default": true,
101
- "type": "boolean"
102
- }
103
- },
104
- "required": [
105
- "id",
106
- "question",
107
- "options"
108
- ],
109
- "additionalProperties": false
110
- }
111
- }
112
- },
113
- "required": [
114
- "questions"
115
- ],
116
- "additionalProperties": false
117
- }
118
- }
119
- },
120
- {
121
- "type": "function",
122
- "function": {
123
- "name": "edit_file",
124
- "description": "Edit an existing file by searching for text and replacing it. Uses fuzzy matching that tolerates whitespace and indentation differences.",
125
- "parameters": {
126
- "$schema": "http://json-schema.org/draft-07/schema#",
127
- "type": "object",
128
- "properties": {
129
- "path": {
130
- "description": "File path: an absolute path (e.g. '/home/user/notes.txt'), or a path relative to the working directory (e.g. 'notes.txt', 'src/app.js'). '~/' refers to the home directory.",
131
- "type": "string"
132
- },
133
- "old_text": {
134
- "description": "The text to find in the file. Uses fuzzy matching that tolerates whitespace and indentation differences. Only the first match is replaced.",
135
- "type": "string",
136
- "minLength": 1
137
- },
138
- "new_text": {
139
- "description": "The replacement text. Use an empty string to delete the matched text.",
140
- "type": "string"
141
- }
142
- },
143
- "required": [
144
- "path",
145
- "old_text",
146
- "new_text"
147
- ],
148
- "additionalProperties": false
149
- }
150
- }
151
- },
152
- {
153
- "type": "function",
154
- "function": {
155
- "name": "read_file",
156
- "description": "Read a file from the workspace. Text files and PDF/Word/PowerPoint/Excel documents return extracted content. Images (jpg, png, webp, gif, bmp) return as visible content. Other binary types return metadata only. Legacy .doc/.ppt/.xls extraction requires LibreOffice.",
157
- "parameters": {
158
- "$schema": "http://json-schema.org/draft-07/schema#",
159
- "type": "object",
160
- "properties": {
161
- "path": {
162
- "description": "File path: an absolute path (e.g. '/home/user/notes.txt'), or a path relative to the working directory (e.g. 'notes.txt', 'images/dog.jpg'). '~/' refers to the home directory.",
163
- "type": "string"
164
- }
165
- },
166
- "required": [
167
- "path"
168
- ],
169
- "additionalProperties": false
170
- }
171
- }
172
- },
173
- {
174
- "type": "function",
175
- "function": {
176
- "name": "fetch_page",
177
- "description": "Retrieve the text content of a web page as markdown. Content may be returned in chunks. If hasMore is true, call again with the same url and the next chunkIndex to continue reading. PDFs are parsed up to 30 pages; content beyond that won't be returned.",
178
- "parameters": {
179
- "$schema": "http://json-schema.org/draft-07/schema#",
180
- "type": "object",
181
- "properties": {
182
- "url": {
183
- "description": "The URL of the page to fetch",
184
- "type": "string",
185
- "format": "uri"
186
- },
187
- "chunkIndex": {
188
- "description": "Which chunk to return (0-indexed). Omit or pass 0 for the first chunk.",
189
- "default": 0,
190
- "type": "integer",
191
- "minimum": 0,
192
- "maximum": 9007199254740991
193
- }
194
- },
195
- "required": [
196
- "url"
197
- ],
198
- "additionalProperties": false
199
- }
200
- }
201
- },
202
- {
203
- "type": "function",
204
- "function": {
205
- "name": "web_search",
206
- "description": "Search the web for current information. Returns relevant results with titles, URLs, and content snippets. Use when you need facts, recent events, or information beyond your training data. When citing results, use the result's numeric id and url in this exact format: [id](url). For example, if a result has id=1 and url=https://example.com, cite it as [1](https://example.com). Do NOT use [source](url) or any other format. Every claim from search results must have a citation.",
207
- "parameters": {
208
- "$schema": "http://json-schema.org/draft-07/schema#",
209
- "type": "object",
210
- "properties": {
211
- "query": {
212
- "description": "The search query",
213
- "type": "string",
214
- "minLength": 1,
215
- "maxLength": 400
216
- },
217
- "depth": {
218
- "description": "The search tool accepts a depth parameter (1, 2, or 3) that controls how many results are fetched and how much content is extracted from each. At depth 1, fewer results are retrieved with shorter excerpts. At depth 3, more results are retrieved with longer, more detailed excerpts per source. Depth 2 falls between the two. Higher depth consumes more of the context window.",
219
- "type": "string",
220
- "enum": [
221
- "1",
222
- "2",
223
- "3"
224
- ]
225
- }
226
- },
227
- "required": [
228
- "query",
229
- "depth"
230
- ],
231
- "additionalProperties": false
232
- }
233
- }
234
- },
235
- {
236
- "type": "function",
237
- "function": {
238
- "name": "write_file",
239
- "description": "Create or overwrite a file in the workspace. Provide the full file content.",
240
- "parameters": {
241
- "$schema": "http://json-schema.org/draft-07/schema#",
242
- "type": "object",
243
- "properties": {
244
- "path": {
245
- "description": "File path: an absolute path (e.g. '/home/user/notes.txt'), or a path relative to the working directory (e.g. 'notes.txt', 'src/app.js'). '~/' refers to the home directory. Parent directories are created as needed.",
246
- "type": "string"
247
- },
248
- "content": {
249
- "description": "The full file content to write",
250
- "type": "string"
251
- }
252
- },
253
- "required": [
254
- "path",
255
- "content"
256
- ],
257
- "additionalProperties": false
258
- }
259
- }
260
- },
261
- {
262
- "type": "function",
263
- "function": {
264
- "name": "image_search",
265
- "description": "Search the web for images and save them to the workspace. Each result is written to a file path; call read_file on that path to view the image.",
266
- "parameters": {
267
- "$schema": "http://json-schema.org/draft-07/schema#",
268
- "type": "object",
269
- "properties": {
270
- "query": {
271
- "description": "The query to use for image search",
272
- "type": "string",
273
- "minLength": 1,
274
- "maxLength": 400
275
- },
276
- "count": {
277
- "description": "How many images to pull into the workspace (1-5).",
278
- "type": "integer",
279
- "minimum": 1,
280
- "maximum": 5
281
- }
282
- },
283
- "required": [
284
- "query",
285
- "count"
286
- ],
287
- "additionalProperties": false
288
- }
289
- }
290
- },
291
- {
292
- "type": "function",
293
- "function": {
294
- "name": "present_file",
295
- "description": "Open a workspace file in the user's viewer so it's in front of them instead of something they have to go find. Present the deliverable when you finish making it such as but not limited to — the document, image, or result the user asked for. Don't present files they didn't ask about, or intermediate and scratch files made along the way. The viewer shows one file at a time: open the main deliverable and mention any others by name.",
296
- "parameters": {
297
- "$schema": "http://json-schema.org/draft-07/schema#",
298
- "type": "object",
299
- "properties": {
300
- "path": {
301
- "description": "Path of an existing workspace file to open in the user's file viewer: an absolute path (e.g. '/home/user/report.md') or a path relative to the working directory (e.g. 'report.md'). '~/' refers to the home directory.",
302
- "type": "string"
303
- }
304
- },
305
- "required": [
306
- "path"
307
- ],
308
- "additionalProperties": false
309
- }
310
- }
311
- },
312
- {
313
- "type": "function",
314
- "function": {
315
- "name": "generate_image",
316
- "description": "Generate a new image or edit existing images, saving the result to the workspace. The output is always AI-generated imagery produced by an image model, even when editing a real input image. The image is saved to the specified file path, which must end in .jpg, .jpeg, or .png. To edit, restyle, or combine existing images, pass their workspace paths in `images` and describe the change in `prompt`; omit `images` for text-to-image generation. Referenced images must already exist in the workspace.",
317
- "parameters": {
318
- "$schema": "http://json-schema.org/draft-07/schema#",
319
- "type": "object",
320
- "properties": {
321
- "file_path": {
322
- "description": "Path to save the generated image: an absolute path (e.g. '/home/user/images/hero.jpg') or a path relative to the working directory (e.g. 'images/hero.jpg'). '~/' refers to the home directory. Parent directories are created as needed. Must end in .jpg, .jpeg, or .png.",
323
- "type": "string"
324
- },
325
- "prompt": {
326
- "description": "Text prompt describing the image to generate",
327
- "type": "string"
328
- },
329
- "images": {
330
- "description": "Optional paths to existing images to edit or use as reference: absolute, relative to the working directory, or '~/'-prefixed (e.g. ['images/cat.png', '/home/user/photo.png', '~/ref.png']). Omit for text-to-image generation.",
331
- "maxItems": 10,
332
- "type": "array",
333
- "items": {
334
- "type": "string"
335
- }
336
- }
337
- },
338
- "required": [
339
- "file_path",
340
- "prompt"
341
- ],
342
- "additionalProperties": false
343
- }
344
- }
345
- },
346
- {
347
- "type": "function",
348
- "function": {
349
- "name": "generate_speech",
350
- "description": "Synthesize spoken audio from `text` and save it to the workspace (the file path's extension sets the format). Use when the user wants narration, a voiceover, or any text read aloud. It produces spoken-word audio only — it cannot sing or produce melodic/musical output; if asked to sing, synthesize the text anyway but first warn the user the result will be spoken, not sung. The voice is determined solely by (`language`, `gender`, `use_case`, `index`) — identical attributes yield the same voice regardless of `text`, so a multi-part narration stays consistent across calls; to change the voice (e.g. the user asks for \"another voice\"), vary `index`. A region subtag in `language` requests a specific accent and is a hard constraint: when this session's voice model doesn't support that exact region the call fails — retry with the bare language tag (e.g. `en` instead of `en-GB`). Speaking rate depends on language (English averages ~800-900 characters/minute, so ~1500 English characters is roughly 1.75 minutes); budget longer text against the per-call character limit. For longer text — or to cut user-perceived latency on medium-length text — split it at sentence boundaries and issue the calls in parallel so chunks synthesize concurrently. You can generate at most 10 clips per turn (the cap resets next turn); if the request needs more than fits, generate the most important parts now and tell the user the remainder will continue in later turns.",
351
- "parameters": {
352
- "$schema": "http://json-schema.org/draft-07/schema#",
353
- "type": "object",
354
- "properties": {
355
- "file_path": {
356
- "description": "Path to save the audio: an absolute path (e.g. '/home/user/audio/narration.mp3') or a path relative to the working directory (e.g. 'audio/narration.mp3'). '~/' refers to the home directory. Parent directories are created as needed. Must end in a supported audio extension (.mp3, .wav, .ogg, .opus, .flac, .aac, .m4a, .aiff).",
357
- "type": "string"
358
- },
359
- "text": {
360
- "description": "The text to speak, up to 1500 characters per call. Plain words only — no SSML, markup, or bracketed tags.",
361
- "type": "string",
362
- "minLength": 1,
363
- "maxLength": 1500
364
- },
365
- "language": {
366
- "description": "BCP-47 language tag matching `text`. Required. Add a region subtag to request an accent/dialect (e.g. 'en' generic, 'en-GB' British, 'es-MX' Mexican Spanish, 'pt-BR'). A requested accent is a hard constraint: if this session's voice model doesn't support that exact region, the call fails — retry with the bare language tag.",
367
- "type": "string"
368
- },
369
- "voice_identity": {
370
- "description": "Optional attributes describing which voice to use.",
371
- "type": "object",
372
- "properties": {
373
- "gender": {
374
- "description": "Voice gender. Specify when the content implies one (e.g. a named character); omit only when indifferent.",
375
- "type": "string",
376
- "enum": [
377
- "feminine",
378
- "masculine"
379
- ]
380
- },
381
- "use_case": {
382
- "description": "Intended use, to bias the voice choice.",
383
- "type": "string",
384
- "enum": [
385
- "narration",
386
- "conversational",
387
- "advertising",
388
- "entertainment",
389
- "educational",
390
- "characters"
391
- ]
392
- },
393
- "index": {
394
- "description": "0-based index (default 0) selecting among the voices that match the other attributes; the order is fixed per session, so a given index always maps to the same voice. Increment it to switch to a different voice (e.g. when the user asks for another); it wraps past the last match.",
395
- "type": "integer",
396
- "minimum": 0,
397
- "maximum": 9007199254740991
398
- }
399
- },
400
- "additionalProperties": false
401
- }
402
- },
403
- "required": [
404
- "file_path",
405
- "text",
406
- "language"
407
- ],
408
- "additionalProperties": false
409
- }
410
- }
411
- }
412
- ],
413
- "result_format": "message",
414
- "enable_thinking": true,
415
- "thinking_budget": 81920,
416
- "preserve_thinking": true,
417
- "tool_choice": "auto"
418
- }