@wrongstack/core 0.267.0 → 0.268.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 (74) hide show
  1. package/dist/{agent-bridge-STJ3JwwK.d.ts → agent-bridge-UhojbpWx.d.ts} +1 -1
  2. package/dist/{agent-subagent-runner-CzPGP3jA.d.ts → agent-subagent-runner-Bvtf1o9K.d.ts} +7 -7
  3. package/dist/{brain-Cdg77tVN.d.ts → brain-69wzMKp1.d.ts} +1 -1
  4. package/dist/{compactor-iMZ84CXq.d.ts → compactor-CBQAJoDc.d.ts} +1 -1
  5. package/dist/{config-Du3pYYln.d.ts → config-VKfOZ-6X.d.ts} +70 -2
  6. package/dist/{context-dT5Ueund.d.ts → context-C0U8B9NF.d.ts} +24 -1
  7. package/dist/coordination/index.d.ts +56 -160
  8. package/dist/coordination/index.js +333 -63
  9. package/dist/coordination/index.js.map +1 -1
  10. package/dist/defaults/index.d.ts +26 -25
  11. package/dist/defaults/index.js +94 -68
  12. package/dist/defaults/index.js.map +1 -1
  13. package/dist/execution/index.d.ts +72 -16
  14. package/dist/execution/index.js +151 -36
  15. package/dist/execution/index.js.map +1 -1
  16. package/dist/execution/prompt-enhancer.d.ts +1 -1
  17. package/dist/extension/index.d.ts +7 -6
  18. package/dist/global-mailbox-KByEFFBa.d.ts +663 -0
  19. package/dist/{goal-preamble-SulMTowG.d.ts → goal-preamble-CrYjmdw4.d.ts} +9 -9
  20. package/dist/{goal-store-CABDwdFE.d.ts → goal-store-Y_zdLZ3q.d.ts} +1 -1
  21. package/dist/hq/index.d.ts +195 -0
  22. package/dist/hq/index.js +1884 -0
  23. package/dist/hq/index.js.map +1 -0
  24. package/dist/{index-IEuxQd-E.d.ts → index-BfaS-f_m.d.ts} +2 -2
  25. package/dist/{index-DtCVWel4.d.ts → index-CtQnmkaS.d.ts} +8 -8
  26. package/dist/{index-Bms0m4oy.d.ts → index-gCv830d7.d.ts} +5 -5
  27. package/dist/index.d.ts +46 -42
  28. package/dist/index.js +2955 -1498
  29. package/dist/index.js.map +1 -1
  30. package/dist/infrastructure/index.d.ts +6 -6
  31. package/dist/infrastructure/index.js +45 -18
  32. package/dist/infrastructure/index.js.map +1 -1
  33. package/dist/kernel/index.d.ts +10 -9
  34. package/dist/{pipeline-BfD2k1rT.d.ts → mailbox-types-Ct2hJq0P.d.ts} +1 -244
  35. package/dist/{mcp-servers-C2cBTxUR.d.ts → mcp-servers-HT3Fi7Bl.d.ts} +10 -4
  36. package/dist/models/index.d.ts +5 -5
  37. package/dist/models/index.js +3 -2
  38. package/dist/models/index.js.map +1 -1
  39. package/dist/{models-registry-BqGZNJQ-.d.ts → models-registry-Bvcl3Vaa.d.ts} +1 -1
  40. package/dist/{multi-agent-coordinator-B8R43uPz.d.ts → multi-agent-coordinator-BACjsmkC.d.ts} +1 -1
  41. package/dist/{null-fleet-bus-CnXa5oTH.d.ts → null-fleet-bus-DA7fvhUg.d.ts} +6 -6
  42. package/dist/observability/index.d.ts +2 -2
  43. package/dist/{parallel-eternal-engine-DdNnw9BQ.d.ts → parallel-eternal-engine-Ci71gYu_.d.ts} +9 -15
  44. package/dist/{path-resolver-COIMLCQL.d.ts → path-resolver-O1IJnmKE.d.ts} +4 -3
  45. package/dist/{permission-B75JAi3-.d.ts → permission-Bd-57Lbl.d.ts} +1 -1
  46. package/dist/{permission-policy-DlR9eJAM.d.ts → permission-policy-uNXC6Kge.d.ts} +2 -3
  47. package/dist/pipeline-BDNvENyV.d.ts +245 -0
  48. package/dist/{plan-templates-DSIKCXZN.d.ts → plan-templates-EMsalEtN.d.ts} +5 -5
  49. package/dist/{provider-model-resolve-BNRsNuJx.d.ts → provider-model-resolve-CEb9x886.d.ts} +3 -3
  50. package/dist/{provider-runner-CX7iIvox.d.ts → provider-runner-DWJbpo70.d.ts} +3 -3
  51. package/dist/{retry-policy-BilV1ujH.d.ts → retry-policy-C3s_lvdK.d.ts} +1 -1
  52. package/dist/sdd/index.d.ts +9 -8
  53. package/dist/sdd/index.js +32 -2
  54. package/dist/sdd/index.js.map +1 -1
  55. package/dist/{secret-vault-gkvEZZfE.d.ts → secret-vault-Cgduf5xL.d.ts} +1 -1
  56. package/dist/security/index.d.ts +5 -5
  57. package/dist/security/index.js +39 -29
  58. package/dist/security/index.js.map +1 -1
  59. package/dist/{selector-Bc7eWtT3.d.ts → selector-47LBnBVk.d.ts} +1 -1
  60. package/dist/{session-event-bridge-D-araDEz.d.ts → session-event-bridge-Cw7oqmW2.d.ts} +1 -1
  61. package/dist/{session-reader-D7Dapswh.d.ts → session-reader-DD4v2Obw.d.ts} +1 -1
  62. package/dist/storage/index.d.ts +14 -12
  63. package/dist/storage/index.js +63 -36
  64. package/dist/storage/index.js.map +1 -1
  65. package/dist/tools/index.d.ts +2 -2
  66. package/dist/tools/index.js +166 -31
  67. package/dist/tools/index.js.map +1 -1
  68. package/dist/types/index.d.ts +20 -19
  69. package/dist/types/index.js +68 -51
  70. package/dist/types/index.js.map +1 -1
  71. package/dist/utils/index.d.ts +22 -3
  72. package/dist/utils/index.js +139 -1
  73. package/dist/utils/index.js.map +1 -1
  74. package/package.json +5 -1
@@ -1,23 +1,24 @@
1
- export { C as CompactorOptions, a as DefaultErrorHandler, b as DefaultRetryPolicy, E as EternalAutonomyEngine, c as EternalAutonomyOptions, d as EternalEngineState, H as HybridCompactor, I as IterationStage, P as ParallelEngineState, e as ParallelEternalEngine, f as ParallelEternalOptions, g as ParallelIterationStage, T as ToolExecutor } from '../parallel-eternal-engine-DdNnw9BQ.js';
2
- export { A as AutoCompactionMiddleware, a as AutonomousRunner, b as AutonomousRunnerOptions, c as AutonomyPromptContributorOptions, C as CompactorStrategy, l as ContextWindowBudgetSnapshot, D as DefaultSkillLoader, d as DoneCheckResult, e as DoneConditionChecker, I as IntelligentCompactor, f as IntelligentCompactorOptions, S as SelectiveCompactor, g as SelectiveCompactorOptions, h as SkillLoaderOptions, i as StrategyCompactorOptions, j as buildGoalPreamble, k as createStrategyCompactor, m as makeAutonomyPromptContributor } from '../goal-preamble-SulMTowG.js';
3
- import { P as Provider } from '../context-dT5Ueund.js';
4
- import { e as BrainDecision, h as BrainDecisionRequest, B as BrainArbiter } from '../brain-Cdg77tVN.js';
5
- import '../retry-policy-BilV1ujH.js';
6
- import '../compactor-iMZ84CXq.js';
7
- import '../config-Du3pYYln.js';
8
- import '../index-Bms0m4oy.js';
1
+ export { C as CompactorOptions, a as DefaultErrorHandler, b as DefaultRetryPolicy, E as EternalAutonomyEngine, c as EternalAutonomyOptions, d as EternalEngineState, H as HybridCompactor, I as IterationStage, P as ParallelEngineState, e as ParallelEternalEngine, f as ParallelEternalOptions, g as ParallelIterationStage, T as ToolExecutor } from '../parallel-eternal-engine-Ci71gYu_.js';
2
+ export { A as AutoCompactionMiddleware, a as AutonomousRunner, b as AutonomousRunnerOptions, c as AutonomyPromptContributorOptions, C as CompactorStrategy, l as ContextWindowBudgetSnapshot, D as DefaultSkillLoader, d as DoneCheckResult, e as DoneConditionChecker, I as IntelligentCompactor, f as IntelligentCompactorOptions, S as SelectiveCompactor, g as SelectiveCompactorOptions, h as SkillLoaderOptions, i as StrategyCompactorOptions, j as buildGoalPreamble, k as createStrategyCompactor, m as makeAutonomyPromptContributor } from '../goal-preamble-CrYjmdw4.js';
3
+ import { P as Provider, l as ReasoningConfig, R as Request } from '../context-C0U8B9NF.js';
4
+ import { e as BrainDecision, h as BrainDecisionRequest, B as BrainArbiter } from '../brain-69wzMKp1.js';
5
+ import { B as ModelRuntimeConfig } from '../config-VKfOZ-6X.js';
6
+ import '../retry-policy-C3s_lvdK.js';
7
+ import '../compactor-CBQAJoDc.js';
8
+ import '../index-gCv830d7.js';
9
9
  import '../logger-B63L5bTg.js';
10
- import '../pipeline-BfD2k1rT.js';
10
+ import '../pipeline-BDNvENyV.js';
11
+ import '../mailbox-types-Ct2hJq0P.js';
11
12
  import '../observability-D-HZN_mF.js';
12
- import '../permission-B75JAi3-.js';
13
- import '../agent-subagent-runner-CzPGP3jA.js';
14
- import '../goal-store-CABDwdFE.js';
15
- import '../multi-agent-coordinator-B8R43uPz.js';
13
+ import '../permission-Bd-57Lbl.js';
14
+ import '../agent-subagent-runner-Bvtf1o9K.js';
15
+ import '../goal-store-Y_zdLZ3q.js';
16
+ import '../multi-agent-coordinator-BACjsmkC.js';
16
17
  import 'node:events';
17
18
  import '../skill-DGIXCtdv.js';
18
19
  import '../wstack-paths-hOpNLmvf.js';
19
- import '../selector-Bc7eWtT3.js';
20
- import '../session-event-bridge-D-araDEz.js';
20
+ import '../selector-47LBnBVk.js';
21
+ import '../session-event-bridge-Cw7oqmW2.js';
21
22
 
22
23
  /**
23
24
  * AutonomyBrain — a self-driving decision layer for autonomous workflows.
@@ -108,4 +109,59 @@ declare function createAutonomyBrain(opts: AutonomyBrainOptions): BrainArbiter;
108
109
  */
109
110
  declare function formatDecisionSummary(decision: BrainDecision, request: BrainDecisionRequest): string;
110
111
 
111
- export { type AutonomyBrainOptions, type BrainAutoRisk, type TieredBrainArbiterOptions, createAutonomyBrain, createTieredBrainArbiter, formatDecisionSummary };
112
+ /**
113
+ * Model-runtime resolver + request-pipeline middleware.
114
+ *
115
+ * Maps the shared `Config.modelRuntime` settings into the per-request
116
+ * `Request.reasoning` and `Request.cache` fields, gated by the active model's
117
+ * `reasoningConfig` capabilities so unsupported values are omitted (and
118
+ * surfaced as warnings) instead of triggering provider 400s.
119
+ *
120
+ * Wired once at boot (REPL/TUI/WebUI all go through the same `request`
121
+ * pipeline) — see `installModelRuntimeMiddleware()`. UIs only need to mutate
122
+ * `Config.modelRuntime` (and persist) for the change to take effect on the next
123
+ * request.
124
+ */
125
+
126
+ interface ResolvedModelRuntime {
127
+ reasoning: Request['reasoning'];
128
+ cache: Request['cache'];
129
+ /** Human-readable warnings for settings that were ignored for this model. */
130
+ warnings: string[];
131
+ }
132
+ /**
133
+ * Resolve user-facing runtime settings into request fields for a specific
134
+ * model capability profile. Pure function — safe to unit-test without a
135
+ * provider or event bus.
136
+ *
137
+ * @param settings `Config.modelRuntime` (may be undefined → no-op)
138
+ * @param reasoning The model's `reasoningConfig`, or undefined when unknown.
139
+ * When undefined the resolver is conservative: explicit
140
+ * on/off is suppressed (provider default wins) and effort is
141
+ * dropped, because we cannot tell whether the model will
142
+ * accept the fields.
143
+ */
144
+ declare function resolveModelRuntime(settings: ModelRuntimeConfig | undefined, reasoning: ReasoningConfig | undefined): ResolvedModelRuntime;
145
+ declare function resolveReasoningForRequest(settings: ModelRuntimeConfig, rc: ReasoningConfig | undefined, warnings: string[]): Request['reasoning'];
146
+ declare function resolveCacheForRequest(settings: ModelRuntimeConfig, _warnings: string[]): Request['cache'];
147
+ interface ModelRuntimeMiddlewareOptions {
148
+ /** Provider id of the active model, for logging/diagnostics only. */
149
+ providerId?: string | undefined;
150
+ /** Model id of the active model, for logging/diagnostics only. */
151
+ modelId?: string | undefined;
152
+ /** Current runtime settings. Called per-request so live changes apply. */
153
+ getSettings(): ModelRuntimeConfig | undefined;
154
+ /** Current model capability profile. Called per-request. */
155
+ getReasoningConfig(): ReasoningConfig | undefined;
156
+ /** Optional sink for suppressed-setting warnings (e.g. emit to event bus). */
157
+ onWarning?: ((message: string) => void) | undefined;
158
+ }
159
+ /**
160
+ * Build a `request`-pipeline middleware that applies runtime settings. The
161
+ * returned function mutates the outgoing request by overlaying resolved
162
+ * `reasoning` / `cache` fields. Existing fields on the request are preserved
163
+ * only when the resolver produces nothing for that field.
164
+ */
165
+ declare function applyModelRuntime(req: Request, opts: ModelRuntimeMiddlewareOptions): Request;
166
+
167
+ export { type AutonomyBrainOptions, type BrainAutoRisk, type ModelRuntimeMiddlewareOptions, type ResolvedModelRuntime, type TieredBrainArbiterOptions, applyModelRuntime, createAutonomyBrain, createTieredBrainArbiter, formatDecisionSummary, resolveCacheForRequest, resolveModelRuntime, resolveReasoningForRequest };
@@ -1765,6 +1765,41 @@ function truncate(s, max) {
1765
1765
  return s.length <= max ? s : `${s.slice(0, max - 1)}\u2026`;
1766
1766
  }
1767
1767
 
1768
+ // src/utils/tool-subject.ts
1769
+ var GLOB_METACHARACTERS = /[*?[\]]/g;
1770
+ function escapeGlobSubject(value) {
1771
+ return value.replace(GLOB_METACHARACTERS, (char) => `\\${char}`);
1772
+ }
1773
+ function normalizePathSubject(value) {
1774
+ return escapeGlobSubject(value.replace(/\\/g, "/"));
1775
+ }
1776
+ function isPathSubjectKey(subjectKey) {
1777
+ return subjectKey === "path" || subjectKey === "file" || subjectKey === "files";
1778
+ }
1779
+ function subjectForToolInput(toolName, input, subjectKey) {
1780
+ if (!input || typeof input !== "object") return void 0;
1781
+ const obj = input;
1782
+ if (subjectKey) {
1783
+ const value = obj[subjectKey];
1784
+ if (typeof value === "string") {
1785
+ return isPathSubjectKey(subjectKey) ? normalizePathSubject(value) : escapeGlobSubject(value);
1786
+ }
1787
+ }
1788
+ if (toolName === "bash" && typeof obj.command === "string") {
1789
+ return escapeGlobSubject(obj.command);
1790
+ }
1791
+ if (typeof obj.path === "string") {
1792
+ return normalizePathSubject(obj.path);
1793
+ }
1794
+ if (typeof obj.url === "string") {
1795
+ return escapeGlobSubject(obj.url);
1796
+ }
1797
+ if (typeof obj.name === "string") {
1798
+ return escapeGlobSubject(obj.name);
1799
+ }
1800
+ return void 0;
1801
+ }
1802
+
1768
1803
  // src/utils/tool-output-serializer.ts
1769
1804
  var DEFAULT_LIST_LIMIT = 500;
1770
1805
  var LOG_ENTRY_LIMIT = 200;
@@ -2994,7 +3029,7 @@ ${errorDetails}`,
2994
3029
  return { result, tool, durationMs: Date.now() - start };
2995
3030
  }
2996
3031
  } else {
2997
- const suggestedPattern = this.subjectFor(tool.name, use.input, tool.subjectKey) ?? tool.name;
3032
+ const suggestedPattern = subjectForToolInput(tool.name, use.input, tool.subjectKey) ?? tool.name;
2998
3033
  const pending = {
2999
3034
  type: "tool_confirm_pending",
3000
3035
  toolUseId: use.id,
@@ -3273,38 +3308,6 @@ ${excerpt}`;
3273
3308
  budgetForString(content, budget) {
3274
3309
  return Math.max(0, budget - Buffer.byteLength(content, "utf8"));
3275
3310
  }
3276
- /**
3277
- * Compute the suggestedPattern string for a tool+input pair.
3278
- * Matches the logic in DefaultPermissionPolicy so the TUI shows the
3279
- * same subject that the trust file would use.
3280
- */
3281
- subjectFor(toolName, input, subjectKey) {
3282
- if (!input || typeof input !== "object") return void 0;
3283
- const obj = input;
3284
- const globChars = /[*?[\]]/g;
3285
- const escapeGlob = (s) => s.replace(globChars, (c) => `\\${c}`);
3286
- const normalizePath = (s) => escapeGlob(s.replace(/\\/g, "/"));
3287
- if (subjectKey) {
3288
- const v = obj[subjectKey];
3289
- if (typeof v === "string") {
3290
- const isPathKey = subjectKey === "path" || subjectKey === "file" || subjectKey === "files";
3291
- return isPathKey ? normalizePath(v) : escapeGlob(v);
3292
- }
3293
- }
3294
- if (toolName === "bash" && typeof obj.command === "string") {
3295
- return escapeGlob(obj.command);
3296
- }
3297
- if (typeof obj.path === "string") {
3298
- return normalizePath(obj.path);
3299
- }
3300
- if (typeof obj.url === "string") {
3301
- return escapeGlob(obj.url);
3302
- }
3303
- if (typeof obj.name === "string") {
3304
- return escapeGlob(obj.name);
3305
- }
3306
- return void 0;
3307
- }
3308
3311
  };
3309
3312
  function clampTimeoutMs(timeoutMs, maxTimeoutMs) {
3310
3313
  const fallback = 3e5;
@@ -7313,7 +7316,27 @@ Working rules:
7313
7316
  id: "devops",
7314
7317
  name: "DevOps",
7315
7318
  role: "devops",
7316
- tools: [...TOOLS.build],
7319
+ tools: [
7320
+ ...TOOLS.build,
7321
+ "mcp__ssh__ssh_list_servers",
7322
+ "mcp__ssh__ssh_connection_status",
7323
+ "mcp__ssh__ssh_execute",
7324
+ "mcp__ssh__ssh_execute_sudo",
7325
+ "mcp__ssh__ssh_upload",
7326
+ "mcp__ssh__ssh_download",
7327
+ "mcp__ssh__ssh_sync",
7328
+ "mcp__ssh__ssh_deploy",
7329
+ "mcp__ssh__ssh_health_check",
7330
+ "mcp__ssh__ssh_service_status",
7331
+ "mcp__ssh__ssh_process_manager",
7332
+ "mcp__ssh__ssh_tunnel",
7333
+ "mcp__ssh__ssh_backup_create",
7334
+ "mcp__ssh__ssh_backup_list",
7335
+ "mcp__ssh__ssh_backup_restore",
7336
+ "mcp__ssh__ssh_db_list",
7337
+ "mcp__ssh__ssh_db_query",
7338
+ "mcp__ssh__ssh_profile"
7339
+ ],
7317
7340
  prompt: `You are the DevOps agent. Your job is CI/CD, containerization, and
7318
7341
  deployment configuration: make builds reproducible and deploys safe.
7319
7342
 
@@ -7322,6 +7345,7 @@ Scope:
7322
7345
  - Write Dockerfiles/compose and optimize image size and layer caching
7323
7346
  - Configure deployment (env, secrets handling, health checks, rollback)
7324
7347
  - Diagnose flaky/broken pipelines
7348
+ - Use optional SSH MCP tools for remote hosts when the 'ssh' MCP server is enabled: list servers, run health checks, inspect services, transfer/deploy files, and open tunnels
7325
7349
 
7326
7350
  Input format you accept:
7327
7351
  { "task": "ci | container | deploy | fix-pipeline", "platform": "github-actions | gitlab | docker | k8s", "target": "<what>" }
@@ -7336,7 +7360,8 @@ Working rules:
7336
7360
  - Never hardcode secrets in config; reference the secret store
7337
7361
  - Pin versions for reproducible builds; avoid floating :latest
7338
7362
  - Every deploy path needs a rollback and a health check
7339
- - Treat CI/CD changes as high-risk \u2014 explain blast radius before applying`
7363
+ - Treat CI/CD changes as high-risk \u2014 explain blast radius before applying
7364
+ - For remote SSH work, start with ssh_list_servers / ssh_connection_status, prefer read-only checks first, and do not run destructive commands without explicit user approval`
7340
7365
  },
7341
7366
  budget: MEDIUM_BUDGET,
7342
7367
  capability: {
@@ -7353,6 +7378,13 @@ Working rules:
7353
7378
  "kubernetes",
7354
7379
  "k8s",
7355
7380
  "deploy",
7381
+ "ssh",
7382
+ "remote ssh",
7383
+ "remote server",
7384
+ "sftp",
7385
+ "tunnel",
7386
+ "bastion",
7387
+ "jump host",
7356
7388
  "github actions",
7357
7389
  "container"
7358
7390
  ]
@@ -8935,6 +8967,7 @@ var DefaultMultiAgentCoordinator = class _DefaultMultiAgentCoordinator extends E
8935
8967
  subagentId: result.subagentId,
8936
8968
  taskId: result.taskId,
8937
8969
  status: result.status,
8970
+ result: result.result,
8938
8971
  iterations: result.iterations,
8939
8972
  toolCalls: result.toolCalls,
8940
8973
  durationMs: result.durationMs
@@ -9868,6 +9901,88 @@ function parseDescriptionFromText(desc) {
9868
9901
  return { trigger, scope };
9869
9902
  }
9870
9903
 
9871
- export { AutoCompactionMiddleware, AutonomousRunner, DefaultErrorHandler, DefaultRetryPolicy, DefaultSkillLoader, DoneConditionChecker, EternalAutonomyEngine, HybridCompactor, IntelligentCompactor, ParallelEternalEngine, SelectiveCompactor, ToolExecutor, buildGoalPreamble, createAutonomyBrain, createStrategyCompactor, createTieredBrainArbiter, formatDecisionSummary, makeAutonomyPromptContributor };
9904
+ // src/execution/model-runtime.ts
9905
+ function resolveModelRuntime(settings, reasoning) {
9906
+ const warnings = [];
9907
+ if (!settings) {
9908
+ return { reasoning: void 0, cache: void 0, warnings };
9909
+ }
9910
+ const reasoningField = resolveReasoningForRequest(settings, reasoning, warnings);
9911
+ const cacheField = resolveCacheForRequest(settings);
9912
+ return { reasoning: reasoningField, cache: cacheField, warnings };
9913
+ }
9914
+ function resolveReasoningForRequest(settings, rc, warnings) {
9915
+ const cfg = settings.reasoning;
9916
+ if (!cfg) return void 0;
9917
+ const capKnown = rc !== void 0;
9918
+ const supportsReasoning = rc ? rc.default !== "disabled" || rc.disableSupported || rc.effortSupported : false;
9919
+ const out = {};
9920
+ if (cfg.mode === "off") {
9921
+ if (capKnown && rc?.disableSupported) {
9922
+ out.enabled = false;
9923
+ } else if (capKnown && rc && rc.default === "always_on") {
9924
+ warnings.push(
9925
+ 'reasoning "off" requested, but this model has thinking always on; the disable field was omitted to avoid a provider error.'
9926
+ );
9927
+ } else if (capKnown && rc && !rc.disableSupported) {
9928
+ warnings.push('reasoning "off" requested, but this model does not support disabling thinking; the setting was omitted.');
9929
+ } else {
9930
+ warnings.push('reasoning "off" requested, but model capabilities are unknown; the setting was omitted.');
9931
+ }
9932
+ } else if (cfg.mode === "on") {
9933
+ if (!capKnown) {
9934
+ warnings.push('reasoning "on" requested, but model capabilities are unknown; the setting was omitted.');
9935
+ } else if (!supportsReasoning && rc?.default === "disabled") {
9936
+ warnings.push('reasoning "on" requested, but this model has reasoning disabled by default and does not advertise support; the setting was omitted.');
9937
+ } else {
9938
+ out.enabled = true;
9939
+ }
9940
+ }
9941
+ const effort = cfg.effort;
9942
+ if (effort !== void 0) {
9943
+ if (capKnown && rc?.effortSupported && rc.effortLevels.includes(effort)) {
9944
+ out.effort = effort;
9945
+ } else if (capKnown && rc?.effortSupported) {
9946
+ warnings.push(
9947
+ `reasoning effort "${effort}" not supported by this model (supported: ${rc.effortLevels.join(", ")}); the setting was omitted.`
9948
+ );
9949
+ } else if (capKnown) {
9950
+ warnings.push(`reasoning effort "${effort}" requested, but this model does not support effort; the setting was omitted.`);
9951
+ } else {
9952
+ warnings.push(`reasoning effort "${effort}" requested, but model capabilities are unknown; the setting was omitted.`);
9953
+ }
9954
+ }
9955
+ if (cfg.preserve !== void 0) {
9956
+ if (capKnown && rc && rc.preserveThinking !== "unsupported") {
9957
+ out.preserve = cfg.preserve;
9958
+ } else if (capKnown) {
9959
+ warnings.push("reasoning preserve requested, but this model does not support preserved thinking; the setting was omitted.");
9960
+ }
9961
+ }
9962
+ return Object.keys(out).length > 0 ? out : void 0;
9963
+ }
9964
+ function resolveCacheForRequest(settings, _warnings) {
9965
+ const ttl = settings.cache?.ttl;
9966
+ if (ttl === void 0) return void 0;
9967
+ const out = { ttl };
9968
+ return out;
9969
+ }
9970
+ function applyModelRuntime(req, opts) {
9971
+ const settings = opts.getSettings();
9972
+ if (!settings) return req;
9973
+ const rc = opts.getReasoningConfig();
9974
+ const resolved = resolveModelRuntime(settings, rc);
9975
+ for (const w of resolved.warnings) opts.onWarning?.(w);
9976
+ const next = { ...req };
9977
+ if (resolved.reasoning !== void 0) {
9978
+ next.reasoning = resolved.reasoning;
9979
+ }
9980
+ if (resolved.cache !== void 0) {
9981
+ next.cache = resolved.cache;
9982
+ }
9983
+ return next;
9984
+ }
9985
+
9986
+ export { AutoCompactionMiddleware, AutonomousRunner, DefaultErrorHandler, DefaultRetryPolicy, DefaultSkillLoader, DoneConditionChecker, EternalAutonomyEngine, HybridCompactor, IntelligentCompactor, ParallelEternalEngine, SelectiveCompactor, ToolExecutor, applyModelRuntime, buildGoalPreamble, createAutonomyBrain, createStrategyCompactor, createTieredBrainArbiter, formatDecisionSummary, makeAutonomyPromptContributor, resolveCacheForRequest, resolveModelRuntime, resolveReasoningForRequest };
9872
9987
  //# sourceMappingURL=index.js.map
9873
9988
  //# sourceMappingURL=index.js.map