codecartographer-pi 0.9.0 → 0.9.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/README.md +1 -1
- package/dist/extensions/codecarto/index.js +18 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -223,7 +223,7 @@ Beyond the slash commands, the Pi extension layers on:
|
|
|
223
223
|
|
|
224
224
|
### Version history (Pi orchestration)
|
|
225
225
|
|
|
226
|
-
The current parallel-sub-agent design landed in 0.2.0 and has been incrementally enriched: file-backed sessions (0.3.0), summary injection (0.4.0), opt-in LLM steering (0.5.0), usage tracking (0.6.0), HTML dashboard (0.7.0), end-to-end auto mode (0.8.0),
|
|
226
|
+
The current parallel-sub-agent design landed in 0.2.0 and has been incrementally enriched: file-backed sessions (0.3.0), summary injection (0.4.0), opt-in LLM steering (0.5.0), usage tracking (0.6.0), HTML dashboard (0.7.0), end-to-end auto mode (0.8.0), experimental library foundations plus MCP library tools (0.9.0), and Pi overlay activation gating (0.9.1). 0.1.x workspaces don't need migration — existing `.codecarto/` directories work unchanged. See `CHANGELOG.md` for details.
|
|
227
227
|
|
|
228
228
|
---
|
|
229
229
|
|
|
@@ -63,6 +63,7 @@ function setUiState(ctx, state, extraLines = []) {
|
|
|
63
63
|
}
|
|
64
64
|
export default function codeCartographerExtension(pi) {
|
|
65
65
|
let lastFeedbackLines = [];
|
|
66
|
+
let codecartoModeActive = false;
|
|
66
67
|
const readWorkspaceState = async (ctx, notifyOnError = true) => {
|
|
67
68
|
try {
|
|
68
69
|
return await getWorkspaceState(ctx.cwd);
|
|
@@ -77,6 +78,10 @@ export default function codeCartographerExtension(pi) {
|
|
|
77
78
|
}
|
|
78
79
|
};
|
|
79
80
|
const refreshWorkspaceUi = async (ctx, extraLines) => {
|
|
81
|
+
if (!codecartoModeActive) {
|
|
82
|
+
setUiState(ctx, null);
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
80
85
|
const state = await readWorkspaceState(ctx, false);
|
|
81
86
|
setUiState(ctx, state, extraLines ?? lastFeedbackLines);
|
|
82
87
|
if (state) {
|
|
@@ -87,6 +92,11 @@ export default function codeCartographerExtension(pi) {
|
|
|
87
92
|
return state;
|
|
88
93
|
};
|
|
89
94
|
const ensureWorkspaceState = async (ctx) => {
|
|
95
|
+
if (!codecartoModeActive) {
|
|
96
|
+
setUiState(ctx, null);
|
|
97
|
+
ctx.ui.notify("CodeCartographer is not active in this session. Run /codecarto-init first.", "warning");
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
90
100
|
const state = await readWorkspaceState(ctx);
|
|
91
101
|
if (state)
|
|
92
102
|
return state;
|
|
@@ -96,10 +106,9 @@ export default function codeCartographerExtension(pi) {
|
|
|
96
106
|
return null;
|
|
97
107
|
};
|
|
98
108
|
pi.on("session_start", async (_event, ctx) => {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
pi.setActiveTools(SAFE_TOOL_NAMES);
|
|
109
|
+
codecartoModeActive = false;
|
|
110
|
+
lastFeedbackLines = [];
|
|
111
|
+
setUiState(ctx, null);
|
|
103
112
|
});
|
|
104
113
|
pi.on("session_shutdown", async () => {
|
|
105
114
|
// Tear down the persistent agents widget so we don't leak the timer
|
|
@@ -110,6 +119,8 @@ export default function codeCartographerExtension(pi) {
|
|
|
110
119
|
await refreshWorkspaceUi(ctx);
|
|
111
120
|
});
|
|
112
121
|
pi.on("tool_call", async (event, ctx) => {
|
|
122
|
+
if (!codecartoModeActive)
|
|
123
|
+
return undefined;
|
|
113
124
|
const workspaceDir = join(ctx.cwd, ".codecarto");
|
|
114
125
|
if (!(await pathExists(workspaceDir)))
|
|
115
126
|
return undefined;
|
|
@@ -179,12 +190,14 @@ export default function codeCartographerExtension(pi) {
|
|
|
179
190
|
const normalizedStatus = createEmptyStatus(basename(ctx.cwd), selectedPipelinePath, pipeline);
|
|
180
191
|
normalizedStatus.last_updated = new Date().toISOString();
|
|
181
192
|
await writeFile(rawStatusPath, `${stringifySimpleYaml(normalizedStatus)}\n`, "utf8");
|
|
193
|
+
codecartoModeActive = true;
|
|
182
194
|
lastFeedbackLines = [`Initialized workspace with pipeline: ${getPipelineLabel(selectedPipelinePath)}`];
|
|
183
195
|
ctx.ui.notify(`Initialized CodeCartographer (${getPipelineLabel(selectedPipelinePath)})`, "info");
|
|
184
|
-
await ctx.reload();
|
|
185
196
|
// Render the initial dashboard (empty usage, all phases pending) so
|
|
186
197
|
// the user sees the file exist immediately after /codecarto-init.
|
|
187
198
|
void writeDashboard(ctx.cwd, PACKAGE_VERSION);
|
|
199
|
+
await refreshWorkspaceUi(ctx, lastFeedbackLines);
|
|
200
|
+
pi.setActiveTools(SAFE_TOOL_NAMES);
|
|
188
201
|
return;
|
|
189
202
|
},
|
|
190
203
|
});
|