@qwen-code/arena-agent 0.0.9-dev.1 → 0.0.9-dev.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.
Files changed (92) hide show
  1. package/.env.example +29 -0
  2. package/README.md +126 -11
  3. package/dist/agent.d.ts +4 -2
  4. package/dist/agent.js +116 -15
  5. package/dist/agent.js.map +1 -1
  6. package/dist/ask-user.d.ts +20 -0
  7. package/dist/ask-user.js +388 -0
  8. package/dist/ask-user.js.map +1 -0
  9. package/dist/canonical-data.d.ts +1 -0
  10. package/dist/canonical-data.js +1 -0
  11. package/dist/canonical-data.js.map +1 -1
  12. package/dist/cli.js +29 -10
  13. package/dist/cli.js.map +1 -1
  14. package/dist/code-cli.d.ts +2 -0
  15. package/dist/code-cli.js +12 -0
  16. package/dist/code-cli.js.map +1 -0
  17. package/dist/code-tools.d.ts +73 -0
  18. package/dist/code-tools.js +2106 -0
  19. package/dist/code-tools.js.map +1 -0
  20. package/dist/config.d.ts +12 -1
  21. package/dist/config.js +66 -3
  22. package/dist/config.js.map +1 -1
  23. package/dist/document-reader.js +9 -0
  24. package/dist/document-reader.js.map +1 -1
  25. package/dist/fetch-page.d.ts +2 -0
  26. package/dist/fetch-page.js +50 -21
  27. package/dist/fetch-page.js.map +1 -1
  28. package/dist/history.d.ts +3 -0
  29. package/dist/history.js +4 -0
  30. package/dist/history.js.map +1 -1
  31. package/dist/mode.d.ts +6 -0
  32. package/dist/mode.js +33 -0
  33. package/dist/mode.js.map +1 -0
  34. package/dist/model-capabilities.d.ts +20 -0
  35. package/dist/model-capabilities.js +98 -0
  36. package/dist/model-capabilities.js.map +1 -0
  37. package/dist/model-diagnostics.d.ts +32 -0
  38. package/dist/model-diagnostics.js +365 -0
  39. package/dist/model-diagnostics.js.map +1 -0
  40. package/dist/provider.d.ts +16 -0
  41. package/dist/provider.js +328 -37
  42. package/dist/provider.js.map +1 -1
  43. package/dist/sdk.d.ts +26 -1
  44. package/dist/sdk.js +1 -0
  45. package/dist/sdk.js.map +1 -1
  46. package/dist/server.d.ts +2 -0
  47. package/dist/server.js +11 -2
  48. package/dist/server.js.map +1 -1
  49. package/dist/spec.d.ts +11 -8
  50. package/dist/spec.js +105 -13
  51. package/dist/spec.js.map +1 -1
  52. package/dist/tools.d.ts +11 -28
  53. package/dist/tools.js +60 -11
  54. package/dist/tools.js.map +1 -1
  55. package/dist/tui.d.ts +2 -0
  56. package/dist/tui.js +8 -2
  57. package/dist/tui.js.map +1 -1
  58. package/dist/types.d.ts +6 -1
  59. package/dist/workspace.d.ts +12 -0
  60. package/dist/workspace.js +165 -0
  61. package/dist/workspace.js.map +1 -0
  62. package/docs/BINARY_DISTRIBUTION.md +225 -0
  63. package/docs/MODES_AND_RELEASES.md +119 -0
  64. package/modes/code-arena/full-stack/system-prompt.txt +77 -0
  65. package/modes/code-arena/full-stack/template/.env +1 -0
  66. package/modes/code-arena/full-stack/template/drizzle.config.json +7 -0
  67. package/modes/code-arena/full-stack/template/eslint.config.mjs +9 -0
  68. package/modes/code-arena/full-stack/template/next.config.ts +5 -0
  69. package/modes/code-arena/full-stack/template/package.json +32 -0
  70. package/modes/code-arena/full-stack/template/postcss.config.mjs +7 -0
  71. package/modes/code-arena/full-stack/template/src/app/api/health/route.ts +13 -0
  72. package/modes/code-arena/full-stack/template/src/app/globals.css +1 -0
  73. package/modes/code-arena/full-stack/template/src/app/layout.tsx +16 -0
  74. package/modes/code-arena/full-stack/template/src/app/page.tsx +22 -0
  75. package/modes/code-arena/full-stack/template/src/db/index.ts +24 -0
  76. package/modes/code-arena/full-stack/template/src/db/schema.ts +3 -0
  77. package/modes/code-arena/full-stack/template/tsconfig.json +24 -0
  78. package/modes/code-arena/full-stack/tools.json +446 -0
  79. package/modes/code-arena/html/system-prompt.txt +36 -0
  80. package/modes/code-arena/html/tools.json +284 -0
  81. package/modes/code-arena/model.json +10 -0
  82. package/modes/code-arena/react/system-prompt.txt +33 -0
  83. package/modes/code-arena/react/template/index.html +12 -0
  84. package/modes/code-arena/react/template/package.json +28 -0
  85. package/modes/code-arena/react/template/src/App.tsx +28 -0
  86. package/modes/code-arena/react/template/src/index.css +1 -0
  87. package/modes/code-arena/react/template/src/main.tsx +10 -0
  88. package/modes/code-arena/react/template/src/utils/cn.ts +6 -0
  89. package/modes/code-arena/react/template/tsconfig.json +25 -0
  90. package/modes/code-arena/react/template/vite.config.ts +18 -0
  91. package/modes/code-arena/react/tools.json +410 -0
  92. package/package.json +18 -3
@@ -0,0 +1,410 @@
1
+ [
2
+ {
3
+ "type": "function",
4
+ "function": {
5
+ "name": "read_file",
6
+ "description": "Read the content of an existing file with line numbers. For large files, use `offset` (1-indexed start line) and `limit` (max lines, default 2000) to read specific ranges. Cannot read binary files (images, fonts, audio, video, archives, etc.) — only text files are supported.\n",
7
+ "parameters": {
8
+ "type": "object",
9
+ "properties": {
10
+ "path": {
11
+ "type": "string",
12
+ "description": "File path relative to project root (for example, 'index.html')"
13
+ },
14
+ "offset": {
15
+ "type": "integer",
16
+ "minimum": 1,
17
+ "description": "Line number to start reading from (1-indexed, default: 1)"
18
+ },
19
+ "limit": {
20
+ "type": "integer",
21
+ "minimum": 1,
22
+ "description": "Maximum number of lines to read (default: 2000)"
23
+ }
24
+ },
25
+ "required": [
26
+ "path",
27
+ "offset",
28
+ "limit"
29
+ ],
30
+ "additionalProperties": false
31
+ }
32
+ }
33
+ },
34
+ {
35
+ "type": "function",
36
+ "function": {
37
+ "name": "create_file",
38
+ "description": "Create a new file or overwrite an existing file in the project with the provided content. The file extension should match the type of file you want to create (e.g., 'index.html' for HTML files). If the file already exists, its content will be completely replaced.\n",
39
+ "parameters": {
40
+ "type": "object",
41
+ "properties": {
42
+ "path": {
43
+ "type": "string",
44
+ "description": "File path relative to project root (for example, 'index.html')"
45
+ },
46
+ "content": {
47
+ "type": "string",
48
+ "description": "The complete content of the file"
49
+ }
50
+ },
51
+ "required": [
52
+ "path",
53
+ "content"
54
+ ],
55
+ "additionalProperties": false
56
+ }
57
+ }
58
+ },
59
+ {
60
+ "type": "function",
61
+ "function": {
62
+ "name": "edit_file",
63
+ "description": "Replace a section of content in a file. Uses fuzzy matching that ignores whitespace and indentation differences, so the context doesn't need to match exactly. This will fail if 'context' matches multiple sections in the file.\n",
64
+ "parameters": {
65
+ "type": "object",
66
+ "properties": {
67
+ "path": {
68
+ "type": "string",
69
+ "description": "File path relative to project root (for example, 'index.html')"
70
+ },
71
+ "context": {
72
+ "type": "string",
73
+ "description": "The text in the file to replace. Uses fuzzy matching that ignores whitespace and indentation differences, so it doesn't need to match exactly. Only the first occurrence will be replaced."
74
+ },
75
+ "replacement": {
76
+ "type": "string",
77
+ "description": "The new text to replace the matched context with. This will be inserted exactly where the context was found."
78
+ }
79
+ },
80
+ "required": [
81
+ "path",
82
+ "context",
83
+ "replacement"
84
+ ],
85
+ "additionalProperties": false
86
+ }
87
+ }
88
+ },
89
+ {
90
+ "type": "function",
91
+ "function": {
92
+ "name": "delete_file",
93
+ "description": "Delete a file from the project.\n",
94
+ "parameters": {
95
+ "type": "object",
96
+ "properties": {
97
+ "path": {
98
+ "type": "string",
99
+ "description": "File path relative to project root (for example, 'index.html')"
100
+ }
101
+ },
102
+ "required": [
103
+ "path"
104
+ ],
105
+ "additionalProperties": false
106
+ }
107
+ }
108
+ },
109
+ {
110
+ "type": "function",
111
+ "function": {
112
+ "name": "list_files",
113
+ "description": "List file paths in the project. If no path is provided, lists all files from the project root. You can optionally provide a relative path to list files within a specific directory. You should generally prefer the glob_files and grep_files tools if you know which directories or patterns to search for.\n",
114
+ "parameters": {
115
+ "type": "object",
116
+ "properties": {
117
+ "path": {
118
+ "type": "string",
119
+ "description": "The directory to list, relative to project root. Defaults to the project root."
120
+ }
121
+ },
122
+ "additionalProperties": false,
123
+ "required": [
124
+ "path"
125
+ ]
126
+ }
127
+ }
128
+ },
129
+ {
130
+ "type": "function",
131
+ "function": {
132
+ "name": "grep_files",
133
+ "description": "Fast content search tool that searches file contents using regular expressions. Supports full regex syntax (e.g., \"log.*Error\", \"function\\s+\\w+\"). Filter files with the glob parameter (e.g., \"*.js\", \"*.{ts,tsx}\"). Returns matching lines with file paths and line numbers. Results are limited to 100 matches.",
134
+ "parameters": {
135
+ "type": "object",
136
+ "properties": {
137
+ "pattern": {
138
+ "type": "string",
139
+ "description": "The regex pattern to search for in file contents"
140
+ },
141
+ "path": {
142
+ "type": "string",
143
+ "description": "The directory to search in, relative to project root. Defaults to the project root."
144
+ },
145
+ "glob": {
146
+ "type": "string",
147
+ "description": "Glob pattern to filter files (e.g. \"*.js\", \"*.{ts,tsx}\")"
148
+ },
149
+ "output_mode": {
150
+ "type": "string",
151
+ "enum": [
152
+ "content",
153
+ "files_with_matches",
154
+ "count"
155
+ ],
156
+ "description": "Output mode: \"content\" shows matching lines (default), \"files_with_matches\" shows only file paths, \"count\" shows match counts per file."
157
+ },
158
+ "-i": {
159
+ "type": "boolean",
160
+ "description": "Case insensitive search"
161
+ },
162
+ "-B": {
163
+ "type": "integer",
164
+ "minimum": 0,
165
+ "description": "Number of lines to show before each match"
166
+ },
167
+ "-A": {
168
+ "type": "integer",
169
+ "minimum": 0,
170
+ "description": "Number of lines to show after each match"
171
+ },
172
+ "-C": {
173
+ "type": "integer",
174
+ "minimum": 0,
175
+ "description": "Number of lines to show before and after each match"
176
+ },
177
+ "context": {
178
+ "type": "integer",
179
+ "minimum": 0,
180
+ "description": "Alias for -C (context lines before and after)"
181
+ }
182
+ },
183
+ "required": [
184
+ "pattern",
185
+ "path",
186
+ "glob",
187
+ "output_mode",
188
+ "-i",
189
+ "-B",
190
+ "-A",
191
+ "-C",
192
+ "context"
193
+ ],
194
+ "additionalProperties": false
195
+ }
196
+ }
197
+ },
198
+ {
199
+ "type": "function",
200
+ "function": {
201
+ "name": "glob_files",
202
+ "description": "Fast file pattern matching tool. Supports glob patterns like \"**/*.js\" or \"src/**/*.ts\". Returns matching file paths. Use this tool when you need to find files by name or extension patterns. Results are limited to 100 files.",
203
+ "parameters": {
204
+ "type": "object",
205
+ "properties": {
206
+ "pattern": {
207
+ "type": "string",
208
+ "description": "The glob pattern to match files against"
209
+ },
210
+ "path": {
211
+ "type": "string",
212
+ "description": "The directory to search in, relative to project root. Defaults to the project root."
213
+ }
214
+ },
215
+ "required": [
216
+ "pattern",
217
+ "path"
218
+ ],
219
+ "additionalProperties": false
220
+ }
221
+ }
222
+ },
223
+ {
224
+ "type": "function",
225
+ "function": {
226
+ "name": "install_npm_packages",
227
+ "description": "Install npm packages as dependencies. Takes an array of package names and runs 'npm install -S' with those packages.\n",
228
+ "parameters": {
229
+ "type": "object",
230
+ "properties": {
231
+ "packages": {
232
+ "type": "array",
233
+ "items": {
234
+ "type": "string",
235
+ "description": "Package name (e.g., 'react', 'lodash', 'axios@1.0.0')"
236
+ }
237
+ }
238
+ },
239
+ "required": [
240
+ "packages"
241
+ ],
242
+ "additionalProperties": false
243
+ }
244
+ }
245
+ },
246
+ {
247
+ "type": "function",
248
+ "function": {
249
+ "name": "build_project",
250
+ "description": "Build the project using 'npm run build'. Use this to confirm that the project builds successfully.\n",
251
+ "parameters": {
252
+ "type": "object",
253
+ "properties": {},
254
+ "additionalProperties": false,
255
+ "required": []
256
+ }
257
+ }
258
+ },
259
+ {
260
+ "type": "function",
261
+ "function": {
262
+ "name": "web_search",
263
+ "description": "Search the web for current information. Use when you need documentation, API references, examples, or facts beyond your training data. Returns results with titles, URLs, and content snippets. The current year is 2026 — use it when searching for recent information.",
264
+ "parameters": {
265
+ "type": "object",
266
+ "properties": {
267
+ "query": {
268
+ "type": "string",
269
+ "description": "The search query"
270
+ },
271
+ "depth": {
272
+ "type": "string",
273
+ "enum": [
274
+ "1",
275
+ "2",
276
+ "3"
277
+ ],
278
+ "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."
279
+ }
280
+ },
281
+ "required": [
282
+ "query",
283
+ "depth"
284
+ ],
285
+ "additionalProperties": false
286
+ }
287
+ }
288
+ },
289
+ {
290
+ "type": "function",
291
+ "function": {
292
+ "name": "web_fetch",
293
+ "description": "Fetch and read the content of a web page. Use to read documentation, API references, or examples found via web_search. Returns content as markdown by default. Supports format options: \"markdown\" (default), \"text\", or \"html\".",
294
+ "parameters": {
295
+ "type": "object",
296
+ "properties": {
297
+ "url": {
298
+ "type": "string",
299
+ "description": "The URL to fetch content from"
300
+ },
301
+ "format": {
302
+ "type": "string",
303
+ "enum": [
304
+ "markdown",
305
+ "text",
306
+ "html"
307
+ ],
308
+ "description": "Output format: \"markdown\" (default), \"text\", or \"html\""
309
+ }
310
+ },
311
+ "required": [
312
+ "url",
313
+ "format"
314
+ ],
315
+ "additionalProperties": false
316
+ }
317
+ }
318
+ },
319
+ {
320
+ "type": "function",
321
+ "function": {
322
+ "name": "fetch_media",
323
+ "description": "Search for stock photos and videos and return URL-based media assets. Use this when real photography or video is better than AI-generated imagery. Use `recommendedUrl`.\n",
324
+ "parameters": {
325
+ "type": "object",
326
+ "properties": {
327
+ "query": {
328
+ "type": "string",
329
+ "description": "Search query for stock media, such as 'modern office interior' or 'ocean waves'."
330
+ },
331
+ "media_type": {
332
+ "type": "string",
333
+ "enum": [
334
+ "image",
335
+ "video",
336
+ "both"
337
+ ],
338
+ "default": "both",
339
+ "description": "Type of media: \"image\", \"video\", or \"both\". Defaults to \"both\"."
340
+ },
341
+ "count": {
342
+ "type": "number",
343
+ "default": 6,
344
+ "description": "Number of assets to return (1-10). Defaults to 6."
345
+ },
346
+ "orientation": {
347
+ "type": "string",
348
+ "enum": [
349
+ "any",
350
+ "landscape",
351
+ "portrait",
352
+ "square"
353
+ ],
354
+ "default": "any",
355
+ "description": "Desired orientation. Defaults to \"any\"."
356
+ },
357
+ "size": {
358
+ "type": "string",
359
+ "enum": [
360
+ "any",
361
+ "large",
362
+ "medium",
363
+ "small"
364
+ ],
365
+ "default": "any",
366
+ "description": "Minimum media size. Defaults to \"any\"."
367
+ },
368
+ "locale": {
369
+ "type": "string",
370
+ "description": "Search locale, such as \"en-US\". Defaults to \"en-US\"."
371
+ }
372
+ },
373
+ "required": [
374
+ "query",
375
+ "media_type",
376
+ "count",
377
+ "orientation",
378
+ "size",
379
+ "locale"
380
+ ],
381
+ "additionalProperties": false
382
+ }
383
+ }
384
+ },
385
+ {
386
+ "type": "function",
387
+ "function": {
388
+ "name": "generate_image",
389
+ "description": "Generate a custom image using AI and save it to the project. Use this tool when you need to create images for the website such as hero backgrounds, icons, illustrations, or any visual content. The image will be saved at the specified path. Place web-accessible images in the 'public/' directory (e.g., 'public/images/hero.jpg'). Provide a detailed, descriptive prompt for best results. Supported formats: JPG, JPEG, and PNG. You can generate at most 10 images per session — plan your image usage carefully and prefer CSS gradients, SVG, or emoji for decorative elements.\n",
390
+ "parameters": {
391
+ "type": "object",
392
+ "properties": {
393
+ "file_path": {
394
+ "type": "string",
395
+ "description": "Relative path to save the generated image (e.g., 'public/images/hero.jpg'). Must end in .jpg, .jpeg, or .png."
396
+ },
397
+ "prompt": {
398
+ "type": "string",
399
+ "description": "Text prompt describing the image to generate"
400
+ }
401
+ },
402
+ "required": [
403
+ "file_path",
404
+ "prompt"
405
+ ],
406
+ "additionalProperties": false
407
+ }
408
+ }
409
+ }
410
+ ]
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@qwen-code/arena-agent",
3
- "version": "0.0.9-dev.1",
4
- "description": "A TypeScript CodeAgent harness reconstructed from Arena message and tool traces.",
3
+ "version": "0.0.9-dev.11",
4
+ "description": "A four-mode TypeScript agent harness for Arena and Code Arena traces.",
5
5
  "type": "module",
6
6
  "types": "./dist/sdk.d.ts",
7
7
  "exports": {
@@ -12,14 +12,22 @@
12
12
  "./sdk": {
13
13
  "types": "./dist/sdk.d.ts",
14
14
  "import": "./dist/sdk.js"
15
+ },
16
+ "./mode": {
17
+ "types": "./dist/mode.d.ts",
18
+ "import": "./dist/mode.js"
15
19
  }
16
20
  },
17
21
  "bin": {
18
- "arena": "dist/cli.js"
22
+ "arena": "dist/cli.js",
23
+ "code-harness": "dist/code-cli.js"
19
24
  },
20
25
  "files": [
21
26
  "dist",
22
27
  "docs/SDK.md",
28
+ "docs/MODES_AND_RELEASES.md",
29
+ "docs/BINARY_DISTRIBUTION.md",
30
+ "modes",
23
31
  "web",
24
32
  "README.md",
25
33
  ".env.example"
@@ -31,6 +39,11 @@
31
39
  "generate:canonical-data": "node scripts/generate-canonical-data.mjs",
32
40
  "prebuild": "npm run generate:canonical-data",
33
41
  "build": "tsc -p tsconfig.json && tsc -p tsconfig.web.json",
42
+ "build:binary": "npm run build && node scripts/build-binary.mjs",
43
+ "package:binary": "npm run build:binary && node scripts/package-binaries.mjs",
44
+ "package:binary:platform": "npm run build:binary && node scripts/package-binaries.mjs --skip-cli",
45
+ "package:binary:cli": "node scripts/package-binaries.mjs --cli-only",
46
+ "publish:binaries": "node scripts/publish-binaries.mjs",
34
47
  "dev": "tsx src/cli.ts serve",
35
48
  "tui": "tsx src/cli.ts tui",
36
49
  "prepack": "npm run build",
@@ -54,6 +67,8 @@
54
67
  },
55
68
  "devDependencies": {
56
69
  "@types/node": "^24.10.0",
70
+ "esbuild": "^0.28.1",
71
+ "postject": "^1.0.0-alpha.6",
57
72
  "tsx": "^4.23.1",
58
73
  "typescript": "^7.0.2"
59
74
  }