@unbrained/pm-cli 2026.8.8 → 2026.8.10
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 +59 -0
- package/dist/cli/commander-usage.js +17 -12
- package/dist/cli/help-json-payload.js +51 -16
- package/dist/cli/main.js +7 -6
- package/dist/cli-bundle/bundle-manifest.json +162 -162
- package/dist/cli-bundle/chunks/chunk-2QYH4QMI.js +30 -0
- package/dist/cli-bundle/chunks/{chunk-2ZMXX3Q6.js → chunk-EBO7OUUE.js} +70 -70
- package/dist/cli-bundle/chunks/{chunk-NUXRRNAB.js → chunk-ETML5C6H.js} +48 -48
- package/dist/cli-bundle/chunks/chunk-JUDU4RO4.js +194 -0
- package/dist/cli-bundle/chunks/chunk-JZSNADRR.js +5 -0
- package/dist/cli-bundle/chunks/chunk-MENWVGJW.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-ALDHXLPS.js → chunk-S4EITGLA.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-TIGKWVLA.js +13 -0
- package/dist/cli-bundle/chunks/{chunk-CBLA33YK.js → chunk-TRWXF476.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-TSLDTJLQ.js +2 -0
- package/dist/cli-bundle/chunks/{register-list-query-WFZAMJHZ.js → register-list-query-OJ6ZXKV4.js} +2 -2
- package/dist/cli-bundle/chunks/{register-mutation-SOKKOTHQ.js → register-mutation-DKI7QC7O.js} +2 -2
- package/dist/cli-bundle/chunks/register-operations-P5OGMT6I.js +2 -0
- package/dist/cli-bundle/chunks/{register-setup-2HL5ZHMK.js → register-setup-S3KT2LTH.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-ANTMGYLI.js → chunk-2COZ67XT.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-2EXI2DKR.js +4 -0
- package/dist/cli-bundle/focused-chunks/{chunk-YSAHYUXX.js → chunk-34SX654S.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-36FTZ2NT.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-3CQECMKR.js +16 -0
- package/dist/cli-bundle/focused-chunks/chunk-75774JWP.js +6 -0
- package/dist/cli-bundle/focused-chunks/chunk-7UN6BHHO.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-TCSAPH33.js → chunk-CHIBMEZR.js} +6 -6
- package/dist/cli-bundle/focused-chunks/chunk-DZGAHZZV.js +3 -0
- package/dist/cli-bundle/focused-chunks/chunk-FF4MNAYB.js +153 -0
- package/dist/cli-bundle/focused-chunks/chunk-GHTN2ILR.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-I4YM2I7S.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-IMDTEN7K.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-IW43E4XL.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-JMVA4HKR.js +5 -0
- package/dist/cli-bundle/focused-chunks/{chunk-PL2EYDJK.js → chunk-KR5RVXLQ.js} +31 -29
- package/dist/cli-bundle/focused-chunks/chunk-KSNJG4KI.js +16 -0
- package/dist/cli-bundle/focused-chunks/chunk-M6RPIXKC.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-MXYSIQ56.js +18 -0
- package/dist/cli-bundle/focused-chunks/chunk-RIIN5V4N.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-RKWSCYYN.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 -2
- package/dist/core/diagnostics/remediation.js +19 -9
- package/dist/core/fs/fs-utils.d.ts +10 -0
- package/dist/core/fs/fs-utils.js +16 -4
- 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/item/item-format.js +3 -32
- package/dist/core/schema/fields-file.d.ts +1 -2
- package/dist/core/schema/fields-file.js +4 -11
- package/dist/core/schema/runtime-schema.js +3 -10
- package/dist/core/schema/status-defs-file.d.ts +1 -2
- package/dist/core/schema/status-defs-file.js +4 -32
- package/dist/core/schema/status-token.d.ts +2 -0
- package/dist/core/schema/status-token.js +32 -0
- package/dist/core/schema/type-workflows.d.ts +1 -2
- package/dist/core/schema/type-workflows.js +4 -11
- package/dist/core/shared/author.d.ts +25 -0
- package/dist/core/shared/author.js +128 -10
- package/dist/core/shared/errors.d.ts +4 -0
- package/dist/core/shared/errors.js +2 -2
- package/dist/core/shared/text-normalization.d.ts +1 -1
- package/dist/core/shared/text-normalization.js +2 -2
- package/dist/sdk/actionability.d.ts +1 -1
- package/dist/sdk/actionability.js +3 -3
- package/dist/sdk/agent/command-recovery.d.ts +4 -0
- package/dist/sdk/agent/command-recovery.js +52 -0
- package/dist/sdk/agent/command-suggestions.d.ts +4 -0
- package/dist/sdk/agent/command-suggestions.js +67 -0
- package/dist/sdk/agent/create-option-policy.d.ts +12 -0
- package/dist/sdk/agent/create-option-policy.js +32 -0
- package/dist/sdk/agent/item-addressing.d.ts +19 -0
- package/dist/sdk/agent/item-addressing.js +208 -0
- package/dist/sdk/cli-bootstrap.d.ts +1 -1
- package/dist/sdk/cli-bootstrap.js +20 -5
- package/dist/sdk/cli-contracts/commander-mutation-options.js +16 -4
- package/dist/sdk/cli-contracts/flag-contracts.js +62 -21
- package/dist/sdk/cli-contracts/registration-helpers.js +10 -2
- package/dist/sdk/cli-contracts/runtime-contracts.d.ts +8 -0
- package/dist/sdk/cli-contracts/runtime-contracts.js +20 -3
- package/dist/sdk/cli-contracts/tool-option-contracts.d.ts +6 -0
- package/dist/sdk/cli-contracts/tool-option-contracts.js +4 -2
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +19 -4
- package/dist/sdk/cli-contracts/tool-schema.js +17 -4
- package/dist/sdk/context-intent-runtime.js +8 -5
- package/dist/sdk/context-signal-store.d.ts +34 -0
- package/dist/sdk/context-signal-store.js +24 -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/dependency-flag-validation.d.ts +15 -1
- package/dist/sdk/dependency-flag-validation.js +54 -2
- package/dist/sdk/extension/bundled-catalog.js +19 -6
- package/dist/sdk/generated-error-code-catalog.js +110 -2
- package/dist/sdk/governance/health.js +38 -12
- package/dist/sdk/governance/provenance-health.d.ts +39 -0
- package/dist/sdk/governance/provenance-health.js +185 -0
- package/dist/sdk/governance/validate-item-reader.d.ts +13 -0
- package/dist/sdk/governance/validate-item-reader.js +18 -0
- package/dist/sdk/governance/validate.d.ts +2 -2
- package/dist/sdk/governance/validate.js +25 -11
- 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 +4 -0
- package/dist/sdk/index.js +6 -2
- package/dist/sdk/lifecycle/close.js +27 -19
- package/dist/sdk/lifecycle/create.d.ts +2 -0
- package/dist/sdk/lifecycle/create.js +66 -19
- package/dist/sdk/lifecycle/plan.js +6 -3
- package/dist/sdk/lifecycle/update-many.js +39 -27
- package/dist/sdk/lifecycle/update.d.ts +6 -1
- package/dist/sdk/lifecycle/update.js +51 -28
- 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 +4 -0
- package/dist/sdk/merge/install.js +29 -17
- package/dist/sdk/merge/receipts.d.ts +17 -1
- package/dist/sdk/merge/receipts.js +112 -20
- 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/output-projection.js +24 -4
- package/dist/sdk/query/context.d.ts +2 -0
- package/dist/sdk/query/context.js +7 -4
- package/dist/sdk/query/get.d.ts +11 -0
- package/dist/sdk/query/get.js +37 -3
- package/dist/sdk/query/light-metadata.d.ts +3 -0
- package/dist/sdk/query/light-metadata.js +19 -0
- package/dist/sdk/read-output-contracts.d.ts +1 -1
- package/dist/sdk/read-output-contracts.js +23 -4
- 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 +4 -1
- package/dist/sdk/runtime.js +8 -3
- package/dist/sdk/schema-migration.js +7 -9
- package/dist/sdk/similarity-scoring.d.ts +1 -2
- package/dist/sdk/similarity-scoring.js +4 -16
- 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/linked-command-detection.d.ts +2 -7
- package/dist/sdk/test/linked-command-detection.js +22 -9
- package/dist/sdk/workspace-snapshot.d.ts +4 -0
- package/dist/sdk/workspace-snapshot.js +24 -11
- package/docs/AGENT_GUIDE.md +5 -2
- package/docs/COMMANDS.md +27 -6
- package/docs/DEPENDENCY_KIND_CONTRACT.md +29 -0
- package/docs/ITEM_READ_PROJECTIONS.md +26 -0
- package/docs/MERGE_SAFETY.md +17 -8
- package/docs/README.md +2 -5
- package/docs/READ_OUTPUT_CONTRACTS.md +2 -2
- package/docs/RELATIONSHIP_GRAPH.md +1 -1
- package/docs/SDK.md +33 -8
- package/docs/SDK_AGENT_SESSION_CONTEXT.md +36 -2
- package/docs/SDK_CONTEXT.md +97 -0
- package/docs/SDK_CONTEXT_INTEGRITY.md +33 -3
- package/docs/SENTRY_CONTRACT_EPOCHS.md +20 -0
- package/docs/agent-task-token-baseline.json +2 -2
- package/marketplace.json +2 -2
- package/package.json +5 -4
- 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 +415 -43
- package/dist/cli-bundle/chunks/chunk-GKA54IJM.js +0 -5
- package/dist/cli-bundle/chunks/chunk-KRY7SRUO.js +0 -2
- package/dist/cli-bundle/chunks/chunk-MNJ4NNSY.js +0 -26
- package/dist/cli-bundle/chunks/chunk-OJPCFDDY.js +0 -13
- package/dist/cli-bundle/chunks/chunk-PFSD3DAN.js +0 -194
- package/dist/cli-bundle/chunks/chunk-SQ7QZFQ6.js +0 -2
- package/dist/cli-bundle/chunks/register-operations-5XQETS6E.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-54EU2UVO.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-5FLBTZJQ.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-5GJ57YKN.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-CMDS3KYT.js +0 -14
- package/dist/cli-bundle/focused-chunks/chunk-DMKOMTTY.js +0 -6
- package/dist/cli-bundle/focused-chunks/chunk-F5B3HBEZ.js +0 -5
- package/dist/cli-bundle/focused-chunks/chunk-FI6DWU2M.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-FNOKJG6N.js +0 -16
- package/dist/cli-bundle/focused-chunks/chunk-FPDYXZBK.js +0 -4
- package/dist/cli-bundle/focused-chunks/chunk-GWI6YIKJ.js +0 -3
- package/dist/cli-bundle/focused-chunks/chunk-HCUC62AB.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-HGNKPSCB.js +0 -153
- package/dist/cli-bundle/focused-chunks/chunk-IAS7PMLG.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-SM2PJGP3.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-U646T7Z6.js +0 -18
- package/dist/cli-bundle/focused-chunks/chunk-YKPE4PPY.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-ZOLDTUU7.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,13 +432,23 @@ 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
444
|
function getProjectionVocabulary(result) {
|
|
431
445
|
const item = isRecord(result.item) ? result.item : {};
|
|
432
|
-
const itemFields =
|
|
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));
|
|
433
452
|
const sections = Object.keys(result)
|
|
434
453
|
.filter((key) => key !== "item" && key !== "read_output" && !ENVELOPE_KEYS.has(key))
|
|
435
454
|
.sort((left, right) => left.localeCompare(right));
|
|
@@ -676,4 +695,4 @@ export function resolveReadOutputEncoding(command, options) {
|
|
|
676
695
|
: undefined;
|
|
677
696
|
}
|
|
678
697
|
//# sourceMappingURL=read-output-contracts.js.map
|
|
679
|
-
//# 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
|
@@ -7,6 +7,7 @@ export { PM_GITIGNORE_END, PM_GITIGNORE_START, ensurePmGitignore, getPmGitignore
|
|
|
7
7
|
export { SEARCH_EXTENSION_FLAG_DEFINITIONS } from "./extension-contracts.js";
|
|
8
8
|
export type { FlagDefinition } from "../core/extensions/loader.js";
|
|
9
9
|
import { EXIT_CODE } from "../core/shared/constants.js";
|
|
10
|
+
import type { ItemMetadata } from "../types/index.js";
|
|
10
11
|
export type { WorkspaceExtensionCommandContract, WorkspaceFieldContract, } from "./workspace-contracts.js";
|
|
11
12
|
import { type PmReadOutputOptions, type PmReadOutputResultFor } from "./read-output-contracts.js";
|
|
12
13
|
export type { PmReadOutputBudgetExceeded, PmReadOutputOptions, PmReadOutputResult, PmReadOutputResultFor, PmReadOutputSurfaceContract, } from "./read-output-contracts.js";
|
|
@@ -74,7 +75,7 @@ export { EXIT_CODE };
|
|
|
74
75
|
export { PmCliError } from "../core/shared/errors.js";
|
|
75
76
|
export { isTimestampLiteral, nowIso } from "../core/shared/time.js";
|
|
76
77
|
export { jaccardSimilarity, normalizeSimilarityText, scoreItemSimilarity, tokenizeSimilarityText, type ItemSimilarityScore, } from "./similarity-scoring.js";
|
|
77
|
-
export { listAllItemMetadata, locateItem, readLocatedItem, } from "../core/store/item-store.js";
|
|
78
|
+
export { listAllItemMetadata, listAllItemMetadataLight, locateItem, readLocatedItem, } from "../core/store/item-store.js";
|
|
78
79
|
export { getHistoryPath, getItemPath, getSettingsPath, resolveImplicitPmRoot, resolvePmRoot, } from "../core/store/paths.js";
|
|
79
80
|
export { readSettings } from "../core/store/settings.js";
|
|
80
81
|
export { runAggregate, type AggregateOptions, type AggregateResult, type AggregateRow, } from "./query/aggregate.js";
|
|
@@ -131,6 +132,8 @@ export declare class PmClient {
|
|
|
131
132
|
private runTyped;
|
|
132
133
|
/** Return the same context snapshot produced by `pm context`. */
|
|
133
134
|
context<Options extends ReadOptions<ContextOptions> = ContextOptions>(options?: Options): ReadPromise<ContextResult, Options>;
|
|
135
|
+
/** Read every item through the scalar-only metadata cache without materializing heavy collections or bodies. */
|
|
136
|
+
listAllItemMetadataLight(): Promise<ItemMetadata[]>;
|
|
134
137
|
/** List items with the MCP/agent compact defaults. */
|
|
135
138
|
list<Options extends ReadOptions<ListOptions> = ListOptions>(options?: Options): ReadPromise<ListResult, Options>;
|
|
136
139
|
/** Search items with the MCP/agent compact defaults. */
|
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]="70ce3cab-35f0-508b-9348-2f8479495946")}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";
|
|
@@ -22,6 +22,7 @@ import { createAsyncReadWriteGate } from "../core/shared/serial-queue.js";
|
|
|
22
22
|
import { resolveRuntimeFieldRegistry, resolveRuntimeStatusRegistry, } from "../core/schema/runtime-schema.js";
|
|
23
23
|
import { getSettingsPath, resolvePmRoot } from "../core/store/paths.js";
|
|
24
24
|
import { readSettings } from "../core/store/settings.js";
|
|
25
|
+
import { listClientItemMetadataLight } from "./query/light-metadata.js";
|
|
25
26
|
import { buildWorkspaceExtensionCommandContracts, buildWorkspaceFieldContracts, } from "./workspace-contracts.js";
|
|
26
27
|
import { PM_TOOL_ACTIONS } from "./cli-contracts/enum-contracts.js";
|
|
27
28
|
import { clearWorkspaceContractsCache, memoizeWorkspaceExtensionRegistrations, } from "./workspace-contracts-cache.js";
|
|
@@ -99,7 +100,7 @@ export { EXIT_CODE };
|
|
|
99
100
|
export { PmCliError } from "../core/shared/errors.js";
|
|
100
101
|
export { isTimestampLiteral, nowIso } from "../core/shared/time.js";
|
|
101
102
|
export { jaccardSimilarity, normalizeSimilarityText, scoreItemSimilarity, tokenizeSimilarityText, } from "./similarity-scoring.js";
|
|
102
|
-
export { listAllItemMetadata, locateItem, readLocatedItem, } from "../core/store/item-store.js";
|
|
103
|
+
export { listAllItemMetadata, listAllItemMetadataLight, locateItem, readLocatedItem, } from "../core/store/item-store.js";
|
|
103
104
|
export { getHistoryPath, getItemPath, getSettingsPath, resolveImplicitPmRoot, resolvePmRoot, } from "../core/store/paths.js";
|
|
104
105
|
export { readSettings } from "../core/store/settings.js";
|
|
105
106
|
export { runAggregate, } from "./query/aggregate.js";
|
|
@@ -169,6 +170,10 @@ export class PmClient {
|
|
|
169
170
|
context(options = {}) {
|
|
170
171
|
return this.runTyped("context", { options });
|
|
171
172
|
}
|
|
173
|
+
/** Read every item through the scalar-only metadata cache without materializing heavy collections or bodies. */
|
|
174
|
+
listAllItemMetadataLight() {
|
|
175
|
+
return listClientItemMetadataLight(this.defaults.path, this.defaults.cwd);
|
|
176
|
+
}
|
|
172
177
|
/** List items with the MCP/agent compact defaults. */
|
|
173
178
|
list(options = {}) {
|
|
174
179
|
return this.runTyped("list", { options });
|
|
@@ -1925,4 +1930,4 @@ async function loadWorkspaceExtensionRegistrations(pmRoot, settings, cwd) {
|
|
|
1925
1930
|
}
|
|
1926
1931
|
}
|
|
1927
1932
|
//# sourceMappingURL=runtime.js.map
|
|
1928
|
-
//# debugId=
|
|
1933
|
+
//# debugId=70ce3cab-35f0-508b-9348-2f8479495946
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* guarantees.
|
|
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]="7d175791-016d-59b6-a44d-a70371f36751")}catch(e){}}();
|
|
11
11
|
import { createHash } from "node:crypto";
|
|
12
12
|
import fs from "node:fs/promises";
|
|
13
13
|
import path from "node:path";
|
|
@@ -18,6 +18,7 @@ import { parseFieldsFile, serializeFieldsFile, } from "../core/schema/fields-fil
|
|
|
18
18
|
import { parseItemTypesFile, serializeItemTypesFile, } from "../core/schema/item-types-file.js";
|
|
19
19
|
import { DEFAULT_RUNTIME_SCHEMA_FILE_PATHS, filePathForSchemaSection, normalizeRuntimeSchemaSettings, } from "../core/schema/runtime-schema.js";
|
|
20
20
|
import { parseStatusDefsFile, serializeStatusDefsFile, } from "../core/schema/status-defs-file.js";
|
|
21
|
+
import { normalizeStatusToken } from "../core/schema/status-token.js";
|
|
21
22
|
import { getActiveExtensionRegistrations } from "../core/extensions/index.js";
|
|
22
23
|
import { listAllItemMetadataLight, locateItem, mutateItem, readLocatedItem, } from "../core/store/item-store.js";
|
|
23
24
|
import { getSettingsPath, resolvePmRoot } from "../core/store/paths.js";
|
|
@@ -55,9 +56,6 @@ export function deriveSchemaEvolutionMigrationId(requestInput, migrationScope) {
|
|
|
55
56
|
.slice(0, 20)}`;
|
|
56
57
|
}
|
|
57
58
|
function normalizedRequest(request) {
|
|
58
|
-
const normalizeToken = (value) => requiredText(value, "source or target")
|
|
59
|
-
.toLowerCase()
|
|
60
|
-
.replaceAll(/[\s-]+/g, "_");
|
|
61
59
|
const normalized = request.kind === "rename-type"
|
|
62
60
|
? {
|
|
63
61
|
kind: request.kind,
|
|
@@ -67,16 +65,16 @@ function normalizedRequest(request) {
|
|
|
67
65
|
: request.kind === "rename-field"
|
|
68
66
|
? {
|
|
69
67
|
kind: request.kind,
|
|
70
|
-
from:
|
|
71
|
-
to:
|
|
68
|
+
from: normalizeStatusToken(requiredText(request.from, "source")),
|
|
69
|
+
to: normalizeStatusToken(requiredText(request.to, "target")),
|
|
72
70
|
...(request.type === undefined
|
|
73
71
|
? {}
|
|
74
72
|
: { type: requiredText(request.type, "type") }),
|
|
75
73
|
}
|
|
76
74
|
: {
|
|
77
75
|
kind: request.kind,
|
|
78
|
-
from:
|
|
79
|
-
to:
|
|
76
|
+
from: normalizeStatusToken(requiredText(request.from, "source")),
|
|
77
|
+
to: normalizeStatusToken(requiredText(request.to, "target")),
|
|
80
78
|
};
|
|
81
79
|
if (normalized.from.toLowerCase() === normalized.to.toLowerCase()) {
|
|
82
80
|
throw new TypeError("Schema migration source and target must differ");
|
|
@@ -857,4 +855,4 @@ export const schemaMigrationTestOnly = {
|
|
|
857
855
|
validateAndStoreMigrationPlan,
|
|
858
856
|
};
|
|
859
857
|
//# sourceMappingURL=schema-migration.js.map
|
|
860
|
-
//# debugId=
|
|
858
|
+
//# debugId=7d175791-016d-59b6-a44d-a70371f36751
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { jaccardSimilarity } from "../core/shared/text-normalization.js";
|
|
1
2
|
/** Precomputed title signals reused by bounded batch similarity operations. */
|
|
2
3
|
export interface PreparedSimilarityText {
|
|
3
4
|
/** Canonical title used for exact comparison. */
|
|
@@ -20,8 +21,6 @@ export declare function normalizeSimilarityText(value: string): string;
|
|
|
20
21
|
export declare function tokenizeSimilarityText(value: string): string[];
|
|
21
22
|
/** Precompute every deterministic title signal exactly once for repeated comparisons. */
|
|
22
23
|
export declare function prepareSimilarityText(value: string): PreparedSimilarityText;
|
|
23
|
-
/** Measure set overlap between two token collections. */
|
|
24
|
-
export declare function jaccardSimilarity(leftTokens: readonly string[], rightTokens: readonly string[]): number;
|
|
25
24
|
/** Score two titles through the canonical exact, issue-code, and token signals. */
|
|
26
25
|
export declare function scoreItemSimilarity(leftTitle: string, rightTitle: string): ItemSimilarityScore;
|
|
27
26
|
/** Score two precomputed title representations without repeating normalization or tokenization. */
|
|
@@ -5,7 +5,9 @@
|
|
|
5
5
|
* extension packages without loading tracker query infrastructure.
|
|
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]="dff9b113-2b29-5154-afbf-f191f2f556a6")}catch(e){}}();
|
|
9
|
+
import { jaccardSimilarity } from "../core/shared/text-normalization.js";
|
|
10
|
+
export { jaccardSimilarity } from "../core/shared/text-normalization.js";
|
|
9
11
|
const ISSUE_CODE_PATTERN = /\b[a-z][a-z0-9]*-\d+(?:-[a-z0-9]+)*\b/giu;
|
|
10
12
|
/** Normalize title text for exact comparisons and tokenization. */
|
|
11
13
|
export function normalizeSimilarityText(value) {
|
|
@@ -30,20 +32,6 @@ export function prepareSimilarityText(value) {
|
|
|
30
32
|
],
|
|
31
33
|
};
|
|
32
34
|
}
|
|
33
|
-
/** Measure set overlap between two token collections. */
|
|
34
|
-
export function jaccardSimilarity(leftTokens, rightTokens) {
|
|
35
|
-
const left = new Set(leftTokens);
|
|
36
|
-
const right = new Set(rightTokens);
|
|
37
|
-
const union = new Set([...left, ...right]);
|
|
38
|
-
if (union.size === 0)
|
|
39
|
-
return 1;
|
|
40
|
-
let intersection = 0;
|
|
41
|
-
for (const token of left) {
|
|
42
|
-
if (right.has(token))
|
|
43
|
-
intersection += 1;
|
|
44
|
-
}
|
|
45
|
-
return intersection / union.size;
|
|
46
|
-
}
|
|
47
35
|
/** Score two titles through the canonical exact, issue-code, and token signals. */
|
|
48
36
|
export function scoreItemSimilarity(leftTitle, rightTitle) {
|
|
49
37
|
return scorePreparedItemSimilarity(prepareSimilarityText(leftTitle), prepareSimilarityText(rightTitle));
|
|
@@ -63,4 +51,4 @@ export function scorePreparedItemSimilarity(left, right) {
|
|
|
63
51
|
};
|
|
64
52
|
}
|
|
65
53
|
//# sourceMappingURL=similarity-scoring.js.map
|
|
66
|
-
//# debugId=
|
|
54
|
+
//# debugId=dff9b113-2b29-5154-afbf-f191f2f556a6
|
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. */
|