@unbrained/pm-cli 2026.8.11 → 2026.8.13
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 +74 -21
- package/dist/cli/commander-usage.js +37 -11
- package/dist/cli/error-guidance.d.ts +2 -0
- package/dist/cli/error-guidance.js +82 -19
- package/dist/cli/main.js +35 -19
- package/dist/cli/register-annotations.js +56 -3
- package/dist/cli/register-assurance.js +28 -17
- package/dist/cli/register-list-query.js +10 -7
- package/dist/cli/register-operations.js +16 -6
- package/dist/cli-bundle/bundle-manifest.json +163 -163
- package/dist/cli-bundle/chunks/chunk-3ZMOWAFM.js +2 -0
- package/dist/cli-bundle/chunks/chunk-DEDU3DG7.js +196 -0
- package/dist/cli-bundle/chunks/chunk-DL5M5J3V.js +13 -0
- package/dist/cli-bundle/chunks/chunk-F7FJYGK3.js +8 -0
- package/dist/cli-bundle/chunks/chunk-HIUZVCMN.js +5 -0
- package/dist/cli-bundle/chunks/chunk-IMGIN7R6.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-A2SJGHSI.js → chunk-Q47C67TQ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-WMEZHCFI.js → chunk-QGTUPEU5.js} +62 -54
- package/dist/cli-bundle/chunks/chunk-TF3TPKPR.js +34 -0
- package/dist/cli-bundle/chunks/{chunk-ZU34C3LH.js → chunk-YLBAPY22.js} +50 -50
- package/dist/cli-bundle/chunks/register-list-query-4HIZ7EA3.js +10 -0
- package/dist/cli-bundle/chunks/register-mutation-W64FZ5HN.js +20 -0
- package/dist/cli-bundle/chunks/register-operations-C44ET7R5.js +2 -0
- package/dist/cli-bundle/chunks/{register-setup-NOCOOWQY.js → register-setup-634MFRXU.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-27N23W6M.js +31 -0
- package/dist/cli-bundle/focused-chunks/{chunk-4H5IA6AV.js → chunk-2JP7W7GO.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-2RI2FESN.js +4 -0
- package/dist/cli-bundle/focused-chunks/chunk-3BNVU6LC.js +8 -0
- package/dist/cli-bundle/focused-chunks/{chunk-2DL3MRTD.js → chunk-3DJSGWVB.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-6MLIRBLV.js +5 -0
- package/dist/cli-bundle/focused-chunks/chunk-6XYLENDV.js +155 -0
- package/dist/cli-bundle/focused-chunks/chunk-CP4K4WFS.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-TL5M2PAY.js → chunk-E3AVJ655.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-EBTNSFYE.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-J5EKAIVD.js → chunk-HC2OL2H2.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-BKPIY34S.js → chunk-I75MANL7.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-IIS2FRKL.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-NFHFZH2Z.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-OGC4XSBC.js +17 -0
- package/dist/cli-bundle/focused-chunks/{chunk-UDAZWT25.js → chunk-OOYYKQWX.js} +4 -4
- package/dist/cli-bundle/focused-chunks/{chunk-23FTGO3W.js → chunk-PKPOZXLL.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-QDZUABWL.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-QQX5TDFT.js +16 -0
- package/dist/cli-bundle/focused-chunks/{chunk-55BIB6DV.js → chunk-TEZIXMTH.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-WEH6NSL6.js +18 -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 +42 -41
- package/dist/cli-bundle/sdk-governance.js +1 -1
- package/dist/cli-bundle/sdk-graph.js +1 -1
- package/dist/cli-bundle/sdk-merge.js +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/checkpoint/checkpoint-gc.js +7 -12
- package/dist/core/extensions/activation-summary-markdown.js +5 -4
- package/dist/core/extensions/activation-summary.d.ts +2 -0
- package/dist/core/extensions/activation-summary.js +6 -2
- package/dist/core/extensions/capability-usage.d.ts +1 -1
- package/dist/core/extensions/capability-usage.js +4 -3
- package/dist/core/extensions/contribution-inventory.d.ts +1 -0
- package/dist/core/extensions/contribution-inventory.js +6 -2
- package/dist/core/extensions/extension-registries.js +3 -2
- package/dist/core/extensions/extension-types.d.ts +83 -1
- package/dist/core/extensions/extension-types.js +3 -2
- package/dist/core/extensions/loader.d.ts +2 -8
- package/dist/core/extensions/loader.js +53 -144
- package/dist/core/extensions/registration-values.d.ts +43 -0
- package/dist/core/extensions/registration-values.js +210 -0
- package/dist/core/extensions/reserved-host-flags.js +3 -2
- package/dist/core/extensions/runtime-registrations.d.ts +3 -1
- package/dist/core/extensions/runtime-registrations.js +12 -2
- package/dist/core/fs/fs-utils.d.ts +2 -0
- package/dist/core/fs/fs-utils.js +7 -3
- package/dist/core/history/drift-cache.js +4 -3
- package/dist/core/history/drift-scan.js +16 -17
- package/dist/core/history/history.d.ts +8 -0
- package/dist/core/history/history.js +57 -7
- package/dist/core/history/replay.d.ts +9 -1
- package/dist/core/history/replay.js +48 -13
- package/dist/core/lock/lock-gc.js +8 -13
- package/dist/core/lock/lock.js +5 -4
- package/dist/core/output/output.d.ts +2 -0
- package/dist/core/output/output.js +46 -14
- package/dist/core/search/vector-stores.js +6 -11
- package/dist/core/shared/command-types.d.ts +2 -0
- package/dist/core/shared/command-types.js +2 -2
- package/dist/core/shared/errors.d.ts +5 -0
- package/dist/core/shared/errors.js +2 -2
- package/dist/core/store/item-metadata-cache.d.ts +1 -1
- package/dist/core/store/item-metadata-cache.js +16 -9
- package/dist/core/telemetry/runtime.d.ts +6 -0
- package/dist/core/telemetry/runtime.js +101 -30
- package/dist/sdk/agent/command-recovery.d.ts +2 -0
- package/dist/sdk/agent/command-recovery.js +10 -2
- package/dist/sdk/annotations.js +4 -4
- package/dist/sdk/cli-bootstrap.d.ts +2 -0
- package/dist/sdk/cli-bootstrap.js +6 -2
- package/dist/sdk/cli-contracts/completeness.js +10 -3
- package/dist/sdk/cli-contracts/enum-contracts.d.ts +1 -1
- package/dist/sdk/cli-contracts/flag-contracts.js +9 -3
- package/dist/sdk/cli-contracts/registration-helpers.d.ts +20 -3
- package/dist/sdk/cli-contracts/registration-helpers.js +18 -12
- package/dist/sdk/cli-contracts/schemas/assurance-definition.d.ts +40 -6
- package/dist/sdk/cli-contracts/schemas/assurance-definition.js +27 -3
- package/dist/sdk/cli-contracts/tool-option-contracts.js +3 -2
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +55 -5
- package/dist/sdk/cli-contracts/tool-schema.d.ts +2 -2
- package/dist/sdk/cli-contracts/tool-schema.js +22 -4
- package/dist/sdk/cli-program.js +3 -2
- package/dist/sdk/comments.js +4 -3
- package/dist/sdk/compile-cache.js +4 -3
- package/dist/sdk/completion.js +16 -7
- package/dist/sdk/compose.d.ts +3 -1
- package/dist/sdk/compose.js +16 -2
- package/dist/sdk/context-intent-contracts.js +45 -4
- package/dist/sdk/context-signal-store.js +4 -3
- package/dist/sdk/core.d.ts +1 -0
- package/dist/sdk/core.js +3 -2
- package/dist/sdk/extension/install-runtime.js +4 -4
- package/dist/sdk/extension/managed-state.js +4 -3
- package/dist/sdk/extension-contracts.d.ts +1 -1
- package/dist/sdk/flag-invocation-contracts.js +5 -6
- package/dist/sdk/generated/generated-error-code-catalog-part-1.d.ts +8 -0
- package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1597 -0
- package/dist/sdk/generated/generated-error-code-catalog-part-2.d.ts +8 -0
- package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1608 -0
- package/dist/sdk/generated-error-code-catalog.js +6 -3140
- package/dist/sdk/governance/assurance-action.d.ts +27 -3
- package/dist/sdk/governance/assurance-action.js +117 -31
- package/dist/sdk/governance/assurance-mutation-error.d.ts +14 -0
- package/dist/sdk/governance/assurance-mutation-error.js +58 -0
- package/dist/sdk/governance/assurance-presets.d.ts +54 -0
- package/dist/sdk/governance/assurance-presets.js +136 -0
- package/dist/sdk/governance/assurance-runtime.d.ts +4 -0
- package/dist/sdk/governance/assurance-runtime.js +118 -14
- package/dist/sdk/governance/assurance.d.ts +51 -6
- package/dist/sdk/governance/assurance.js +321 -67
- package/dist/sdk/governance/gc.js +5 -11
- package/dist/sdk/governance/health.d.ts +3 -1
- package/dist/sdk/governance/health.js +24 -7
- package/dist/sdk/governance/validate-item-reader.js +3 -3
- package/dist/sdk/governance/validate.d.ts +2 -0
- package/dist/sdk/governance/validate.js +15 -5
- package/dist/sdk/graph/durable-cache.d.ts +1 -1
- package/dist/sdk/graph/durable-cache.js +156 -29
- package/dist/sdk/graph/governance-contracts.d.ts +12 -0
- package/dist/sdk/graph/governance-contracts.js +27 -0
- package/dist/sdk/graph/governance.d.ts +44 -2
- package/dist/sdk/graph/governance.js +156 -12
- package/dist/sdk/guide.js +4 -4
- package/dist/sdk/index.d.ts +3 -2
- package/dist/sdk/index.js +5 -4
- package/dist/sdk/lifecycle/claim.js +10 -3
- package/dist/sdk/linked-artifacts.d.ts +2 -0
- package/dist/sdk/linked-artifacts.js +29 -4
- package/dist/sdk/merge/driver.d.ts +2 -2
- package/dist/sdk/merge/driver.js +3 -3
- package/dist/sdk/merge/install.js +5 -4
- package/dist/sdk/merge/receipts.d.ts +6 -4
- package/dist/sdk/merge/receipts.js +7 -5
- package/dist/sdk/merge/three-way.d.ts +2 -2
- package/dist/sdk/merge/three-way.js +3 -3
- package/dist/sdk/output-projection.d.ts +9 -1
- package/dist/sdk/output-projection.js +45 -9
- package/dist/sdk/query/activity.d.ts +49 -2
- package/dist/sdk/query/activity.js +185 -38
- package/dist/sdk/query/get.js +19 -2
- package/dist/sdk/read-output-contracts.d.ts +5 -1
- package/dist/sdk/read-output-contracts.js +17 -2
- package/dist/sdk/read-output-session.d.ts +2 -0
- package/dist/sdk/read-output-session.js +12 -5
- package/dist/sdk/relationship-history.js +5 -5
- package/dist/sdk/runtime-primitives.d.ts +3 -3
- package/dist/sdk/runtime-primitives.js +5 -5
- package/dist/sdk/runtime-stats-options.js +3 -2
- package/dist/sdk/runtime.js +5 -9
- package/dist/sdk/schema-migration.js +4 -4
- package/dist/sdk/stats.d.ts +36 -3
- package/dist/sdk/stats.js +55 -15
- package/dist/sdk/test/execution.d.ts +4 -0
- package/dist/sdk/test/execution.js +88 -23
- package/dist/sdk/workspace-memory.js +4 -4
- package/dist/sdk/workspace-snapshot.js +8 -14
- package/dist/sdk/workspace-transaction-gc.js +4 -9
- package/dist/sdk/workspace-transaction.js +4 -4
- package/dist/sdk/workspace.js +4 -3
- package/dist/types.d.ts +2 -0
- package/dist/types.js +2 -2
- package/docs/ASSURANCE.md +170 -14
- package/docs/COMMANDS.md +29 -8
- package/docs/CONFIGURATION.md +9 -0
- package/docs/DEPENDENCY_KIND_CONTRACT.md +10 -8
- package/docs/EXTENSIONS.md +11 -12
- package/docs/MERGE_SAFETY.md +3 -1
- package/docs/OUTPUT_PROJECTION_CONTRACTS.md +26 -13
- package/docs/README.md +2 -0
- package/docs/READ_OUTPUT_CONTRACTS.md +17 -2
- package/docs/RELATIONSHIP_GRAPH.md +15 -0
- package/docs/SDK.md +17 -3
- package/docs/SDK_AGENT_SESSION_CONTEXT.md +12 -1
- package/docs/SDK_CONTEXT_EVIDENCE_CONTRACTS.md +53 -0
- package/docs/SDK_CONTEXT_INTEGRITY.md +28 -1
- package/docs/TESTING.md +24 -15
- package/docs/TRUSTWORTHY_CONTEXT_EVIDENCE.md +106 -0
- package/docs/performance/sdk-entrypoint-import-costs.md +6 -2
- package/marketplace.json +2 -2
- package/package.json +6 -6
- 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 +384 -83
- package/dist/cli-bundle/chunks/chunk-2OOU2AFH.js +0 -8
- package/dist/cli-bundle/chunks/chunk-2RA2YTHJ.js +0 -33
- package/dist/cli-bundle/chunks/chunk-DSKYD4LG.js +0 -13
- package/dist/cli-bundle/chunks/chunk-HC3GM6YY.js +0 -194
- package/dist/cli-bundle/chunks/chunk-IUNRVDAI.js +0 -2
- package/dist/cli-bundle/chunks/chunk-W7CPZGSB.js +0 -2
- package/dist/cli-bundle/chunks/chunk-ZXOC6HG5.js +0 -5
- package/dist/cli-bundle/chunks/register-list-query-HAUXVUPY.js +0 -10
- package/dist/cli-bundle/chunks/register-mutation-7Y5U7ABT.js +0 -20
- package/dist/cli-bundle/chunks/register-operations-EQX3DLAZ.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-3AYKXMYX.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-4AHEC74N.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-4SV3ZKG3.js +0 -16
- package/dist/cli-bundle/focused-chunks/chunk-6JW6Z2P5.js +0 -8
- package/dist/cli-bundle/focused-chunks/chunk-D4PIWE6D.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-DPO7TEFX.js +0 -31
- package/dist/cli-bundle/focused-chunks/chunk-E3KCL7AY.js +0 -5
- package/dist/cli-bundle/focused-chunks/chunk-ERAAFLPS.js +0 -153
- package/dist/cli-bundle/focused-chunks/chunk-F6E4JZKG.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-FPSYO5ZG.js +0 -18
- package/dist/cli-bundle/focused-chunks/chunk-KDH5OX3D.js +0 -4
- package/dist/cli-bundle/focused-chunks/chunk-OJ3LVVIS.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-VABB4L5Y.js +0 -17
|
@@ -4,15 +4,17 @@
|
|
|
4
4
|
* Captures consent-aware telemetry and observability events 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]="26ea62d9-874d-5826-9822-83c5523b673b")}catch(e){}}();
|
|
8
8
|
import crypto from "node:crypto";
|
|
9
9
|
import { spawn } from "node:child_process";
|
|
10
10
|
import { mkdirSync, rmSync, statSync } from "node:fs";
|
|
11
11
|
import { mkdir, readdir, rm, stat } from "node:fs/promises";
|
|
12
|
+
import { request as httpRequest } from "node:http";
|
|
13
|
+
import { request as httpsRequest } from "node:https";
|
|
12
14
|
import os from "node:os";
|
|
13
15
|
import path from "node:path";
|
|
14
16
|
import { resolvePmPackageRootFromModule } from "../packages/root.js";
|
|
15
|
-
import { appendLineAtomic, readFileIfExists, writeFileAtomic, } from "../fs/fs-utils.js";
|
|
17
|
+
import { isFileMissingError, appendLineAtomic, readFileIfExists, writeFileAtomic, } from "../fs/fs-utils.js";
|
|
16
18
|
import { resolveTelemetryErrorCategory, } from "../shared/constants.js";
|
|
17
19
|
import { nowIso } from "../shared/time.js";
|
|
18
20
|
import { detectAgentIdentity, readAuthorEnvironment, } from "../shared/author.js";
|
|
@@ -22,11 +24,10 @@ import { deriveTelemetryCommandResolution, deriveTelemetryCommandTaxonomy, infer
|
|
|
22
24
|
const TELEMETRY_QUEUE_RELATIVE_PATH = path.join("runtime", "telemetry", "events.jsonl");
|
|
23
25
|
const TELEMETRY_STATE_RELATIVE_PATH = path.join("runtime", "telemetry", "state.json");
|
|
24
26
|
const TELEMETRY_OTEL_SPANS_RELATIVE_PATH = path.join("runtime", "telemetry", "otel-spans.jsonl");
|
|
25
|
-
//
|
|
26
|
-
//
|
|
27
|
-
//
|
|
28
|
-
//
|
|
29
|
-
// start a second concurrent worker.
|
|
27
|
+
// OTLP requests run concurrently, while event and OTLP phases run sequentially.
|
|
28
|
+
// The maximum configurable HTTP timeout therefore keeps two worst-case network
|
|
29
|
+
// phases below TELEMETRY_FLUSH_LOCK_STALE_MS (60s), preventing a later command
|
|
30
|
+
// from treating a live worker's lock as stale and starting a second worker.
|
|
30
31
|
const TELEMETRY_OTEL_SPANS_FLUSH_BATCH_SIZE = 8;
|
|
31
32
|
const TELEMETRY_OTEL_SPANS_MAX_PENDING = 500;
|
|
32
33
|
/** Public contract for telemetry schema version, shared by SDK and presentation-layer consumers. */
|
|
@@ -35,7 +36,9 @@ const TELEMETRY_CLIENT_SCHEMA_VERSION = 1;
|
|
|
35
36
|
const TELEMETRY_FLUSH_BATCH_SIZE = 100;
|
|
36
37
|
const TELEMETRY_MAX_RETRY_DELAY_MS = 3_600_000;
|
|
37
38
|
const TELEMETRY_RETRY_BASE_DELAY_MS = 30_000;
|
|
38
|
-
const
|
|
39
|
+
const TELEMETRY_HTTP_TIMEOUT_DEFAULT_MS = 20_000;
|
|
40
|
+
const TELEMETRY_HTTP_TIMEOUT_MIN_MS = 1_000;
|
|
41
|
+
const TELEMETRY_HTTP_TIMEOUT_MAX_MS = 25_000;
|
|
39
42
|
const MILLISECONDS_PER_DAY = 86_400_000;
|
|
40
43
|
const TELEMETRY_MAX_EVENT_BYTES = 65_536;
|
|
41
44
|
const TELEMETRY_SANITIZE_MAX_DEPTH = 6;
|
|
@@ -58,6 +61,8 @@ const PM_TELEMETRY_OTEL_DISABLED_VALUES = new Set(["1", "true", "yes", "on"]);
|
|
|
58
61
|
const PM_TELEMETRY_INLINE_FLUSH_ENV = "PM_TELEMETRY_INLINE_FLUSH";
|
|
59
62
|
const PM_TELEMETRY_FLUSH_CHILD_ENV = "PM_TELEMETRY_FLUSH_CHILD";
|
|
60
63
|
const PM_TELEMETRY_SOURCE_CONTEXT_ENV = "PM_TELEMETRY_SOURCE_CONTEXT";
|
|
64
|
+
const PM_TELEMETRY_HTTP_TIMEOUT_MS_ENV = "PM_TELEMETRY_HTTP_TIMEOUT_MS";
|
|
65
|
+
const NATIVE_FETCH = globalThis.fetch;
|
|
61
66
|
/** Supported values accepted by the pm telemetry source context contract. */
|
|
62
67
|
export const PM_TELEMETRY_SOURCE_CONTEXT_VALUES = [
|
|
63
68
|
"user",
|
|
@@ -390,6 +395,80 @@ function normalizeCaptureLevel(value) {
|
|
|
390
395
|
function parseBooleanTrueLike(value) {
|
|
391
396
|
return BOOLEAN_TRUE_VALUES.has((value ?? "").trim().toLowerCase());
|
|
392
397
|
}
|
|
398
|
+
/** Resolve the background event and OTLP request timeout within the flush-lock safety envelope. */
|
|
399
|
+
function resolveTelemetryHttpTimeoutMs() {
|
|
400
|
+
const rawConfigured = process.env[PM_TELEMETRY_HTTP_TIMEOUT_MS_ENV]?.trim();
|
|
401
|
+
if (!rawConfigured) {
|
|
402
|
+
return TELEMETRY_HTTP_TIMEOUT_DEFAULT_MS;
|
|
403
|
+
}
|
|
404
|
+
const configured = Number(rawConfigured);
|
|
405
|
+
if (!Number.isFinite(configured)) {
|
|
406
|
+
return TELEMETRY_HTTP_TIMEOUT_DEFAULT_MS;
|
|
407
|
+
}
|
|
408
|
+
return Math.min(TELEMETRY_HTTP_TIMEOUT_MAX_MS, Math.max(TELEMETRY_HTTP_TIMEOUT_MIN_MS, Math.trunc(configured)));
|
|
409
|
+
}
|
|
410
|
+
/** POST a JSON payload with one total timeout that covers DNS, connection, TLS, and response completion. */
|
|
411
|
+
async function postTelemetryJson(endpoint, headers, body) {
|
|
412
|
+
const url = new URL(endpoint);
|
|
413
|
+
// A replaced global fetch is an intentional runtime adapter used by the
|
|
414
|
+
// repository's deterministic tests and by embedders that instrument network
|
|
415
|
+
// traffic. Production retains the native HTTP transport below so Node's
|
|
416
|
+
// independent built-in-fetch connect timeout cannot preempt our bound.
|
|
417
|
+
if (globalThis.fetch !== NATIVE_FETCH) {
|
|
418
|
+
const controller = new AbortController();
|
|
419
|
+
let timeout;
|
|
420
|
+
const deadline = new Promise((_resolve, reject) => {
|
|
421
|
+
timeout = setTimeout(() => {
|
|
422
|
+
controller.abort();
|
|
423
|
+
reject(new Error("telemetry_http_timeout"));
|
|
424
|
+
}, resolveTelemetryHttpTimeoutMs());
|
|
425
|
+
});
|
|
426
|
+
try {
|
|
427
|
+
const response = await Promise.race([
|
|
428
|
+
globalThis.fetch(endpoint, {
|
|
429
|
+
method: "POST",
|
|
430
|
+
headers,
|
|
431
|
+
body,
|
|
432
|
+
signal: controller.signal,
|
|
433
|
+
}),
|
|
434
|
+
deadline,
|
|
435
|
+
]);
|
|
436
|
+
return response.status;
|
|
437
|
+
}
|
|
438
|
+
finally {
|
|
439
|
+
clearTimeout(timeout);
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
const request = url.protocol === "https:"
|
|
443
|
+
? httpsRequest
|
|
444
|
+
: url.protocol === "http:"
|
|
445
|
+
? httpRequest
|
|
446
|
+
: undefined;
|
|
447
|
+
if (!request) {
|
|
448
|
+
throw new Error(`telemetry_http_protocol_unsupported_${url.protocol}`);
|
|
449
|
+
}
|
|
450
|
+
return new Promise((resolve, reject) => {
|
|
451
|
+
const timeoutMs = resolveTelemetryHttpTimeoutMs();
|
|
452
|
+
const requestOptions = {
|
|
453
|
+
method: "POST",
|
|
454
|
+
headers: {
|
|
455
|
+
...headers,
|
|
456
|
+
"content-length": Buffer.byteLength(body),
|
|
457
|
+
},
|
|
458
|
+
signal: AbortSignal.timeout(timeoutMs),
|
|
459
|
+
autoSelectFamilyAttemptTimeout: Math.min(5_000, timeoutMs),
|
|
460
|
+
};
|
|
461
|
+
const clientRequest = request(url, requestOptions, (response) => {
|
|
462
|
+
response.once("error", reject);
|
|
463
|
+
// Client responses always carry an HTTP status code; Node's shared
|
|
464
|
+
// IncomingMessage type is also used for server requests where it is absent.
|
|
465
|
+
response.once("end", () => resolve(response.statusCode));
|
|
466
|
+
response.resume();
|
|
467
|
+
});
|
|
468
|
+
clientRequest.once("error", reject);
|
|
469
|
+
clientRequest.end(body);
|
|
470
|
+
});
|
|
471
|
+
}
|
|
393
472
|
function normalizePmVersion(value) {
|
|
394
473
|
const trimmed = typeof value === "string" ? value.trim() : "";
|
|
395
474
|
return trimmed.length > 0 ? trimmed : "0.0.0";
|
|
@@ -1214,14 +1293,9 @@ async function flushPendingOtelSpans(globalPmRoot, retentionDays) {
|
|
|
1214
1293
|
// and safe under Node's single-threaded event loop.
|
|
1215
1294
|
await Promise.all(due.map(async (span) => {
|
|
1216
1295
|
try {
|
|
1217
|
-
const
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
body: JSON.stringify(span.payload),
|
|
1221
|
-
signal: AbortSignal.timeout(TELEMETRY_HTTP_TIMEOUT_MS),
|
|
1222
|
-
});
|
|
1223
|
-
if (!response.ok) {
|
|
1224
|
-
throw new Error(`local_otel_export_http_${response.status}`);
|
|
1296
|
+
const status = await postTelemetryJson(span.endpoint, { "content-type": "application/json" }, JSON.stringify(span.payload));
|
|
1297
|
+
if (status < 200 || status >= 300) {
|
|
1298
|
+
throw new Error(`local_otel_export_http_${status}`);
|
|
1225
1299
|
}
|
|
1226
1300
|
succeededIds.add(span.id);
|
|
1227
1301
|
succeededCount += 1;
|
|
@@ -1398,17 +1472,12 @@ async function flushQueue(globalPmRoot, endpoint, retentionDays) {
|
|
|
1398
1472
|
requestHeaders["x-pm-telemetry-key"] = ingestKey;
|
|
1399
1473
|
}
|
|
1400
1474
|
try {
|
|
1401
|
-
const
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
}),
|
|
1408
|
-
signal: AbortSignal.timeout(TELEMETRY_HTTP_TIMEOUT_MS),
|
|
1409
|
-
});
|
|
1410
|
-
if (!response.ok) {
|
|
1411
|
-
throw new Error(`telemetry_flush_http_${response.status}`);
|
|
1475
|
+
const status = await postTelemetryJson(normalizedEndpoint, requestHeaders, JSON.stringify({
|
|
1476
|
+
schema_version: TELEMETRY_SCHEMA_VERSION,
|
|
1477
|
+
events: dueEntries.map((entry) => entry.event),
|
|
1478
|
+
}));
|
|
1479
|
+
if (status < 200 || status >= 300) {
|
|
1480
|
+
throw new Error(`telemetry_flush_http_${status}`);
|
|
1412
1481
|
}
|
|
1413
1482
|
}
|
|
1414
1483
|
catch (error) {
|
|
@@ -1519,7 +1588,7 @@ function createDirectoryLock(lockPath) {
|
|
|
1519
1588
|
if (code === "EEXIST") {
|
|
1520
1589
|
return false;
|
|
1521
1590
|
}
|
|
1522
|
-
if (
|
|
1591
|
+
if (!isFileMissingError(error)) {
|
|
1523
1592
|
return false;
|
|
1524
1593
|
}
|
|
1525
1594
|
}
|
|
@@ -1547,7 +1616,7 @@ function acquireTelemetryFlushSpawnGate(globalPmRoot) {
|
|
|
1547
1616
|
removeDirectoryLockBestEffort(lockPath);
|
|
1548
1617
|
}
|
|
1549
1618
|
catch (error) {
|
|
1550
|
-
if (
|
|
1619
|
+
if (!isFileMissingError(error)) {
|
|
1551
1620
|
return false;
|
|
1552
1621
|
}
|
|
1553
1622
|
}
|
|
@@ -1586,11 +1655,13 @@ export const _testOnly = {
|
|
|
1586
1655
|
looksLikeEmailToken,
|
|
1587
1656
|
otelSpansQueuePath,
|
|
1588
1657
|
parseBooleanTrueLike,
|
|
1658
|
+
postTelemetryJson,
|
|
1589
1659
|
parsePendingOtelSpanLines,
|
|
1590
1660
|
prunePendingOtelSpans,
|
|
1591
1661
|
reconcilePendingOtelSpansAfterFlush,
|
|
1592
1662
|
retentionCutoffMs,
|
|
1593
1663
|
resolveOtelTracesEndpoint,
|
|
1664
|
+
resolveTelemetryHttpTimeoutMs,
|
|
1594
1665
|
rewritePendingOtelSpans,
|
|
1595
1666
|
normalizeForHash,
|
|
1596
1667
|
normalizeCaptureLevel,
|
|
@@ -1915,4 +1986,4 @@ export async function emitTelemetryErrorEvent(context) {
|
|
|
1915
1986
|
}
|
|
1916
1987
|
}
|
|
1917
1988
|
//# sourceMappingURL=runtime.js.map
|
|
1918
|
-
//# debugId=
|
|
1989
|
+
//# debugId=26ea62d9-874d-5826-9822-83c5523b673b
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/** Resolve a recovery command without interpreting global option values as command tokens. */
|
|
2
|
+
export declare function resolveRecoveryCommandName(invocationArgv: string[] | undefined): string | undefined;
|
|
1
3
|
/** Resolve the truthful placeholder for a missing flag from its contract. */
|
|
2
4
|
export declare function resolveMissingOptionPlaceholder(commandName: string, missingLabel: string): string | null | undefined;
|
|
3
5
|
/** Preserve an attempted argv vector and insert each missing option before `--`. */
|
|
@@ -6,13 +6,21 @@
|
|
|
6
6
|
* supplied arguments are preserved byte-for-token.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
9
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="4973a995-60f0-5990-9927-371dc6716063")}catch(e){}}();
|
|
10
10
|
import { renderPmCommand } from "../command-line.js";
|
|
11
11
|
import { resolveSubcommandFlagContractsForCommand } from "../cli-contracts.js";
|
|
12
|
+
import { parseBootstrapCommandName } from "../cli-bootstrap.js";
|
|
12
13
|
function normalizeMissingFlag(label) {
|
|
13
14
|
const match = label.trim().match(/--[a-z0-9][a-z0-9_-]*/i);
|
|
14
15
|
return match?.[0]?.replaceAll("_", "-").toLowerCase();
|
|
15
16
|
}
|
|
17
|
+
/** Resolve a recovery command without interpreting global option values as command tokens. */
|
|
18
|
+
export function resolveRecoveryCommandName(invocationArgv) {
|
|
19
|
+
if (!Array.isArray(invocationArgv) || invocationArgv.length === 0) {
|
|
20
|
+
return undefined;
|
|
21
|
+
}
|
|
22
|
+
return parseBootstrapCommandName(invocationArgv);
|
|
23
|
+
}
|
|
16
24
|
/** Resolve the truthful placeholder for a missing flag from its contract. */
|
|
17
25
|
export function resolveMissingOptionPlaceholder(commandName, missingLabel) {
|
|
18
26
|
const flag = normalizeMissingFlag(missingLabel);
|
|
@@ -49,4 +57,4 @@ export function renderMissingOptionRetry(invocationArgv, commandName, missingLab
|
|
|
49
57
|
: renderPmCommand(retry);
|
|
50
58
|
}
|
|
51
59
|
//# sourceMappingURL=command-recovery.js.map
|
|
52
|
-
//# debugId=
|
|
60
|
+
//# debugId=4973a995-60f0-5990-9927-371dc6716063
|
package/dist/sdk/annotations.js
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* Implements the pm annotation command command surface and its agent-facing runtime behavior.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
7
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="0af9967c-ca72-563a-9518-2e68da0c0fe0")}catch(e){}}();
|
|
8
8
|
import { readFile } from "node:fs/promises";
|
|
9
|
-
import { pathExists } from "../core/fs/fs-utils.js";
|
|
9
|
+
import { isFileAbsentError, pathExists } from "../core/fs/fs-utils.js";
|
|
10
10
|
import { getActiveExtensionRegistrations } from "../core/extensions/index.js";
|
|
11
11
|
import { resolveItemTypeRegistry } from "../core/item/type-registry.js";
|
|
12
12
|
import { createStdinTokenResolver, parseCsvKv } from "../core/item/parse.js";
|
|
@@ -114,7 +114,7 @@ async function resolveAnnotationTextSource(options, noun) {
|
|
|
114
114
|
return { value: await readFile(filePath, "utf8"), emptyFlag: "--file" };
|
|
115
115
|
}
|
|
116
116
|
catch (error) {
|
|
117
|
-
if (isErrnoError(error) && error
|
|
117
|
+
if (isErrnoError(error) && isFileAbsentError(error)) {
|
|
118
118
|
throw new PmCliError(`--file path not found: ${filePath}`, EXIT_CODE.USAGE);
|
|
119
119
|
}
|
|
120
120
|
const detail = error instanceof Error ? error.message : String(error);
|
|
@@ -399,4 +399,4 @@ function renderAnnotationResult(id, collectionKey, allEntries, limit, includeMet
|
|
|
399
399
|
};
|
|
400
400
|
}
|
|
401
401
|
//# sourceMappingURL=annotations.js.map
|
|
402
|
-
//# debugId=
|
|
402
|
+
//# debugId=0af9967c-ca72-563a-9518-2e68da0c0fe0
|
|
@@ -31,6 +31,8 @@ export interface BootstrapGlobalOptions {
|
|
|
31
31
|
outputFormat?: "toon" | "json";
|
|
32
32
|
/** Caller-carried cross-call budget and served-item state. */
|
|
33
33
|
outputSession?: string;
|
|
34
|
+
/** Whether machine-readable row discovery metadata is requested. */
|
|
35
|
+
outputRowContract?: boolean;
|
|
34
36
|
/** Invocation-wide mutation author override. */
|
|
35
37
|
author?: string;
|
|
36
38
|
/** Whether `--author` was present without its required value. */
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Provides public bootstrap argument normalization for embedded CLI hosts.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
7
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="7b3209a8-8580-542c-9e80-21d04df3f61f")}catch(e){}}();
|
|
8
8
|
import { EXECUTABLE_COMMAND_ALIASES, resolveSubcommandFlagContractsForCommand, } from "./cli-contracts.js";
|
|
9
9
|
export { EXECUTABLE_COMMAND_ALIASES };
|
|
10
10
|
import { levenshteinDistanceWithinLimit } from "../core/shared/levenshtein.js";
|
|
@@ -47,6 +47,7 @@ const BOOTSTRAP_BOOLEAN_FLAGS = new Set([
|
|
|
47
47
|
"--quiet",
|
|
48
48
|
"--lean",
|
|
49
49
|
"--token-accounting",
|
|
50
|
+
"--output-row-contract",
|
|
50
51
|
]);
|
|
51
52
|
/** Consume one bootstrap-global token and update the accumulated parse state. */
|
|
52
53
|
function consumeBootstrapGlobalToken(argv, index, state) {
|
|
@@ -95,6 +96,9 @@ export function parseBootstrapGlobalOptions(argv) {
|
|
|
95
96
|
quiet: state.booleanFlags.has("--quiet"),
|
|
96
97
|
lean: state.booleanFlags.has("--lean"),
|
|
97
98
|
tokenAccounting: state.booleanFlags.has("--token-accounting"),
|
|
99
|
+
...(state.booleanFlags.has("--output-row-contract")
|
|
100
|
+
? { outputRowContract: true }
|
|
101
|
+
: {}),
|
|
98
102
|
...(state.outputValues.get("--output-include") === undefined
|
|
99
103
|
? {}
|
|
100
104
|
: { outputInclude: state.outputValues.get("--output-include") }),
|
|
@@ -886,4 +890,4 @@ export const _testOnly = {
|
|
|
886
890
|
resolveCanonicalFlag,
|
|
887
891
|
};
|
|
888
892
|
//# sourceMappingURL=cli-bootstrap.js.map
|
|
889
|
-
//# debugId=
|
|
893
|
+
//# debugId=7b3209a8-8580-542c-9e80-21d04df3f61f
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* a hand-picked test list.
|
|
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]="cf238c71-1626-5e48-9207-7acf22c0d680")}catch(e){}}();
|
|
11
11
|
import { PM_TOOL_ACTIONS } from "./enum-contracts.js";
|
|
12
12
|
import { resolveSubcommandFlagContractsForCommand, } from "./flag-contracts.js";
|
|
13
13
|
import { pmToolActionParameterKeys } from "./tool-schema.js";
|
|
@@ -23,6 +23,7 @@ const CLI_TRANSPORT_FLAGS = new Set([
|
|
|
23
23
|
"--output-budget",
|
|
24
24
|
"--output-format",
|
|
25
25
|
"--output-session",
|
|
26
|
+
"--output-row-contract",
|
|
26
27
|
"--no-changed-fields",
|
|
27
28
|
"--no-extensions",
|
|
28
29
|
"--no-pager",
|
|
@@ -79,6 +80,7 @@ const ACTION_POSITIONAL_PARAMETERS = {
|
|
|
79
80
|
assurance: {
|
|
80
81
|
id: "<id>",
|
|
81
82
|
kind: "<kind>",
|
|
83
|
+
preset: "[kind]|[id]",
|
|
82
84
|
subcommand: "<action>",
|
|
83
85
|
},
|
|
84
86
|
event: { title: "<title>" },
|
|
@@ -94,7 +96,12 @@ const ACTION_POSITIONAL_PARAMETERS = {
|
|
|
94
96
|
},
|
|
95
97
|
};
|
|
96
98
|
const ACTION_FLAG_PARAMETER_OVERRIDES = {
|
|
97
|
-
assurance: {
|
|
99
|
+
assurance: {
|
|
100
|
+
"--tree": "treeId",
|
|
101
|
+
"--owner": "owner",
|
|
102
|
+
"--apply": "apply",
|
|
103
|
+
"--enforcement": "enforcement",
|
|
104
|
+
},
|
|
98
105
|
init: {
|
|
99
106
|
"--id-prefix": "idPrefix",
|
|
100
107
|
"--no-merge-fence": "mergeFence",
|
|
@@ -376,4 +383,4 @@ export function analyzeSdkCliParameterCompleteness(source = {}) {
|
|
|
376
383
|
});
|
|
377
384
|
}
|
|
378
385
|
//# sourceMappingURL=completeness.js.map
|
|
379
|
-
//# debugId=
|
|
386
|
+
//# debugId=cf238c71-1626-5e48-9207-7acf22c0d680
|
|
@@ -19,7 +19,7 @@ export declare const PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS: readonly ["none", "
|
|
|
19
19
|
/** Restricts pm extension sandbox profile contract values accepted by command, SDK, and storage contracts. */
|
|
20
20
|
export type PmExtensionSandboxProfileContract = (typeof PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS)[number];
|
|
21
21
|
/** Public contract for pm extension policy surface contracts, shared by SDK and presentation-layer consumers. */
|
|
22
|
-
export declare const PM_EXTENSION_POLICY_SURFACE_CONTRACTS: readonly ["commands.override", "commands.handler", "hooks.beforecommand", "hooks.beforemutation", "hooks.aftercommand", "hooks.onwrite", "hooks.onread", "hooks.onindex", "schema.flags", "schema.itemfields", "schema.itemtypes", "schema.relationshipkinds", "schema.migrations", "schema.profiles", "parser.override", "preflight.override", "services.override", "renderers.override", "importers.importer", "importers.exporter", "search.provider", "search.vectorstore"];
|
|
22
|
+
export declare const PM_EXTENSION_POLICY_SURFACE_CONTRACTS: readonly ["commands.override", "commands.handler", "hooks.beforecommand", "hooks.beforemutation", "hooks.aftercommand", "hooks.onwrite", "hooks.onread", "hooks.onindex", "schema.flags", "schema.itemfields", "schema.itemtypes", "schema.relationshipkinds", "schema.migrations", "schema.profiles", "parser.override", "preflight.override", "services.override", "renderers.override", "importers.importer", "importers.exporter", "search.provider", "search.vectorstore", "services.assuranceprovider"];
|
|
23
23
|
/** Restricts pm extension policy surface contract values accepted by command, SDK, and storage contracts. */
|
|
24
24
|
export type PmExtensionPolicySurfaceContract = (typeof PM_EXTENSION_POLICY_SURFACE_CONTRACTS)[number];
|
|
25
25
|
/** Public contract for pm core command names, shared by SDK and presentation-layer consumers. */
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* flag surface stays single-sourced across the CLI, SDK, and MCP boundaries.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
10
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="a5a2c81f-8870-5111-b13c-74c362098d54")}catch(e){}}();
|
|
11
11
|
import { normalizeUniqueStringList } from "./string-lists.js";
|
|
12
12
|
import { RESERVED_EXTENSION_HOST_FLAGS } from "../../core/extensions/reserved-host-flags.js";
|
|
13
13
|
function normalizeFlagAliasKey(flag) {
|
|
@@ -392,7 +392,7 @@ export const SCHEMA_FLAG_CONTRACTS = [
|
|
|
392
392
|
// add-type --infer flags (title-prefix type inference).
|
|
393
393
|
{ flag: "--infer" },
|
|
394
394
|
{ flag: "--min-count" },
|
|
395
|
-
{ flag: "--apply" },
|
|
395
|
+
{ flag: "--apply", value_type: "boolean" },
|
|
396
396
|
// Lossless schema evolution flags.
|
|
397
397
|
{ flag: "--to" },
|
|
398
398
|
{ flag: "--migration-id", aliases: ["--migration_id"] },
|
|
@@ -875,6 +875,7 @@ export const TEST_FLAG_CONTRACTS = [
|
|
|
875
875
|
{ flag: "--add" },
|
|
876
876
|
{ flag: "--add-json" },
|
|
877
877
|
{ flag: "--remove" },
|
|
878
|
+
{ flag: "--remove-index", repeatable: true },
|
|
878
879
|
{ flag: "--run" },
|
|
879
880
|
{ flag: "--match" },
|
|
880
881
|
{ flag: "--only-index" },
|
|
@@ -940,6 +941,7 @@ export const GC_FLAG_CONTRACTS = [
|
|
|
940
941
|
];
|
|
941
942
|
/** Public contract for stats flag contracts, shared by SDK and presentation-layer consumers. */
|
|
942
943
|
export const STATS_FLAG_CONTRACTS = [
|
|
944
|
+
{ flag: "--include-empty" },
|
|
943
945
|
{ flag: "--storage" },
|
|
944
946
|
{ flag: "--metadata-coverage" },
|
|
945
947
|
{ flag: "--field-utilization" },
|
|
@@ -1016,6 +1018,9 @@ export const ASSURANCE_FLAG_CONTRACTS = [
|
|
|
1016
1018
|
{ flag: "--dry-run" },
|
|
1017
1019
|
{ flag: "--author", value_name: "value" },
|
|
1018
1020
|
{ flag: "--message", value_name: "value" },
|
|
1021
|
+
{ flag: "--owner", value_name: "item-id" },
|
|
1022
|
+
{ flag: "--apply", value_type: "boolean" },
|
|
1023
|
+
{ flag: "--enforcement", value_name: "level" },
|
|
1019
1024
|
];
|
|
1020
1025
|
const ITEM_OWNERSHIP_AND_ISSUE_FLAG_CONTRACTS = [
|
|
1021
1026
|
{ flag: "--assignee" },
|
|
@@ -1391,6 +1396,7 @@ export const ACTIVITY_FLAG_CONTRACTS = [
|
|
|
1391
1396
|
{ flag: "--limit" },
|
|
1392
1397
|
{ flag: "--unbounded" },
|
|
1393
1398
|
{ flag: "--compact" },
|
|
1399
|
+
{ flag: "--raw" },
|
|
1394
1400
|
{ flag: "--full" },
|
|
1395
1401
|
{ flag: "--provenance" },
|
|
1396
1402
|
{ flag: "--provenance-summary" },
|
|
@@ -1811,4 +1817,4 @@ export function toCompletionFlagString(flagContracts, includeGlobal = true) {
|
|
|
1811
1817
|
return normalizeUniqueStringList(all).join(" ");
|
|
1812
1818
|
}
|
|
1813
1819
|
//# sourceMappingURL=flag-contracts.js.map
|
|
1814
|
-
//# debugId=
|
|
1820
|
+
//# debugId=a5a2c81f-8870-5111-b13c-74c362098d54
|
|
@@ -70,22 +70,39 @@ export declare function printActivityJsonStream(result: ActivityCommandResult, o
|
|
|
70
70
|
export declare function normalizeSearchOptions(options: Record<string, unknown>): Record<string, unknown>;
|
|
71
71
|
/** Implements normalize search keywords input for the public runtime surface of this module. */
|
|
72
72
|
export declare function normalizeSearchKeywordsInput(keywords: string[]): string;
|
|
73
|
-
/**
|
|
74
|
-
export
|
|
73
|
+
/** Canonical Commander-normalized activity query options. */
|
|
74
|
+
export interface NormalizedActivityOptions {
|
|
75
|
+
/** Exact item identifier filter. */
|
|
75
76
|
id?: string;
|
|
77
|
+
/** Exact immutable history operation filter. */
|
|
76
78
|
op?: string;
|
|
79
|
+
/** Exact recorded author filter. */
|
|
77
80
|
author?: string;
|
|
81
|
+
/** Inclusive activity window lower bound. */
|
|
78
82
|
from?: string;
|
|
83
|
+
/** Inclusive activity window upper bound. */
|
|
79
84
|
to?: string;
|
|
85
|
+
/** Maximum projected row count encoded as Commander text. */
|
|
80
86
|
limit?: string;
|
|
87
|
+
/** Select the compact raw-event projection. */
|
|
81
88
|
compact?: boolean;
|
|
89
|
+
/** Select a raw event projection instead of the item digest. */
|
|
90
|
+
raw?: boolean;
|
|
91
|
+
/** Disable the default projection row bound. */
|
|
82
92
|
unbounded?: boolean;
|
|
93
|
+
/** Select privacy-safe provenance event rows. */
|
|
83
94
|
provenance?: boolean;
|
|
95
|
+
/** Include constant-size provenance completeness metrics. */
|
|
84
96
|
provenanceSummary?: boolean;
|
|
97
|
+
/** Canonical harness filters supplied by Commander. */
|
|
85
98
|
harness?: string[];
|
|
99
|
+
/** Privacy-safe agent invocation fingerprint filters. */
|
|
86
100
|
agentInstance?: string[];
|
|
101
|
+
/** Exact provenance dimension predicates. */
|
|
87
102
|
provenanceFilter?: string[];
|
|
88
|
-
}
|
|
103
|
+
}
|
|
104
|
+
/** Implements normalize activity options for the public runtime surface of this module. */
|
|
105
|
+
export declare function normalizeActivityOptions(options: Record<string, unknown>): NormalizedActivityOptions;
|
|
89
106
|
/** Implements resolve activity stream mode for the public runtime surface of this module. */
|
|
90
107
|
export declare function resolveActivityStreamMode(raw: unknown): boolean;
|
|
91
108
|
/** Implements normalize context options for the public runtime surface of this module. */
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Provides CLI runtime support for Registration Helpers.
|
|
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]="daefefd1-3b0b-513d-8b8c-ab17f90b995a")}catch(e){}}();
|
|
8
8
|
import { Option } from "commander";
|
|
9
9
|
import { pathExists, refreshSearchArtifactsForMutation, shouldRunSearchRefreshInForeground, EXIT_CODE, PmCliError, printError, printResult, writeStdout, getSettingsPath, resolvePmRoot, readSettings, runActiveServiceOverride, setActiveCommandResult, } from "../runtime-primitives.js";
|
|
10
10
|
import { ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS, CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS, CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS, CREATE_COMMANDER_STRING_OPTION_CONTRACTS, LIST_COMMANDER_STRING_OPTION_CONTRACTS, NEXT_COMMANDER_STRING_OPTION_CONTRACTS, SEARCH_COMMANDER_STRING_OPTION_CONTRACTS, UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS, UPDATE_COMMANDER_STRING_OPTION_CONTRACTS, readFirstValueFromCommanderOptions, readFirstStringFromCommanderOptions, readStringArrayFromCommanderOptions, } from "../cli-contracts.js";
|
|
@@ -100,7 +100,7 @@ export function getGlobalOptions(command) {
|
|
|
100
100
|
: typeof reader.opts === "function"
|
|
101
101
|
? reader.opts()
|
|
102
102
|
: {};
|
|
103
|
-
|
|
103
|
+
const normalized = {
|
|
104
104
|
json: opts.json === true ? true : undefined,
|
|
105
105
|
quiet: Boolean(opts.quiet),
|
|
106
106
|
noChangedFields: opts.changedFields === false,
|
|
@@ -112,20 +112,19 @@ export function getGlobalOptions(command) {
|
|
|
112
112
|
outputLimit: readStringCommandOption(opts, "outputLimit"),
|
|
113
113
|
outputBudget: readStringCommandOption(opts, "outputBudget"),
|
|
114
114
|
outputSession: readStringCommandOption(opts, "outputSession"),
|
|
115
|
+
...(opts.outputRowContract === true ? { outputRowContract: true } : {}),
|
|
115
116
|
...(opts.outputFormat === "toon" || opts.outputFormat === "json"
|
|
116
117
|
? { outputFormat: opts.outputFormat }
|
|
117
118
|
: {}),
|
|
118
|
-
path:
|
|
119
|
-
|
|
120
|
-
: typeof opts.path === "string"
|
|
121
|
-
? opts.path
|
|
122
|
-
: undefined,
|
|
119
|
+
path: readStringCommandOption(opts, "pmPath") ??
|
|
120
|
+
readStringCommandOption(opts, "path"),
|
|
123
121
|
noExtensions: opts.extensions === false,
|
|
124
122
|
noPager: Boolean(opts.noPager),
|
|
125
123
|
profile: Boolean(opts.profile),
|
|
126
124
|
...(commandPath.length > 0 ? { command: commandPath } : {}),
|
|
127
125
|
...(typeof opts.author === "string" ? { author: opts.author } : {}),
|
|
128
126
|
};
|
|
127
|
+
return normalized;
|
|
129
128
|
}
|
|
130
129
|
/** Implements get command path for the public runtime surface of this module. */
|
|
131
130
|
export function getCommandPath(command) {
|
|
@@ -239,6 +238,7 @@ export function buildBackgroundTestCommandArgs(id, options) {
|
|
|
239
238
|
pushRepeatableValueFlag(args, "--add", options.add);
|
|
240
239
|
pushRepeatableValueFlag(args, "--add-json", options.addJson);
|
|
241
240
|
pushRepeatableValueFlag(args, "--remove", options.remove);
|
|
241
|
+
pushRepeatableValueFlag(args, "--remove-index", options.removeIndex);
|
|
242
242
|
pushOptionalValueFlag(args, "--match", options.match);
|
|
243
243
|
pushOptionalValueFlag(args, "--only-index", options.onlyIndex);
|
|
244
244
|
pushOptionalBooleanFlag(args, "--only-last", options.onlyLast);
|
|
@@ -792,7 +792,7 @@ export function normalizeSearchKeywordsInput(keywords) {
|
|
|
792
792
|
/** Implements normalize activity options for the public runtime surface of this module. */
|
|
793
793
|
export function normalizeActivityOptions(options) {
|
|
794
794
|
const readActivityString = (target) => readFirstStringFromCommanderOptions(options, resolveCommanderContract(ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS, target));
|
|
795
|
-
|
|
795
|
+
const normalized = {
|
|
796
796
|
id: readActivityString("id"),
|
|
797
797
|
op: readActivityString("op"),
|
|
798
798
|
author: readActivityString("author"),
|
|
@@ -801,9 +801,14 @@ export function normalizeActivityOptions(options) {
|
|
|
801
801
|
limit: readActivityString("limit"),
|
|
802
802
|
compact: options.full === true || options.provenance === true
|
|
803
803
|
? false
|
|
804
|
-
: options.compact ===
|
|
805
|
-
?
|
|
806
|
-
:
|
|
804
|
+
: options.compact === true || options.raw === true
|
|
805
|
+
? true
|
|
806
|
+
: undefined,
|
|
807
|
+
...(options.raw === true ||
|
|
808
|
+
options.compact === true ||
|
|
809
|
+
options.full === true
|
|
810
|
+
? { raw: true }
|
|
811
|
+
: {}),
|
|
807
812
|
unbounded: optionTrue(options, "unbounded"),
|
|
808
813
|
provenance: optionTrue(options, "provenance"),
|
|
809
814
|
provenanceSummary: optionTrue(options, "provenanceSummary"),
|
|
@@ -817,6 +822,7 @@ export function normalizeActivityOptions(options) {
|
|
|
817
822
|
? options.provenanceFilter
|
|
818
823
|
: undefined,
|
|
819
824
|
};
|
|
825
|
+
return Object.fromEntries(Object.entries(normalized).filter(([, value]) => value !== undefined));
|
|
820
826
|
}
|
|
821
827
|
const ACTIVITY_STREAM_ENABLED_VALUES = new Set([
|
|
822
828
|
"",
|
|
@@ -978,4 +984,4 @@ export const _testOnly = {
|
|
|
978
984
|
collectMutationItemIds,
|
|
979
985
|
};
|
|
980
986
|
//# sourceMappingURL=registration-helpers.js.map
|
|
981
|
-
//# debugId=
|
|
987
|
+
//# debugId=daefefd1-3b0b-513d-8b8c-ab17f90b995a
|