@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,159 @@
|
|
|
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 governanceModule = null;
|
|
6
|
+
let governanceModulePromise = null;
|
|
7
|
+
|
|
8
|
+
async function ensureGovernanceModule() {
|
|
9
|
+
if (governanceModule) {
|
|
10
|
+
return governanceModule;
|
|
11
|
+
}
|
|
12
|
+
if (!governanceModulePromise) {
|
|
13
|
+
governanceModulePromise = loadGovernanceModule();
|
|
14
|
+
}
|
|
15
|
+
governanceModule = await governanceModulePromise;
|
|
16
|
+
return governanceModule;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
async function loadGovernanceModule() {
|
|
20
|
+
const envRoot = process.env[PM_PACKAGE_ROOT_ENV];
|
|
21
|
+
if (typeof envRoot !== "string" || envRoot.trim().length === 0) {
|
|
22
|
+
throw new Error(
|
|
23
|
+
`builtin-governance-audit 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 loaded = await import(pathToFileURL(modulePath).href);
|
|
29
|
+
if (
|
|
30
|
+
typeof loaded.runDedupeAudit === "function" &&
|
|
31
|
+
typeof loaded.runCommentsAudit === "function" &&
|
|
32
|
+
typeof loaded.runNormalize === "function"
|
|
33
|
+
) {
|
|
34
|
+
return loaded;
|
|
35
|
+
}
|
|
36
|
+
} catch {
|
|
37
|
+
// Fall through to deterministic failure message below.
|
|
38
|
+
}
|
|
39
|
+
throw new Error(
|
|
40
|
+
`builtin-governance-audit failed to load governance SDK runtime exports from ${modulePath}.`,
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function readStringOption(options, key, aliases = []) {
|
|
45
|
+
const keys = [key, ...aliases];
|
|
46
|
+
for (const candidate of keys) {
|
|
47
|
+
const value = options[candidate];
|
|
48
|
+
if (typeof value === "string" && value.trim().length > 0) {
|
|
49
|
+
return value;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return undefined;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function readBooleanOption(options, key, aliases = []) {
|
|
56
|
+
const keys = [key, ...aliases];
|
|
57
|
+
for (const candidate of keys) {
|
|
58
|
+
const value = options[candidate];
|
|
59
|
+
if (value === undefined) {
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
if (typeof value === "boolean") {
|
|
63
|
+
return value;
|
|
64
|
+
}
|
|
65
|
+
if (typeof value === "string") {
|
|
66
|
+
const normalized = value.trim().toLowerCase();
|
|
67
|
+
if (normalized === "true" || normalized === "1" || normalized === "yes" || normalized === "on") {
|
|
68
|
+
return true;
|
|
69
|
+
}
|
|
70
|
+
if (normalized === "false" || normalized === "0" || normalized === "no" || normalized === "off") {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return undefined;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function normalizeDedupeAuditOptions(raw) {
|
|
79
|
+
return {
|
|
80
|
+
mode: readStringOption(raw, "mode"),
|
|
81
|
+
status: readStringOption(raw, "status"),
|
|
82
|
+
type: readStringOption(raw, "type"),
|
|
83
|
+
tag: readStringOption(raw, "tag"),
|
|
84
|
+
priority: readStringOption(raw, "priority"),
|
|
85
|
+
deadlineBefore: readStringOption(raw, "deadlineBefore", ["deadline_before"]),
|
|
86
|
+
deadlineAfter: readStringOption(raw, "deadlineAfter", ["deadline_after"]),
|
|
87
|
+
assignee: readStringOption(raw, "assignee"),
|
|
88
|
+
assigneeFilter: readStringOption(raw, "assigneeFilter", ["assignee_filter"]),
|
|
89
|
+
parent: readStringOption(raw, "parent"),
|
|
90
|
+
sprint: readStringOption(raw, "sprint"),
|
|
91
|
+
release: readStringOption(raw, "release"),
|
|
92
|
+
limit: readStringOption(raw, "limit"),
|
|
93
|
+
threshold: readStringOption(raw, "threshold"),
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function normalizeCommentsAuditOptions(raw) {
|
|
98
|
+
return {
|
|
99
|
+
status: readStringOption(raw, "status"),
|
|
100
|
+
type: readStringOption(raw, "type"),
|
|
101
|
+
tag: readStringOption(raw, "tag"),
|
|
102
|
+
priority: readStringOption(raw, "priority"),
|
|
103
|
+
parent: readStringOption(raw, "parent"),
|
|
104
|
+
sprint: readStringOption(raw, "sprint"),
|
|
105
|
+
release: readStringOption(raw, "release"),
|
|
106
|
+
assignee: readStringOption(raw, "assignee"),
|
|
107
|
+
assigneeFilter: readStringOption(raw, "assigneeFilter", ["assignee_filter"]),
|
|
108
|
+
limit: readStringOption(raw, "limit"),
|
|
109
|
+
limitItems: readStringOption(raw, "limitItems", ["limit_items"]),
|
|
110
|
+
latest: readStringOption(raw, "latest"),
|
|
111
|
+
fullHistory: readBooleanOption(raw, "fullHistory", ["full_history"]) === true ? true : undefined,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function normalizeNormalizeOptions(raw) {
|
|
116
|
+
return {
|
|
117
|
+
status: readStringOption(raw, "filterStatus", ["filter_status", "status"]),
|
|
118
|
+
list: {
|
|
119
|
+
type: readStringOption(raw, "type"),
|
|
120
|
+
tag: readStringOption(raw, "tag"),
|
|
121
|
+
priority: readStringOption(raw, "priority"),
|
|
122
|
+
deadlineBefore: readStringOption(raw, "deadlineBefore", ["deadline_before"]),
|
|
123
|
+
deadlineAfter: readStringOption(raw, "deadlineAfter", ["deadline_after"]),
|
|
124
|
+
assignee: readStringOption(raw, "assignee"),
|
|
125
|
+
assigneeFilter: readStringOption(raw, "assigneeFilter", ["assignee_filter"]),
|
|
126
|
+
parent: readStringOption(raw, "parent"),
|
|
127
|
+
sprint: readStringOption(raw, "sprint"),
|
|
128
|
+
release: readStringOption(raw, "release"),
|
|
129
|
+
limit: readStringOption(raw, "limit"),
|
|
130
|
+
offset: readStringOption(raw, "offset"),
|
|
131
|
+
includeBody: readBooleanOption(raw, "includeBody", ["include_body"]) === true ? true : undefined,
|
|
132
|
+
compact: readBooleanOption(raw, "compact") === true ? true : undefined,
|
|
133
|
+
fields: readStringOption(raw, "fields"),
|
|
134
|
+
sort: readStringOption(raw, "sort"),
|
|
135
|
+
order: readStringOption(raw, "order"),
|
|
136
|
+
},
|
|
137
|
+
dryRun: readBooleanOption(raw, "dryRun", ["dry_run"]) === true ? true : undefined,
|
|
138
|
+
apply: readBooleanOption(raw, "apply") === true ? true : undefined,
|
|
139
|
+
author: readStringOption(raw, "author"),
|
|
140
|
+
message: readStringOption(raw, "message"),
|
|
141
|
+
force: readBooleanOption(raw, "force") === true ? true : undefined,
|
|
142
|
+
allowAuditUpdate: readBooleanOption(raw, "allowAuditUpdate", ["allow_audit_update"]) === true ? true : undefined,
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export async function runDedupeAuditPackage(options, global) {
|
|
147
|
+
const module = await ensureGovernanceModule();
|
|
148
|
+
return module.runDedupeAudit(normalizeDedupeAuditOptions(options), global);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export async function runCommentsAuditPackage(options, global) {
|
|
152
|
+
const module = await ensureGovernanceModule();
|
|
153
|
+
return module.runCommentsAudit(normalizeCommentsAuditOptions(options), global);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export async function runNormalizePackage(options, global) {
|
|
157
|
+
const module = await ensureGovernanceModule();
|
|
158
|
+
return module.runNormalize(normalizeNormalizeOptions(options), global);
|
|
159
|
+
}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { pathToFileURL } from "node:url";
|
|
3
|
+
import type { GlobalOptions } from "../../../../src/sdk/runtime.js";
|
|
4
|
+
|
|
5
|
+
const PM_PACKAGE_ROOT_ENV = "PM_CLI_PACKAGE_ROOT";
|
|
6
|
+
|
|
7
|
+
interface GovernanceRuntimeSdkModule {
|
|
8
|
+
runDedupeAudit: (options: Record<string, unknown>, global: GlobalOptions) => Promise<unknown>;
|
|
9
|
+
runCommentsAudit: (options: Record<string, unknown>, global: GlobalOptions) => Promise<unknown>;
|
|
10
|
+
runNormalize: (options: Record<string, unknown>, global: GlobalOptions) => Promise<unknown>;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
let governanceModule: GovernanceRuntimeSdkModule | null = null;
|
|
14
|
+
let governanceModulePromise: Promise<GovernanceRuntimeSdkModule> | null = null;
|
|
15
|
+
|
|
16
|
+
async function ensureGovernanceModule(): Promise<GovernanceRuntimeSdkModule> {
|
|
17
|
+
if (governanceModule) {
|
|
18
|
+
return governanceModule;
|
|
19
|
+
}
|
|
20
|
+
if (!governanceModulePromise) {
|
|
21
|
+
governanceModulePromise = loadGovernanceModule();
|
|
22
|
+
}
|
|
23
|
+
governanceModule = await governanceModulePromise;
|
|
24
|
+
return governanceModule;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
async function loadGovernanceModule(): Promise<GovernanceRuntimeSdkModule> {
|
|
28
|
+
const envRoot = process.env[PM_PACKAGE_ROOT_ENV];
|
|
29
|
+
if (typeof envRoot !== "string" || envRoot.trim().length === 0) {
|
|
30
|
+
throw new Error(
|
|
31
|
+
`builtin-governance-audit requires ${PM_PACKAGE_ROOT_ENV} to locate core SDK runtime exports.`,
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
const modulePath = path.join(path.resolve(envRoot.trim()), "dist", "sdk", "runtime.js");
|
|
35
|
+
try {
|
|
36
|
+
const loaded = (await import(pathToFileURL(modulePath).href)) as Partial<GovernanceRuntimeSdkModule>;
|
|
37
|
+
if (
|
|
38
|
+
typeof loaded.runDedupeAudit === "function" &&
|
|
39
|
+
typeof loaded.runCommentsAudit === "function" &&
|
|
40
|
+
typeof loaded.runNormalize === "function"
|
|
41
|
+
) {
|
|
42
|
+
return loaded as GovernanceRuntimeSdkModule;
|
|
43
|
+
}
|
|
44
|
+
} catch {
|
|
45
|
+
// Fall through to deterministic failure message below.
|
|
46
|
+
}
|
|
47
|
+
throw new Error(
|
|
48
|
+
`builtin-governance-audit failed to load governance SDK runtime exports from ${modulePath}.`,
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function readStringOption(options: Record<string, unknown>, key: string, aliases: string[] = []): string | undefined {
|
|
53
|
+
const keys = [key, ...aliases];
|
|
54
|
+
for (const candidate of keys) {
|
|
55
|
+
const value = options[candidate];
|
|
56
|
+
if (typeof value === "string" && value.trim().length > 0) {
|
|
57
|
+
return value;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return undefined;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function readBooleanOption(options: Record<string, unknown>, key: string, aliases: string[] = []): boolean | undefined {
|
|
64
|
+
const keys = [key, ...aliases];
|
|
65
|
+
for (const candidate of keys) {
|
|
66
|
+
const value = options[candidate];
|
|
67
|
+
if (value === undefined) {
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
if (typeof value === "boolean") {
|
|
71
|
+
return value;
|
|
72
|
+
}
|
|
73
|
+
if (typeof value === "string") {
|
|
74
|
+
const normalized = value.trim().toLowerCase();
|
|
75
|
+
if (normalized === "true" || normalized === "1" || normalized === "yes" || normalized === "on") {
|
|
76
|
+
return true;
|
|
77
|
+
}
|
|
78
|
+
if (normalized === "false" || normalized === "0" || normalized === "no" || normalized === "off") {
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return undefined;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function normalizeDedupeAuditOptions(raw: Record<string, unknown>): Record<string, unknown> {
|
|
87
|
+
return {
|
|
88
|
+
mode: readStringOption(raw, "mode"),
|
|
89
|
+
status: readStringOption(raw, "status"),
|
|
90
|
+
type: readStringOption(raw, "type"),
|
|
91
|
+
tag: readStringOption(raw, "tag"),
|
|
92
|
+
priority: readStringOption(raw, "priority"),
|
|
93
|
+
deadlineBefore: readStringOption(raw, "deadlineBefore", ["deadline_before"]),
|
|
94
|
+
deadlineAfter: readStringOption(raw, "deadlineAfter", ["deadline_after"]),
|
|
95
|
+
assignee: readStringOption(raw, "assignee"),
|
|
96
|
+
assigneeFilter: readStringOption(raw, "assigneeFilter", ["assignee_filter"]),
|
|
97
|
+
parent: readStringOption(raw, "parent"),
|
|
98
|
+
sprint: readStringOption(raw, "sprint"),
|
|
99
|
+
release: readStringOption(raw, "release"),
|
|
100
|
+
limit: readStringOption(raw, "limit"),
|
|
101
|
+
threshold: readStringOption(raw, "threshold"),
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function normalizeCommentsAuditOptions(raw: Record<string, unknown>): Record<string, unknown> {
|
|
106
|
+
return {
|
|
107
|
+
status: readStringOption(raw, "status"),
|
|
108
|
+
type: readStringOption(raw, "type"),
|
|
109
|
+
tag: readStringOption(raw, "tag"),
|
|
110
|
+
priority: readStringOption(raw, "priority"),
|
|
111
|
+
parent: readStringOption(raw, "parent"),
|
|
112
|
+
sprint: readStringOption(raw, "sprint"),
|
|
113
|
+
release: readStringOption(raw, "release"),
|
|
114
|
+
assignee: readStringOption(raw, "assignee"),
|
|
115
|
+
assigneeFilter: readStringOption(raw, "assigneeFilter", ["assignee_filter"]),
|
|
116
|
+
limit: readStringOption(raw, "limit"),
|
|
117
|
+
limitItems: readStringOption(raw, "limitItems", ["limit_items"]),
|
|
118
|
+
latest: readStringOption(raw, "latest"),
|
|
119
|
+
fullHistory: readBooleanOption(raw, "fullHistory", ["full_history"]) === true ? true : undefined,
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function normalizeNormalizeOptions(raw: Record<string, unknown>): Record<string, unknown> {
|
|
124
|
+
return {
|
|
125
|
+
status: readStringOption(raw, "filterStatus", ["filter_status", "status"]),
|
|
126
|
+
list: {
|
|
127
|
+
type: readStringOption(raw, "type"),
|
|
128
|
+
tag: readStringOption(raw, "tag"),
|
|
129
|
+
priority: readStringOption(raw, "priority"),
|
|
130
|
+
deadlineBefore: readStringOption(raw, "deadlineBefore", ["deadline_before"]),
|
|
131
|
+
deadlineAfter: readStringOption(raw, "deadlineAfter", ["deadline_after"]),
|
|
132
|
+
assignee: readStringOption(raw, "assignee"),
|
|
133
|
+
assigneeFilter: readStringOption(raw, "assigneeFilter", ["assignee_filter"]),
|
|
134
|
+
parent: readStringOption(raw, "parent"),
|
|
135
|
+
sprint: readStringOption(raw, "sprint"),
|
|
136
|
+
release: readStringOption(raw, "release"),
|
|
137
|
+
limit: readStringOption(raw, "limit"),
|
|
138
|
+
offset: readStringOption(raw, "offset"),
|
|
139
|
+
includeBody: readBooleanOption(raw, "includeBody", ["include_body"]) === true ? true : undefined,
|
|
140
|
+
compact: readBooleanOption(raw, "compact") === true ? true : undefined,
|
|
141
|
+
fields: readStringOption(raw, "fields"),
|
|
142
|
+
sort: readStringOption(raw, "sort"),
|
|
143
|
+
order: readStringOption(raw, "order"),
|
|
144
|
+
},
|
|
145
|
+
dryRun: readBooleanOption(raw, "dryRun", ["dry_run"]) === true ? true : undefined,
|
|
146
|
+
apply: readBooleanOption(raw, "apply") === true ? true : undefined,
|
|
147
|
+
author: readStringOption(raw, "author"),
|
|
148
|
+
message: readStringOption(raw, "message"),
|
|
149
|
+
force: readBooleanOption(raw, "force") === true ? true : undefined,
|
|
150
|
+
allowAuditUpdate: readBooleanOption(raw, "allowAuditUpdate", ["allow_audit_update"]) === true ? true : undefined,
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export async function runDedupeAuditPackage(
|
|
155
|
+
options: Record<string, unknown>,
|
|
156
|
+
global: GlobalOptions,
|
|
157
|
+
): Promise<unknown> {
|
|
158
|
+
const module = await ensureGovernanceModule();
|
|
159
|
+
return module.runDedupeAudit(normalizeDedupeAuditOptions(options), global);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export async function runCommentsAuditPackage(
|
|
163
|
+
options: Record<string, unknown>,
|
|
164
|
+
global: GlobalOptions,
|
|
165
|
+
): Promise<unknown> {
|
|
166
|
+
const module = await ensureGovernanceModule();
|
|
167
|
+
return module.runCommentsAudit(normalizeCommentsAuditOptions(options), global);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export async function runNormalizePackage(
|
|
171
|
+
options: Record<string, unknown>,
|
|
172
|
+
global: GlobalOptions,
|
|
173
|
+
): Promise<unknown> {
|
|
174
|
+
const module = await ensureGovernanceModule();
|
|
175
|
+
return module.runNormalize(normalizeNormalizeOptions(options), global);
|
|
176
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@unbrained/pm-package-governance-audit",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"description": "First-party pm package for governance audit and normalization workflows.",
|
|
7
|
+
"homepage": "https://github.com/unbraind/pm-cli/tree/main/packages/pm-governance-audit#readme",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/unbraind/pm-cli.git",
|
|
11
|
+
"directory": "packages/pm-governance-audit"
|
|
12
|
+
},
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/unbraind/pm-cli/issues"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"pm-package",
|
|
18
|
+
"project-management",
|
|
19
|
+
"governance",
|
|
20
|
+
"audit",
|
|
21
|
+
"normalize"
|
|
22
|
+
],
|
|
23
|
+
"pm": {
|
|
24
|
+
"aliases": [
|
|
25
|
+
"governance-audit"
|
|
26
|
+
],
|
|
27
|
+
"extensions": [
|
|
28
|
+
"extensions/governance-audit"
|
|
29
|
+
],
|
|
30
|
+
"catalog": {
|
|
31
|
+
"display_name": "Governance Audit",
|
|
32
|
+
"category": "governance",
|
|
33
|
+
"summary": "Run dedupe audits, comments audits, and normalize sweeps as package-owned workflows.",
|
|
34
|
+
"tags": [
|
|
35
|
+
"governance",
|
|
36
|
+
"audit",
|
|
37
|
+
"normalize"
|
|
38
|
+
],
|
|
39
|
+
"links": {
|
|
40
|
+
"docs": "https://github.com/unbraind/pm-cli/tree/main/packages/pm-governance-audit#readme",
|
|
41
|
+
"repository": "https://github.com/unbraind/pm-cli/tree/main/packages/pm-governance-audit",
|
|
42
|
+
"report": "https://github.com/unbraind/pm-cli/issues"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"docs": [
|
|
46
|
+
"README.md"
|
|
47
|
+
],
|
|
48
|
+
"examples": [
|
|
49
|
+
"README.md"
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# pm-guide-shell
|
|
2
|
+
|
|
3
|
+
First-party package that restores optional guide and shell-completion UX in bare-core `pm`.
|
|
4
|
+
|
|
5
|
+
## Commands
|
|
6
|
+
|
|
7
|
+
- `pm guide [topic]`
|
|
8
|
+
- `pm completion [bash|zsh|fish]`
|
|
9
|
+
- `pm completion-tags`
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
pm install guide-shell --project
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Verify
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
pm guide --list --json
|
|
21
|
+
pm completion bash
|
|
22
|
+
pm completion-tags
|
|
23
|
+
```
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import {
|
|
2
|
+
renderGuideShellPackageOutput,
|
|
3
|
+
runCompletionPackage,
|
|
4
|
+
runCompletionTagsPackage,
|
|
5
|
+
runGuidePackage,
|
|
6
|
+
} from "./runtime.js";
|
|
7
|
+
|
|
8
|
+
export const manifest = {
|
|
9
|
+
name: "builtin-guide-shell",
|
|
10
|
+
version: "0.1.0",
|
|
11
|
+
entry: "./index.js",
|
|
12
|
+
priority: 0,
|
|
13
|
+
capabilities: ["commands", "schema", "services"],
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const guideFlags = [
|
|
17
|
+
{ long: "--list", value_type: "boolean", description: "List available guide topics." },
|
|
18
|
+
{ long: "--format", value_name: "value", value_type: "string", description: "Output format override: markdown|toon|json." },
|
|
19
|
+
{ long: "--depth", value_name: "value", value_type: "string", description: "Guide detail depth." },
|
|
20
|
+
{ long: "--topic", value_name: "value", value_type: "string", description: "Explicit guide topic override." },
|
|
21
|
+
];
|
|
22
|
+
|
|
23
|
+
const completionFlags = [
|
|
24
|
+
{ long: "--shell", value_name: "value", value_type: "string", description: "Completion target shell: bash|zsh|fish." },
|
|
25
|
+
{ long: "--item-types", value_name: "csv", value_type: "string", description: "Filter completion item types." },
|
|
26
|
+
{ long: "--item_types", value_name: "csv", value_type: "string", description: "Alias for --item-types." },
|
|
27
|
+
{ long: "--tags", value_name: "csv", value_type: "string", description: "Filter completion tags." },
|
|
28
|
+
{ long: "--eager-tags", value_type: "boolean", description: "Expand all tag suggestions eagerly." },
|
|
29
|
+
{ long: "--eager_tags", value_type: "boolean", description: "Alias for --eager-tags." },
|
|
30
|
+
];
|
|
31
|
+
|
|
32
|
+
function guideCommand() {
|
|
33
|
+
return {
|
|
34
|
+
name: "guide",
|
|
35
|
+
action: "guide",
|
|
36
|
+
description: "Show migration and usage guidance for pm command families.",
|
|
37
|
+
arguments: [{ name: "topic", required: false, description: "Optional guide topic." }],
|
|
38
|
+
flags: [...guideFlags],
|
|
39
|
+
run: async (context) => runGuidePackage(context.args, context.options, context.global),
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function completionCommand() {
|
|
44
|
+
return {
|
|
45
|
+
name: "completion",
|
|
46
|
+
action: "completion",
|
|
47
|
+
description: "Generate shell completion scripts for bash, zsh, and fish.",
|
|
48
|
+
arguments: [{ name: "shell", required: false, description: "Target shell (bash|zsh|fish)." }],
|
|
49
|
+
flags: [...completionFlags],
|
|
50
|
+
run: async (context) => runCompletionPackage(context.args, context.options, context.global),
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function completionTagsCommand() {
|
|
55
|
+
return {
|
|
56
|
+
name: "completion-tags",
|
|
57
|
+
action: "completion-tags",
|
|
58
|
+
description: "Print known tags for completion filters.",
|
|
59
|
+
run: async (context) => runCompletionTagsPackage(context.global),
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function activate(api) {
|
|
64
|
+
api.registerCommand(guideCommand());
|
|
65
|
+
api.registerCommand(completionCommand());
|
|
66
|
+
api.registerCommand(completionTagsCommand());
|
|
67
|
+
api.registerService("output_format", (context) => {
|
|
68
|
+
const rendered = renderGuideShellPackageOutput(context);
|
|
69
|
+
return rendered ?? context.payload;
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export default {
|
|
74
|
+
manifest,
|
|
75
|
+
activate,
|
|
76
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
CommandDefinition,
|
|
3
|
+
ExtensionApi,
|
|
4
|
+
ServiceOverrideContext,
|
|
5
|
+
} from "../../../../src/sdk/index.js";
|
|
6
|
+
import {
|
|
7
|
+
renderGuideShellPackageOutput,
|
|
8
|
+
runCompletionPackage,
|
|
9
|
+
runCompletionTagsPackage,
|
|
10
|
+
runGuidePackage,
|
|
11
|
+
} from "./runtime.js";
|
|
12
|
+
|
|
13
|
+
export const manifest = {
|
|
14
|
+
name: "builtin-guide-shell",
|
|
15
|
+
version: "0.1.0",
|
|
16
|
+
entry: "./index.js",
|
|
17
|
+
priority: 0,
|
|
18
|
+
capabilities: ["commands", "schema", "services"],
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const guideFlags = [
|
|
22
|
+
{ long: "--list", value_type: "boolean", description: "List available guide topics." },
|
|
23
|
+
{ long: "--format", value_name: "value", value_type: "string", description: "Output format override: markdown|toon|json." },
|
|
24
|
+
{ long: "--depth", value_name: "value", value_type: "string", description: "Guide detail depth." },
|
|
25
|
+
{ long: "--topic", value_name: "value", value_type: "string", description: "Explicit guide topic override." },
|
|
26
|
+
] as const;
|
|
27
|
+
|
|
28
|
+
const completionFlags = [
|
|
29
|
+
{ long: "--shell", value_name: "value", value_type: "string", description: "Completion target shell: bash|zsh|fish." },
|
|
30
|
+
{ long: "--item-types", value_name: "csv", value_type: "string", description: "Filter completion item types." },
|
|
31
|
+
{ long: "--item_types", value_name: "csv", value_type: "string", description: "Alias for --item-types." },
|
|
32
|
+
{ long: "--tags", value_name: "csv", value_type: "string", description: "Filter completion tags." },
|
|
33
|
+
{ long: "--eager-tags", value_type: "boolean", description: "Expand all tag suggestions eagerly." },
|
|
34
|
+
{ long: "--eager_tags", value_type: "boolean", description: "Alias for --eager-tags." },
|
|
35
|
+
] as const;
|
|
36
|
+
|
|
37
|
+
function guideCommand(): CommandDefinition {
|
|
38
|
+
return {
|
|
39
|
+
name: "guide",
|
|
40
|
+
action: "guide",
|
|
41
|
+
description: "Show migration and usage guidance for pm command families.",
|
|
42
|
+
arguments: [{ name: "topic", required: false, description: "Optional guide topic." }],
|
|
43
|
+
flags: [...guideFlags],
|
|
44
|
+
run: async (context) => runGuidePackage(context.args, context.options, context.global),
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function completionCommand(): CommandDefinition {
|
|
49
|
+
return {
|
|
50
|
+
name: "completion",
|
|
51
|
+
action: "completion",
|
|
52
|
+
description: "Generate shell completion scripts for bash, zsh, and fish.",
|
|
53
|
+
arguments: [{ name: "shell", required: false, description: "Target shell (bash|zsh|fish)." }],
|
|
54
|
+
flags: [...completionFlags],
|
|
55
|
+
run: async (context) => runCompletionPackage(context.args, context.options, context.global),
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function completionTagsCommand(): CommandDefinition {
|
|
60
|
+
return {
|
|
61
|
+
name: "completion-tags",
|
|
62
|
+
action: "completion-tags",
|
|
63
|
+
description: "Print known tags for completion filters.",
|
|
64
|
+
run: async (context) => runCompletionTagsPackage(context.global),
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export function activate(api: ExtensionApi): void {
|
|
69
|
+
api.registerCommand(guideCommand());
|
|
70
|
+
api.registerCommand(completionCommand());
|
|
71
|
+
api.registerCommand(completionTagsCommand());
|
|
72
|
+
api.registerService("output_format", (context) => {
|
|
73
|
+
const rendered = renderGuideShellPackageOutput(context as ServiceOverrideContext);
|
|
74
|
+
return rendered ?? context.payload;
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export default {
|
|
79
|
+
manifest,
|
|
80
|
+
activate,
|
|
81
|
+
};
|