opencode-agentic-engine 0.2.2 → 0.2.3

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAinG/D,eAAO,MAAM,aAAa,EAAE,MAAqB,CAAA;AAEjD,QAAA,MAAM,YAAY,EAAE,YAGnB,CAAA;AACD,eAAe,YAAY,CAAA;AAG3B,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAA;AACzE,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AAC/D,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAA;AAC5J,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAioG/D,eAAO,MAAM,aAAa,EAAE,MAAqB,CAAA;AAEjD,QAAA,MAAM,YAAY,EAAE,YAGnB,CAAA;AACD,eAAe,YAAY,CAAA;AAG3B,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAA;AACzE,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AAC/D,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAA;AAC5J,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAA"}
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- // opencode-agentic-engine v0.2.2
1
+ // opencode-agentic-engine v0.2.3
2
2
  // Bundled for zero-install drop-in
3
3
 
4
4
  // src/index.ts
@@ -6563,10 +6563,12 @@ You have access to **22 specialized agentic_* tools** designed for software engi
6563
6563
 
6564
6564
  ### BEFORE STARTING ANY TASK \u2014 Gather Knowledge First
6565
6565
  Your training data has a cutoff date. Before implementing:
6566
- 1. **Search skills**: \`agentic_skill find "relevant technology"\` \u2014 learn from past successes/failures
6567
- 2. **Search episodes**: \`agentic_episodes search "similar task"\` \u2014 see what worked before
6568
- 3. **Search latest docs**: \`websearch "technology X latest version 2026"\` \u2014 check current APIs for ANY ecosystem (Node, Rust, Go, Python, etc.)
6569
- 4. Only then start implementing
6566
+ 1. **Check project structure** \u2014 agentic_auto already gives you a map: file types, root dirs, largest dirs
6567
+ 2. **Read relevant files** \u2014 use \`read\` or \`agentic_nav\` to inspect specific files (you decide which)
6568
+ 3. **Search skills**: \`agentic_skill find "relevant technology"\` \u2014 learn from past successes/failures
6569
+ 4. **Search episodes**: \`agentic_episodes search "similar task"\` \u2014 see what worked before
6570
+ 5. **Search latest docs**: \`websearch "technology X latest version 2026"\` \u2014 check current APIs for ANY ecosystem (Node, Rust, Go, Python, etc.)
6571
+ 6. Only then start implementing
6570
6572
 
6571
6573
  ### FOR MULTI-STEP FEATURES (apps, APIs, refactors):
6572
6574
  Call **agentic_auto** IMMEDIATELY. It auto-gathers skills + doc context. Example:
@@ -6798,7 +6800,7 @@ Call the specific tool (agentic_nav, agentic_execute, etc.) directly.
6798
6800
  await traceLogger.init();
6799
6801
  } catch {
6800
6802
  }
6801
- autoUpdatePlugin("0.2.2");
6803
+ autoUpdatePlugin("0.2.3");
6802
6804
  configLoader.onChange((newConfig) => {
6803
6805
  vectorStore.setSearchWeights(newConfig.memory.search.keywordWeight, newConfig.memory.search.vectorWeight);
6804
6806
  vectorStore.setStopWordsLanguages(newConfig.memory.stopWordsLanguages);
@@ -9508,53 +9510,70 @@ ${dataset.data.slice(0, 2e3)}${dataset.data.length > 2e3 ? "\n\u2026 (truncated)
9508
9510
  }
9509
9511
  } catch {
9510
9512
  }
9511
- let codebaseContext = "";
9513
+ let structureContext = "";
9512
9514
  try {
9513
- const rootFiles = readdirSync2(projectDir).filter((f) => !f.startsWith(".") && !f.includes("lock"));
9514
- const knownConfigNames = /* @__PURE__ */ new Set(["Makefile", "Dockerfile", "docker-compose.yml", "docker-compose.yaml", "go.mod", "Gemfile", "requirements.txt", "setup.py", "setup.cfg", "pom.xml", "build.gradle", "gradle.properties", "Podfile", "Cartfile", "Mixfile", "rebar.config", "opam", "stack.yaml", "cabal.project", "Cargo.lock", "Gemfile.lock", "composer.lock", "pnpm-lock.yaml", "yarn.lock", "bun.lock"]);
9515
- const configExts = [".json", ".toml", ".yaml", ".yml", ".ini", ".cfg", ".conf"];
9516
- const configFiles = rootFiles.filter((f) => knownConfigNames.has(f) || configExts.some((ext) => f.endsWith(ext))).slice(0, 5);
9517
- for (const cfg of configFiles) {
9518
- const cfgPath = join6(projectDir, cfg);
9519
- codebaseContext += `
9520
- ### ${cfg}
9521
- \`\`\`
9522
- ${readFileSync6(cfgPath, "utf-8").slice(0, 1e3)}
9523
- \`\`\`
9515
+ const extCount = /* @__PURE__ */ new Map();
9516
+ const walkExt = (d, depth = 0) => {
9517
+ if (depth > 8) return;
9518
+ for (const entry of readdirSync2(d, { withFileTypes: true })) {
9519
+ if (entry.name.startsWith(".") || ["node_modules", ".git", "dist", "build", "target", "vendor"].includes(entry.name)) continue;
9520
+ const full = join6(d, entry.name);
9521
+ if (entry.isDirectory()) walkExt(full, depth + 1);
9522
+ else if (entry.isFile()) {
9523
+ const idx = entry.name.lastIndexOf(".");
9524
+ const ext = idx > 0 ? entry.name.slice(idx) : "(no ext)";
9525
+ extCount.set(ext, (extCount.get(ext) || 0) + 1);
9526
+ }
9527
+ }
9528
+ };
9529
+ walkExt(projectDir);
9530
+ const sortedExts = [...extCount.entries()].sort((a, b) => b[1] - a[1]).slice(0, 15);
9531
+ structureContext += `
9532
+ ### Project File Types
9533
+ | Extension | Count |
9534
+ |-----------|-------|
9535
+ `;
9536
+ for (const [ext, count] of sortedExts) {
9537
+ structureContext += `| \`${ext}\` | ${count} |
9524
9538
  `;
9525
9539
  }
9526
- const srcDirs = ["src", "app", "lib", "server"].filter((d) => existsSync8(join6(projectDir, d)));
9527
- let filesRead = 0;
9528
- for (const dir of srcDirs) {
9529
- const walkDir = (d) => {
9530
- if (filesRead >= 5) return;
9531
- try {
9532
- for (const entry of readdirSync2(d, { withFileTypes: true })) {
9533
- if (filesRead >= 5) return;
9534
- const full = join6(d, entry.name);
9535
- if (entry.isDirectory() && !["node_modules", ".git", "dist"].includes(entry.name)) walkDir(full);
9536
- else if (entry.isFile() && /\.(ts|js|tsx|jsx|mjs|rs|go|py)$/.test(entry.name)) {
9537
- const content = readFileSync6(full, "utf-8").slice(0, 500);
9538
- if (content.trim()) {
9539
- codebaseContext += `
9540
- ### ${full.replace(projectDir, ".")}
9540
+ const rootEntries = readdirSync2(projectDir, { withFileTypes: true }).filter((e) => !e.name.startsWith(".") && !["node_modules", ".git", "dist", "build", "target", "vendor"].includes(e.name));
9541
+ structureContext += `
9542
+ ### Project Root
9541
9543
  \`\`\`
9542
- ${content}
9544
+ ${rootEntries.map((e) => (e.isDirectory() ? "\u{1F4C1} " : "\u{1F4C4} ") + e.name).join("\n")}
9543
9545
  \`\`\`
9544
9546
  `;
9545
- filesRead++;
9546
- }
9547
- }
9548
- }
9549
- } catch {
9547
+ const dirCount = /* @__PURE__ */ new Map();
9548
+ const walkDirCount = (d, depth = 0) => {
9549
+ if (depth > 6) return;
9550
+ for (const entry of readdirSync2(d, { withFileTypes: true })) {
9551
+ if (entry.name.startsWith(".") || ["node_modules", ".git", "dist", "build", "target", "vendor"].includes(entry.name)) continue;
9552
+ const full = join6(d, entry.name);
9553
+ if (entry.isDirectory()) walkDirCount(full, depth + 1);
9554
+ else if (entry.isFile()) {
9555
+ const parent = d.replace(projectDir, "").slice(1) || ".";
9556
+ dirCount.set(parent, (dirCount.get(parent) || 0) + 1);
9550
9557
  }
9551
- };
9552
- walkDir(join6(projectDir, dir));
9558
+ }
9559
+ };
9560
+ walkDirCount(projectDir);
9561
+ const sortedDirs = [...dirCount.entries()].sort((a, b) => b[1] - a[1]).slice(0, 8);
9562
+ structureContext += `
9563
+ ### Largest Directories
9564
+ | Directory | Files |
9565
+ |-----------|-------|
9566
+ `;
9567
+ for (const [dir, count] of sortedDirs) {
9568
+ structureContext += `| \`${dir}/\` | ${count} |
9569
+ `;
9553
9570
  }
9571
+ structureContext += `
9572
+ > \u{1F4A1} LLM: Use \`read\` or \`agentic_nav\` to inspect specific files as needed.`;
9554
9573
  } catch {
9555
9574
  }
9556
9575
  await navigator.scan(projectDir);
9557
- const summary = navigator.getSummary() + knowledgeContext + codebaseContext;
9576
+ const summary = navigator.getSummary() + knowledgeContext + structureContext;
9558
9577
  let subtasks = [];
9559
9578
  try {
9560
9579
  const intent = await planner.decomposeWithLLM(llmEngine2, args.goal, summary);