@principles/pd-cli 1.74.0 → 1.76.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/dist/commands/config-doctor.d.ts +3 -6
- package/dist/commands/config-doctor.d.ts.map +1 -1
- package/dist/commands/config-doctor.js +30 -31
- package/dist/commands/config-doctor.js.map +1 -1
- package/dist/commands/console.d.ts +18 -0
- package/dist/commands/console.d.ts.map +1 -1
- package/dist/commands/console.js +439 -0
- package/dist/commands/console.js.map +1 -1
- package/dist/commands/runtime-features.d.ts +23 -8
- package/dist/commands/runtime-features.d.ts.map +1 -1
- package/dist/commands/runtime-features.js +72 -31
- package/dist/commands/runtime-features.js.map +1 -1
- package/dist/index.js +51 -15
- package/dist/index.js.map +1 -1
- package/dist/services/config-doctor.d.ts +26 -66
- package/dist/services/config-doctor.d.ts.map +1 -1
- package/dist/services/config-doctor.js +197 -374
- package/dist/services/config-doctor.js.map +1 -1
- package/dist/services/console-launcher.d.ts +110 -0
- package/dist/services/console-launcher.d.ts.map +1 -0
- package/dist/services/console-launcher.js +282 -0
- package/dist/services/console-launcher.js.map +1 -0
- package/dist/services/pd-config-loader.d.ts +64 -0
- package/dist/services/pd-config-loader.d.ts.map +1 -0
- package/dist/services/pd-config-loader.js +156 -0
- package/dist/services/pd-config-loader.js.map +1 -0
- package/package.json +1 -1
- package/src/commands/config-doctor.ts +30 -30
- package/src/commands/console.ts +445 -1
- package/src/commands/runtime-features.ts +98 -44
- package/src/index.ts +55 -16
- package/src/services/config-doctor.ts +236 -425
- package/src/services/console-launcher.ts +373 -0
- package/src/services/pd-config-loader.ts +213 -0
- package/tests/commands/config-doctor.test.ts +207 -506
- package/tests/commands/console-open.test.ts +773 -0
- package/tests/commands/runtime-features.test.ts +220 -85
- package/tests/services/pd-config-loader.test.ts +479 -0
package/src/index.ts
CHANGED
|
@@ -46,6 +46,7 @@ import { handleRuntimeActivationDispatch } from './commands/runtime-activation.j
|
|
|
46
46
|
import { handleProvenChannelBaseline } from './commands/proven-channel-baseline.js';
|
|
47
47
|
import { handleDemoStoryA } from './commands/demo-story-a.js';
|
|
48
48
|
import { handleRuntimeFeaturesStatus } from './commands/runtime-features.js';
|
|
49
|
+
import { handleConfigDoctor } from './commands/config-doctor.js';
|
|
49
50
|
|
|
50
51
|
import { createRequire } from 'module';
|
|
51
52
|
const require = createRequire(import.meta.url);
|
|
@@ -55,8 +56,9 @@ const program = new Command();
|
|
|
55
56
|
|
|
56
57
|
program
|
|
57
58
|
.name('pd')
|
|
58
|
-
.description('PD CLI
|
|
59
|
-
.version(pkg.version)
|
|
59
|
+
.description('PD CLI — Pain recording, sample management, and evolution tasks')
|
|
60
|
+
.version(pkg.version)
|
|
61
|
+
.enablePositionalOptions();
|
|
60
62
|
|
|
61
63
|
const painCmd = program
|
|
62
64
|
.command('pain')
|
|
@@ -367,6 +369,19 @@ runtimeCmd
|
|
|
367
369
|
});
|
|
368
370
|
});
|
|
369
371
|
|
|
372
|
+
const configCmd = program
|
|
373
|
+
.command('config')
|
|
374
|
+
.description('PD configuration discovery and diagnosis');
|
|
375
|
+
|
|
376
|
+
configCmd
|
|
377
|
+
.command('doctor')
|
|
378
|
+
.description('Show PD + OpenClaw config locations, feature flags, and provider connectivity (PRI-299)')
|
|
379
|
+
.option('-w, --workspace <path>', 'Workspace directory')
|
|
380
|
+
.option('--json', 'Output raw JSON')
|
|
381
|
+
.action(async (opts) => {
|
|
382
|
+
await handleConfigDoctor({ workspace: opts.workspace, json: opts.json });
|
|
383
|
+
});
|
|
384
|
+
|
|
370
385
|
const demoCmd = program
|
|
371
386
|
.command('demo')
|
|
372
387
|
.description('Demo scenarios for MVP validation');
|
|
@@ -813,9 +828,18 @@ const _legacyCleanupCmd = legacyCmd
|
|
|
813
828
|
await handleLegacyCleanup(opts.workspace, apply);
|
|
814
829
|
});
|
|
815
830
|
|
|
816
|
-
program
|
|
831
|
+
const consoleCmd = program
|
|
817
832
|
.command('console')
|
|
818
|
-
.description('Start the pd-console web UI for principle review')
|
|
833
|
+
.description('Start the pd-console web UI for principle review (default: legacy launcher)')
|
|
834
|
+
.passThroughOptions()
|
|
835
|
+
.option('-w, --workspace <path>', 'Workspace directory')
|
|
836
|
+
.option('-p, --port <port>', 'Port to listen on', '3100')
|
|
837
|
+
.option('--no-auth', 'Disable authentication (local dev only)', false)
|
|
838
|
+
.option('--json', 'Output JSON status', false);
|
|
839
|
+
|
|
840
|
+
consoleCmd
|
|
841
|
+
.command('start')
|
|
842
|
+
.description('Legacy launcher — start the pd-console on the requested port (no reuse, no browser open)')
|
|
819
843
|
.option('-w, --workspace <path>', 'Workspace directory')
|
|
820
844
|
.option('-p, --port <port>', 'Port to listen on', '3100')
|
|
821
845
|
.option('--no-auth', 'Disable authentication (local dev only)', false)
|
|
@@ -825,27 +849,42 @@ program
|
|
|
825
849
|
await handleConsole({
|
|
826
850
|
workspace: opts.workspace,
|
|
827
851
|
port: opts.port,
|
|
828
|
-
noAuth: opts.
|
|
852
|
+
noAuth: opts.auth === false,
|
|
829
853
|
json: opts.json,
|
|
830
854
|
});
|
|
831
855
|
});
|
|
832
856
|
|
|
833
|
-
// PRI-
|
|
834
|
-
|
|
835
|
-
.command('
|
|
836
|
-
.description('
|
|
837
|
-
|
|
838
|
-
configCmd
|
|
839
|
-
.command('doctor')
|
|
840
|
-
.description('Inspect PD / OpenClaw config paths, feature flags, and provider connectivity (PRI-299)')
|
|
857
|
+
// PRI-300: seed-friendly Console launcher with reuse + auto-port + browser open
|
|
858
|
+
consoleCmd
|
|
859
|
+
.command('open')
|
|
860
|
+
.description('Open the pd-console in your browser (PRI-300) — auto-port, reuses running console, loopback-only')
|
|
841
861
|
.option('-w, --workspace <path>', 'Workspace directory')
|
|
842
|
-
.option('--
|
|
862
|
+
.option('-p, --port <port>', 'Preferred port (default 3100; auto-falls back to next free port)')
|
|
863
|
+
.option('--host <host>', 'Loopback host (default 127.0.0.1; non-loopback refused)')
|
|
864
|
+
.option('--no-auth', 'Disable authentication (local dev only)', false)
|
|
865
|
+
.option('--no-browser', 'Do not open the system browser on success', false)
|
|
866
|
+
.option('--json', 'Output JSON status (suppresses browser open)', false)
|
|
843
867
|
.action(async (opts) => {
|
|
844
|
-
const {
|
|
845
|
-
await
|
|
868
|
+
const { handleConsoleOpen } = await import('./commands/console.js');
|
|
869
|
+
await handleConsoleOpen({
|
|
846
870
|
workspace: opts.workspace,
|
|
871
|
+
port: opts.port,
|
|
872
|
+
host: opts.host,
|
|
873
|
+
noAuth: opts.auth === false,
|
|
874
|
+
noBrowser: opts.browser === false,
|
|
847
875
|
json: opts.json,
|
|
848
876
|
});
|
|
849
877
|
});
|
|
850
878
|
|
|
879
|
+
// Default `pd console` → legacy launcher (backward compat)
|
|
880
|
+
consoleCmd.action(async (opts) => {
|
|
881
|
+
const { handleConsole } = await import('./commands/console.js');
|
|
882
|
+
await handleConsole({
|
|
883
|
+
workspace: opts.workspace,
|
|
884
|
+
port: opts.port,
|
|
885
|
+
noAuth: opts.auth === false,
|
|
886
|
+
json: opts.json,
|
|
887
|
+
});
|
|
888
|
+
});
|
|
889
|
+
|
|
851
890
|
program.parse();
|