@unbrained/pm-cli 2026.8.27 → 2026.8.29
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 +49 -1
- package/dist/cli/error-guidance.js +61 -7
- package/dist/cli/register-annotations.js +58 -41
- package/dist/cli-bundle/bundle-manifest.json +142 -142
- package/dist/cli-bundle/chunks/{chunk-TNX6HC54.js → chunk-2MKLQL2E.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-SKXLJIEK.js → chunk-2UETTHY6.js} +49 -49
- package/dist/cli-bundle/chunks/{chunk-SHMDY36D.js → chunk-3TEF3HM5.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-SH6P7FXI.js → chunk-7SKMLSMX.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-7X6OZEIV.js +34 -0
- package/dist/cli-bundle/chunks/{chunk-CVBBGWW5.js → chunk-CMIEDWAY.js} +54 -50
- package/dist/cli-bundle/chunks/{chunk-3OO3W6FW.js → chunk-GNWPTEBW.js} +64 -61
- package/dist/cli-bundle/chunks/chunk-MTTKAUBX.js +2 -0
- package/dist/cli-bundle/chunks/chunk-N6OR6FAR.js +13 -0
- package/dist/cli-bundle/chunks/{chunk-R4ETAOJC.js → chunk-TGNAA66W.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-52EKTW6V.js → chunk-WS2GJQVG.js} +2 -2
- package/dist/cli-bundle/chunks/{register-list-query-EUWM6VII.js → register-list-query-OMKJ5ONN.js} +2 -2
- package/dist/cli-bundle/chunks/{register-mutation-FD4HSAVU.js → register-mutation-QBSNCOY3.js} +4 -4
- package/dist/cli-bundle/chunks/{register-operations-HRMNFEC3.js → register-operations-UC77FQZC.js} +2 -2
- package/dist/cli-bundle/chunks/{register-setup-33GNICLX.js → register-setup-GLQ5SYV3.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-HC7ODMH3.js → chunk-3AVAWVZA.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-3UMBF26I.js +158 -0
- package/dist/cli-bundle/focused-chunks/{chunk-YVVZ3LQ6.js → chunk-73EDXGYE.js} +16 -15
- package/dist/cli-bundle/focused-chunks/{chunk-4BR5UU52.js → chunk-AXZ5AJAF.js} +45 -45
- package/dist/cli-bundle/focused-chunks/{chunk-MXTYGECH.js → chunk-G6PATS5E.js} +3 -3
- package/dist/cli-bundle/focused-chunks/{chunk-SUBSWYW3.js → chunk-JZYPPMXF.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-LLNTHF5X.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-LYFWQMVC.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-RKOKG43G.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-TDK3OCX3.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-EKX37ZHA.js → chunk-THEPQMLX.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-FC2AXLB5.js → chunk-XXOWRJZ5.js} +2 -2
- package/dist/cli-bundle/main.js +14 -14
- package/dist/cli-bundle/sdk-authoring.js +1 -1
- package/dist/cli-bundle/sdk-contracts.js +2 -2
- package/dist/cli-bundle/sdk-core.js +31 -32
- 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 +34 -32
- 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 +10 -10
- package/dist/core/diagnostics/remediation.js +16 -6
- package/dist/core/history/drift-scan.d.ts +2 -0
- package/dist/core/history/drift-scan.js +72 -36
- package/dist/core/history/history.d.ts +3 -3
- package/dist/core/history/history.js +5 -5
- package/dist/core/history/replay.d.ts +1 -1
- package/dist/core/history/replay.js +50 -19
- package/dist/core/item/actionability.d.ts +7 -1
- package/dist/core/item/actionability.js +44 -11
- package/dist/core/item/dependency-reference.d.ts +10 -0
- package/dist/core/item/dependency-reference.js +21 -0
- package/dist/core/item/parse.d.ts +4 -0
- package/dist/core/item/parse.js +38 -16
- package/dist/core/shared/author.js +69 -17
- package/dist/mcp/tool-definitions.js +5 -5
- package/dist/sdk/agent/command-recovery.js +3 -3
- package/dist/sdk/agent/task-transcript-contracts.d.ts +52 -0
- package/dist/sdk/agent/task-transcript-contracts.js +198 -0
- package/dist/sdk/annotations.d.ts +5 -2
- package/dist/sdk/annotations.js +66 -36
- package/dist/sdk/cli-bootstrap.d.ts +2 -8
- package/dist/sdk/cli-bootstrap.js +7 -67
- package/dist/sdk/cli-contracts/bootstrap-command-scanner.d.ts +23 -0
- package/dist/sdk/cli-contracts/bootstrap-command-scanner.js +80 -0
- package/dist/sdk/cli-contracts/flag-contracts.js +5 -2
- package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +5 -5
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +15 -2
- package/dist/sdk/cli-contracts/tool-schema.d.ts +1 -1
- package/dist/sdk/cli-contracts/tool-schema.js +16 -3
- package/dist/sdk/comments.d.ts +4 -0
- package/dist/sdk/comments.js +2 -2
- package/dist/sdk/completion.js +9 -5
- package/dist/sdk/contracts.d.ts +1 -0
- package/dist/sdk/contracts.js +3 -2
- package/dist/sdk/dependency-provenance.d.ts +51 -2
- package/dist/sdk/dependency-provenance.js +91 -7
- package/dist/sdk/extension/install-sources.d.ts +8 -1
- package/dist/sdk/extension/install-sources.js +132 -39
- package/dist/sdk/generated/generated-error-code-catalog-part-1.js +74 -14
- package/dist/sdk/generated/generated-error-code-catalog-part-2.js +86 -38
- package/dist/sdk/governance/health.js +86 -22
- package/dist/sdk/governance/validate-history-drift.js +5 -2
- package/dist/sdk/graph/assembly.js +51 -22
- package/dist/sdk/history-repair.d.ts +1 -1
- package/dist/sdk/history-repair.js +20 -10
- package/dist/sdk/index.d.ts +1 -0
- package/dist/sdk/index.js +3 -2
- package/dist/sdk/learnings.d.ts +4 -0
- package/dist/sdk/learnings.js +7 -4
- package/dist/sdk/lifecycle/close.js +4 -3
- package/dist/sdk/lifecycle/create.js +43 -19
- package/dist/sdk/linked-artifacts.js +21 -31
- package/dist/sdk/merge/reconcile.js +3 -16
- package/dist/sdk/notes.d.ts +4 -0
- package/dist/sdk/notes.js +2 -2
- package/dist/sdk/query/next.d.ts +6 -0
- package/dist/sdk/query/next.js +7 -2
- package/dist/sdk/runtime-input.js +5 -2
- package/dist/sdk/runtime.d.ts +6 -6
- package/dist/sdk/runtime.js +8 -8
- package/dist/sdk/test/entry.d.ts +1 -1
- package/dist/sdk/test/entry.js +5 -9
- package/dist/sdk/test/execution.d.ts +3 -0
- package/dist/sdk/test/execution.js +54 -13
- package/docs/COMMANDS.md +4 -3
- package/docs/CONTEXT_RECOVERY_PRIMITIVES.md +67 -0
- package/docs/MERGE_SAFETY.md +23 -10
- package/docs/OUTPUT_TOKEN_ACCOUNTING.md +20 -7
- package/docs/README.md +1 -0
- package/docs/RELEASING.md +9 -1
- package/docs/SDK.md +12 -0
- package/docs/SDK_CONTEXT_INTEGRITY.md +12 -1
- package/docs/SDK_RUNTIME_BOUNDARIES.md +10 -0
- package/docs/TESTING.md +6 -2
- package/docs/agent-task-token-baseline.json +97 -11
- package/docs/agent-task-transcripts.json +211 -0
- package/docs/generated/FLAG_LEXICON_BUDGETS.md +3 -3
- package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +13 -4
- package/docs/performance/cli-transport-overhead.md +10 -2
- package/marketplace.json +2 -2
- package/package.json +8 -8
- package/packages/pm-beads/package.json +1 -1
- package/packages/pm-calendar/package.json +1 -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/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/sdk/public-surface.json +297 -36
- package/dist/cli-bundle/chunks/chunk-MFNTKMTI.js +0 -13
- package/dist/cli-bundle/chunks/chunk-OS27HHBN.js +0 -35
- package/dist/cli-bundle/chunks/chunk-QTO7USTH.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-2AGZ5BRT.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-AQ5IYEZZ.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-XDPYBQCF.js +0 -156
- package/dist/cli-bundle/focused-chunks/chunk-Y5A7SJJ7.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-YHWHX6YY.js +0 -2
package/dist/sdk/annotations.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Implements the pm annotation command 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]="6d20a21c-ac67-5712-9f63-b10ffc0e2c64")}catch(e){}}();
|
|
8
8
|
import { assertInitializedTracker } from "./environment/tracker-preflight.js";
|
|
9
9
|
import { readFile } from "node:fs/promises";
|
|
10
10
|
import { isFileAbsentError } from "../core/fs/fs-utils.js";
|
|
@@ -217,6 +217,13 @@ function assertAnnotationAddValueIsNotFlagLike(raw, config) {
|
|
|
217
217
|
* with the same structured recovery bundle.
|
|
218
218
|
*/
|
|
219
219
|
function assertAnnotationMessageHasTextSource(config, options) {
|
|
220
|
+
if (options.ifAbsent === true &&
|
|
221
|
+
!["add", "stdin", "file"].includes(config.input.mode)) {
|
|
222
|
+
throw new PmCliError(`--if-absent requires a ${config.collectionKey.replace(/s$/, "")} append`, EXIT_CODE.USAGE, {
|
|
223
|
+
code: "annotation_if_absent_without_append",
|
|
224
|
+
required: "Combine --if-absent with one append text source; omit it for list, edit, and delete operations.",
|
|
225
|
+
});
|
|
226
|
+
}
|
|
220
227
|
if (config.input.mode !== "list" || options.message === undefined) {
|
|
221
228
|
return;
|
|
222
229
|
}
|
|
@@ -230,6 +237,19 @@ function assertAnnotationMessageHasTextSource(config, options) {
|
|
|
230
237
|
],
|
|
231
238
|
});
|
|
232
239
|
}
|
|
240
|
+
/** Append one annotation entry or return the matching entry for an idempotent retry. */
|
|
241
|
+
function appendAnnotationEntry(document, collectionKey, author, text, ifAbsent, createEntry) {
|
|
242
|
+
const entries = readAnnotationEntries(document.metadata, collectionKey);
|
|
243
|
+
const existingIndex = ifAbsent
|
|
244
|
+
? entries.findIndex((entry) => entry.author === author && entry.text === text)
|
|
245
|
+
: -1;
|
|
246
|
+
if (existingIndex >= 0) {
|
|
247
|
+
return { changedFields: [], entryIndex: existingIndex + 1 };
|
|
248
|
+
}
|
|
249
|
+
entries.push(createEntry({ created_at: nowIso(), author, text }));
|
|
250
|
+
document.metadata[collectionKey] = entries;
|
|
251
|
+
return { changedFields: [collectionKey], entryIndex: entries.length };
|
|
252
|
+
}
|
|
233
253
|
/** Implements run annotation command for the public runtime surface of this module. */
|
|
234
254
|
export async function runAnnotationCommand(id, options, global, config) {
|
|
235
255
|
assertAnnotationMessageHasTextSource(config, options);
|
|
@@ -325,6 +345,7 @@ export async function runAnnotationCommand(id, options, global, config) {
|
|
|
325
345
|
}, options.fullHistory === true);
|
|
326
346
|
}
|
|
327
347
|
let result;
|
|
348
|
+
let entryIndex = 0;
|
|
328
349
|
try {
|
|
329
350
|
result = await mutateItem({
|
|
330
351
|
pmRoot,
|
|
@@ -335,12 +356,11 @@ export async function runAnnotationCommand(id, options, global, config) {
|
|
|
335
356
|
message: options.message,
|
|
336
357
|
force: options.force,
|
|
337
358
|
bypassAssigneeConflict: config.bypassOwnershipConflict,
|
|
359
|
+
skipNoop: options.ifAbsent === true,
|
|
338
360
|
mutate(document) {
|
|
339
|
-
const
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
document.metadata[config.collectionKey] = entries;
|
|
343
|
-
return { changedFields: [config.collectionKey] };
|
|
361
|
+
const appended = appendAnnotationEntry(document, config.collectionKey, author, text, options.ifAbsent === true, config.createEntry);
|
|
362
|
+
entryIndex = appended.entryIndex;
|
|
363
|
+
return { changedFields: appended.changedFields };
|
|
344
364
|
},
|
|
345
365
|
});
|
|
346
366
|
}
|
|
@@ -350,8 +370,11 @@ export async function runAnnotationCommand(id, options, global, config) {
|
|
|
350
370
|
const allEntries = readAnnotationEntries(result.item, config.collectionKey);
|
|
351
371
|
return renderAnnotationResult(result.item.id, config.collectionKey, allEntries, limit, options.includeMeta === true, {
|
|
352
372
|
action: "add",
|
|
353
|
-
entryIndex
|
|
354
|
-
entry: allEntries
|
|
373
|
+
entryIndex,
|
|
374
|
+
entry: allEntries[entryIndex - 1],
|
|
375
|
+
changedCount: options.ifAbsent === true
|
|
376
|
+
? Math.min(result.changedFields.length, 1)
|
|
377
|
+
: undefined,
|
|
355
378
|
}, options.fullHistory === true);
|
|
356
379
|
}
|
|
357
380
|
/** Implements resolve annotation index for the public runtime surface of this module. */
|
|
@@ -367,6 +390,36 @@ export function resolveAnnotationIndex(oneBasedIndex, count, collectionKey) {
|
|
|
367
390
|
}
|
|
368
391
|
return oneBasedIndex - 1;
|
|
369
392
|
}
|
|
393
|
+
/** Build the mutation and omission receipts attached to bounded annotation results. */
|
|
394
|
+
function renderAnnotationMutationReceipts(collectionKey, mutation, historyOmitted) {
|
|
395
|
+
if (mutation === undefined)
|
|
396
|
+
return {};
|
|
397
|
+
return {
|
|
398
|
+
mutation_receipt: {
|
|
399
|
+
action: mutation.action,
|
|
400
|
+
entry_index: mutation.entryIndex,
|
|
401
|
+
changed_count: mutation.changedCount ?? 1,
|
|
402
|
+
full_history_included: !historyOmitted,
|
|
403
|
+
},
|
|
404
|
+
omission_receipt: {
|
|
405
|
+
has_omissions: historyOmitted,
|
|
406
|
+
omitted_field_group_count: historyOmitted ? 1 : 0,
|
|
407
|
+
omitted_field_groups: historyOmitted
|
|
408
|
+
? [
|
|
409
|
+
{
|
|
410
|
+
name: `${collectionKey}_history`,
|
|
411
|
+
restore_with: {
|
|
412
|
+
selector: "full_history",
|
|
413
|
+
cli_flag: "--full-history",
|
|
414
|
+
sdk_option: "fullHistory",
|
|
415
|
+
mcp_option: "full",
|
|
416
|
+
},
|
|
417
|
+
},
|
|
418
|
+
]
|
|
419
|
+
: [],
|
|
420
|
+
},
|
|
421
|
+
};
|
|
422
|
+
}
|
|
370
423
|
function renderAnnotationResult(id, collectionKey, allEntries, limit, includeMeta, mutation, fullHistory = false) {
|
|
371
424
|
const entries = mutation === undefined || fullHistory
|
|
372
425
|
? limitAnnotationEntries(allEntries, mutation !== undefined && fullHistory ? undefined : limit)
|
|
@@ -378,6 +431,9 @@ function renderAnnotationResult(id, collectionKey, allEntries, limit, includeMet
|
|
|
378
431
|
id,
|
|
379
432
|
[collectionKey]: entries,
|
|
380
433
|
count: entries.length,
|
|
434
|
+
...(mutation?.changedCount === undefined
|
|
435
|
+
? {}
|
|
436
|
+
: { changed: mutation.changedCount === 1 }),
|
|
381
437
|
...([includeMeta, mutation !== undefined].includes(true)
|
|
382
438
|
? {
|
|
383
439
|
total_count: allEntries.length,
|
|
@@ -386,34 +442,8 @@ function renderAnnotationResult(id, collectionKey, allEntries, limit, includeMet
|
|
|
386
442
|
...(limit !== undefined ? { limit } : {}),
|
|
387
443
|
}
|
|
388
444
|
: {}),
|
|
389
|
-
...(mutation
|
|
390
|
-
? {}
|
|
391
|
-
: {
|
|
392
|
-
mutation_receipt: {
|
|
393
|
-
action: mutation.action,
|
|
394
|
-
entry_index: mutation.entryIndex,
|
|
395
|
-
changed_count: 1,
|
|
396
|
-
full_history_included: !historyOmitted,
|
|
397
|
-
},
|
|
398
|
-
omission_receipt: {
|
|
399
|
-
has_omissions: historyOmitted,
|
|
400
|
-
omitted_field_group_count: historyOmitted ? 1 : 0,
|
|
401
|
-
omitted_field_groups: historyOmitted
|
|
402
|
-
? [
|
|
403
|
-
{
|
|
404
|
-
name: `${collectionKey}_history`,
|
|
405
|
-
restore_with: {
|
|
406
|
-
selector: "full_history",
|
|
407
|
-
cli_flag: "--full-history",
|
|
408
|
-
sdk_option: "fullHistory",
|
|
409
|
-
mcp_option: "full",
|
|
410
|
-
},
|
|
411
|
-
},
|
|
412
|
-
]
|
|
413
|
-
: [],
|
|
414
|
-
},
|
|
415
|
-
}),
|
|
445
|
+
...renderAnnotationMutationReceipts(collectionKey, mutation, historyOmitted),
|
|
416
446
|
};
|
|
417
447
|
}
|
|
418
448
|
//# sourceMappingURL=annotations.js.map
|
|
419
|
-
//# debugId=
|
|
449
|
+
//# debugId=6d20a21c-ac67-5712-9f63-b10ffc0e2c64
|
|
@@ -53,15 +53,9 @@ export interface BootstrapHelpRequest {
|
|
|
53
53
|
}
|
|
54
54
|
/** Implements parse bootstrap help request for the public runtime surface of this module. */
|
|
55
55
|
export declare function parseBootstrapHelpRequest(argv: string[]): BootstrapHelpRequest;
|
|
56
|
-
/**
|
|
57
|
-
* Index of the command token in argv — the first non-flag token, skipping the
|
|
58
|
-
* value-consuming/global bootstrap flags. Returns undefined when there is none
|
|
59
|
-
* (bare invocation, only global flags, or a leading `--`). Single source of truth
|
|
60
|
-
* for command-position scanning shared by {@link parseBootstrapCommandName} and the
|
|
61
|
-
* command-alias rewrite so their precedence rules can never drift apart.
|
|
62
|
-
*/
|
|
56
|
+
/** Locate the command token after global bootstrap flags and their values. */
|
|
63
57
|
export declare function findBootstrapCommandTokenIndex(argv: string[]): number | undefined;
|
|
64
|
-
/**
|
|
58
|
+
/** Resolve the normalized command name from bootstrap invocation arguments. */
|
|
65
59
|
export declare function parseBootstrapCommandName(argv: string[]): string | undefined;
|
|
66
60
|
/** Implements apply bootstrap pager policy for the public runtime surface of this module. */
|
|
67
61
|
export declare function applyBootstrapPagerPolicy(argv: string[]): () => void;
|
|
@@ -4,24 +4,14 @@
|
|
|
4
4
|
* Provides public bootstrap argument normalization for embedded CLI hosts.
|
|
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]="3d35c0f5-e1b8-5fd8-8fd7-c754a21784a1")}catch(e){}}();
|
|
8
8
|
import { EXECUTABLE_COMMAND_ALIASES, PM_COMMAND_ALIAS_CONTRACTS, renderPmCommandAliasMigrationHint, resolvePmCommandAlias, resolveSubcommandFlagContractsForCommand, } from "./cli-contracts.js";
|
|
9
9
|
export { EXECUTABLE_COMMAND_ALIASES, PM_COMMAND_ALIAS_CONTRACTS, renderPmCommandAliasMigrationHint, resolvePmCommandAlias, };
|
|
10
10
|
import { levenshteinDistanceWithinLimit } from "../core/shared/levenshtein.js";
|
|
11
11
|
import { EXIT_CODE } from "../core/shared/constants.js";
|
|
12
12
|
import { PmCliError } from "../core/shared/errors.js";
|
|
13
13
|
import { normalizeItemAddressInvocation } from "./agent/item-addressing.js";
|
|
14
|
-
|
|
15
|
-
"--pm-path",
|
|
16
|
-
"--path",
|
|
17
|
-
"--author",
|
|
18
|
-
"--output-include",
|
|
19
|
-
"--output-limit",
|
|
20
|
-
"--output-budget",
|
|
21
|
-
"--output-format",
|
|
22
|
-
"--output-session",
|
|
23
|
-
"--output-cursor",
|
|
24
|
-
]);
|
|
14
|
+
import { BOOTSTRAP_BOOLEAN_FLAGS, GLOBAL_VALUE_CONSUMING_FLAGS, consumesBootstrapValue, findBootstrapCommandTokenIndex as findContractBootstrapCommandTokenIndex, isInlineGlobalValueToken, parseBootstrapCommandName as parseContractBootstrapCommandName, } from "./cli-contracts/bootstrap-command-scanner.js";
|
|
25
15
|
const OUTPUT_VALUE_FLAGS = new Set([
|
|
26
16
|
"--output-include",
|
|
27
17
|
"--output-limit",
|
|
@@ -30,28 +20,6 @@ const OUTPUT_VALUE_FLAGS = new Set([
|
|
|
30
20
|
"--output-session",
|
|
31
21
|
"--output-cursor",
|
|
32
22
|
]);
|
|
33
|
-
/** Whether a global value-consuming flag uses its inline `--flag=value` form. */
|
|
34
|
-
const isInlineGlobalValueToken = (token) => {
|
|
35
|
-
const equalsIndex = token.indexOf("=");
|
|
36
|
-
return (equalsIndex > 0 &&
|
|
37
|
-
GLOBAL_VALUE_CONSUMING_FLAGS.has(token.slice(0, equalsIndex)));
|
|
38
|
-
};
|
|
39
|
-
/** Whether a bootstrap value flag consumes its following token. */
|
|
40
|
-
const consumesBootstrapValue = (flag, next) => {
|
|
41
|
-
if (typeof next !== "string")
|
|
42
|
-
return false;
|
|
43
|
-
return flag === "--path" || flag === "--pm-path" || !next.startsWith("-");
|
|
44
|
-
};
|
|
45
|
-
const BOOTSTRAP_BOOLEAN_FLAGS = new Set([
|
|
46
|
-
"--no-extensions",
|
|
47
|
-
"--no-pager",
|
|
48
|
-
"--json",
|
|
49
|
-
"--quiet",
|
|
50
|
-
"--lean",
|
|
51
|
-
"--token-accounting",
|
|
52
|
-
"--output-row-contract",
|
|
53
|
-
"--all",
|
|
54
|
-
]);
|
|
55
23
|
/** Consume one bootstrap-global token and update the accumulated parse state. */
|
|
56
24
|
function consumeBootstrapGlobalToken(argv, index, state) {
|
|
57
25
|
const token = argv[index];
|
|
@@ -197,41 +165,13 @@ export function parseBootstrapHelpRequest(argv) {
|
|
|
197
165
|
commandPathTokens,
|
|
198
166
|
};
|
|
199
167
|
}
|
|
200
|
-
/**
|
|
201
|
-
* Index of the command token in argv — the first non-flag token, skipping the
|
|
202
|
-
* value-consuming/global bootstrap flags. Returns undefined when there is none
|
|
203
|
-
* (bare invocation, only global flags, or a leading `--`). Single source of truth
|
|
204
|
-
* for command-position scanning shared by {@link parseBootstrapCommandName} and the
|
|
205
|
-
* command-alias rewrite so their precedence rules can never drift apart.
|
|
206
|
-
*/
|
|
168
|
+
/** Locate the command token after global bootstrap flags and their values. */
|
|
207
169
|
export function findBootstrapCommandTokenIndex(argv) {
|
|
208
|
-
|
|
209
|
-
const token = argv[index];
|
|
210
|
-
if (token === "--") {
|
|
211
|
-
return undefined;
|
|
212
|
-
}
|
|
213
|
-
if (GLOBAL_VALUE_CONSUMING_FLAGS.has(token)) {
|
|
214
|
-
index += consumesBootstrapValue(token, argv[index + 1]) ? 1 : 0;
|
|
215
|
-
continue;
|
|
216
|
-
}
|
|
217
|
-
if (isInlineGlobalValueToken(token) ||
|
|
218
|
-
BOOTSTRAP_BOOLEAN_FLAGS.has(token) ||
|
|
219
|
-
token === "--profile" ||
|
|
220
|
-
token === "--id-only" ||
|
|
221
|
-
token === "--explain") {
|
|
222
|
-
continue;
|
|
223
|
-
}
|
|
224
|
-
if (token.startsWith("-")) {
|
|
225
|
-
continue;
|
|
226
|
-
}
|
|
227
|
-
return index;
|
|
228
|
-
}
|
|
229
|
-
return undefined;
|
|
170
|
+
return findContractBootstrapCommandTokenIndex(argv);
|
|
230
171
|
}
|
|
231
|
-
/**
|
|
172
|
+
/** Resolve the normalized command name from bootstrap invocation arguments. */
|
|
232
173
|
export function parseBootstrapCommandName(argv) {
|
|
233
|
-
|
|
234
|
-
return index === undefined ? undefined : argv[index].trim().toLowerCase();
|
|
174
|
+
return parseContractBootstrapCommandName(argv);
|
|
235
175
|
}
|
|
236
176
|
function shouldDisablePagerForInvocation(argv, bootstrapGlobal) {
|
|
237
177
|
if (bootstrapGlobal.noPager) {
|
|
@@ -896,4 +836,4 @@ export const _testOnly = {
|
|
|
896
836
|
resolveCanonicalFlag,
|
|
897
837
|
};
|
|
898
838
|
//# sourceMappingURL=cli-bootstrap.js.map
|
|
899
|
-
//# debugId=
|
|
839
|
+
//# debugId=3d35c0f5-e1b8-5fd8-8fd7-c754a21784a1
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module sdk/cli-contracts/bootstrap-command-scanner
|
|
3
|
+
*
|
|
4
|
+
* Resolves command position from shell-free argv without loading CLI runtime
|
|
5
|
+
* normalization, error, filesystem, or item-addressing dependencies.
|
|
6
|
+
*/
|
|
7
|
+
/** Global options that consume a following value when one is present. */
|
|
8
|
+
export declare const GLOBAL_VALUE_CONSUMING_FLAGS: Set<string>;
|
|
9
|
+
/** Boolean global options ignored while locating the command token. */
|
|
10
|
+
export declare const BOOTSTRAP_BOOLEAN_FLAGS: Set<string>;
|
|
11
|
+
/** Whether a global value-consuming flag uses its inline `--flag=value` form. */
|
|
12
|
+
export declare function isInlineGlobalValueToken(token: string): boolean;
|
|
13
|
+
/** Whether a bootstrap value flag consumes its following token. */
|
|
14
|
+
export declare function consumesBootstrapValue(flag: string, next: string | undefined): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Locate the first command token after global flags and their values.
|
|
17
|
+
*
|
|
18
|
+
* A leading `--` terminates command discovery. Unknown flags are ignored so
|
|
19
|
+
* later command-specific validation can return the canonical diagnostic.
|
|
20
|
+
*/
|
|
21
|
+
export declare function findBootstrapCommandTokenIndex(argv: readonly string[]): number | undefined;
|
|
22
|
+
/** Resolve the normalized command name from shell-free invocation arguments. */
|
|
23
|
+
export declare function parseBootstrapCommandName(argv: readonly string[]): string | undefined;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module sdk/cli-contracts/bootstrap-command-scanner
|
|
3
|
+
*
|
|
4
|
+
* Resolves command position from shell-free argv without loading CLI runtime
|
|
5
|
+
* normalization, error, filesystem, or item-addressing dependencies.
|
|
6
|
+
*/
|
|
7
|
+
/** Global options that consume a following value when one is present. */
|
|
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]="9d04e30a-caf5-59b4-8853-9df39c1728aa")}catch(e){}}();
|
|
10
|
+
export const GLOBAL_VALUE_CONSUMING_FLAGS = new Set([
|
|
11
|
+
"--pm-path",
|
|
12
|
+
"--path",
|
|
13
|
+
"--author",
|
|
14
|
+
"--output-include",
|
|
15
|
+
"--output-limit",
|
|
16
|
+
"--output-budget",
|
|
17
|
+
"--output-format",
|
|
18
|
+
"--output-session",
|
|
19
|
+
"--output-cursor",
|
|
20
|
+
]);
|
|
21
|
+
/** Boolean global options ignored while locating the command token. */
|
|
22
|
+
export const BOOTSTRAP_BOOLEAN_FLAGS = new Set([
|
|
23
|
+
"--no-extensions",
|
|
24
|
+
"--no-pager",
|
|
25
|
+
"--json",
|
|
26
|
+
"--quiet",
|
|
27
|
+
"--lean",
|
|
28
|
+
"--token-accounting",
|
|
29
|
+
"--output-row-contract",
|
|
30
|
+
"--all",
|
|
31
|
+
]);
|
|
32
|
+
/** Whether a global value-consuming flag uses its inline `--flag=value` form. */
|
|
33
|
+
export function isInlineGlobalValueToken(token) {
|
|
34
|
+
const equalsIndex = token.indexOf("=");
|
|
35
|
+
return (equalsIndex > 0 &&
|
|
36
|
+
GLOBAL_VALUE_CONSUMING_FLAGS.has(token.slice(0, equalsIndex)));
|
|
37
|
+
}
|
|
38
|
+
/** Whether a bootstrap value flag consumes its following token. */
|
|
39
|
+
export function consumesBootstrapValue(flag, next) {
|
|
40
|
+
if (typeof next !== "string")
|
|
41
|
+
return false;
|
|
42
|
+
return flag === "--path" || flag === "--pm-path" || !next.startsWith("-");
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Locate the first command token after global flags and their values.
|
|
46
|
+
*
|
|
47
|
+
* A leading `--` terminates command discovery. Unknown flags are ignored so
|
|
48
|
+
* later command-specific validation can return the canonical diagnostic.
|
|
49
|
+
*/
|
|
50
|
+
export function findBootstrapCommandTokenIndex(argv) {
|
|
51
|
+
for (let index = 0; index < argv.length; index += 1) {
|
|
52
|
+
const token = argv[index];
|
|
53
|
+
if (token === "--") {
|
|
54
|
+
return undefined;
|
|
55
|
+
}
|
|
56
|
+
if (GLOBAL_VALUE_CONSUMING_FLAGS.has(token)) {
|
|
57
|
+
index += consumesBootstrapValue(token, argv[index + 1]) ? 1 : 0;
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
if (isInlineGlobalValueToken(token) ||
|
|
61
|
+
BOOTSTRAP_BOOLEAN_FLAGS.has(token) ||
|
|
62
|
+
token === "--profile" ||
|
|
63
|
+
token === "--id-only" ||
|
|
64
|
+
token === "--explain") {
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
if (token.startsWith("-")) {
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
return index;
|
|
71
|
+
}
|
|
72
|
+
return undefined;
|
|
73
|
+
}
|
|
74
|
+
/** Resolve the normalized command name from shell-free invocation arguments. */
|
|
75
|
+
export function parseBootstrapCommandName(argv) {
|
|
76
|
+
const index = findBootstrapCommandTokenIndex(argv);
|
|
77
|
+
return index === undefined ? undefined : argv[index].trim().toLowerCase();
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=bootstrap-command-scanner.js.map
|
|
80
|
+
//# debugId=9d04e30a-caf5-59b4-8853-9df39c1728aa
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* flag surface stays single-sourced across the CLI, SDK, and MCP boundaries.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
!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]="
|
|
10
|
+
!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]="bd6c497f-9fb0-5c47-a677-9dd6636dba02")}catch(e){}}();
|
|
11
11
|
import { normalizeUniqueStringList } from "./string-lists.js";
|
|
12
12
|
import { RESERVED_EXTENSION_HOST_FLAGS } from "../../core/extensions/reserved-host-flags.js";
|
|
13
13
|
import { PM_POSITIONAL_ACTION_CONTRACTS, } from "./grammar-contracts.js";
|
|
@@ -226,6 +226,7 @@ export const COMMENTS_FLAG_CONTRACTS = [
|
|
|
226
226
|
{ flag: "--delete" },
|
|
227
227
|
{ flag: "--limit" },
|
|
228
228
|
{ flag: "--full-history" },
|
|
229
|
+
{ flag: "--if-absent", value_type: "boolean" },
|
|
229
230
|
{ flag: "--author" },
|
|
230
231
|
{ flag: "--message" },
|
|
231
232
|
{ flag: "--force" },
|
|
@@ -249,6 +250,7 @@ export const NOTES_FLAG_CONTRACTS = [
|
|
|
249
250
|
{ flag: "--event-type" },
|
|
250
251
|
{ flag: "--include-meta" },
|
|
251
252
|
{ flag: "--full-history" },
|
|
253
|
+
{ flag: "--if-absent", value_type: "boolean" },
|
|
252
254
|
{ flag: "--author" },
|
|
253
255
|
{ flag: "--message" },
|
|
254
256
|
{ flag: "--force" },
|
|
@@ -259,6 +261,7 @@ export const LEARNINGS_FLAG_CONTRACTS = [
|
|
|
259
261
|
{ flag: "--add", aliases: ["--learning", "--text"] },
|
|
260
262
|
{ flag: "--limit" },
|
|
261
263
|
{ flag: "--full-history" },
|
|
264
|
+
{ flag: "--if-absent", value_type: "boolean" },
|
|
262
265
|
{ flag: "--author" },
|
|
263
266
|
{ flag: "--message" },
|
|
264
267
|
{ flag: "--force" },
|
|
@@ -1912,4 +1915,4 @@ export function toCompletionFlagString(flagContracts, includeGlobal = true) {
|
|
|
1912
1915
|
return normalizeUniqueStringList(all).join(" ");
|
|
1913
1916
|
}
|
|
1914
1917
|
//# sourceMappingURL=flag-contracts.js.map
|
|
1915
|
-
//# debugId=
|
|
1918
|
+
//# debugId=bd6c497f-9fb0-5c47-a677-9dd6636dba02
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* per-command growth budgets.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
!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]="
|
|
8
|
+
!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]="3466866d-8869-5ab6-b981-d084e7330aa5")}catch(e){}}();
|
|
9
9
|
import { hasSubcommandFlagContractsForCommand, resolveSubcommandFlagContractsForCommand, } from "./flag-contracts.js";
|
|
10
10
|
import { PM_COMMAND_CAPABILITY_CONTRACTS, } from "../agent-capability-contracts.js";
|
|
11
11
|
import { enrichCliFlagInvocationContracts } from "../flag-invocation-contracts.js";
|
|
@@ -146,9 +146,9 @@ const PM_COMMAND_FLAG_BUDGET_MAXIMUMS = Object.freeze({
|
|
|
146
146
|
"close-many": 72,
|
|
147
147
|
delete: 24,
|
|
148
148
|
append: 24,
|
|
149
|
-
comments:
|
|
150
|
-
notes:
|
|
151
|
-
learnings:
|
|
149
|
+
comments: 31,
|
|
150
|
+
notes: 35,
|
|
151
|
+
learnings: 27,
|
|
152
152
|
files: 39,
|
|
153
153
|
docs: 30,
|
|
154
154
|
deps: 32,
|
|
@@ -337,4 +337,4 @@ export function renderPmFlagLexiconMarkdown() {
|
|
|
337
337
|
].join("\n");
|
|
338
338
|
}
|
|
339
339
|
//# sourceMappingURL=flag-lexicon-contracts.js.map
|
|
340
|
-
//# debugId=
|
|
340
|
+
//# debugId=3466866d-8869-5ab6-b981-d084e7330aa5
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Defines SDK command-contract metadata for Tool Parameter Tables.
|
|
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]="6968f481-8384-5e3b-8ac0-b0972d08eeb1")}catch(e){}}();
|
|
8
8
|
import { PLAN_HARNESS_VALUES, PLAN_MODE_VALUES, PLAN_STEP_LINK_KIND_VALUES, PLAN_STEP_STATUS_VALUES, } from "../../types/index.js";
|
|
9
9
|
import { PM_READ_OUTPUT_SESSION_MAX_SEEN_ITEM_IDS } from "../read-output-session.js";
|
|
10
10
|
import { ASSURANCE_DEFINITION_SCHEMA } from "./schemas/assurance-definition.js";
|
|
@@ -499,6 +499,7 @@ export const PM_TOOL_PARAMETER_PROPERTIES = {
|
|
|
499
499
|
noCheckpoint: { type: "boolean" },
|
|
500
500
|
force: { type: "boolean" },
|
|
501
501
|
ifAvailable: { type: "boolean" },
|
|
502
|
+
ifAbsent: { type: "boolean" },
|
|
502
503
|
next: { type: "boolean" },
|
|
503
504
|
maxAttempts: {
|
|
504
505
|
anyOf: [
|
|
@@ -1266,6 +1267,9 @@ export const PM_TOOL_PARAMETER_METADATA = {
|
|
|
1266
1267
|
message: {
|
|
1267
1268
|
description: "History message for mutation audit trail.",
|
|
1268
1269
|
},
|
|
1270
|
+
ifAbsent: {
|
|
1271
|
+
description: "For annotations, append only when no existing entry has the same resolved author and exact stored text; retries return changed false without a history event.",
|
|
1272
|
+
},
|
|
1269
1273
|
assignee: {
|
|
1270
1274
|
description: "Assignee identity.",
|
|
1271
1275
|
},
|
|
@@ -2029,11 +2033,17 @@ export const PM_TOOL_ACTION_SCOPED_PARAMETER_METADATA = {
|
|
|
2029
2033
|
full: {
|
|
2030
2034
|
description: "Return the complete post-mutation comment history instead of the bounded mutation receipt projection.",
|
|
2031
2035
|
},
|
|
2036
|
+
ifAbsent: {
|
|
2037
|
+
description: "Append a comment only when the resolved author and exact stored text are absent; a duplicate retry returns changed false without writing history.",
|
|
2038
|
+
},
|
|
2032
2039
|
},
|
|
2033
2040
|
notes: {
|
|
2034
2041
|
full: {
|
|
2035
2042
|
description: "Return the complete post-mutation note history instead of the bounded mutation receipt projection.",
|
|
2036
2043
|
},
|
|
2044
|
+
ifAbsent: {
|
|
2045
|
+
description: "Append a note only when the resolved author and exact stored text are absent; a duplicate retry returns changed false without writing history.",
|
|
2046
|
+
},
|
|
2037
2047
|
since: {
|
|
2038
2048
|
description: "Inclusive ISO 8601 creation timestamp lower bound for structured note event filtering.",
|
|
2039
2049
|
examples: ["2026-01-01T00:00:00.000Z"],
|
|
@@ -2043,6 +2053,9 @@ export const PM_TOOL_ACTION_SCOPED_PARAMETER_METADATA = {
|
|
|
2043
2053
|
full: {
|
|
2044
2054
|
description: "Return the complete post-mutation learning history instead of the bounded mutation receipt projection.",
|
|
2045
2055
|
},
|
|
2056
|
+
ifAbsent: {
|
|
2057
|
+
description: "Append a learning only when the resolved author and exact stored text are absent; a duplicate retry returns changed false without writing history.",
|
|
2058
|
+
},
|
|
2046
2059
|
},
|
|
2047
2060
|
next: {
|
|
2048
2061
|
tag: {
|
|
@@ -2128,4 +2141,4 @@ export const PM_TOOL_ACTION_SCOPED_PARAMETER_METADATA = {
|
|
|
2128
2141
|
},
|
|
2129
2142
|
};
|
|
2130
2143
|
//# sourceMappingURL=tool-parameter-tables.js.map
|
|
2131
|
-
//# debugId=
|
|
2144
|
+
//# debugId=6968f481-8384-5e3b-8ac0-b0972d08eeb1
|
|
@@ -91,7 +91,7 @@ export interface PmActionToolInputSchemaOptions {
|
|
|
91
91
|
*/
|
|
92
92
|
export declare function buildPmActionToolInputSchema(action: PmToolAction, options?: PmActionToolInputSchemaOptions): Record<string, unknown>;
|
|
93
93
|
/** Canonical version of the action-scoped strict MCP tool-parameters schema (`PM_TOOL_PARAMETERS_SCHEMA`). Exported as the single source of truth so the MCP server, the `pm contracts` command, SDK consumers, and contract tests bind to one version constant. Bump the patch/minor for additive, backward-compatible schema changes; bump the MAJOR for breaking changes — the major also drives the `$id` `tool-parameters-v{major}` slug, so the two never drift. */
|
|
94
|
-
export declare const PM_TOOL_PARAMETERS_SCHEMA_VERSION: "4.
|
|
94
|
+
export declare const PM_TOOL_PARAMETERS_SCHEMA_VERSION: "4.10.1";
|
|
95
95
|
/**
|
|
96
96
|
* Major component of {@link PM_TOOL_PARAMETERS_SCHEMA_VERSION}, used to build the
|
|
97
97
|
* schema `$id` slug so a breaking version bump renames the document in lockstep.
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* consumers from a single source of truth.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
!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]="
|
|
10
|
+
!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]="91de08b8-ad0b-5c61-a272-3c18cd3f083b")}catch(e){}}();
|
|
11
11
|
import { normalizeUniqueStringList } from "./string-lists.js";
|
|
12
12
|
import { PM_TOOL_ACTIONS } from "./enum-contracts.js";
|
|
13
13
|
import { TOOL_CREATE_OPTION_CONTRACTS, TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS, TOOL_UPDATE_OPTION_CONTRACTS, TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS, TOOL_CONTEXT_OPTION_CONTRACTS, TOOL_ACTIVITY_OPTION_CONTRACTS, TOOL_LIST_FILTER_OPTION_CONTRACTS, TOOL_AGGREGATE_OPTION_CONTRACTS, TOOL_SEARCH_FILTER_OPTION_CONTRACTS, TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS, } from "./tool-option-contracts.js";
|
|
@@ -850,8 +850,13 @@ const PM_TOOL_ACTION_SCHEMA_CONTRACTS = {
|
|
|
850
850
|
"delete",
|
|
851
851
|
"limit",
|
|
852
852
|
"full",
|
|
853
|
+
"ifAbsent",
|
|
853
854
|
...AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS,
|
|
854
855
|
],
|
|
856
|
+
mutuallyExclusive: [
|
|
857
|
+
["edit", "ifAbsent"],
|
|
858
|
+
["delete", "ifAbsent"],
|
|
859
|
+
],
|
|
855
860
|
},
|
|
856
861
|
notes: {
|
|
857
862
|
required: ["id"],
|
|
@@ -867,6 +872,7 @@ const PM_TOOL_ACTION_SCHEMA_CONTRACTS = {
|
|
|
867
872
|
"eventType",
|
|
868
873
|
"includeMeta",
|
|
869
874
|
"full",
|
|
875
|
+
"ifAbsent",
|
|
870
876
|
...AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS,
|
|
871
877
|
],
|
|
872
878
|
mutuallyExclusive: [
|
|
@@ -875,6 +881,8 @@ const PM_TOOL_ACTION_SCHEMA_CONTRACTS = {
|
|
|
875
881
|
["addJson", "file"],
|
|
876
882
|
["addJson", "edit"],
|
|
877
883
|
["addJson", "delete"],
|
|
884
|
+
["edit", "ifAbsent"],
|
|
885
|
+
["delete", "ifAbsent"],
|
|
878
886
|
],
|
|
879
887
|
},
|
|
880
888
|
learnings: {
|
|
@@ -887,8 +895,13 @@ const PM_TOOL_ACTION_SCHEMA_CONTRACTS = {
|
|
|
887
895
|
"delete",
|
|
888
896
|
"limit",
|
|
889
897
|
"full",
|
|
898
|
+
"ifAbsent",
|
|
890
899
|
...AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS,
|
|
891
900
|
],
|
|
901
|
+
mutuallyExclusive: [
|
|
902
|
+
["edit", "ifAbsent"],
|
|
903
|
+
["delete", "ifAbsent"],
|
|
904
|
+
],
|
|
892
905
|
},
|
|
893
906
|
files: {
|
|
894
907
|
required: [],
|
|
@@ -1534,7 +1547,7 @@ function createLazyContractSchema(build) {
|
|
|
1534
1547
|
});
|
|
1535
1548
|
}
|
|
1536
1549
|
/** Canonical version of the action-scoped strict MCP tool-parameters schema (`PM_TOOL_PARAMETERS_SCHEMA`). Exported as the single source of truth so the MCP server, the `pm contracts` command, SDK consumers, and contract tests bind to one version constant. Bump the patch/minor for additive, backward-compatible schema changes; bump the MAJOR for breaking changes — the major also drives the `$id` `tool-parameters-v{major}` slug, so the two never drift. */
|
|
1537
|
-
export const PM_TOOL_PARAMETERS_SCHEMA_VERSION = "4.
|
|
1550
|
+
export const PM_TOOL_PARAMETERS_SCHEMA_VERSION = "4.10.1";
|
|
1538
1551
|
/**
|
|
1539
1552
|
* Major component of {@link PM_TOOL_PARAMETERS_SCHEMA_VERSION}, used to build the
|
|
1540
1553
|
* schema `$id` slug so a breaking version bump renames the document in lockstep.
|
|
@@ -1616,4 +1629,4 @@ export const _testOnlyCliContracts = {
|
|
|
1616
1629
|
withFlagAliasMetadata,
|
|
1617
1630
|
};
|
|
1618
1631
|
//# sourceMappingURL=tool-schema.js.map
|
|
1619
|
-
//# debugId=
|
|
1632
|
+
//# debugId=91de08b8-ad0b-5c61-a272-3c18cd3f083b
|
package/dist/sdk/comments.d.ts
CHANGED
|
@@ -19,6 +19,8 @@ export interface CommentsCommandOptions {
|
|
|
19
19
|
includeMeta?: boolean;
|
|
20
20
|
/** Return complete comment history after a mutation instead of a bounded receipt. */
|
|
21
21
|
fullHistory?: boolean;
|
|
22
|
+
/** Append only when no comment has the same resolved author and text. */
|
|
23
|
+
ifAbsent?: boolean;
|
|
22
24
|
/** Value that configures or reports author for this contract. */
|
|
23
25
|
author?: string;
|
|
24
26
|
/** Human-readable explanation suitable for logs and agent-facing output. */
|
|
@@ -46,6 +48,8 @@ export interface CommentsResult {
|
|
|
46
48
|
mutation_receipt?: AnnotationMutationReceipt;
|
|
47
49
|
/** Declares whether older comments were withheld from a mutation response. */
|
|
48
50
|
omission_receipt?: AnnotationOmissionReceipt;
|
|
51
|
+
/** Whether a requested mutation changed persisted state. */
|
|
52
|
+
changed?: boolean;
|
|
49
53
|
}
|
|
50
54
|
/** Implements run comments for the public runtime surface of this module. */
|
|
51
55
|
export declare function runComments(id: string, options: CommentsCommandOptions, global: GlobalOptions): Promise<CommentsResult>;
|
package/dist/sdk/comments.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
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]="f761d37b-28df-5176-9e25-762f57aa0abf")}catch(e){}}();
|
|
8
8
|
import { isFileAbsentError } from "../core/fs/fs-utils.js";
|
|
9
9
|
import { readFile } from "node:fs/promises";
|
|
10
10
|
import { EXIT_CODE, PmCliError, createStdinTokenResolver, shouldResolveMutationStdinTokens, } from "./runtime-primitives.js";
|
|
@@ -131,4 +131,4 @@ export async function runComments(id, options, global) {
|
|
|
131
131
|
});
|
|
132
132
|
}
|
|
133
133
|
//# sourceMappingURL=comments.js.map
|
|
134
|
-
//# debugId=
|
|
134
|
+
//# debugId=f761d37b-28df-5176-9e25-762f57aa0abf
|