@unbrained/pm-cli 2026.5.11 → 2026.5.14
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/AGENTS.md +3 -116
- package/CHANGELOG.md +18 -0
- package/PRD.md +18 -39
- package/README.md +8 -5
- package/dist/cli/commander-usage.js +27 -0
- package/dist/cli/commander-usage.js.map +1 -1
- package/dist/cli/commands/activity.js +19 -4
- package/dist/cli/commands/activity.js.map +1 -1
- package/dist/cli/commands/calendar.js +5 -2
- package/dist/cli/commands/calendar.js.map +1 -1
- package/dist/cli/commands/contracts.js +63 -19
- package/dist/cli/commands/contracts.js.map +1 -1
- package/dist/cli/commands/create.js +58 -3
- package/dist/cli/commands/create.js.map +1 -1
- package/dist/cli/commands/extension.d.ts +14 -3
- package/dist/cli/commands/extension.js +481 -95
- package/dist/cli/commands/extension.js.map +1 -1
- package/dist/cli/commands/index.d.ts +1 -8
- package/dist/cli/commands/index.js +1 -8
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/reindex.d.ts +8 -0
- package/dist/cli/commands/reindex.js +96 -23
- package/dist/cli/commands/reindex.js.map +1 -1
- package/dist/cli/commands/search.js +51 -25
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/test.js +14 -6
- package/dist/cli/commands/test.js.map +1 -1
- package/dist/cli/commands/upgrade.d.ts +63 -0
- package/dist/cli/commands/upgrade.js +260 -0
- package/dist/cli/commands/upgrade.js.map +1 -0
- package/dist/cli/guide-topics.js +18 -16
- package/dist/cli/guide-topics.js.map +1 -1
- package/dist/cli/help-content.js +57 -18
- package/dist/cli/help-content.js.map +1 -1
- package/dist/cli/main.js +73 -7
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/register-list-query.js +24 -142
- package/dist/cli/register-list-query.js.map +1 -1
- package/dist/cli/register-mutation.js +49 -257
- package/dist/cli/register-mutation.js.map +1 -1
- package/dist/cli/register-operations.js +29 -198
- package/dist/cli/register-operations.js.map +1 -1
- package/dist/cli/register-setup.js +181 -204
- package/dist/cli/register-setup.js.map +1 -1
- package/dist/cli/registration-helpers.d.ts +2 -2
- package/dist/cli/registration-helpers.js +1 -19
- package/dist/cli/registration-helpers.js.map +1 -1
- package/dist/core/extensions/loader.js +7 -1
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/packages/manifest.d.ts +38 -0
- package/dist/core/packages/manifest.js +221 -0
- package/dist/core/packages/manifest.js.map +1 -0
- package/dist/core/search/embedding-batches.d.ts +13 -1
- package/dist/core/search/embedding-batches.js +19 -1
- package/dist/core/search/embedding-batches.js.map +1 -1
- package/dist/core/store/front-matter-cache.d.ts +8 -1
- package/dist/core/store/front-matter-cache.js +20 -11
- package/dist/core/store/front-matter-cache.js.map +1 -1
- package/dist/mcp/server.d.ts +8 -0
- package/dist/mcp/server.js +100 -43
- package/dist/mcp/server.js.map +1 -1
- package/dist/sdk/cli-contracts/commander-mutation-options.d.ts +7 -0
- package/dist/sdk/cli-contracts/commander-mutation-options.js +477 -0
- package/dist/sdk/cli-contracts/commander-mutation-options.js.map +1 -0
- package/dist/sdk/cli-contracts/commander-types.d.ts +21 -0
- package/dist/sdk/cli-contracts/commander-types.js +92 -0
- package/dist/sdk/cli-contracts/commander-types.js.map +1 -0
- package/dist/sdk/cli-contracts.d.ts +22 -32
- package/dist/sdk/cli-contracts.js +155 -296
- package/dist/sdk/cli-contracts.js.map +1 -1
- package/dist/sdk/index.d.ts +2 -0
- package/dist/sdk/index.js +2 -0
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/runtime.d.ts +29 -0
- package/dist/sdk/runtime.js +28 -0
- package/dist/sdk/runtime.js.map +1 -0
- package/docs/ARCHITECTURE.md +1 -1
- package/docs/COMMANDS.md +17 -1
- package/docs/EXTENSIONS.md +169 -61
- package/docs/QUICKSTART.md +11 -2
- package/docs/README.md +4 -6
- package/docs/RELEASING.md +4 -2
- package/docs/SDK.md +79 -438
- package/package.json +6 -23
- package/packages/pm-beads/README.md +10 -0
- package/packages/pm-beads/extensions/beads/index.js +113 -0
- package/{.agents/pm/extensions/beads/index.js → packages/pm-beads/extensions/beads/index.ts} +42 -20
- package/{.agents/pm → packages/pm-beads}/extensions/beads/runtime.js +2 -17
- package/{.agents/pm → packages/pm-beads}/extensions/beads/runtime.ts +41 -18
- package/packages/pm-beads/package.json +50 -0
- package/packages/pm-calendar/README.md +13 -0
- package/packages/pm-calendar/extensions/calendar/index.js +56 -0
- package/packages/pm-calendar/extensions/calendar/index.ts +62 -0
- package/packages/pm-calendar/extensions/calendar/manifest.json +7 -0
- package/packages/pm-calendar/extensions/calendar/runtime.js +95 -0
- package/packages/pm-calendar/extensions/calendar/runtime.ts +104 -0
- package/packages/pm-calendar/package.json +51 -0
- package/packages/pm-governance-audit/README.md +23 -0
- package/packages/pm-governance-audit/extensions/governance-audit/index.js +117 -0
- package/packages/pm-governance-audit/extensions/governance-audit/index.ts +118 -0
- package/packages/pm-governance-audit/extensions/governance-audit/manifest.json +7 -0
- package/packages/pm-governance-audit/extensions/governance-audit/runtime.js +159 -0
- package/packages/pm-governance-audit/extensions/governance-audit/runtime.ts +176 -0
- package/packages/pm-governance-audit/package.json +52 -0
- package/packages/pm-guide-shell/README.md +23 -0
- package/packages/pm-guide-shell/extensions/guide-shell/index.js +76 -0
- package/packages/pm-guide-shell/extensions/guide-shell/index.ts +81 -0
- package/packages/pm-guide-shell/extensions/guide-shell/manifest.json +7 -0
- package/packages/pm-guide-shell/extensions/guide-shell/runtime.js +263 -0
- package/packages/pm-guide-shell/extensions/guide-shell/runtime.ts +327 -0
- package/packages/pm-guide-shell/package.json +52 -0
- package/packages/pm-linked-test-adapters/README.md +24 -0
- package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/index.js +101 -0
- package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/index.ts +102 -0
- package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/manifest.json +7 -0
- package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/runtime.js +142 -0
- package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/runtime.ts +173 -0
- package/packages/pm-linked-test-adapters/package.json +53 -0
- package/packages/pm-search-advanced/README.md +27 -0
- package/packages/pm-search-advanced/extensions/search-advanced/index.js +93 -0
- package/packages/pm-search-advanced/extensions/search-advanced/index.ts +94 -0
- package/packages/pm-search-advanced/extensions/search-advanced/manifest.json +7 -0
- package/packages/pm-search-advanced/extensions/search-advanced/runtime.js +120 -0
- package/packages/pm-search-advanced/extensions/search-advanced/runtime.ts +144 -0
- package/packages/pm-search-advanced/package.json +54 -0
- package/packages/pm-templates/README.md +20 -0
- package/packages/pm-templates/extensions/templates/index.js +101 -0
- package/packages/pm-templates/extensions/templates/index.ts +109 -0
- package/packages/pm-templates/extensions/templates/manifest.json +7 -0
- package/packages/pm-templates/extensions/templates/runtime.js +226 -0
- package/packages/pm-templates/extensions/templates/runtime.ts +283 -0
- package/packages/pm-templates/package.json +50 -0
- package/packages/pm-todos/README.md +11 -0
- package/packages/pm-todos/extensions/todos/index.js +130 -0
- package/{.agents/pm/extensions/todos/index.js → packages/pm-todos/extensions/todos/index.ts} +47 -23
- package/{.agents/pm → packages/pm-todos}/extensions/todos/runtime.js +3 -18
- package/{.agents/pm → packages/pm-todos}/extensions/todos/runtime.ts +42 -20
- package/packages/pm-todos/package.json +51 -0
- package/plugins/pm-cli-claude/README.md +1 -2
- package/plugins/pm-cli-claude/hooks/session-start.mjs +4 -55
- package/plugins/pm-cli-claude/scripts/pm-mcp-server.mjs +4 -2
- package/plugins/pm-cli-codex/scripts/pm-mcp-server.mjs +4 -2
- package/.agents/pm/extensions/.managed-extensions.json +0 -42
- package/.agents/skills/HARNESS_COMPATIBILITY.md +0 -45
- package/.agents/skills/README.md +0 -21
- package/.agents/skills/pm-developer/SKILL.md +0 -73
- package/.agents/skills/pm-developer/references/COMMAND_PLAYBOOK.md +0 -48
- package/.agents/skills/pm-developer/references/PROMPTS.md +0 -17
- package/.agents/skills/pm-extensions/SKILL.md +0 -57
- package/.agents/skills/pm-extensions/references/LIFECYCLE.md +0 -40
- package/.agents/skills/pm-extensions/references/TROUBLESHOOTING.md +0 -25
- package/.agents/skills/pm-sdk/SKILL.md +0 -50
- package/.agents/skills/pm-sdk/references/INTEGRATION_CHECKLIST.md +0 -31
- package/.agents/skills/pm-sdk/references/PROMPTS.md +0 -13
- package/.agents/skills/pm-user/SKILL.md +0 -59
- package/.agents/skills/pm-user/references/PROMPTS.md +0 -17
- package/.agents/skills/pm-user/references/WORKFLOWS.md +0 -35
- package/.pi/README.md +0 -35
- package/.pi/agents/pm-triage-agent.md +0 -19
- package/.pi/agents/pm-verification-agent.md +0 -21
- package/.pi/chains/pm-native-delivery.chain.md +0 -11
- package/.pi/extensions/pm-cli/index.js +0 -387
- package/.pi/prompts/pm-workflow.md +0 -5
- package/.pi/skills/pm-native/SKILL.md +0 -44
- package/.pi/skills/pm-release/SKILL.md +0 -35
- package/dist/pi/native.d.ts +0 -5
- package/dist/pi/native.js +0 -236
- package/dist/pi/native.js.map +0 -1
- package/docs/PI_PACKAGE.md +0 -141
- /package/{.agents/pm → packages/pm-beads}/extensions/beads/manifest.json +0 -0
- /package/{.agents/pm → packages/pm-todos}/extensions/todos/manifest.json +0 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import {
|
|
2
|
+
runTestRunsListPackage,
|
|
3
|
+
runTestRunsLogsPackage,
|
|
4
|
+
runTestRunsResumePackage,
|
|
5
|
+
runTestRunsStatusPackage,
|
|
6
|
+
runTestRunsStopPackage,
|
|
7
|
+
} from "./runtime.js";
|
|
8
|
+
|
|
9
|
+
export const manifest = {
|
|
10
|
+
name: "builtin-linked-test-adapters",
|
|
11
|
+
version: "0.1.0",
|
|
12
|
+
entry: "./index.js",
|
|
13
|
+
priority: 0,
|
|
14
|
+
capabilities: ["commands", "schema"],
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
function testRunsCommand() {
|
|
18
|
+
return {
|
|
19
|
+
name: "test-runs",
|
|
20
|
+
action: "test-runs-list",
|
|
21
|
+
description: "List background linked-test runs.",
|
|
22
|
+
flags: [
|
|
23
|
+
{ long: "--status", value_name: "value", value_type: "string", description: "Filter by background run status." },
|
|
24
|
+
{ long: "--limit", value_name: "n", value_type: "string", description: "Limit number of runs returned." },
|
|
25
|
+
],
|
|
26
|
+
run: async (context) => runTestRunsListPackage(context.options, context.global),
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function testRunsListCommand() {
|
|
31
|
+
return {
|
|
32
|
+
name: "test-runs list",
|
|
33
|
+
action: "test-runs-list",
|
|
34
|
+
description: "List background linked-test runs.",
|
|
35
|
+
flags: [
|
|
36
|
+
{ long: "--status", value_name: "value", value_type: "string", description: "Filter by background run status." },
|
|
37
|
+
{ long: "--limit", value_name: "n", value_type: "string", description: "Limit number of runs returned." },
|
|
38
|
+
],
|
|
39
|
+
run: async (context) => runTestRunsListPackage(context.options, context.global),
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function testRunsStatusCommand() {
|
|
44
|
+
return {
|
|
45
|
+
name: "test-runs status",
|
|
46
|
+
action: "test-runs-status",
|
|
47
|
+
description: "Show status and health snapshot for a background linked-test run.",
|
|
48
|
+
arguments: [{ name: "runId", required: true, description: "Background run id." }],
|
|
49
|
+
run: async (context) => runTestRunsStatusPackage(context.args, context.global),
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function testRunsLogsCommand() {
|
|
54
|
+
return {
|
|
55
|
+
name: "test-runs logs",
|
|
56
|
+
action: "test-runs-logs",
|
|
57
|
+
description: "Show tailed logs for a background linked-test run.",
|
|
58
|
+
arguments: [{ name: "runId", required: true, description: "Background run id." }],
|
|
59
|
+
flags: [
|
|
60
|
+
{ long: "--stream", value_name: "value", value_type: "string", description: "Log stream selector: stdout|stderr|both." },
|
|
61
|
+
{ long: "--tail", value_name: "n", value_type: "string", description: "Tail number of lines per selected stream." },
|
|
62
|
+
],
|
|
63
|
+
run: async (context) => runTestRunsLogsPackage(context.args, context.options, context.global),
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function testRunsStopCommand() {
|
|
68
|
+
return {
|
|
69
|
+
name: "test-runs stop",
|
|
70
|
+
action: "test-runs-stop",
|
|
71
|
+
description: "Stop a running background linked-test run.",
|
|
72
|
+
arguments: [{ name: "runId", required: true, description: "Background run id." }],
|
|
73
|
+
flags: [{ long: "--force", value_type: "boolean", description: "Force-stop via SIGKILL." }],
|
|
74
|
+
run: async (context) => runTestRunsStopPackage(context.args, context.options, context.global),
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function testRunsResumeCommand() {
|
|
79
|
+
return {
|
|
80
|
+
name: "test-runs resume",
|
|
81
|
+
action: "test-runs-resume",
|
|
82
|
+
description: "Resume a terminal background linked-test run by starting a new attempt.",
|
|
83
|
+
arguments: [{ name: "runId", required: true, description: "Background run id." }],
|
|
84
|
+
flags: [{ long: "--author", value_name: "value", value_type: "string", description: "Resume author override." }],
|
|
85
|
+
run: async (context) => runTestRunsResumePackage(context.args, context.options, context.global),
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export function activate(api) {
|
|
90
|
+
api.registerCommand(testRunsCommand());
|
|
91
|
+
api.registerCommand(testRunsListCommand());
|
|
92
|
+
api.registerCommand(testRunsStatusCommand());
|
|
93
|
+
api.registerCommand(testRunsLogsCommand());
|
|
94
|
+
api.registerCommand(testRunsStopCommand());
|
|
95
|
+
api.registerCommand(testRunsResumeCommand());
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export default {
|
|
99
|
+
manifest,
|
|
100
|
+
activate,
|
|
101
|
+
};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import type { CommandDefinition, ExtensionApi } from "../../../../src/sdk/index.js";
|
|
2
|
+
import {
|
|
3
|
+
runTestRunsListPackage,
|
|
4
|
+
runTestRunsLogsPackage,
|
|
5
|
+
runTestRunsResumePackage,
|
|
6
|
+
runTestRunsStatusPackage,
|
|
7
|
+
runTestRunsStopPackage,
|
|
8
|
+
} from "./runtime.js";
|
|
9
|
+
|
|
10
|
+
export const manifest = {
|
|
11
|
+
name: "builtin-linked-test-adapters",
|
|
12
|
+
version: "0.1.0",
|
|
13
|
+
entry: "./index.js",
|
|
14
|
+
priority: 0,
|
|
15
|
+
capabilities: ["commands", "schema"],
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
function testRunsCommand(): CommandDefinition {
|
|
19
|
+
return {
|
|
20
|
+
name: "test-runs",
|
|
21
|
+
action: "test-runs-list",
|
|
22
|
+
description: "List background linked-test runs.",
|
|
23
|
+
flags: [
|
|
24
|
+
{ long: "--status", value_name: "value", value_type: "string", description: "Filter by background run status." },
|
|
25
|
+
{ long: "--limit", value_name: "n", value_type: "string", description: "Limit number of runs returned." },
|
|
26
|
+
],
|
|
27
|
+
run: async (context) => runTestRunsListPackage(context.options, context.global),
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function testRunsListCommand(): CommandDefinition {
|
|
32
|
+
return {
|
|
33
|
+
name: "test-runs list",
|
|
34
|
+
action: "test-runs-list",
|
|
35
|
+
description: "List background linked-test runs.",
|
|
36
|
+
flags: [
|
|
37
|
+
{ long: "--status", value_name: "value", value_type: "string", description: "Filter by background run status." },
|
|
38
|
+
{ long: "--limit", value_name: "n", value_type: "string", description: "Limit number of runs returned." },
|
|
39
|
+
],
|
|
40
|
+
run: async (context) => runTestRunsListPackage(context.options, context.global),
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function testRunsStatusCommand(): CommandDefinition {
|
|
45
|
+
return {
|
|
46
|
+
name: "test-runs status",
|
|
47
|
+
action: "test-runs-status",
|
|
48
|
+
description: "Show status and health snapshot for a background linked-test run.",
|
|
49
|
+
arguments: [{ name: "runId", required: true, description: "Background run id." }],
|
|
50
|
+
run: async (context) => runTestRunsStatusPackage(context.args, context.global),
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function testRunsLogsCommand(): CommandDefinition {
|
|
55
|
+
return {
|
|
56
|
+
name: "test-runs logs",
|
|
57
|
+
action: "test-runs-logs",
|
|
58
|
+
description: "Show tailed logs for a background linked-test run.",
|
|
59
|
+
arguments: [{ name: "runId", required: true, description: "Background run id." }],
|
|
60
|
+
flags: [
|
|
61
|
+
{ long: "--stream", value_name: "value", value_type: "string", description: "Log stream selector: stdout|stderr|both." },
|
|
62
|
+
{ long: "--tail", value_name: "n", value_type: "string", description: "Tail number of lines per selected stream." },
|
|
63
|
+
],
|
|
64
|
+
run: async (context) => runTestRunsLogsPackage(context.args, context.options, context.global),
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function testRunsStopCommand(): CommandDefinition {
|
|
69
|
+
return {
|
|
70
|
+
name: "test-runs stop",
|
|
71
|
+
action: "test-runs-stop",
|
|
72
|
+
description: "Stop a running background linked-test run.",
|
|
73
|
+
arguments: [{ name: "runId", required: true, description: "Background run id." }],
|
|
74
|
+
flags: [{ long: "--force", value_type: "boolean", description: "Force-stop via SIGKILL." }],
|
|
75
|
+
run: async (context) => runTestRunsStopPackage(context.args, context.options, context.global),
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function testRunsResumeCommand(): CommandDefinition {
|
|
80
|
+
return {
|
|
81
|
+
name: "test-runs resume",
|
|
82
|
+
action: "test-runs-resume",
|
|
83
|
+
description: "Resume a terminal background linked-test run by starting a new attempt.",
|
|
84
|
+
arguments: [{ name: "runId", required: true, description: "Background run id." }],
|
|
85
|
+
flags: [{ long: "--author", value_name: "value", value_type: "string", description: "Resume author override." }],
|
|
86
|
+
run: async (context) => runTestRunsResumePackage(context.args, context.options, context.global),
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export function activate(api: ExtensionApi): void {
|
|
91
|
+
api.registerCommand(testRunsCommand());
|
|
92
|
+
api.registerCommand(testRunsListCommand());
|
|
93
|
+
api.registerCommand(testRunsStatusCommand());
|
|
94
|
+
api.registerCommand(testRunsLogsCommand());
|
|
95
|
+
api.registerCommand(testRunsStopCommand());
|
|
96
|
+
api.registerCommand(testRunsResumeCommand());
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export default {
|
|
100
|
+
manifest,
|
|
101
|
+
activate,
|
|
102
|
+
};
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { pathToFileURL } from "node:url";
|
|
3
|
+
|
|
4
|
+
const PM_PACKAGE_ROOT_ENV = "PM_CLI_PACKAGE_ROOT";
|
|
5
|
+
let runtimeBundle = null;
|
|
6
|
+
let runtimeBundlePromise = null;
|
|
7
|
+
|
|
8
|
+
async function ensureRuntimeBundle() {
|
|
9
|
+
if (runtimeBundle) {
|
|
10
|
+
return runtimeBundle;
|
|
11
|
+
}
|
|
12
|
+
if (!runtimeBundlePromise) {
|
|
13
|
+
runtimeBundlePromise = loadRuntimeBundle();
|
|
14
|
+
}
|
|
15
|
+
runtimeBundle = await runtimeBundlePromise;
|
|
16
|
+
return runtimeBundle;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
async function loadRuntimeBundle() {
|
|
20
|
+
const envRoot = process.env[PM_PACKAGE_ROOT_ENV];
|
|
21
|
+
if (typeof envRoot !== "string" || envRoot.trim().length === 0) {
|
|
22
|
+
throw new Error(
|
|
23
|
+
`builtin-linked-test-adapters requires ${PM_PACKAGE_ROOT_ENV} to locate core SDK runtime exports.`,
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
const modulePath = path.join(path.resolve(envRoot.trim()), "dist", "sdk", "runtime.js");
|
|
27
|
+
try {
|
|
28
|
+
const sdkLoaded = await import(pathToFileURL(modulePath).href);
|
|
29
|
+
if (
|
|
30
|
+
typeof sdkLoaded.runTestRunsList === "function" &&
|
|
31
|
+
typeof sdkLoaded.runTestRunsStatus === "function" &&
|
|
32
|
+
typeof sdkLoaded.runTestRunsLogs === "function" &&
|
|
33
|
+
typeof sdkLoaded.runTestRunsStop === "function" &&
|
|
34
|
+
typeof sdkLoaded.runTestRunsResume === "function" &&
|
|
35
|
+
typeof sdkLoaded.PmCliError === "function" &&
|
|
36
|
+
typeof sdkLoaded.EXIT_CODE === "object" &&
|
|
37
|
+
sdkLoaded.EXIT_CODE !== null
|
|
38
|
+
) {
|
|
39
|
+
return {
|
|
40
|
+
sdk: sdkLoaded,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
} catch {
|
|
44
|
+
// Fall through to deterministic failure message below.
|
|
45
|
+
}
|
|
46
|
+
throw new Error(
|
|
47
|
+
`builtin-linked-test-adapters failed to load test-runs SDK runtime exports from ${modulePath}.`,
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function readStringOption(options, key, aliases = []) {
|
|
52
|
+
const keys = [key, ...aliases];
|
|
53
|
+
for (const candidate of keys) {
|
|
54
|
+
const value = options[candidate];
|
|
55
|
+
if (typeof value === "string" && value.trim().length > 0) {
|
|
56
|
+
return value;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return undefined;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function readBooleanOption(options, key, aliases = []) {
|
|
63
|
+
const keys = [key, ...aliases];
|
|
64
|
+
for (const candidate of keys) {
|
|
65
|
+
const value = options[candidate];
|
|
66
|
+
if (value === undefined) {
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
if (typeof value === "boolean") {
|
|
70
|
+
return value;
|
|
71
|
+
}
|
|
72
|
+
if (typeof value === "string") {
|
|
73
|
+
const normalized = value.trim().toLowerCase();
|
|
74
|
+
if (normalized === "true" || normalized === "1" || normalized === "yes" || normalized === "on") {
|
|
75
|
+
return true;
|
|
76
|
+
}
|
|
77
|
+
if (normalized === "false" || normalized === "0" || normalized === "no" || normalized === "off") {
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return undefined;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function requireRunId(bundle, commandName, args) {
|
|
86
|
+
const runId = args[0];
|
|
87
|
+
if (typeof runId === "string" && runId.trim().length > 0) {
|
|
88
|
+
return runId.trim();
|
|
89
|
+
}
|
|
90
|
+
throw new bundle.sdk.PmCliError(`${commandName} requires a runId argument.`, bundle.sdk.EXIT_CODE.USAGE);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export async function runTestRunsListPackage(options, global) {
|
|
94
|
+
const bundle = await ensureRuntimeBundle();
|
|
95
|
+
return bundle.sdk.runTestRunsList(
|
|
96
|
+
{
|
|
97
|
+
status: readStringOption(options, "status"),
|
|
98
|
+
limit: readStringOption(options, "limit"),
|
|
99
|
+
},
|
|
100
|
+
global,
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export async function runTestRunsStatusPackage(args, global) {
|
|
105
|
+
const bundle = await ensureRuntimeBundle();
|
|
106
|
+
return bundle.sdk.runTestRunsStatus(requireRunId(bundle, "test-runs status", args), global);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export async function runTestRunsLogsPackage(args, options, global) {
|
|
110
|
+
const bundle = await ensureRuntimeBundle();
|
|
111
|
+
return bundle.sdk.runTestRunsLogs(
|
|
112
|
+
requireRunId(bundle, "test-runs logs", args),
|
|
113
|
+
{
|
|
114
|
+
stream: readStringOption(options, "stream"),
|
|
115
|
+
tail: readStringOption(options, "tail"),
|
|
116
|
+
},
|
|
117
|
+
global,
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export async function runTestRunsStopPackage(args, options, global) {
|
|
122
|
+
const bundle = await ensureRuntimeBundle();
|
|
123
|
+
return bundle.sdk.runTestRunsStop(
|
|
124
|
+
requireRunId(bundle, "test-runs stop", args),
|
|
125
|
+
{
|
|
126
|
+
force: readBooleanOption(options, "force") === true,
|
|
127
|
+
},
|
|
128
|
+
global,
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export async function runTestRunsResumePackage(args, options, global) {
|
|
133
|
+
const bundle = await ensureRuntimeBundle();
|
|
134
|
+
return bundle.sdk.runTestRunsResume(
|
|
135
|
+
requireRunId(bundle, "test-runs resume", args),
|
|
136
|
+
{
|
|
137
|
+
author: readStringOption(options, "author"),
|
|
138
|
+
noExtensions: global.noExtensions === true,
|
|
139
|
+
},
|
|
140
|
+
global,
|
|
141
|
+
);
|
|
142
|
+
}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { pathToFileURL } from "node:url";
|
|
3
|
+
import type { GlobalOptions } from "../../../../src/sdk/index.js";
|
|
4
|
+
|
|
5
|
+
const PM_PACKAGE_ROOT_ENV = "PM_CLI_PACKAGE_ROOT";
|
|
6
|
+
|
|
7
|
+
interface RuntimeSdkModule {
|
|
8
|
+
EXIT_CODE: { USAGE: number };
|
|
9
|
+
PmCliError: new (message: string, exitCode?: number) => Error;
|
|
10
|
+
runTestRunsList: (options: Record<string, unknown>, global: GlobalOptions) => Promise<unknown>;
|
|
11
|
+
runTestRunsStatus: (runId: string, global: GlobalOptions) => Promise<unknown>;
|
|
12
|
+
runTestRunsLogs: (runId: string, options: Record<string, unknown>, global: GlobalOptions) => Promise<unknown>;
|
|
13
|
+
runTestRunsStop: (runId: string, options: Record<string, unknown>, global: GlobalOptions) => Promise<unknown>;
|
|
14
|
+
runTestRunsResume: (runId: string, options: Record<string, unknown>, global: GlobalOptions) => Promise<unknown>;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
interface RuntimeBundle {
|
|
18
|
+
sdk: RuntimeSdkModule;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
let runtimeBundle: RuntimeBundle | null = null;
|
|
22
|
+
let runtimeBundlePromise: Promise<RuntimeBundle> | null = null;
|
|
23
|
+
|
|
24
|
+
async function ensureRuntimeBundle(): Promise<RuntimeBundle> {
|
|
25
|
+
if (runtimeBundle) {
|
|
26
|
+
return runtimeBundle;
|
|
27
|
+
}
|
|
28
|
+
if (!runtimeBundlePromise) {
|
|
29
|
+
runtimeBundlePromise = loadRuntimeBundle();
|
|
30
|
+
}
|
|
31
|
+
runtimeBundle = await runtimeBundlePromise;
|
|
32
|
+
return runtimeBundle;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
async function loadRuntimeBundle(): Promise<RuntimeBundle> {
|
|
36
|
+
const envRoot = process.env[PM_PACKAGE_ROOT_ENV];
|
|
37
|
+
if (typeof envRoot !== "string" || envRoot.trim().length === 0) {
|
|
38
|
+
throw new Error(
|
|
39
|
+
`builtin-linked-test-adapters requires ${PM_PACKAGE_ROOT_ENV} to locate core SDK runtime exports.`,
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
const modulePath = path.join(path.resolve(envRoot.trim()), "dist", "sdk", "runtime.js");
|
|
43
|
+
try {
|
|
44
|
+
const sdkLoaded = (await import(pathToFileURL(modulePath).href)) as Partial<RuntimeSdkModule>;
|
|
45
|
+
if (
|
|
46
|
+
typeof sdkLoaded.runTestRunsList === "function" &&
|
|
47
|
+
typeof sdkLoaded.runTestRunsStatus === "function" &&
|
|
48
|
+
typeof sdkLoaded.runTestRunsLogs === "function" &&
|
|
49
|
+
typeof sdkLoaded.runTestRunsStop === "function" &&
|
|
50
|
+
typeof sdkLoaded.runTestRunsResume === "function" &&
|
|
51
|
+
typeof sdkLoaded.PmCliError === "function" &&
|
|
52
|
+
typeof sdkLoaded.EXIT_CODE === "object" &&
|
|
53
|
+
sdkLoaded.EXIT_CODE !== null
|
|
54
|
+
) {
|
|
55
|
+
return {
|
|
56
|
+
sdk: sdkLoaded as RuntimeSdkModule,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
} catch {
|
|
60
|
+
// Fall through to deterministic failure message below.
|
|
61
|
+
}
|
|
62
|
+
throw new Error(
|
|
63
|
+
`builtin-linked-test-adapters failed to load test-runs SDK runtime exports from ${modulePath}.`,
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function readStringOption(options: Record<string, unknown>, key: string, aliases: string[] = []): string | undefined {
|
|
68
|
+
const keys = [key, ...aliases];
|
|
69
|
+
for (const candidate of keys) {
|
|
70
|
+
const value = options[candidate];
|
|
71
|
+
if (typeof value === "string" && value.trim().length > 0) {
|
|
72
|
+
return value;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return undefined;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function readBooleanOption(options: Record<string, unknown>, key: string, aliases: string[] = []): boolean | undefined {
|
|
79
|
+
const keys = [key, ...aliases];
|
|
80
|
+
for (const candidate of keys) {
|
|
81
|
+
const value = options[candidate];
|
|
82
|
+
if (value === undefined) {
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
if (typeof value === "boolean") {
|
|
86
|
+
return value;
|
|
87
|
+
}
|
|
88
|
+
if (typeof value === "string") {
|
|
89
|
+
const normalized = value.trim().toLowerCase();
|
|
90
|
+
if (normalized === "true" || normalized === "1" || normalized === "yes" || normalized === "on") {
|
|
91
|
+
return true;
|
|
92
|
+
}
|
|
93
|
+
if (normalized === "false" || normalized === "0" || normalized === "no" || normalized === "off") {
|
|
94
|
+
return false;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return undefined;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function requireRunId(bundle: RuntimeBundle, commandName: string, args: string[]): string {
|
|
102
|
+
const runId = args[0];
|
|
103
|
+
if (typeof runId === "string" && runId.trim().length > 0) {
|
|
104
|
+
return runId.trim();
|
|
105
|
+
}
|
|
106
|
+
throw new bundle.sdk.PmCliError(`${commandName} requires a runId argument.`, bundle.sdk.EXIT_CODE.USAGE);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export async function runTestRunsListPackage(
|
|
110
|
+
options: Record<string, unknown>,
|
|
111
|
+
global: GlobalOptions,
|
|
112
|
+
): Promise<unknown> {
|
|
113
|
+
const bundle = await ensureRuntimeBundle();
|
|
114
|
+
return bundle.sdk.runTestRunsList(
|
|
115
|
+
{
|
|
116
|
+
status: readStringOption(options, "status"),
|
|
117
|
+
limit: readStringOption(options, "limit"),
|
|
118
|
+
},
|
|
119
|
+
global,
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export async function runTestRunsStatusPackage(args: string[], global: GlobalOptions): Promise<unknown> {
|
|
124
|
+
const bundle = await ensureRuntimeBundle();
|
|
125
|
+
return bundle.sdk.runTestRunsStatus(requireRunId(bundle, "test-runs status", args), global);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export async function runTestRunsLogsPackage(
|
|
129
|
+
args: string[],
|
|
130
|
+
options: Record<string, unknown>,
|
|
131
|
+
global: GlobalOptions,
|
|
132
|
+
): Promise<unknown> {
|
|
133
|
+
const bundle = await ensureRuntimeBundle();
|
|
134
|
+
return bundle.sdk.runTestRunsLogs(
|
|
135
|
+
requireRunId(bundle, "test-runs logs", args),
|
|
136
|
+
{
|
|
137
|
+
stream: readStringOption(options, "stream"),
|
|
138
|
+
tail: readStringOption(options, "tail"),
|
|
139
|
+
},
|
|
140
|
+
global,
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export async function runTestRunsStopPackage(
|
|
145
|
+
args: string[],
|
|
146
|
+
options: Record<string, unknown>,
|
|
147
|
+
global: GlobalOptions,
|
|
148
|
+
): Promise<unknown> {
|
|
149
|
+
const bundle = await ensureRuntimeBundle();
|
|
150
|
+
return bundle.sdk.runTestRunsStop(
|
|
151
|
+
requireRunId(bundle, "test-runs stop", args),
|
|
152
|
+
{
|
|
153
|
+
force: readBooleanOption(options, "force") === true,
|
|
154
|
+
},
|
|
155
|
+
global,
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export async function runTestRunsResumePackage(
|
|
160
|
+
args: string[],
|
|
161
|
+
options: Record<string, unknown>,
|
|
162
|
+
global: GlobalOptions,
|
|
163
|
+
): Promise<unknown> {
|
|
164
|
+
const bundle = await ensureRuntimeBundle();
|
|
165
|
+
return bundle.sdk.runTestRunsResume(
|
|
166
|
+
requireRunId(bundle, "test-runs resume", args),
|
|
167
|
+
{
|
|
168
|
+
author: readStringOption(options, "author"),
|
|
169
|
+
noExtensions: global.noExtensions === true,
|
|
170
|
+
},
|
|
171
|
+
global,
|
|
172
|
+
);
|
|
173
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@unbrained/pm-package-linked-test-adapters",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"description": "First-party pm package for optional linked-test run management adapters and reporters.",
|
|
7
|
+
"homepage": "https://github.com/unbraind/pm-cli/tree/main/packages/pm-linked-test-adapters#readme",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/unbraind/pm-cli.git",
|
|
11
|
+
"directory": "packages/pm-linked-test-adapters"
|
|
12
|
+
},
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/unbraind/pm-cli/issues"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"pm-package",
|
|
18
|
+
"project-management",
|
|
19
|
+
"linked-tests",
|
|
20
|
+
"background-runs",
|
|
21
|
+
"test-runs"
|
|
22
|
+
],
|
|
23
|
+
"pm": {
|
|
24
|
+
"aliases": [
|
|
25
|
+
"linked-test-adapters"
|
|
26
|
+
],
|
|
27
|
+
"extensions": [
|
|
28
|
+
"extensions/linked-test-adapters"
|
|
29
|
+
],
|
|
30
|
+
"catalog": {
|
|
31
|
+
"display_name": "Linked Test Adapters",
|
|
32
|
+
"category": "testing",
|
|
33
|
+
"summary": "Restore optional linked-test run management/reporting command surfaces.",
|
|
34
|
+
"tags": [
|
|
35
|
+
"tests",
|
|
36
|
+
"linked-tests",
|
|
37
|
+
"background",
|
|
38
|
+
"reporting"
|
|
39
|
+
],
|
|
40
|
+
"links": {
|
|
41
|
+
"docs": "https://github.com/unbraind/pm-cli/tree/main/packages/pm-linked-test-adapters#readme",
|
|
42
|
+
"repository": "https://github.com/unbraind/pm-cli/tree/main/packages/pm-linked-test-adapters",
|
|
43
|
+
"report": "https://github.com/unbraind/pm-cli/issues"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"docs": [
|
|
47
|
+
"README.md"
|
|
48
|
+
],
|
|
49
|
+
"examples": [
|
|
50
|
+
"README.md"
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# pm-search-advanced
|
|
2
|
+
|
|
3
|
+
First-party package that restores optional advanced search surfaces in bare-core `pm`.
|
|
4
|
+
|
|
5
|
+
## Commands and behavior
|
|
6
|
+
|
|
7
|
+
- Adds `pm search-advanced` with:
|
|
8
|
+
- `--mode keyword|semantic|hybrid`
|
|
9
|
+
- `--include-linked`
|
|
10
|
+
- `--title-exact`
|
|
11
|
+
- `--phrase-exact`
|
|
12
|
+
- Adds `pm reindex` with:
|
|
13
|
+
- `--mode keyword|semantic|hybrid`
|
|
14
|
+
- `--progress`
|
|
15
|
+
|
|
16
|
+
## Install
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
pm install search-advanced --project
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Verify
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
pm search-advanced "vector cache" --mode hybrid --limit 5 --json
|
|
26
|
+
pm reindex --mode hybrid --progress --json
|
|
27
|
+
```
|