@dreki-gg/pi-plan-mode 0.26.1 → 0.27.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
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @dreki-gg/pi-plan-mode
|
|
2
2
|
|
|
3
|
+
## 0.27.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Plan mode no longer overrides the model or thinking level. Entering plan mode,
|
|
8
|
+
starting execution, and session restore all keep whatever model and thinking
|
|
9
|
+
level the user had active. The forced executor model picker is also removed.
|
|
10
|
+
Additionally, plan mode now auto-exits after the agent submits a plan or
|
|
11
|
+
initiative, returning the user to normal mode immediately.
|
|
12
|
+
|
|
13
|
+
## 0.26.2
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
- @dreki-gg/taskman@0.3.0
|
|
19
|
+
|
|
3
20
|
## 0.26.1
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -41,18 +41,5 @@ export const EXEC_TOOLS = [
|
|
|
41
41
|
'reconcile_plans',
|
|
42
42
|
];
|
|
43
43
|
|
|
44
|
-
// ── Model + thinking presets ─────────────────────────────────────────────────
|
|
45
|
-
export const PLAN_MODEL = { provider: 'anthropic', id: 'claude-opus-4-6' } as const;
|
|
46
|
-
export const PLAN_THINKING = 'medium' as const;
|
|
47
|
-
|
|
48
|
-
export const EXEC_MODEL = { provider: 'openai', id: 'gpt-5.5' } as const;
|
|
49
|
-
export const EXEC_THINKING = 'low' as const;
|
|
50
|
-
|
|
51
44
|
// ── Exec-pending marker file name ────────────────────────────────────────────
|
|
52
45
|
export const EXEC_PENDING_FILE = '.exec-pending.json';
|
|
53
|
-
|
|
54
|
-
// ── Execution model picker options ───────────────────────────────────────────
|
|
55
|
-
export const EXEC_MODEL_OPTIONS: { label: string; model: { provider: string; id: string } }[] = [
|
|
56
|
-
{ label: 'gpt-5.5', model: { provider: 'openai', id: 'gpt-5.5' } },
|
|
57
|
-
{ label: 'claude-opus-4-6', model: { provider: 'anthropic', id: 'claude-opus-4-6' } },
|
|
58
|
-
];
|
|
@@ -21,12 +21,8 @@ import { Key } from '@earendil-works/pi-tui';
|
|
|
21
21
|
import {
|
|
22
22
|
PLAN_TOOLS,
|
|
23
23
|
EXEC_TOOLS,
|
|
24
|
-
PLAN_MODEL,
|
|
25
|
-
PLAN_THINKING,
|
|
26
|
-
EXEC_MODEL,
|
|
27
|
-
EXEC_THINKING,
|
|
28
24
|
} from './constants.js';
|
|
29
|
-
import type {
|
|
25
|
+
import type { TaskStatus } from './types.js';
|
|
30
26
|
import { PlanModeState } from './state.js';
|
|
31
27
|
import { makePlanRuntime } from '@dreki-gg/taskman';
|
|
32
28
|
import { loadHandoff } from '@dreki-gg/taskman';
|
|
@@ -524,11 +520,10 @@ export default function planMode(pi: ExtensionAPI): void {
|
|
|
524
520
|
{ triggerTurn: false },
|
|
525
521
|
);
|
|
526
522
|
|
|
527
|
-
const { previousModel: dpm
|
|
523
|
+
const { previousModel: dpm } = state;
|
|
528
524
|
state.exitPreservingPlan();
|
|
529
525
|
pi.setActiveTools(EXEC_TOOLS);
|
|
530
526
|
if (dpm) await switchModel(pi, ctx, dpm);
|
|
531
|
-
if (dpt) pi.setThinkingLevel(dpt);
|
|
532
527
|
updateUI(state, ctx);
|
|
533
528
|
state.persist(pi);
|
|
534
529
|
return;
|
|
@@ -587,11 +582,10 @@ export default function planMode(pi: ExtensionAPI): void {
|
|
|
587
582
|
{ triggerTurn: false },
|
|
588
583
|
);
|
|
589
584
|
|
|
590
|
-
const { previousModel: pm
|
|
585
|
+
const { previousModel: pm } = state;
|
|
591
586
|
state.reset();
|
|
592
587
|
pi.setActiveTools(EXEC_TOOLS);
|
|
593
588
|
if (pm) await switchModel(pi, ctx, pm);
|
|
594
|
-
if (pt) pi.setThinkingLevel(pt);
|
|
595
589
|
updateUI(state, ctx);
|
|
596
590
|
state.persist(pi);
|
|
597
591
|
return;
|
|
@@ -599,8 +593,11 @@ export default function planMode(pi: ExtensionAPI): void {
|
|
|
599
593
|
return;
|
|
600
594
|
}
|
|
601
595
|
|
|
602
|
-
//
|
|
603
|
-
//
|
|
596
|
+
// Auto-exit plan mode after plan/initiative submission so the user
|
|
597
|
+
// returns to normal mode with their original model.
|
|
598
|
+
if (state.planEnabled) {
|
|
599
|
+
await exitPlanMode(state, pi, ctx);
|
|
600
|
+
}
|
|
604
601
|
});
|
|
605
602
|
|
|
606
603
|
// ── Event: session restore ────────────────────────────────────────────────
|
|
@@ -636,7 +633,7 @@ export default function planMode(pi: ExtensionAPI): void {
|
|
|
636
633
|
state.planEnabled = false;
|
|
637
634
|
pi.setActiveTools(EXEC_TOOLS);
|
|
638
635
|
await switchModel(pi, ctx, pending.config.model);
|
|
639
|
-
|
|
636
|
+
|
|
640
637
|
updateUI(state, ctx);
|
|
641
638
|
state.persist(pi);
|
|
642
639
|
return;
|
|
@@ -651,15 +648,11 @@ export default function planMode(pi: ExtensionAPI): void {
|
|
|
651
648
|
await resolveActivePlan(state, pi, runPlanIO);
|
|
652
649
|
}
|
|
653
650
|
|
|
654
|
-
// Apply tool restrictions
|
|
651
|
+
// Apply tool restrictions (no model/thinking override — keep user's settings)
|
|
655
652
|
if (state.planEnabled) {
|
|
656
653
|
pi.setActiveTools(PLAN_TOOLS);
|
|
657
|
-
await switchModel(pi, ctx, PLAN_MODEL);
|
|
658
|
-
pi.setThinkingLevel(PLAN_THINKING);
|
|
659
654
|
} else if (state.executing) {
|
|
660
655
|
pi.setActiveTools(EXEC_TOOLS);
|
|
661
|
-
await switchModel(pi, ctx, EXEC_MODEL);
|
|
662
|
-
pi.setThinkingLevel(EXEC_THINKING);
|
|
663
656
|
}
|
|
664
657
|
|
|
665
658
|
updateUI(state, ctx);
|
|
@@ -4,14 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
import type { ExtensionAPI, ExtensionContext } from '@earendil-works/pi-coding-agent';
|
|
6
6
|
import type { PlanModeState } from './state.js';
|
|
7
|
-
import type { ThinkingLevel } from './types.js';
|
|
8
7
|
import {
|
|
9
8
|
PLAN_TOOLS,
|
|
10
9
|
EXEC_TOOLS,
|
|
11
|
-
PLAN_MODEL,
|
|
12
|
-
PLAN_THINKING,
|
|
13
|
-
EXEC_MODEL,
|
|
14
|
-
EXEC_THINKING,
|
|
15
10
|
} from './constants.js';
|
|
16
11
|
import { updateUI } from './ui.js';
|
|
17
12
|
|
|
@@ -42,12 +37,9 @@ export async function enterPlanMode(
|
|
|
42
37
|
state.executing = false;
|
|
43
38
|
state.planDir = undefined;
|
|
44
39
|
state.plan = undefined;
|
|
45
|
-
state.previousThinking = pi.getThinkingLevel() as ThinkingLevel;
|
|
46
40
|
state.previousModel = ctx.model ? { provider: ctx.model.provider, id: ctx.model.id } : undefined;
|
|
47
41
|
pi.setActiveTools(PLAN_TOOLS);
|
|
48
|
-
|
|
49
|
-
pi.setThinkingLevel(PLAN_THINKING);
|
|
50
|
-
ctx.ui.notify(`Plan mode ON — ${PLAN_MODEL.provider}/${PLAN_MODEL.id}:${PLAN_THINKING}`, 'info');
|
|
42
|
+
ctx.ui.notify('Plan mode ON', 'info');
|
|
51
43
|
updateUI(state, ctx);
|
|
52
44
|
state.persist(pi);
|
|
53
45
|
}
|
|
@@ -57,16 +49,13 @@ export async function exitPlanMode(
|
|
|
57
49
|
pi: ExtensionAPI,
|
|
58
50
|
ctx: ExtensionContext,
|
|
59
51
|
): Promise<void> {
|
|
60
|
-
const { previousModel
|
|
52
|
+
const { previousModel } = state;
|
|
61
53
|
state.exitPreservingPlan();
|
|
62
54
|
pi.setActiveTools(EXEC_TOOLS);
|
|
63
55
|
if (previousModel) {
|
|
64
56
|
await switchModel(pi, ctx, previousModel);
|
|
65
57
|
}
|
|
66
|
-
|
|
67
|
-
pi.setThinkingLevel(previousThinking);
|
|
68
|
-
}
|
|
69
|
-
ctx.ui.notify('Plan mode OFF — original model restored', 'info');
|
|
58
|
+
ctx.ui.notify('Plan mode OFF', 'info');
|
|
70
59
|
updateUI(state, ctx);
|
|
71
60
|
state.persist(pi);
|
|
72
61
|
}
|
|
@@ -80,12 +69,7 @@ export async function startExecution(
|
|
|
80
69
|
state.executing = true;
|
|
81
70
|
state.executionStartIdx = ctx.sessionManager.getEntries().length;
|
|
82
71
|
pi.setActiveTools(EXEC_TOOLS);
|
|
83
|
-
|
|
84
|
-
pi.setThinkingLevel(EXEC_THINKING);
|
|
85
|
-
ctx.ui.notify(
|
|
86
|
-
`Executing plan — ${EXEC_MODEL.provider}/${EXEC_MODEL.id}:${EXEC_THINKING}`,
|
|
87
|
-
'info',
|
|
88
|
-
);
|
|
72
|
+
ctx.ui.notify('Executing plan', 'info');
|
|
89
73
|
updateUI(state, ctx);
|
|
90
74
|
state.persist(pi);
|
|
91
75
|
}
|
|
@@ -4,13 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
import type {
|
|
6
6
|
ExtensionAPI,
|
|
7
|
-
ExtensionContext,
|
|
8
7
|
ExtensionCommandContext,
|
|
9
8
|
} from '@earendil-works/pi-coding-agent';
|
|
10
9
|
import type { PlanModeState } from './state.js';
|
|
11
10
|
import type { PlanData } from './types.js';
|
|
12
11
|
import type { RunPlanIO } from '@dreki-gg/taskman';
|
|
13
|
-
|
|
12
|
+
|
|
14
13
|
import { readPlansManifest } from '@dreki-gg/taskman';
|
|
15
14
|
import { loadHandoff } from '@dreki-gg/taskman';
|
|
16
15
|
import { writeExecPending } from './exec-pending.js';
|
|
@@ -18,15 +17,6 @@ import { readTasksJsonl, writeTasksJsonl } from '@dreki-gg/taskman';
|
|
|
18
17
|
import { enterPlanMode } from './phase-transitions.js';
|
|
19
18
|
import { reactivateForExecution } from '@dreki-gg/taskman';
|
|
20
19
|
|
|
21
|
-
export async function pickExecutionModel(
|
|
22
|
-
ctx: ExtensionContext,
|
|
23
|
-
): Promise<{ provider: string; id: string } | undefined> {
|
|
24
|
-
const labels = EXEC_MODEL_OPTIONS.map((o) => o.label);
|
|
25
|
-
const choice = await ctx.ui.select('Execute with:', labels);
|
|
26
|
-
if (!choice) return undefined;
|
|
27
|
-
return EXEC_MODEL_OPTIONS.find((o) => o.label === choice)?.model;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
20
|
export async function executeInNewSession(
|
|
31
21
|
ctx: ExtensionCommandContext,
|
|
32
22
|
runPlanIO: RunPlanIO,
|
|
@@ -34,10 +24,12 @@ export async function executeInNewSession(
|
|
|
34
24
|
_planData: PlanData,
|
|
35
25
|
kickoff: string,
|
|
36
26
|
): Promise<void> {
|
|
37
|
-
|
|
38
|
-
|
|
27
|
+
// Use the current model for execution — no forced model override.
|
|
28
|
+
const currentModel = ctx.model
|
|
29
|
+
? { provider: ctx.model.provider, id: ctx.model.id }
|
|
30
|
+
: { provider: 'anthropic', id: 'claude-sonnet-4-20250514' };
|
|
39
31
|
|
|
40
|
-
await runPlanIO(writeExecPending(dir, { model:
|
|
32
|
+
await runPlanIO(writeExecPending(dir, { model: currentModel, thinking: 'low' }));
|
|
41
33
|
const parentSession = ctx.sessionManager.getSessionFile();
|
|
42
34
|
|
|
43
35
|
await ctx.newSession({
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import type { ExtensionAPI } from '@earendil-works/pi-coding-agent';
|
|
6
|
-
import type { PlanData, PersistedState
|
|
6
|
+
import type { PlanData, PersistedState } from './types.js';
|
|
7
7
|
|
|
8
8
|
export class PlanModeState {
|
|
9
9
|
planEnabled = false;
|
|
@@ -11,7 +11,6 @@ export class PlanModeState {
|
|
|
11
11
|
planDir: string | undefined;
|
|
12
12
|
plan: PlanData | undefined;
|
|
13
13
|
executionStartIdx: number | undefined;
|
|
14
|
-
previousThinking: ThinkingLevel | undefined;
|
|
15
14
|
previousModel: { provider: string; id: string } | undefined;
|
|
16
15
|
|
|
17
16
|
persist(pi: ExtensionAPI): void {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dreki-gg/pi-plan-mode",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.27.0",
|
|
4
4
|
"description": "Two-phase planning workflow for pi — plan with claude-opus-4-6:medium, execute with gpt-5.5:low, with .plans/ file-based handoff",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package"
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@dreki-gg/pi-command-sandbox": "^0.3.0",
|
|
44
|
-
"@dreki-gg/taskman": "^0.
|
|
44
|
+
"@dreki-gg/taskman": "^0.3.0",
|
|
45
45
|
"effect": "^3.21.2"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|