@rubytech/taskmaster 1.17.5 → 1.17.6
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/build-info.json
CHANGED
|
@@ -171,15 +171,16 @@ const INDIVIDUAL_CONTROL_PANEL_TOOLS = [
|
|
|
171
171
|
"logs_read",
|
|
172
172
|
];
|
|
173
173
|
/**
|
|
174
|
-
* Ensure admin agents
|
|
174
|
+
* Ensure admin agents have `group:control-panel` in their allow list.
|
|
175
175
|
*
|
|
176
|
-
*
|
|
177
|
-
*
|
|
178
|
-
* later (e.g. `logs_read`)
|
|
179
|
-
*
|
|
176
|
+
* Two cases handled:
|
|
177
|
+
* 1. Agent has individual control-panel tool entries (pre-group setup) — replace them
|
|
178
|
+
* with the group so tools added to the group later (e.g. `logs_read`) are visible.
|
|
179
|
+
* 2. Agent has `message` but no `group:control-panel` at all (predates the group being
|
|
180
|
+
* added to ACCOUNT_ADMIN_TOOLS) — add the group directly.
|
|
180
181
|
*
|
|
181
182
|
* Runs unconditionally on gateway startup. Idempotent — skips agents that already
|
|
182
|
-
* have `group:control-panel
|
|
183
|
+
* have `group:control-panel`.
|
|
183
184
|
*/
|
|
184
185
|
export function reconcileControlPanelTools(params) {
|
|
185
186
|
const config = structuredClone(params.config);
|
|
@@ -196,21 +197,25 @@ export function reconcileControlPanelTools(params) {
|
|
|
196
197
|
// Already using the group — nothing to do
|
|
197
198
|
if (allow.includes("group:control-panel"))
|
|
198
199
|
continue;
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
removed.push(tool);
|
|
200
|
+
const hasIndividual = INDIVIDUAL_CONTROL_PANEL_TOOLS.some((t) => allow.includes(t));
|
|
201
|
+
if (hasIndividual) {
|
|
202
|
+
// Case 1: replace individual entries with the group
|
|
203
|
+
const removed = [];
|
|
204
|
+
for (const tool of INDIVIDUAL_CONTROL_PANEL_TOOLS) {
|
|
205
|
+
const idx = allow.indexOf(tool);
|
|
206
|
+
if (idx !== -1) {
|
|
207
|
+
allow.splice(idx, 1);
|
|
208
|
+
removed.push(tool);
|
|
209
|
+
}
|
|
210
210
|
}
|
|
211
|
+
allow.push("group:control-panel");
|
|
212
|
+
changes.push(`Replaced ${removed.join(", ")} with group:control-panel in agent "${agent.id}" tools.allow.`);
|
|
213
|
+
}
|
|
214
|
+
else if (allow.includes("message")) {
|
|
215
|
+
// Case 2: group entirely absent on a full admin agent — add it
|
|
216
|
+
allow.push("group:control-panel");
|
|
217
|
+
changes.push(`Added group:control-panel to agent "${agent.id ?? "<unnamed>"}" tools.allow.`);
|
|
211
218
|
}
|
|
212
|
-
allow.push("group:control-panel");
|
|
213
|
-
changes.push(`Replaced ${removed.join(", ")} with group:control-panel in agent "${agent.id}" tools.allow.`);
|
|
214
219
|
}
|
|
215
220
|
return { config, changes };
|
|
216
221
|
}
|