open-agents-ai 0.187.497 → 0.187.498

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/dist/index.js CHANGED
@@ -255310,6 +255310,281 @@ var init_working_notes = __esm({
255310
255310
  }
255311
255311
  });
255312
255312
 
255313
+ // packages/execution/dist/tools/project-scaffolding.js
255314
+ function detectShape(task) {
255315
+ const lower = task.toLowerCase();
255316
+ if (/\b(cli|command[ -]line|terminal app)\b/.test(lower))
255317
+ return "cli";
255318
+ if (/\b(library|sdk|public api package)\b/.test(lower))
255319
+ return "library";
255320
+ if (/\b(pipeline|etl|data flow|stream processing)\b/.test(lower))
255321
+ return "pipeline";
255322
+ if (/\b(game|game loop|gameplay)\b/.test(lower))
255323
+ return "game";
255324
+ if (/\b(compiler|interpreter|lexer|parser|language|syntax)\b/.test(lower))
255325
+ return "compiler";
255326
+ if (/\b(frontend|ui|page|browser|dashboard|chat|app|website|spa)\b/.test(lower))
255327
+ return "web-app";
255328
+ return "service";
255329
+ }
255330
+ function defaultVerifyCommands(shape) {
255331
+ switch (shape) {
255332
+ case "library":
255333
+ return [
255334
+ "test suite passes (e.g. `npm test`, `pytest`, `cargo test`) — exit 0",
255335
+ "type check / static analysis passes — exit 0",
255336
+ "package builds without errors — exit 0"
255337
+ ];
255338
+ case "cli":
255339
+ return [
255340
+ "test suite passes — exit 0",
255341
+ "build produces a runnable binary or script — exit 0",
255342
+ "smoke test: `<binary> --help` exits 0 with usage text"
255343
+ ];
255344
+ case "pipeline":
255345
+ return [
255346
+ "test suite passes (incl. property tests for idempotency) — exit 0",
255347
+ "end-to-end fixture run succeeds — exit 0"
255348
+ ];
255349
+ case "game":
255350
+ return [
255351
+ "test suite passes — exit 0",
255352
+ "headless / smoke run completes one full update tick — exit 0"
255353
+ ];
255354
+ case "compiler":
255355
+ return [
255356
+ "test suite passes (incl. example-program eval tests) — exit 0",
255357
+ "build / compile of the compiler itself — exit 0"
255358
+ ];
255359
+ default:
255360
+ return [
255361
+ "test suite passes — exit 0",
255362
+ "type check / lint passes — exit 0",
255363
+ "build produces a working artifact — exit 0"
255364
+ ];
255365
+ }
255366
+ }
255367
+ function bulletList(items, fallback = "(none specified)") {
255368
+ if (!items || items.length === 0)
255369
+ return ` ${fallback}`;
255370
+ return items.map((i2) => ` - ${i2}`).join("\n");
255371
+ }
255372
+ function renderSections(shape) {
255373
+ const sections = SHAPE_SECTIONS[shape];
255374
+ return sections.map(([title, hint], i2) => ` ${(i2 + 1).toString().padStart(2, " ")}. **${title}** — ${hint}`).join("\n");
255375
+ }
255376
+ function buildScaffoldedPrompt(args) {
255377
+ const task = (args.task || "").trim();
255378
+ if (task.length === 0) {
255379
+ throw new Error("project_scaffolding: 'task' is required and must be non-empty");
255380
+ }
255381
+ const shape = !args.shape || args.shape === "auto" ? detectShape(task) : args.shape;
255382
+ const outputPath = (args.output_path || "./IMPLEMENTATION_GUIDE.md").trim();
255383
+ const projectName = (args.project_name || "").trim();
255384
+ const verifyCmds = args.verify_commands && args.verify_commands.length > 0 ? args.verify_commands : defaultVerifyCommands(shape);
255385
+ const lines = [];
255386
+ lines.push(`Create a detailed implementation specification${projectName ? ` for **${projectName}**` : ""}, written to:`);
255387
+ lines.push(` ${outputPath}`);
255388
+ lines.push("");
255389
+ lines.push(`## Task description`);
255390
+ lines.push(task);
255391
+ lines.push("");
255392
+ if (args.features && args.features.length > 0) {
255393
+ lines.push(`## Required features`);
255394
+ lines.push(bulletList(args.features));
255395
+ lines.push("");
255396
+ }
255397
+ lines.push(`## Tech stack — POSITIVE constraints (use these)`);
255398
+ lines.push(bulletList(args.stack));
255399
+ lines.push("");
255400
+ lines.push(`## Tech stack — NEGATIVE constraints (do NOT use these)`);
255401
+ lines.push(`These prohibitions are load-bearing. Default training data favors popular alternatives; you must respect the explicit "no" here even when a forbidden choice would be conventional.`);
255402
+ lines.push("");
255403
+ lines.push(bulletList(args.anti_stack));
255404
+ lines.push("");
255405
+ if (args.notes && args.notes.trim().length > 0) {
255406
+ lines.push(`## Additional constraints / notes`);
255407
+ lines.push(args.notes.trim());
255408
+ lines.push("");
255409
+ }
255410
+ lines.push(`## Required spec sections (numbered, in order)`);
255411
+ lines.push(`The spec MUST contain the following sections, each titled and numbered as below. Each section must be detailed enough to stand on its own; do not defer details to later sections.`);
255412
+ lines.push("");
255413
+ lines.push(renderSections(shape));
255414
+ lines.push("");
255415
+ lines.push(`## Reproducibility test (the load-bearing acceptance criterion)`);
255416
+ lines.push(`The spec must be detailed enough that **a different agent**, with no access to this conversation and no shared memory with you, can implement it from the document alone — and produce a result that satisfies the verification commands below.`);
255417
+ lines.push("");
255418
+ lines.push(`## Verifiable acceptance criteria`);
255419
+ lines.push(`Final implementation must pass:`);
255420
+ lines.push(bulletList(verifyCmds));
255421
+ lines.push("");
255422
+ lines.push(`## Output discipline`);
255423
+ lines.push(`- Write the entire spec to ${outputPath} in a single file_write call when you have a complete document. Iterating section-by-section across multiple calls produces incoherent specs; plan the whole document first, then emit.`);
255424
+ lines.push(`- Do NOT implement any code outside the spec document itself. The spec is the deliverable; implementation is a separate downstream task.`);
255425
+ lines.push(`- Call task_complete only after the spec is on disk and you have read it back to verify it covers every numbered section above.`);
255426
+ return lines.join("\n");
255427
+ }
255428
+ var COMMON_HEAD_SECTIONS, COMMON_TAIL_SECTIONS, SHAPE_SECTIONS, ProjectScaffoldingTool;
255429
+ var init_project_scaffolding = __esm({
255430
+ "packages/execution/dist/tools/project-scaffolding.js"() {
255431
+ "use strict";
255432
+ COMMON_HEAD_SECTIONS = [
255433
+ ["Overview", "Goal, scope, non-goals."],
255434
+ ["Non-functional requirements", "Performance, persistence, observability, error handling."]
255435
+ ];
255436
+ COMMON_TAIL_SECTIONS = [
255437
+ ["Build commands", "All scripts (build, test, typecheck, dev). Each must be runnable and reproducible."],
255438
+ ["Acceptance criteria", "Specific test counts and categories. The exact commands that must exit 0 to declare done."],
255439
+ ["Test fixtures + sample data", "All sample inputs/outputs needed to run tests deterministically."],
255440
+ ["Anti-requirements", "Explicit things NOT to do (frameworks, patterns, dependencies excluded)."]
255441
+ ];
255442
+ SHAPE_SECTIONS = {
255443
+ "web-app": [
255444
+ ...COMMON_HEAD_SECTIONS,
255445
+ ["Data models", "Schema (DB) + type definitions."],
255446
+ ["API contract", "Endpoints, request/response shapes, error codes."],
255447
+ ["Real-time events (if any)", "Event types, lifecycle, sequencing rules."],
255448
+ ["Frontend architecture", "Module structure, state management, rendering pattern."],
255449
+ ["File structure", "Every file the implementer must create, with one-line purpose."],
255450
+ ...COMMON_TAIL_SECTIONS
255451
+ ],
255452
+ "service": [
255453
+ ...COMMON_HEAD_SECTIONS,
255454
+ ["Data models", "Schema + type definitions."],
255455
+ ["API contract", "Endpoints, request/response shapes, error codes."],
255456
+ ["Background processing (if any)", "Workers, queues, scheduled jobs."],
255457
+ ["File structure", "Every file the implementer must create, with one-line purpose."],
255458
+ ["Operational concerns", "Logging, metrics, health checks, configuration."],
255459
+ ...COMMON_TAIL_SECTIONS
255460
+ ],
255461
+ "cli": [
255462
+ ...COMMON_HEAD_SECTIONS,
255463
+ ["Command surface", "All commands, flags, args, exit codes, stdout/stderr format."],
255464
+ ["Configuration", "Config file format, environment variables, precedence rules."],
255465
+ ["File structure", "Every file the implementer must create, with one-line purpose."],
255466
+ ["Error handling", "Error categories and how each surfaces to the user."],
255467
+ ...COMMON_TAIL_SECTIONS
255468
+ ],
255469
+ "library": [
255470
+ ...COMMON_HEAD_SECTIONS,
255471
+ ["Public API surface", "Every exported symbol with signature, semantics, examples."],
255472
+ ["Internal architecture", "Module breakdown, invariants, data flow."],
255473
+ ["File structure", "Every file the implementer must create, with one-line purpose."],
255474
+ ["Backward compatibility", "Versioning policy, deprecation rules."],
255475
+ ...COMMON_TAIL_SECTIONS
255476
+ ],
255477
+ "pipeline": [
255478
+ ...COMMON_HEAD_SECTIONS,
255479
+ ["Stages", "Each stage's input, transform, output, idempotency property."],
255480
+ ["Schemas", "Input/output schema for every stage boundary."],
255481
+ ["Failure handling", "Retry, dead-letter, rollback, monitoring."],
255482
+ ["File structure", "Every file the implementer must create, with one-line purpose."],
255483
+ ...COMMON_TAIL_SECTIONS
255484
+ ],
255485
+ "game": [
255486
+ ...COMMON_HEAD_SECTIONS,
255487
+ ["Game loop", "Tick rate, update/render cycle, fixed vs variable timestep."],
255488
+ ["State machines", "All entities/scenes with transitions and invariants."],
255489
+ ["Asset pipeline", "Format, loader, lifecycle."],
255490
+ ["Input handling", "Mapping from device → game action."],
255491
+ ["File structure", "Every file the implementer must create, with one-line purpose."],
255492
+ ...COMMON_TAIL_SECTIONS
255493
+ ],
255494
+ "compiler": [
255495
+ ...COMMON_HEAD_SECTIONS,
255496
+ ["Source language", "Grammar (BNF), example programs."],
255497
+ ["Lexer", "Token kinds, error reporting."],
255498
+ ["Parser", "AST shape, precedence, error recovery."],
255499
+ ["Type system / static analysis", "Rules, inference algorithm if any."],
255500
+ ["Evaluator / runtime", "Semantics, error model, foreign function calls."],
255501
+ ["File structure", "Every file the implementer must create, with one-line purpose."],
255502
+ ...COMMON_TAIL_SECTIONS
255503
+ ]
255504
+ };
255505
+ ProjectScaffoldingTool = class {
255506
+ name = "project_scaffolding";
255507
+ description = "Convert a brief, mushy task description into a structured spec-generation prompt with concrete deliverable, positive+negative stack constraints, numbered sections, reproducibility framing, and verifiable acceptance criteria. Use BEFORE delegating spec generation to another agent — the scaffolded prompt produces coherent implementable specs where a mush prompt produces hand-waving. Args: task (required string), output_path (optional, default ./IMPLEMENTATION_GUIDE.md), stack (string array of POSITIVE constraints), anti_stack (string array of NEGATIVE constraints — load-bearing for small models that default to popular patterns), features (string array of required features), shape (one of 'web-app' | 'service' | 'cli' | 'library' | 'pipeline' | 'game' | 'compiler' | 'auto', default 'auto'), notes (free-text additional constraints), project_name (display name in spec heading), verify_commands (override default verification commands). Returns the scaffolded prompt as a string. The agent should then either (a) hand the prompt off to a sub-agent / another OA run, or (b) execute the spec generation itself.";
255508
+ parameters = {
255509
+ type: "object",
255510
+ properties: {
255511
+ task: {
255512
+ type: "string",
255513
+ description: "Brief task description (the mush). E.g. 'a real-time chat app with rooms and reactions'."
255514
+ },
255515
+ output_path: {
255516
+ type: "string",
255517
+ description: "File path the downstream agent should write the spec to. Default: ./IMPLEMENTATION_GUIDE.md."
255518
+ },
255519
+ stack: {
255520
+ type: "array",
255521
+ items: { type: "string" },
255522
+ description: "POSITIVE tech-stack constraints. E.g. ['Node.js', 'TypeScript', 'Express', 'PostgreSQL']."
255523
+ },
255524
+ anti_stack: {
255525
+ type: "array",
255526
+ items: { type: "string" },
255527
+ description: "NEGATIVE tech-stack constraints — things to explicitly avoid. Load-bearing for small models. E.g. ['WebSockets', 'React', 'in-memory only']."
255528
+ },
255529
+ features: {
255530
+ type: "array",
255531
+ items: { type: "string" },
255532
+ description: "Required features to surface as MUST-have. E.g. ['user auth', 'rate limiting', 'audit log']."
255533
+ },
255534
+ shape: {
255535
+ type: "string",
255536
+ enum: ["web-app", "service", "cli", "library", "pipeline", "game", "compiler", "auto"],
255537
+ description: "Project shape. Determines which sections appear in the spec. Default: 'auto' (detect from task)."
255538
+ },
255539
+ notes: {
255540
+ type: "string",
255541
+ description: "Free-text additional constraints (operational, security, performance, deployment)."
255542
+ },
255543
+ project_name: {
255544
+ type: "string",
255545
+ description: "Display name used in spec heading. Optional."
255546
+ },
255547
+ verify_commands: {
255548
+ type: "array",
255549
+ items: { type: "string" },
255550
+ description: "Override default verification commands. Each item describes a command + expected outcome."
255551
+ }
255552
+ },
255553
+ required: ["task"]
255554
+ };
255555
+ async execute(args) {
255556
+ const start2 = Date.now();
255557
+ try {
255558
+ const scaffArgs = {
255559
+ task: String(args["task"] ?? ""),
255560
+ output_path: typeof args["output_path"] === "string" ? args["output_path"] : void 0,
255561
+ stack: Array.isArray(args["stack"]) ? args["stack"].map(String) : void 0,
255562
+ anti_stack: Array.isArray(args["anti_stack"]) ? args["anti_stack"].map(String) : void 0,
255563
+ features: Array.isArray(args["features"]) ? args["features"].map(String) : void 0,
255564
+ shape: typeof args["shape"] === "string" ? args["shape"] : void 0,
255565
+ notes: typeof args["notes"] === "string" ? args["notes"] : void 0,
255566
+ project_name: typeof args["project_name"] === "string" ? args["project_name"] : void 0,
255567
+ verify_commands: Array.isArray(args["verify_commands"]) ? args["verify_commands"].map(String) : void 0
255568
+ };
255569
+ const prompt = buildScaffoldedPrompt(scaffArgs);
255570
+ return {
255571
+ success: true,
255572
+ output: prompt,
255573
+ durationMs: Date.now() - start2
255574
+ };
255575
+ } catch (e2) {
255576
+ return {
255577
+ success: false,
255578
+ output: "",
255579
+ error: e2 instanceof Error ? e2.message : String(e2),
255580
+ durationMs: Date.now() - start2
255581
+ };
255582
+ }
255583
+ }
255584
+ };
255585
+ }
255586
+ });
255587
+
255313
255588
  // packages/execution/dist/tools/todo-store.js
255314
255589
  import { existsSync as existsSync30, readFileSync as readFileSync24, writeFileSync as writeFileSync12, mkdirSync as mkdirSync11, renameSync, unlinkSync as unlinkSync5, readdirSync as readdirSync9 } from "node:fs";
255315
255590
  import { join as join47 } from "node:path";
@@ -510376,6 +510651,7 @@ __export(dist_exports, {
510376
510651
  PlaywrightBrowserTool: () => PlaywrightBrowserTool,
510377
510652
  PluginManager: () => PluginManager,
510378
510653
  ProcessHealthTool: () => ProcessHealthTool,
510654
+ ProjectScaffoldingTool: () => ProjectScaffoldingTool,
510379
510655
  ReflectionIntegrityTool: () => ReflectionIntegrityTool,
510380
510656
  ReminderTool: () => ReminderTool,
510381
510657
  ReplTool: () => ReplTool,
@@ -510418,6 +510694,7 @@ __export(dist_exports, {
510418
510694
  buildCustomTools: () => buildCustomTools,
510419
510695
  buildGraph: () => buildGraph,
510420
510696
  buildMcpToolName: () => buildMcpToolName,
510697
+ buildScaffoldedPrompt: () => buildScaffoldedPrompt,
510421
510698
  buildSkillsSummary: () => buildSkillsSummary,
510422
510699
  buildSubProcessArgs: () => buildSubProcessArgs,
510423
510700
  canInvokeTool: () => canInvokeTool,
@@ -510597,6 +510874,7 @@ var init_dist5 = __esm({
510597
510874
  init_cron_agent();
510598
510875
  init_file_explore();
510599
510876
  init_working_notes();
510877
+ init_project_scaffolding();
510600
510878
  init_todo_write();
510601
510879
  init_todo_store();
510602
510880
  init_semantic_map();
@@ -596018,6 +596296,7 @@ function buildSubAgentTools(repoRoot, config) {
596018
596296
  new TodoWriteTool(),
596019
596297
  new TodoReadTool(),
596020
596298
  new WorkingNotesTool(),
596299
+ new ProjectScaffoldingTool(),
596021
596300
  // Code understanding + navigation
596022
596301
  new CodebaseMapTool(repoRoot),
596023
596302
  new SemanticMapTool(repoRoot),
@@ -596181,6 +596460,7 @@ function buildTools(repoRoot, config, contextWindowSize, modelTier) {
596181
596460
  // Chunked file exploration + working notes + semantic map
596182
596461
  new FileExploreTool(repoRoot),
596183
596462
  new WorkingNotesTool(),
596463
+ new ProjectScaffoldingTool(),
596184
596464
  // Agent-facing checklist (WO-TASK-02 — TodoWrite/TodoRead)
596185
596465
  new TodoWriteTool(),
596186
596466
  new TodoReadTool(),
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.187.497",
3
+ "version": "0.187.498",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "open-agents-ai",
9
- "version": "0.187.497",
9
+ "version": "0.187.498",
10
10
  "hasInstallScript": true,
11
11
  "license": "CC-BY-NC-4.0",
12
12
  "dependencies": {
@@ -7165,12 +7165,12 @@
7165
7165
  }
7166
7166
  },
7167
7167
  "node_modules/p-queue": {
7168
- "version": "9.1.2",
7169
- "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-9.1.2.tgz",
7170
- "integrity": "sha512-ktsDOALzTYTWWF1PbkNVg2rOt+HaOaMWJMUnt7T3qf5tvZ1L8dBW3tObzprBcXNMKkwj+yFSLqHso0x+UFcJXw==",
7168
+ "version": "9.2.0",
7169
+ "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-9.2.0.tgz",
7170
+ "integrity": "sha512-dWgLE8AH0HjQ9fe74pUkKkvzzYT18Inp4zra3lKHnnwqGvcfcUBrvF2EAVX+envufDNBOzpPq/IBUONDbI7+3g==",
7171
7171
  "license": "MIT",
7172
7172
  "dependencies": {
7173
- "eventemitter3": "^5.0.1",
7173
+ "eventemitter3": "^5.0.4",
7174
7174
  "p-timeout": "^7.0.0"
7175
7175
  },
7176
7176
  "engines": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.187.497",
3
+ "version": "0.187.498",
4
4
  "description": "AI coding agent powered by open-source models (Ollama/vLLM) — interactive TUI with agentic tool-calling loop",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",