@theokit/agents 1.1.0 → 2.0.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.
package/dist/bridge.js CHANGED
@@ -43,7 +43,7 @@ import {
43
43
  streamAgentUIMessages,
44
44
  toAgentFactory,
45
45
  translateSdkEvent
46
- } from "./chunk-3HI6O5GI.js";
46
+ } from "./chunk-K3VX4S65.js";
47
47
  import "./chunk-7QVYU63E.js";
48
48
  export {
49
49
  AGENT_BRAND,
@@ -2,6 +2,14 @@ import {
2
2
  __name
3
3
  } from "./chunk-7QVYU63E.js";
4
4
 
5
+ // src/errors.ts
6
+ var ConfigurationError = class extends Error {
7
+ static {
8
+ __name(this, "ConfigurationError");
9
+ }
10
+ name = "ConfigurationError";
11
+ };
12
+
5
13
  // src/bridge/define-agent.ts
6
14
  var AGENT_BRAND = /* @__PURE__ */ Symbol.for("theokit.agent.definition");
7
15
  function defineAgent(config) {
@@ -138,14 +146,6 @@ function compileApprovals(def) {
138
146
  }
139
147
  __name(compileApprovals, "compileApprovals");
140
148
 
141
- // src/errors.ts
142
- var ConfigurationError = class extends Error {
143
- static {
144
- __name(this, "ConfigurationError");
145
- }
146
- name = "ConfigurationError";
147
- };
148
-
149
149
  // src/bridge/compile-context-window.ts
150
150
  var STRATEGY_KNOBS = [
151
151
  "compactionStrategy",
@@ -228,12 +228,12 @@ function compileTools(toolboxes, toolboxInstances) {
228
228
  for (const tb of toolboxes) {
229
229
  const instance = toolboxInstances.get(tb.class);
230
230
  if (!instance) {
231
- throw new Error(`[@theokit/agents] Toolbox ${tb.class.name} not instantiated \u2014 add to providers or pass instances.`);
231
+ throw new ConfigurationError(`toolbox: ${tb.class.name} n\xE3o foi instanciado \u2014 passe a inst\xE2ncia em \`toolboxInstances\``);
232
232
  }
233
233
  for (const tool of tb.tools) {
234
234
  const handler = instance[tool.propertyKey];
235
235
  if (typeof handler !== "function") {
236
- throw new Error(`[@theokit/agents] Toolbox ${tb.class.name}: '${String(tool.propertyKey)}' is not a function.`);
236
+ throw new ConfigurationError(`toolbox: ${tb.class.name}.${String(tool.propertyKey)} n\xE3o \xE9 um m\xE9todo (tool "${tool.config.name}")`);
237
237
  }
238
238
  const name = toolRuntimeName(tb.namespace, tool.config.name);
239
239
  tools.push({
@@ -3352,11 +3352,11 @@ function matchRoute(routes, method, pathname) {
3352
3352
  __name(matchRoute, "matchRoute");
3353
3353
 
3354
3354
  export {
3355
+ ConfigurationError,
3355
3356
  AGENT_BRAND,
3356
3357
  isAgentDefinition,
3357
3358
  compileAgentDefinition,
3358
3359
  compileSkillsSelection,
3359
- ConfigurationError,
3360
3360
  compileContextWindow,
3361
3361
  compileSkills,
3362
3362
  toolRuntimeName,
@@ -3424,4 +3424,4 @@ export {
3424
3424
  generateAgentManifest,
3425
3425
  agentsPlugin
3426
3426
  };
3427
- //# sourceMappingURL=chunk-3HI6O5GI.js.map
3427
+ //# sourceMappingURL=chunk-K3VX4S65.js.map