pi-arsenal 0.2.1 → 0.3.2
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/extensions/task-panel.ts +0 -18
- package/extensions/workspace-drawer.ts +1121 -866
- package/lib/session-library.ts +1 -1
- package/package.json +1 -1
package/extensions/task-panel.ts
CHANGED
|
@@ -87,17 +87,6 @@ function approvalFromChoices(event: { toolName: string; content: Array<{ type: s
|
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
// Shared mutable state so the /task command can read it.
|
|
91
|
-
let _steps: PlanStep[] = [];
|
|
92
|
-
let _cancelPlan: (() => void) | undefined;
|
|
93
|
-
|
|
94
|
-
export function getActivePlan(): PlanStep[] { return _steps; }
|
|
95
|
-
export function cancelActivePlan(): boolean {
|
|
96
|
-
if (!_steps.some((s) => s.status !== "completed")) return false;
|
|
97
|
-
if (_cancelPlan) _cancelPlan();
|
|
98
|
-
return true;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
90
|
export default function taskPanel(pi: ExtensionAPI) {
|
|
102
91
|
let steps: PlanStep[] = [];
|
|
103
92
|
let planChangeAuthorized = false;
|
|
@@ -124,7 +113,6 @@ export default function taskPanel(pi: ExtensionAPI) {
|
|
|
124
113
|
|
|
125
114
|
function restore(ctx: ExtensionContext): void {
|
|
126
115
|
steps = restoreSteps(ctx.sessionManager.getBranch());
|
|
127
|
-
_steps = steps;
|
|
128
116
|
planChangeAuthorized = false;
|
|
129
117
|
planChangeChoiceCallId = undefined;
|
|
130
118
|
render(ctx);
|
|
@@ -158,15 +146,10 @@ export default function taskPanel(pi: ExtensionAPI) {
|
|
|
158
146
|
const next = parseSteps((event.args as { steps?: unknown } | undefined)?.steps);
|
|
159
147
|
if (!next) return;
|
|
160
148
|
steps = next;
|
|
161
|
-
_steps = steps;
|
|
162
149
|
render(ctx);
|
|
163
150
|
});
|
|
164
151
|
|
|
165
152
|
// /task command: show current plan and optionally cancel it.
|
|
166
|
-
_cancelPlan = () => {
|
|
167
|
-
steps = steps.map((s) => s.status === "completed" ? s : { ...s, status: "completed" as const });
|
|
168
|
-
_steps = steps;
|
|
169
|
-
};
|
|
170
153
|
pi.registerCommand("task", {
|
|
171
154
|
description: "Show current plan and cancel if needed",
|
|
172
155
|
handler: async (_args, ctx) => {
|
|
@@ -182,7 +165,6 @@ export default function taskPanel(pi: ExtensionAPI) {
|
|
|
182
165
|
const confirmed = await ctx.ui.confirm("Cancel plan?", "Mark all remaining steps completed so the model is free to start a new plan.");
|
|
183
166
|
if (confirmed) {
|
|
184
167
|
steps = steps.map((s) => ({ ...s, status: "completed" as const }));
|
|
185
|
-
_steps = steps;
|
|
186
168
|
render(ctx);
|
|
187
169
|
ctx.ui.notify("Plan cancelled. The model may now start a new plan.", "info");
|
|
188
170
|
}
|