pi-braid 0.43.40 → 0.43.42
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/CHANGELOG.md +19 -0
- package/CONTRIBUTING.md +1 -1
- package/TOOLS.md +10 -15
- package/build-info.json +4 -4
- package/dist/extensions/heartbeat/analytics/index.js +41 -18
- package/dist/extensions/memory/three-memory-stores/index.js +34 -38
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -2
- package/dist/lib/tools/tool-families.d.ts +119 -0
- package/dist/lib/tools/tool-families.js +172 -0
- package/dist/loader/api.d.ts +2 -5
- package/dist/loader/api.js +7 -48
- package/dist/loader/loader.d.ts +0 -2
- package/dist/loader/loader.js +0 -4
- package/docs/LOCAL_DEV.md +1 -1
- package/docs/SETUP.md +1 -1
- package/package.json +1 -1
- package/skills/release-pipeline/SKILL.md +12 -0
- package/src/extensions/heartbeat/analytics/AGENTS.md +2 -2
- package/src/extensions/heartbeat/analytics/index.ts +50 -19
- package/src/extensions/memory/AGENTS.md +1 -2
- package/src/extensions/memory/three-memory-stores/index.ts +43 -41
- package/src/index.ts +0 -2
- package/src/lib/AGENTS.md +1 -0
- package/src/lib/tools/tool-families.ts +232 -0
- package/src/loader/AGENTS.md +4 -4
- package/src/loader/api.ts +9 -51
- package/src/loader/loader.ts +0 -5
package/src/loader/AGENTS.md
CHANGED
|
@@ -12,10 +12,10 @@ that it contains the **loader** (and the related subagent API), not
|
|
|
12
12
|
|
|
13
13
|
## Files
|
|
14
14
|
|
|
15
|
-
| File | Purpose
|
|
16
|
-
| ----------- |
|
|
17
|
-
| `loader.ts` | Resolves `BRAID_MODULES` / `braid.modules` (pi global, pi project, braid's store) / runtime overrides into an enabled set, topologically sorts by dependency, and invokes each factory.
|
|
18
|
-
| `api.ts` | Registers `/modules` (verbs: `on`, `off`, `toggle`, `reset`, `all on
|
|
15
|
+
| File | Purpose |
|
|
16
|
+
| ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
17
|
+
| `loader.ts` | Resolves `BRAID_MODULES` / `braid.modules` (pi global, pi project, braid's store) / runtime overrides into an enabled set, topologically sorts by dependency, and invokes each factory. |
|
|
18
|
+
| `api.ts` | Registers `/modules` (verbs: `on`, `off`, `toggle`, `reset`, `all on` / `off`, `list`) for the subagent API, and states that a contrib extension is toggled through `braid.contrib`, not from this list. |
|
|
19
19
|
|
|
20
20
|
## Layer position
|
|
21
21
|
|
package/src/loader/api.ts
CHANGED
|
@@ -17,11 +17,8 @@
|
|
|
17
17
|
* alone; argument completion and `list` are the places that enumerate what is
|
|
18
18
|
* accepted.
|
|
19
19
|
*
|
|
20
|
-
* The
|
|
21
|
-
*
|
|
22
|
-
* modules-reset, modules-list, modules-status. Each maps its whole argument
|
|
23
|
-
* onto the equivalent argv, so a script written against the old names keeps
|
|
24
|
-
* working until it is pointed at `/modules`.
|
|
20
|
+
* The list covers the core manifest only: a contrib extension is toggled
|
|
21
|
+
* through its `braid.contrib.<name>` key in settings, not from this command.
|
|
25
22
|
*/
|
|
26
23
|
|
|
27
24
|
import type { ExtensionAPI, ExtensionCommandContext } from "@earendil-works/pi-coding-agent";
|
|
@@ -67,6 +64,10 @@ const USAGE =
|
|
|
67
64
|
"Usage: /modules [on|off|toggle|reset|all|list] <ref>\n" +
|
|
68
65
|
"A ref is an extension id or a module group name. Tab completes both.";
|
|
69
66
|
|
|
67
|
+
/** Why a contrib extension is absent from this list, stated where it shows. */
|
|
68
|
+
const CONTRIB_NOTE =
|
|
69
|
+
"Contrib extensions are toggled through braid.contrib in settings, not from this list.";
|
|
70
|
+
|
|
70
71
|
export default async function modulesApiExtension(pi: ExtensionAPI): Promise<void> {
|
|
71
72
|
const run = async (argv: string[], ctx: ExtensionCommandContext): Promise<void> => {
|
|
72
73
|
const notify = (message: string, type: "info" | "warning" | "error" = "info"): void => {
|
|
@@ -168,35 +169,7 @@ export default async function modulesApiExtension(pi: ExtensionAPI): Promise<voi
|
|
|
168
169
|
handler: (args, ctx) => run(splitArgs(args), ctx),
|
|
169
170
|
});
|
|
170
171
|
|
|
171
|
-
|
|
172
|
-
description: "Alias of /modules on <ref>. Retained for one release.",
|
|
173
|
-
getArgumentCompletions: completeRefs("on"),
|
|
174
|
-
handler: (args, ctx) => run([...forwarded("on", args)], ctx),
|
|
175
|
-
});
|
|
176
|
-
pi.registerCommand("modules-disable", {
|
|
177
|
-
description: "Alias of /modules off <ref>. Retained for one release.",
|
|
178
|
-
getArgumentCompletions: completeRefs("off"),
|
|
179
|
-
handler: (args, ctx) => run([...forwarded("off", args)], ctx),
|
|
180
|
-
});
|
|
181
|
-
pi.registerCommand("modules-toggle", {
|
|
182
|
-
description: "Alias of /modules toggle <ref>. Retained for one release.",
|
|
183
|
-
getArgumentCompletions: completeRefs("toggle"),
|
|
184
|
-
handler: (args, ctx) => run([...forwarded("toggle", args)], ctx),
|
|
185
|
-
});
|
|
186
|
-
pi.registerCommand("modules-reset", {
|
|
187
|
-
description: "Alias of /modules reset. Retained for one release.",
|
|
188
|
-
handler: async (_args, ctx) => run(["reset"], ctx),
|
|
189
|
-
});
|
|
190
|
-
pi.registerCommand("modules-list", {
|
|
191
|
-
description: "Alias of /modules list. Retained for one release.",
|
|
192
|
-
handler: async (_args, ctx) => run(["list"], ctx),
|
|
193
|
-
});
|
|
194
|
-
pi.registerCommand("modules-status", {
|
|
195
|
-
description: "Alias of /modules list. Retained for one release.",
|
|
196
|
-
handler: async (_args, ctx) => run(["list"], ctx),
|
|
197
|
-
});
|
|
198
|
-
|
|
199
|
-
log.info("Module API registered: /modules (+ six forwarding aliases)");
|
|
172
|
+
log.info("Module API registered: /modules");
|
|
200
173
|
}
|
|
201
174
|
|
|
202
175
|
// ── Argument parsing ────────────────────────────────────────────────────────
|
|
@@ -214,11 +187,6 @@ function splitArgs(args: string | undefined): string[] {
|
|
|
214
187
|
return argv;
|
|
215
188
|
}
|
|
216
189
|
|
|
217
|
-
/** The argv an old name forwards: its whole argument is the ref. */
|
|
218
|
-
function forwarded(verb: string, args: string | undefined): string[] {
|
|
219
|
-
return [verb, (args ?? "").trim()];
|
|
220
|
-
}
|
|
221
|
-
|
|
222
190
|
/** Why a reference was refused, naming the rule instead of listing refs. */
|
|
223
191
|
function refusal(ref: string, verb: string): string {
|
|
224
192
|
if (!getModuleRefs().includes(ref)) {
|
|
@@ -255,16 +223,6 @@ function completeModules(prefix: string): AutocompleteItem[] | null {
|
|
|
255
223
|
return null;
|
|
256
224
|
}
|
|
257
225
|
|
|
258
|
-
/** Completion for an old name: the whole argument text is the reference. */
|
|
259
|
-
function completeRefs(verb: string) {
|
|
260
|
-
return (prefix: string): AutocompleteItem[] | null => {
|
|
261
|
-
const typed = (prefix ?? "").toLowerCase();
|
|
262
|
-
return getModuleRefs()
|
|
263
|
-
.filter((ref) => ref.startsWith(typed))
|
|
264
|
-
.map((ref) => ({ value: ref, label: ref, description: `Forwarded to /modules ${verb}` }));
|
|
265
|
-
};
|
|
266
|
-
}
|
|
267
|
-
|
|
268
226
|
function completeValues(prefix: string, values: string[]): AutocompleteItem[] {
|
|
269
227
|
const typed = (prefix ?? "").toLowerCase();
|
|
270
228
|
return values
|
|
@@ -296,7 +254,7 @@ function describe(desc: string, origin: ModuleOrigin, enabled: boolean, loaded:
|
|
|
296
254
|
/** The rows as text, for RPC mode and the `list` verb. */
|
|
297
255
|
function renderRows(): string {
|
|
298
256
|
const { rows, source } = moduleRows();
|
|
299
|
-
const lines = [`Extensions (${rows.length}, config: ${source})
|
|
257
|
+
const lines = [`Extensions (${rows.length}, config: ${source}):`, CONTRIB_NOTE];
|
|
300
258
|
const width = Math.min(28, Math.max(...rows.map((row) => row.id.length)));
|
|
301
259
|
for (const row of rows) {
|
|
302
260
|
lines.push(` ${row.value.padEnd(3)} ${row.id.padEnd(width)} ${row.description}`);
|
|
@@ -319,7 +277,7 @@ async function openModuleList(ctx: ExtensionCommandContext): Promise<void> {
|
|
|
319
277
|
container.addChild(
|
|
320
278
|
new (class {
|
|
321
279
|
render(_width: number) {
|
|
322
|
-
return [theme.fg("accent", theme.bold("Extensions"))];
|
|
280
|
+
return [theme.fg("accent", theme.bold("Extensions")), theme.fg("muted", CONTRIB_NOTE)];
|
|
323
281
|
}
|
|
324
282
|
invalidate() {}
|
|
325
283
|
})(),
|
package/src/loader/loader.ts
CHANGED
|
@@ -656,8 +656,3 @@ function topologicalSort(extIds: string[]): string[] {
|
|
|
656
656
|
export function getModuleRefs(): string[] {
|
|
657
657
|
return allConfigRefs();
|
|
658
658
|
}
|
|
659
|
-
|
|
660
|
-
/** @deprecated Use getModuleRefs. Kept as an alias for existing callers. */
|
|
661
|
-
export function getAllRefNames(): string[] {
|
|
662
|
-
return getModuleRefs();
|
|
663
|
-
}
|