@aipack-ai/multi-agent 0.0.2 → 1.0.2

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.js CHANGED
@@ -345,6 +345,7 @@ var ExtensionManager = class {
345
345
  beforeRun: new AsyncSeriesWaterfallHook("beforeRun"),
346
346
  beforeTransform: new AsyncSeriesWaterfallHook("beforeTransform"),
347
347
  afterTransform: new AsyncSeriesWaterfallHook("afterTransform"),
348
+ beforeModelCall: new AsyncSeriesWaterfallHook("beforeModelCall"),
348
349
  beforeEmit: new AsyncSeriesHook("beforeEmit"),
349
350
  afterEmit: new AsyncSeriesHook("afterEmit"),
350
351
  done: new AsyncSeriesHook("done"),
@@ -1054,7 +1055,8 @@ var AgentRuntime = class _AgentRuntime {
1054
1055
  config: runtime._config,
1055
1056
  workspace: options.workspace ?? process.cwd(),
1056
1057
  sessionKey: runtime._sessionKey,
1057
- shared: /* @__PURE__ */ new Map()
1058
+ shared: /* @__PURE__ */ new Map(),
1059
+ runtime
1058
1060
  };
1059
1061
  runtime._extensionContext = ctx;
1060
1062
  runtime._extensions.applyAll(ctx);
@@ -2252,7 +2254,10 @@ ${text}`,
2252
2254
  });
2253
2255
  };
2254
2256
  try {
2255
- for await (const event of this._streamFn(this._model, this.buildContext(compilation.messages), options)) {
2257
+ const context = await this._hooks.beforeModelCall.promise(
2258
+ this.buildContext(compilation.messages)
2259
+ );
2260
+ for await (const event of this._streamFn(this._model, context, options)) {
2256
2261
  if (stream && event.type === "text_delta" && ttftAt === void 0) {
2257
2262
  ttftAt = Date.now();
2258
2263
  }