@openape/ape-agent 2.3.0 → 2.4.0

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.
Files changed (2) hide show
  1. package/dist/bridge.mjs +22 -16
  2. package/package.json +1 -1
package/dist/bridge.mjs CHANGED
@@ -4041,14 +4041,14 @@ var PATCH_INTERVAL_MS = 300;
4041
4041
  var ThreadSession = class {
4042
4042
  constructor(deps) {
4043
4043
  this.deps = deps;
4044
- this.resolvedTools = taskTools(deps.tools);
4045
4044
  }
4046
4045
  active;
4047
4046
  queue = [];
4048
4047
  history = [];
4049
- resolvedTools;
4050
- /** No-op placeholder kept for API compatibility with the previous
4051
- * RPC-listener model where dispose() detached the listener. */
4048
+ /**
4049
+ * No-op placeholder kept for API compatibility with the previous
4050
+ * RPC-listener model where dispose() detached the listener.
4051
+ */
4052
4052
  dispose() {
4053
4053
  }
4054
4054
  /** Forward an inbound chat message to the runtime. Queues if a turn is in flight. */
@@ -4088,12 +4088,13 @@ var ThreadSession = class {
4088
4088
  this.deps.log(`status patch failed: ${err instanceof Error ? err.message : String(err)}`);
4089
4089
  }
4090
4090
  };
4091
+ const { systemPrompt, tools } = this.deps.resolveConfig();
4091
4092
  try {
4092
4093
  const result = await runLoop({
4093
4094
  config: this.deps.runtimeConfig,
4094
- systemPrompt: this.deps.systemPrompt,
4095
+ systemPrompt,
4095
4096
  userMessage: body,
4096
- tools: this.resolvedTools,
4097
+ tools: taskTools(tools),
4097
4098
  maxSteps: this.deps.maxSteps,
4098
4099
  history: this.history,
4099
4100
  handlers: {
@@ -4365,16 +4366,21 @@ var Bridge = class {
4365
4366
  threadId,
4366
4367
  chat: this.chat,
4367
4368
  runtimeConfig: this.runtimeConfig(),
4368
- // Tools resolve from agent.json (latest sync from troop) on
4369
- // every new thread, so owner edits in the troop UI take
4370
- // effect after the next sync without a bridge restart.
4371
- // SOUL.md + skills are merged into the system prompt the same
4372
- // way picked up per-thread without restart.
4373
- tools: resolveTools(this.cfg.tools),
4374
- systemPrompt: composeSystemPrompt({
4375
- base: resolveSystemPrompt(this.cfg.systemPrompt),
4376
- enabledTools: resolveTools(this.cfg.tools)
4377
- }),
4369
+ // Resolve tools + systemPrompt on every turn from agent.json
4370
+ // (latest sync from troop). Owner edits in the troop UI thus
4371
+ // take effect on the very next message in an existing thread —
4372
+ // not just on a freshly-opened one. SOUL.md + skills get merged
4373
+ // into the system prompt the same way.
4374
+ resolveConfig: () => {
4375
+ const tools = resolveTools(this.cfg.tools);
4376
+ return {
4377
+ tools,
4378
+ systemPrompt: composeSystemPrompt({
4379
+ base: resolveSystemPrompt(this.cfg.systemPrompt),
4380
+ enabledTools: tools
4381
+ })
4382
+ };
4383
+ },
4378
4384
  maxSteps: this.cfg.maxSteps,
4379
4385
  log
4380
4386
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openape/ape-agent",
3
- "version": "2.3.0",
3
+ "version": "2.4.0",
4
4
  "description": "OpenApe agent runtime: per-agent process that connects to chat.openape.ai, runs the LLM loop with tools + cron tasks, and streams replies back to owners.",
5
5
  "type": "module",
6
6
  "license": "MIT",