opencode-agentic-engine 0.1.2 → 0.1.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.
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +57 -2
- package/dist/index.js.map +3 -3
- package/package.json +1 -1
package/dist/index.d.ts.map
CHANGED
|
@@ -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;
|
|
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;AAq+F/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.
|
|
1
|
+
// opencode-agentic-engine v0.1.3
|
|
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;
|
|
@@ -6668,6 +6722,7 @@ You are an AI assistant with access to 21 agentic engineering tools (agentic_pla
|
|
|
6668
6722
|
await traceLogger.init();
|
|
6669
6723
|
} catch {
|
|
6670
6724
|
}
|
|
6725
|
+
autoUpdatePlugin("0.1.3");
|
|
6671
6726
|
configLoader.onChange((newConfig) => {
|
|
6672
6727
|
vectorStore.setSearchWeights(newConfig.memory.search.keywordWeight, newConfig.memory.search.vectorWeight);
|
|
6673
6728
|
vectorStore.setStopWordsLanguages(newConfig.memory.stopWordsLanguages);
|