create-pmos 0.582.0 → 0.583.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-pmos",
3
- "version": "0.582.0",
3
+ "version": "0.583.0",
4
4
  "description": "Scaffold the PMOS portable kit — run the PMOS product-management workflow (initiative → lane-fit spec → contract → build → three gates, with work-type lanes for features, research, maintenance, incidents, and content) entirely inside your own repo, with all state as git-versioned files. Includes `workflow-sweep`, which audits the state every board derives from and separates real defects from work you simply have not done. `create-pmos workspace` also installs + launches the local Terminal Workspace GUI. No database, no network, no telemetry.",
5
5
  "license": "MIT",
6
6
  "bin": {
@@ -33,6 +33,19 @@
33
33
  "audit"
34
34
  ],
35
35
  "pmosChanges": [
36
+ {
37
+ "v": "0.583.0",
38
+ "at": "2026-11-17T04:07:38.209Z",
39
+ "f": 4,
40
+ "prs": [
41
+ {
42
+ "n": 1316,
43
+ "t": "Answer Claude Code's add-directory trust prompt for PMOS's own chat-files folder",
44
+ "s": "Answer Claude Code's add-directory trust prompt for PMOS's own chat-files folder",
45
+ "k": "fix"
46
+ }
47
+ ]
48
+ },
36
49
  {
37
50
  "v": "0.582.0",
38
51
  "at": "2026-11-17T02:50:44.770Z",
@@ -285,19 +298,6 @@
285
298
  "k": "fix"
286
299
  }
287
300
  ]
288
- },
289
- {
290
- "v": "0.563.0",
291
- "at": "2026-11-11T12:32:19.496Z",
292
- "f": 4,
293
- "prs": [
294
- {
295
- "n": 1294,
296
- "t": "The feature registry and pmos blueprint, each status derived from evidence",
297
- "s": "The feature registry and pmos blueprint, each status derived from evidence",
298
- "k": "new"
299
- }
300
- ]
301
301
  }
302
302
  ]
303
303
  }
@@ -1,3 +1,3 @@
1
- kernel-source: pmos@a5848a9a
1
+ kernel-source: pmos@aeaaaae9
2
2
  assembled: 2026-11-17
3
3
  mode: vendor
@@ -2,7 +2,7 @@
2
2
  type: Reference
3
3
  title: "Eval calibration log"
4
4
  description: "Append-only record of every PM override of an evaluator verdict."
5
- generated: {by: process:create-pmos, at: "2026-11-17T02:50:41Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-17T04:07:35Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -2,7 +2,7 @@
2
2
  type: Reference
3
3
  title: "Health budgets"
4
4
  description: "Closed registry of health-budget anchors (D59), edited only by the PM."
5
- generated: {by: process:create-pmos, at: "2026-11-17T02:50:41Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-17T04:07:35Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -2,7 +2,7 @@
2
2
  type: Reference
3
3
  title: "Discoveries and friction log"
4
4
  description: "Append-only record of what runs discovered and where the process rubbed."
5
- generated: {by: process:create-pmos, at: "2026-11-17T02:50:41Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-17T04:07:35Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -1,4 +1,17 @@
1
1
  [
2
+ {
3
+ "v": "0.583.0",
4
+ "at": "2026-11-17T04:07:38.209Z",
5
+ "f": 4,
6
+ "prs": [
7
+ {
8
+ "n": 1316,
9
+ "t": "Answer Claude Code's add-directory trust prompt for PMOS's own chat-files folder",
10
+ "s": "Answer Claude Code's add-directory trust prompt for PMOS's own chat-files folder",
11
+ "k": "fix"
12
+ }
13
+ ]
14
+ },
2
15
  {
3
16
  "v": "0.582.0",
4
17
  "at": "2026-11-17T02:50:44.770Z",
@@ -576,9 +576,14 @@ function permissionAsk(screen, clean = (x) => x) {
576
576
  * Claude Code's folder trust prompt, read from the pane's visible screen the same way (feedback batch 10 item 1). A folder that
577
577
  * Claude Code (under the profile the session runs with) was never told to trust opens with "Is this a project you trust?" or
578
578
  * "Do you trust the files in this folder?", with "No, exit" as an answer. Typing the chat's first message into it chose an answer
579
- * and the session ended within seconds, so the chat showed nothing. Returns { question, options, trust: true } or null.
579
+ * and the session ended within seconds, so the chat showed nothing. Returns { question, options, trust: true, dir? } or null; `dir` is the
580
+ * folder a 2.1.326 "Adding a new directory" prompt asks about (an --add-dir), so the server can answer for a folder PMOS itself made.
580
581
  */
581
- const TRUST_RE = /(trust the files in this folder|project you (?:created or one you )?trust|trust this (?:folder|project))/i;
582
+ const TRUST_RE = /(trust the files in this folder|(?:project|directory|folder) you (?:created or one you )?trust|trust this (?:folder|project|directory))/i;
583
+ // Claude Code 2.1.326 (2026-11-17): a folder given with --add-dir is asked about too — "Adding a new directory: <path> … Is this a directory
584
+ // you created or one you trust?", answers "No, exit" / "Yes, add it", and the hint line "Esc to exit · To add it, press ↓ to Yes, then Enter".
585
+ const ADD_DIR_RE = /^Adding a new directory:\s*(.*)$/i;
586
+ const HINT_RE = /^(?:Enter to confirm|Esc to (?:exit|cancel))\b|\s·\s/i;
582
587
  const SEL_RE = /^[❯›>]\s+/;
583
588
  const NUM_RE = /^\d[.)]\s+/;
584
589
  /** The menu's answers: the lines next to the selected one (❯), up to a blank line. Each answer's n is its place (1 first) and sel is the
@@ -591,13 +596,18 @@ function trustAsk(screen, clean = (x) => x) {
591
596
  if (k < 0) return null;
592
597
  let a = k, b = k;
593
598
  while (a > 0 && lines[a - 1] && !TRUST_RE.test(lines[a - 1]) && a > k - 6) a--;
594
- while (b + 1 < lines.length && lines[b + 1] && !/^Enter to confirm/i.test(lines[b + 1]) && b < k + 6) b++;
599
+ while (b + 1 < lines.length && lines[b + 1] && !HINT_RE.test(lines[b + 1]) && b < k + 6) b++;
595
600
  const block = lines.slice(a, b + 1).map((l) => l.replace(SEL_RE, '').replace(NUM_RE, '').trim());
596
601
  if (block.length < 2 || block.length > 6 || !block.some((l) => /\bexit\b/i.test(l))) return null;
597
602
  let q = null;
598
603
  for (let i = a - 1; i >= 0 && i >= a - 12; i--) if (TRUST_RE.test(lines[i])) { q = lines[i]; break; }
599
604
  if (!q && !block.some((l) => /trust/i.test(l))) return null;
600
- return { question: clean(q || 'Do you trust the files in this folder?').slice(0, 200), options: block.map((l, i) => ({ n: String(i + 1), label: clean(l).slice(0, 160) })), sel: k - a + 1, trust: true };
605
+ let dir = null;
606
+ for (let i = a - 1; i >= 0 && i >= a - 14; i--) {
607
+ const m = ADD_DIR_RE.exec(lines[i]);
608
+ if (m) { dir = (m[1] || '').trim() || (lines[i + 1] || '').trim(); break; }
609
+ }
610
+ return { question: clean(q || 'Do you trust the files in this folder?').slice(0, 200), options: block.map((l, i) => ({ n: String(i + 1), label: clean(l).slice(0, 160) })), sel: k - a + 1, trust: true, ...(dir ? { dir: clean(dir).slice(0, 400) } : {}) };
601
611
  }
602
612
 
603
613
  module.exports = { trustAsk, permissionAsk, askQuestions, claudeHomes, callTarget, findTranscript, readHarness, readConversation, CONV_LIMIT, prettyTool, slugFor, resolvePid, descendants,
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.582.0",
3
+ "version": "0.583.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pmos-workspace",
9
- "version": "0.582.0",
9
+ "version": "0.583.0",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@anthropic-ai/sdk": "^1.3.0",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.582.0",
3
+ "version": "0.583.0",
4
4
  "private": true,
5
5
  "description": "PMOS Terminal Workspace — local companion hosting real PTYs beside the library and gates (D62)",
6
6
  "license": "MIT",
@@ -3765,8 +3765,31 @@ function paneTrust(s, now = Date.now()) {
3765
3765
  s.trustAt = now;
3766
3766
  const r = tmuxCtl(['capture-pane', '-p', '-t', s.tmux]);
3767
3767
  s.trust = r.status === 0 && r.stdout ? transcript.trustAsk(r.stdout, scrub) : null;
3768
+ // Claude Code 2.1.326 asks before it adds an --add-dir folder, once per session. The chat's attachments folder (lib/chat-files.js, under
3769
+ // PMOS's own state folder) is PMOS's to answer for: it made it, and the PM never sees the hidden terminal the question sits in. Any other
3770
+ // folder stays the PM's question, as before. (2026-11-17: every new chat stalled on this prompt and the chat showed nothing.)
3771
+ if (s.trust && s.trust.dir && ownStateDir(s.trust.dir)) {
3772
+ const yes = s.trust.options.find((o) => /^yes\b/i.test(o.label));
3773
+ if (yes && answerPrompt(s, s.trust, Number(yes.n))) { s.note = 'PMOS added its attachments folder to the session (Claude Code asked)'; s.trust = null; return null; }
3774
+ }
3768
3775
  return s.trust;
3769
3776
  }
3777
+ // A folder under PMOS's own state folder (the runtime folder of any workspace, or STATE), resolved; never a product repository.
3778
+ function ownStateDir(p) {
3779
+ try {
3780
+ const d = path.resolve(String(p || ''));
3781
+ const roots = [STATE, ...[...workspaces.values()].map((w) => { try { return stateDirFor(w); } catch { return null; } })].filter(Boolean).map((x) => path.resolve(x));
3782
+ return roots.some((root) => d === root || d.startsWith(root + path.sep));
3783
+ } catch { return false; }
3784
+ }
3785
+ // Answer a menu prompt on the pane with its n-th answer: arrow keys from the selected one, then Enter (chatSessions.pick does the same).
3786
+ function answerPrompt(s, q, n) {
3787
+ if (!s.pty || s.state === 'exited' || !(n >= 1 && n <= q.options.length)) return false;
3788
+ const d = n - q.sel;
3789
+ try { s.pty.write((d > 0 ? '\x1b[B' : '\x1b[A').repeat(Math.abs(d))); setTimeout(() => { try { s.pty.write('\r'); } catch { /* gone */ } }, 200); } catch { return false; }
3790
+ s.trustAt = Date.now();
3791
+ return true;
3792
+ }
3770
3793
  // The pane's visible screen, plain text, or '' (no tmux pane). lib/first-input.js reads Claude Code's input box from it.
3771
3794
  function paneScreen(s) {
3772
3795
  if (!s || !s.tmux || !TMUX) return '';