@botbotgo/agent-harness 0.0.100 → 0.0.101

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,8 +1,8 @@
1
1
  import path from "node:path";
2
2
  import { MemorySaver } from "@langchain/langgraph";
3
3
  import { SqliteSaver } from "@langchain/langgraph-checkpoint-sqlite";
4
- import { FileCheckpointSaver } from "../file-checkpoint-saver.js";
5
- import { ManagedSqliteSaver } from "../sqlite-maintained-checkpoint-saver.js";
4
+ import { FileCheckpointSaver } from "../maintenance/file-checkpoint-saver.js";
5
+ import { ManagedSqliteSaver } from "../maintenance/sqlite-maintained-checkpoint-saver.js";
6
6
  import { createInMemoryStore, FileBackedStore } from "../harness/system/store.js";
7
7
  export function createStoreForConfig(storeConfig, runRoot) {
8
8
  const kind = typeof storeConfig.kind === "string" ? storeConfig.kind : "FileStore";
@@ -235,12 +235,29 @@ function readCapabilities(value) {
235
235
  };
236
236
  return Object.keys(capabilities).length > 0 ? capabilities : undefined;
237
237
  }
238
+ const CONSUMED_AGENT_CONFIG_KEYS = [
239
+ "systemPrompt",
240
+ "checkpointer",
241
+ "interruptOn",
242
+ "stateSchema",
243
+ "responseFormat",
244
+ "contextSchema",
245
+ "includeAgentName",
246
+ "version",
247
+ "middleware",
248
+ "backend",
249
+ "store",
250
+ "runtimeMemory",
251
+ "taskDescription",
252
+ "generalPurposeAgent",
253
+ "filesystem",
254
+ ];
238
255
  function readExecutionConfig(value) {
239
256
  return asMutableObject(value);
240
257
  }
241
- function readExecutionAgentConfig(item) {
258
+ function readExecutionValue(item, key, reader) {
242
259
  const execution = readExecutionConfig(item.execution);
243
- return asMutableObject(execution?.config) ?? {};
260
+ return reader(execution?.[key]);
244
261
  }
245
262
  function readRuntimeConfig(item) {
246
263
  return asMutableObject(item.runtime);
@@ -323,21 +340,13 @@ function resolveExecutionBackend(item, current) {
323
340
  }
324
341
  return undefined;
325
342
  }
326
- function readExecutionSingleRef(item, key) {
327
- const execution = readExecutionConfig(item.execution);
328
- return readSingleRef(execution?.[key]);
329
- }
330
- function readExecutionRefArray(item, key) {
331
- const execution = readExecutionConfig(item.execution);
332
- return readRefArray(execution?.[key]);
333
- }
334
- function readExecutionPathArray(item, key) {
335
- const execution = readExecutionConfig(item.execution);
336
- return readPathArray(execution?.[key]);
337
- }
338
- function readExecutionObjectArray(item, key) {
339
- const execution = readExecutionConfig(item.execution);
340
- return readObjectArray(execution?.[key]);
343
+ function readSharedAgentConfigFields(config) {
344
+ return {
345
+ ...(typeof config.store === "object" && config.store ? { store: config.store } : {}),
346
+ ...(typeof config.runtimeMemory === "object" && config.runtimeMemory ? { runtimeMemory: config.runtimeMemory } : {}),
347
+ ...(typeof config.taskDescription === "string" && config.taskDescription.trim() ? { taskDescription: config.taskDescription } : {}),
348
+ ...(typeof config.generalPurposeAgent === "boolean" ? { generalPurposeAgent: config.generalPurposeAgent } : {}),
349
+ };
341
350
  }
342
351
  function readSharedAgentConfig(config) {
343
352
  const middleware = readMiddlewareArray(config.middleware);
@@ -359,67 +368,20 @@ function readSharedAgentConfig(config) {
359
368
  ...(middleware ? { middleware } : {}),
360
369
  };
361
370
  }
362
- function readLangchainAgentConfig(item) {
363
- const config = readExecutionAgentConfig(item);
364
- const passthrough = readPassthroughConfig(config, [
365
- "systemPrompt",
366
- "checkpointer",
367
- "interruptOn",
368
- "stateSchema",
369
- "responseFormat",
370
- "contextSchema",
371
- "includeAgentName",
372
- "version",
373
- "middleware",
374
- "backend",
375
- "store",
376
- "runtimeMemory",
377
- "taskDescription",
378
- "generalPurposeAgent",
379
- "filesystem",
380
- ]);
371
+ function readAgentConfig(item, options = {}) {
372
+ const config = readExecutionValue(item, "config", asMutableObject) ?? {};
373
+ const passthrough = readPassthroughConfig(config, [...CONSUMED_AGENT_CONFIG_KEYS]);
381
374
  return {
382
375
  ...readSharedAgentConfig(config),
383
- ...(typeof config.store === "object" && config.store ? { store: config.store } : {}),
384
- ...(typeof config.runtimeMemory === "object" && config.runtimeMemory ? { runtimeMemory: config.runtimeMemory } : {}),
385
- ...(typeof config.taskDescription === "string" && config.taskDescription.trim() ? { taskDescription: config.taskDescription } : {}),
386
- ...(typeof config.generalPurposeAgent === "boolean" ? { generalPurposeAgent: config.generalPurposeAgent } : {}),
387
- ...(passthrough ? { passthrough } : {}),
388
- };
389
- }
390
- function readDeepAgentConfig(item) {
391
- const config = readExecutionAgentConfig(item);
392
- const passthrough = readPassthroughConfig(config, [
393
- "systemPrompt",
394
- "checkpointer",
395
- "interruptOn",
396
- "stateSchema",
397
- "responseFormat",
398
- "contextSchema",
399
- "includeAgentName",
400
- "version",
401
- "middleware",
402
- "backend",
403
- "store",
404
- "runtimeMemory",
405
- "taskDescription",
406
- "generalPurposeAgent",
407
- "filesystem",
408
- ]);
409
- return {
410
- ...readSharedAgentConfig(config),
411
- ...(typeof config.backend === "object" && config.backend ? { backend: config.backend } : {}),
412
- ...(typeof config.store === "object" && config.store ? { store: config.store } : {}),
413
- ...(typeof config.runtimeMemory === "object" && config.runtimeMemory ? { runtimeMemory: config.runtimeMemory } : {}),
414
- ...(typeof config.taskDescription === "string" && config.taskDescription.trim() ? { taskDescription: config.taskDescription } : {}),
415
- ...(typeof config.generalPurposeAgent === "boolean" ? { generalPurposeAgent: config.generalPurposeAgent } : {}),
376
+ ...readSharedAgentConfigFields(config),
377
+ ...(options.includeObjectBackend && typeof config.backend === "object" && config.backend ? { backend: config.backend } : {}),
416
378
  ...(passthrough ? { passthrough } : {}),
417
379
  };
418
380
  }
419
381
  export function parseAgentItem(item, sourcePath) {
420
382
  const moduleRoot = moduleRootForSourcePath(sourcePath, "agents");
421
- const subagentRefs = readExecutionRefArray(item, "subagents");
422
- const subagentPathRefs = readExecutionPathArray(item, "subagents").map((entry) => resolveModuleRelativePath(entry, moduleRoot));
383
+ const subagentRefs = readExecutionValue(item, "subagents", readRefArray);
384
+ const subagentPathRefs = readExecutionValue(item, "subagents", readPathArray).map((entry) => resolveModuleRelativePath(entry, moduleRoot));
423
385
  const executionMode = String(resolveExecutionBackend(item) ?? "deepagent");
424
386
  const runtime = readRuntimeConfig(item);
425
387
  return {
@@ -430,16 +392,16 @@ export function parseAgentItem(item, sourcePath) {
430
392
  ? { delegation: true, memory: true }
431
393
  : { delegation: true, memory: true }),
432
394
  description: String(item.description ?? ""),
433
- modelRef: readExecutionSingleRef(item, "modelRef") ?? "",
395
+ modelRef: readExecutionValue(item, "modelRef", readSingleRef) ?? "",
434
396
  runRoot: typeof runtime?.runRoot === "string" ? runtime.runRoot : undefined,
435
- toolRefs: readExecutionRefArray(item, "tools"),
436
- mcpServers: readExecutionObjectArray(item, "mcpServers"),
437
- skillPathRefs: readExecutionPathArray(item, "skills").map((entry) => resolveModuleRelativePath(entry, moduleRoot)),
438
- memorySources: readExecutionPathArray(item, "memory").map((entry) => resolveModuleRelativePath(entry, moduleRoot)),
397
+ toolRefs: readExecutionValue(item, "tools", readRefArray),
398
+ mcpServers: readExecutionValue(item, "mcpServers", readObjectArray),
399
+ skillPathRefs: readExecutionValue(item, "skills", readPathArray).map((entry) => resolveModuleRelativePath(entry, moduleRoot)),
400
+ memorySources: readExecutionValue(item, "memory", readPathArray).map((entry) => resolveModuleRelativePath(entry, moduleRoot)),
439
401
  subagentRefs,
440
402
  subagentPathRefs,
441
- langchainAgentConfig: normalizeModuleAgentConfig(readLangchainAgentConfig(item), moduleRoot),
442
- deepAgentConfig: normalizeModuleAgentConfig(readDeepAgentConfig(item), moduleRoot),
403
+ langchainAgentConfig: normalizeModuleAgentConfig(readAgentConfig(item), moduleRoot),
404
+ deepAgentConfig: normalizeModuleAgentConfig(readAgentConfig(item, { includeObjectBackend: true }), moduleRoot),
443
405
  sourcePath,
444
406
  };
445
407
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botbotgo/agent-harness",
3
- "version": "0.0.100",
3
+ "version": "0.0.101",
4
4
  "description": "Workspace runtime for multi-agent applications",
5
5
  "type": "module",
6
6
  "packageManager": "npm@10.9.2",
@@ -1 +0,0 @@
1
- export * from "./maintenance/checkpoint-maintenance.js";
@@ -1 +0,0 @@
1
- export * from "./maintenance/checkpoint-maintenance.js";
@@ -1 +0,0 @@
1
- export * from "./maintenance/file-checkpoint-saver.js";
@@ -1 +0,0 @@
1
- export * from "./maintenance/file-checkpoint-saver.js";
@@ -1 +0,0 @@
1
- export * from "./maintenance/sqlite-maintained-checkpoint-saver.js";
@@ -1 +0,0 @@
1
- export * from "./maintenance/sqlite-maintained-checkpoint-saver.js";