create-pmos 0.234.0 → 0.235.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 +1 -1
- package/payload/KIT-VERSION +1 -1
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/state/discoveries.md +1 -1
- package/workspace/bin/pmos.js +18 -0
- package/workspace/lib/win-command.js +54 -0
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/replaced-tests.json +14 -0
- package/workspace/server.js +5 -2
- package/workspace/test-lists/one-line-setup.json +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pmos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.235.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": {
|
package/payload/KIT-VERSION
CHANGED
|
@@ -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-10-14T09:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-10-14T09:56:46Z"}
|
|
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-10-14T09:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-10-14T09:56:46Z"}
|
|
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-10-14T09:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-10-14T09:56:46Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
package/workspace/bin/pmos.js
CHANGED
|
@@ -27,6 +27,7 @@ const http = require('http');
|
|
|
27
27
|
const net = require('net');
|
|
28
28
|
const fs = require('fs');
|
|
29
29
|
const path = require('path');
|
|
30
|
+
const os = require('os');
|
|
30
31
|
const { spawn, spawnSync } = require('child_process');
|
|
31
32
|
const D = require('../lib/server-discovery');
|
|
32
33
|
const stateRoot = require('../lib/state-root');
|
|
@@ -164,6 +165,17 @@ function repoRootOf(dir) {
|
|
|
164
165
|
return top && fs.existsSync(top) ? top : path.resolve(dir);
|
|
165
166
|
}
|
|
166
167
|
|
|
168
|
+
// `pmos` typed in a new terminal runs in the home folder. Registering the home folder as a workspace made PMOS start
|
|
169
|
+
// its background jobs over every file the PM has. The setup's PMOS folder (PMOS_DIR, else ~/PMOS) is opened instead;
|
|
170
|
+
// with no such folder, `pmos` says where to run it and registers nothing.
|
|
171
|
+
function workspaceDir(dir) {
|
|
172
|
+
const home = path.resolve(os.homedir());
|
|
173
|
+
if (path.resolve(repoRootOf(dir)) !== home) return { dir };
|
|
174
|
+
const pmosDir = process.env.PMOS_DIR ? path.resolve(process.env.PMOS_DIR) : path.join(home, 'PMOS');
|
|
175
|
+
if (pmosDir !== home && fs.existsSync(pmosDir)) return { dir: pmosDir, note: `note: this is your home folder, so PMOS opens your PMOS folder, ${pmosDir}.` };
|
|
176
|
+
return { refused: 'this is your home folder. Run `pmos` inside a project folder, or `pmos <folder>`.' };
|
|
177
|
+
}
|
|
178
|
+
|
|
167
179
|
function openBrowser(url) {
|
|
168
180
|
if (NO_OPEN) return;
|
|
169
181
|
const cmd = process.platform === 'darwin' ? ['open', [url]]
|
|
@@ -283,6 +295,12 @@ async function servesTailnet(port) {
|
|
|
283
295
|
// `remote` starts a NEW server in tailnet mode (pmos phone); a server that is already running is reused as it is.
|
|
284
296
|
// `open: false` registers the repo without opening the desktop browser.
|
|
285
297
|
async function up(dir, { remote = false, open = true, waited = false } = {}) {
|
|
298
|
+
if (!waited) {
|
|
299
|
+
const where = workspaceDir(dir);
|
|
300
|
+
if (where.refused) { say(`✗ ${where.refused}`); return 1; }
|
|
301
|
+
if (where.note) say(where.note);
|
|
302
|
+
dir = where.dir;
|
|
303
|
+
}
|
|
286
304
|
// 1. Is a workspace already running — on ANY port it recorded, not just the one this shell guesses?
|
|
287
305
|
let live = await discover();
|
|
288
306
|
// A server that predates this install is running OLD code under NEW files (or the reverse). Reusing
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/* lib/win-command.js — how to start a command such as `claude` on Windows.
|
|
3
|
+
*
|
|
4
|
+
* On Windows, Node starts a program by name only when it is an .exe or .com file. A command that npm installed
|
|
5
|
+
* (`npm install -g @anthropic-ai/claude-code`) is a `claude.cmd` file, so `spawn('claude')` fails with ENOENT
|
|
6
|
+
* (-4058), even though the same `claude` works in a terminal. Since Node 20, Node also refuses to start a .cmd
|
|
7
|
+
* file without a shell.
|
|
8
|
+
*
|
|
9
|
+
* resolve() finds the file on PATH the way a terminal does (PATHEXT) and returns what to start instead:
|
|
10
|
+
* - an .exe or .com file: its full path;
|
|
11
|
+
* - an npm .cmd shim: node and the script the shim points to, so no shell quoting is involved;
|
|
12
|
+
* - any other .cmd or .bat file: cmd.exe /d /s /c with the file, as a last resort.
|
|
13
|
+
* On other platforms, and when nothing is found, the command is returned unchanged, so the caller's own
|
|
14
|
+
* "not found" handling still applies.
|
|
15
|
+
*
|
|
16
|
+
* Pure apart from the injected `exists` and `read`, so every case is testable on any platform.
|
|
17
|
+
*/
|
|
18
|
+
const fs = require('fs');
|
|
19
|
+
const path = require('path');
|
|
20
|
+
|
|
21
|
+
function resolve(cmd, {
|
|
22
|
+
platform = process.platform, env = process.env, execPath = process.execPath,
|
|
23
|
+
exists = (f) => { try { return fs.statSync(f).isFile(); } catch { return false; } },
|
|
24
|
+
read = (f) => { try { return fs.readFileSync(f, 'utf8'); } catch { return null; } },
|
|
25
|
+
} = {}) {
|
|
26
|
+
const same = { file: cmd, prefix: [] };
|
|
27
|
+
if (platform !== 'win32' || !cmd) return same;
|
|
28
|
+
const P = path.win32;
|
|
29
|
+
const exts = String(env.PATHEXT || '.COM;.EXE;.BAT;.CMD').split(';').filter(Boolean).map((e) => e.toLowerCase());
|
|
30
|
+
const hasExt = exts.includes(P.extname(cmd).toLowerCase());
|
|
31
|
+
const names = hasExt ? [cmd] : exts.map((e) => cmd + e);
|
|
32
|
+
const dirs = /[\\/]/.test(cmd) ? [''] : String(env.PATH || env.Path || '').split(';').filter(Boolean);
|
|
33
|
+
let found = null;
|
|
34
|
+
for (const d of dirs) {
|
|
35
|
+
for (const n of names) { const f = d ? P.join(d, n) : n; if (exists(f)) { found = f; break; } }
|
|
36
|
+
if (found) break;
|
|
37
|
+
}
|
|
38
|
+
if (!found) return same;
|
|
39
|
+
const ext = P.extname(found).toLowerCase();
|
|
40
|
+
if (ext === '.exe' || ext === '.com') return { file: found, prefix: [] };
|
|
41
|
+
if (ext === '.cmd' || ext === '.bat') {
|
|
42
|
+
// npm's cmd-shim names its target relative to the shim's folder: "%dp0%\node_modules\…\cli.js" (or "%~dp0\…").
|
|
43
|
+
const text = read(found) || '';
|
|
44
|
+
const m = /"%~?dp0%?\\([^"%]+\.(js|cjs|mjs|exe))"/i.exec(text);
|
|
45
|
+
if (m) {
|
|
46
|
+
const target = P.join(P.dirname(found), m[1]);
|
|
47
|
+
if (exists(target)) return m[2].toLowerCase() === 'exe' ? { file: target, prefix: [] } : { file: execPath, prefix: [target] };
|
|
48
|
+
}
|
|
49
|
+
return { file: env.ComSpec || 'cmd.exe', prefix: ['/d', '/s', '/c', found] };
|
|
50
|
+
}
|
|
51
|
+
return same;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
module.exports = { resolve };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmos-workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.235.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pmos-workspace",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.235.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@xterm/addon-fit": "^0.11.0",
|
package/workspace/package.json
CHANGED
|
@@ -3061,6 +3061,20 @@
|
|
|
3061
3061
|
"names": [
|
|
3062
3062
|
"hand to agent: no drop on any column started a session or called a /handoff/ route"
|
|
3063
3063
|
]
|
|
3064
|
+
},
|
|
3065
|
+
{
|
|
3066
|
+
"id": "E75",
|
|
3067
|
+
"group": "E",
|
|
3068
|
+
"file": "workspace/pm-r12-test.js",
|
|
3069
|
+
"section": "T3: the two spawn paths",
|
|
3070
|
+
"change": "rewritten",
|
|
3071
|
+
"slice": "one-line-setup",
|
|
3072
|
+
"reason": "On Windows, Node cannot start npm's claude.cmd by name (spawn claude ENOENT, -4058). The direct-PTY spawn now starts the file lib/win-command.js resolves (unchanged on macOS and Linux). The assertion read the old line of server.js literally.",
|
|
3073
|
+
"replacement": "The assertion stays under the same name; it now matches pty.spawn(run.file, [...run.prefix, ...launchArgs], …), which still passes the launch args as an argv.",
|
|
3074
|
+
"pm_approval": null,
|
|
3075
|
+
"names": [
|
|
3076
|
+
"T3: both spawn paths take the launch args — tmux joins plain tokens, the direct PTY passes an argv"
|
|
3077
|
+
]
|
|
3064
3078
|
}
|
|
3065
3079
|
]
|
|
3066
3080
|
}
|
package/workspace/server.js
CHANGED
|
@@ -1957,6 +1957,7 @@ const autoSync = require('./lib/auto-sync').createAutoSync({
|
|
|
1957
1957
|
// workspace starts the board and facts rebuilds when the repository changes, so nothing is re-read on a clock. The board
|
|
1958
1958
|
// keeps its last value while it rebuilds (stale while revalidate): dropping it would show a blank Board on every change.
|
|
1959
1959
|
const factsAsync = require('./lib/facts-async.js');
|
|
1960
|
+
const winCommand = require('./lib/win-command');
|
|
1960
1961
|
factsAsync.configure({ stateDir: STATE });
|
|
1961
1962
|
const freshness = require('./lib/freshness.js').create({
|
|
1962
1963
|
stateDir: STATE,
|
|
@@ -3611,7 +3612,9 @@ function startHeadless(base, workdir, kind, launchArgs, env, initialInput, addDi
|
|
|
3611
3612
|
let child;
|
|
3612
3613
|
// detached: its own process group, so stopping it also stops what it started (an MCP server, a script) and no
|
|
3613
3614
|
// grandchild keeps the output pipes open after the run is stopped.
|
|
3614
|
-
|
|
3615
|
+
// Windows: `claude` installed by npm is claude.cmd, which spawn() cannot start by name (lib/win-command.js).
|
|
3616
|
+
const run = winCommand.resolve(base.agent, { env });
|
|
3617
|
+
try { child = spawn(run.file, [...run.prefix, ...args], { cwd: workdir, env, stdio: ['pipe', 'pipe', 'pipe'], detached: true }); }
|
|
3615
3618
|
catch (e) {
|
|
3616
3619
|
s.state = 'exited'; s.note = spawnFailureAdvice(e, base.agent, false);
|
|
3617
3620
|
say(`\x1b[38;5;203m✗ ${s.note}\x1b[0m\n`); persist(s); pushSessions(); pushWorkspaces(); return s;
|
|
@@ -3862,7 +3865,7 @@ function spawnSessionInner({ name, agent, cwd, ws, origin, initialInput, profile
|
|
|
3862
3865
|
let p, usedCmd = cmd;
|
|
3863
3866
|
try {
|
|
3864
3867
|
if (isShell) { const r = spawnPty(cmd, workdir, penv); p = r.pty; usedCmd = r.cmd; }
|
|
3865
|
-
else p = pty.spawn(
|
|
3868
|
+
else { const run = winCommand.resolve(cmd, { env: penv }); p = pty.spawn(run.file, [...run.prefix, ...launchArgs], { name: 'xterm-256color', cols: 80, rows: 24, cwd: workdir, env: penv }); }
|
|
3866
3869
|
} catch (e) {
|
|
3867
3870
|
return exitedSession(base, workdir, spawnFailureAdvice(e, cmd, isShell));
|
|
3868
3871
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"_comment": "one-line-setup: on Windows the
|
|
3
|
-
"modules": ["win-hide.test.js", "busy-server.test.js"],
|
|
4
|
-
"seconds": { "win-hide.test.js": 1, "busy-server.test.js": 12 }
|
|
2
|
+
"_comment": "one-line-setup: on Windows the server hides command windows (win-hide), starts npm's claude.cmd (win-command), and `pmos` waits for its own busy server (busy-server) and never registers the home folder (windows-start).",
|
|
3
|
+
"modules": ["win-hide.test.js", "busy-server.test.js", "windows-start.test.js"],
|
|
4
|
+
"seconds": { "win-hide.test.js": 1, "busy-server.test.js": 12, "windows-start.test.js": 3 }
|
|
5
5
|
}
|