@unbrained/pm-cli 2026.8.7 → 2026.8.9
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 +54 -0
- package/dist/cli/main.js +4 -3
- package/dist/cli/register-annotations.d.ts +11 -0
- package/dist/cli/register-annotations.js +195 -0
- package/dist/cli/register-history-author.js +7 -30
- package/dist/cli/register-mutation.js +25 -206
- package/dist/cli/runtime-compatibility-boundary.d.ts +17 -0
- package/dist/cli/runtime-compatibility-boundary.js +43 -0
- package/dist/cli-bundle/bundle-manifest.json +158 -694
- package/dist/cli-bundle/chunks/chunk-2DTCZXSD.js +13 -0
- package/dist/cli-bundle/chunks/chunk-5JO6R4BS.js +3 -0
- package/dist/cli-bundle/chunks/chunk-5KN4DZYV.js +194 -0
- package/dist/cli-bundle/chunks/chunk-EF43KODO.js +2 -0
- package/dist/cli-bundle/chunks/chunk-GMX5YOI3.js +77 -0
- package/dist/cli-bundle/chunks/chunk-HUV2Z7IS.js +28 -0
- package/dist/cli-bundle/chunks/chunk-MHBVCUF2.js +2 -0
- package/dist/cli-bundle/chunks/chunk-PYO5GZU6.js +5 -0
- package/dist/cli-bundle/chunks/chunk-QWRRFYK3.js +2 -0
- package/dist/cli-bundle/chunks/chunk-RJC7TPF4.js +8 -0
- package/dist/cli-bundle/chunks/chunk-YC3UF2IO.js +2068 -0
- package/dist/cli-bundle/chunks/{register-list-query-FJZCJ67O.js → register-list-query-BUE7PTCU.js} +8 -8
- package/dist/cli-bundle/chunks/register-mutation-FC3XLVIK.js +20 -0
- package/dist/cli-bundle/chunks/register-operations-YH2WAOXU.js +2 -0
- package/dist/cli-bundle/chunks/register-setup-UQDTNTLJ.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-2VVP5RAA.js +153 -0
- package/dist/cli-bundle/focused-chunks/{chunk-4VJQTS3P.js → chunk-3GSFUDAI.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-3WVHTUAW.js +5 -0
- package/dist/cli-bundle/focused-chunks/chunk-4H6MVCK3.js +16 -0
- package/dist/cli-bundle/focused-chunks/{chunk-73JUDYXT.js → chunk-54TZJ4BM.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-5NK5TJ5D.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-HNL6IFGS.js → chunk-6DO4YQWZ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-73FIJONU.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-TIKDBG4D.js → chunk-C3GCHDSQ.js} +29 -27
- package/dist/cli-bundle/focused-chunks/chunk-JGRSQZJT.js +18 -0
- package/dist/cli-bundle/focused-chunks/{chunk-YZEZAPJK.js → chunk-KNEHLPBF.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-MRWVJ3ZG.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-NL57J7BZ.js +4 -0
- package/dist/cli-bundle/focused-chunks/{chunk-NBJKQP4S.js → chunk-P6BBIQRG.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-QHRTT7WT.js → chunk-PZAGVQNN.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-QDAO3XEK.js +14 -0
- package/dist/cli-bundle/focused-chunks/chunk-T4IGQCSY.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-U46GQJNY.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-RPNYG5MO.js → chunk-VRXJSGIT.js} +6 -6
- package/dist/cli-bundle/focused-chunks/{chunk-R2LEMEV5.js → chunk-XC2ZW3CJ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-ZG54B4XG.js +2 -0
- package/dist/cli-bundle/main.js +13 -13
- 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 +38 -38
- 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 +1 -1
- 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 +2 -1
- package/dist/cli.js +14 -4
- package/dist/core/diagnostics/remediation.js +12 -2
- package/dist/core/history/history.js +13 -4
- package/dist/core/item/actionability.d.ts +7 -1
- package/dist/core/item/actionability.js +71 -15
- package/dist/core/output/output.js +9 -2
- package/dist/core/sentry/helpers.d.ts +10 -0
- package/dist/core/sentry/helpers.js +59 -4
- package/dist/core/shared/author.d.ts +25 -0
- package/dist/core/shared/author.js +114 -9
- package/dist/core/shared/constants.d.ts +2 -0
- package/dist/core/shared/constants.js +4 -2
- package/dist/sdk/actionability.d.ts +1 -1
- package/dist/sdk/actionability.js +3 -3
- package/dist/sdk/annotations.d.ts +40 -0
- package/dist/sdk/annotations.js +61 -9
- package/dist/sdk/author-attribution.d.ts +12 -0
- package/dist/sdk/author-attribution.js +73 -11
- package/dist/sdk/cli-contracts/command-exit-contracts.d.ts +118 -0
- package/dist/sdk/cli-contracts/command-exit-contracts.js +152 -0
- package/dist/sdk/cli-contracts/completeness.js +5 -3
- package/dist/sdk/cli-contracts/flag-contracts.js +5 -2
- package/dist/sdk/cli-contracts/runtime-contracts.d.ts +19 -0
- package/dist/sdk/cli-contracts/runtime-contracts.js +44 -2
- 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 +6 -3
- package/dist/sdk/comments.d.ts +7 -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/core-governance.d.ts +1 -1
- package/dist/sdk/core-governance.js +3 -3
- package/dist/sdk/dependencies.d.ts +2 -0
- package/dist/sdk/dependencies.js +7 -6
- package/dist/sdk/environment/host-environment-errors.d.ts +27 -0
- package/dist/sdk/environment/host-environment-errors.js +124 -0
- package/dist/sdk/environment/project-runtime-compatibility.d.ts +65 -0
- package/dist/sdk/environment/project-runtime-compatibility.js +385 -0
- package/dist/sdk/environment/source-context.d.ts +23 -0
- package/dist/sdk/environment/source-context.js +29 -0
- package/dist/sdk/error-code-catalog.d.ts +6 -0
- package/dist/sdk/error-code-catalog.js +62 -8
- package/dist/sdk/extension/bundled-catalog.js +19 -6
- package/dist/sdk/generated-error-code-catalog.js +665 -3
- package/dist/sdk/governance/health.d.ts +11 -3
- package/dist/sdk/governance/health.js +32 -13
- package/dist/sdk/governance/provenance-health.d.ts +26 -0
- package/dist/sdk/governance/provenance-health.js +139 -0
- package/dist/sdk/governance/validate.js +13 -8
- package/dist/sdk/governance.d.ts +1 -0
- package/dist/sdk/governance.js +3 -2
- package/dist/sdk/graph/assembly.d.ts +4 -0
- package/dist/sdk/graph/assembly.js +22 -2
- package/dist/sdk/graph/run.d.ts +2 -0
- package/dist/sdk/graph/run.js +3 -2
- package/dist/sdk/index.d.ts +7 -3
- package/dist/sdk/index.js +9 -5
- package/dist/sdk/learnings.d.ts +15 -0
- package/dist/sdk/learnings.js +2 -2
- package/dist/sdk/lifecycle/close-many.d.ts +6 -1
- package/dist/sdk/lifecycle/close-many.js +43 -5
- package/dist/sdk/lifecycle/close.js +13 -8
- package/dist/sdk/lifecycle/create.js +6 -12
- package/dist/sdk/lifecycle/plan.js +6 -3
- package/dist/sdk/lifecycle/update-many.d.ts +2 -1
- package/dist/sdk/lifecycle/update-many.js +29 -5
- package/dist/sdk/lifecycle/update.js +6 -20
- package/dist/sdk/merge/driver.d.ts +2 -1
- package/dist/sdk/merge/driver.js +7 -4
- package/dist/sdk/merge/index.d.ts +1 -1
- package/dist/sdk/merge/index.js +3 -3
- package/dist/sdk/merge/install.d.ts +21 -0
- package/dist/sdk/merge/install.js +51 -21
- package/dist/sdk/merge/receipts.d.ts +14 -1
- package/dist/sdk/merge/receipts.js +36 -8
- package/dist/sdk/merge/reconcile.js +21 -4
- package/dist/sdk/merge/three-way.d.ts +6 -2
- package/dist/sdk/merge/three-way.js +24 -10
- package/dist/sdk/notes.d.ts +7 -0
- package/dist/sdk/notes.js +2 -2
- package/dist/sdk/query/get.d.ts +11 -0
- package/dist/sdk/query/get.js +37 -3
- package/dist/sdk/read-output-contracts.d.ts +1 -1
- package/dist/sdk/read-output-contracts.js +103 -5
- package/dist/sdk/relationship-kinds/contract.d.ts +48 -0
- package/dist/sdk/relationship-kinds/contract.js +22 -0
- package/dist/sdk/relationships.d.ts +6 -41
- package/dist/sdk/relationships.js +12 -126
- package/dist/sdk/runtime-primitives.d.ts +1 -1
- package/dist/sdk/runtime-primitives.js +3 -3
- package/dist/sdk/runtime.d.ts +1 -1
- package/dist/sdk/runtime.js +9 -25
- package/dist/sdk/similarity.d.ts +5 -0
- package/dist/sdk/similarity.js +40 -10
- package/dist/sdk/structured-mutations.js +5 -2
- package/dist/sdk/test/execution.js +4 -2
- package/dist/sdk/test/linked-command-detection.d.ts +2 -7
- package/dist/sdk/test/linked-command-detection.js +22 -9
- package/dist/sdk/test/parsers.js +5 -2
- package/dist/sdk/workspace-snapshot.d.ts +9 -0
- package/dist/sdk/workspace-snapshot.js +48 -16
- package/docs/AGENT_GUIDE.md +2 -1
- package/docs/AGENT_RUNTIME_PRIMITIVES.md +11 -4
- package/docs/COMMANDS.md +19 -1
- package/docs/DEPENDENCY_KIND_CONTRACT.md +29 -0
- package/docs/ITEM_READ_PROJECTIONS.md +26 -0
- package/docs/MERGE_SAFETY.md +10 -3
- package/docs/README.md +1 -0
- package/docs/RELATIONSHIP_GRAPH.md +1 -1
- package/docs/RELEASING.md +27 -2
- package/docs/SCRIPTING.md +27 -1
- package/docs/SDK_AGENT_SESSION_CONTEXT.md +35 -2
- package/docs/SDK_CONTEXT_INTEGRITY.md +81 -0
- package/docs/SDK_RUNTIME_BOUNDARIES.md +58 -0
- package/docs/SELF_DESCRIBING_CONTEXT_CONTRACTS.md +13 -0
- package/docs/SENTRY_CONTRACT_EPOCHS.md +20 -0
- package/docs/TESTING.md +17 -0
- package/docs/agent-task-token-baseline.json +2 -2
- package/marketplace.json +2 -2
- package/package.json +5 -3
- 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 +756 -57
- package/dist/cli-bundle/chunks/append-7BXBFDGD.js +0 -2
- package/dist/cli-bundle/chunks/chunk-2AXF3VSK.js +0 -2
- package/dist/cli-bundle/chunks/chunk-2XS43CCV.js +0 -2
- package/dist/cli-bundle/chunks/chunk-3A6KWB72.js +0 -8
- package/dist/cli-bundle/chunks/chunk-3ISTDB42.js +0 -8
- package/dist/cli-bundle/chunks/chunk-4MTI7XOV.js +0 -5
- package/dist/cli-bundle/chunks/chunk-6BX5UDCN.js +0 -3
- package/dist/cli-bundle/chunks/chunk-6QPO7KLR.js +0 -2
- package/dist/cli-bundle/chunks/chunk-7MXHZHSQ.js +0 -5
- package/dist/cli-bundle/chunks/chunk-7ZPMJW4U.js +0 -2
- package/dist/cli-bundle/chunks/chunk-A6KGKEWT.js +0 -2
- package/dist/cli-bundle/chunks/chunk-AGYNSNCI.js +0 -2
- package/dist/cli-bundle/chunks/chunk-B4H7FEFH.js +0 -5
- package/dist/cli-bundle/chunks/chunk-B4KLBBMN.js +0 -2
- package/dist/cli-bundle/chunks/chunk-BXCSXK4J.js +0 -2
- package/dist/cli-bundle/chunks/chunk-CALJHNBL.js +0 -23
- package/dist/cli-bundle/chunks/chunk-CFIGP5LY.js +0 -2
- package/dist/cli-bundle/chunks/chunk-CHOQ2VAW.js +0 -2
- package/dist/cli-bundle/chunks/chunk-CS6MRHG7.js +0 -2
- package/dist/cli-bundle/chunks/chunk-CUGNQQKH.js +0 -2
- package/dist/cli-bundle/chunks/chunk-D4FPS43D.js +0 -164
- package/dist/cli-bundle/chunks/chunk-E2ZSLTOP.js +0 -2
- package/dist/cli-bundle/chunks/chunk-FB7G2HY2.js +0 -2
- package/dist/cli-bundle/chunks/chunk-H5Y5YE6A.js +0 -2
- package/dist/cli-bundle/chunks/chunk-H5Y6UV6E.js +0 -2
- package/dist/cli-bundle/chunks/chunk-H7KGWPDF.js +0 -2
- package/dist/cli-bundle/chunks/chunk-HFSD77TQ.js +0 -2
- package/dist/cli-bundle/chunks/chunk-HX2GTA6L.js +0 -2
- package/dist/cli-bundle/chunks/chunk-J2IEKAVR.js +0 -2
- package/dist/cli-bundle/chunks/chunk-JC6FKIFM.js +0 -2
- package/dist/cli-bundle/chunks/chunk-K44PYFXH.js +0 -2
- package/dist/cli-bundle/chunks/chunk-K4KGEEBT.js +0 -2
- package/dist/cli-bundle/chunks/chunk-KFLK5TRH.js +0 -21
- package/dist/cli-bundle/chunks/chunk-KL6IEBV2.js +0 -2
- package/dist/cli-bundle/chunks/chunk-KWQZDZSS.js +0 -2
- package/dist/cli-bundle/chunks/chunk-KZ4X3DGU.js +0 -3
- package/dist/cli-bundle/chunks/chunk-LD77HJMQ.js +0 -13
- package/dist/cli-bundle/chunks/chunk-LEPJJ6QC.js +0 -2
- package/dist/cli-bundle/chunks/chunk-ME2JJ4LA.js +0 -3
- package/dist/cli-bundle/chunks/chunk-NE5VRDAI.js +0 -2
- package/dist/cli-bundle/chunks/chunk-NFLJ3FHD.js +0 -2
- package/dist/cli-bundle/chunks/chunk-NG6OXIBR.js +0 -19
- package/dist/cli-bundle/chunks/chunk-NYIGHWQY.js +0 -8
- package/dist/cli-bundle/chunks/chunk-NZ75GNSA.js +0 -2
- package/dist/cli-bundle/chunks/chunk-PCJWJNC2.js +0 -2
- package/dist/cli-bundle/chunks/chunk-PD3225AM.js +0 -2
- package/dist/cli-bundle/chunks/chunk-PDEGKG7P.js +0 -2
- package/dist/cli-bundle/chunks/chunk-PIE5HBNA.js +0 -2
- package/dist/cli-bundle/chunks/chunk-PW2H7YJR.js +0 -56
- package/dist/cli-bundle/chunks/chunk-RSIC5OPE.js +0 -2
- package/dist/cli-bundle/chunks/chunk-TPKN3S7S.js +0 -2
- package/dist/cli-bundle/chunks/chunk-TPXAXTCO.js +0 -2
- package/dist/cli-bundle/chunks/chunk-UFWUJO4V.js +0 -2
- package/dist/cli-bundle/chunks/chunk-UQLZQVFW.js +0 -55
- package/dist/cli-bundle/chunks/chunk-VT3Z5G7D.js +0 -2
- package/dist/cli-bundle/chunks/chunk-WOD3WWUN.js +0 -2
- package/dist/cli-bundle/chunks/chunk-WSJEIGJF.js +0 -3
- package/dist/cli-bundle/chunks/chunk-WYNUU7ZW.js +0 -2008
- package/dist/cli-bundle/chunks/chunk-YGPNCCXZ.js +0 -2
- package/dist/cli-bundle/chunks/close-CMY3BAUG.js +0 -2
- package/dist/cli-bundle/chunks/close-many-SA4XZCTK.js +0 -2
- package/dist/cli-bundle/chunks/comments-EZ556ZD3.js +0 -2
- package/dist/cli-bundle/chunks/copy-ZSGPA52X.js +0 -2
- package/dist/cli-bundle/chunks/create-I5DVV4YG.js +0 -2
- package/dist/cli-bundle/chunks/delete-RL3JACSW.js +0 -2
- package/dist/cli-bundle/chunks/deps-S7UBCECS.js +0 -2
- package/dist/cli-bundle/chunks/docs-ZZNVBBYO.js +0 -2
- package/dist/cli-bundle/chunks/files-27C337VT.js +0 -2
- package/dist/cli-bundle/chunks/focus-5Z2SG7LU.js +0 -2
- package/dist/cli-bundle/chunks/history-compact-HJQK67CZ.js +0 -2
- package/dist/cli-bundle/chunks/history-redact-PWC6PDWA.js +0 -2
- package/dist/cli-bundle/chunks/history-repair-N3CY4WBF.js +0 -2
- package/dist/cli-bundle/chunks/learnings-4FH23XDT.js +0 -2
- package/dist/cli-bundle/chunks/profile-5Y5XXH5N.js +0 -2
- package/dist/cli-bundle/chunks/register-mutation-YGYPW3BL.js +0 -20
- package/dist/cli-bundle/chunks/register-operations-WMDSUMQF.js +0 -2
- package/dist/cli-bundle/chunks/register-setup-DL7FFABC.js +0 -2
- package/dist/cli-bundle/chunks/restore-6KYBV5BY.js +0 -2
- package/dist/cli-bundle/chunks/schema-EQGKBYXJ.js +0 -2
- package/dist/cli-bundle/chunks/update-QVTYOD6I.js +0 -2
- package/dist/cli-bundle/chunks/update-many-DJSBU525.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-2ECLECMK.js +0 -12
- package/dist/cli-bundle/focused-chunks/chunk-3K4XV2BF.js +0 -16
- package/dist/cli-bundle/focused-chunks/chunk-4EX25PXM.js +0 -8
- package/dist/cli-bundle/focused-chunks/chunk-CIXVQPB7.js +0 -5
- package/dist/cli-bundle/focused-chunks/chunk-DLTS3IHM.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-DQ6FKGL3.js +0 -14
- package/dist/cli-bundle/focused-chunks/chunk-JLG2C4EQ.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-MHMTKV5V.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-MOTJFQ3F.js +0 -153
- package/dist/cli-bundle/focused-chunks/chunk-RW5IYD4J.js +0 -4
- package/dist/cli-bundle/focused-chunks/chunk-VZFU2R4M.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-ZJIMJHDB.js +0 -2
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* surface without coupling package authors to command-specific option names.
|
|
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]="819ac44d-0add-581c-90e8-ac6e8247b04b")}catch(e){}}();
|
|
9
9
|
import { EXIT_CODE } from "../core/shared/constants.js";
|
|
10
10
|
import { PmCliError } from "../core/shared/errors.js";
|
|
11
11
|
import { compactReadOutputToBudget, updateReadOutputReceiptEstimate, } from "./read-output-budget.js";
|
|
@@ -39,6 +39,7 @@ export const PM_READ_OUTPUT_SURFACES = [
|
|
|
39
39
|
"docs",
|
|
40
40
|
"stats",
|
|
41
41
|
"aggregate",
|
|
42
|
+
"package-manage",
|
|
42
43
|
];
|
|
43
44
|
const READ_OUTPUT_PRECEDENCE = [
|
|
44
45
|
"canonical",
|
|
@@ -126,6 +127,7 @@ const LEGACY_FLAGS_BY_COMMAND = {
|
|
|
126
127
|
docs: {},
|
|
127
128
|
stats: {},
|
|
128
129
|
aggregate: {},
|
|
130
|
+
"package-manage": {},
|
|
129
131
|
};
|
|
130
132
|
const VALUE_BEARING_INCLUDE_ALIASES = new Set(["--fields", "--section"]);
|
|
131
133
|
const BEHAVIOR_PRESERVING_MIGRATION_HINTS = Object.freeze({
|
|
@@ -186,7 +188,14 @@ const SURFACE_CONTRACT_BY_COMMAND = new Map(PM_READ_OUTPUT_SURFACE_CONTRACTS.map
|
|
|
186
188
|
]));
|
|
187
189
|
/** Resolve a command or list/context alias to its canonical read-output surface. */
|
|
188
190
|
export function resolveReadOutputSurface(command) {
|
|
189
|
-
const
|
|
191
|
+
const normalizedCommand = command
|
|
192
|
+
.trim()
|
|
193
|
+
.toLowerCase()
|
|
194
|
+
.replaceAll(/\s+/gu, " ");
|
|
195
|
+
const root = normalizedCommand === "package manage" ||
|
|
196
|
+
normalizedCommand === "package-manage"
|
|
197
|
+
? "package-manage"
|
|
198
|
+
: normalizedCommand.split(" ")[0];
|
|
190
199
|
const normalized = root.startsWith("list-")
|
|
191
200
|
? "list"
|
|
192
201
|
: root === "ctx"
|
|
@@ -423,11 +432,100 @@ const ENVELOPE_KEYS = new Set([
|
|
|
423
432
|
"total",
|
|
424
433
|
"truncated",
|
|
425
434
|
]);
|
|
435
|
+
const GET_STABLE_DERIVED_ITEM_SELECTORS = [
|
|
436
|
+
"collection_counts",
|
|
437
|
+
"notes_count",
|
|
438
|
+
"tests_count",
|
|
439
|
+
];
|
|
426
440
|
function projectRecordFields(value, selectors) {
|
|
427
441
|
const selected = new Set(selectors.map((selector) => selector.split(".")[0]));
|
|
428
442
|
return Object.fromEntries(Object.entries(value).filter(([key]) => selected.has(key)));
|
|
429
443
|
}
|
|
430
|
-
function
|
|
444
|
+
function getProjectionVocabulary(result) {
|
|
445
|
+
const item = isRecord(result.item) ? result.item : {};
|
|
446
|
+
const itemFields = [
|
|
447
|
+
...new Set([
|
|
448
|
+
...Object.keys(item),
|
|
449
|
+
...GET_STABLE_DERIVED_ITEM_SELECTORS.filter((key) => Object.hasOwn(item, key)),
|
|
450
|
+
]),
|
|
451
|
+
].sort((left, right) => left.localeCompare(right));
|
|
452
|
+
const sections = Object.keys(result)
|
|
453
|
+
.filter((key) => key !== "item" && key !== "read_output" && !ENVELOPE_KEYS.has(key))
|
|
454
|
+
.sort((left, right) => left.localeCompare(right));
|
|
455
|
+
return {
|
|
456
|
+
item,
|
|
457
|
+
itemFields,
|
|
458
|
+
sections,
|
|
459
|
+
valid: [
|
|
460
|
+
...itemFields,
|
|
461
|
+
"item",
|
|
462
|
+
...itemFields.map((field) => `item.${field}`),
|
|
463
|
+
...sections,
|
|
464
|
+
],
|
|
465
|
+
};
|
|
466
|
+
}
|
|
467
|
+
function applyGetIncludeProjection(result, selectors) {
|
|
468
|
+
const vocabulary = getProjectionVocabulary(result);
|
|
469
|
+
const unknown = selectors.filter((selector) => !vocabulary.valid.includes(selector));
|
|
470
|
+
if (unknown.length > 0) {
|
|
471
|
+
throw new PmCliError(`Unknown --output-include selector(s) for get: ${unknown.join(", ")}. Valid selectors: ${vocabulary.valid.join(", ")}.`, EXIT_CODE.USAGE);
|
|
472
|
+
}
|
|
473
|
+
const fullItem = selectors.includes("item");
|
|
474
|
+
const itemSelectors = selectors
|
|
475
|
+
.flatMap((selector) => selector.startsWith("item.")
|
|
476
|
+
? [selector.slice("item.".length)]
|
|
477
|
+
: vocabulary.itemFields.includes(selector)
|
|
478
|
+
? [selector]
|
|
479
|
+
: [])
|
|
480
|
+
.filter((selector, index, values) => values.indexOf(selector) === index);
|
|
481
|
+
if (fullItem && itemSelectors.length > 0) {
|
|
482
|
+
throw new PmCliError("--output-include cannot mix a full item with projected item fields; use item or item.<field>, not both.", EXIT_CODE.USAGE);
|
|
483
|
+
}
|
|
484
|
+
const selectedSections = new Set(selectors.filter((selector) => vocabulary.sections.includes(selector)));
|
|
485
|
+
const projected = Object.fromEntries(Object.entries(result).filter(([key]) => ENVELOPE_KEYS.has(key) || selectedSections.has(key)));
|
|
486
|
+
if (fullItem) {
|
|
487
|
+
projected.item = vocabulary.item;
|
|
488
|
+
}
|
|
489
|
+
else if (itemSelectors.length > 0) {
|
|
490
|
+
projected.item = projectRecordFields(vocabulary.item, itemSelectors);
|
|
491
|
+
}
|
|
492
|
+
const omittedFieldGroups = [
|
|
493
|
+
...(fullItem
|
|
494
|
+
? []
|
|
495
|
+
: itemSelectors.length > 0
|
|
496
|
+
? vocabulary.itemFields
|
|
497
|
+
.filter((field) => !itemSelectors.includes(field))
|
|
498
|
+
.map((field) => ({
|
|
499
|
+
name: `item.${field}`,
|
|
500
|
+
restore_with: `--output-include item.${field}`,
|
|
501
|
+
}))
|
|
502
|
+
: [{ name: "item", restore_with: "--output-include item" }]),
|
|
503
|
+
...vocabulary.sections
|
|
504
|
+
.filter((section) => !selectedSections.has(section))
|
|
505
|
+
.map((section) => ({
|
|
506
|
+
name: section,
|
|
507
|
+
restore_with: `--output-include ${section}`,
|
|
508
|
+
})),
|
|
509
|
+
];
|
|
510
|
+
const inheritedOmittedFieldGroups = isRecord(projected.omission_receipt) &&
|
|
511
|
+
Array.isArray(projected.omission_receipt.omitted_field_groups)
|
|
512
|
+
? projected.omission_receipt.omitted_field_groups
|
|
513
|
+
: [];
|
|
514
|
+
const combinedOmittedFieldGroups = [
|
|
515
|
+
...inheritedOmittedFieldGroups,
|
|
516
|
+
...omittedFieldGroups,
|
|
517
|
+
];
|
|
518
|
+
projected.omission_receipt = {
|
|
519
|
+
has_omissions: combinedOmittedFieldGroups.length > 0,
|
|
520
|
+
omitted_field_group_count: combinedOmittedFieldGroups.length,
|
|
521
|
+
omitted_field_groups: combinedOmittedFieldGroups,
|
|
522
|
+
};
|
|
523
|
+
return projected;
|
|
524
|
+
}
|
|
525
|
+
function applyIncludeProjection(command, result, selectors) {
|
|
526
|
+
if (command === "get") {
|
|
527
|
+
return applyGetIncludeProjection(result, selectors);
|
|
528
|
+
}
|
|
431
529
|
const rows = readOutputRowPaths(result);
|
|
432
530
|
const qualifiedRowSelectors = selectors.flatMap((selector) => rows.flatMap((rowPath) => selector.startsWith(`${rowPath}.`)
|
|
433
531
|
? [selector.slice(rowPath.length + 1)]
|
|
@@ -486,7 +584,7 @@ function attachReadOutputSessionContracts(result, state, receipt) {
|
|
|
486
584
|
function projectReadOutputRows(result, resolved, session) {
|
|
487
585
|
let projected = { ...result };
|
|
488
586
|
if (resolved.include?.source === "canonical") {
|
|
489
|
-
projected = applyIncludeProjection(projected, resolved.include.value);
|
|
587
|
+
projected = applyIncludeProjection(resolved.command, projected, resolved.include.value);
|
|
490
588
|
}
|
|
491
589
|
if (resolved.amount?.source === "canonical") {
|
|
492
590
|
projected = applyAmountBound(projected, resolved.amount.value);
|
|
@@ -597,4 +695,4 @@ export function resolveReadOutputEncoding(command, options) {
|
|
|
597
695
|
: undefined;
|
|
598
696
|
}
|
|
599
697
|
//# sourceMappingURL=read-output-contracts.js.map
|
|
600
|
-
//# debugId=
|
|
698
|
+
//# debugId=819ac44d-0add-581c-90e8-ac6e8247b04b
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module sdk/relationship-kinds/contract
|
|
3
|
+
*
|
|
4
|
+
* Dependency-free relationship ontology shared by contracts and graph runtime.
|
|
5
|
+
*/
|
|
6
|
+
/** Direction exposed by a relationship kind. */
|
|
7
|
+
export type RelationshipDirection = "directed" | "undirected";
|
|
8
|
+
/** Cardinality constraint applied independently to outgoing and incoming edges. */
|
|
9
|
+
export type RelationshipCardinality = "one" | "many";
|
|
10
|
+
/** Lifecycle policy for a relationship kind. */
|
|
11
|
+
export type RelationshipLifecycle = "persistent" | "supersedable" | "ephemeral";
|
|
12
|
+
/** Direction in which an ordering edge contributes to execution precedence. */
|
|
13
|
+
export type RelationshipPrecedence = "source_before_target" | "target_before_source";
|
|
14
|
+
/** Endpoint that represents the structural parent for hierarchy kinds. */
|
|
15
|
+
export type RelationshipHierarchyDirection = "source_parent" | "target_parent";
|
|
16
|
+
/** Versioned semantic definition for a built-in or application-defined edge kind. */
|
|
17
|
+
export interface RelationshipKindDefinition {
|
|
18
|
+
/** Canonical, case-insensitive kind identifier. */
|
|
19
|
+
kind: string;
|
|
20
|
+
/** Whether traversing source to target has distinct meaning from the reverse. */
|
|
21
|
+
direction: RelationshipDirection;
|
|
22
|
+
/** Optional canonical kind used when traversing a directed edge in reverse. */
|
|
23
|
+
inverse?: string;
|
|
24
|
+
/** Whether the kind participates in execution-order cycle checks. */
|
|
25
|
+
ordering: boolean;
|
|
26
|
+
/** Execution direction for ordering kinds; defaults to source before target. */
|
|
27
|
+
precedence?: RelationshipPrecedence;
|
|
28
|
+
/** Whether the kind contributes to structural ancestry. */
|
|
29
|
+
hierarchy: boolean;
|
|
30
|
+
/** Endpoint that represents the parent; defaults to source for custom kinds. */
|
|
31
|
+
hierarchyDirection?: RelationshipHierarchyDirection;
|
|
32
|
+
/** Maximum logical outgoing edges of this kind from one node. */
|
|
33
|
+
outgoing: RelationshipCardinality;
|
|
34
|
+
/** Maximum logical incoming edges of this kind to one node. */
|
|
35
|
+
incoming: RelationshipCardinality;
|
|
36
|
+
/** Edge replacement and retention behavior. */
|
|
37
|
+
lifecycle: RelationshipLifecycle;
|
|
38
|
+
/** JSON Schema for optional application-owned payloads. */
|
|
39
|
+
payloadSchema?: Readonly<Record<string, unknown>>;
|
|
40
|
+
/** Legacy spellings normalized to this definition. */
|
|
41
|
+
aliases?: readonly string[];
|
|
42
|
+
/** Compatibility version of this semantic contract. */
|
|
43
|
+
compatibilityVersion: number;
|
|
44
|
+
/** Whether source and target may be the same node. */
|
|
45
|
+
allowSelf: boolean;
|
|
46
|
+
}
|
|
47
|
+
/** Stable built-in relationship ontology without graph or storage dependencies. */
|
|
48
|
+
export declare const BUILTIN_RELATIONSHIP_KINDS: readonly RelationshipKindDefinition[];
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module sdk/relationship-kinds/contract
|
|
3
|
+
*
|
|
4
|
+
* Dependency-free relationship ontology shared by contracts and graph runtime.
|
|
5
|
+
*/
|
|
6
|
+
/** Stable built-in relationship ontology without graph or storage dependencies. */
|
|
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]="49a83ce3-4c55-5b3f-b061-bc21b716d498")}catch(e){}}();
|
|
9
|
+
export const BUILTIN_RELATIONSHIP_KINDS = [
|
|
10
|
+
{ kind: "blocked_by", direction: "directed", inverse: "blocks", ordering: true, precedence: "target_before_source", hierarchy: false, outgoing: "many", incoming: "many", lifecycle: "persistent", aliases: ["depends_on"], compatibilityVersion: 1, allowSelf: false },
|
|
11
|
+
{ kind: "blocks", direction: "directed", inverse: "blocked_by", ordering: true, precedence: "source_before_target", hierarchy: false, outgoing: "many", incoming: "many", lifecycle: "persistent", compatibilityVersion: 1, allowSelf: false },
|
|
12
|
+
{ kind: "parent", direction: "directed", inverse: "child", ordering: false, hierarchy: true, hierarchyDirection: "target_parent", outgoing: "one", incoming: "many", lifecycle: "supersedable", aliases: ["child_of", "epic"], compatibilityVersion: 1, allowSelf: false },
|
|
13
|
+
{ kind: "child", direction: "directed", inverse: "parent", ordering: false, hierarchy: true, hierarchyDirection: "source_parent", outgoing: "many", incoming: "one", lifecycle: "supersedable", aliases: ["parent_child", "task"], compatibilityVersion: 1, allowSelf: false },
|
|
14
|
+
{ kind: "related", direction: "undirected", ordering: false, hierarchy: false, outgoing: "many", incoming: "many", lifecycle: "persistent", aliases: ["related_to"], compatibilityVersion: 1, allowSelf: false },
|
|
15
|
+
{ kind: "discovered_from", direction: "directed", ordering: false, hierarchy: false, outgoing: "many", incoming: "many", lifecycle: "persistent", compatibilityVersion: 1, allowSelf: false },
|
|
16
|
+
{ kind: "incident_from", direction: "directed", ordering: false, hierarchy: false, outgoing: "many", incoming: "many", lifecycle: "persistent", compatibilityVersion: 1, allowSelf: false },
|
|
17
|
+
{ kind: "implements", direction: "directed", ordering: false, hierarchy: false, outgoing: "many", incoming: "many", lifecycle: "persistent", compatibilityVersion: 1, allowSelf: false },
|
|
18
|
+
{ kind: "verifies", direction: "directed", ordering: false, hierarchy: false, outgoing: "many", incoming: "many", lifecycle: "persistent", compatibilityVersion: 1, allowSelf: false },
|
|
19
|
+
{ kind: "supersedes", direction: "directed", ordering: false, hierarchy: false, outgoing: "many", incoming: "many", lifecycle: "supersedable", compatibilityVersion: 1, allowSelf: false },
|
|
20
|
+
];
|
|
21
|
+
//# sourceMappingURL=contract.js.map
|
|
22
|
+
//# debugId=49a83ce3-4c55-5b3f-b061-bc21b716d498
|
|
@@ -5,47 +5,8 @@
|
|
|
5
5
|
* kernel shared by the SDK, CLI, MCP adapters, extensions, and non-PM apps.
|
|
6
6
|
*/
|
|
7
7
|
import type { Dependency, ItemMetadata } from "../types/index.js";
|
|
8
|
-
|
|
9
|
-
export type RelationshipDirection
|
|
10
|
-
/** Cardinality constraint applied independently to outgoing and incoming edges. */
|
|
11
|
-
export type RelationshipCardinality = "one" | "many";
|
|
12
|
-
/** Lifecycle policy for a relationship kind. */
|
|
13
|
-
export type RelationshipLifecycle = "persistent" | "supersedable" | "ephemeral";
|
|
14
|
-
/** Direction in which an ordering edge contributes to execution precedence. */
|
|
15
|
-
export type RelationshipPrecedence = "source_before_target" | "target_before_source";
|
|
16
|
-
/** Endpoint that represents the structural parent for hierarchy kinds. */
|
|
17
|
-
export type RelationshipHierarchyDirection = "source_parent" | "target_parent";
|
|
18
|
-
/** Versioned semantic definition for a built-in or application-defined edge kind. */
|
|
19
|
-
export interface RelationshipKindDefinition {
|
|
20
|
-
/** Canonical, case-insensitive kind identifier. */
|
|
21
|
-
kind: string;
|
|
22
|
-
/** Whether traversing source to target has distinct meaning from the reverse. */
|
|
23
|
-
direction: RelationshipDirection;
|
|
24
|
-
/** Optional canonical kind used when traversing a directed edge in reverse. */
|
|
25
|
-
inverse?: string;
|
|
26
|
-
/** Whether the kind participates in execution-order cycle checks. */
|
|
27
|
-
ordering: boolean;
|
|
28
|
-
/** Execution direction for ordering kinds; defaults to source before target. */
|
|
29
|
-
precedence?: RelationshipPrecedence;
|
|
30
|
-
/** Whether the kind contributes to structural ancestry. */
|
|
31
|
-
hierarchy: boolean;
|
|
32
|
-
/** Endpoint that represents the parent; defaults to source for custom kinds. */
|
|
33
|
-
hierarchyDirection?: RelationshipHierarchyDirection;
|
|
34
|
-
/** Maximum logical outgoing edges of this kind from one node. */
|
|
35
|
-
outgoing: RelationshipCardinality;
|
|
36
|
-
/** Maximum logical incoming edges of this kind to one node. */
|
|
37
|
-
incoming: RelationshipCardinality;
|
|
38
|
-
/** Edge replacement and retention behavior. */
|
|
39
|
-
lifecycle: RelationshipLifecycle;
|
|
40
|
-
/** JSON Schema for optional application-owned payloads. */
|
|
41
|
-
payloadSchema?: Readonly<Record<string, unknown>>;
|
|
42
|
-
/** Legacy spellings normalized to this definition. */
|
|
43
|
-
aliases?: readonly string[];
|
|
44
|
-
/** Compatibility version of this semantic contract. */
|
|
45
|
-
compatibilityVersion: number;
|
|
46
|
-
/** Whether source and target may be the same node. */
|
|
47
|
-
allowSelf: boolean;
|
|
48
|
-
}
|
|
8
|
+
import { type RelationshipKindDefinition } from "./relationship-kinds/contract.js";
|
|
9
|
+
export { BUILTIN_RELATIONSHIP_KINDS, type RelationshipCardinality, type RelationshipDirection, type RelationshipHierarchyDirection, type RelationshipKindDefinition, type RelationshipLifecycle, type RelationshipPrecedence, } from "./relationship-kinds/contract.js";
|
|
49
10
|
/** One normalized relationship edge indexed by the graph kernel. */
|
|
50
11
|
export interface RelationshipEdge {
|
|
51
12
|
/** Source node identifier. */
|
|
@@ -124,6 +85,10 @@ export declare class RelationshipKindRegistry {
|
|
|
124
85
|
}
|
|
125
86
|
/** Create a registry containing the built-in relationship ontology. */
|
|
126
87
|
export declare function createRelationshipKindRegistry(): RelationshipKindRegistry;
|
|
88
|
+
/** Resolve an accepted built-in relationship spelling to its canonical stored kind. */
|
|
89
|
+
export declare function canonicalizeRelationshipKind(kind: string): string;
|
|
90
|
+
/** Resolve an accepted built-in relationship spelling, returning undefined for unknown kinds. */
|
|
91
|
+
export declare function resolveCanonicalRelationshipKind(kind: unknown): string | undefined;
|
|
127
92
|
/** Report whether a kind participates in execution-order cycle detection. */
|
|
128
93
|
export declare function isOrderingRelationshipKind(kind: string, registry?: RelationshipKindRegistry): boolean;
|
|
129
94
|
/**
|
|
@@ -1,129 +1,7 @@
|
|
|
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]="
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
kind: "blocked_by",
|
|
6
|
-
direction: "directed",
|
|
7
|
-
inverse: "blocks",
|
|
8
|
-
ordering: true,
|
|
9
|
-
precedence: "target_before_source",
|
|
10
|
-
hierarchy: false,
|
|
11
|
-
outgoing: "many",
|
|
12
|
-
incoming: "many",
|
|
13
|
-
lifecycle: "persistent",
|
|
14
|
-
aliases: ["depends_on"],
|
|
15
|
-
compatibilityVersion: 1,
|
|
16
|
-
allowSelf: false,
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
kind: "blocks",
|
|
20
|
-
direction: "directed",
|
|
21
|
-
inverse: "blocked_by",
|
|
22
|
-
ordering: true,
|
|
23
|
-
precedence: "source_before_target",
|
|
24
|
-
hierarchy: false,
|
|
25
|
-
outgoing: "many",
|
|
26
|
-
incoming: "many",
|
|
27
|
-
lifecycle: "persistent",
|
|
28
|
-
compatibilityVersion: 1,
|
|
29
|
-
allowSelf: false,
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
kind: "parent",
|
|
33
|
-
direction: "directed",
|
|
34
|
-
inverse: "child",
|
|
35
|
-
ordering: false,
|
|
36
|
-
hierarchy: true,
|
|
37
|
-
hierarchyDirection: "target_parent",
|
|
38
|
-
outgoing: "one",
|
|
39
|
-
incoming: "many",
|
|
40
|
-
lifecycle: "supersedable",
|
|
41
|
-
aliases: ["child_of", "epic"],
|
|
42
|
-
compatibilityVersion: 1,
|
|
43
|
-
allowSelf: false,
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
kind: "child",
|
|
47
|
-
direction: "directed",
|
|
48
|
-
inverse: "parent",
|
|
49
|
-
ordering: false,
|
|
50
|
-
hierarchy: true,
|
|
51
|
-
hierarchyDirection: "source_parent",
|
|
52
|
-
outgoing: "many",
|
|
53
|
-
incoming: "one",
|
|
54
|
-
lifecycle: "supersedable",
|
|
55
|
-
aliases: ["parent_child", "task"],
|
|
56
|
-
compatibilityVersion: 1,
|
|
57
|
-
allowSelf: false,
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
kind: "related",
|
|
61
|
-
direction: "undirected",
|
|
62
|
-
ordering: false,
|
|
63
|
-
hierarchy: false,
|
|
64
|
-
outgoing: "many",
|
|
65
|
-
incoming: "many",
|
|
66
|
-
lifecycle: "persistent",
|
|
67
|
-
aliases: ["related_to"],
|
|
68
|
-
compatibilityVersion: 1,
|
|
69
|
-
allowSelf: false,
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
kind: "discovered_from",
|
|
73
|
-
direction: "directed",
|
|
74
|
-
ordering: false,
|
|
75
|
-
hierarchy: false,
|
|
76
|
-
outgoing: "many",
|
|
77
|
-
incoming: "many",
|
|
78
|
-
lifecycle: "persistent",
|
|
79
|
-
compatibilityVersion: 1,
|
|
80
|
-
allowSelf: false,
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
kind: "incident_from",
|
|
84
|
-
direction: "directed",
|
|
85
|
-
ordering: false,
|
|
86
|
-
hierarchy: false,
|
|
87
|
-
outgoing: "many",
|
|
88
|
-
incoming: "many",
|
|
89
|
-
lifecycle: "persistent",
|
|
90
|
-
compatibilityVersion: 1,
|
|
91
|
-
allowSelf: false,
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
kind: "implements",
|
|
95
|
-
direction: "directed",
|
|
96
|
-
ordering: false,
|
|
97
|
-
hierarchy: false,
|
|
98
|
-
outgoing: "many",
|
|
99
|
-
incoming: "many",
|
|
100
|
-
lifecycle: "persistent",
|
|
101
|
-
compatibilityVersion: 1,
|
|
102
|
-
allowSelf: false,
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
kind: "verifies",
|
|
106
|
-
direction: "directed",
|
|
107
|
-
ordering: false,
|
|
108
|
-
hierarchy: false,
|
|
109
|
-
outgoing: "many",
|
|
110
|
-
incoming: "many",
|
|
111
|
-
lifecycle: "persistent",
|
|
112
|
-
compatibilityVersion: 1,
|
|
113
|
-
allowSelf: false,
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
kind: "supersedes",
|
|
117
|
-
direction: "directed",
|
|
118
|
-
ordering: false,
|
|
119
|
-
hierarchy: false,
|
|
120
|
-
outgoing: "many",
|
|
121
|
-
incoming: "many",
|
|
122
|
-
lifecycle: "supersedable",
|
|
123
|
-
compatibilityVersion: 1,
|
|
124
|
-
allowSelf: false,
|
|
125
|
-
},
|
|
126
|
-
];
|
|
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]="05e01593-acb6-5e28-a5ac-8c8f74359c62")}catch(e){}}();
|
|
3
|
+
import { BUILTIN_RELATIONSHIP_KINDS, } from "./relationship-kinds/contract.js";
|
|
4
|
+
export { BUILTIN_RELATIONSHIP_KINDS, } from "./relationship-kinds/contract.js";
|
|
127
5
|
function normalizeKind(kind) {
|
|
128
6
|
return kind.trim().toLowerCase().replaceAll("-", "_");
|
|
129
7
|
}
|
|
@@ -278,6 +156,14 @@ export function createRelationshipKindRegistry() {
|
|
|
278
156
|
return new RelationshipKindRegistry();
|
|
279
157
|
}
|
|
280
158
|
const defaultRegistry = createRelationshipKindRegistry();
|
|
159
|
+
/** Resolve an accepted built-in relationship spelling to its canonical stored kind. */
|
|
160
|
+
export function canonicalizeRelationshipKind(kind) {
|
|
161
|
+
return defaultRegistry.require(kind).kind;
|
|
162
|
+
}
|
|
163
|
+
/** Resolve an accepted built-in relationship spelling, returning undefined for unknown kinds. */
|
|
164
|
+
export function resolveCanonicalRelationshipKind(kind) {
|
|
165
|
+
return defaultRegistry.resolve(kind)?.kind;
|
|
166
|
+
}
|
|
281
167
|
/** Report whether a kind participates in execution-order cycle detection. */
|
|
282
168
|
export function isOrderingRelationshipKind(kind, registry = defaultRegistry) {
|
|
283
169
|
return registry.resolve(kind)?.ordering === true;
|
|
@@ -657,4 +543,4 @@ export function dependencyToRelationship(source, dependency, registry = defaultR
|
|
|
657
543
|
};
|
|
658
544
|
}
|
|
659
545
|
//# sourceMappingURL=relationships.js.map
|
|
660
|
-
//# debugId=
|
|
546
|
+
//# debugId=05e01593-acb6-5e28-a5ac-8c8f74359c62
|
|
@@ -51,7 +51,7 @@ export { type VectorizationEmbeddingIdentity, type VectorizationEmbeddingMetadat
|
|
|
51
51
|
export { sentryCaptureCliError, sentryFinishCommandSpan, sentryFlush, sentryLogCliUsageError, sentrySetCommandContext, sentryStartCommandSpan, } from "../core/sentry/helpers.js";
|
|
52
52
|
export { ensureSentryInit } from "../core/sentry/instrument.js";
|
|
53
53
|
export { clearFocusedItem, getFocusedItem, setFocusedItem, } from "../core/session/session-state.js";
|
|
54
|
-
export { readAuthorEnvironment, resolveAuthor, resolveClaimPrincipal, runWithHarnessDetectionSignals, runWithWorkspaceHarnessSignalDescriptors, type AgentClientInfo, writeAuthorEnvironment, } from "../core/shared/author.js";
|
|
54
|
+
export { readAuthorEnvironment, diagnoseAgentIdentity, resolveAuthor, resolveClaimPrincipal, runWithHarnessDetectionSignals, runWithWorkspaceHarnessSignalDescriptors, type AgentClientInfo, writeAuthorEnvironment, } from "../core/shared/author.js";
|
|
55
55
|
export { agentSessionEnvironment, boundAgentEpisodeIdentity, runWithAgentSessionContext, resolveAgentSessionContextFromSignals, type AgentEpisodeIdentity, type AgentSessionContext, } from "../core/shared/agent-session-context.js";
|
|
56
56
|
export { evaluateMutationGuard, isMutationAction, listMutationActions, scanMutationSecrets, type EvaluateMutationGuardOptions, type MutationGuardResult, type MutationGuardSettings, type SecretGuardFinding, type SecretGuardMode, } from "./mutation-guard.js";
|
|
57
57
|
export { jaccardSimilarity, normalizeSimilarityText, scoreItemSimilarity, tokenizeSimilarityText, type ItemSimilarityScore, } from "./similarity-scoring.js";
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* prefer the typed operations exported by the main SDK barrel.
|
|
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]="17358714-bb54-58e5-bba0-61bfd1323ec2")}catch(e){}}();
|
|
11
11
|
export { createCheckpointId, loadMutationCheckpoint, restoreCheckpointItems, writeMutationCheckpoint, } from "../core/checkpoint/mutation-checkpoint.js";
|
|
12
12
|
export { flattenFlagListValue, resolveFlagValueKind, } from "../core/extensions/flag-value-types.js";
|
|
13
13
|
export { activateExtensions, clearActiveExtensionHooks, consumeAfterCommandAffectedItems, createCoreCommandHookContext, createEmptyExtensionRegistrationRegistry, discoverExtensions, getActiveCommandResult, getActiveExtensionRegistrations, loadExtensions, projectAfterCommandItemSnapshot, recordAfterCommandAffectedItem, resetActiveExtensionRuntimeState, runActiveCommandHandler, runActiveBeforeMutationHooks, runActiveOnIndexHooks, runActiveOnReadHooks, runActiveOnWriteHooks, runActiveParserOverride, runActivePreflightOverride, runActiveServiceOverride, runAfterCommandHooks, runBeforeCommandHooks, setActiveCommandContext, setActiveCommandResult, setActiveExtensionCommands, setActiveExtensionHooks, setActiveExtensionParsers, setActiveExtensionPreflight, setActiveExtensionRegistrations, setActiveExtensionRenderers, setActiveExtensionServices, } from "../core/extensions/index.js";
|
|
@@ -53,7 +53,7 @@ export { buildVectorizationEmbeddingIdentity, buildVectorizationEmbeddingMetadat
|
|
|
53
53
|
export { sentryCaptureCliError, sentryFinishCommandSpan, sentryFlush, sentryLogCliUsageError, sentrySetCommandContext, sentryStartCommandSpan, } from "../core/sentry/helpers.js";
|
|
54
54
|
export { ensureSentryInit } from "../core/sentry/instrument.js";
|
|
55
55
|
export { clearFocusedItem, getFocusedItem, setFocusedItem, } from "../core/session/session-state.js";
|
|
56
|
-
export { readAuthorEnvironment, resolveAuthor, resolveClaimPrincipal, runWithHarnessDetectionSignals, runWithWorkspaceHarnessSignalDescriptors, writeAuthorEnvironment, } from "../core/shared/author.js";
|
|
56
|
+
export { readAuthorEnvironment, diagnoseAgentIdentity, resolveAuthor, resolveClaimPrincipal, runWithHarnessDetectionSignals, runWithWorkspaceHarnessSignalDescriptors, writeAuthorEnvironment, } from "../core/shared/author.js";
|
|
57
57
|
export { agentSessionEnvironment, boundAgentEpisodeIdentity, runWithAgentSessionContext, resolveAgentSessionContextFromSignals, } from "../core/shared/agent-session-context.js";
|
|
58
58
|
export { evaluateMutationGuard, isMutationAction, listMutationActions, scanMutationSecrets, } from "./mutation-guard.js";
|
|
59
59
|
export { jaccardSimilarity, normalizeSimilarityText, scoreItemSimilarity, tokenizeSimilarityText, } from "./similarity-scoring.js";
|
|
@@ -79,4 +79,4 @@ export { maybeRunFirstUseTelemetryPrompt } from "../core/telemetry/consent.js";
|
|
|
79
79
|
export { deriveTelemetryCommandResolution, } from "../core/telemetry/observability.js";
|
|
80
80
|
export { emitTelemetryErrorEvent, finishTelemetryCommand, startTelemetryCommand, } from "../core/telemetry/runtime.js";
|
|
81
81
|
//# sourceMappingURL=runtime-primitives.js.map
|
|
82
|
-
//# debugId=
|
|
82
|
+
//# debugId=17358714-bb54-58e5-bba0-61bfd1323ec2
|
package/dist/sdk/runtime.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ import { EXIT_CODE } from "../core/shared/constants.js";
|
|
|
10
10
|
export type { WorkspaceExtensionCommandContract, WorkspaceFieldContract, } from "./workspace-contracts.js";
|
|
11
11
|
import { type PmReadOutputOptions, type PmReadOutputResultFor } from "./read-output-contracts.js";
|
|
12
12
|
export type { PmReadOutputBudgetExceeded, PmReadOutputOptions, PmReadOutputResult, PmReadOutputResultFor, PmReadOutputSurfaceContract, } from "./read-output-contracts.js";
|
|
13
|
-
export type { PmReadOutputSessionReceipt, PmReadOutputSessionState } from "./read-output-session.js";
|
|
13
|
+
export type { PmReadOutputSessionReceipt, PmReadOutputSessionState, } from "./read-output-session.js";
|
|
14
14
|
export type { PmContextIntentContract } from "./context-intent-contracts.js";
|
|
15
15
|
export type { PmErrorCodeContract } from "./error-code-catalog.js";
|
|
16
16
|
export { clearWorkspaceContractsCache } from "./workspace-contracts-cache.js";
|
package/dist/sdk/runtime.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Defines public SDK APIs and package-author helpers for Runtime.
|
|
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]="c8f2b88e-1883-5744-868b-3a16f3814813")}catch(e){}}();
|
|
8
8
|
export { PM_GITIGNORE_END, PM_GITIGNORE_START, ensurePmGitignore, getPmGitignoreBlock, } from "./workspace.js";
|
|
9
9
|
export { SEARCH_EXTENSION_FLAG_DEFINITIONS } from "./extension-contracts.js";
|
|
10
10
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
@@ -36,6 +36,7 @@ import { runAggregate, } from "./query/aggregate.js";
|
|
|
36
36
|
import { runAppend } from "./lifecycle/append.js";
|
|
37
37
|
import { runClaim, runClaimNext, runRelease } from "./lifecycle/claim.js";
|
|
38
38
|
import { runCloseMany } from "./lifecycle/close-many.js";
|
|
39
|
+
import { normalizeAnnotationTransportOptions } from "./annotations.js";
|
|
39
40
|
import { runComments } from "./comments.js";
|
|
40
41
|
import { runHistory } from "./query/history.js";
|
|
41
42
|
import { runLearnings } from "./learnings.js";
|
|
@@ -60,7 +61,7 @@ import { runExtension, } from "./extension.js";
|
|
|
60
61
|
import { runConfig } from "./config.js";
|
|
61
62
|
import { runInit } from "./init.js";
|
|
62
63
|
import { runRuntimeEvalAction, runRuntimeEventsAction, runRuntimeMergeAction, runRuntimeSchedulingAction, runRuntimeWorkspaceAction, } from "./runtime-extended-actions.js";
|
|
63
|
-
import {
|
|
64
|
+
import { acknowledgeUnknownAuthorHistoryEventsFromTransport, } from "./author-attribution.js";
|
|
64
65
|
import { runProfileApply, runProfileLint, runProfileList, runProfileShow, } from "./profile.js";
|
|
65
66
|
import { runHistoryRedact, } from "./history-redact.js";
|
|
66
67
|
import { runMcpHistoryCompactAction, runMcpHistoryRepairAction, } from "./history-mcp.js";
|
|
@@ -1387,7 +1388,7 @@ async function runMcpCloseAction(ctx) {
|
|
|
1387
1388
|
});
|
|
1388
1389
|
}
|
|
1389
1390
|
function runMcpCommentsAction(ctx) {
|
|
1390
|
-
const commentOptions =
|
|
1391
|
+
const commentOptions = normalizeAnnotationTransportOptions(ctx.options);
|
|
1391
1392
|
const isListing = commentOptions.add === undefined &&
|
|
1392
1393
|
commentOptions.stdin === undefined &&
|
|
1393
1394
|
commentOptions.file === undefined &&
|
|
@@ -1395,11 +1396,10 @@ function runMcpCommentsAction(ctx) {
|
|
|
1395
1396
|
commentOptions.delete === undefined;
|
|
1396
1397
|
if (isListing) {
|
|
1397
1398
|
commentOptions.includeMeta = true;
|
|
1398
|
-
if (commentOptions.limit === undefined && commentOptions.
|
|
1399
|
+
if (commentOptions.limit === undefined && commentOptions.fullHistory !== true) {
|
|
1399
1400
|
commentOptions.limit = "20";
|
|
1400
1401
|
}
|
|
1401
1402
|
}
|
|
1402
|
-
delete commentOptions.full;
|
|
1403
1403
|
return runComments(requireMcpItemId(ctx), commentOptions, ctx.global);
|
|
1404
1404
|
}
|
|
1405
1405
|
function runMcpFilesAction(ctx) {
|
|
@@ -1752,23 +1752,7 @@ function runMcpGraphAction(ctx) {
|
|
|
1752
1752
|
return runGraph(readRequiredString(merged, "subcommand"), readString(merged, "id") ?? ctx.id, readString(merged, "target"), graphOptionsFromFlat(merged), ctx.global);
|
|
1753
1753
|
}
|
|
1754
1754
|
function runMcpHistoryAuthorAcknowledgeAction(ctx) {
|
|
1755
|
-
|
|
1756
|
-
const events = readStringArray(merged.historyEvent).map((value) => {
|
|
1757
|
-
const separator = value.lastIndexOf(":");
|
|
1758
|
-
return {
|
|
1759
|
-
item_id: value.slice(0, separator).trim(),
|
|
1760
|
-
line: Number(value.slice(separator + 1)),
|
|
1761
|
-
};
|
|
1762
|
-
});
|
|
1763
|
-
return acknowledgeUnknownAuthorHistoryEvents(resolvePmRoot(process.cwd(), ctx.global.path), {
|
|
1764
|
-
events,
|
|
1765
|
-
all_actionable: merged.allActionable === true || merged.all_actionable === true,
|
|
1766
|
-
attributed_author: readString(merged, "attributedAuthor") ??
|
|
1767
|
-
readString(merged, "attributed_author") ??
|
|
1768
|
-
"",
|
|
1769
|
-
reviewer: readString(merged, "reviewer") ?? "",
|
|
1770
|
-
reason: readString(merged, "reason") ?? "",
|
|
1771
|
-
});
|
|
1755
|
+
return acknowledgeUnknownAuthorHistoryEventsFromTransport(resolvePmRoot(process.cwd(), ctx.global.path), { ...ctx.args, ...ctx.options });
|
|
1772
1756
|
}
|
|
1773
1757
|
const SDK_ACTION_HANDLERS = {
|
|
1774
1758
|
init: (ctx) => runInit(readString(ctx.args, "prefix"), ctx.global, ctx.options),
|
|
@@ -1813,8 +1797,8 @@ const SDK_ACTION_HANDLERS = {
|
|
|
1813
1797
|
"close-task": runMcpCloseTaskAction,
|
|
1814
1798
|
close: runMcpCloseAction,
|
|
1815
1799
|
comments: runMcpCommentsAction,
|
|
1816
|
-
notes: (ctx) => runNotes(requireMcpItemId(ctx), ctx.options, ctx.global),
|
|
1817
|
-
learnings: (ctx) => runLearnings(requireMcpItemId(ctx), ctx.options, ctx.global),
|
|
1800
|
+
notes: (ctx) => runNotes(requireMcpItemId(ctx), normalizeAnnotationTransportOptions(ctx.options), ctx.global),
|
|
1801
|
+
learnings: (ctx) => runLearnings(requireMcpItemId(ctx), normalizeAnnotationTransportOptions(ctx.options), ctx.global),
|
|
1818
1802
|
files: runMcpFilesAction,
|
|
1819
1803
|
docs: (ctx) => runDocs(requireMcpItemId(ctx), withAddNoteOption(ctx.options), ctx.global),
|
|
1820
1804
|
test: (ctx) => runTest(requireMcpItemId(ctx), ctx.options, ctx.global),
|
|
@@ -1941,4 +1925,4 @@ async function loadWorkspaceExtensionRegistrations(pmRoot, settings, cwd) {
|
|
|
1941
1925
|
}
|
|
1942
1926
|
}
|
|
1943
1927
|
//# sourceMappingURL=runtime.js.map
|
|
1944
|
-
//# debugId=
|
|
1928
|
+
//# debugId=c8f2b88e-1883-5744-868b-3a16f3814813
|
package/dist/sdk/similarity.d.ts
CHANGED
|
@@ -88,6 +88,11 @@ export interface DuplicateClustersResult {
|
|
|
88
88
|
threshold: number;
|
|
89
89
|
/** Retrieval path used for this whole-workspace sweep. */
|
|
90
90
|
source: "metadata_scan";
|
|
91
|
+
/** Effective lifecycle filter; null means the complete all-status corpus. */
|
|
92
|
+
filters: {
|
|
93
|
+
statuses: string[] | null;
|
|
94
|
+
since: string | null;
|
|
95
|
+
};
|
|
91
96
|
/** Work performed after the single metadata read. */
|
|
92
97
|
cost: {
|
|
93
98
|
/** Items retained after filters. */
|