@wrongstack/runtime 0.313.1 → 0.316.1

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.
@@ -1,5 +1,6 @@
1
+ import type { EventBus } from '@wrongstack/core/kernel';
1
2
  import type { ToolRegistry } from '@wrongstack/core/registry';
2
- import type { ConcreteTokenSavingTier, MemoryPort, Tool, ToolDescriptionModeConfig, ToolResultRenderModeConfig } from '@wrongstack/core/types';
3
+ import type { AutoThinConfig, ConcreteTokenSavingTier, DisabledToolMeta, MemoryPort, Tool, ToolDescriptionModeConfig, ToolResultRenderModeConfig } from '@wrongstack/core/types';
3
4
  import { type VectorMemoryStore } from '@wrongstack/vector-memory';
4
5
  export interface CanonicalHostToolRegistrationOptions {
5
6
  registry: ToolRegistry;
@@ -36,6 +37,25 @@ export interface CanonicalHostToolRegistrationOptions {
36
37
  descriptionMode?: ToolDescriptionModeConfig | undefined;
37
38
  resultRenderMode?: ToolResultRenderModeConfig | undefined;
38
39
  disabledTools?: readonly string[] | undefined;
40
+ /**
41
+ * Audit-trail metadata for `disabledTools` — written by `/tool autothin
42
+ * apply` and consumed by `boot-time auto-thin` so the decision survives
43
+ * restarts. Pair with `disabledTools`: the names live in both, the
44
+ * `reason`/`at` lives here.
45
+ */
46
+ disabledToolMeta?: Readonly<Record<string, DisabledToolMeta>> | undefined;
47
+ /**
48
+ * Stats-driven tool auto-thinning policy (`tools.autoThin`). When provided,
49
+ * the host's boot-time auto-apply uses it to disable underused tools.
50
+ * Pair with `events` so the registry can emit `tool.thinned`.
51
+ */
52
+ autoThin?: AutoThinConfig | undefined;
53
+ /**
54
+ * EventBus the registry should publish `tool.thinned` on. Optional —
55
+ * `thinUnderused()` is a no-op (with a warning) if the registry has no
56
+ * bus. Hosts that wire `wireMetricsToEvents` already have one.
57
+ */
58
+ events?: EventBus | undefined;
39
59
  }
40
60
  export interface CanonicalHostToolRegistrationResult {
41
61
  builtinTools: readonly Tool[];
@@ -9,6 +9,7 @@ import {
9
9
  searchMemoryTool
10
10
  } from "@wrongstack/tools/memory";
11
11
  import { registerBuiltinToolTier, selectBuiltinToolsForTier } from "@wrongstack/tools/tool-tier";
12
+ import { createVectorMemoryTools } from "@wrongstack/vector-memory";
12
13
 
13
14
  // src/kanban-ports.ts
14
15
  import { setKanbanBoundaryOps, setKanbanDispatch } from "@wrongstack/core/coordination";
@@ -68,7 +69,6 @@ function wireKanbanPorts() {
68
69
  }
69
70
 
70
71
  // src/tool-registration.ts
71
- import { createVectorMemoryTools } from "@wrongstack/vector-memory";
72
72
  var DIRECT_LAZY_GATEWAYS = ["tool_search", "tool_use", "tool_help"];
73
73
  function registerCanonicalHostTools(options) {
74
74
  wireKanbanPorts();
@@ -127,7 +127,9 @@ function registerCanonicalHostTools(options) {
127
127
  }
128
128
  applyToolDescriptionModes(options.registry, options.descriptionMode);
129
129
  applyToolResultRenderModes(options.registry, options.resultRenderMode);
130
+ if (options.events) options.registry.setEventBus(options.events);
130
131
  if (options.disabledTools) options.registry.applyDisabled([...options.disabledTools]);
132
+ if (options.disabledToolMeta) options.registry.applyDisabledMeta(options.disabledToolMeta);
131
133
  return { builtinTools, memoryBackend };
132
134
  }
133
135
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wrongstack/runtime",
3
- "version": "0.313.1",
3
+ "version": "0.316.1",
4
4
  "license": "MIT",
5
5
  "description": "WrongStack default runtime implementations and host-level composition helpers built on @wrongstack/core.",
6
6
  "repository": {
@@ -64,17 +64,17 @@
64
64
  "README.md"
65
65
  ],
66
66
  "dependencies": {
67
- "@wrongstack/core": "0.313.1",
68
- "@wrongstack/sage": "0.313.1",
69
- "@wrongstack/governance": "0.313.1",
70
- "@wrongstack/kanban": "0.313.1",
71
- "@wrongstack/tools": "0.313.1",
72
- "@wrongstack/vector-memory": "0.313.1"
67
+ "@wrongstack/kanban": "0.316.1",
68
+ "@wrongstack/core": "0.316.1",
69
+ "@wrongstack/governance": "0.316.1",
70
+ "@wrongstack/sage": "0.316.1",
71
+ "@wrongstack/tools": "0.316.1",
72
+ "@wrongstack/vector-memory": "0.316.1"
73
73
  },
74
74
  "devDependencies": {
75
75
  "@types/node": "^26.2.0",
76
76
  "typescript": "^7.0.2",
77
- "@wrongstack/wrongtrace": "0.313.1"
77
+ "@wrongstack/wrongtrace": "0.316.1"
78
78
  },
79
79
  "publishConfig": {
80
80
  "access": "public"