@theokit/agents 0.35.1 → 0.35.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/bridge.js CHANGED
@@ -46,7 +46,7 @@ import {
46
46
  translateToUIMessageStream,
47
47
  validateUniqueRoutes,
48
48
  walkAgentMetadata
49
- } from "./chunk-IAE4FWBV.js";
49
+ } from "./chunk-7IGNIY3B.js";
50
50
  import "./chunk-B24BAVE6.js";
51
51
  import "./chunk-7QVYU63E.js";
52
52
  export {
@@ -804,6 +804,15 @@ async function* extractThinkTagStream(source) {
804
804
  }
805
805
  __name(extractThinkTagStream, "extractThinkTagStream");
806
806
 
807
+ // src/debug-log.ts
808
+ function debugLog(marker, data) {
809
+ const flag = process.env.THEOKIT_DEBUG;
810
+ if (flag !== void 0 && flag !== "" && flag !== "0" && flag !== "false") {
811
+ console.debug(marker, data);
812
+ }
813
+ }
814
+ __name(debugLog, "debugLog");
815
+
807
816
  // src/bridge/sdk-adapter-create-options.ts
808
817
  function assembleM8CreateOptions(compiled) {
809
818
  const options = {};
@@ -1196,7 +1205,7 @@ function createSdkAgentStream(compiled, compiledTools, apiKey, overrides = {}) {
1196
1205
  } else {
1197
1206
  runContextSource = "none";
1198
1207
  }
1199
- console.debug("[THEO_AGENT_M7_RUN_CONTEXT]", {
1208
+ debugLog("[THEO_AGENT_M7_RUN_CONTEXT]", {
1200
1209
  source: runContextSource,
1201
1210
  keys: runContext !== void 0 ? Object.keys(runContext) : []
1202
1211
  });
@@ -1237,7 +1246,7 @@ async function* streamSdkAgent(rt, compiled, sdkTools, storage, opts) {
1237
1246
  };
1238
1247
  const extra = buildExtraCreateOptions(overrides, compiled);
1239
1248
  if (applied.length > 0) {
1240
- console.debug("[THEO_AGENT_M8_RUNTIME_APPLIED]", {
1249
+ debugLog("[THEO_AGENT_M8_RUNTIME_APPLIED]", {
1241
1250
  skills: applied.includes("skills"),
1242
1251
  contextWindow: applied.includes("context"),
1243
1252
  projectContext: applied.includes("projectContext")
@@ -2152,7 +2161,7 @@ __name(accumulateUsage, "accumulateUsage");
2152
2161
  function finalize(acc, round, reason, strategyName) {
2153
2162
  acc.rounds = round;
2154
2163
  acc.finishReason = reason;
2155
- console.debug(MAINLOOP_METRIC, {
2164
+ debugLog(MAINLOOP_METRIC, {
2156
2165
  strategy: strategyName,
2157
2166
  rounds: round,
2158
2167
  terminal: reason
@@ -2951,4 +2960,4 @@ export {
2951
2960
  generateAgentManifest,
2952
2961
  agentsPlugin
2953
2962
  };
2954
- //# sourceMappingURL=chunk-IAE4FWBV.js.map
2963
+ //# sourceMappingURL=chunk-7IGNIY3B.js.map