@unbrained/pm-cli 2026.3.12 → 2026.5.1-2
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/.agents/pm/extensions/.managed-extensions.json +42 -0
- package/.agents/pm/extensions/beads/index.js +109 -0
- package/.agents/pm/extensions/beads/manifest.json +7 -0
- package/{dist/cli/commands/beads.js → .agents/pm/extensions/beads/runtime.js} +31 -21
- package/.agents/pm/extensions/beads/runtime.ts +702 -0
- package/.agents/pm/extensions/todos/index.js +126 -0
- package/.agents/pm/extensions/todos/manifest.json +7 -0
- package/{dist/extensions/builtins/todos/import-export.js → .agents/pm/extensions/todos/runtime.js} +39 -29
- package/.agents/pm/extensions/todos/runtime.ts +568 -0
- package/AGENTS.md +196 -92
- package/CHANGELOG.md +404 -0
- package/CODE_OF_CONDUCT.md +42 -0
- package/CONTRIBUTING.md +144 -0
- package/PRD.md +512 -164
- package/README.md +1053 -2
- package/SECURITY.md +51 -0
- package/dist/cli/commands/activity.d.ts +5 -0
- package/dist/cli/commands/activity.js +66 -3
- package/dist/cli/commands/activity.js.map +1 -1
- package/dist/cli/commands/aggregate.d.ts +54 -0
- package/dist/cli/commands/aggregate.js +181 -0
- package/dist/cli/commands/aggregate.js.map +1 -0
- package/dist/cli/commands/append.js +4 -1
- package/dist/cli/commands/append.js.map +1 -1
- package/dist/cli/commands/calendar.d.ts +109 -0
- package/dist/cli/commands/calendar.js +797 -0
- package/dist/cli/commands/calendar.js.map +1 -0
- package/dist/cli/commands/claim.d.ts +5 -1
- package/dist/cli/commands/claim.js +42 -21
- package/dist/cli/commands/claim.js.map +1 -1
- package/dist/cli/commands/close.d.ts +1 -0
- package/dist/cli/commands/close.js +54 -5
- package/dist/cli/commands/close.js.map +1 -1
- package/dist/cli/commands/comments-audit.d.ts +91 -0
- package/dist/cli/commands/comments-audit.js +195 -0
- package/dist/cli/commands/comments-audit.js.map +1 -0
- package/dist/cli/commands/comments.d.ts +1 -0
- package/dist/cli/commands/comments.js +70 -21
- package/dist/cli/commands/comments.js.map +1 -1
- package/dist/cli/commands/completion.d.ts +10 -4
- package/dist/cli/commands/completion.js +1184 -137
- package/dist/cli/commands/completion.js.map +1 -1
- package/dist/cli/commands/config.d.ts +35 -3
- package/dist/cli/commands/config.js +968 -13
- package/dist/cli/commands/config.js.map +1 -1
- package/dist/cli/commands/context.d.ts +86 -0
- package/dist/cli/commands/context.js +299 -0
- package/dist/cli/commands/context.js.map +1 -0
- package/dist/cli/commands/contracts.d.ts +78 -0
- package/dist/cli/commands/contracts.js +920 -0
- package/dist/cli/commands/contracts.js.map +1 -0
- package/dist/cli/commands/create.d.ts +48 -14
- package/dist/cli/commands/create.js +1331 -160
- package/dist/cli/commands/create.js.map +1 -1
- package/dist/cli/commands/dedupe-audit.d.ts +81 -0
- package/dist/cli/commands/dedupe-audit.js +330 -0
- package/dist/cli/commands/dedupe-audit.js.map +1 -0
- package/dist/cli/commands/deps.d.ts +52 -0
- package/dist/cli/commands/deps.js +204 -0
- package/dist/cli/commands/deps.js.map +1 -0
- package/dist/cli/commands/docs.d.ts +19 -0
- package/dist/cli/commands/docs.js +212 -13
- package/dist/cli/commands/docs.js.map +1 -1
- package/dist/cli/commands/extension.d.ts +122 -0
- package/dist/cli/commands/extension.js +1850 -0
- package/dist/cli/commands/extension.js.map +1 -0
- package/dist/cli/commands/files.d.ts +52 -1
- package/dist/cli/commands/files.js +455 -13
- package/dist/cli/commands/files.js.map +1 -1
- package/dist/cli/commands/gc.d.ts +11 -1
- package/dist/cli/commands/gc.js +89 -11
- package/dist/cli/commands/gc.js.map +1 -1
- package/dist/cli/commands/get.d.ts +13 -0
- package/dist/cli/commands/get.js +35 -3
- package/dist/cli/commands/get.js.map +1 -1
- package/dist/cli/commands/health.d.ts +10 -2
- package/dist/cli/commands/health.js +774 -23
- package/dist/cli/commands/health.js.map +1 -1
- package/dist/cli/commands/history.d.ts +20 -0
- package/dist/cli/commands/history.js +152 -6
- package/dist/cli/commands/history.js.map +1 -1
- package/dist/cli/commands/index.d.ts +16 -3
- package/dist/cli/commands/index.js +16 -3
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/init.d.ts +7 -2
- package/dist/cli/commands/init.js +137 -5
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/learnings.d.ts +17 -0
- package/dist/cli/commands/learnings.js +129 -0
- package/dist/cli/commands/learnings.js.map +1 -0
- package/dist/cli/commands/list.d.ts +29 -1
- package/dist/cli/commands/list.js +289 -53
- package/dist/cli/commands/list.js.map +1 -1
- package/dist/cli/commands/normalize.d.ts +51 -0
- package/dist/cli/commands/normalize.js +298 -0
- package/dist/cli/commands/normalize.js.map +1 -0
- package/dist/cli/commands/notes.d.ts +17 -0
- package/dist/cli/commands/notes.js +129 -0
- package/dist/cli/commands/notes.js.map +1 -0
- package/dist/cli/commands/reindex.d.ts +1 -0
- package/dist/cli/commands/reindex.js +208 -32
- package/dist/cli/commands/reindex.js.map +1 -1
- package/dist/cli/commands/restore.js +164 -30
- package/dist/cli/commands/restore.js.map +1 -1
- package/dist/cli/commands/search.d.ts +14 -1
- package/dist/cli/commands/search.js +475 -81
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/stats.js +26 -10
- package/dist/cli/commands/stats.js.map +1 -1
- package/dist/cli/commands/templates.d.ts +26 -0
- package/dist/cli/commands/templates.js +179 -0
- package/dist/cli/commands/templates.js.map +1 -0
- package/dist/cli/commands/test-all.d.ts +19 -1
- package/dist/cli/commands/test-all.js +161 -13
- package/dist/cli/commands/test-all.js.map +1 -1
- package/dist/cli/commands/test-runs.d.ts +63 -0
- package/dist/cli/commands/test-runs.js +179 -0
- package/dist/cli/commands/test-runs.js.map +1 -0
- package/dist/cli/commands/test.d.ts +75 -1
- package/dist/cli/commands/test.js +1360 -41
- package/dist/cli/commands/test.js.map +1 -1
- package/dist/cli/commands/update-many.d.ts +57 -0
- package/dist/cli/commands/update-many.js +631 -0
- package/dist/cli/commands/update-many.js.map +1 -0
- package/dist/cli/commands/update.d.ts +30 -0
- package/dist/cli/commands/update.js +1393 -84
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/commands/validate.d.ts +30 -0
- package/dist/cli/commands/validate.js +1151 -0
- package/dist/cli/commands/validate.js.map +1 -0
- package/dist/cli/error-guidance.d.ts +33 -0
- package/dist/cli/error-guidance.js +337 -0
- package/dist/cli/error-guidance.js.map +1 -0
- package/dist/cli/extension-command-options.d.ts +1 -0
- package/dist/cli/extension-command-options.js +92 -0
- package/dist/cli/extension-command-options.js.map +1 -1
- package/dist/cli/help-content.d.ts +20 -0
- package/dist/cli/help-content.js +543 -0
- package/dist/cli/help-content.js.map +1 -0
- package/dist/cli/main.js +3625 -445
- package/dist/cli/main.js.map +1 -1
- package/dist/core/extensions/index.d.ts +13 -1
- package/dist/core/extensions/index.js +108 -1
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/item-fields.d.ts +2 -0
- package/dist/core/extensions/item-fields.js +79 -0
- package/dist/core/extensions/item-fields.js.map +1 -0
- package/dist/core/extensions/loader.d.ts +322 -9
- package/dist/core/extensions/loader.js +911 -20
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runtime-registrations.d.ts +5 -0
- package/dist/core/extensions/runtime-registrations.js +51 -0
- package/dist/core/extensions/runtime-registrations.js.map +1 -0
- package/dist/core/history/history-stream-policy.d.ts +20 -0
- package/dist/core/history/history-stream-policy.js +53 -0
- package/dist/core/history/history-stream-policy.js.map +1 -0
- package/dist/core/history/history.js +90 -1
- package/dist/core/history/history.js.map +1 -1
- package/dist/core/item/id.js +4 -1
- package/dist/core/item/id.js.map +1 -1
- package/dist/core/item/index.d.ts +1 -0
- package/dist/core/item/index.js +1 -0
- package/dist/core/item/index.js.map +1 -1
- package/dist/core/item/item-format.d.ts +11 -5
- package/dist/core/item/item-format.js +507 -24
- package/dist/core/item/item-format.js.map +1 -1
- package/dist/core/item/parent-reference-policy.d.ts +6 -0
- package/dist/core/item/parent-reference-policy.js +32 -0
- package/dist/core/item/parent-reference-policy.js.map +1 -0
- package/dist/core/item/parse.d.ts +5 -0
- package/dist/core/item/parse.js +216 -19
- package/dist/core/item/parse.js.map +1 -1
- package/dist/core/item/sprint-release-format.d.ts +6 -0
- package/dist/core/item/sprint-release-format.js +33 -0
- package/dist/core/item/sprint-release-format.js.map +1 -0
- package/dist/core/item/status.d.ts +3 -0
- package/dist/core/item/status.js +24 -0
- package/dist/core/item/status.js.map +1 -0
- package/dist/core/item/type-registry.d.ts +37 -0
- package/dist/core/item/type-registry.js +706 -0
- package/dist/core/item/type-registry.js.map +1 -0
- package/dist/core/lock/lock.d.ts +1 -1
- package/dist/core/lock/lock.js +101 -12
- package/dist/core/lock/lock.js.map +1 -1
- package/dist/core/output/command-aware.d.ts +1 -0
- package/dist/core/output/command-aware.js +394 -0
- package/dist/core/output/command-aware.js.map +1 -0
- package/dist/core/output/output.d.ts +3 -0
- package/dist/core/output/output.js +124 -6
- package/dist/core/output/output.js.map +1 -1
- package/dist/core/schema/runtime-field-filters.d.ts +3 -0
- package/dist/core/schema/runtime-field-filters.js +39 -0
- package/dist/core/schema/runtime-field-filters.js.map +1 -0
- package/dist/core/schema/runtime-field-values.d.ts +8 -0
- package/dist/core/schema/runtime-field-values.js +154 -0
- package/dist/core/schema/runtime-field-values.js.map +1 -0
- package/dist/core/schema/runtime-schema.d.ts +68 -0
- package/dist/core/schema/runtime-schema.js +554 -0
- package/dist/core/schema/runtime-schema.js.map +1 -0
- package/dist/core/search/cache.d.ts +13 -1
- package/dist/core/search/cache.js +123 -14
- package/dist/core/search/cache.js.map +1 -1
- package/dist/core/search/semantic-defaults.d.ts +6 -0
- package/dist/core/search/semantic-defaults.js +120 -0
- package/dist/core/search/semantic-defaults.js.map +1 -0
- package/dist/core/search/vector-stores.js +3 -1
- package/dist/core/search/vector-stores.js.map +1 -1
- package/dist/core/shared/command-types.d.ts +2 -0
- package/dist/core/shared/conflict-markers.d.ts +7 -0
- package/dist/core/shared/conflict-markers.js +27 -0
- package/dist/core/shared/conflict-markers.js.map +1 -0
- package/dist/core/shared/constants.d.ts +15 -4
- package/dist/core/shared/constants.js +141 -1
- package/dist/core/shared/constants.js.map +1 -1
- package/dist/core/shared/errors.d.ts +10 -1
- package/dist/core/shared/errors.js +3 -1
- package/dist/core/shared/errors.js.map +1 -1
- package/dist/core/shared/text-normalization.d.ts +4 -0
- package/dist/core/shared/text-normalization.js +33 -0
- package/dist/core/shared/text-normalization.js.map +1 -0
- package/dist/core/shared/time.d.ts +1 -2
- package/dist/core/shared/time.js +98 -11
- package/dist/core/shared/time.js.map +1 -1
- package/dist/core/store/index.d.ts +1 -0
- package/dist/core/store/index.js +1 -0
- package/dist/core/store/index.js.map +1 -1
- package/dist/core/store/item-format-migration.d.ts +9 -0
- package/dist/core/store/item-format-migration.js +87 -0
- package/dist/core/store/item-format-migration.js.map +1 -0
- package/dist/core/store/item-store.d.ts +13 -4
- package/dist/core/store/item-store.js +238 -51
- package/dist/core/store/item-store.js.map +1 -1
- package/dist/core/store/paths.d.ts +21 -3
- package/dist/core/store/paths.js +59 -4
- package/dist/core/store/paths.js.map +1 -1
- package/dist/core/store/settings.d.ts +14 -1
- package/dist/core/store/settings.js +463 -7
- package/dist/core/store/settings.js.map +1 -1
- package/dist/core/telemetry/consent.d.ts +2 -0
- package/dist/core/telemetry/consent.js +79 -0
- package/dist/core/telemetry/consent.js.map +1 -0
- package/dist/core/telemetry/runtime.d.ts +38 -0
- package/dist/core/telemetry/runtime.js +733 -0
- package/dist/core/telemetry/runtime.js.map +1 -0
- package/dist/core/test/background-runs.d.ts +117 -0
- package/dist/core/test/background-runs.js +760 -0
- package/dist/core/test/background-runs.js.map +1 -0
- package/dist/core/test/item-test-run-tracking.d.ts +9 -0
- package/dist/core/test/item-test-run-tracking.js +50 -0
- package/dist/core/test/item-test-run-tracking.js.map +1 -0
- package/dist/sdk/cli-contracts.d.ts +92 -0
- package/dist/sdk/cli-contracts.js +2357 -0
- package/dist/sdk/cli-contracts.js.map +1 -0
- package/dist/sdk/index.d.ts +34 -0
- package/dist/sdk/index.js +23 -0
- package/dist/sdk/index.js.map +1 -0
- package/dist/types.d.ts +197 -3
- package/dist/types.js +48 -1
- package/dist/types.js.map +1 -1
- package/docs/ARCHITECTURE.md +368 -39
- package/docs/EXTENSIONS.md +454 -49
- package/docs/RELEASING.md +70 -19
- package/docs/SDK.md +123 -0
- package/docs/examples/starter-extension/README.md +48 -0
- package/docs/examples/starter-extension/index.js +191 -0
- package/docs/examples/starter-extension/manifest.json +17 -0
- package/docs/examples/starter-extension/package.json +10 -0
- package/package.json +41 -14
- package/.pi/extensions/pm-cli/index.ts +0 -778
- package/dist/cli/commands/beads.d.ts +0 -16
- package/dist/cli/commands/beads.js.map +0 -1
- package/dist/cli/commands/install.d.ts +0 -18
- package/dist/cli/commands/install.js +0 -87
- package/dist/cli/commands/install.js.map +0 -1
- package/dist/core/extensions/builtins.d.ts +0 -3
- package/dist/core/extensions/builtins.js +0 -47
- package/dist/core/extensions/builtins.js.map +0 -1
- package/dist/extensions/builtins/beads/index.d.ts +0 -8
- package/dist/extensions/builtins/beads/index.js +0 -33
- package/dist/extensions/builtins/beads/index.js.map +0 -1
- package/dist/extensions/builtins/todos/import-export.d.ts +0 -26
- package/dist/extensions/builtins/todos/import-export.js.map +0 -1
- package/dist/extensions/builtins/todos/index.d.ts +0 -8
- package/dist/extensions/builtins/todos/index.js +0 -38
- package/dist/extensions/builtins/todos/index.js.map +0 -1
|
@@ -1,5 +1,16 @@
|
|
|
1
|
-
import type { PmSettings } from "../../types/index.js";
|
|
1
|
+
import type { ItemDocument, PmSettings } from "../../types/index.js";
|
|
2
2
|
import type { GlobalOptions } from "../shared/command-types.js";
|
|
3
|
+
export declare const KNOWN_EXTENSION_CAPABILITIES: readonly ["commands", "renderers", "hooks", "schema", "importers", "search", "parser", "preflight", "services"];
|
|
4
|
+
type ExtensionCapability = (typeof KNOWN_EXTENSION_CAPABILITIES)[number];
|
|
5
|
+
export declare const EXTENSION_CAPABILITY_CONTRACT_VERSION = 2;
|
|
6
|
+
export declare const EXTENSION_CAPABILITY_LEGACY_ALIASES: Readonly<Record<string, ExtensionCapability>>;
|
|
7
|
+
export declare const EXTENSION_CAPABILITY_CONTRACT: Readonly<{
|
|
8
|
+
version: 2;
|
|
9
|
+
capabilities: ("search" | "schema" | "commands" | "renderers" | "hooks" | "importers" | "parser" | "preflight" | "services")[];
|
|
10
|
+
legacy_aliases: {
|
|
11
|
+
[x: string]: "search" | "schema" | "commands" | "renderers" | "hooks" | "importers" | "parser" | "preflight" | "services";
|
|
12
|
+
};
|
|
13
|
+
}>;
|
|
3
14
|
export type ExtensionLayer = "global" | "project";
|
|
4
15
|
type ExtensionStatus = "ok" | "warn";
|
|
5
16
|
export interface ExtensionManifest {
|
|
@@ -8,6 +19,7 @@ export interface ExtensionManifest {
|
|
|
8
19
|
entry: string;
|
|
9
20
|
priority: number;
|
|
10
21
|
capabilities: string[];
|
|
22
|
+
legacy_capability_aliases?: LegacyExtensionCapabilityAliasMapping[];
|
|
11
23
|
}
|
|
12
24
|
export interface ExtensionDiagnostic {
|
|
13
25
|
layer: ExtensionLayer;
|
|
@@ -60,11 +72,14 @@ export interface ExtensionLoadResult extends ExtensionDiscoveryResult {
|
|
|
60
72
|
export interface BeforeCommandHookContext {
|
|
61
73
|
command: string;
|
|
62
74
|
args: string[];
|
|
75
|
+
options?: Record<string, unknown>;
|
|
76
|
+
global?: GlobalOptions;
|
|
63
77
|
pm_root: string;
|
|
64
78
|
}
|
|
65
79
|
export interface AfterCommandHookContext extends BeforeCommandHookContext {
|
|
66
80
|
ok: boolean;
|
|
67
81
|
error?: string;
|
|
82
|
+
result?: unknown;
|
|
68
83
|
}
|
|
69
84
|
export interface OnWriteHookContext {
|
|
70
85
|
path: string;
|
|
@@ -88,6 +103,9 @@ export type OutputRendererFormat = "toon" | "json";
|
|
|
88
103
|
export type CommandOverride = (context: CommandOverrideContext) => unknown;
|
|
89
104
|
export type RendererOverride = (context: RendererOverrideContext) => string;
|
|
90
105
|
export type CommandHandler = (context: CommandHandlerContext) => unknown;
|
|
106
|
+
export type ParserOverride = (context: ParserOverrideContext) => ParserOverrideDelta | Promise<ParserOverrideDelta>;
|
|
107
|
+
export type PreflightOverride = (context: PreflightOverrideContext) => PreflightOverrideDelta | Promise<PreflightOverrideDelta>;
|
|
108
|
+
export type ServiceOverride = (context: ServiceOverrideContext) => unknown;
|
|
91
109
|
export interface RegisteredExtensionHook<THook> {
|
|
92
110
|
layer: ExtensionLayer;
|
|
93
111
|
name: string;
|
|
@@ -124,17 +142,205 @@ export interface CommandHandlerContext {
|
|
|
124
142
|
global: GlobalOptions;
|
|
125
143
|
pm_root: string;
|
|
126
144
|
}
|
|
145
|
+
export interface ParserOverrideContext extends CommandHandlerContext {
|
|
146
|
+
}
|
|
147
|
+
export interface ParserOverrideDelta {
|
|
148
|
+
args?: string[];
|
|
149
|
+
options?: Record<string, unknown>;
|
|
150
|
+
global?: GlobalOptions;
|
|
151
|
+
}
|
|
152
|
+
export interface PreflightOverrideContext extends CommandHandlerContext {
|
|
153
|
+
decision: PreflightRuntimeDecision;
|
|
154
|
+
}
|
|
155
|
+
export interface PreflightRuntimeDecision {
|
|
156
|
+
enforce_item_format_gate: boolean;
|
|
157
|
+
run_preflight_item_format_sync: boolean;
|
|
158
|
+
run_extension_migrations: boolean;
|
|
159
|
+
enforce_mandatory_migration_gate: boolean;
|
|
160
|
+
}
|
|
161
|
+
export interface PreflightOverrideDelta extends ParserOverrideDelta {
|
|
162
|
+
enforce_item_format_gate?: boolean;
|
|
163
|
+
run_preflight_item_format_sync?: boolean;
|
|
164
|
+
run_extension_migrations?: boolean;
|
|
165
|
+
enforce_mandatory_migration_gate?: boolean;
|
|
166
|
+
}
|
|
167
|
+
export type ExtensionServiceName = "output_format" | "error_format" | "help_format" | "lock_acquire" | "lock_release" | "history_append" | "item_store_write" | "item_store_delete";
|
|
168
|
+
export interface ServiceOverrideContext {
|
|
169
|
+
service: ExtensionServiceName;
|
|
170
|
+
command?: string;
|
|
171
|
+
args?: string[];
|
|
172
|
+
options?: Record<string, unknown>;
|
|
173
|
+
global?: GlobalOptions;
|
|
174
|
+
pm_root?: string;
|
|
175
|
+
payload: unknown;
|
|
176
|
+
}
|
|
177
|
+
export interface ExtensionCommandArgumentDefinition {
|
|
178
|
+
name: string;
|
|
179
|
+
required?: boolean;
|
|
180
|
+
variadic?: boolean;
|
|
181
|
+
description?: string;
|
|
182
|
+
}
|
|
127
183
|
export interface CommandDefinition {
|
|
128
184
|
name: string;
|
|
129
|
-
run
|
|
185
|
+
run?: CommandHandler;
|
|
186
|
+
/**
|
|
187
|
+
* @deprecated Use `run` instead. This alias remains for backward compatibility.
|
|
188
|
+
*/
|
|
189
|
+
handler?: CommandHandler;
|
|
190
|
+
action?: string;
|
|
191
|
+
description?: string;
|
|
192
|
+
intent?: string;
|
|
193
|
+
examples?: string[];
|
|
194
|
+
failure_hints?: string[];
|
|
195
|
+
arguments?: ExtensionCommandArgumentDefinition[];
|
|
196
|
+
flags?: FlagDefinition[];
|
|
197
|
+
}
|
|
198
|
+
export type FlagValueType = "string" | "number" | "boolean";
|
|
199
|
+
export interface FlagDefinition {
|
|
200
|
+
long?: string;
|
|
201
|
+
short?: string;
|
|
202
|
+
value_name?: string;
|
|
203
|
+
description?: string;
|
|
204
|
+
required?: boolean;
|
|
205
|
+
enabled?: boolean;
|
|
206
|
+
visible?: boolean;
|
|
207
|
+
type?: FlagValueType;
|
|
208
|
+
value_type?: FlagValueType;
|
|
209
|
+
[key: string]: unknown;
|
|
210
|
+
}
|
|
211
|
+
export interface SchemaFieldDefinition {
|
|
212
|
+
name: string;
|
|
213
|
+
type: string;
|
|
214
|
+
optional?: boolean;
|
|
215
|
+
[key: string]: unknown;
|
|
216
|
+
}
|
|
217
|
+
export interface SchemaItemTypeCommandOptionPolicyDefinition {
|
|
218
|
+
command: string;
|
|
219
|
+
option: string;
|
|
220
|
+
enabled?: boolean;
|
|
221
|
+
required?: boolean;
|
|
222
|
+
visible?: boolean;
|
|
223
|
+
[key: string]: unknown;
|
|
224
|
+
}
|
|
225
|
+
export interface SchemaItemTypeOptionDefinition {
|
|
226
|
+
key: string;
|
|
227
|
+
values?: string[];
|
|
228
|
+
required?: boolean;
|
|
229
|
+
aliases?: string[];
|
|
230
|
+
[key: string]: unknown;
|
|
231
|
+
}
|
|
232
|
+
export interface SchemaItemTypeDefinition {
|
|
233
|
+
name: string;
|
|
234
|
+
folder?: string;
|
|
235
|
+
aliases?: string[];
|
|
236
|
+
required_create_fields?: string[];
|
|
237
|
+
required_create_repeatables?: string[];
|
|
238
|
+
command_option_policies?: SchemaItemTypeCommandOptionPolicyDefinition[];
|
|
239
|
+
options?: SchemaItemTypeOptionDefinition[];
|
|
240
|
+
[key: string]: unknown;
|
|
241
|
+
}
|
|
242
|
+
export interface SchemaMigrationRunContext {
|
|
243
|
+
id: string;
|
|
244
|
+
command: "migration";
|
|
245
|
+
layer: ExtensionLayer;
|
|
246
|
+
extension: string;
|
|
247
|
+
pm_root: string;
|
|
248
|
+
status: string;
|
|
249
|
+
}
|
|
250
|
+
export type SchemaMigrationRunner = (context: SchemaMigrationRunContext) => unknown | Promise<unknown>;
|
|
251
|
+
export interface SchemaMigrationDefinition {
|
|
252
|
+
id?: string;
|
|
253
|
+
description?: string;
|
|
254
|
+
status?: string;
|
|
255
|
+
mandatory?: boolean;
|
|
256
|
+
run?: SchemaMigrationRunner;
|
|
257
|
+
[key: string]: unknown;
|
|
258
|
+
}
|
|
259
|
+
export interface ImportExportContext {
|
|
260
|
+
registration: string;
|
|
261
|
+
action: "import" | "export";
|
|
262
|
+
command: string;
|
|
263
|
+
args: string[];
|
|
264
|
+
options: Record<string, unknown>;
|
|
265
|
+
global: GlobalOptions;
|
|
266
|
+
pm_root: string;
|
|
267
|
+
}
|
|
268
|
+
export type Importer = (context: ImportExportContext) => unknown | Promise<unknown>;
|
|
269
|
+
export type Exporter = (context: ImportExportContext) => unknown | Promise<unknown>;
|
|
270
|
+
export type ExtensionSearchMode = "keyword" | "semantic" | "hybrid";
|
|
271
|
+
export interface SearchProviderQueryContext {
|
|
272
|
+
query: string;
|
|
273
|
+
mode: ExtensionSearchMode;
|
|
274
|
+
tokens: string[];
|
|
275
|
+
options: Record<string, unknown>;
|
|
276
|
+
settings: PmSettings;
|
|
277
|
+
documents: ItemDocument[];
|
|
278
|
+
[key: string]: unknown;
|
|
279
|
+
}
|
|
280
|
+
export interface SearchProviderHit {
|
|
281
|
+
id: string;
|
|
282
|
+
score: number;
|
|
283
|
+
matched_fields?: string[];
|
|
284
|
+
[key: string]: unknown;
|
|
285
|
+
}
|
|
286
|
+
export type SearchProviderQueryResult = SearchProviderHit[] | {
|
|
287
|
+
hits?: SearchProviderHit[];
|
|
288
|
+
};
|
|
289
|
+
export interface SearchProviderEmbedBatchContext {
|
|
290
|
+
inputs: string[];
|
|
291
|
+
settings: PmSettings;
|
|
292
|
+
model: string;
|
|
293
|
+
[key: string]: unknown;
|
|
294
|
+
}
|
|
295
|
+
export interface SearchProviderEmbedContext {
|
|
296
|
+
input: string;
|
|
297
|
+
settings: PmSettings;
|
|
298
|
+
model: string;
|
|
299
|
+
[key: string]: unknown;
|
|
300
|
+
}
|
|
301
|
+
export interface SearchProviderDefinition {
|
|
302
|
+
name: string;
|
|
303
|
+
query?: (context: SearchProviderQueryContext) => SearchProviderQueryResult | Promise<SearchProviderQueryResult>;
|
|
304
|
+
embedBatch?: (context: SearchProviderEmbedBatchContext) => number[][] | Promise<number[][]>;
|
|
305
|
+
embed_batch?: (context: SearchProviderEmbedBatchContext) => number[][] | Promise<number[][]>;
|
|
306
|
+
embed?: (context: SearchProviderEmbedContext) => number[] | Promise<number[]>;
|
|
307
|
+
[key: string]: unknown;
|
|
308
|
+
}
|
|
309
|
+
export interface VectorStoreQueryHit {
|
|
310
|
+
id: string;
|
|
311
|
+
score: number;
|
|
312
|
+
payload?: Record<string, unknown>;
|
|
313
|
+
[key: string]: unknown;
|
|
314
|
+
}
|
|
315
|
+
export interface VectorStoreQueryContext {
|
|
316
|
+
vector: number[];
|
|
317
|
+
limit: number;
|
|
318
|
+
settings: PmSettings;
|
|
319
|
+
[key: string]: unknown;
|
|
320
|
+
}
|
|
321
|
+
export interface VectorStoreUpsertPoint {
|
|
322
|
+
id: string;
|
|
323
|
+
vector: number[];
|
|
324
|
+
payload?: Record<string, unknown>;
|
|
325
|
+
[key: string]: unknown;
|
|
326
|
+
}
|
|
327
|
+
export interface VectorStoreUpsertContext {
|
|
328
|
+
points: VectorStoreUpsertPoint[];
|
|
329
|
+
settings: PmSettings;
|
|
330
|
+
[key: string]: unknown;
|
|
331
|
+
}
|
|
332
|
+
export interface VectorStoreDeleteContext {
|
|
333
|
+
ids: string[];
|
|
334
|
+
settings: PmSettings;
|
|
335
|
+
[key: string]: unknown;
|
|
336
|
+
}
|
|
337
|
+
export interface VectorStoreAdapterDefinition {
|
|
338
|
+
name: string;
|
|
339
|
+
query?: (context: VectorStoreQueryContext) => VectorStoreQueryHit[] | Promise<VectorStoreQueryHit[]>;
|
|
340
|
+
upsert?: (context: VectorStoreUpsertContext) => unknown | Promise<unknown>;
|
|
341
|
+
delete?: (context: VectorStoreDeleteContext) => unknown | Promise<unknown>;
|
|
342
|
+
[key: string]: unknown;
|
|
130
343
|
}
|
|
131
|
-
export type FlagDefinition = Record<string, unknown>;
|
|
132
|
-
export type SchemaFieldDefinition = Record<string, unknown>;
|
|
133
|
-
export type SchemaMigrationDefinition = Record<string, unknown>;
|
|
134
|
-
export type SearchProviderDefinition = Record<string, unknown>;
|
|
135
|
-
export type VectorStoreAdapterDefinition = Record<string, unknown>;
|
|
136
|
-
export type Importer = (context: unknown) => unknown;
|
|
137
|
-
export type Exporter = (context: unknown) => unknown;
|
|
138
344
|
export interface RegisteredExtensionCommandOverride {
|
|
139
345
|
layer: ExtensionLayer;
|
|
140
346
|
name: string;
|
|
@@ -147,6 +353,23 @@ export interface RegisteredExtensionCommandHandler {
|
|
|
147
353
|
command: string;
|
|
148
354
|
run: CommandHandler;
|
|
149
355
|
}
|
|
356
|
+
export interface RegisteredExtensionParserOverride {
|
|
357
|
+
layer: ExtensionLayer;
|
|
358
|
+
name: string;
|
|
359
|
+
command: string;
|
|
360
|
+
run: ParserOverride;
|
|
361
|
+
}
|
|
362
|
+
export interface RegisteredExtensionPreflightOverride {
|
|
363
|
+
layer: ExtensionLayer;
|
|
364
|
+
name: string;
|
|
365
|
+
run: PreflightOverride;
|
|
366
|
+
}
|
|
367
|
+
export interface RegisteredExtensionServiceOverride {
|
|
368
|
+
layer: ExtensionLayer;
|
|
369
|
+
name: string;
|
|
370
|
+
service: ExtensionServiceName;
|
|
371
|
+
run: ServiceOverride;
|
|
372
|
+
}
|
|
150
373
|
export interface RegisteredExtensionRendererOverride {
|
|
151
374
|
layer: ExtensionLayer;
|
|
152
375
|
name: string;
|
|
@@ -157,6 +380,15 @@ export interface ExtensionCommandRegistry {
|
|
|
157
380
|
overrides: RegisteredExtensionCommandOverride[];
|
|
158
381
|
handlers: RegisteredExtensionCommandHandler[];
|
|
159
382
|
}
|
|
383
|
+
export interface ExtensionParserRegistry {
|
|
384
|
+
overrides: RegisteredExtensionParserOverride[];
|
|
385
|
+
}
|
|
386
|
+
export interface ExtensionPreflightRegistry {
|
|
387
|
+
overrides: RegisteredExtensionPreflightOverride[];
|
|
388
|
+
}
|
|
389
|
+
export interface ExtensionServiceRegistry {
|
|
390
|
+
overrides: RegisteredExtensionServiceOverride[];
|
|
391
|
+
}
|
|
160
392
|
export interface ExtensionRendererRegistry {
|
|
161
393
|
overrides: RegisteredExtensionRendererOverride[];
|
|
162
394
|
}
|
|
@@ -166,15 +398,32 @@ export interface RegisteredExtensionFlagDefinitions {
|
|
|
166
398
|
target_command: string;
|
|
167
399
|
flags: FlagDefinition[];
|
|
168
400
|
}
|
|
401
|
+
export interface RegisteredExtensionCommandDefinition {
|
|
402
|
+
layer: ExtensionLayer;
|
|
403
|
+
name: string;
|
|
404
|
+
command: string;
|
|
405
|
+
action: string;
|
|
406
|
+
description?: string;
|
|
407
|
+
intent?: string;
|
|
408
|
+
examples: string[];
|
|
409
|
+
failure_hints: string[];
|
|
410
|
+
arguments: ExtensionCommandArgumentDefinition[];
|
|
411
|
+
}
|
|
169
412
|
export interface RegisteredExtensionSchemaFieldDefinitions {
|
|
170
413
|
layer: ExtensionLayer;
|
|
171
414
|
name: string;
|
|
172
415
|
fields: SchemaFieldDefinition[];
|
|
173
416
|
}
|
|
417
|
+
export interface RegisteredExtensionSchemaItemTypeDefinitions {
|
|
418
|
+
layer: ExtensionLayer;
|
|
419
|
+
name: string;
|
|
420
|
+
types: SchemaItemTypeDefinition[];
|
|
421
|
+
}
|
|
174
422
|
export interface RegisteredExtensionSchemaMigrationDefinition {
|
|
175
423
|
layer: ExtensionLayer;
|
|
176
424
|
name: string;
|
|
177
425
|
definition: SchemaMigrationDefinition;
|
|
426
|
+
runtime_definition: SchemaMigrationDefinition;
|
|
178
427
|
}
|
|
179
428
|
export interface RegisteredExtensionImporter {
|
|
180
429
|
layer: ExtensionLayer;
|
|
@@ -190,15 +439,19 @@ export interface RegisteredExtensionSearchProvider {
|
|
|
190
439
|
layer: ExtensionLayer;
|
|
191
440
|
name: string;
|
|
192
441
|
definition: SearchProviderDefinition;
|
|
442
|
+
runtime_definition: SearchProviderDefinition;
|
|
193
443
|
}
|
|
194
444
|
export interface RegisteredExtensionVectorStoreAdapter {
|
|
195
445
|
layer: ExtensionLayer;
|
|
196
446
|
name: string;
|
|
197
447
|
definition: VectorStoreAdapterDefinition;
|
|
448
|
+
runtime_definition: VectorStoreAdapterDefinition;
|
|
198
449
|
}
|
|
199
450
|
export interface ExtensionRegistrationRegistry {
|
|
451
|
+
commands: RegisteredExtensionCommandDefinition[];
|
|
200
452
|
flags: RegisteredExtensionFlagDefinitions[];
|
|
201
453
|
item_fields: RegisteredExtensionSchemaFieldDefinitions[];
|
|
454
|
+
item_types: RegisteredExtensionSchemaItemTypeDefinitions[];
|
|
202
455
|
migrations: RegisteredExtensionSchemaMigrationDefinition[];
|
|
203
456
|
importers: RegisteredExtensionImporter[];
|
|
204
457
|
exporters: RegisteredExtensionExporter[];
|
|
@@ -206,8 +459,10 @@ export interface ExtensionRegistrationRegistry {
|
|
|
206
459
|
vector_store_adapters: RegisteredExtensionVectorStoreAdapter[];
|
|
207
460
|
}
|
|
208
461
|
export interface ExtensionRegistrationCounts {
|
|
462
|
+
commands: number;
|
|
209
463
|
flags: number;
|
|
210
464
|
item_fields: number;
|
|
465
|
+
item_types: number;
|
|
211
466
|
migrations: number;
|
|
212
467
|
importers: number;
|
|
213
468
|
exporters: number;
|
|
@@ -217,8 +472,12 @@ export interface ExtensionRegistrationCounts {
|
|
|
217
472
|
export interface ExtensionApi {
|
|
218
473
|
registerCommand(command: string, override: CommandOverride): void;
|
|
219
474
|
registerCommand(definition: CommandDefinition): void;
|
|
475
|
+
registerParser(command: string, override: ParserOverride): void;
|
|
476
|
+
registerPreflight(override: PreflightOverride): void;
|
|
477
|
+
registerService(service: ExtensionServiceName, override: ServiceOverride): void;
|
|
220
478
|
registerFlags(targetCommand: string, flags: FlagDefinition[]): void;
|
|
221
479
|
registerItemFields(fields: SchemaFieldDefinition[]): void;
|
|
480
|
+
registerItemTypes(types: SchemaItemTypeDefinition[]): void;
|
|
222
481
|
registerMigration(definition: SchemaMigrationDefinition): void;
|
|
223
482
|
registerRenderer(format: OutputRendererFormat, renderer: RendererOverride): void;
|
|
224
483
|
registerImporter(name: string, importer: Importer): void;
|
|
@@ -238,10 +497,22 @@ export interface FailedExtensionActivation {
|
|
|
238
497
|
name: string;
|
|
239
498
|
entry_path: string;
|
|
240
499
|
error: string;
|
|
500
|
+
trace?: ExtensionActivationFailureTrace;
|
|
501
|
+
}
|
|
502
|
+
export interface ExtensionActivationFailureTrace {
|
|
503
|
+
method: string;
|
|
504
|
+
registration_index: number;
|
|
505
|
+
command?: string;
|
|
506
|
+
expected_schema: string;
|
|
507
|
+
received?: unknown;
|
|
508
|
+
hint?: string;
|
|
241
509
|
}
|
|
242
510
|
export interface ExtensionActivationResult {
|
|
243
511
|
hooks: ExtensionHookRegistry;
|
|
244
512
|
commands: ExtensionCommandRegistry;
|
|
513
|
+
parsers: ExtensionParserRegistry;
|
|
514
|
+
preflight: ExtensionPreflightRegistry;
|
|
515
|
+
services: ExtensionServiceRegistry;
|
|
245
516
|
renderers: ExtensionRendererRegistry;
|
|
246
517
|
registrations: ExtensionRegistrationRegistry;
|
|
247
518
|
failed: FailedExtensionActivation[];
|
|
@@ -255,15 +526,37 @@ export interface ExtensionActivationResult {
|
|
|
255
526
|
};
|
|
256
527
|
command_override_count: number;
|
|
257
528
|
command_handler_count: number;
|
|
529
|
+
parser_override_count: number;
|
|
530
|
+
preflight_override_count: number;
|
|
531
|
+
service_override_count: number;
|
|
258
532
|
renderer_override_count: number;
|
|
259
533
|
registration_counts: ExtensionRegistrationCounts;
|
|
260
534
|
}
|
|
535
|
+
export interface LegacyExtensionCapabilityAliasMapping {
|
|
536
|
+
alias: string;
|
|
537
|
+
target: ExtensionCapability;
|
|
538
|
+
}
|
|
539
|
+
export interface UnknownExtensionCapabilityWarningDetails {
|
|
540
|
+
layer: ExtensionLayer;
|
|
541
|
+
name: string;
|
|
542
|
+
capability: string;
|
|
543
|
+
allowed_capabilities: string[];
|
|
544
|
+
capability_contract_version: number;
|
|
545
|
+
suggested_capability?: string;
|
|
546
|
+
suggestion_source?: "legacy_alias" | "nearest_match";
|
|
547
|
+
legacy_alias_target?: string;
|
|
548
|
+
}
|
|
549
|
+
export declare function parseUnknownExtensionCapabilityWarning(warning: string): UnknownExtensionCapabilityWarningDetails | null;
|
|
550
|
+
export declare function parseLegacyExtensionCapabilityAliasWarning(warning: string): UnknownExtensionCapabilityWarningDetails[];
|
|
261
551
|
export declare function resolveExtensionRoots(pmRoot: string, cwd?: string): {
|
|
262
552
|
global: string;
|
|
263
553
|
project: string;
|
|
264
554
|
};
|
|
265
555
|
export declare function createEmptyExtensionHookRegistry(): ExtensionHookRegistry;
|
|
266
556
|
export declare function createEmptyExtensionCommandRegistry(): ExtensionCommandRegistry;
|
|
557
|
+
export declare function createEmptyExtensionParserRegistry(): ExtensionParserRegistry;
|
|
558
|
+
export declare function createEmptyExtensionPreflightRegistry(): ExtensionPreflightRegistry;
|
|
559
|
+
export declare function createEmptyExtensionServiceRegistry(): ExtensionServiceRegistry;
|
|
267
560
|
export declare function createEmptyExtensionRendererRegistry(): ExtensionRendererRegistry;
|
|
268
561
|
export declare function createEmptyExtensionRegistrationRegistry(): ExtensionRegistrationRegistry;
|
|
269
562
|
interface DiscoverExtensionsOptions {
|
|
@@ -291,6 +584,26 @@ export interface CommandHandlerResult {
|
|
|
291
584
|
warnings: string[];
|
|
292
585
|
}
|
|
293
586
|
export declare function runCommandHandler(commands: ExtensionCommandRegistry, context: CommandHandlerContext): Promise<CommandHandlerResult>;
|
|
587
|
+
export interface ParserOverrideResult {
|
|
588
|
+
overridden: boolean;
|
|
589
|
+
context: CommandHandlerContext;
|
|
590
|
+
warnings: string[];
|
|
591
|
+
}
|
|
592
|
+
export declare function runParserOverride(parsers: ExtensionParserRegistry, context: ParserOverrideContext): Promise<ParserOverrideResult>;
|
|
593
|
+
export interface PreflightOverrideResult {
|
|
594
|
+
overridden: boolean;
|
|
595
|
+
context: CommandHandlerContext;
|
|
596
|
+
decision: PreflightRuntimeDecision;
|
|
597
|
+
warnings: string[];
|
|
598
|
+
}
|
|
599
|
+
export declare function runPreflightOverride(preflight: ExtensionPreflightRegistry, context: PreflightOverrideContext): Promise<PreflightOverrideResult>;
|
|
600
|
+
export interface ServiceOverrideResult {
|
|
601
|
+
handled: boolean;
|
|
602
|
+
result: unknown;
|
|
603
|
+
warnings: string[];
|
|
604
|
+
}
|
|
605
|
+
export declare function runServiceOverrideSync(services: ExtensionServiceRegistry, context: ServiceOverrideContext): ServiceOverrideResult;
|
|
606
|
+
export declare function runServiceOverride(services: ExtensionServiceRegistry, context: ServiceOverrideContext): Promise<ServiceOverrideResult>;
|
|
294
607
|
export declare function runCommandOverride(commands: ExtensionCommandRegistry, context: CommandOverrideContext): CommandOverrideResult;
|
|
295
608
|
export interface RendererOverrideResult {
|
|
296
609
|
overridden: boolean;
|