@unbrained/pm-cli 2026.8.23 → 2026.8.24
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/.claude-plugin/marketplace.json +2 -2
- package/CHANGELOG.md +14 -1
- package/dist/cli/description-stdin.js +5 -4
- package/dist/cli/extension-command-help.d.ts +5 -0
- package/dist/cli/extension-command-help.js +6 -2
- package/dist/cli/help-content.d.ts +5 -0
- package/dist/cli/help-content.js +56 -3
- package/dist/cli/help-json-payload.d.ts +5 -2
- package/dist/cli/help-json-payload.js +57 -17
- package/dist/cli/main.d.ts +3 -0
- package/dist/cli/main.js +28 -3
- package/dist/cli/register-annotations.js +5 -5
- package/dist/cli/register-mutation.js +73 -27
- package/dist/cli-bundle/bundle-manifest.json +152 -152
- package/dist/cli-bundle/chunks/{chunk-JB4KZWBF.js → chunk-AGUL3HUT.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-EG6CLDZT.js → chunk-DJNJBWAQ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-F3AI2JFL.js → chunk-I5Q7QSZX.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-IW72J5FW.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-KXPMB2YL.js → chunk-L22NP5MA.js} +55 -55
- package/dist/cli-bundle/chunks/chunk-MKE6MD2K.js +36 -0
- package/dist/cli-bundle/chunks/{chunk-QDVHNHAQ.js → chunk-NXBFO63A.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-TEQDR5KI.js +202 -0
- package/dist/cli-bundle/chunks/{chunk-KPH73XXJ.js → chunk-X7WWQDYQ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-TFI5V5N2.js → chunk-YOLLRCLY.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-HWZ6CELB.js → chunk-ZAVCS2GH.js} +2 -2
- package/dist/cli-bundle/chunks/{register-list-query-UJB5FMV2.js → register-list-query-37A4P6O4.js} +2 -2
- package/dist/cli-bundle/chunks/register-mutation-TBJDHYIT.js +20 -0
- package/dist/cli-bundle/chunks/{register-operations-RXIJIYXC.js → register-operations-WRZNEBUM.js} +2 -2
- package/dist/cli-bundle/chunks/{register-setup-GFUZEKRE.js → register-setup-H4PDLACD.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-AUFH5H35.js → chunk-4WP7LNE3.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-LYVSW5VM.js → chunk-6MUTDXMP.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-6Z24ZMU3.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-OGLQBL46.js → chunk-BFA6KKCI.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-QGFNI65N.js → chunk-CWCN5RLO.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-UYRFYCDQ.js → chunk-FCTT4CZU.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-IFLWKY2R.js → chunk-GJR6YEMR.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-37Z4OEAP.js → chunk-IMWTYKII.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-R27IDGHD.js → chunk-IZNRRCU3.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-JOWDB2MH.js → chunk-MNPECIRL.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-OFVUGTLJ.js → chunk-O4ZXNJMT.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-Q63PSLO4.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-QBP5FSBX.js +4 -0
- package/dist/cli-bundle/focused-chunks/{chunk-OY7QAV4Y.js → chunk-QV5UP27O.js} +46 -46
- package/dist/cli-bundle/focused-chunks/{chunk-3UPTYG44.js → chunk-RASVBJX5.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-5S7E72FY.js → chunk-RPRLENVA.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-TOFVXBWA.js +19 -0
- package/dist/cli-bundle/focused-chunks/{chunk-FZS4H32O.js → chunk-WZLSSGEU.js} +2 -2
- package/dist/cli-bundle/main.js +18 -17
- package/dist/cli-bundle/sdk-authoring.js +1 -1
- package/dist/cli-bundle/sdk-contracts.js +1 -1
- package/dist/cli-bundle/sdk-core.js +41 -41
- package/dist/cli-bundle/sdk-governance.js +1 -1
- package/dist/cli-bundle/sdk-graph.js +1 -1
- package/dist/cli-bundle/sdk-merge.js +33 -33
- package/dist/cli-bundle/sdk-query.js +1 -1
- package/dist/cli-bundle/sdk-runtime.js +1 -1
- package/dist/cli-bundle/sdk-testing.js +1 -1
- package/dist/cli-bundle/sdk.js +6 -5
- package/dist/core/extensions/command-metadata-contract.d.ts +10 -0
- package/dist/core/extensions/command-metadata-contract.js +23 -0
- package/dist/core/extensions/command-visibility-tier.js +12 -2
- package/dist/core/extensions/extension-types.d.ts +6 -0
- package/dist/core/extensions/extension-types.js +2 -2
- package/dist/core/extensions/loader.js +4 -3
- package/dist/core/io/body-file.js +7 -2
- package/dist/core/io/bulk-ids-input.d.ts +24 -0
- package/dist/core/io/bulk-ids-input.js +113 -0
- package/dist/core/item/parse.d.ts +22 -2
- package/dist/core/item/parse.js +97 -4
- package/dist/mcp/server.d.ts +3 -2
- package/dist/mcp/server.js +16 -9
- package/dist/sdk/agent/refusal-closure-census.d.ts +66 -0
- package/dist/sdk/agent/refusal-closure-census.js +144 -0
- package/dist/sdk/agent-capability-contracts.d.ts +34 -1
- package/dist/sdk/agent-capability-contracts.js +104 -6
- package/dist/sdk/annotations.d.ts +2 -0
- package/dist/sdk/annotations.js +25 -7
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +38 -2
- package/dist/sdk/cli-contracts/typed-action-inputs.d.ts +4 -1
- package/dist/sdk/cli-contracts/typed-action-inputs.js +2 -2
- package/dist/sdk/comments.js +15 -7
- package/dist/sdk/flag-invocation-contracts.d.ts +2 -0
- package/dist/sdk/flag-invocation-contracts.js +28 -3
- package/dist/sdk/generated/generated-error-code-catalog-part-1.js +71 -38
- package/dist/sdk/generated/generated-error-code-catalog-part-2.js +38 -2
- package/dist/sdk/guide-topics.d.ts +0 -5
- package/dist/sdk/guide-topics.js +28 -2
- package/dist/sdk/history-compact.d.ts +2 -1
- package/dist/sdk/history-compact.js +24 -5
- package/dist/sdk/history-mcp.js +11 -10
- package/dist/sdk/index.d.ts +1 -0
- package/dist/sdk/index.js +3 -2
- package/dist/sdk/item-transaction.js +19 -12
- package/dist/sdk/lifecycle/append.js +4 -4
- package/dist/sdk/lifecycle/close-many.js +16 -7
- package/dist/sdk/lifecycle/create.js +29 -21
- package/dist/sdk/lifecycle/plan.js +24 -6
- package/dist/sdk/lifecycle/update-many.js +15 -8
- package/dist/sdk/lifecycle/update.d.ts +2 -0
- package/dist/sdk/lifecycle/update.js +34 -24
- package/dist/sdk/runtime-extended-actions.js +5 -3
- package/dist/sdk/runtime-input.d.ts +4 -0
- package/dist/sdk/runtime-input.js +98 -23
- package/dist/sdk/runtime-primitives.d.ts +2 -1
- package/dist/sdk/runtime-primitives.js +4 -3
- package/dist/sdk/runtime.js +7 -20
- package/dist/sdk/scheduling-shortcuts.js +5 -3
- package/dist/sdk/structured-mutations.js +10 -3
- package/dist/sdk/workspace-contracts.d.ts +3 -0
- package/dist/sdk/workspace-contracts.js +3 -2
- package/docs/README.md +2 -0
- package/docs/RELEASING.md +40 -21
- package/docs/SCRIPTING.md +62 -3
- package/docs/SDK.md +8 -0
- package/docs/generated/AGENT_CAPABILITY_ROUTING.md +17 -0
- package/docs/generated/AGENT_COMMAND_SURFACE.md +1 -1
- package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +355 -0
- package/marketplace.json +2 -2
- package/package.json +1 -1
- package/packages/pm-beads/package.json +1 -1
- package/packages/pm-calendar/package.json +1 -1
- package/packages/pm-command-kit/README.md +9 -11
- package/packages/pm-command-kit/extensions/command-kit/index.ts +3 -1
- package/packages/pm-command-kit/package.json +1 -1
- package/packages/pm-digital-twin/package.json +1 -1
- package/packages/pm-governance-audit/package.json +1 -1
- package/packages/pm-guide-shell/extensions/guide-shell/index.ts +10 -0
- package/packages/pm-guide-shell/package.json +1 -1
- package/packages/pm-kanban/package.json +1 -1
- package/packages/pm-lifecycle-hooks/package.json +1 -1
- package/packages/pm-linked-test-adapters/package.json +1 -1
- package/packages/pm-search-advanced/package.json +1 -1
- package/packages/pm-templates/package.json +1 -1
- package/packages/pm-todos/package.json +1 -1
- package/packages/pm-vcs/package.json +1 -1
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
- package/scripts/generate-agent-capability-surfaces.mjs +27 -1
- package/sdk/public-surface.json +215 -11
- package/dist/cli-bundle/chunks/chunk-3ENVHX6C.js +0 -36
- package/dist/cli-bundle/chunks/chunk-DW2CGEMU.js +0 -2
- package/dist/cli-bundle/chunks/chunk-HZBMLSZI.js +0 -201
- package/dist/cli-bundle/chunks/register-mutation-NX5XE4VX.js +0 -20
- package/dist/cli-bundle/focused-chunks/chunk-E7X25GC3.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-FQCSTBWE.js +0 -4
- package/dist/cli-bundle/focused-chunks/chunk-MRCNF3U6.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-ZHVA42R5.js +0 -18
package/dist/sdk/comments.js
CHANGED
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
* Implements the pm comments command surface and its agent-facing runtime behavior.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
7
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="5167b367-26cf-52d5-8040-bb001ce3592a")}catch(e){}}();
|
|
8
8
|
import { isFileAbsentError } from "../core/fs/fs-utils.js";
|
|
9
9
|
import { readFile } from "node:fs/promises";
|
|
10
|
-
import { EXIT_CODE, PmCliError, createStdinTokenResolver, } from "./runtime-primitives.js";
|
|
11
|
-
import { isErrnoError, parseAnnotationTextInput, runAnnotationCommand, } from "./annotations.js";
|
|
10
|
+
import { EXIT_CODE, PmCliError, createStdinTokenResolver, shouldResolveMutationStdinTokens, } from "./runtime-primitives.js";
|
|
11
|
+
import { assertAnnotationStdinTransportAvailable, isErrnoError, parseAnnotationTextInput, runAnnotationCommand, } from "./annotations.js";
|
|
12
12
|
async function resolveCommentTextSource(options, stdinResolver) {
|
|
13
13
|
const hasAdd = options.add !== undefined;
|
|
14
14
|
const hasStdin = options.stdin === true;
|
|
@@ -21,10 +21,11 @@ async function resolveCommentTextSource(options, stdinResolver) {
|
|
|
21
21
|
throw new PmCliError("Specify comment text using only one input source: --add, --stdin, or --file", EXIT_CODE.USAGE);
|
|
22
22
|
}
|
|
23
23
|
if (hasAdd) {
|
|
24
|
-
const addInput = await stdinResolver.resolveValue(options.add, "--add");
|
|
24
|
+
const addInput = await stdinResolver.resolveValue(options.add, "--add", shouldResolveMutationStdinTokens(options));
|
|
25
25
|
return { value: addInput ?? "", emptyFlag: "--add" };
|
|
26
26
|
}
|
|
27
27
|
if (hasStdin) {
|
|
28
|
+
assertAnnotationStdinTransportAvailable(options, "--stdin");
|
|
28
29
|
const stdinInput = await stdinResolver.resolveValue("-", "--stdin");
|
|
29
30
|
return { value: stdinInput ?? "", emptyFlag: "--stdin" };
|
|
30
31
|
}
|
|
@@ -32,16 +33,23 @@ async function resolveCommentTextSource(options, stdinResolver) {
|
|
|
32
33
|
if (!filePath) {
|
|
33
34
|
throw new PmCliError("--file path cannot be empty", EXIT_CODE.USAGE);
|
|
34
35
|
}
|
|
36
|
+
if (filePath === "-") {
|
|
37
|
+
assertAnnotationStdinTransportAvailable(options, "--file -");
|
|
38
|
+
return {
|
|
39
|
+
value: (await stdinResolver.resolveValue("-", "--file")) ?? "",
|
|
40
|
+
emptyFlag: "--file",
|
|
41
|
+
};
|
|
42
|
+
}
|
|
35
43
|
try {
|
|
36
44
|
const fileInput = await readFile(filePath, "utf8");
|
|
37
45
|
return { value: fileInput, emptyFlag: "--file" };
|
|
38
46
|
}
|
|
39
47
|
catch (error) {
|
|
40
48
|
if (isErrnoError(error) && isFileAbsentError(error)) {
|
|
41
|
-
throw new PmCliError(`--file path not found: ${filePath}
|
|
49
|
+
throw new PmCliError(`--file path not found: ${filePath}. Use --file - to read stdin.`, EXIT_CODE.USAGE);
|
|
42
50
|
}
|
|
43
51
|
const detail = error instanceof Error ? error.message : String(error);
|
|
44
|
-
throw new PmCliError(`Failed to read --file path "${filePath}": ${detail}
|
|
52
|
+
throw new PmCliError(`Failed to read --file path "${filePath}": ${detail}. Use --file - to read stdin.`, EXIT_CODE.USAGE);
|
|
45
53
|
}
|
|
46
54
|
}
|
|
47
55
|
async function resolveCommentInput(options, stdinResolver) {
|
|
@@ -123,4 +131,4 @@ export async function runComments(id, options, global) {
|
|
|
123
131
|
});
|
|
124
132
|
}
|
|
125
133
|
//# sourceMappingURL=comments.js.map
|
|
126
|
-
//# debugId=
|
|
134
|
+
//# debugId=5167b367-26cf-52d5-8040-bb001ce3592a
|
|
@@ -24,6 +24,8 @@ export interface CliFlagInvocationContract extends CliFlagContract {
|
|
|
24
24
|
input_sources: CliFlagInputSource[];
|
|
25
25
|
/** Sentinel that redirects the argv value to stdin. */
|
|
26
26
|
stdin_token?: "-";
|
|
27
|
+
/** Prefix that redirects the argv value to a file path. */
|
|
28
|
+
file_token_prefix?: "@";
|
|
27
29
|
}
|
|
28
30
|
/** Executable option arity observed from the registered Commander program. */
|
|
29
31
|
export interface CliFlagArityObservation {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="7ef5cc14-ad6b-5cce-a1a1-e5cfac85fbc2")}catch(e){}}();
|
|
3
3
|
const FLAG_DESCRIPTIONS = Object.freeze({
|
|
4
4
|
"--body": "Set the item body.",
|
|
5
|
-
"--body-file": "Read the item body from a file
|
|
5
|
+
"--body-file": "Read the item body from a file, or from stdin when set to -.",
|
|
6
6
|
"--description": "Set the item description.",
|
|
7
7
|
"--stdin": "Read the value from stdin.",
|
|
8
8
|
"--stdin-json": "Read a complete JSON document from stdin.",
|
|
@@ -12,13 +12,16 @@ const STDIN_TOKEN_FLAGS = new Set([
|
|
|
12
12
|
"--body",
|
|
13
13
|
"--comment",
|
|
14
14
|
"--dep",
|
|
15
|
+
"--dep-remove",
|
|
15
16
|
"--description",
|
|
16
17
|
"--doc",
|
|
18
|
+
"--event",
|
|
17
19
|
"--field",
|
|
18
20
|
"--file",
|
|
19
21
|
"--learning",
|
|
20
22
|
"--note",
|
|
21
23
|
"--remove",
|
|
24
|
+
"--reminder",
|
|
22
25
|
"--test",
|
|
23
26
|
"--type-option",
|
|
24
27
|
]);
|
|
@@ -32,6 +35,22 @@ const STDIN_VALUE_COMMANDS = new Set([
|
|
|
32
35
|
"notes",
|
|
33
36
|
"test",
|
|
34
37
|
"update",
|
|
38
|
+
"update-many",
|
|
39
|
+
]);
|
|
40
|
+
const FILE_OR_STDIN_COMMAND_FLAGS = new Set([
|
|
41
|
+
"close-many:--ids",
|
|
42
|
+
"comments:--file",
|
|
43
|
+
"create:--body-file",
|
|
44
|
+
"history-compact:--ids",
|
|
45
|
+
"learnings:--file",
|
|
46
|
+
"notes:--file",
|
|
47
|
+
"update:--body-file",
|
|
48
|
+
"update-many:--ids",
|
|
49
|
+
]);
|
|
50
|
+
const AT_PATH_FILE_COMMAND_FLAGS = new Set([
|
|
51
|
+
"close-many:--ids",
|
|
52
|
+
"history-compact:--ids",
|
|
53
|
+
"update-many:--ids",
|
|
35
54
|
]);
|
|
36
55
|
const BOOLEAN_FLAG_PREFIXES = [
|
|
37
56
|
"--allow-",
|
|
@@ -193,6 +212,9 @@ const OPTIONAL_VALUE_FLAGS = new Set(["--regression"]);
|
|
|
193
212
|
function resolveFlagInputSources(command, flag) {
|
|
194
213
|
if (flag === "--stdin" || flag === "--stdin-json")
|
|
195
214
|
return ["stdin"];
|
|
215
|
+
if (FILE_OR_STDIN_COMMAND_FLAGS.has(`${command}:${flag}`)) {
|
|
216
|
+
return ["argv", "file", "stdin"];
|
|
217
|
+
}
|
|
196
218
|
if (flag.endsWith("-file"))
|
|
197
219
|
return ["argv", "file"];
|
|
198
220
|
if (STDIN_TOKEN_FLAGS.has(flag) && STDIN_VALUE_COMMANDS.has(command)) {
|
|
@@ -243,6 +265,9 @@ export function enrichCliFlagInvocationContract(command, contract) {
|
|
|
243
265
|
contract.flag !== "--stdin-json"
|
|
244
266
|
? { stdin_token: "-" }
|
|
245
267
|
: {}),
|
|
268
|
+
...(AT_PATH_FILE_COMMAND_FLAGS.has(`${command}:${contract.flag}`)
|
|
269
|
+
? { file_token_prefix: "@" }
|
|
270
|
+
: {}),
|
|
246
271
|
};
|
|
247
272
|
}
|
|
248
273
|
/** Enrich a complete command flag table without mutating package-owned rows. */
|
|
@@ -317,4 +342,4 @@ export function verifyCliFlagInvocationParity(command, declarations, observation
|
|
|
317
342
|
};
|
|
318
343
|
}
|
|
319
344
|
//# sourceMappingURL=flag-invocation-contracts.js.map
|
|
320
|
-
//# debugId=
|
|
345
|
+
//# debugId=7ef5cc14-ad6b-5cce-a1a1-e5cfac85fbc2
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** Generated partition 1 of the exhaustive error-code catalog. */
|
|
2
2
|
|
|
3
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
3
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="030027d7-2703-56ea-9235-64bc602a25c3")}catch(e){}}();
|
|
4
4
|
export const PM_ERROR_CODE_CATALOG_PART_1 = [
|
|
5
5
|
{
|
|
6
6
|
code: "acceptance_criteria_mutation_conflict",
|
|
@@ -218,6 +218,51 @@ export const PM_ERROR_CODE_CATALOG_PART_1 = [
|
|
|
218
218
|
canonical_code: "budget_exceeded",
|
|
219
219
|
aliases: [],
|
|
220
220
|
},
|
|
221
|
+
{
|
|
222
|
+
code: "bulk_ids_input_empty",
|
|
223
|
+
meaning: "Bulk ids input empty condition.",
|
|
224
|
+
stability: "provisional",
|
|
225
|
+
exit_code: 2,
|
|
226
|
+
class: "usage",
|
|
227
|
+
recovery: "Inspect the structured error guidance and retry the suggested command.",
|
|
228
|
+
sources: ["core/io/bulk-ids-input.ts", "sdk/history-compact.ts", "sdk/history-mcp.ts"],
|
|
229
|
+
emitting_commands: ["*"],
|
|
230
|
+
canonical_code: "bulk_ids_input_empty",
|
|
231
|
+
aliases: [],
|
|
232
|
+
owned_states: [
|
|
233
|
+
{ state: "bulk_ids_stdin_contains_no_nonempty_ids", probe_id: "bulk-ids-stdin-empty", entrypoints: ["update-many"], expected_exit_class: "usage" },
|
|
234
|
+
],
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
code: "bulk_ids_input_missing_path",
|
|
238
|
+
meaning: "Bulk ids input missing path condition.",
|
|
239
|
+
stability: "provisional",
|
|
240
|
+
exit_code: 2,
|
|
241
|
+
class: "usage",
|
|
242
|
+
recovery: "Inspect the structured error guidance and retry the suggested command.",
|
|
243
|
+
sources: ["core/io/bulk-ids-input.ts"],
|
|
244
|
+
emitting_commands: ["*"],
|
|
245
|
+
canonical_code: "bulk_ids_input_missing_path",
|
|
246
|
+
aliases: [],
|
|
247
|
+
owned_states: [
|
|
248
|
+
{ state: "bulk_ids_file_token_omits_its_path", probe_id: "bulk-ids-file-path-missing", entrypoints: ["update-many"], expected_exit_class: "usage" },
|
|
249
|
+
],
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
code: "bulk_ids_input_unreadable",
|
|
253
|
+
meaning: "Bulk ids input unreadable condition.",
|
|
254
|
+
stability: "provisional",
|
|
255
|
+
exit_code: 3,
|
|
256
|
+
class: "not_found",
|
|
257
|
+
recovery: "Inspect the structured error guidance and retry the suggested command.",
|
|
258
|
+
sources: ["core/io/bulk-ids-input.ts"],
|
|
259
|
+
emitting_commands: ["*"],
|
|
260
|
+
canonical_code: "bulk_ids_input_unreadable",
|
|
261
|
+
aliases: [],
|
|
262
|
+
owned_states: [
|
|
263
|
+
{ state: "bulk_ids_file_path_cannot_be_read", probe_id: "bulk-ids-file-unreadable", entrypoints: ["update-many"], expected_exit_class: "not_found" },
|
|
264
|
+
],
|
|
265
|
+
},
|
|
221
266
|
{
|
|
222
267
|
code: "bundle_integrity_torn_install",
|
|
223
268
|
meaning: "Bundle integrity torn install condition.",
|
|
@@ -1896,6 +1941,30 @@ export const PM_ERROR_CODE_CATALOG_PART_1 = [
|
|
|
1896
1941
|
canonical_code: "manifest_unknown_key",
|
|
1897
1942
|
aliases: [],
|
|
1898
1943
|
},
|
|
1944
|
+
{
|
|
1945
|
+
code: "mcp_annotation_file_unavailable",
|
|
1946
|
+
meaning: "Mcp annotation file unavailable condition.",
|
|
1947
|
+
stability: "provisional",
|
|
1948
|
+
exit_code: 2,
|
|
1949
|
+
class: "usage",
|
|
1950
|
+
recovery: "Inspect the structured error guidance and retry the suggested command.",
|
|
1951
|
+
sources: ["sdk/runtime-input.ts"],
|
|
1952
|
+
emitting_commands: ["*"],
|
|
1953
|
+
canonical_code: "mcp_annotation_file_unavailable",
|
|
1954
|
+
aliases: [],
|
|
1955
|
+
},
|
|
1956
|
+
{
|
|
1957
|
+
code: "mcp_stdin_unavailable",
|
|
1958
|
+
meaning: "Mcp stdin unavailable condition.",
|
|
1959
|
+
stability: "provisional",
|
|
1960
|
+
exit_code: 2,
|
|
1961
|
+
class: "usage",
|
|
1962
|
+
recovery: "Inspect the structured error guidance and retry the suggested command.",
|
|
1963
|
+
sources: ["sdk/annotations.ts"],
|
|
1964
|
+
emitting_commands: ["*"],
|
|
1965
|
+
canonical_code: "mcp_stdin_unavailable",
|
|
1966
|
+
aliases: [],
|
|
1967
|
+
},
|
|
1899
1968
|
{
|
|
1900
1969
|
code: "merge_conflict_markers_detected",
|
|
1901
1970
|
meaning: "Merge conflict markers detected condition.",
|
|
@@ -1980,42 +2049,6 @@ export const PM_ERROR_CODE_CATALOG_PART_1 = [
|
|
|
1980
2049
|
canonical_code: "missing_budget",
|
|
1981
2050
|
aliases: [],
|
|
1982
2051
|
},
|
|
1983
|
-
{
|
|
1984
|
-
code: "missing_cli_flag",
|
|
1985
|
-
meaning: "Missing cli flag condition.",
|
|
1986
|
-
stability: "provisional",
|
|
1987
|
-
exit_code: 1,
|
|
1988
|
-
class: "generic_failure",
|
|
1989
|
-
recovery: "Inspect the structured error guidance and retry the suggested command.",
|
|
1990
|
-
sources: ["sdk/cli-contracts/tool-option-contracts.ts"],
|
|
1991
|
-
emitting_commands: ["*"],
|
|
1992
|
-
canonical_code: "missing_cli_flag",
|
|
1993
|
-
aliases: [],
|
|
1994
|
-
},
|
|
1995
|
-
{
|
|
1996
|
-
code: "missing_destination",
|
|
1997
|
-
meaning: "Missing destination condition.",
|
|
1998
|
-
stability: "provisional",
|
|
1999
|
-
exit_code: 1,
|
|
2000
|
-
class: "generic_failure",
|
|
2001
|
-
recovery: "Inspect the structured error guidance and retry the suggested command.",
|
|
2002
|
-
sources: ["sdk/cli-contracts/grammar-contracts.ts"],
|
|
2003
|
-
emitting_commands: ["*"],
|
|
2004
|
-
canonical_code: "missing_destination",
|
|
2005
|
-
aliases: [],
|
|
2006
|
-
},
|
|
2007
|
-
{
|
|
2008
|
-
code: "missing_directory",
|
|
2009
|
-
meaning: "Missing directory condition.",
|
|
2010
|
-
stability: "stable",
|
|
2011
|
-
exit_code: 1,
|
|
2012
|
-
class: "generic_failure",
|
|
2013
|
-
recovery: "Inspect the structured error guidance and retry the suggested command.",
|
|
2014
|
-
sources: ["core/diagnostics/remediation.ts"],
|
|
2015
|
-
emitting_commands: ["*"],
|
|
2016
|
-
canonical_code: "missing_directory",
|
|
2017
|
-
aliases: [],
|
|
2018
|
-
},
|
|
2019
2052
|
];
|
|
2020
2053
|
//# sourceMappingURL=generated-error-code-catalog-part-1.js.map
|
|
2021
|
-
//# debugId=
|
|
2054
|
+
//# debugId=030027d7-2703-56ea-9235-64bc602a25c3
|
|
@@ -1,7 +1,43 @@
|
|
|
1
1
|
/** Generated partition 2 of the exhaustive error-code catalog. */
|
|
2
2
|
|
|
3
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
3
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="8724f8ed-1236-5779-9e97-dc4b35866839")}catch(e){}}();
|
|
4
4
|
export const PM_ERROR_CODE_CATALOG_PART_2 = [
|
|
5
|
+
{
|
|
6
|
+
code: "missing_cli_flag",
|
|
7
|
+
meaning: "Missing cli flag condition.",
|
|
8
|
+
stability: "provisional",
|
|
9
|
+
exit_code: 1,
|
|
10
|
+
class: "generic_failure",
|
|
11
|
+
recovery: "Inspect the structured error guidance and retry the suggested command.",
|
|
12
|
+
sources: ["sdk/cli-contracts/tool-option-contracts.ts"],
|
|
13
|
+
emitting_commands: ["*"],
|
|
14
|
+
canonical_code: "missing_cli_flag",
|
|
15
|
+
aliases: [],
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
code: "missing_destination",
|
|
19
|
+
meaning: "Missing destination condition.",
|
|
20
|
+
stability: "provisional",
|
|
21
|
+
exit_code: 1,
|
|
22
|
+
class: "generic_failure",
|
|
23
|
+
recovery: "Inspect the structured error guidance and retry the suggested command.",
|
|
24
|
+
sources: ["sdk/cli-contracts/grammar-contracts.ts"],
|
|
25
|
+
emitting_commands: ["*"],
|
|
26
|
+
canonical_code: "missing_destination",
|
|
27
|
+
aliases: [],
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
code: "missing_directory",
|
|
31
|
+
meaning: "Missing directory condition.",
|
|
32
|
+
stability: "stable",
|
|
33
|
+
exit_code: 1,
|
|
34
|
+
class: "generic_failure",
|
|
35
|
+
recovery: "Inspect the structured error guidance and retry the suggested command.",
|
|
36
|
+
sources: ["core/diagnostics/remediation.ts"],
|
|
37
|
+
emitting_commands: ["*"],
|
|
38
|
+
canonical_code: "missing_directory",
|
|
39
|
+
aliases: [],
|
|
40
|
+
},
|
|
5
41
|
{
|
|
6
42
|
code: "missing_init_recovery",
|
|
7
43
|
meaning: "Missing init recovery condition.",
|
|
@@ -2039,4 +2075,4 @@ export const PM_ERROR_CODE_CATALOG_PART_2 = [
|
|
|
2039
2075
|
},
|
|
2040
2076
|
];
|
|
2041
2077
|
//# sourceMappingURL=generated-error-code-catalog-part-2.js.map
|
|
2042
|
-
//# debugId=
|
|
2078
|
+
//# debugId=8724f8ed-1236-5779-9e97-dc4b35866839
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module cli/guide-topics
|
|
3
|
-
*
|
|
4
|
-
* Provides CLI runtime support for Guide Topics.
|
|
5
|
-
*/
|
|
6
1
|
/** Describes one documentation file surfaced by a progressive-disclosure guide topic. */
|
|
7
2
|
export interface GuideDocReference {
|
|
8
3
|
/** Filesystem path used for path resolution. */
|
package/dist/sdk/guide-topics.js
CHANGED
|
@@ -1,9 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module cli/guide-topics
|
|
3
|
+
*
|
|
4
|
+
* Provides CLI runtime support for Guide Topics.
|
|
5
|
+
*/
|
|
1
6
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
7
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="3e5f92c9-c299-592d-a7ab-a6f9998159f0")}catch(e){}}();
|
|
8
|
+
import { listPmCommandCapabilityGroups } from "./agent-capability-contracts.js";
|
|
3
9
|
function normalizeTopicToken(value) {
|
|
4
10
|
return value.trim().toLowerCase().replaceAll("_", "-");
|
|
5
11
|
}
|
|
6
12
|
const GUIDE_TOPICS = [
|
|
13
|
+
{
|
|
14
|
+
id: "capabilities",
|
|
15
|
+
aliases: ["capability-map", "families", "routing"],
|
|
16
|
+
title: "Generated Capability Routing",
|
|
17
|
+
summary: "Route work through command families generated from the canonical agent capability contract.",
|
|
18
|
+
intent: "Use this as the drift-free entrypoint when selecting a CLI, MCP, completion, documentation, or extension command surface.",
|
|
19
|
+
commands: listPmCommandCapabilityGroups().flatMap(({ commands }) => commands.map((command) => `pm ${command}`)),
|
|
20
|
+
workflows: [],
|
|
21
|
+
docs: [
|
|
22
|
+
{
|
|
23
|
+
path: "docs/generated/AGENT_CAPABILITY_ROUTING.md",
|
|
24
|
+
purpose: "Generated command-to-family routing table.",
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
path: "docs/generated/AGENT_COMMAND_SURFACE.md",
|
|
28
|
+
purpose: "Generated visibility-tier and family table.",
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
related: ["commands", "workflows", "extensions"],
|
|
32
|
+
},
|
|
7
33
|
{
|
|
8
34
|
id: "quickstart",
|
|
9
35
|
aliases: ["start", "getting-started", "bootstrap"],
|
|
@@ -565,4 +591,4 @@ export function resolveGuideTopic(rawTopic) {
|
|
|
565
591
|
return TOPIC_BY_TOKEN.get(normalized) ?? null;
|
|
566
592
|
}
|
|
567
593
|
//# sourceMappingURL=guide-topics.js.map
|
|
568
|
-
//# debugId=
|
|
594
|
+
//# debugId=3e5f92c9-c299-592d-a7ab-a6f9998159f0
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type HistoryCompactBulkSkipReason, type HistoryCompactScope } from "../core/history/history-compact-bulk.js";
|
|
2
|
+
import { type BulkIdsValue } from "../core/io/bulk-ids-input.js";
|
|
2
3
|
import type { GlobalOptions } from "../core/shared/command-types.js";
|
|
3
4
|
/** Documents the history compact command options payload exchanged by command, SDK, and package integrations. */
|
|
4
5
|
export interface HistoryCompactCommandOptions {
|
|
@@ -58,7 +59,7 @@ export declare const HISTORY_COMPACT_BULK_DEFAULT_MIN_ENTRIES = 3;
|
|
|
58
59
|
/** Documents the bulk history compact command options payload exchanged by command, SDK, and package integrations. */
|
|
59
60
|
export interface HistoryCompactBulkCommandOptions {
|
|
60
61
|
/** Value that configures or reports ids for this contract. */
|
|
61
|
-
ids?:
|
|
62
|
+
ids?: BulkIdsValue;
|
|
62
63
|
/** Value that configures or reports scope for this contract. */
|
|
63
64
|
scope?: HistoryCompactScope;
|
|
64
65
|
/** Value that configures or reports all over for this contract. */
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Implements the pm history compact command surface and its agent-facing runtime behavior.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
7
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="31152621-df59-54a5-a28d-63119e734e6e")}catch(e){}}();
|
|
8
8
|
import { assertInitializedTracker } from "./environment/tracker-preflight.js";
|
|
9
9
|
import fs from "node:fs/promises";
|
|
10
10
|
import path from "node:path";
|
|
@@ -19,6 +19,7 @@ import { lifecycleClassifierFromStatusRegistry } from "../core/governance/metada
|
|
|
19
19
|
import { resolveRuntimeStatusRegistry } from "../core/schema/runtime-schema.js";
|
|
20
20
|
import { listAllItemMetadataLight } from "../core/store/item-store.js";
|
|
21
21
|
import { pathExists, readFileIfExists } from "../core/fs/fs-utils.js";
|
|
22
|
+
import { normalizeBulkIdsValue, parseBulkIdsText, } from "../core/io/bulk-ids-input.js";
|
|
22
23
|
import { EXIT_CODE } from "../core/shared/constants.js";
|
|
23
24
|
import { PmCliError } from "../core/shared/errors.js";
|
|
24
25
|
import { nowIso } from "../core/shared/time.js";
|
|
@@ -301,6 +302,21 @@ export async function runHistoryCompact(id, options, global) {
|
|
|
301
302
|
}
|
|
302
303
|
/** Default entry floor below which a stream is treated as already compact. */
|
|
303
304
|
export const HISTORY_COMPACT_BULK_DEFAULT_MIN_ENTRIES = 3;
|
|
305
|
+
function normalizeHistoryCompactBulkOptions(options) {
|
|
306
|
+
const normalizedIdsText = normalizeBulkIdsValue(options.ids);
|
|
307
|
+
if (options.ids !== undefined && normalizedIdsText === "") {
|
|
308
|
+
throw new PmCliError("history-compact ids requires at least one valid item ID.", EXIT_CODE.USAGE, {
|
|
309
|
+
code: "bulk_ids_input_empty",
|
|
310
|
+
required: "Provide one or more string or finite numeric IDs; non-finite and unsupported selector values are rejected.",
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
return {
|
|
314
|
+
...options,
|
|
315
|
+
ids: normalizedIdsText === undefined
|
|
316
|
+
? undefined
|
|
317
|
+
: parseBulkIdsText(normalizedIdsText),
|
|
318
|
+
};
|
|
319
|
+
}
|
|
304
320
|
/** Enforce the `pm history-compact` target contract shared by the CLI and MCP surfaces: exactly one selection mode — a single item `<id>`, an explicit `--ids` list, or a scan selector (`--all-over` / `--closed` / `--all-streams`). */
|
|
305
321
|
export function assertHistoryCompactTarget(id, bulk) {
|
|
306
322
|
const hasIds = bulk.ids !== undefined && bulk.ids.length > 0;
|
|
@@ -436,6 +452,7 @@ async function runHistoryCompactBulkRow(params) {
|
|
|
436
452
|
* configured policy drives the sweep.
|
|
437
453
|
*/
|
|
438
454
|
export async function runHistoryCompactBulk(options, global) {
|
|
455
|
+
const normalizedOptions = normalizeHistoryCompactBulkOptions(options);
|
|
439
456
|
const pmRoot = resolvePmRoot(process.cwd(), global.path);
|
|
440
457
|
await assertInitializedTracker(pmRoot);
|
|
441
458
|
const settings = await readSettings(pmRoot);
|
|
@@ -445,14 +462,16 @@ export async function runHistoryCompactBulk(options, global) {
|
|
|
445
462
|
settings,
|
|
446
463
|
typeToFolder: typeRegistry.type_to_folder,
|
|
447
464
|
});
|
|
448
|
-
const mode =
|
|
465
|
+
const mode = normalizedOptions.ids !== undefined && normalizedOptions.ids.length > 0
|
|
466
|
+
? "ids"
|
|
467
|
+
: "scan";
|
|
449
468
|
const minEntries = options.minEntries ?? HISTORY_COMPACT_BULK_DEFAULT_MIN_ENTRIES;
|
|
450
469
|
const policy = settings.history.compact_policy;
|
|
451
470
|
const policyThresholdApplied = mode === "scan" && options.allOver === undefined && policy.enabled;
|
|
452
471
|
const allOver = options.allOver ??
|
|
453
472
|
(policyThresholdApplied ? policy.max_entries : undefined);
|
|
454
473
|
const selection = selectHistoryCompactBulkTargets(candidates, {
|
|
455
|
-
ids:
|
|
474
|
+
ids: normalizedOptions.ids,
|
|
456
475
|
scope: options.scope,
|
|
457
476
|
minEntries,
|
|
458
477
|
allOver,
|
|
@@ -469,7 +488,7 @@ export async function runHistoryCompactBulk(options, global) {
|
|
|
469
488
|
for (const row of selection) {
|
|
470
489
|
const outcome = await runHistoryCompactBulkRow({
|
|
471
490
|
row,
|
|
472
|
-
options,
|
|
491
|
+
options: normalizedOptions,
|
|
473
492
|
dryRun,
|
|
474
493
|
global,
|
|
475
494
|
});
|
|
@@ -502,4 +521,4 @@ export async function runHistoryCompactBulk(options, global) {
|
|
|
502
521
|
};
|
|
503
522
|
}
|
|
504
523
|
//# sourceMappingURL=history-compact.js.map
|
|
505
|
-
//# debugId=
|
|
524
|
+
//# debugId=31152621-df59-54a5-a28d-63119e734e6e
|
package/dist/sdk/history-mcp.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="4888a558-7f50-5c28-8e29-fcd19180cbd4")}catch(e){}}();
|
|
3
|
+
import { normalizeBulkIdsValue, parseBulkIdsText, } from "../core/io/bulk-ids-input.js";
|
|
3
4
|
import { EXIT_CODE } from "../core/shared/constants.js";
|
|
4
5
|
import { PmCliError } from "../core/shared/errors.js";
|
|
5
6
|
import { assertHistoryCompactTarget, runHistoryCompact, runHistoryCompactBulk, } from "./history-compact.js";
|
|
@@ -17,14 +18,14 @@ export function runMcpHistoryRepairAction(context) {
|
|
|
17
18
|
/** Dispatch single or bounded bulk history compaction from an MCP payload. */
|
|
18
19
|
export function runMcpHistoryCompactAction(context) {
|
|
19
20
|
const idsSource = context.options.ids;
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
21
|
+
const normalizedIds = normalizeBulkIdsValue(idsSource);
|
|
22
|
+
if (idsSource !== undefined && normalizedIds === "") {
|
|
23
|
+
throw new PmCliError("history-compact ids requires at least one valid item ID.", EXIT_CODE.USAGE, {
|
|
24
|
+
code: "bulk_ids_input_empty",
|
|
25
|
+
required: "Provide one or more string or finite numeric IDs; non-finite and unsupported selector values are rejected.",
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
const ids = normalizedIds === undefined ? undefined : parseBulkIdsText(normalizedIds);
|
|
28
29
|
const allOver = parseRuntimeInteger(context.options.allOver ?? context.options.all_over, "history-compact allOver");
|
|
29
30
|
const minEntries = parseRuntimeInteger(context.options.minEntries ?? context.options.min_entries, "history-compact minEntries");
|
|
30
31
|
const explicitScope = readRuntimeString(context.options, "scope");
|
|
@@ -65,4 +66,4 @@ export function runMcpHistoryCompactAction(context) {
|
|
|
65
66
|
}, context.global);
|
|
66
67
|
}
|
|
67
68
|
//# sourceMappingURL=history-mcp.js.map
|
|
68
|
-
//# debugId=
|
|
69
|
+
//# debugId=4888a558-7f50-5c28-8e29-fcd19180cbd4
|
package/dist/sdk/index.d.ts
CHANGED
|
@@ -124,6 +124,7 @@ export * from "./error-runtime.js";
|
|
|
124
124
|
export * from "./error-code-catalog.js";
|
|
125
125
|
export * from "./generated-error-code-catalog.js";
|
|
126
126
|
export * from "./agent/refusal-reachability.js";
|
|
127
|
+
export * from "./agent/refusal-closure-census.js";
|
|
127
128
|
export * from "./agent/refusal-closure.js";
|
|
128
129
|
export * from "./agent/closed-domain-contracts.js";
|
|
129
130
|
export * from "./agent/refusal-corpus-contracts.js";
|
package/dist/sdk/index.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Defines public SDK APIs and package-author helpers for Index.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
7
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="805c081a-a781-50c3-8919-81492208913b")}catch(e){}}();
|
|
8
8
|
export { PM_COMMAND_CAPABILITY_CONTRACTS, PM_COMMAND_VISIBILITY_CONTRACTS, PM_MCP_PROMPT_CONTRACTS, PM_MCP_RESOURCE_CONTRACTS, PM_MCP_TOOL_COMMAND_CONTRACTS, listPmCommandsForFamily, listPmCommandsForTier, listPmMcpToolsForProfile, renderPmCommandVisibilityMarkdown, resolvePmCommandCapabilityFamily, resolvePmCommandVisibilityTier, } from "./agent-capability-contracts.js";
|
|
9
9
|
export * from "./cli-contracts/grammar-contracts.js";
|
|
10
10
|
export * from "./agent-session-context.js";
|
|
@@ -121,6 +121,7 @@ export * from "./error-runtime.js";
|
|
|
121
121
|
export * from "./error-code-catalog.js";
|
|
122
122
|
export * from "./generated-error-code-catalog.js";
|
|
123
123
|
export * from "./agent/refusal-reachability.js";
|
|
124
|
+
export * from "./agent/refusal-closure-census.js";
|
|
124
125
|
export * from "./agent/refusal-closure.js";
|
|
125
126
|
export * from "./agent/closed-domain-contracts.js";
|
|
126
127
|
export * from "./agent/refusal-corpus-contracts.js";
|
|
@@ -166,4 +167,4 @@ export * from "./governance.js";
|
|
|
166
167
|
export * from "./query.js";
|
|
167
168
|
export * from "./testing.js";
|
|
168
169
|
//# sourceMappingURL=index.js.map
|
|
169
|
-
//# debugId=
|
|
170
|
+
//# debugId=805c081a-a781-50c3-8919-81492208913b
|
|
@@ -6,15 +6,22 @@
|
|
|
6
6
|
* with correct-by-construction inspection and compensation wiring.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
9
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="ea10685a-3187-533c-9699-73c23d377705")}catch(e){}}();
|
|
10
10
|
import crypto from "node:crypto";
|
|
11
11
|
import path from "node:path";
|
|
12
|
+
import { transferMutationStdinTokenPolicy, } from "../core/item/parse.js";
|
|
12
13
|
import { EXIT_CODE } from "../core/shared/constants.js";
|
|
13
14
|
import { PmCliError } from "../core/shared/errors.js";
|
|
14
15
|
import { stableStringify } from "../core/shared/serialization.js";
|
|
15
16
|
import { readHistoryEntries } from "./history-read.js";
|
|
16
17
|
import { close, create, deleteItem, get, release, restore, update, } from "./runtime.js";
|
|
17
18
|
import { commitWorkspaceTransaction, } from "./workspace-transaction.js";
|
|
19
|
+
function mergeTransactionMutationOptions(source, additions) {
|
|
20
|
+
const merged = { ...source, ...additions };
|
|
21
|
+
return source === undefined
|
|
22
|
+
? merged
|
|
23
|
+
: transferMutationStdinTokenPolicy(source, merged);
|
|
24
|
+
}
|
|
18
25
|
/** Read one item's transaction-relevant fields, mapping not-found to undefined. */
|
|
19
26
|
async function readItemSnapshot(pmRoot, id) {
|
|
20
27
|
try {
|
|
@@ -112,7 +119,10 @@ function buildCreateStep(config, mutation, stepId) {
|
|
|
112
119
|
return { state: "applied", result: { id: snapshot.id, op: "create" } };
|
|
113
120
|
},
|
|
114
121
|
async apply() {
|
|
115
|
-
const created = await create(
|
|
122
|
+
const created = await create(mergeTransactionMutationOptions(mutation.options, {
|
|
123
|
+
author: config.author,
|
|
124
|
+
id: mutation.id,
|
|
125
|
+
}), { pmRoot: config.pmRoot });
|
|
116
126
|
const createdItem = created.item;
|
|
117
127
|
return { id: String(createdItem.id), op: "create" };
|
|
118
128
|
},
|
|
@@ -155,11 +165,10 @@ function buildUpdateStep(config, mutation, stepId) {
|
|
|
155
165
|
return prepareRestoreCompensation(config.pmRoot, mutation);
|
|
156
166
|
},
|
|
157
167
|
async apply() {
|
|
158
|
-
const updated = await update(mutation.id, {
|
|
159
|
-
...mutation.options,
|
|
168
|
+
const updated = await update(mutation.id, mergeTransactionMutationOptions(mutation.options, {
|
|
160
169
|
author: config.author,
|
|
161
170
|
message: bulkHistoryMarker(config.transactionId, stepId, "apply"),
|
|
162
|
-
}, { pmRoot: config.pmRoot });
|
|
171
|
+
}), { pmRoot: config.pmRoot });
|
|
163
172
|
const updatedItem = updated.item;
|
|
164
173
|
return { id: String(updatedItem.id), op: "update" };
|
|
165
174
|
},
|
|
@@ -191,11 +200,10 @@ function buildCloseStep(config, mutation, stepId) {
|
|
|
191
200
|
return prepareRestoreCompensation(config.pmRoot, mutation);
|
|
192
201
|
},
|
|
193
202
|
async apply() {
|
|
194
|
-
const closed = await close(mutation.id, mutation.reason, {
|
|
195
|
-
...mutation.options,
|
|
203
|
+
const closed = await close(mutation.id, mutation.reason, mergeTransactionMutationOptions(mutation.options, {
|
|
196
204
|
author: config.author,
|
|
197
205
|
message: bulkHistoryMarker(config.transactionId, stepId, "apply"),
|
|
198
|
-
}, { pmRoot: config.pmRoot });
|
|
206
|
+
}), { pmRoot: config.pmRoot });
|
|
199
207
|
const closedItem = closed.item;
|
|
200
208
|
return { id: String(closedItem.id), op: "close" };
|
|
201
209
|
},
|
|
@@ -226,11 +234,10 @@ function buildReleaseStep(config, mutation, stepId) {
|
|
|
226
234
|
return prepareRestoreCompensation(config.pmRoot, mutation);
|
|
227
235
|
},
|
|
228
236
|
async apply() {
|
|
229
|
-
const released = await release(mutation.id, {
|
|
230
|
-
...mutation.options,
|
|
237
|
+
const released = await release(mutation.id, mergeTransactionMutationOptions(mutation.options, {
|
|
231
238
|
author: config.author,
|
|
232
239
|
message: bulkHistoryMarker(config.transactionId, stepId, "apply"),
|
|
233
|
-
}, { pmRoot: config.pmRoot });
|
|
240
|
+
}), { pmRoot: config.pmRoot });
|
|
234
241
|
const releasedItem = released.item;
|
|
235
242
|
return { id: String(releasedItem.id), op: "release" };
|
|
236
243
|
},
|
|
@@ -387,4 +394,4 @@ export const _testOnlyItemTransaction = {
|
|
|
387
394
|
readItemSnapshot,
|
|
388
395
|
};
|
|
389
396
|
//# sourceMappingURL=item-transaction.js.map
|
|
390
|
-
//# debugId=
|
|
397
|
+
//# debugId=ea10685a-3187-533c-9699-73c23d377705
|