ceulen 0.7.0 → 0.9.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.
- package/CHANGELOG.md +83 -0
- package/extensions/lib/registry.test.ts +67 -0
- package/extensions/lib/registry.ts +24 -7
- package/extensions/modules/a2a/configPanel.ts +435 -0
- package/extensions/modules/a2a/index.ts +1117 -0
- package/extensions/modules/a2a/lib/activity.ts +173 -0
- package/extensions/modules/a2a/lib/client.ts +1061 -0
- package/extensions/modules/a2a/lib/config.ts +920 -0
- package/extensions/modules/a2a/lib/discovery.ts +158 -0
- package/extensions/modules/a2a/lib/gateway.ts +889 -0
- package/extensions/modules/a2a/lib/mdns.ts +233 -0
- package/extensions/modules/a2a/lib/outcome.ts +48 -0
- package/extensions/modules/a2a/lib/persistence.ts +123 -0
- package/extensions/modules/a2a/lib/protocol.ts +506 -0
- package/extensions/modules/a2a/lib/registry.ts +146 -0
- package/extensions/modules/a2a/lib/retry.ts +86 -0
- package/extensions/modules/a2a/lib/security.ts +394 -0
- package/extensions/modules/a2a/lib/server.ts +1436 -0
- package/extensions/modules/a2a/test/activity.test.ts +138 -0
- package/extensions/modules/a2a/test/bridge.test.ts +101 -0
- package/extensions/modules/a2a/test/broadcast-parse.test.ts +31 -0
- package/extensions/modules/a2a/test/chai.ts +101 -0
- package/extensions/modules/a2a/test/client.test.ts +856 -0
- package/extensions/modules/a2a/test/completion-guard.test.ts +73 -0
- package/extensions/modules/a2a/test/config.test.ts +1396 -0
- package/extensions/modules/a2a/test/configPanel.test.ts +393 -0
- package/extensions/modules/a2a/test/discovery.test.ts +144 -0
- package/extensions/modules/a2a/test/extension.test.ts +135 -0
- package/extensions/modules/a2a/test/gateway.test.ts +1449 -0
- package/extensions/modules/a2a/test/helpers.ts +39 -0
- package/extensions/modules/a2a/test/mdns.test.ts +131 -0
- package/extensions/modules/a2a/test/outcome.test.ts +61 -0
- package/extensions/modules/a2a/test/persistence.test.ts +92 -0
- package/extensions/modules/a2a/test/protocol.test.ts +217 -0
- package/extensions/modules/a2a/test/registry.test.ts +114 -0
- package/extensions/modules/a2a/test/retry.test.ts +136 -0
- package/extensions/modules/a2a/test/security.test.ts +281 -0
- package/extensions/modules/a2a/test/server.test.ts +1966 -0
- package/extensions/modules/a2a/test/tmp.ts +59 -0
- package/extensions/modules/a2a/test/vendor.test.ts +57 -0
- package/extensions/modules/a2a/types/bonjour-service.d.ts +22 -0
- package/extensions/modules/a2a/vendor/VENDORED.md +18 -0
- package/extensions/modules/a2a/vendor/package.json +1 -0
- package/extensions/modules/a2a/vendor/vendored_deps/bonjour-service/LICENSE +23 -0
- package/extensions/modules/a2a/vendor/vendored_deps/bonjour-service/dist/index.d.ts +14 -0
- package/extensions/modules/a2a/vendor/vendored_deps/bonjour-service/dist/index.js +57 -0
- package/extensions/modules/a2a/vendor/vendored_deps/bonjour-service/dist/lib/KeyValue.d.ts +4 -0
- package/extensions/modules/a2a/vendor/vendored_deps/bonjour-service/dist/lib/KeyValue.js +3 -0
- package/extensions/modules/a2a/vendor/vendored_deps/bonjour-service/dist/lib/bonjour.d.ts +13 -0
- package/extensions/modules/a2a/vendor/vendored_deps/bonjour-service/dist/lib/bonjour.js +50 -0
- package/extensions/modules/a2a/vendor/vendored_deps/bonjour-service/dist/lib/browser.d.ts +41 -0
- package/extensions/modules/a2a/vendor/vendored_deps/bonjour-service/dist/lib/browser.js +209 -0
- package/extensions/modules/a2a/vendor/vendored_deps/bonjour-service/dist/lib/dns-txt.d.ts +9 -0
- package/extensions/modules/a2a/vendor/vendored_deps/bonjour-service/dist/lib/dns-txt.js +42 -0
- package/extensions/modules/a2a/vendor/vendored_deps/bonjour-service/dist/lib/mdns-server.d.ts +14 -0
- package/extensions/modules/a2a/vendor/vendored_deps/bonjour-service/dist/lib/mdns-server.js +119 -0
- package/extensions/modules/a2a/vendor/vendored_deps/bonjour-service/dist/lib/registry.d.ts +14 -0
- package/extensions/modules/a2a/vendor/vendored_deps/bonjour-service/dist/lib/registry.js +142 -0
- package/extensions/modules/a2a/vendor/vendored_deps/bonjour-service/dist/lib/service-types.d.ts +7 -0
- package/extensions/modules/a2a/vendor/vendored_deps/bonjour-service/dist/lib/service-types.js +53 -0
- package/extensions/modules/a2a/vendor/vendored_deps/bonjour-service/dist/lib/service.d.ts +58 -0
- package/extensions/modules/a2a/vendor/vendored_deps/bonjour-service/dist/lib/service.js +130 -0
- package/extensions/modules/a2a/vendor/vendored_deps/bonjour-service/dist/lib/utils/dns-equal.d.ts +1 -0
- package/extensions/modules/a2a/vendor/vendored_deps/bonjour-service/dist/lib/utils/dns-equal.js +13 -0
- package/extensions/modules/a2a/vendor/vendored_deps/bonjour-service/dist/lib/utils/equal-txt.d.ts +1 -0
- package/extensions/modules/a2a/vendor/vendored_deps/bonjour-service/dist/lib/utils/equal-txt.js +17 -0
- package/extensions/modules/a2a/vendor/vendored_deps/bonjour-service/dist/lib/utils/filter-service.d.ts +4 -0
- package/extensions/modules/a2a/vendor/vendored_deps/bonjour-service/dist/lib/utils/filter-service.js +22 -0
- package/extensions/modules/a2a/vendor/vendored_deps/bonjour-service/dist/lib/utils/filter-txt.d.ts +3 -0
- package/extensions/modules/a2a/vendor/vendored_deps/bonjour-service/dist/lib/utils/filter-txt.js +6 -0
- package/extensions/modules/a2a/vendor/vendored_deps/dns-packet/LICENSE +21 -0
- package/extensions/modules/a2a/vendor/vendored_deps/dns-packet/classes.js +23 -0
- package/extensions/modules/a2a/vendor/vendored_deps/dns-packet/index.js +1761 -0
- package/extensions/modules/a2a/vendor/vendored_deps/dns-packet/opcodes.js +50 -0
- package/extensions/modules/a2a/vendor/vendored_deps/dns-packet/optioncodes.js +59 -0
- package/extensions/modules/a2a/vendor/vendored_deps/dns-packet/rcodes.js +50 -0
- package/extensions/modules/a2a/vendor/vendored_deps/dns-packet/types.js +103 -0
- package/extensions/modules/a2a/vendor/vendored_deps/fast-deep-equal/LICENSE +21 -0
- package/extensions/modules/a2a/vendor/vendored_deps/fast-deep-equal/es6.js +73 -0
- package/extensions/modules/a2a/vendor/vendored_deps/fast-deep-equal/index.js +46 -0
- package/extensions/modules/a2a/vendor/vendored_deps/ip-codec/LICENSE +21 -0
- package/extensions/modules/a2a/vendor/vendored_deps/ip-codec/index.cjs +250 -0
- package/extensions/modules/a2a/vendor/vendored_deps/multicast-dns/LICENSE +21 -0
- package/extensions/modules/a2a/vendor/vendored_deps/multicast-dns/index.js +205 -0
- package/extensions/modules/a2a/vendor/vendored_deps/thunky/LICENSE +21 -0
- package/extensions/modules/a2a/vendor/vendored_deps/thunky/index.js +55 -0
- package/extensions/modules/advisor/index.ts +20 -2
- package/extensions/modules/advisor/lib/watcher.ts +3 -1
- package/extensions/modules/advisor/test/module.test.ts +64 -1
- package/extensions/modules/composer/test/module.test.ts +2 -2
- package/extensions/modules/config/index.ts +2 -0
- package/extensions/modules/config/test/renderTools.test.ts +1 -1
- package/extensions/modules/munin/configPanel.ts +5 -2
- package/extensions/modules/munin/test/configPanel.test.ts +27 -2
- package/extensions/modules/router/configPanel.ts +24 -10
- package/extensions/modules/router/lib/client.ts +6 -4
- package/extensions/modules/router/test/unit.test.ts +83 -2
- package/extensions/modules/rules/index.ts +120 -0
- package/extensions/modules/rules/lib/rules.ts +348 -0
- package/extensions/modules/rules/test/lib.test.ts +263 -0
- package/extensions/modules/rules/test/module.test.ts +222 -0
- package/extensions/modules/subagent/index.ts +19 -6
- package/extensions/modules/subagent/lib/routing.ts +11 -6
- package/extensions/modules/subagent/lib/security.ts +12 -1
- package/extensions/modules/subagent/test/routing.test.ts +174 -0
- package/extensions/modules/todo/configPanel.ts +55 -0
- package/extensions/modules/todo/index.ts +511 -0
- package/extensions/modules/todo/lib/render.ts +271 -0
- package/extensions/modules/todo/lib/settings.ts +73 -0
- package/extensions/modules/todo/test/todo.test.ts +528 -0
- package/extensions/modules/usage/index.ts +11 -0
- package/extensions/modules/usage/test/session-accumulators.test.ts +85 -0
- package/extensions/modules/web/configPanel.ts +38 -13
- package/extensions/modules/web/lib/settings.ts +11 -2
- package/extensions/modules/web/test/configPanel.test.ts +67 -1
- package/extensions/modules/zai/configPanel.ts +5 -2
- package/extensions/modules/zai/lib/signing.ts +4 -1
- package/extensions/modules/zai/test/configPanel.test.ts +23 -0
- package/extensions/modules/zai/test/signing.test.ts +19 -0
- package/package.json +2 -2
- package/skills/a2a/SKILL.md +63 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,88 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.9.0 — 2026-10-04
|
|
4
|
+
|
|
5
|
+
- **todo HUD**: OMP-parity live UI for the todo module — an above-editor
|
|
6
|
+
widget (same placement as the subagent HUD) rendering the board as a
|
|
7
|
+
nested tree (` └─ Tasks · n/m` head over ` ├─/└─` checkbox rows),
|
|
8
|
+
where every connector turns accent once its phase completes — the
|
|
9
|
+
completed tree reads as one lit progress path. Done rows stay visible
|
|
10
|
+
(success green + strikethrough), the current phase draws mdLink blue,
|
|
11
|
+
blocked rows warning + `(blocked by …)`, notes collapse to `+n`.
|
|
12
|
+
The transcript tool-result row draws the same colored board. When ALL
|
|
13
|
+
phases complete the board lingers `todo.lingerSecs` seconds (global
|
|
14
|
+
settings.json, default 60; 0 = instant, −1 = never; closed-set row on
|
|
15
|
+
`/config` → Tasks → Todo), then auto-clears; any new mutation cancels
|
|
16
|
+
the timer. The LLM-facing tool-result text stays the plain board.
|
|
17
|
+
|
|
18
|
+
- **a2a**: new module — the A2A Protocol v1.0 bidirectional peer ported from
|
|
19
|
+
`@bacnh85/pi-a2a` 0.7.13: 7 outbound tools (`a2a_call` with
|
|
20
|
+
`async_dispatch`, `a2a_status`, `a2a_discover`, `a2a_list`, `a2a_history`,
|
|
21
|
+
`a2a_orchestrate`, `a2a_peers`), 8 commands, the opt-in inbound server
|
|
22
|
+
(`/a2a-server start`, isolated child sessions, transcripts, audit log,
|
|
23
|
+
anti-loop, per-peer tokens), and local/mDNS/gateway discovery. `bonjour-service`
|
|
24
|
+
is vendored (flat `vendor/vendored_deps/`, no `node_modules` path) — zero new
|
|
25
|
+
runtime deps. Settings live on the **Tasks** tab of the central `/config`
|
|
26
|
+
panel (`A2A` + `A2A peers & discovery` sections); upstream's `/a2a-config`
|
|
27
|
+
is dropped, and the project `.pi/settings.json` is read only when trusted
|
|
28
|
+
(security keys stay global-only even then).
|
|
29
|
+
- **a2a fixes found against a live switchboard**: gateway-proxied peers
|
|
30
|
+
(`gw/<key>/<name>`) are never card-fetched — the proxied card advertises the
|
|
31
|
+
peer's DIRECT url, which routed dispatches around the gateway and tripped the
|
|
32
|
+
SSRF guard; `a2a_call`/`a2a_status`/`a2a_orchestrate` now pin to the proxy
|
|
33
|
+
URL. `a2a_discover` on a configured gateway origin is allowlisted and sends
|
|
34
|
+
that gateway's token (the proxy 401s an anonymous card fetch).
|
|
35
|
+
The `/config` add/remove action rows re-prompt with the reason on invalid
|
|
36
|
+
input instead of returning silently.
|
|
37
|
+
|
|
38
|
+
## 0.8.0 — 2026-10-04
|
|
39
|
+
|
|
40
|
+
- **todo**: new module (OMP port) — phased task tracking: one `todo` tool
|
|
41
|
+
(`init/start/done/rm/block/unblock/append/view`) over an ordered phase list.
|
|
42
|
+
Blocked is derived from unmet `blockedBy` edges (finishing a blocker
|
|
43
|
+
auto-unblocks dependents); the earliest pending unblocked phase auto-starts
|
|
44
|
+
after every mutation; `start` errors while another phase is in progress
|
|
45
|
+
unless `force`. Every mutation persists (`ceulen-todo` entries, rehydrated
|
|
46
|
+
on session start) and updates a `▸ n/m done · in_progress: …` status
|
|
47
|
+
segment. `/todo` prints the board, `/todo clear` resets.
|
|
48
|
+
- **rules**: new module (OMP port) — sticky RULES.md + rulebook. Sources:
|
|
49
|
+
nearest-first walk from cwd to root for `.pi/RULES.md`, then
|
|
50
|
+
`~/.pi/agent/RULES.md`; project names override user. One rule per
|
|
51
|
+
`## name` section — a `description:` first line makes it a rulebook rule
|
|
52
|
+
(listed in the prompt, body served on demand by the `rule_get` tool);
|
|
53
|
+
otherwise the body is sticky (appended to every request inside
|
|
54
|
+
`<user-rules>…</user-rules>`, 4000-char cap with a loud truncation marker).
|
|
55
|
+
`@path` imports expand at load (cycle-guarded); files cached by mtime so
|
|
56
|
+
edits apply without `/reload`. `/rules` = status, `/rules reload` = drop
|
|
57
|
+
the cache. Zero footprint when no RULES.md exists anywhere.
|
|
58
|
+
- **subagent**: `subagent.idleTimeoutMins` now actually reaches the timeout
|
|
59
|
+
resolver (it was dead config — children always died on the env default);
|
|
60
|
+
a typo'd `@alias` fails the dispatch loud on BOTH runners instead of
|
|
61
|
+
silently running the child on the parent model; the classifier tier gates
|
|
62
|
+
on the chosen label's own probability, not the max across all labels.
|
|
63
|
+
- **router**: `/config` saves re-register the provider from the EFFECTIVE
|
|
64
|
+
(trust-aware) snapshot — a trusted-project endpoint is no longer clobbered
|
|
65
|
+
and the catalog refresh can no longer send the API key to a saved-but-
|
|
66
|
+
shadowed URL; `combo/*` thinking `off` now OMITS `reasoning_effort`
|
|
67
|
+
(the upstream 422s on the literal value — found by live-testing).
|
|
68
|
+
- **steering**: registry reorder — steering is now genuinely the LAST
|
|
69
|
+
`before_agent_start` rewriter (serena/web loaded after it and appended to
|
|
70
|
+
the ds-anchor bootstrap prompt, breaking byte-identity on request #1).
|
|
71
|
+
- **advisor**: the "paused after 3 consecutive failures" notice actually
|
|
72
|
+
reaches the user (it was defeated by its own pause flag); the cursor
|
|
73
|
+
reseed fires when enable + chain are saved in one `/config` write.
|
|
74
|
+
- **usage**: session cost / tok-s accumulators reset on `session_start` —
|
|
75
|
+
"Session cost" no longer reports whole-process totals after `/new` or
|
|
76
|
+
reload.
|
|
77
|
+
- **zai**: config panel baseline honors project trust; the 401 ladder clears
|
|
78
|
+
its signed-request marker on success so unsigned 401s no longer count
|
|
79
|
+
toward signing bypass.
|
|
80
|
+
- **web**: garbage input on a number row is skipped instead of persisted as
|
|
81
|
+
`0`; nested-shaped project `web` entries are disclosed as save shadows.
|
|
82
|
+
- **munin**: config panel baseline honors project trust.
|
|
83
|
+
- **registry**: `isProjectTrusted` walks each agent dir from cwd (a mutated
|
|
84
|
+
cursor made the second dir probe at `/`).
|
|
85
|
+
|
|
3
86
|
## 0.7.0 — 2026-10-04
|
|
4
87
|
|
|
5
88
|
- **web**: new module — the 11 unified web tools ported from `@bacnh85/pi-web`
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// Registry helpers: the trust walk must restart from cwd for EVERY candidate
|
|
2
|
+
// agent dir (the walk mutates its cursor up to `/`, so a shared cursor made
|
|
3
|
+
// dir #2 probe the filesystem root and fail closed).
|
|
4
|
+
|
|
5
|
+
import { describe, it, before, after } from "node:test";
|
|
6
|
+
import assert from "node:assert/strict";
|
|
7
|
+
import { mkdirSync, rmSync, writeFileSync } from "node:fs";
|
|
8
|
+
import { tmpdir } from "node:os";
|
|
9
|
+
import { join } from "node:path";
|
|
10
|
+
|
|
11
|
+
const ROOT = join(tmpdir(), "ceulen-registry-test-" + process.pid);
|
|
12
|
+
// project = <ROOT>/proj; dirs probed in order dirA (no matching entry) → dirB.
|
|
13
|
+
const PROJECT = join(ROOT, "proj");
|
|
14
|
+
const DIR_A = join(ROOT, "agentA");
|
|
15
|
+
const DIR_B = join(ROOT, "agentB");
|
|
16
|
+
|
|
17
|
+
before(() => {
|
|
18
|
+
rmSync(ROOT, { recursive: true, force: true });
|
|
19
|
+
for (const d of [PROJECT, DIR_A, DIR_B]) mkdirSync(d, { recursive: true });
|
|
20
|
+
});
|
|
21
|
+
after(() => { rmSync(ROOT, { recursive: true, force: true }); });
|
|
22
|
+
|
|
23
|
+
describe("isProjectTrusted", () => {
|
|
24
|
+
it("second agent dir is probed from cwd, not from the first dir's walk root", async () => {
|
|
25
|
+
const { isProjectTrusted } = await import("./registry.js");
|
|
26
|
+
// dirA carries a trust.json that says NOTHING about PROJECT — its walk
|
|
27
|
+
// reaches '/' and must not leak that cursor into dirB's probe.
|
|
28
|
+
writeFileSync(join(DIR_A, "trust.json"), JSON.stringify({ "/somewhere/else": true }));
|
|
29
|
+
writeFileSync(join(DIR_B, "trust.json"), JSON.stringify({ [PROJECT]: true }));
|
|
30
|
+
assert.equal(isProjectTrusted(PROJECT, [DIR_A, DIR_B]), true, "declared boolean for the entry in dir #2");
|
|
31
|
+
|
|
32
|
+
writeFileSync(join(DIR_B, "trust.json"), JSON.stringify({ [PROJECT]: false }));
|
|
33
|
+
assert.equal(isProjectTrusted(PROJECT, [DIR_A, DIR_B]), false, "explicit false honoured too");
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it("single-dir behaviour unchanged: parent-walk hit, miss, unreadable → false", async () => {
|
|
37
|
+
const { isProjectTrusted } = await import("./registry.js");
|
|
38
|
+
const nested = join(PROJECT, "a", "b");
|
|
39
|
+
mkdirSync(nested, { recursive: true });
|
|
40
|
+
writeFileSync(join(DIR_A, "trust.json"), JSON.stringify({ [PROJECT]: true }));
|
|
41
|
+
assert.equal(isProjectTrusted(nested, [DIR_A]), true, "walk finds the ancestor entry");
|
|
42
|
+
assert.equal(isProjectTrusted(join(ROOT, "nope"), [DIR_A]), false, "no entry → fail closed");
|
|
43
|
+
assert.equal(isProjectTrusted(PROJECT, [join(ROOT, "missing-dir")]), false, "absent trust.json → false");
|
|
44
|
+
const bad = join(ROOT, "bad");
|
|
45
|
+
mkdirSync(bad, { recursive: true });
|
|
46
|
+
writeFileSync(join(bad, "trust.json"), "{not json");
|
|
47
|
+
assert.equal(isProjectTrusted(PROJECT, [bad]), false, "malformed json → false");
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
describe("MODULES load order", () => {
|
|
52
|
+
// The steering entry must stay behind every before_agent_start prompt
|
|
53
|
+
// rewriter (its ds-anchor bootstrap REPLACES the final prompt; a rewriter
|
|
54
|
+
// loaded after it would append to the byte-identical minimal prompt, which
|
|
55
|
+
// is exactly what serena/web used to do) and ahead of the non-rewriters
|
|
56
|
+
// (rtk/config). Modules registering before_agent_start and loading BEFORE
|
|
57
|
+
// steering: munin, advisor, ux, ponytail, subagent, plan, fff, serena, web
|
|
58
|
+
// — web is the last of them, hence the anchor below.
|
|
59
|
+
it("steering is the last prompt rewriter, before rtk/config", async () => {
|
|
60
|
+
const { MODULES } = await import("./registry.js");
|
|
61
|
+
const at = (name: string) => MODULES.findIndex((m) => m.name === name);
|
|
62
|
+
assert.ok(at("steering") > at("web"), "steering loads after the last rewriter (web)");
|
|
63
|
+
assert.ok(at("steering") > at("serena") && at("steering") > at("plan"));
|
|
64
|
+
assert.ok(at("steering") < at("rtk"), "rtk (no prompt rewrite) loads after steering");
|
|
65
|
+
assert.equal(MODULES.at(-1)!.name, "config", "config stays last");
|
|
66
|
+
});
|
|
67
|
+
});
|
|
@@ -26,6 +26,10 @@ import subagentModule from "../modules/subagent/index.ts";
|
|
|
26
26
|
import { subagentConfig } from "../modules/subagent/configPanel.js";
|
|
27
27
|
import planModule from "../modules/plan/index.ts";
|
|
28
28
|
import { planConfig } from "../modules/plan/configPanel.js";
|
|
29
|
+
import a2aModule from "../modules/a2a/index.ts";
|
|
30
|
+
import { a2aConfig } from "../modules/a2a/configPanel.js";
|
|
31
|
+
import todoModule from "../modules/todo/index.ts";
|
|
32
|
+
import { todoConfig } from "../modules/todo/configPanel.ts";
|
|
29
33
|
import steeringModule from "../modules/steering/index.ts";
|
|
30
34
|
import { steeringConfig } from "../modules/steering/configPanel.js";
|
|
31
35
|
import repairModule from "../modules/repair/index.ts";
|
|
@@ -38,6 +42,7 @@ import muninModule from "../modules/munin/index.ts";
|
|
|
38
42
|
import { muninConfig } from "../modules/munin/configPanel.ts";
|
|
39
43
|
import webModule from "../modules/web/index.ts";
|
|
40
44
|
import { webConfig } from "../modules/web/configPanel.ts";
|
|
45
|
+
import rulesModule from "../modules/rules/index.ts";
|
|
41
46
|
import configModule from "../modules/config/index.ts";
|
|
42
47
|
|
|
43
48
|
/** A module's contribution to the central `/config` panel. */
|
|
@@ -120,12 +125,11 @@ export const MODULES: ModuleEntry[] = [
|
|
|
120
125
|
// (sandbox: read-only) and its before_agent_start must compose BEFORE
|
|
121
126
|
// steering (the last prompt rewriter — see its entry below).
|
|
122
127
|
{ name: "plan", category: "Tasks", describe: "Read-only plan mode: /plan toggle, tool gating, write_plan + ask_user_question, plan model/thinking, approval handoff.", load: planModule, config: planConfig, tools: ["write_plan", "ask_user_question"] },
|
|
123
|
-
//
|
|
124
|
-
//
|
|
125
|
-
//
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
{ name: "steering", category: "Model", describe: "Per-model-family steering (DeepSeek/GLM): first-tool hints, reasoning strip, leak cleaning, error recovery hints, DeepSeek guidance + v4-pro minimal-mode anchor.", load: steeringModule, config: steeringConfig },
|
|
128
|
+
// A2A after plan: cross-agent delegation (the remote sibling of subagent).
|
|
129
|
+
// No before_agent_start → no prompt-rewrite ordering constraint; its
|
|
130
|
+
// child sessions reuse the host-only session guards in the module.
|
|
131
|
+
{ name: "a2a", category: "Tasks", describe: "A2A Protocol v1.0 peer: call remote agents (a2a_call…), be called by them (opt-in inbound server), local/mDNS/gateway discovery.", load: a2aModule, config: a2aConfig, tools: ["a2a_call", "a2a_status", "a2a_discover", "a2a_list", "a2a_history", "a2a_orchestrate", "a2a_peers"] },
|
|
132
|
+
{ name: "todo", category: "Tasks", describe: "Phased task board: the `todo` tool (init/start/done/block/unblock) with session persistence, blockers, an above-editor HUD, and a status-segment progress readout.", load: todoModule, config: todoConfig, tools: ["todo"] },
|
|
129
133
|
// ── Tools ─────────────────────────────────────────────────────────────
|
|
130
134
|
// Repair first in the section: it wraps the built-in tools; serena/fff ride
|
|
131
135
|
// on top (no load-order dependency — hooks resolve at call time).
|
|
@@ -148,6 +152,17 @@ export const MODULES: ModuleEntry[] = [
|
|
|
148
152
|
{ name: "web", category: "Tools", describe: "Unified web tools: search (SearXNG/Brave/Firecrawl), extract & crawl (JSDOM/Firecrawl/Crawl4AI/agy), screenshot/PDF, CDP browser interaction, Gemini research, image generation, one-off chat.", load: webModule, config: webConfig, tools: [
|
|
149
153
|
"web_search", "web_extract", "web_map", "web_crawl", "web_screenshot", "web_pdf", "web_interact", "web_research", "web_image", "web_chat", "web_status",
|
|
150
154
|
] },
|
|
155
|
+
{ name: "rules", category: "Context", describe: "Sticky RULES.md constraints carried in every request + a rulebook of on-demand rules served by rule_get. Nearest-first project walk over user-level.", load: rulesModule, tools: ["rule_get"] },
|
|
156
|
+
// Steering LAST of the prompt rewriters, i.e. after EVERY before_agent_start
|
|
157
|
+
// composer (ponytail/plan/subagent/munin/advisor/ux/fff/serena/web/rules) and
|
|
158
|
+
// before the config module (load order is load-bearing even though its
|
|
159
|
+
// /config rows live on the Model tab, which PI_TAB_ORDER sorts
|
|
160
|
+
// independently): pi chains before_agent_start results, so steering must run
|
|
161
|
+
// LAST for its deepseek-v4-pro anchor bootstrap to REPLACE the final prompt
|
|
162
|
+
// (byte-identical minimal prompt) instead of appending to a prompt that
|
|
163
|
+
// serena/web then append to. Nothing after this entry (rtk, config) touches
|
|
164
|
+
// the prompt — do not move it earlier or add a prompt rewriter after it.
|
|
165
|
+
{ name: "steering", category: "Model", describe: "Per-model-family steering (DeepSeek/GLM): first-tool hints, reasoning strip, leak cleaning, error recovery hints, DeepSeek guidance + v4-pro minimal-mode anchor.", load: steeringModule, config: steeringConfig },
|
|
151
166
|
// ── Shell ──────────────────────────────────────────────────────────────
|
|
152
167
|
{ name: "rtk", category: "Shell", describe: "Route shell commands through RTK for token savings.", load: rtkModule },
|
|
153
168
|
// ── Plugins ────────────────────────────────────────────────────────────
|
|
@@ -247,8 +262,10 @@ export function writeDisabled(list: string[], cwd = process.cwd()): string {
|
|
|
247
262
|
* walking up the tree like pi's ProjectTrustStore. Unreadable/absent →
|
|
248
263
|
* false (fail closed). */
|
|
249
264
|
export function isProjectTrusted(cwd: string, dirs: string[] = agentDirs()): boolean {
|
|
250
|
-
let current = path.resolve(cwd);
|
|
251
265
|
for (const dir of dirs) {
|
|
266
|
+
// Per-dir walk start — the walk below mutates `current` up to the root, so
|
|
267
|
+
// a second agent dir must restart from cwd, not inherit the first's root.
|
|
268
|
+
let current = path.resolve(cwd);
|
|
252
269
|
const file = path.join(dir, "trust.json");
|
|
253
270
|
if (!existsSync(file)) continue;
|
|
254
271
|
try {
|