@unbrained/pm-cli 2026.5.18 → 2026.5.24
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/CHANGELOG.md +60 -0
- package/README.md +2 -1
- package/dist/cli/commander-usage.js +16 -2
- package/dist/cli/commander-usage.js.map +1 -1
- package/dist/cli/commands/annotation-command.d.ts +49 -0
- package/dist/cli/commands/annotation-command.js +135 -0
- package/dist/cli/commands/annotation-command.js.map +1 -0
- package/dist/cli/commands/append.js +3 -7
- package/dist/cli/commands/append.js.map +1 -1
- package/dist/cli/commands/calendar.js +3 -6
- package/dist/cli/commands/calendar.js.map +1 -1
- package/dist/cli/commands/claim.js +12 -22
- package/dist/cli/commands/claim.js.map +1 -1
- package/dist/cli/commands/close.js +61 -9
- package/dist/cli/commands/close.js.map +1 -1
- package/dist/cli/commands/comments.d.ts +5 -0
- package/dist/cli/commands/comments.js +27 -117
- package/dist/cli/commands/comments.js.map +1 -1
- package/dist/cli/commands/completion.js +102 -15
- package/dist/cli/commands/completion.js.map +1 -1
- package/dist/cli/commands/context.js +4 -10
- package/dist/cli/commands/context.js.map +1 -1
- package/dist/cli/commands/contracts.js +168 -36
- package/dist/cli/commands/contracts.js.map +1 -1
- package/dist/cli/commands/create.js +49 -44
- package/dist/cli/commands/create.js.map +1 -1
- package/dist/cli/commands/dedupe-audit.js +7 -4
- package/dist/cli/commands/dedupe-audit.js.map +1 -1
- package/dist/cli/commands/delete.d.ts +3 -0
- package/dist/cli/commands/delete.js +9 -8
- package/dist/cli/commands/delete.js.map +1 -1
- package/dist/cli/commands/docs.d.ts +1 -0
- package/dist/cli/commands/docs.js +4 -8
- package/dist/cli/commands/docs.js.map +1 -1
- package/dist/cli/commands/event-validation-messages.d.ts +3 -0
- package/dist/cli/commands/event-validation-messages.js +44 -0
- package/dist/cli/commands/event-validation-messages.js.map +1 -0
- package/dist/cli/commands/extension.d.ts +1 -0
- package/dist/cli/commands/extension.js +138 -21
- package/dist/cli/commands/extension.js.map +1 -1
- package/dist/cli/commands/files.js +6 -13
- package/dist/cli/commands/files.js.map +1 -1
- package/dist/cli/commands/gc.js +17 -4
- package/dist/cli/commands/gc.js.map +1 -1
- package/dist/cli/commands/get.d.ts +3 -2
- package/dist/cli/commands/get.js +50 -8
- package/dist/cli/commands/get.js.map +1 -1
- package/dist/cli/commands/health.d.ts +10 -0
- package/dist/cli/commands/health.js +254 -75
- package/dist/cli/commands/health.js.map +1 -1
- package/dist/cli/commands/history-redact.d.ts +8 -0
- package/dist/cli/commands/history-redact.js +14 -97
- package/dist/cli/commands/history-redact.js.map +1 -1
- package/dist/cli/commands/history-repair.d.ts +33 -0
- package/dist/cli/commands/history-repair.js +166 -0
- package/dist/cli/commands/history-repair.js.map +1 -0
- package/dist/cli/commands/history.d.ts +4 -4
- package/dist/cli/commands/history.js +10 -88
- package/dist/cli/commands/history.js.map +1 -1
- package/dist/cli/commands/index.d.ts +3 -1
- package/dist/cli/commands/index.js +5 -3
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/init.d.ts +28 -0
- package/dist/cli/commands/init.js +23 -2
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/learnings.js +20 -119
- package/dist/cli/commands/learnings.js.map +1 -1
- package/dist/cli/commands/linked-test-entry.d.ts +3 -0
- package/dist/cli/commands/linked-test-entry.js +62 -0
- package/dist/cli/commands/linked-test-entry.js.map +1 -0
- package/dist/cli/commands/list.js +32 -22
- package/dist/cli/commands/list.js.map +1 -1
- package/dist/cli/commands/notes.js +20 -119
- package/dist/cli/commands/notes.js.map +1 -1
- package/dist/cli/commands/plan.d.ts +3 -0
- package/dist/cli/commands/plan.js +184 -22
- package/dist/cli/commands/plan.js.map +1 -1
- package/dist/cli/commands/restore.js +7 -50
- package/dist/cli/commands/restore.js.map +1 -1
- package/dist/cli/commands/schema.d.ts +31 -0
- package/dist/cli/commands/schema.js +98 -0
- package/dist/cli/commands/schema.js.map +1 -0
- package/dist/cli/commands/search.js +151 -40
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/templates.d.ts +4 -0
- package/dist/cli/commands/templates.js +89 -17
- package/dist/cli/commands/templates.js.map +1 -1
- package/dist/cli/commands/test-all.js +4 -8
- package/dist/cli/commands/test-all.js.map +1 -1
- package/dist/cli/commands/test.d.ts +1 -0
- package/dist/cli/commands/test.js +7 -10
- package/dist/cli/commands/test.js.map +1 -1
- package/dist/cli/commands/update-many.js +4 -8
- package/dist/cli/commands/update-many.js.map +1 -1
- package/dist/cli/commands/update.js +109 -51
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/commands/validate.d.ts +3 -1
- package/dist/cli/commands/validate.js +23 -71
- package/dist/cli/commands/validate.js.map +1 -1
- package/dist/cli/error-guidance.js +96 -6
- package/dist/cli/error-guidance.js.map +1 -1
- package/dist/cli/extension-command-help.d.ts +0 -1
- package/dist/cli/extension-command-help.js +2 -13
- package/dist/cli/extension-command-help.js.map +1 -1
- package/dist/cli/extension-command-options.d.ts +1 -0
- package/dist/cli/extension-command-options.js +106 -7
- package/dist/cli/extension-command-options.js.map +1 -1
- package/dist/cli/help-content.d.ts +0 -1
- package/dist/cli/help-content.js +13 -9
- package/dist/cli/help-content.js.map +1 -1
- package/dist/cli/help-json-payload.d.ts +1 -0
- package/dist/cli/help-json-payload.js +33 -3
- package/dist/cli/help-json-payload.js.map +1 -1
- package/dist/cli/main.js +35 -29
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/register-list-query.d.ts +1 -1
- package/dist/cli/register-list-query.js +40 -17
- package/dist/cli/register-list-query.js.map +1 -1
- package/dist/cli/register-mutation.d.ts +1 -1
- package/dist/cli/register-mutation.js +232 -64
- package/dist/cli/register-mutation.js.map +1 -1
- package/dist/cli/register-operations.js +16 -11
- package/dist/cli/register-operations.js.map +1 -1
- package/dist/cli/register-setup.js +26 -14
- package/dist/cli/register-setup.js.map +1 -1
- package/dist/cli/registration-helpers.d.ts +0 -2
- package/dist/cli/registration-helpers.js +13 -40
- package/dist/cli/registration-helpers.js.map +1 -1
- package/dist/cli.js +23 -3
- package/dist/cli.js.map +1 -1
- package/dist/core/extensions/index.d.ts +0 -1
- package/dist/core/extensions/index.js +2 -14
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/loader.js +3 -9
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/fs/path-utils.d.ts +1 -0
- package/dist/core/fs/path-utils.js +12 -0
- package/dist/core/fs/path-utils.js.map +1 -0
- package/dist/core/history/drift-scan.d.ts +11 -0
- package/dist/core/history/drift-scan.js +67 -0
- package/dist/core/history/drift-scan.js.map +1 -0
- package/dist/core/history/replay.d.ts +82 -0
- package/dist/core/history/replay.js +249 -0
- package/dist/core/history/replay.js.map +1 -0
- package/dist/core/item/item-format.js +11 -8
- package/dist/core/item/item-format.js.map +1 -1
- package/dist/core/item/item-type-definition.d.ts +52 -0
- package/dist/core/item/item-type-definition.js +123 -0
- package/dist/core/item/item-type-definition.js.map +1 -0
- package/dist/core/item/parse.js +3 -2
- package/dist/core/item/parse.js.map +1 -1
- package/dist/core/item/priority.d.ts +23 -0
- package/dist/core/item/priority.js +55 -0
- package/dist/core/item/priority.js.map +1 -0
- package/dist/core/item/status.d.ts +14 -1
- package/dist/core/item/status.js +22 -2
- package/dist/core/item/status.js.map +1 -1
- package/dist/core/item/toon-decode.d.ts +19 -0
- package/dist/core/item/toon-decode.js +69 -0
- package/dist/core/item/toon-decode.js.map +1 -0
- package/dist/core/item/type-registry.js +13 -84
- package/dist/core/item/type-registry.js.map +1 -1
- package/dist/core/packages/manifest.js +3 -9
- package/dist/core/packages/manifest.js.map +1 -1
- package/dist/core/schema/item-types-file.d.ts +85 -0
- package/dist/core/schema/item-types-file.js +243 -0
- package/dist/core/schema/item-types-file.js.map +1 -0
- package/dist/core/schema/runtime-schema.d.ts +2 -1
- package/dist/core/schema/runtime-schema.js +11 -9
- package/dist/core/schema/runtime-schema.js.map +1 -1
- package/dist/core/search/semantic-defaults.js +3 -3
- package/dist/core/search/semantic-defaults.js.map +1 -1
- package/dist/core/shared/author.d.ts +1 -0
- package/dist/core/shared/author.js +9 -0
- package/dist/core/shared/author.js.map +1 -0
- package/dist/core/shared/lazy-module.d.ts +1 -0
- package/dist/core/shared/lazy-module.js +11 -0
- package/dist/core/shared/lazy-module.js.map +1 -0
- package/dist/core/shared/option-alias-visibility.d.ts +44 -0
- package/dist/core/shared/option-alias-visibility.js +76 -0
- package/dist/core/shared/option-alias-visibility.js.map +1 -0
- package/dist/core/shared/text-normalization.d.ts +0 -1
- package/dist/core/shared/text-normalization.js +2 -5
- package/dist/core/shared/text-normalization.js.map +1 -1
- package/dist/core/store/item-store.d.ts +2 -0
- package/dist/core/store/item-store.js +70 -39
- package/dist/core/store/item-store.js.map +1 -1
- package/dist/core/store/settings-validator.d.ts +106 -0
- package/dist/core/store/settings-validator.js +279 -0
- package/dist/core/store/settings-validator.js.map +1 -0
- package/dist/core/store/settings.js +6 -343
- package/dist/core/store/settings.js.map +1 -1
- package/dist/core/telemetry/runtime.js +5 -3
- package/dist/core/telemetry/runtime.js.map +1 -1
- package/dist/mcp/server.js +64 -13
- package/dist/mcp/server.js.map +1 -1
- package/dist/sdk/cli-contracts.d.ts +9 -2
- package/dist/sdk/cli-contracts.js +204 -13
- package/dist/sdk/cli-contracts.js.map +1 -1
- package/dist/sdk/runtime.d.ts +25 -1
- package/dist/sdk/runtime.js +46 -3
- package/dist/sdk/runtime.js.map +1 -1
- package/dist/types.d.ts +6 -0
- package/dist/types.js +10 -2
- package/dist/types.js.map +1 -1
- package/docs/AGENT_GUIDE.md +7 -1
- package/docs/ARCHITECTURE.md +1 -1
- package/docs/COMMANDS.md +39 -6
- package/docs/CONFIGURATION.md +1 -1
- package/docs/RELEASING.md +11 -7
- package/docs/SDK.md +11 -2
- package/package.json +12 -11
- package/packages/pm-calendar/README.md +3 -1
- package/packages/pm-calendar/extensions/calendar/index.js +21 -2
- package/packages/pm-calendar/extensions/calendar/index.ts +21 -2
- package/packages/pm-search-advanced/README.md +8 -0
- package/packages/pm-search-advanced/extensions/search-advanced/index.js +74 -0
- package/packages/pm-search-advanced/extensions/search-advanced/index.ts +74 -0
- package/packages/pm-search-advanced/extensions/search-advanced/runtime.js +67 -9
- package/packages/pm-search-advanced/extensions/search-advanced/runtime.ts +67 -9
- package/packages/pm-templates/extensions/templates/runtime.js +11 -202
- package/packages/pm-templates/extensions/templates/runtime.ts +38 -230
- package/dist/core/output/command-aware.d.ts +0 -1
- package/dist/core/output/command-aware.js +0 -397
- package/dist/core/output/command-aware.js.map +0 -1
|
@@ -1,276 +1,13 @@
|
|
|
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
|
-
import {
|
|
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]="7fed7222-981d-50f3-8a28-3635f56361b9")}catch(e){}}();
|
|
3
|
+
import { validateSettings } from "./settings-validator.js";
|
|
4
4
|
import { runActiveOnReadHooks, runActiveOnWriteHooks } from "../extensions/index.js";
|
|
5
5
|
import { GOVERNANCE_PRESET_DEFAULTS, SETTINGS_DEFAULTS } from "../shared/constants.js";
|
|
6
6
|
import { readFileIfExists, writeFileAtomic } from "../fs/fs-utils.js";
|
|
7
7
|
import { ensureRuntimeSchemaFileScaffold, loadRuntimeSchemaFromOptionalFiles, normalizeRuntimeSchemaSettings, } from "../schema/runtime-schema.js";
|
|
8
8
|
import { getSettingsPath } from "./paths.js";
|
|
9
9
|
import { orderObject } from "../shared/serialization.js";
|
|
10
|
-
|
|
11
|
-
key: z.string(),
|
|
12
|
-
values: z.array(z.string()),
|
|
13
|
-
required: z.boolean().optional(),
|
|
14
|
-
aliases: z.array(z.string()).optional(),
|
|
15
|
-
description: z.string().optional(),
|
|
16
|
-
});
|
|
17
|
-
const itemTypeCommandOptionPolicySchema = z.object({
|
|
18
|
-
command: z.union([z.literal("create"), z.literal("update")]),
|
|
19
|
-
option: z.string(),
|
|
20
|
-
required: z.boolean().optional(),
|
|
21
|
-
visible: z.boolean().optional(),
|
|
22
|
-
enabled: z.boolean().optional(),
|
|
23
|
-
});
|
|
24
|
-
const itemTypeDefinitionSchema = z.object({
|
|
25
|
-
name: z.string(),
|
|
26
|
-
folder: z.string().optional(),
|
|
27
|
-
aliases: z.array(z.string()).optional(),
|
|
28
|
-
required_create_fields: z.array(z.string()).optional(),
|
|
29
|
-
required_create_repeatables: z.array(z.string()).optional(),
|
|
30
|
-
options: z.array(itemTypeOptionSchema).optional(),
|
|
31
|
-
command_option_policies: z.array(itemTypeCommandOptionPolicySchema).optional(),
|
|
32
|
-
});
|
|
33
|
-
const runtimeStatusDefinitionSchema = z.object({
|
|
34
|
-
id: z.string(),
|
|
35
|
-
aliases: z.array(z.string()).optional(),
|
|
36
|
-
roles: z
|
|
37
|
-
.array(z.union([
|
|
38
|
-
z.literal("draft"),
|
|
39
|
-
z.literal("active"),
|
|
40
|
-
z.literal("blocked"),
|
|
41
|
-
z.literal("terminal"),
|
|
42
|
-
z.literal("terminal_done"),
|
|
43
|
-
z.literal("terminal_canceled"),
|
|
44
|
-
z.literal("default_open"),
|
|
45
|
-
z.literal("default_close"),
|
|
46
|
-
z.literal("default_cancel"),
|
|
47
|
-
]))
|
|
48
|
-
.optional(),
|
|
49
|
-
description: z.string().optional(),
|
|
50
|
-
order: z.number().optional(),
|
|
51
|
-
});
|
|
52
|
-
const runtimeFieldDefinitionSchema = z.object({
|
|
53
|
-
key: z.string(),
|
|
54
|
-
metadata_key: z.string().optional(),
|
|
55
|
-
front_matter_key: z.string().optional(),
|
|
56
|
-
cli_flag: z.string().optional(),
|
|
57
|
-
cli_aliases: z.array(z.string()).optional(),
|
|
58
|
-
description: z.string().optional(),
|
|
59
|
-
type: z.union([z.literal("string"), z.literal("number"), z.literal("boolean"), z.literal("string_array")]).optional(),
|
|
60
|
-
commands: z
|
|
61
|
-
.array(z.union([
|
|
62
|
-
z.literal("create"),
|
|
63
|
-
z.literal("update"),
|
|
64
|
-
z.literal("update_many"),
|
|
65
|
-
z.literal("list"),
|
|
66
|
-
z.literal("search"),
|
|
67
|
-
z.literal("calendar"),
|
|
68
|
-
z.literal("context"),
|
|
69
|
-
]))
|
|
70
|
-
.optional(),
|
|
71
|
-
repeatable: z.boolean().optional(),
|
|
72
|
-
required: z.boolean().optional(),
|
|
73
|
-
required_on_create: z.boolean().optional(),
|
|
74
|
-
required_types: z.array(z.string()).optional(),
|
|
75
|
-
allow_unset: z.boolean().optional(),
|
|
76
|
-
});
|
|
77
|
-
const runtimeSchemaSettingsSchema = z
|
|
78
|
-
.object({
|
|
79
|
-
version: z.number().int().optional(),
|
|
80
|
-
files: z
|
|
81
|
-
.object({
|
|
82
|
-
types: z.string().optional(),
|
|
83
|
-
statuses: z.string().optional(),
|
|
84
|
-
fields: z.string().optional(),
|
|
85
|
-
workflows: z.string().optional(),
|
|
86
|
-
})
|
|
87
|
-
.optional(),
|
|
88
|
-
statuses: z.array(runtimeStatusDefinitionSchema).optional(),
|
|
89
|
-
fields: z.array(runtimeFieldDefinitionSchema).optional(),
|
|
90
|
-
workflow: z
|
|
91
|
-
.object({
|
|
92
|
-
draft_status: z.string().optional(),
|
|
93
|
-
open_status: z.string().optional(),
|
|
94
|
-
in_progress_status: z.string().optional(),
|
|
95
|
-
blocked_status: z.string().optional(),
|
|
96
|
-
close_status: z.string().optional(),
|
|
97
|
-
canceled_status: z.string().optional(),
|
|
98
|
-
})
|
|
99
|
-
.optional(),
|
|
100
|
-
unknown_field_policy: z.union([z.literal("allow"), z.literal("warn"), z.literal("reject")]).optional(),
|
|
101
|
-
})
|
|
102
|
-
.optional();
|
|
103
|
-
const governanceSettingsSchema = z
|
|
104
|
-
.object({
|
|
105
|
-
preset: z.union([z.literal("minimal"), z.literal("default"), z.literal("strict"), z.literal("custom")]).optional(),
|
|
106
|
-
ownership_enforcement: z.union([z.literal("none"), z.literal("warn"), z.literal("strict")]).optional(),
|
|
107
|
-
create_mode_default: z.union([z.literal("progressive"), z.literal("strict")]).optional(),
|
|
108
|
-
close_validation_default: z.union([z.literal("off"), z.literal("warn"), z.literal("strict")]).optional(),
|
|
109
|
-
parent_reference: z.union([z.literal("warn"), z.literal("strict_error")]).optional(),
|
|
110
|
-
metadata_profile: z.union([z.literal("core"), z.literal("strict"), z.literal("custom")]).optional(),
|
|
111
|
-
force_required_for_stale_lock: z.boolean().optional(),
|
|
112
|
-
create_default_type: z.string().optional(),
|
|
113
|
-
})
|
|
114
|
-
.optional();
|
|
115
|
-
const extensionPolicyOverrideSchema = z.object({
|
|
116
|
-
name: z.string(),
|
|
117
|
-
disabled: z.boolean().optional(),
|
|
118
|
-
require_trusted: z.boolean().optional(),
|
|
119
|
-
require_provenance: z.boolean().optional(),
|
|
120
|
-
sandbox_profile: z.union([z.literal("none"), z.literal("restricted"), z.literal("strict")]).optional(),
|
|
121
|
-
allowed_capabilities: z.array(z.string()).optional(),
|
|
122
|
-
blocked_capabilities: z.array(z.string()).optional(),
|
|
123
|
-
allowed_surfaces: z.array(z.string()).optional(),
|
|
124
|
-
blocked_surfaces: z.array(z.string()).optional(),
|
|
125
|
-
allowed_commands: z.array(z.string()).optional(),
|
|
126
|
-
blocked_commands: z.array(z.string()).optional(),
|
|
127
|
-
allowed_actions: z.array(z.string()).optional(),
|
|
128
|
-
blocked_actions: z.array(z.string()).optional(),
|
|
129
|
-
allowed_services: z.array(z.string()).optional(),
|
|
130
|
-
blocked_services: z.array(z.string()).optional(),
|
|
131
|
-
});
|
|
132
|
-
const extensionPolicySchema = z
|
|
133
|
-
.object({
|
|
134
|
-
mode: z.union([z.literal("off"), z.literal("warn"), z.literal("enforce")]).optional(),
|
|
135
|
-
trust_mode: z.union([z.literal("off"), z.literal("warn"), z.literal("enforce")]).optional(),
|
|
136
|
-
require_provenance: z.boolean().optional(),
|
|
137
|
-
trusted_extensions: z.array(z.string()).optional(),
|
|
138
|
-
default_sandbox_profile: z.union([z.literal("none"), z.literal("restricted"), z.literal("strict")]).optional(),
|
|
139
|
-
allowed_extensions: z.array(z.string()).optional(),
|
|
140
|
-
blocked_extensions: z.array(z.string()).optional(),
|
|
141
|
-
allowed_capabilities: z.array(z.string()).optional(),
|
|
142
|
-
blocked_capabilities: z.array(z.string()).optional(),
|
|
143
|
-
allowed_surfaces: z.array(z.string()).optional(),
|
|
144
|
-
blocked_surfaces: z.array(z.string()).optional(),
|
|
145
|
-
allowed_commands: z.array(z.string()).optional(),
|
|
146
|
-
blocked_commands: z.array(z.string()).optional(),
|
|
147
|
-
allowed_actions: z.array(z.string()).optional(),
|
|
148
|
-
blocked_actions: z.array(z.string()).optional(),
|
|
149
|
-
allowed_services: z.array(z.string()).optional(),
|
|
150
|
-
blocked_services: z.array(z.string()).optional(),
|
|
151
|
-
extension_overrides: z.array(extensionPolicyOverrideSchema).optional(),
|
|
152
|
-
})
|
|
153
|
-
.optional();
|
|
154
|
-
const settingsSchema = z.object({
|
|
155
|
-
version: z.number().int(),
|
|
156
|
-
id_prefix: z.string(),
|
|
157
|
-
author_default: z.string(),
|
|
158
|
-
item_format: z.union([z.literal("toon"), z.literal("json_markdown")]).optional(),
|
|
159
|
-
locks: z.object({
|
|
160
|
-
ttl_seconds: z.number().int(),
|
|
161
|
-
}),
|
|
162
|
-
output: z.object({
|
|
163
|
-
default_format: z.union([z.literal("toon"), z.literal("json")]),
|
|
164
|
-
}),
|
|
165
|
-
history: z
|
|
166
|
-
.object({
|
|
167
|
-
missing_stream: z.union([z.literal("auto_create"), z.literal("strict_error")]),
|
|
168
|
-
})
|
|
169
|
-
.optional(),
|
|
170
|
-
validation: z
|
|
171
|
-
.object({
|
|
172
|
-
sprint_release_format: z.union([z.literal("warn"), z.literal("strict_error")]),
|
|
173
|
-
parent_reference: z.union([z.literal("warn"), z.literal("strict_error")]).optional(),
|
|
174
|
-
metadata_profile: z.union([z.literal("core"), z.literal("strict"), z.literal("custom")]).optional(),
|
|
175
|
-
metadata_required_fields: z.array(z.string()).optional(),
|
|
176
|
-
lifecycle_stale_blocker_reason_patterns: z.array(z.string()).optional(),
|
|
177
|
-
lifecycle_closure_like_blocked_reason_patterns: z.array(z.string()).optional(),
|
|
178
|
-
lifecycle_closure_like_resolution_patterns: z.array(z.string()).optional(),
|
|
179
|
-
lifecycle_closure_like_actual_result_patterns: z.array(z.string()).optional(),
|
|
180
|
-
})
|
|
181
|
-
.optional(),
|
|
182
|
-
governance: governanceSettingsSchema,
|
|
183
|
-
workflow: z
|
|
184
|
-
.object({
|
|
185
|
-
definition_of_done: z.array(z.string()),
|
|
186
|
-
})
|
|
187
|
-
.optional(),
|
|
188
|
-
testing: z
|
|
189
|
-
.object({
|
|
190
|
-
record_results_to_items: z.boolean(),
|
|
191
|
-
})
|
|
192
|
-
.optional(),
|
|
193
|
-
telemetry: z
|
|
194
|
-
.object({
|
|
195
|
-
enabled: z.boolean(),
|
|
196
|
-
first_run_prompt_completed: z.boolean().optional(),
|
|
197
|
-
capture_level: z.union([z.literal("minimal"), z.literal("redacted"), z.literal("max")]).optional(),
|
|
198
|
-
endpoint: z.string().optional(),
|
|
199
|
-
installation_id: z.string().optional(),
|
|
200
|
-
retention_days: z.number().int().positive().optional(),
|
|
201
|
-
})
|
|
202
|
-
.optional(),
|
|
203
|
-
agent_guidance: z
|
|
204
|
-
.object({
|
|
205
|
-
prompt_completed: z.boolean().optional(),
|
|
206
|
-
declined: z.boolean().optional(),
|
|
207
|
-
declined_at: z.string().optional(),
|
|
208
|
-
template_version: z.number().int().positive().optional(),
|
|
209
|
-
last_checked_files: z.array(z.string()).optional(),
|
|
210
|
-
})
|
|
211
|
-
.optional(),
|
|
212
|
-
item_types: z
|
|
213
|
-
.object({
|
|
214
|
-
definitions: z.array(itemTypeDefinitionSchema),
|
|
215
|
-
})
|
|
216
|
-
.optional(),
|
|
217
|
-
schema: runtimeSchemaSettingsSchema,
|
|
218
|
-
context: z
|
|
219
|
-
.object({
|
|
220
|
-
default_depth: z.union([z.literal("brief"), z.literal("standard"), z.literal("deep")]).optional(),
|
|
221
|
-
activity_limit: z.number().int().positive().optional(),
|
|
222
|
-
stale_threshold_days: z.number().int().positive().optional(),
|
|
223
|
-
sections: z
|
|
224
|
-
.object({
|
|
225
|
-
hierarchy: z.boolean().optional(),
|
|
226
|
-
activity: z.boolean().optional(),
|
|
227
|
-
progress: z.boolean().optional(),
|
|
228
|
-
blockers: z.boolean().optional(),
|
|
229
|
-
files: z.boolean().optional(),
|
|
230
|
-
workload: z.boolean().optional(),
|
|
231
|
-
staleness: z.boolean().optional(),
|
|
232
|
-
tests: z.boolean().optional(),
|
|
233
|
-
})
|
|
234
|
-
.optional(),
|
|
235
|
-
})
|
|
236
|
-
.optional(),
|
|
237
|
-
extensions: z.object({
|
|
238
|
-
enabled: z.array(z.string()),
|
|
239
|
-
disabled: z.array(z.string()),
|
|
240
|
-
policy: extensionPolicySchema,
|
|
241
|
-
}),
|
|
242
|
-
search: z.object({
|
|
243
|
-
score_threshold: z.number(),
|
|
244
|
-
hybrid_semantic_weight: z.number().optional(),
|
|
245
|
-
max_results: z.number().int(),
|
|
246
|
-
embedding_model: z.string(),
|
|
247
|
-
embedding_batch_size: z.number().int(),
|
|
248
|
-
embedding_timeout_ms: z.number().int().optional(),
|
|
249
|
-
scanner_max_batch_retries: z.number().int(),
|
|
250
|
-
provider: z.string().optional(),
|
|
251
|
-
}),
|
|
252
|
-
providers: z.object({
|
|
253
|
-
openai: z.object({
|
|
254
|
-
base_url: z.string(),
|
|
255
|
-
api_key: z.string(),
|
|
256
|
-
model: z.string(),
|
|
257
|
-
}),
|
|
258
|
-
ollama: z.object({
|
|
259
|
-
base_url: z.string(),
|
|
260
|
-
model: z.string(),
|
|
261
|
-
}),
|
|
262
|
-
}),
|
|
263
|
-
vector_store: z.object({
|
|
264
|
-
adapter: z.string().optional(),
|
|
265
|
-
qdrant: z.object({
|
|
266
|
-
url: z.string(),
|
|
267
|
-
api_key: z.string(),
|
|
268
|
-
}),
|
|
269
|
-
lancedb: z.object({
|
|
270
|
-
path: z.string(),
|
|
271
|
-
}),
|
|
272
|
-
}),
|
|
273
|
-
});
|
|
10
|
+
import { normalizeItemTypeDefinition } from "../item/item-type-definition.js";
|
|
274
11
|
const SETTINGS_WRITE_OP = "settings:write";
|
|
275
12
|
function resolveGovernanceKnobsFromPreset(preset) {
|
|
276
13
|
return structuredClone(GOVERNANCE_PRESET_DEFAULTS[preset]);
|
|
@@ -488,75 +225,6 @@ function normalizeValidationMetadataRequiredFields(values) {
|
|
|
488
225
|
function normalizeValidationPatternList(values) {
|
|
489
226
|
return [...new Set((values ?? []).map((value) => value.trim().toLowerCase()).filter((value) => value.length > 0))].sort((left, right) => left.localeCompare(right));
|
|
490
227
|
}
|
|
491
|
-
function normalizeItemTypeOptionDefinition(option) {
|
|
492
|
-
const key = option.key.trim();
|
|
493
|
-
if (key.length === 0) {
|
|
494
|
-
return null;
|
|
495
|
-
}
|
|
496
|
-
const values = normalizeStringList(option.values);
|
|
497
|
-
const aliases = normalizeStringList(option.aliases);
|
|
498
|
-
const description = option.description?.trim();
|
|
499
|
-
return {
|
|
500
|
-
key,
|
|
501
|
-
values,
|
|
502
|
-
required: option.required === true ? true : undefined,
|
|
503
|
-
aliases: aliases.length > 0 ? aliases : undefined,
|
|
504
|
-
description: description && description.length > 0 ? description : undefined,
|
|
505
|
-
};
|
|
506
|
-
}
|
|
507
|
-
function normalizeItemTypeCommandOptionPolicy(policy) {
|
|
508
|
-
const option = policy.option.trim();
|
|
509
|
-
if (option.length === 0) {
|
|
510
|
-
return null;
|
|
511
|
-
}
|
|
512
|
-
return {
|
|
513
|
-
command: policy.command,
|
|
514
|
-
option,
|
|
515
|
-
required: policy.required,
|
|
516
|
-
visible: policy.visible,
|
|
517
|
-
enabled: policy.enabled,
|
|
518
|
-
};
|
|
519
|
-
}
|
|
520
|
-
function normalizeItemTypeDefinition(definition) {
|
|
521
|
-
const name = definition.name.trim();
|
|
522
|
-
if (name.length === 0) {
|
|
523
|
-
return null;
|
|
524
|
-
}
|
|
525
|
-
const hasRequiredCreateFields = definition.required_create_fields !== undefined;
|
|
526
|
-
const hasRequiredCreateRepeatables = definition.required_create_repeatables !== undefined;
|
|
527
|
-
const hasOptions = definition.options !== undefined;
|
|
528
|
-
const hasCommandOptionPolicies = definition.command_option_policies !== undefined;
|
|
529
|
-
const folder = definition.folder?.trim();
|
|
530
|
-
const aliases = normalizeStringList(definition.aliases);
|
|
531
|
-
const requiredCreateFields = normalizeStringList(definition.required_create_fields);
|
|
532
|
-
const requiredCreateRepeatables = normalizeStringList(definition.required_create_repeatables);
|
|
533
|
-
const options = (definition.options ?? [])
|
|
534
|
-
.map((option) => normalizeItemTypeOptionDefinition(option))
|
|
535
|
-
.filter((option) => option !== null)
|
|
536
|
-
.sort((left, right) => left.key.localeCompare(right.key));
|
|
537
|
-
const commandOptionPolicies = (() => {
|
|
538
|
-
const dedupedByKey = new Map();
|
|
539
|
-
for (const policy of definition.command_option_policies ?? []) {
|
|
540
|
-
const normalized = normalizeItemTypeCommandOptionPolicy(policy);
|
|
541
|
-
if (!normalized) {
|
|
542
|
-
continue;
|
|
543
|
-
}
|
|
544
|
-
dedupedByKey.set(`${normalized.command}:${normalized.option.toLowerCase()}`, normalized);
|
|
545
|
-
}
|
|
546
|
-
return [...dedupedByKey.values()].sort((left, right) => left.command === right.command
|
|
547
|
-
? left.option.localeCompare(right.option)
|
|
548
|
-
: left.command.localeCompare(right.command));
|
|
549
|
-
})();
|
|
550
|
-
return {
|
|
551
|
-
name,
|
|
552
|
-
folder: folder && folder.length > 0 ? folder : undefined,
|
|
553
|
-
aliases: aliases.length > 0 ? aliases : undefined,
|
|
554
|
-
required_create_fields: hasRequiredCreateFields ? requiredCreateFields : undefined,
|
|
555
|
-
required_create_repeatables: hasRequiredCreateRepeatables ? requiredCreateRepeatables : undefined,
|
|
556
|
-
options: hasOptions ? options : undefined,
|
|
557
|
-
command_option_policies: hasCommandOptionPolicies ? commandOptionPolicies : undefined,
|
|
558
|
-
};
|
|
559
|
-
}
|
|
560
228
|
export function normalizeItemTypeDefinitions(definitions) {
|
|
561
229
|
const normalized = (definitions ?? [])
|
|
562
230
|
.map((definition) => normalizeItemTypeDefinition(definition))
|
|
@@ -567,13 +235,8 @@ export function normalizeItemTypeDefinitions(definitions) {
|
|
|
567
235
|
}
|
|
568
236
|
return [...dedupedByName.values()].sort((left, right) => left.name.localeCompare(right.name));
|
|
569
237
|
}
|
|
570
|
-
function mergeSettings(
|
|
238
|
+
function mergeSettings(settings) {
|
|
571
239
|
const defaults = cloneDefaults();
|
|
572
|
-
const parsed = settingsSchema.safeParse(raw);
|
|
573
|
-
if (!parsed.success) {
|
|
574
|
-
return defaults;
|
|
575
|
-
}
|
|
576
|
-
const settings = parsed.data;
|
|
577
240
|
const governance = resolveGovernanceKnobs({
|
|
578
241
|
governance: settings.governance ?? { preset: "default" },
|
|
579
242
|
});
|
|
@@ -840,7 +503,7 @@ export async function readSettingsWithMetadata(pmRoot) {
|
|
|
840
503
|
catch {
|
|
841
504
|
return buildFallbackSettingsReadResult("settings_read_invalid_json");
|
|
842
505
|
}
|
|
843
|
-
const validated =
|
|
506
|
+
const validated = validateSettings(parsed);
|
|
844
507
|
if (!validated.success) {
|
|
845
508
|
return buildFallbackSettingsReadResult("settings_read_invalid_schema");
|
|
846
509
|
}
|
|
@@ -889,4 +552,4 @@ export async function writeSettings(pmRoot, settings, op = SETTINGS_WRITE_OP) {
|
|
|
889
552
|
});
|
|
890
553
|
}
|
|
891
554
|
//# sourceMappingURL=settings.js.map
|
|
892
|
-
//# debugId=
|
|
555
|
+
//# debugId=7fed7222-981d-50f3-8a28-3635f56361b9
|