@agent-plan/pi-adapter 0.2.22-next.0 → 0.2.22-next.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.
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -6
- package/package.json +3 -3
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAoB,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAoB,MAAM,iCAAiC,CAAC;AA40BtF,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,EAAE,EAAE,YAAY,GAAG,IAAI,CAw5H9D"}
|
package/dist/index.js
CHANGED
|
@@ -662,10 +662,8 @@ function resolveStaticDir() {
|
|
|
662
662
|
}
|
|
663
663
|
}
|
|
664
664
|
async function maybeStartWeb(ctx) {
|
|
665
|
-
if (server)
|
|
666
|
-
plannerSessionEnabled = true;
|
|
665
|
+
if (server)
|
|
667
666
|
return;
|
|
668
|
-
}
|
|
669
667
|
ctx.ui.notify("Starting web server (LAN)…", "info");
|
|
670
668
|
try {
|
|
671
669
|
await startServer(ctx, undefined, "lan");
|
|
@@ -687,7 +685,6 @@ function normalizeVisibility(input) {
|
|
|
687
685
|
return undefined;
|
|
688
686
|
}
|
|
689
687
|
async function startServer(ctx, requestedPort, visibility = "lan") {
|
|
690
|
-
plannerSessionEnabled = true;
|
|
691
688
|
if (server)
|
|
692
689
|
return;
|
|
693
690
|
const host = visibility === "lan" ? "0.0.0.0" : "127.0.0.1";
|
|
@@ -759,6 +756,10 @@ async function startServer(ctx, requestedPort, visibility = "lan") {
|
|
|
759
756
|
catch { }
|
|
760
757
|
}
|
|
761
758
|
}
|
|
759
|
+
function enablePlannerSession() {
|
|
760
|
+
plannerSessionEnabled = true;
|
|
761
|
+
contextBlockDirty = true;
|
|
762
|
+
}
|
|
762
763
|
function disablePlannerSession() {
|
|
763
764
|
plannerSessionEnabled = false;
|
|
764
765
|
startupResumePromptPending = false;
|
|
@@ -1160,6 +1161,7 @@ export default function planPiExtension(pi) {
|
|
|
1160
1161
|
await st.writeGenerated();
|
|
1161
1162
|
await scanCodebase();
|
|
1162
1163
|
ctx.ui.notify(`.planner/ initialized for "${name.trim()}". Starting project discuss…`, "info");
|
|
1164
|
+
enablePlannerSession();
|
|
1163
1165
|
await maybeStartWeb(ctx);
|
|
1164
1166
|
await handlePlanner("project discuss", ctx);
|
|
1165
1167
|
return;
|
|
@@ -1177,6 +1179,7 @@ export default function planPiExtension(pi) {
|
|
|
1177
1179
|
await st.writeGenerated();
|
|
1178
1180
|
await scanCodebase();
|
|
1179
1181
|
ctx.ui.notify(`.planner/ initialized for "${name.trim()}". Starting project discuss…`, "info");
|
|
1182
|
+
enablePlannerSession();
|
|
1180
1183
|
await maybeStartWeb(ctx);
|
|
1181
1184
|
await handlePlanner("project discuss", ctx);
|
|
1182
1185
|
return;
|
|
@@ -2557,7 +2560,7 @@ export default function planPiExtension(pi) {
|
|
|
2557
2560
|
return;
|
|
2558
2561
|
}
|
|
2559
2562
|
if (a === "load") {
|
|
2560
|
-
|
|
2563
|
+
enablePlannerSession();
|
|
2561
2564
|
if (!server) {
|
|
2562
2565
|
ctx.ui.notify("Starting web server (LAN) …", "info");
|
|
2563
2566
|
await startServer(ctx, undefined, "lan").catch(() => { });
|
|
@@ -4804,7 +4807,7 @@ export default function planPiExtension(pi) {
|
|
|
4804
4807
|
const st = await requirePlan(ctx);
|
|
4805
4808
|
if (!st)
|
|
4806
4809
|
return { content: [{ type: "text", text: "No .planner/ found. Run plan_init first." }], details: { enabled: false, running: false } };
|
|
4807
|
-
|
|
4810
|
+
enablePlannerSession();
|
|
4808
4811
|
if (!server) {
|
|
4809
4812
|
await startServer(ctx, undefined, "lan").catch(() => { });
|
|
4810
4813
|
}
|
|
@@ -4876,6 +4879,7 @@ export default function planPiExtension(pi) {
|
|
|
4876
4879
|
const activity = await st.loadActivityLog();
|
|
4877
4880
|
const recentActivity = activity.entries.slice(-3).reverse();
|
|
4878
4881
|
const handoffs = await st.listHandoffs();
|
|
4882
|
+
const extensionRules = await st.extensionRules();
|
|
4879
4883
|
const featureById = new Map(plan.features.features.map((feature) => [feature.id, feature]));
|
|
4880
4884
|
const phaseById = new Map(plan.phases.map((phase) => [phase.id, phase]));
|
|
4881
4885
|
const orderedPhases = [
|
|
@@ -4996,6 +5000,13 @@ export default function planPiExtension(pi) {
|
|
|
4996
5000
|
"- Planner ops (status/handoff/planner metadata) are NOT code edits; they are always allowed.",
|
|
4997
5001
|
"- Prioritize work: continue an in-progress task; otherwise choose ready work feature → phase → task by ascending priority, respecting dependencies and blocked/waiting states. Prefer shortId or F00x/P00x/T00x refs. Find via feature_list / phase_list / task_list; read one entity via *_get(full=true).",
|
|
4998
5002
|
"- If edit/write guard blocks you, start the right task or use an explicit bypass.",
|
|
5003
|
+
...(extensionRules.length > 0
|
|
5004
|
+
? [
|
|
5005
|
+
"",
|
|
5006
|
+
"Planner rules (extension; agent-only):",
|
|
5007
|
+
...extensionRules.map((rule, index) => `${index + 1}. ${rule}`),
|
|
5008
|
+
]
|
|
5009
|
+
: []),
|
|
4999
5010
|
"",
|
|
5000
5011
|
`Goal: ${project.goal || "(not set)"}`,
|
|
5001
5012
|
project.description ? `Description: ${project.description}` : "",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-plan/pi-adapter",
|
|
3
|
-
"version": "0.2.22-next.
|
|
3
|
+
"version": "0.2.22-next.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Pi agent extension for Agent Plan — structured project planning in .planner/",
|
|
6
6
|
"keywords": [
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"typebox": "^1.1.24",
|
|
30
30
|
"zod": "^3.24.0",
|
|
31
|
-
"@agent-plan/core": "0.2.22-next.
|
|
32
|
-
"@agent-plan/server": "0.2.22-next.
|
|
31
|
+
"@agent-plan/core": "0.2.22-next.1",
|
|
32
|
+
"@agent-plan/server": "0.2.22-next.1"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@earendil-works/pi-coding-agent": "^0.74.0",
|