gsd-pi 2.34.0-dev.0150ae9 → 2.34.0-dev.7d38042
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/resources/extensions/gsd/changelog.js +162 -0
- package/dist/resources/extensions/gsd/commands-bootstrap.js +1 -0
- package/dist/resources/extensions/gsd/commands.js +8 -1
- package/package.json +1 -1
- package/packages/pi-coding-agent/dist/core/settings-manager.d.ts +8 -0
- package/packages/pi-coding-agent/dist/core/settings-manager.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/settings-manager.js +76 -166
- package/packages/pi-coding-agent/dist/core/settings-manager.js.map +1 -1
- package/packages/pi-coding-agent/src/core/settings-manager.ts +85 -164
- package/src/resources/extensions/gsd/changelog.ts +213 -0
- package/src/resources/extensions/gsd/commands-bootstrap.ts +1 -0
- package/src/resources/extensions/gsd/commands.ts +9 -1
|
@@ -349,13 +349,46 @@ export class SettingsManager {
|
|
|
349
349
|
this.errors = [];
|
|
350
350
|
return drained;
|
|
351
351
|
}
|
|
352
|
+
// ── Generic setter helpers ──────────────────────────────────────────
|
|
353
|
+
/** Set a top-level global setting field, mark modified, and save. */
|
|
354
|
+
setGlobalSetting(key, value) {
|
|
355
|
+
this.globalSettings[key] = value;
|
|
356
|
+
this.markModified(key);
|
|
357
|
+
this.save();
|
|
358
|
+
}
|
|
359
|
+
/** Set a top-level setting, scoped to project when project settings are active. */
|
|
360
|
+
setScopedSetting(key, value) {
|
|
361
|
+
if (this.hasProjectSettings()) {
|
|
362
|
+
this.projectSettings[key] = value;
|
|
363
|
+
this.markProjectModified(key);
|
|
364
|
+
this.saveProjectSettings(this.projectSettings);
|
|
365
|
+
}
|
|
366
|
+
else {
|
|
367
|
+
this.setGlobalSetting(key, value);
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
/** Set a nested field within a global settings object (e.g. compaction.enabled). */
|
|
371
|
+
setNestedGlobalSetting(key, nestedKey, value) {
|
|
372
|
+
if (!this.globalSettings[key]) {
|
|
373
|
+
this.globalSettings[key] = {};
|
|
374
|
+
}
|
|
375
|
+
this.globalSettings[key][nestedKey] = value;
|
|
376
|
+
this.markModified(key, nestedKey);
|
|
377
|
+
this.save();
|
|
378
|
+
}
|
|
379
|
+
/** Set a field on project settings (clone, set, mark modified, save). */
|
|
380
|
+
setProjectSetting(key, value) {
|
|
381
|
+
const projectSettings = structuredClone(this.projectSettings);
|
|
382
|
+
projectSettings[key] = value;
|
|
383
|
+
this.markProjectModified(key);
|
|
384
|
+
this.saveProjectSettings(projectSettings);
|
|
385
|
+
}
|
|
386
|
+
// ── Public getters and setters ──────────────────────────────────────
|
|
352
387
|
getLastChangelogVersion() {
|
|
353
388
|
return this.settings.lastChangelogVersion;
|
|
354
389
|
}
|
|
355
390
|
setLastChangelogVersion(version) {
|
|
356
|
-
this.
|
|
357
|
-
this.markModified("lastChangelogVersion");
|
|
358
|
-
this.save();
|
|
391
|
+
this.setGlobalSetting("lastChangelogVersion", version);
|
|
359
392
|
}
|
|
360
393
|
getDefaultProvider() {
|
|
361
394
|
return this.settings.defaultProvider;
|
|
@@ -364,28 +397,10 @@ export class SettingsManager {
|
|
|
364
397
|
return this.settings.defaultModel;
|
|
365
398
|
}
|
|
366
399
|
setDefaultProvider(provider) {
|
|
367
|
-
|
|
368
|
-
this.projectSettings.defaultProvider = provider;
|
|
369
|
-
this.markProjectModified("defaultProvider");
|
|
370
|
-
this.saveProjectSettings(this.projectSettings);
|
|
371
|
-
}
|
|
372
|
-
else {
|
|
373
|
-
this.globalSettings.defaultProvider = provider;
|
|
374
|
-
this.markModified("defaultProvider");
|
|
375
|
-
this.save();
|
|
376
|
-
}
|
|
400
|
+
this.setScopedSetting("defaultProvider", provider);
|
|
377
401
|
}
|
|
378
402
|
setDefaultModel(modelId) {
|
|
379
|
-
|
|
380
|
-
this.projectSettings.defaultModel = modelId;
|
|
381
|
-
this.markProjectModified("defaultModel");
|
|
382
|
-
this.saveProjectSettings(this.projectSettings);
|
|
383
|
-
}
|
|
384
|
-
else {
|
|
385
|
-
this.globalSettings.defaultModel = modelId;
|
|
386
|
-
this.markModified("defaultModel");
|
|
387
|
-
this.save();
|
|
388
|
-
}
|
|
403
|
+
this.setScopedSetting("defaultModel", modelId);
|
|
389
404
|
}
|
|
390
405
|
setDefaultModelAndProvider(provider, modelId) {
|
|
391
406
|
if (this.hasProjectSettings()) {
|
|
@@ -407,52 +422,37 @@ export class SettingsManager {
|
|
|
407
422
|
return this.settings.steeringMode || "one-at-a-time";
|
|
408
423
|
}
|
|
409
424
|
setSteeringMode(mode) {
|
|
410
|
-
this.
|
|
411
|
-
this.markModified("steeringMode");
|
|
412
|
-
this.save();
|
|
425
|
+
this.setGlobalSetting("steeringMode", mode);
|
|
413
426
|
}
|
|
414
427
|
getFollowUpMode() {
|
|
415
428
|
return this.settings.followUpMode || "one-at-a-time";
|
|
416
429
|
}
|
|
417
430
|
setFollowUpMode(mode) {
|
|
418
|
-
this.
|
|
419
|
-
this.markModified("followUpMode");
|
|
420
|
-
this.save();
|
|
431
|
+
this.setGlobalSetting("followUpMode", mode);
|
|
421
432
|
}
|
|
422
433
|
getTheme() {
|
|
423
434
|
return this.settings.theme;
|
|
424
435
|
}
|
|
425
436
|
setTheme(theme) {
|
|
426
|
-
this.
|
|
427
|
-
this.markModified("theme");
|
|
428
|
-
this.save();
|
|
437
|
+
this.setGlobalSetting("theme", theme);
|
|
429
438
|
}
|
|
430
439
|
getDefaultThinkingLevel() {
|
|
431
440
|
return this.settings.defaultThinkingLevel;
|
|
432
441
|
}
|
|
433
442
|
setDefaultThinkingLevel(level) {
|
|
434
|
-
this.
|
|
435
|
-
this.markModified("defaultThinkingLevel");
|
|
436
|
-
this.save();
|
|
443
|
+
this.setGlobalSetting("defaultThinkingLevel", level);
|
|
437
444
|
}
|
|
438
445
|
getTransport() {
|
|
439
446
|
return this.settings.transport ?? "sse";
|
|
440
447
|
}
|
|
441
448
|
setTransport(transport) {
|
|
442
|
-
this.
|
|
443
|
-
this.markModified("transport");
|
|
444
|
-
this.save();
|
|
449
|
+
this.setGlobalSetting("transport", transport);
|
|
445
450
|
}
|
|
446
451
|
getCompactionEnabled() {
|
|
447
452
|
return this.settings.compaction?.enabled ?? true;
|
|
448
453
|
}
|
|
449
454
|
setCompactionEnabled(enabled) {
|
|
450
|
-
|
|
451
|
-
this.globalSettings.compaction = {};
|
|
452
|
-
}
|
|
453
|
-
this.globalSettings.compaction.enabled = enabled;
|
|
454
|
-
this.markModified("compaction", "enabled");
|
|
455
|
-
this.save();
|
|
455
|
+
this.setNestedGlobalSetting("compaction", "enabled", enabled);
|
|
456
456
|
}
|
|
457
457
|
getCompactionReserveTokens() {
|
|
458
458
|
return this.settings.compaction?.reserveTokens ?? COMPACTION_RESERVE_TOKENS;
|
|
@@ -480,12 +480,7 @@ export class SettingsManager {
|
|
|
480
480
|
return this.settings.retry?.enabled ?? true;
|
|
481
481
|
}
|
|
482
482
|
setRetryEnabled(enabled) {
|
|
483
|
-
|
|
484
|
-
this.globalSettings.retry = {};
|
|
485
|
-
}
|
|
486
|
-
this.globalSettings.retry.enabled = enabled;
|
|
487
|
-
this.markModified("retry", "enabled");
|
|
488
|
-
this.save();
|
|
483
|
+
this.setNestedGlobalSetting("retry", "enabled", enabled);
|
|
489
484
|
}
|
|
490
485
|
getRetrySettings() {
|
|
491
486
|
return {
|
|
@@ -499,119 +494,82 @@ export class SettingsManager {
|
|
|
499
494
|
return this.settings.hideThinkingBlock ?? false;
|
|
500
495
|
}
|
|
501
496
|
setHideThinkingBlock(hide) {
|
|
502
|
-
this.
|
|
503
|
-
this.markModified("hideThinkingBlock");
|
|
504
|
-
this.save();
|
|
497
|
+
this.setGlobalSetting("hideThinkingBlock", hide);
|
|
505
498
|
}
|
|
506
499
|
getShellPath() {
|
|
507
500
|
return this.settings.shellPath;
|
|
508
501
|
}
|
|
509
502
|
setShellPath(path) {
|
|
510
|
-
this.
|
|
511
|
-
this.markModified("shellPath");
|
|
512
|
-
this.save();
|
|
503
|
+
this.setGlobalSetting("shellPath", path);
|
|
513
504
|
}
|
|
514
505
|
getQuietStartup() {
|
|
515
506
|
return this.settings.quietStartup ?? false;
|
|
516
507
|
}
|
|
517
508
|
setQuietStartup(quiet) {
|
|
518
|
-
this.
|
|
519
|
-
this.markModified("quietStartup");
|
|
520
|
-
this.save();
|
|
509
|
+
this.setGlobalSetting("quietStartup", quiet);
|
|
521
510
|
}
|
|
522
511
|
getShellCommandPrefix() {
|
|
523
512
|
return this.settings.shellCommandPrefix;
|
|
524
513
|
}
|
|
525
514
|
setShellCommandPrefix(prefix) {
|
|
526
|
-
this.
|
|
527
|
-
this.markModified("shellCommandPrefix");
|
|
528
|
-
this.save();
|
|
515
|
+
this.setGlobalSetting("shellCommandPrefix", prefix);
|
|
529
516
|
}
|
|
530
517
|
getCollapseChangelog() {
|
|
531
518
|
return this.settings.collapseChangelog ?? false;
|
|
532
519
|
}
|
|
533
520
|
setCollapseChangelog(collapse) {
|
|
534
|
-
this.
|
|
535
|
-
this.markModified("collapseChangelog");
|
|
536
|
-
this.save();
|
|
521
|
+
this.setGlobalSetting("collapseChangelog", collapse);
|
|
537
522
|
}
|
|
538
523
|
getPackages() {
|
|
539
524
|
return [...(this.settings.packages ?? [])];
|
|
540
525
|
}
|
|
541
526
|
setPackages(packages) {
|
|
542
|
-
this.
|
|
543
|
-
this.markModified("packages");
|
|
544
|
-
this.save();
|
|
527
|
+
this.setGlobalSetting("packages", packages);
|
|
545
528
|
}
|
|
546
529
|
setProjectPackages(packages) {
|
|
547
|
-
|
|
548
|
-
projectSettings.packages = packages;
|
|
549
|
-
this.markProjectModified("packages");
|
|
550
|
-
this.saveProjectSettings(projectSettings);
|
|
530
|
+
this.setProjectSetting("packages", packages);
|
|
551
531
|
}
|
|
552
532
|
getExtensionPaths() {
|
|
553
533
|
return [...(this.settings.extensions ?? [])];
|
|
554
534
|
}
|
|
555
535
|
setExtensionPaths(paths) {
|
|
556
|
-
this.
|
|
557
|
-
this.markModified("extensions");
|
|
558
|
-
this.save();
|
|
536
|
+
this.setGlobalSetting("extensions", paths);
|
|
559
537
|
}
|
|
560
538
|
setProjectExtensionPaths(paths) {
|
|
561
|
-
|
|
562
|
-
projectSettings.extensions = paths;
|
|
563
|
-
this.markProjectModified("extensions");
|
|
564
|
-
this.saveProjectSettings(projectSettings);
|
|
539
|
+
this.setProjectSetting("extensions", paths);
|
|
565
540
|
}
|
|
566
541
|
getSkillPaths() {
|
|
567
542
|
return [...(this.settings.skills ?? [])];
|
|
568
543
|
}
|
|
569
544
|
setSkillPaths(paths) {
|
|
570
|
-
this.
|
|
571
|
-
this.markModified("skills");
|
|
572
|
-
this.save();
|
|
545
|
+
this.setGlobalSetting("skills", paths);
|
|
573
546
|
}
|
|
574
547
|
setProjectSkillPaths(paths) {
|
|
575
|
-
|
|
576
|
-
projectSettings.skills = paths;
|
|
577
|
-
this.markProjectModified("skills");
|
|
578
|
-
this.saveProjectSettings(projectSettings);
|
|
548
|
+
this.setProjectSetting("skills", paths);
|
|
579
549
|
}
|
|
580
550
|
getPromptTemplatePaths() {
|
|
581
551
|
return [...(this.settings.prompts ?? [])];
|
|
582
552
|
}
|
|
583
553
|
setPromptTemplatePaths(paths) {
|
|
584
|
-
this.
|
|
585
|
-
this.markModified("prompts");
|
|
586
|
-
this.save();
|
|
554
|
+
this.setGlobalSetting("prompts", paths);
|
|
587
555
|
}
|
|
588
556
|
setProjectPromptTemplatePaths(paths) {
|
|
589
|
-
|
|
590
|
-
projectSettings.prompts = paths;
|
|
591
|
-
this.markProjectModified("prompts");
|
|
592
|
-
this.saveProjectSettings(projectSettings);
|
|
557
|
+
this.setProjectSetting("prompts", paths);
|
|
593
558
|
}
|
|
594
559
|
getThemePaths() {
|
|
595
560
|
return [...(this.settings.themes ?? [])];
|
|
596
561
|
}
|
|
597
562
|
setThemePaths(paths) {
|
|
598
|
-
this.
|
|
599
|
-
this.markModified("themes");
|
|
600
|
-
this.save();
|
|
563
|
+
this.setGlobalSetting("themes", paths);
|
|
601
564
|
}
|
|
602
565
|
setProjectThemePaths(paths) {
|
|
603
|
-
|
|
604
|
-
projectSettings.themes = paths;
|
|
605
|
-
this.markProjectModified("themes");
|
|
606
|
-
this.saveProjectSettings(projectSettings);
|
|
566
|
+
this.setProjectSetting("themes", paths);
|
|
607
567
|
}
|
|
608
568
|
getEnableSkillCommands() {
|
|
609
569
|
return this.settings.enableSkillCommands ?? true;
|
|
610
570
|
}
|
|
611
571
|
setEnableSkillCommands(enabled) {
|
|
612
|
-
this.
|
|
613
|
-
this.markModified("enableSkillCommands");
|
|
614
|
-
this.save();
|
|
572
|
+
this.setGlobalSetting("enableSkillCommands", enabled);
|
|
615
573
|
}
|
|
616
574
|
getThinkingBudgets() {
|
|
617
575
|
return this.settings.thinkingBudgets;
|
|
@@ -620,12 +578,7 @@ export class SettingsManager {
|
|
|
620
578
|
return this.settings.terminal?.showImages ?? true;
|
|
621
579
|
}
|
|
622
580
|
setShowImages(show) {
|
|
623
|
-
|
|
624
|
-
this.globalSettings.terminal = {};
|
|
625
|
-
}
|
|
626
|
-
this.globalSettings.terminal.showImages = show;
|
|
627
|
-
this.markModified("terminal", "showImages");
|
|
628
|
-
this.save();
|
|
581
|
+
this.setNestedGlobalSetting("terminal", "showImages", show);
|
|
629
582
|
}
|
|
630
583
|
getClearOnShrink() {
|
|
631
584
|
// Settings takes precedence, then env var, then default false
|
|
@@ -635,50 +588,31 @@ export class SettingsManager {
|
|
|
635
588
|
return process.env.PI_CLEAR_ON_SHRINK === "1";
|
|
636
589
|
}
|
|
637
590
|
setClearOnShrink(enabled) {
|
|
638
|
-
|
|
639
|
-
this.globalSettings.terminal = {};
|
|
640
|
-
}
|
|
641
|
-
this.globalSettings.terminal.clearOnShrink = enabled;
|
|
642
|
-
this.markModified("terminal", "clearOnShrink");
|
|
643
|
-
this.save();
|
|
591
|
+
this.setNestedGlobalSetting("terminal", "clearOnShrink", enabled);
|
|
644
592
|
}
|
|
645
593
|
getImageAutoResize() {
|
|
646
594
|
return this.settings.images?.autoResize ?? true;
|
|
647
595
|
}
|
|
648
596
|
setImageAutoResize(enabled) {
|
|
649
|
-
|
|
650
|
-
this.globalSettings.images = {};
|
|
651
|
-
}
|
|
652
|
-
this.globalSettings.images.autoResize = enabled;
|
|
653
|
-
this.markModified("images", "autoResize");
|
|
654
|
-
this.save();
|
|
597
|
+
this.setNestedGlobalSetting("images", "autoResize", enabled);
|
|
655
598
|
}
|
|
656
599
|
getBlockImages() {
|
|
657
600
|
return this.settings.images?.blockImages ?? false;
|
|
658
601
|
}
|
|
659
602
|
setBlockImages(blocked) {
|
|
660
|
-
|
|
661
|
-
this.globalSettings.images = {};
|
|
662
|
-
}
|
|
663
|
-
this.globalSettings.images.blockImages = blocked;
|
|
664
|
-
this.markModified("images", "blockImages");
|
|
665
|
-
this.save();
|
|
603
|
+
this.setNestedGlobalSetting("images", "blockImages", blocked);
|
|
666
604
|
}
|
|
667
605
|
getEnabledModels() {
|
|
668
606
|
return this.settings.enabledModels;
|
|
669
607
|
}
|
|
670
608
|
setEnabledModels(patterns) {
|
|
671
|
-
this.
|
|
672
|
-
this.markModified("enabledModels");
|
|
673
|
-
this.save();
|
|
609
|
+
this.setGlobalSetting("enabledModels", patterns);
|
|
674
610
|
}
|
|
675
611
|
getDoubleEscapeAction() {
|
|
676
612
|
return this.settings.doubleEscapeAction ?? "tree";
|
|
677
613
|
}
|
|
678
614
|
setDoubleEscapeAction(action) {
|
|
679
|
-
this.
|
|
680
|
-
this.markModified("doubleEscapeAction");
|
|
681
|
-
this.save();
|
|
615
|
+
this.setGlobalSetting("doubleEscapeAction", action);
|
|
682
616
|
}
|
|
683
617
|
getTreeFilterMode() {
|
|
684
618
|
const mode = this.settings.treeFilterMode;
|
|
@@ -686,49 +620,37 @@ export class SettingsManager {
|
|
|
686
620
|
return mode && valid.includes(mode) ? mode : "default";
|
|
687
621
|
}
|
|
688
622
|
setTreeFilterMode(mode) {
|
|
689
|
-
this.
|
|
690
|
-
this.markModified("treeFilterMode");
|
|
691
|
-
this.save();
|
|
623
|
+
this.setGlobalSetting("treeFilterMode", mode);
|
|
692
624
|
}
|
|
693
625
|
getShowHardwareCursor() {
|
|
694
626
|
return this.settings.showHardwareCursor ?? process.env.PI_HARDWARE_CURSOR === "1";
|
|
695
627
|
}
|
|
696
628
|
setShowHardwareCursor(enabled) {
|
|
697
|
-
this.
|
|
698
|
-
this.markModified("showHardwareCursor");
|
|
699
|
-
this.save();
|
|
629
|
+
this.setGlobalSetting("showHardwareCursor", enabled);
|
|
700
630
|
}
|
|
701
631
|
getEditorPaddingX() {
|
|
702
632
|
return this.settings.editorPaddingX ?? 0;
|
|
703
633
|
}
|
|
704
634
|
setEditorPaddingX(padding) {
|
|
705
|
-
this.
|
|
706
|
-
this.markModified("editorPaddingX");
|
|
707
|
-
this.save();
|
|
635
|
+
this.setGlobalSetting("editorPaddingX", Math.max(0, Math.min(3, Math.floor(padding))));
|
|
708
636
|
}
|
|
709
637
|
getAutocompleteMaxVisible() {
|
|
710
638
|
return this.settings.autocompleteMaxVisible ?? 5;
|
|
711
639
|
}
|
|
712
640
|
setAutocompleteMaxVisible(maxVisible) {
|
|
713
|
-
this.
|
|
714
|
-
this.markModified("autocompleteMaxVisible");
|
|
715
|
-
this.save();
|
|
641
|
+
this.setGlobalSetting("autocompleteMaxVisible", Math.max(3, Math.min(20, Math.floor(maxVisible))));
|
|
716
642
|
}
|
|
717
643
|
getRespectGitignoreInPicker() {
|
|
718
644
|
return this.settings.respectGitignoreInPicker ?? true;
|
|
719
645
|
}
|
|
720
646
|
setRespectGitignoreInPicker(value) {
|
|
721
|
-
this.
|
|
722
|
-
this.markModified("respectGitignoreInPicker");
|
|
723
|
-
this.save();
|
|
647
|
+
this.setGlobalSetting("respectGitignoreInPicker", value);
|
|
724
648
|
}
|
|
725
649
|
getSearchExcludeDirs() {
|
|
726
650
|
return this.settings.searchExcludeDirs ?? [];
|
|
727
651
|
}
|
|
728
652
|
setSearchExcludeDirs(dirs) {
|
|
729
|
-
this.
|
|
730
|
-
this.markModified("searchExcludeDirs");
|
|
731
|
-
this.save();
|
|
653
|
+
this.setGlobalSetting("searchExcludeDirs", dirs.filter(Boolean));
|
|
732
654
|
}
|
|
733
655
|
getCodeBlockIndent() {
|
|
734
656
|
return this.settings.markdown?.codeBlockIndent ?? " ";
|
|
@@ -759,12 +681,7 @@ export class SettingsManager {
|
|
|
759
681
|
return this.settings.fallback?.enabled ?? false;
|
|
760
682
|
}
|
|
761
683
|
setFallbackEnabled(enabled) {
|
|
762
|
-
|
|
763
|
-
this.globalSettings.fallback = {};
|
|
764
|
-
}
|
|
765
|
-
this.globalSettings.fallback.enabled = enabled;
|
|
766
|
-
this.markModified("fallback", "enabled");
|
|
767
|
-
this.save();
|
|
684
|
+
this.setNestedGlobalSetting("fallback", "enabled", enabled);
|
|
768
685
|
}
|
|
769
686
|
getFallbackChains() {
|
|
770
687
|
return this.settings.fallback?.chains ?? {};
|
|
@@ -806,20 +723,13 @@ export class SettingsManager {
|
|
|
806
723
|
return this.settings.modelDiscovery ?? {};
|
|
807
724
|
}
|
|
808
725
|
setModelDiscoveryEnabled(enabled) {
|
|
809
|
-
|
|
810
|
-
this.globalSettings.modelDiscovery = {};
|
|
811
|
-
}
|
|
812
|
-
this.globalSettings.modelDiscovery.enabled = enabled;
|
|
813
|
-
this.markModified("modelDiscovery", "enabled");
|
|
814
|
-
this.save();
|
|
726
|
+
this.setNestedGlobalSetting("modelDiscovery", "enabled", enabled);
|
|
815
727
|
}
|
|
816
728
|
getEditMode() {
|
|
817
729
|
return this.settings.editMode ?? "standard";
|
|
818
730
|
}
|
|
819
731
|
setEditMode(mode) {
|
|
820
|
-
this.
|
|
821
|
-
this.markModified("editMode");
|
|
822
|
-
this.save();
|
|
732
|
+
this.setGlobalSetting("editMode", mode);
|
|
823
733
|
}
|
|
824
734
|
}
|
|
825
735
|
//# sourceMappingURL=settings-manager.js.map
|