opencode-agentic-engine 0.1.0 → 0.1.1

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;AAi5F/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;AAo5F/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
@@ -16662,7 +16662,7 @@ var TraceLogger = class {
16662
16662
  /** Retention days for trace entries (0 = never prune). Config-hot-reloadable. */
16663
16663
  retentionDays = 7;
16664
16664
  constructor(worktree) {
16665
- this.logPath = join4(worktree, ".agentic", "trace.jsonl");
16665
+ this.logPath = join4(worktree || process.cwd(), ".agentic", "trace.jsonl");
16666
16666
  }
16667
16667
  /** Set retention days for pruning old traces — called on config hot-reload. */
16668
16668
  setRetentionDays(days) {
@@ -17428,8 +17428,8 @@ var PersistenceLayer = class {
17428
17428
  baseDir;
17429
17429
  storeDir;
17430
17430
  constructor(worktree) {
17431
- this.baseDir = worktree;
17432
- this.storeDir = resolve4(worktree, ".agentic", "store");
17431
+ this.baseDir = worktree || process.cwd();
17432
+ this.storeDir = resolve4(this.baseDir, ".agentic", "store");
17433
17433
  this.ensureDir();
17434
17434
  }
17435
17435
  save(namespace, key, data) {
@@ -18238,8 +18238,8 @@ var ConfigLoader = class {
18238
18238
  watcher = null;
18239
18239
  listeners = [];
18240
18240
  constructor(worktree) {
18241
- this.worktree = worktree;
18242
- this.configPath = join5(worktree, ".agentic", "config.json");
18241
+ this.worktree = worktree || process.cwd();
18242
+ this.configPath = join5(this.worktree, ".agentic", "config.json");
18243
18243
  this.config = { ...DEFAULT_CONFIG };
18244
18244
  }
18245
18245
  /** Load config from file, auto-create default if missing */
@@ -18899,10 +18899,11 @@ var LiveEvaluator = class {
18899
18899
 
18900
18900
  // src/index.ts
18901
18901
  var createEngine = async (input, _options) => {
18902
- const configLoader = new ConfigLoader(input.worktree);
18902
+ const worktree = input.worktree || process.cwd();
18903
+ const configLoader = new ConfigLoader(worktree);
18903
18904
  const config2 = configLoader.load();
18904
18905
  configLoader.startWatch();
18905
- const agentsDir = join6(input.worktree, ".opencode", "agents");
18906
+ const agentsDir = join6(worktree, ".opencode", "agents");
18906
18907
  const agenticAgentPath = join6(agentsDir, "agentic.md");
18907
18908
  if (!existsSync8(agenticAgentPath)) {
18908
18909
  try {
@@ -18925,7 +18926,7 @@ You are an AI assistant with access to 21 agentic engineering tools (agentic_pla
18925
18926
  const navigator2 = new CodebaseNavigator();
18926
18927
  const depTracker = new DependencyTracker();
18927
18928
  try {
18928
- const sourceDir = join6(input.worktree, "src");
18929
+ const sourceDir = join6(worktree, "src");
18929
18930
  if (existsSync8(sourceDir)) {
18930
18931
  const scanBatch = {};
18931
18932
  const walkDir = (dir) => {
@@ -18944,12 +18945,12 @@ You are an AI assistant with access to 21 agentic engineering tools (agentic_pla
18944
18945
  }
18945
18946
  };
18946
18947
  walkDir(sourceDir);
18947
- depTracker.scanFiles(scanBatch, input.worktree);
18948
+ depTracker.scanFiles(scanBatch, worktree);
18948
18949
  }
18949
18950
  } catch {
18950
18951
  }
18951
18952
  const contextCompressor = new ContextCompressor();
18952
- const git = new GitIntegration(input.worktree);
18953
+ const git = new GitIntegration(worktree);
18953
18954
  const debtScorer = new TechDebtScorer();
18954
18955
  const skillStore = new SkillStore();
18955
18956
  const coordinator = new AgentCoordinator(skillStore);
@@ -18959,11 +18960,11 @@ You are an AI assistant with access to 21 agentic engineering tools (agentic_pla
18959
18960
  }
18960
18961
  const episodicStore = new EpisodicStore();
18961
18962
  const checkpoints = new CheckpointSystem();
18962
- const hallucinationGuard = new HallucinationGuard(input.worktree);
18963
+ const hallucinationGuard = new HallucinationGuard(worktree);
18963
18964
  const parallelExec = new ParallelExecutor();
18964
18965
  const dashboard = new Dashboard();
18965
18966
  const sessionStore = new SessionStore();
18966
- const traceLogger = new TraceLogger(input.worktree);
18967
+ const traceLogger = new TraceLogger(worktree);
18967
18968
  const roleRegistry = new RoleRegistry();
18968
18969
  const schemaVersion = new MemorySchemaVersion();
18969
18970
  const selfEvolver = new SelfEvolver();
@@ -19031,7 +19032,7 @@ You are an AI assistant with access to 21 agentic engineering tools (agentic_pla
19031
19032
  findSkills: (query) => skillStore.find(query).map((s) => ({ name: s.definition.meta.name, successRate: s.successRate }))
19032
19033
  });
19033
19034
  const agentLoop = new AgentLoop(llmEngine2, { maxIterations: 10, autoRetry: true, maxRetries: 2, verifyAfterEach: false });
19034
- const persistence = new PersistenceLayer(input.worktree);
19035
+ const persistence = new PersistenceLayer(worktree);
19035
19036
  const vectorStore = new VectorStore();
19036
19037
  vectorStore.setLLM(llmEngine2);
19037
19038
  vectorStore.setSearchWeights(config2.memory.search.keywordWeight, config2.memory.search.vectorWeight);
@@ -19042,7 +19043,7 @@ You are an AI assistant with access to 21 agentic engineering tools (agentic_pla
19042
19043
  vectorStore.setLLM(llmEngine2);
19043
19044
  }
19044
19045
  contextCompressor.setLLM(llmEngine2);
19045
- verifier.detectLanguage(input.worktree);
19046
+ verifier.detectLanguage(worktree);
19046
19047
  const savedModels = persistence.loadAll("models");
19047
19048
  for (const m of savedModels) {
19048
19049
  modelRegistry.fromJSON(m.data);
@@ -19125,7 +19126,7 @@ You are an AI assistant with access to 21 agentic engineering tools (agentic_pla
19125
19126
  }
19126
19127
  }
19127
19128
  let traces = [];
19128
- const tracePath = `${input.worktree}/.agentic/trace.jsonl`;
19129
+ const tracePath = `${worktree}/.agentic/trace.jsonl`;
19129
19130
  try {
19130
19131
  const content = readFileSync6(tracePath, "utf-8");
19131
19132
  for (const line of content.trim().split("\n").filter(Boolean)) {
@@ -19254,7 +19255,7 @@ ${patch.instruction}`;
19254
19255
  let subtasks = args.subtasks ?? [];
19255
19256
  if (subtasks.length === 0 && args.autoDecompose !== false) {
19256
19257
  if (args.llmDecompose !== false) {
19257
- await navigator2.scan(input.worktree);
19258
+ await navigator2.scan(worktree);
19258
19259
  const codebaseSummary = navigator2.getSummary();
19259
19260
  try {
19260
19261
  const llmIntent = await planner.decomposeWithLLM(llmEngine2, args.goal, codebaseSummary);
@@ -19350,7 +19351,7 @@ Start with \`agentic_execute\` for the first ready step.`,
19350
19351
  },
19351
19352
  async execute(args, _context) {
19352
19353
  const maxResults = args.maxResults ?? 10;
19353
- await navigator2.scan(input.worktree);
19354
+ await navigator2.scan(worktree);
19354
19355
  const files = navigator2.findRelevantFiles(args.query, maxResults);
19355
19356
  for (const file2 of files) {
19356
19357
  vectorStore.addDocument(`file:${file2}`, `File ${file2}`, {
@@ -21115,7 +21116,7 @@ Run \`agentic_parallel\` with \`action: "execute"\` to run these steps concurren
21115
21116
  const modelReliability = modelRegistry.getSummary();
21116
21117
  let traceSection = "";
21117
21118
  await traceLogger.flush();
21118
- const tracePath = `${input.worktree}/.agentic/trace.jsonl`;
21119
+ const tracePath = `${worktree}/.agentic/trace.jsonl`;
21119
21120
  let traces = [];
21120
21121
  try {
21121
21122
  const content = readFileSync6(tracePath, "utf-8");
@@ -21408,7 +21409,7 @@ ${JSON.stringify(createMemoryEnvelope({ example: true }, "example"), null, 2)}
21408
21409
  }
21409
21410
  }
21410
21411
  let traces = [];
21411
- const tracePath = `${input.worktree}/.agentic/trace.jsonl`;
21412
+ const tracePath = `${worktree}/.agentic/trace.jsonl`;
21412
21413
  try {
21413
21414
  const content = readFileSync6(tracePath, "utf-8");
21414
21415
  for (const line of content.trim().split("\n").filter(Boolean)) {