taskplane 0.24.21 → 0.24.22
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/bin/taskplane.mjs +239 -103
- package/extensions/task-runner.ts +2 -110
- package/extensions/taskplane/config-loader.ts +306 -269
- package/extensions/taskplane/config-schema.ts +49 -32
- package/extensions/taskplane/merge.ts +1 -1
- package/extensions/taskplane/settings-tui.ts +149 -172
- package/extensions/taskplane/supervisor.ts +2 -2
- package/extensions/taskplane/types.ts +1 -1
- package/package.json +1 -1
|
@@ -480,34 +480,25 @@ export interface TaskplaneConfig {
|
|
|
480
480
|
}
|
|
481
481
|
|
|
482
482
|
|
|
483
|
-
// ──
|
|
483
|
+
// ── Global Preferences (Layer 2) ─────────────────────────────────────
|
|
484
484
|
|
|
485
485
|
/**
|
|
486
|
-
*
|
|
486
|
+
* Global preferences — personal settings stored per-user.
|
|
487
487
|
*
|
|
488
488
|
* File: `~/.pi/agent/taskplane/preferences.json`
|
|
489
489
|
* (or `$PI_CODING_AGENT_DIR/taskplane/preferences.json` if set)
|
|
490
490
|
*
|
|
491
491
|
* These are "Layer 2" fields — they override project config (Layer 1)
|
|
492
492
|
* for user-scoped settings only. The merge is allowlist-based: only
|
|
493
|
-
* the fields defined here can be overridden by
|
|
493
|
+
* the fields defined here can be overridden by global preferences.
|
|
494
494
|
* Unknown keys in the preferences file are silently ignored.
|
|
495
495
|
*
|
|
496
496
|
* Preferences JSON uses camelCase keys matching the runtime config shape.
|
|
497
497
|
*
|
|
498
|
-
* Layer 2 allowlist
|
|
499
|
-
*
|
|
500
|
-
*
|
|
501
|
-
*
|
|
502
|
-
* | operatorId | orchestrator.orchestrator.operatorId | string |
|
|
503
|
-
* | sessionPrefix | orchestrator.orchestrator.sessionPrefix | string |
|
|
504
|
-
* | spawnMode | orchestrator.orchestrator.spawnMode | string |
|
|
505
|
-
* | workerModel | taskRunner.worker.model | string |
|
|
506
|
-
* | reviewerModel | taskRunner.reviewer.model | string |
|
|
507
|
-
* | mergeModel | orchestrator.merge.model | string |
|
|
508
|
-
* | supervisorModel | orchestrator.supervisor.model | string |
|
|
509
|
-
* | dashboardPort | (preferences-only; not yet in schema)| number |
|
|
510
|
-
* | initAgentDefaults | (preferences-only; used by init UX) | object |
|
|
498
|
+
* Layer 2 allowlist:
|
|
499
|
+
* - Config-shaped nested overrides (`taskRunner`, `orchestrator`, `workspace`)
|
|
500
|
+
* - Legacy flat aliases (`workerModel`, `reviewerModel`, etc.) for backward compatibility
|
|
501
|
+
* - Preferences-only keys (`dashboardPort`, `initAgentDefaults`)
|
|
511
502
|
*/
|
|
512
503
|
export interface InitAgentDefaultsPreferences {
|
|
513
504
|
/** Worker model default for `taskplane init` prompts (empty = inherit) */
|
|
@@ -524,42 +515,68 @@ export interface InitAgentDefaultsPreferences {
|
|
|
524
515
|
mergeThinking?: string;
|
|
525
516
|
}
|
|
526
517
|
|
|
527
|
-
export
|
|
528
|
-
|
|
518
|
+
export type DeepPartial<T> = T extends Array<infer U>
|
|
519
|
+
? Array<DeepPartial<U>>
|
|
520
|
+
: T extends object
|
|
521
|
+
? { [K in keyof T]?: DeepPartial<T[K]> }
|
|
522
|
+
: T;
|
|
523
|
+
|
|
524
|
+
export interface GlobalPreferences {
|
|
525
|
+
/**
|
|
526
|
+
* Global baseline overrides using the same shape as project config.
|
|
527
|
+
* All fields are optional and merged deeply into schema defaults.
|
|
528
|
+
*/
|
|
529
|
+
taskRunner?: DeepPartial<TaskRunnerSection>;
|
|
530
|
+
orchestrator?: DeepPartial<OrchestratorSection>;
|
|
531
|
+
workspace?: DeepPartial<WorkspaceSectionConfig>;
|
|
532
|
+
|
|
533
|
+
/** Legacy flat aliases (backward compatibility for existing preferences.json files). */
|
|
529
534
|
operatorId?: string;
|
|
530
|
-
/** Orchestrator session prefix (overrides orchestrator.orchestrator.sessionPrefix) */
|
|
531
535
|
sessionPrefix?: string;
|
|
532
|
-
/** Spawn mode override (overrides orchestrator.orchestrator.spawnMode). */
|
|
533
536
|
spawnMode?: "subprocess";
|
|
534
|
-
/** Worker model override (overrides taskRunner.worker.model) */
|
|
535
537
|
workerModel?: string;
|
|
536
|
-
/** Reviewer model override (overrides taskRunner.reviewer.model) */
|
|
537
538
|
reviewerModel?: string;
|
|
538
|
-
/** Merge model override (overrides orchestrator.merge.model) */
|
|
539
539
|
mergeModel?: string;
|
|
540
|
-
/** Merge thinking override (overrides orchestrator.merge.thinking) */
|
|
541
540
|
mergeThinking?: string;
|
|
542
|
-
/** Supervisor model override (overrides orchestrator.supervisor.model) (TP-041) */
|
|
543
541
|
supervisorModel?: string;
|
|
544
|
-
|
|
542
|
+
|
|
543
|
+
/** Preferences-only values (stored globally, not merged into runtime config). */
|
|
545
544
|
dashboardPort?: number;
|
|
546
545
|
/** Saved defaults used to pre-populate `taskplane init` model/thinking prompts */
|
|
547
546
|
initAgentDefaults?: InitAgentDefaultsPreferences;
|
|
548
547
|
}
|
|
549
548
|
|
|
550
|
-
/** Default (empty)
|
|
551
|
-
export const
|
|
549
|
+
/** Default (empty) global preferences — all fields undefined means "no override". */
|
|
550
|
+
export const DEFAULT_GLOBAL_PREFERENCES: GlobalPreferences = {};
|
|
551
|
+
|
|
552
|
+
/**
|
|
553
|
+
* Seed values used when first bootstrapping preferences.json.
|
|
554
|
+
*
|
|
555
|
+
* Kept separate from DEFAULT_GLOBAL_PREFERENCES so runtime fallback semantics
|
|
556
|
+
* remain "no override", while first-install scaffolding can provide
|
|
557
|
+
* user-friendly init defaults.
|
|
558
|
+
*/
|
|
559
|
+
export const DEFAULT_BOOTSTRAP_GLOBAL_PREFERENCES: GlobalPreferences = {
|
|
560
|
+
initAgentDefaults: {
|
|
561
|
+
workerModel: "",
|
|
562
|
+
reviewerModel: "",
|
|
563
|
+
mergeModel: "",
|
|
564
|
+
workerThinking: "high",
|
|
565
|
+
reviewerThinking: "high",
|
|
566
|
+
mergeThinking: "high",
|
|
567
|
+
},
|
|
568
|
+
};
|
|
552
569
|
|
|
553
570
|
/**
|
|
554
|
-
* Canonical filename for
|
|
571
|
+
* Canonical filename for global preferences.
|
|
555
572
|
* Resolved relative to agent directory: `<agentDir>/taskplane/preferences.json`
|
|
556
573
|
*/
|
|
557
|
-
export const
|
|
574
|
+
export const GLOBAL_PREFERENCES_FILENAME = "preferences.json";
|
|
558
575
|
|
|
559
576
|
/**
|
|
560
577
|
* Subdirectory under the agent dir for taskplane preferences.
|
|
561
578
|
*/
|
|
562
|
-
export const
|
|
579
|
+
export const GLOBAL_PREFERENCES_SUBDIR = "taskplane";
|
|
563
580
|
|
|
564
581
|
|
|
565
582
|
// ── Defaults ─────────────────────────────────────────────────────────
|
|
@@ -624,7 +641,7 @@ export const DEFAULT_ORCHESTRATOR_SECTION: OrchestratorSection = {
|
|
|
624
641
|
merge: {
|
|
625
642
|
model: "",
|
|
626
643
|
tools: "read,write,edit,bash,grep,find,ls",
|
|
627
|
-
thinking: "",
|
|
644
|
+
thinking: "off",
|
|
628
645
|
verify: [],
|
|
629
646
|
order: "fewest-files-first",
|
|
630
647
|
timeoutMinutes: 90,
|
|
@@ -611,7 +611,7 @@ export async function spawnMergeAgentV2(
|
|
|
611
611
|
packet: null,
|
|
612
612
|
env: {
|
|
613
613
|
ORCH_BATCH_ID: bid,
|
|
614
|
-
// Isolate merge agent from operator's
|
|
614
|
+
// Isolate merge agent from operator's global preferences to prevent
|
|
615
615
|
// verification test contamination (e.g., stale reviewerModel pref
|
|
616
616
|
// overriding schema defaults in deep-equal assertions).
|
|
617
617
|
PI_CODING_AGENT_DIR: join(sidecarRoot, "runtime", bid, "merge-agent-env"),
|