@wrongstack/runtime 1.0.3 → 1.0.5
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/host.js +1 -1
- package/dist/index.js +13 -3
- package/dist/tool-registration.d.ts +3 -0
- package/dist/tool-registration.js +14 -2
- package/package.json +8 -8
package/dist/host.js
CHANGED
|
@@ -25,7 +25,7 @@ async function applyWrongStackPack(host, pack, opts = {}) {
|
|
|
25
25
|
unregisterExtensions[i]();
|
|
26
26
|
}
|
|
27
27
|
for (let i = registeredCommandNames.length - 1; i >= 0; i--) {
|
|
28
|
-
host.slashCommands.unregister(registeredCommandNames[i]);
|
|
28
|
+
host.slashCommands.unregister(registeredCommandNames[i], owner);
|
|
29
29
|
}
|
|
30
30
|
for (let i = registeredToolNames.length - 1; i >= 0; i--) {
|
|
31
31
|
host.tools.unregister(registeredToolNames[i]);
|
package/dist/index.js
CHANGED
|
@@ -287,6 +287,7 @@ import {
|
|
|
287
287
|
DefaultPermissionPolicy,
|
|
288
288
|
DefaultSecretScrubber,
|
|
289
289
|
DirectoryPermissionPolicy,
|
|
290
|
+
resolveYoloConfirmKinds,
|
|
290
291
|
validateDirectoryPolicy
|
|
291
292
|
} from "@wrongstack/core/security";
|
|
292
293
|
import {
|
|
@@ -437,7 +438,11 @@ function createDefaultContainer(opts) {
|
|
|
437
438
|
container.bind(TOKENS.PermissionPolicy, () => {
|
|
438
439
|
const policyOptions = {
|
|
439
440
|
trustFile: wpaths.projectTrust,
|
|
440
|
-
yolo: opts.permission?.yolo ?? false
|
|
441
|
+
yolo: opts.permission?.yolo ?? false,
|
|
442
|
+
// Which kinds of damage still prompt under YOLO. Read from the user's
|
|
443
|
+
// profile config; an absent map gates every kind (fail-closed), and the
|
|
444
|
+
// in-project loader strips `autonomy.yoloConfirm` so a repo cannot widen it.
|
|
445
|
+
yoloConfirmKinds: resolveYoloConfirmKinds(config.autonomy?.yoloConfirm)
|
|
441
446
|
};
|
|
442
447
|
if (opts.permission?.promptDelegate !== void 0) {
|
|
443
448
|
policyOptions.promptDelegate = opts.permission.promptDelegate;
|
|
@@ -612,7 +617,12 @@ function makeLightSubagentFactory(deps) {
|
|
|
612
617
|
context: ctx,
|
|
613
618
|
permissionPolicy,
|
|
614
619
|
toolExecutor,
|
|
615
|
-
loopDetection: config.tools?.loopDetection
|
|
620
|
+
loopDetection: config.tools?.loopDetection,
|
|
621
|
+
// See the sibling CLI subagent factory: only a POSITIVE configured budget
|
|
622
|
+
// is forwarded, because the shipped default is `0` ("no hard limit") and
|
|
623
|
+
// handing that down would replace a missing setting with a missing
|
|
624
|
+
// safety net.
|
|
625
|
+
...typeof config.tools?.maxIterations === "number" && Number.isFinite(config.tools.maxIterations) && config.tools.maxIterations > 0 ? { maxIterations: config.tools.maxIterations } : {}
|
|
616
626
|
});
|
|
617
627
|
agent.extensions.register(
|
|
618
628
|
createFallbackModelExtension({
|
|
@@ -751,7 +761,7 @@ async function applyWrongStackPack(host, pack, opts = {}) {
|
|
|
751
761
|
unregisterExtensions[i]();
|
|
752
762
|
}
|
|
753
763
|
for (let i = registeredCommandNames.length - 1; i >= 0; i--) {
|
|
754
|
-
host.slashCommands.unregister(registeredCommandNames[i]);
|
|
764
|
+
host.slashCommands.unregister(registeredCommandNames[i], owner);
|
|
755
765
|
}
|
|
756
766
|
for (let i = registeredToolNames.length - 1; i >= 0; i--) {
|
|
757
767
|
host.tools.unregister(registeredToolNames[i]);
|
|
@@ -7,6 +7,9 @@ export interface CanonicalHostToolRegistrationOptions {
|
|
|
7
7
|
tier: ConcreteTokenSavingTier;
|
|
8
8
|
contextTool?: Tool | undefined;
|
|
9
9
|
coordinationTools?: readonly Tool[] | undefined;
|
|
10
|
+
browser?: {
|
|
11
|
+
enabled?: boolean;
|
|
12
|
+
} | undefined;
|
|
10
13
|
memory?: {
|
|
11
14
|
enabled: boolean;
|
|
12
15
|
store?: MemoryPort | null | undefined;
|
|
@@ -8,6 +8,9 @@ import {
|
|
|
8
8
|
rememberTool,
|
|
9
9
|
searchMemoryTool
|
|
10
10
|
} from "@wrongstack/tools/memory";
|
|
11
|
+
import {
|
|
12
|
+
BROWSER_TOOL_NAMES
|
|
13
|
+
} from "@wrongstack/tools";
|
|
11
14
|
import { registerBuiltinToolTier, selectBuiltinToolsForTier } from "@wrongstack/tools/tool-tier";
|
|
12
15
|
import { createVectorMemoryTools } from "@wrongstack/vector-memory";
|
|
13
16
|
|
|
@@ -69,7 +72,7 @@ function wireKanbanPorts() {
|
|
|
69
72
|
}
|
|
70
73
|
|
|
71
74
|
// src/tool-registration.ts
|
|
72
|
-
var DIRECT_LAZY_GATEWAYS = ["tool_search", "tool_use"
|
|
75
|
+
var DIRECT_LAZY_GATEWAYS = ["tool_search", "tool_use"];
|
|
73
76
|
function registerCanonicalHostTools(options) {
|
|
74
77
|
wireKanbanPorts();
|
|
75
78
|
const catalogBuiltinTools = registerBuiltinToolTier({
|
|
@@ -121,9 +124,18 @@ function registerCanonicalHostTools(options) {
|
|
|
121
124
|
directNames.add(name);
|
|
122
125
|
}
|
|
123
126
|
}
|
|
127
|
+
if (options.browser?.enabled) {
|
|
128
|
+
for (const name of BROWSER_TOOL_NAMES) directNames.add(name);
|
|
129
|
+
}
|
|
124
130
|
options.registry.setProviderToolNames([...directNames]);
|
|
125
131
|
} else {
|
|
126
|
-
options.
|
|
132
|
+
if (options.browser?.enabled !== true) {
|
|
133
|
+
const allNames = options.registry.list().map((tool) => tool.name);
|
|
134
|
+
const browserSet = new Set(BROWSER_TOOL_NAMES);
|
|
135
|
+
options.registry.setProviderToolNames(allNames.filter((name) => !browserSet.has(name)));
|
|
136
|
+
} else {
|
|
137
|
+
options.registry.setProviderToolNames(void 0);
|
|
138
|
+
}
|
|
127
139
|
}
|
|
128
140
|
applyToolDescriptionModes(options.registry, options.descriptionMode);
|
|
129
141
|
applyToolResultRenderModes(options.registry, options.resultRenderMode);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wrongstack/runtime",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "WrongStack default runtime implementations and host-level composition helpers built on @wrongstack/core.",
|
|
6
6
|
"repository": {
|
|
@@ -64,16 +64,16 @@
|
|
|
64
64
|
"README.md"
|
|
65
65
|
],
|
|
66
66
|
"dependencies": {
|
|
67
|
-
"@wrongstack/core": "1.0.
|
|
68
|
-
"@wrongstack/kanban": "1.0.
|
|
69
|
-
"@wrongstack/governance": "1.0.
|
|
70
|
-
"@wrongstack/sage": "1.0.
|
|
71
|
-
"@wrongstack/tools": "1.0.
|
|
72
|
-
"@wrongstack/vector-memory": "1.0.
|
|
67
|
+
"@wrongstack/core": "1.0.5",
|
|
68
|
+
"@wrongstack/kanban": "1.0.5",
|
|
69
|
+
"@wrongstack/governance": "1.0.5",
|
|
70
|
+
"@wrongstack/sage": "1.0.5",
|
|
71
|
+
"@wrongstack/tools": "1.0.5",
|
|
72
|
+
"@wrongstack/vector-memory": "1.0.5"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
75
|
"@types/node": "^26.2.0",
|
|
76
|
-
"@wrongstack/wrongtrace": "1.0.
|
|
76
|
+
"@wrongstack/wrongtrace": "1.0.5",
|
|
77
77
|
"typescript": "^7.0.2"
|
|
78
78
|
},
|
|
79
79
|
"publishConfig": {
|