@aefree/pi-plastic 0.5.3 → 0.5.4

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
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project follows semantic versioning for public package releases.
7
7
 
8
+ ## [0.5.4] - 2026-08-13
9
+
10
+ ### Fixed
11
+
12
+ - Recognize both `smartbranch` and `br` branch forms in Plastic workspace selectors, including quoted values produced by different checkout workflows.
13
+ - Use a valid local selector as the footer's authoritative branch source instead of launching an unnecessary `cm status` process; malformed or missing branch selectors retain the bounded CLI fallback.
14
+
8
15
  ## [0.5.3] - 2026-08-09
9
16
 
10
17
  ### Changed
package/README.md CHANGED
@@ -4,7 +4,7 @@ Pi tools, footer status, and skill guidance for Plastic SCM / Unity Version Cont
4
4
 
5
5
  ## Plastic branch footer status
6
6
 
7
- When Pi starts inside a Plastic workspace, this package adds a themed `Plastic <branch>` status to Pi's built-in footer. It discovers the nearest enclosing `.plastic/plastic.workspace`, reads the local selector as a fast credential-free fallback, and confirms the branch with a bounded `cm status` call. Selector changes and successful same-workspace `plastic_*` tools refresh the status; sibling workspaces are ignored.
7
+ When Pi starts inside a Plastic workspace, this package adds a themed `Plastic <branch>` status to Pi's built-in footer. It discovers the nearest enclosing `.plastic/plastic.workspace` and reads either the selector's `smartbranch` or `br` form as the credential-free branch source. A bounded `cm status` call is used only when the selector has no valid branch. Selector changes and successful same-workspace `plastic_*` tools refresh the status; sibling workspaces are ignored.
8
8
 
9
9
  The extension owns only the `plastic-branch` status key. It does not replace Pi's footer or suppress Pi's Git branch display, so Git and Plastic information can appear together in nested workspaces. If the Plastic marker exists but neither the selector nor `cm` yields a branch, the footer shows `Plastic branch unavailable`. Non-Plastic directories show no Plastic status.
10
10
 
@@ -107,13 +107,13 @@ pi install npm:@aefree/pi-plastic
107
107
  Install a pinned GitHub release over HTTPS:
108
108
 
109
109
  ```bash
110
- pi install git:github.com/aefreedman/pi-plastic@v0.5.3
110
+ pi install git:github.com/aefreedman/pi-plastic@v0.5.4
111
111
  ```
112
112
 
113
113
  Equivalent SSH install:
114
114
 
115
115
  ```bash
116
- pi install git:git@github.com/aefreedman/pi-plastic@v0.5.3
116
+ pi install git:git@github.com/aefreedman/pi-plastic@v0.5.4
117
117
  ```
118
118
 
119
119
  To intentionally track the moving default branch instead of a release tag:
@@ -219,7 +219,8 @@ export function createPlasticBranchStatusExtension(overrides: Partial<BranchStat
219
219
  if (!active || generation !== ownedGeneration || refreshSequence !== ownedRefresh) return;
220
220
 
221
221
  const hasSelectorBranch = selectorBranch ? displayBranch(selectorBranch) : false;
222
- if (!hasSelectorBranch) displayUnavailable();
222
+ if (hasSelectorBranch) return;
223
+ displayUnavailable();
223
224
 
224
225
  const controller = new AbortController();
225
226
  confirmationController = controller;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aefree/pi-plastic",
3
- "version": "0.5.3",
3
+ "version": "0.5.4",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": ">=22.19.0"
@@ -78,7 +78,8 @@ const parseSelectorValue = (line: string, key: string): string | undefined => {
78
78
  /** Parse the local selector without treating it as proof that a workspace exists. */
79
79
  export function parsePlasticSelector(content: string): ParseOutcome<PlasticSelector> {
80
80
  let repository: string | undefined;
81
- let branch: string | undefined;
81
+ let smartBranch: string | undefined;
82
+ let explicitBranch: string | undefined;
82
83
  let sawBranchKey = false;
83
84
 
84
85
  for (const line of content.split(/\r?\n/)) {
@@ -86,13 +87,18 @@ export function parsePlasticSelector(content: string): ParseOutcome<PlasticSelec
86
87
  if (/^\s*repository(?:\s|$)/i.test(line)) repository = parseSelectorValue(line, "repository");
87
88
  if (/^\s*smartbranch(?:\s|$)/i.test(line)) {
88
89
  sawBranchKey = true;
89
- branch = parseSelectorValue(line, "smartbranch");
90
+ smartBranch = parseSelectorValue(line, "smartbranch");
91
+ }
92
+ if (/^\s*br(?:\s|$)/i.test(line)) {
93
+ sawBranchKey = true;
94
+ explicitBranch = parseSelectorValue(line, "br");
90
95
  }
91
96
  }
92
97
 
93
98
  if (!sawBranchKey) return { kind: "not_found" };
99
+ const branch = smartBranch ?? explicitBranch;
94
100
  if (!branch || /[\u0000-\u001f\u007f]/.test(branch)) {
95
- return { kind: "malformed", reason: "Selector smartbranch is blank or contains control characters." };
101
+ return { kind: "malformed", reason: "Selector branch is blank or contains control characters." };
96
102
  }
97
103
 
98
104
  return {