@theokit/sdk 5.2.0 → 5.3.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/index.js CHANGED
@@ -67,7 +67,7 @@ import './chunk-AGACYRJ2.js';
67
67
  import './chunk-JMDDYA22.js';
68
68
  import './chunk-V22DZIXO.js';
69
69
  import './chunk-NJWYQWDL.js';
70
- import { BudgetExceededError, TheokitAgentError, MemoryAdapterError, ConfigurationError, AuthenticationError } from './chunk-ALUN2B4W.js';
70
+ import { BudgetExceededError, ConfigurationError, TheokitAgentError, MemoryAdapterError, AuthenticationError } from './chunk-ALUN2B4W.js';
71
71
  export { AgentDisposedError, AgentRunError, AuthenticationError, BudgetExceededError, ConfigurationError, IntegrationNotConnectedError, InvalidTaskIdError, MemoryAdapterError, NetworkError, RateLimitError, TaskNotFoundError, TheokitAgentError, UnknownAgentError, UnsupportedBudgetOperationError, UnsupportedRunOperationError, UnsupportedTaskOperationError, isTransientError } from './chunk-ALUN2B4W.js';
72
72
  import { diag, redactSecrets, addPattern, resolveApiKey } from './chunk-CZJ6Q7CW.js';
73
73
  export { setDiagnosticsSink } from './chunk-CZJ6Q7CW.js';
@@ -924,8 +924,17 @@ var NoopMemoryProvider = class {
924
924
  var ALWAYS_REGISTERED = ["shell"];
925
925
  var MEMORY_BUILTINS = ["memory_search", "memory_get"];
926
926
  function effectiveToolNames(options) {
927
+ refuseCreatedTool(options);
927
928
  return { names: resolvableNames(options), unresolved: unresolvableSources(options) };
928
929
  }
930
+ function refuseCreatedTool(options) {
931
+ const candidate = options;
932
+ if (candidate.handler === void 0 || candidate.inputSchema === void 0) return;
933
+ throw new ConfigurationError(
934
+ `effectiveToolNames received a created tool${typeof candidate.name === "string" ? ` ("${candidate.name}")` : ""}, not AgentOptions. \`SubAgent.create()\` returns a CustomTool and closes its spec inside the handler, so the spec cannot be recovered from it. Pass the spec you built it from \u2014 keep it in a variable, or extract it into a function the test can call.`,
935
+ { code: "effective_tools_expected_options" }
936
+ );
937
+ }
929
938
  function resolvableNames(options) {
930
939
  const withheld = new Set(options.withheldBuiltinTools ?? []);
931
940
  const builtins = [