opencode-agentic-engine 0.1.2 → 0.1.4

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;AAq5F/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;AAshG/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,11 +1,13 @@
1
- // opencode-agentic-engine v0.1.0
1
+ // opencode-agentic-engine v0.1.4
2
2
  // Bundled for zero-install drop-in
3
3
 
4
4
  // src/index.ts
5
5
  import { tool } from "@opencode-ai/plugin";
6
- import { readFileSync as readFileSync6, writeFileSync as writeFileSync4, mkdirSync as mkdirSync4, existsSync as existsSync8, readdirSync as readdirSync2 } from "node:fs";
6
+ import { readFileSync as readFileSync6, writeFileSync as writeFileSync4, mkdirSync as mkdirSync4, existsSync as existsSync8, readdirSync as readdirSync2, cpSync, rmSync, mkdtempSync } from "node:fs";
7
7
  import { execFileSync as execFileSync5 } from "node:child_process";
8
8
  import { join as join6, dirname as dirname5 } from "node:path";
9
+ import { fileURLToPath } from "node:url";
10
+ import { tmpdir } from "node:os";
9
11
 
10
12
  // src/core/intent-parser.ts
11
13
  var IntentParser = class {
@@ -6481,6 +6483,58 @@ var LiveEvaluator = class {
6481
6483
  };
6482
6484
 
6483
6485
  // src/index.ts
6486
+ function isNewerVersion(latest, current) {
6487
+ const l = latest.split(".").map(Number);
6488
+ const c = current.split(".").map(Number);
6489
+ for (let i = 0; i < Math.max(l.length, c.length); i++) {
6490
+ if ((l[i] ?? 0) > (c[i] ?? 0)) return true;
6491
+ if ((l[i] ?? 0) < (c[i] ?? 0)) return false;
6492
+ }
6493
+ return false;
6494
+ }
6495
+ async function autoUpdatePlugin(currentVersion) {
6496
+ if (false) return;
6497
+ try {
6498
+ const res = await fetch(
6499
+ "https://registry.npmjs.org/opencode-agentic-engine/latest",
6500
+ { signal: AbortSignal.timeout(5e3) }
6501
+ );
6502
+ if (!res.ok) return;
6503
+ const data = await res.json();
6504
+ const latest = data.version;
6505
+ if (!isNewerVersion(latest, currentVersion)) return;
6506
+ const ownFile = fileURLToPath(import.meta.url);
6507
+ const distDir = dirname5(ownFile);
6508
+ const pluginDir = dirname5(distDir);
6509
+ const tmpDir = mkdtempSync(join6(tmpdir(), "opencode-agentic-engine-"));
6510
+ try {
6511
+ execFileSync5("npm", ["pack", "opencode-agentic-engine@latest"], {
6512
+ cwd: tmpDir,
6513
+ stdio: "pipe",
6514
+ timeout: 3e4
6515
+ });
6516
+ const tarball = readdirSync2(tmpDir).find((f) => f.endsWith(".tgz"));
6517
+ if (!tarball) return;
6518
+ execFileSync5("tar", ["-xzf", tarball], {
6519
+ cwd: tmpDir,
6520
+ stdio: "pipe",
6521
+ timeout: 1e4
6522
+ });
6523
+ const extractDir = join6(tmpDir, "package");
6524
+ if (existsSync8(extractDir)) {
6525
+ cpSync(extractDir, pluginDir, { recursive: true, force: true });
6526
+ }
6527
+ process.stderr.write(
6528
+ `
6529
+ [AgenticEngine] \u2705 Auto-updated v${currentVersion} \u2192 v${latest}. Restart OpenCode to apply.
6530
+ `
6531
+ );
6532
+ } finally {
6533
+ rmSync(tmpDir, { recursive: true, force: true });
6534
+ }
6535
+ } catch {
6536
+ }
6537
+ }
6484
6538
  var createEngine = async (input, _options) => {
6485
6539
  const rawWorktree = input.worktree || process.cwd();
6486
6540
  const worktree = rawWorktree === "/" ? process.cwd() : rawWorktree;
@@ -6493,11 +6547,60 @@ var createEngine = async (input, _options) => {
6493
6547
  try {
6494
6548
  mkdirSync4(agentsDir, { recursive: true });
6495
6549
  writeFileSync4(agenticAgentPath, `---
6496
- description: Multi-agent software engineering assistant (20 tools: plan, execute, reflect, verify, nav, delegate, etc.)
6550
+ description: Multi-agent software engineering assistant \u2014 22 tools for autonomous planning, execution, verification, delegation, and self-evolution.
6497
6551
  mode: all
6498
6552
  ---
6499
6553
 
6500
- You are an AI assistant with access to 21 agentic engineering tools (agentic_plan, agentic_execute, agentic_reflect, agentic_verify, agentic_nav, agentic_delegate, etc.). Use these tools to help the user plan, implement, verify, and manage software engineering tasks.
6554
+ # Agentic Engineering Agent
6555
+
6556
+ You have access to **22 specialized tools**. Use them automatically \u2014 no need to ask for permission. For ANY multi-step task, follow this workflow:
6557
+
6558
+ ## Standard Workflow
6559
+
6560
+ 1. **agentic_plan** \u2014 Decompose the goal into steps (LLM decomposes automatically)
6561
+ 2. **agentic_nav** \u2014 Explore the codebase to find relevant files
6562
+ 3. **agentic_execute** \u2014 Execute each step, report progress
6563
+ 4. **agentic_verify** \u2014 Verify compilation/tests after execution
6564
+ 5. **agentic_reflect** \u2014 If a step fails, analyze and retry
6565
+
6566
+ ## Tool Reference
6567
+
6568
+ ### Stage I \u2014 Core Engineering Loop
6569
+ - **agentic_plan**: Decompose a goal into subtasks with dependencies. Call FIRST for any multi-step task. Supports auto-decomposition via LLM.
6570
+ - **agentic_execute**: Record a completed subtask. Auto-verifies compilation. Tracks retries per error category. Supports user feedback (positive/negative).
6571
+ - **agentic_reflect**: Analyze a failed step \u2014 error category, propagation trace, root cause, recovery plan.
6572
+ - **agentic_verify**: Full compile + lint + test suite. Auto-detects language (TS, Python, Go, Rust, JS).
6573
+ - **agentic_status**: Dashboard: progress bar, health, blocked steps, retry history, model reliability, evolution trend.
6574
+
6575
+ ### Stage II \u2014 Codebase & Context
6576
+ - **agentic_nav**: Scan codebase, find files relevant to a task, show test files.
6577
+ - **agentic_context**: View or compress conversation context to stay within token limits.
6578
+ - **agentic_snapshot**: Save/list execution checkpoints.
6579
+ - **agentic_pr**: Generate PR description from plan + results. Can create actual PR via \`gh\`.
6580
+ - **agentic_score**: Analyze changeset for technical debt (coupling, size, patterns).
6581
+ - **agentic_model**: Configure per-role LLM model preferences per session.
6582
+
6583
+ ### Stage III \u2014 Multi-Agent & Memory
6584
+ - **agentic_delegate**: Assign tasks to specialized roles (architect/developer/qa/coordinator/pm). Auto-suggests role. Supports pipeline-aware delegation + cross-validation.
6585
+ - **agentic_pipeline**: Define, list, run, or auto-suggest multi-agent pipelines (PM\u2192Arch\u2192Dev\u2192QA).
6586
+ - **agentic_message**: Inter-agent messaging: send, inbox, conversation, review requests.
6587
+ - **agentic_parallel**: Analyze or execute ready steps concurrently (Promise.all).
6588
+ - **agentic_skill**: Extract a completed step as reusable skill. Search or list existing skills.
6589
+ - **agentic_episodes**: Search cross-session memory for past tasks and outcomes.
6590
+ - **agentic_dashboard**: Full observability: timeline, anomaly detection, model reliability stats.
6591
+ - **agentic_guard**: Verify claims in step output (file existence, function references, imports) to catch hallucinations.
6592
+
6593
+ ### Stage IV \u2014 Self-Evolution
6594
+ - **agentic_evolve**: Inspect/extend the agent system. Register custom roles, export skills, manage prompt history, export training data.
6595
+
6596
+ ### Stage V \u2014 Autonomous
6597
+ - **agentic_auto**: Fully autonomous loop: plan \u2192 execute \u2192 verify \u2192 retry in ONE call. Just give a goal.
6598
+
6599
+ ## Rules
6600
+ - Always call tools proactively \u2014 never ask the user "should I X?"
6601
+ - For multi-step tasks, ALWAYS start with **agentic_plan**
6602
+ - After each execute, check if verification is needed
6603
+ - If a step fails, call **agentic_reflect** before retrying
6501
6604
  `, "utf-8");
6502
6605
  } catch {
6503
6606
  }
@@ -6668,6 +6771,7 @@ You are an AI assistant with access to 21 agentic engineering tools (agentic_pla
6668
6771
  await traceLogger.init();
6669
6772
  } catch {
6670
6773
  }
6774
+ autoUpdatePlugin("0.1.4");
6671
6775
  configLoader.onChange((newConfig) => {
6672
6776
  vectorStore.setSearchWeights(newConfig.memory.search.keywordWeight, newConfig.memory.search.vectorWeight);
6673
6777
  vectorStore.setStopWordsLanguages(newConfig.memory.stopWordsLanguages);