@unbrained/pm-cli 2026.5.29 → 2026.5.31
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 +54 -12
- package/dist/cli/bootstrap-args.d.ts +1 -1
- package/dist/cli/bootstrap-args.js +59 -9
- package/dist/cli/bootstrap-args.js.map +1 -1
- package/dist/cli/commands/activity.js +4 -4
- package/dist/cli/commands/activity.js.map +1 -1
- package/dist/cli/commands/calendar.js +83 -11
- package/dist/cli/commands/calendar.js.map +1 -1
- package/dist/cli/commands/close.js +4 -4
- package/dist/cli/commands/close.js.map +1 -1
- package/dist/cli/commands/completion.js +4 -4
- package/dist/cli/commands/completion.js.map +1 -1
- package/dist/cli/commands/create.js +50 -7
- package/dist/cli/commands/create.js.map +1 -1
- package/dist/cli/commands/deps.js +4 -4
- package/dist/cli/commands/deps.js.map +1 -1
- package/dist/cli/commands/extension/install-sources.d.ts +3 -0
- package/dist/cli/commands/extension/install-sources.js +29 -4
- package/dist/cli/commands/extension/install-sources.js.map +1 -1
- package/dist/cli/commands/extension.js +26 -5
- package/dist/cli/commands/extension.js.map +1 -1
- package/dist/cli/commands/get.js +6 -3
- package/dist/cli/commands/get.js.map +1 -1
- package/dist/cli/commands/list.js +25 -6
- package/dist/cli/commands/list.js.map +1 -1
- package/dist/cli/commands/reindex.js +3 -3
- package/dist/cli/commands/reindex.js.map +1 -1
- package/dist/cli/commands/search.d.ts +17 -0
- package/dist/cli/commands/search.js +40 -10
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/stats.js +4 -4
- package/dist/cli/commands/stats.js.map +1 -1
- package/dist/cli/commands/test-all.js +4 -4
- package/dist/cli/commands/test-all.js.map +1 -1
- package/dist/cli/main.d.ts +2 -0
- package/dist/cli/main.js +39 -11
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/register-list-query.js +10 -12
- package/dist/cli/register-list-query.js.map +1 -1
- package/dist/cli/register-mutation.js +20 -22
- package/dist/cli/register-mutation.js.map +1 -1
- package/dist/cli/register-operations.js +32 -25
- package/dist/cli/register-operations.js.map +1 -1
- package/dist/cli/register-setup.js +7 -9
- package/dist/cli/register-setup.js.map +1 -1
- package/dist/cli/registration-helpers.js +6 -3
- package/dist/cli/registration-helpers.js.map +1 -1
- package/dist/cli/search-refresh.d.ts +2 -0
- package/dist/cli/search-refresh.js +13 -0
- package/dist/cli/search-refresh.js.map +1 -0
- package/dist/cli-bundle/chunks/activity-OWYSUZOY.js +17 -0
- package/dist/cli-bundle/chunks/activity-OWYSUZOY.js.map +7 -0
- package/dist/cli-bundle/chunks/aggregate-ADUOSFRO.js +209 -0
- package/dist/cli-bundle/chunks/aggregate-ADUOSFRO.js.map +7 -0
- package/dist/cli-bundle/chunks/append-JD2DETU7.js +73 -0
- package/dist/cli-bundle/chunks/append-JD2DETU7.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-3HUE7XOF.js +27 -0
- package/dist/cli-bundle/chunks/chunk-3HUE7XOF.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-3M73P3G6.js +1636 -0
- package/dist/cli-bundle/chunks/chunk-3M73P3G6.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-4AEZR5EJ.js +189 -0
- package/dist/cli-bundle/chunks/chunk-4AEZR5EJ.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-5HSEP75M.js +330 -0
- package/dist/cli-bundle/chunks/chunk-5HSEP75M.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-6HT2F4TK.js +1770 -0
- package/dist/cli-bundle/chunks/chunk-6HT2F4TK.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-6YCV7WSL.js +552 -0
- package/dist/cli-bundle/chunks/chunk-6YCV7WSL.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-7Y53ZJIQ.js +202 -0
- package/dist/cli-bundle/chunks/chunk-7Y53ZJIQ.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-A7E7PUVX.js +157 -0
- package/dist/cli-bundle/chunks/chunk-A7E7PUVX.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-AKOOMO3T.js +90 -0
- package/dist/cli-bundle/chunks/chunk-AKOOMO3T.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-BUPWJ3IJ.js +950 -0
- package/dist/cli-bundle/chunks/chunk-BUPWJ3IJ.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-CEFIVZPG.js +79 -0
- package/dist/cli-bundle/chunks/chunk-CEFIVZPG.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-D7AOMPRH.js +349 -0
- package/dist/cli-bundle/chunks/chunk-D7AOMPRH.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-EAOG77HM.js +56 -0
- package/dist/cli-bundle/chunks/chunk-EAOG77HM.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-EGUGFSNX.js +47 -0
- package/dist/cli-bundle/chunks/chunk-EGUGFSNX.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-FM26RGSU.js +56 -0
- package/dist/cli-bundle/chunks/chunk-FM26RGSU.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-FQE6XZDB.js +435 -0
- package/dist/cli-bundle/chunks/chunk-FQE6XZDB.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-G57E5D7T.js +185 -0
- package/dist/cli-bundle/chunks/chunk-G57E5D7T.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-GN7IJPCD.js +3621 -0
- package/dist/cli-bundle/chunks/chunk-GN7IJPCD.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-JFWUHHS2.js +233 -0
- package/dist/cli-bundle/chunks/chunk-JFWUHHS2.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-JTWRXG4B.js +1861 -0
- package/dist/cli-bundle/chunks/chunk-JTWRXG4B.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-JULRTHJQ.js +648 -0
- package/dist/cli-bundle/chunks/chunk-JULRTHJQ.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-KBQY3YG5.js +122 -0
- package/dist/cli-bundle/chunks/chunk-KBQY3YG5.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-L2FXEKDB.js +185 -0
- package/dist/cli-bundle/chunks/chunk-L2FXEKDB.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-LRBOHPUE.js +189 -0
- package/dist/cli-bundle/chunks/chunk-LRBOHPUE.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-LSXGH6NE.js +5153 -0
- package/dist/cli-bundle/chunks/chunk-LSXGH6NE.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-MD7K4JYF.js +1345 -0
- package/dist/cli-bundle/chunks/chunk-MD7K4JYF.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-NGN7UV5K.js +341 -0
- package/dist/cli-bundle/chunks/chunk-NGN7UV5K.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-O7IWB35H.js +18 -0
- package/dist/cli-bundle/chunks/chunk-O7IWB35H.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-OGZEG5TT.js +2929 -0
- package/dist/cli-bundle/chunks/chunk-OGZEG5TT.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-P53TN6IA.js +674 -0
- package/dist/cli-bundle/chunks/chunk-P53TN6IA.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-PVNQLCIS.js +176 -0
- package/dist/cli-bundle/chunks/chunk-PVNQLCIS.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-PXUAZUUY.js +1680 -0
- package/dist/cli-bundle/chunks/chunk-PXUAZUUY.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-QAJBIGRA.js +20 -0
- package/dist/cli-bundle/chunks/chunk-QAJBIGRA.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-SEXQN4KL.js +60 -0
- package/dist/cli-bundle/chunks/chunk-SEXQN4KL.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-U7FMKRXH.js +362 -0
- package/dist/cli-bundle/chunks/chunk-U7FMKRXH.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-VGICHR7D.js +141 -0
- package/dist/cli-bundle/chunks/chunk-VGICHR7D.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-WDPXDQFG.js +632 -0
- package/dist/cli-bundle/chunks/chunk-WDPXDQFG.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-WJ2NAC37.js +252 -0
- package/dist/cli-bundle/chunks/chunk-WJ2NAC37.js.map +7 -0
- package/dist/cli-bundle/chunks/claim-EE4TKKCV.js +133 -0
- package/dist/cli-bundle/chunks/claim-EE4TKKCV.js.map +7 -0
- package/dist/cli-bundle/chunks/close-XY4CSAYF.js +14 -0
- package/dist/cli-bundle/chunks/close-XY4CSAYF.js.map +7 -0
- package/dist/cli-bundle/chunks/comments-AAKJQ6LW.js +104 -0
- package/dist/cli-bundle/chunks/comments-AAKJQ6LW.js.map +7 -0
- package/dist/cli-bundle/chunks/config-V3FZOKLI.js +1577 -0
- package/dist/cli-bundle/chunks/config-V3FZOKLI.js.map +7 -0
- package/dist/cli-bundle/chunks/context-RZ5QPNJB.js +1458 -0
- package/dist/cli-bundle/chunks/context-RZ5QPNJB.js.map +7 -0
- package/dist/cli-bundle/chunks/contracts-YLMH33VU.js +1245 -0
- package/dist/cli-bundle/chunks/contracts-YLMH33VU.js.map +7 -0
- package/dist/cli-bundle/chunks/create-PZVHRIZQ.js +28 -0
- package/dist/cli-bundle/chunks/create-PZVHRIZQ.js.map +7 -0
- package/dist/cli-bundle/chunks/delete-RHCTEORS.js +59 -0
- package/dist/cli-bundle/chunks/delete-RHCTEORS.js.map +7 -0
- package/dist/cli-bundle/chunks/deps-MZYCMLAO.js +229 -0
- package/dist/cli-bundle/chunks/deps-MZYCMLAO.js.map +7 -0
- package/dist/cli-bundle/chunks/docs-FXXUCZYU.js +35 -0
- package/dist/cli-bundle/chunks/docs-FXXUCZYU.js.map +7 -0
- package/dist/cli-bundle/chunks/extension-B4WL7BQU.js +25 -0
- package/dist/cli-bundle/chunks/extension-B4WL7BQU.js.map +7 -0
- package/dist/cli-bundle/chunks/files-WVOX67PE.js +286 -0
- package/dist/cli-bundle/chunks/files-WVOX67PE.js.map +7 -0
- package/dist/cli-bundle/chunks/gc-JWNF66EC.js +181 -0
- package/dist/cli-bundle/chunks/gc-JWNF66EC.js.map +7 -0
- package/dist/cli-bundle/chunks/get-LTK3HOCQ.js +198 -0
- package/dist/cli-bundle/chunks/get-LTK3HOCQ.js.map +7 -0
- package/dist/cli-bundle/chunks/health-TCWL55KM.js +1233 -0
- package/dist/cli-bundle/chunks/health-TCWL55KM.js.map +7 -0
- package/dist/cli-bundle/chunks/history-A2JUDXUE.js +21 -0
- package/dist/cli-bundle/chunks/history-A2JUDXUE.js.map +7 -0
- package/dist/cli-bundle/chunks/history-redact-ED6RFCPL.js +20 -0
- package/dist/cli-bundle/chunks/history-redact-ED6RFCPL.js.map +7 -0
- package/dist/cli-bundle/chunks/history-repair-ZWSTDRH2.js +198 -0
- package/dist/cli-bundle/chunks/history-repair-ZWSTDRH2.js.map +7 -0
- package/dist/cli-bundle/chunks/init-M2WUB4YH.js +16 -0
- package/dist/cli-bundle/chunks/init-M2WUB4YH.js.map +7 -0
- package/dist/cli-bundle/chunks/learnings-NXTWE3FR.js +48 -0
- package/dist/cli-bundle/chunks/learnings-NXTWE3FR.js.map +7 -0
- package/dist/cli-bundle/chunks/list-OGWQPC26.js +20 -0
- package/dist/cli-bundle/chunks/list-OGWQPC26.js.map +7 -0
- package/dist/cli-bundle/chunks/notes-DFS5ZGOO.js +48 -0
- package/dist/cli-bundle/chunks/notes-DFS5ZGOO.js.map +7 -0
- package/dist/cli-bundle/chunks/plan-67AB2PLM.js +1175 -0
- package/dist/cli-bundle/chunks/plan-67AB2PLM.js.map +7 -0
- package/dist/cli-bundle/chunks/register-list-query-UP3VRUFS.js +232 -0
- package/dist/cli-bundle/chunks/register-list-query-UP3VRUFS.js.map +7 -0
- package/dist/cli-bundle/chunks/register-mutation-YWSBF545.js +712 -0
- package/dist/cli-bundle/chunks/register-mutation-YWSBF545.js.map +7 -0
- package/dist/cli-bundle/chunks/register-operations-3BDTGSDH.js +374 -0
- package/dist/cli-bundle/chunks/register-operations-3BDTGSDH.js.map +7 -0
- package/dist/cli-bundle/chunks/register-setup-V56GDRUS.js +246 -0
- package/dist/cli-bundle/chunks/register-setup-V56GDRUS.js.map +7 -0
- package/dist/cli-bundle/chunks/restore-MB2ISME7.js +18 -0
- package/dist/cli-bundle/chunks/restore-MB2ISME7.js.map +7 -0
- package/dist/cli-bundle/chunks/schema-Q622KC46.js +119 -0
- package/dist/cli-bundle/chunks/schema-Q622KC46.js.map +7 -0
- package/dist/cli-bundle/chunks/search-HENBL456.js +1135 -0
- package/dist/cli-bundle/chunks/search-HENBL456.js.map +7 -0
- package/dist/cli-bundle/chunks/stats-N6H3YP2F.js +124 -0
- package/dist/cli-bundle/chunks/stats-N6H3YP2F.js.map +7 -0
- package/dist/cli-bundle/chunks/test-VNBDRJ4Z.js +32 -0
- package/dist/cli-bundle/chunks/test-VNBDRJ4Z.js.map +7 -0
- package/dist/cli-bundle/chunks/test-all-G2AZOHXI.js +332 -0
- package/dist/cli-bundle/chunks/test-all-G2AZOHXI.js.map +7 -0
- package/dist/cli-bundle/chunks/test-runs-GX5HTPSF.js +939 -0
- package/dist/cli-bundle/chunks/test-runs-GX5HTPSF.js.map +7 -0
- package/dist/cli-bundle/chunks/update-H6SCWNMA.js +22 -0
- package/dist/cli-bundle/chunks/update-H6SCWNMA.js.map +7 -0
- package/dist/cli-bundle/chunks/update-many-46HRSP2Q.js +676 -0
- package/dist/cli-bundle/chunks/update-many-46HRSP2Q.js.map +7 -0
- package/dist/cli-bundle/chunks/upgrade-H5HHM5UV.js +271 -0
- package/dist/cli-bundle/chunks/upgrade-H5HHM5UV.js.map +7 -0
- package/dist/cli-bundle/chunks/validate-TMCVKIGZ.js +1110 -0
- package/dist/cli-bundle/chunks/validate-TMCVKIGZ.js.map +7 -0
- package/dist/cli-bundle/main.js +6952 -0
- package/dist/cli-bundle/main.js.map +7 -0
- package/dist/cli.js +1 -1
- package/dist/core/config/nested-settings.d.ts +2 -0
- package/dist/core/config/nested-settings.js +17 -2
- package/dist/core/config/nested-settings.js.map +1 -1
- package/dist/core/item/item-type-definition.js +6 -2
- package/dist/core/item/item-type-definition.js.map +1 -1
- package/dist/core/item/type-registry.d.ts +4 -0
- package/dist/core/item/type-registry.js +10 -2
- package/dist/core/item/type-registry.js.map +1 -1
- package/dist/core/item/type-synonyms.d.ts +20 -0
- package/dist/core/item/type-synonyms.js +42 -0
- package/dist/core/item/type-synonyms.js.map +1 -0
- package/dist/core/search/background-refresh.d.ts +53 -0
- package/dist/core/search/background-refresh.js +286 -0
- package/dist/core/search/background-refresh.js.map +1 -0
- package/dist/core/search/cache.d.ts +20 -1
- package/dist/core/search/cache.js +76 -5
- package/dist/core/search/cache.js.map +1 -1
- package/dist/core/search/semantic-defaults.js +73 -32
- package/dist/core/search/semantic-defaults.js.map +1 -1
- package/dist/core/search/vector-stores.js +7 -3
- package/dist/core/search/vector-stores.js.map +1 -1
- package/dist/core/sentry/helpers.d.ts +1 -1
- package/dist/core/sentry/helpers.js +4 -4
- package/dist/core/sentry/helpers.js.map +1 -1
- package/dist/core/shared/constants.d.ts +2 -2
- package/dist/core/shared/constants.js +3 -3
- package/dist/core/shared/constants.js.map +1 -1
- package/dist/core/shared/html-entity-decode.d.ts +2 -1
- package/dist/core/shared/html-entity-decode.js +14 -9
- package/dist/core/shared/html-entity-decode.js.map +1 -1
- package/dist/core/shared/time.js +52 -2
- package/dist/core/shared/time.js.map +1 -1
- package/dist/core/store/front-matter-cache.d.ts +24 -0
- package/dist/core/store/front-matter-cache.js +119 -8
- package/dist/core/store/front-matter-cache.js.map +1 -1
- package/dist/core/store/item-format-migration.js +25 -15
- package/dist/core/store/item-format-migration.js.map +1 -1
- package/dist/core/store/item-store.d.ts +7 -0
- package/dist/core/store/item-store.js +13 -3
- package/dist/core/store/item-store.js.map +1 -1
- package/dist/core/store/settings-validator.d.ts +1 -0
- package/dist/core/store/settings-validator.js +7 -2
- package/dist/core/store/settings-validator.js.map +1 -1
- package/dist/core/store/settings.js +19 -3
- package/dist/core/store/settings.js.map +1 -1
- package/dist/core/telemetry/runtime.d.ts +10 -0
- package/dist/core/telemetry/runtime.js +86 -2
- package/dist/core/telemetry/runtime.js.map +1 -1
- package/dist/mcp/server.js +3 -3
- package/dist/mcp/server.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +4 -4
- package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
- package/dist/sdk/cli-contracts.js +29 -8
- package/dist/sdk/cli-contracts.js.map +1 -1
- package/dist/types.d.ts +9 -1
- package/dist/types.js +2 -2
- package/dist/types.js.map +1 -1
- package/docs/CONFIGURATION.md +11 -0
- package/docs/RELEASING.md +1 -1
- package/package.json +7 -5
- package/packages/pm-calendar/extensions/calendar/index.js +27 -2
- package/packages/pm-calendar/extensions/calendar/index.ts +28 -2
- package/scripts/bundle-cli.mjs +39 -0
|
@@ -0,0 +1,632 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ITEM_TYPE_VALUES,
|
|
3
|
+
TYPE_TO_FOLDER,
|
|
4
|
+
normalizeItemTypeDefinition,
|
|
5
|
+
normalizeItemTypeStringList,
|
|
6
|
+
strictPolicyCommand
|
|
7
|
+
} from "./chunk-LSXGH6NE.js";
|
|
8
|
+
|
|
9
|
+
// dist/core/item/type-registry.js
|
|
10
|
+
!(function() {
|
|
11
|
+
try {
|
|
12
|
+
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
13
|
+
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "3a95db0f-9c6e-5a39-bffe-30ff5e40da57");
|
|
14
|
+
} catch (e2) {
|
|
15
|
+
}
|
|
16
|
+
})();
|
|
17
|
+
var DEFAULT_REQUIRED_CREATE_FIELDS = [
|
|
18
|
+
"title",
|
|
19
|
+
"description",
|
|
20
|
+
"status",
|
|
21
|
+
"priority",
|
|
22
|
+
"tags",
|
|
23
|
+
"body",
|
|
24
|
+
"deadline",
|
|
25
|
+
"estimatedMinutes",
|
|
26
|
+
"acceptanceCriteria",
|
|
27
|
+
"author",
|
|
28
|
+
"message",
|
|
29
|
+
"assignee"
|
|
30
|
+
];
|
|
31
|
+
var DEFAULT_REQUIRED_CREATE_REPEATABLES = ["dep", "comment", "note", "learning", "file", "test", "doc"];
|
|
32
|
+
var CREATE_COMMAND_OPTION_KEYS = [
|
|
33
|
+
"title",
|
|
34
|
+
"description",
|
|
35
|
+
"type",
|
|
36
|
+
"status",
|
|
37
|
+
"priority",
|
|
38
|
+
"tags",
|
|
39
|
+
"body",
|
|
40
|
+
"deadline",
|
|
41
|
+
"estimatedMinutes",
|
|
42
|
+
"acceptanceCriteria",
|
|
43
|
+
"definitionOfReady",
|
|
44
|
+
"order",
|
|
45
|
+
"goal",
|
|
46
|
+
"objective",
|
|
47
|
+
"value",
|
|
48
|
+
"impact",
|
|
49
|
+
"outcome",
|
|
50
|
+
"whyNow",
|
|
51
|
+
"author",
|
|
52
|
+
"message",
|
|
53
|
+
"assignee",
|
|
54
|
+
"parent",
|
|
55
|
+
"reviewer",
|
|
56
|
+
"risk",
|
|
57
|
+
"confidence",
|
|
58
|
+
"sprint",
|
|
59
|
+
"release",
|
|
60
|
+
"blockedBy",
|
|
61
|
+
"blockedReason",
|
|
62
|
+
"unblockNote",
|
|
63
|
+
"reporter",
|
|
64
|
+
"severity",
|
|
65
|
+
"environment",
|
|
66
|
+
"reproSteps",
|
|
67
|
+
"resolution",
|
|
68
|
+
"expectedResult",
|
|
69
|
+
"actualResult",
|
|
70
|
+
"affectedVersion",
|
|
71
|
+
"fixedVersion",
|
|
72
|
+
"component",
|
|
73
|
+
"regression",
|
|
74
|
+
"customerImpact",
|
|
75
|
+
"dep",
|
|
76
|
+
"comment",
|
|
77
|
+
"note",
|
|
78
|
+
"learning",
|
|
79
|
+
"file",
|
|
80
|
+
"test",
|
|
81
|
+
"doc",
|
|
82
|
+
"reminder",
|
|
83
|
+
"event",
|
|
84
|
+
"typeOption"
|
|
85
|
+
];
|
|
86
|
+
var UPDATE_COMMAND_OPTION_KEYS = [
|
|
87
|
+
"title",
|
|
88
|
+
"description",
|
|
89
|
+
"body",
|
|
90
|
+
"status",
|
|
91
|
+
"closeReason",
|
|
92
|
+
"priority",
|
|
93
|
+
"type",
|
|
94
|
+
"tags",
|
|
95
|
+
"deadline",
|
|
96
|
+
"estimatedMinutes",
|
|
97
|
+
"acceptanceCriteria",
|
|
98
|
+
"definitionOfReady",
|
|
99
|
+
"order",
|
|
100
|
+
"goal",
|
|
101
|
+
"objective",
|
|
102
|
+
"value",
|
|
103
|
+
"impact",
|
|
104
|
+
"outcome",
|
|
105
|
+
"whyNow",
|
|
106
|
+
"author",
|
|
107
|
+
"message",
|
|
108
|
+
"assignee",
|
|
109
|
+
"parent",
|
|
110
|
+
"reviewer",
|
|
111
|
+
"risk",
|
|
112
|
+
"confidence",
|
|
113
|
+
"sprint",
|
|
114
|
+
"release",
|
|
115
|
+
"blockedBy",
|
|
116
|
+
"blockedReason",
|
|
117
|
+
"unblockNote",
|
|
118
|
+
"reporter",
|
|
119
|
+
"severity",
|
|
120
|
+
"environment",
|
|
121
|
+
"reproSteps",
|
|
122
|
+
"resolution",
|
|
123
|
+
"expectedResult",
|
|
124
|
+
"actualResult",
|
|
125
|
+
"affectedVersion",
|
|
126
|
+
"fixedVersion",
|
|
127
|
+
"component",
|
|
128
|
+
"regression",
|
|
129
|
+
"customerImpact",
|
|
130
|
+
"comment",
|
|
131
|
+
"note",
|
|
132
|
+
"learning",
|
|
133
|
+
"file",
|
|
134
|
+
"test",
|
|
135
|
+
"doc",
|
|
136
|
+
"reminder",
|
|
137
|
+
"event",
|
|
138
|
+
"typeOption",
|
|
139
|
+
"allowAuditUpdate",
|
|
140
|
+
"force"
|
|
141
|
+
];
|
|
142
|
+
var SHARED_COMMAND_OPTION_ALIASES = {
|
|
143
|
+
"close-reason": "closeReason",
|
|
144
|
+
close_reason: "closeReason",
|
|
145
|
+
"estimated-minutes": "estimatedMinutes",
|
|
146
|
+
estimated_minutes: "estimatedMinutes",
|
|
147
|
+
estimate: "estimatedMinutes",
|
|
148
|
+
"acceptance-criteria": "acceptanceCriteria",
|
|
149
|
+
acceptance_criteria: "acceptanceCriteria",
|
|
150
|
+
ac: "acceptanceCriteria",
|
|
151
|
+
"definition-of-ready": "definitionOfReady",
|
|
152
|
+
definition_of_ready: "definitionOfReady",
|
|
153
|
+
rank: "order",
|
|
154
|
+
"why-now": "whyNow",
|
|
155
|
+
why_now: "whyNow",
|
|
156
|
+
"blocked-by": "blockedBy",
|
|
157
|
+
blocked_by: "blockedBy",
|
|
158
|
+
"blocked-reason": "blockedReason",
|
|
159
|
+
blocked_reason: "blockedReason",
|
|
160
|
+
"unblock-note": "unblockNote",
|
|
161
|
+
unblock_note: "unblockNote",
|
|
162
|
+
"repro-steps": "reproSteps",
|
|
163
|
+
repro_steps: "reproSteps",
|
|
164
|
+
"expected-result": "expectedResult",
|
|
165
|
+
expected_result: "expectedResult",
|
|
166
|
+
"actual-result": "actualResult",
|
|
167
|
+
actual_result: "actualResult",
|
|
168
|
+
"affected-version": "affectedVersion",
|
|
169
|
+
affected_version: "affectedVersion",
|
|
170
|
+
"fixed-version": "fixedVersion",
|
|
171
|
+
fixed_version: "fixedVersion",
|
|
172
|
+
"customer-impact": "customerImpact",
|
|
173
|
+
customer_impact: "customerImpact",
|
|
174
|
+
"type-option": "typeOption",
|
|
175
|
+
type_option: "typeOption",
|
|
176
|
+
type_options: "typeOption"
|
|
177
|
+
};
|
|
178
|
+
var CREATE_COMMAND_OPTION_ALIASES = {
|
|
179
|
+
...SHARED_COMMAND_OPTION_ALIASES
|
|
180
|
+
};
|
|
181
|
+
var UPDATE_COMMAND_OPTION_ALIASES = {
|
|
182
|
+
...SHARED_COMMAND_OPTION_ALIASES,
|
|
183
|
+
"allow-audit-update": "allowAuditUpdate",
|
|
184
|
+
allow_audit_update: "allowAuditUpdate"
|
|
185
|
+
};
|
|
186
|
+
var CREATE_COMMAND_OPTION_FLAG_LABELS = {
|
|
187
|
+
title: "--title",
|
|
188
|
+
description: "--description",
|
|
189
|
+
type: "--type",
|
|
190
|
+
status: "--status",
|
|
191
|
+
priority: "--priority",
|
|
192
|
+
tags: "--tags",
|
|
193
|
+
body: "--body",
|
|
194
|
+
deadline: "--deadline",
|
|
195
|
+
estimatedMinutes: "--estimate/--estimated-minutes",
|
|
196
|
+
acceptanceCriteria: "--acceptance-criteria/--ac",
|
|
197
|
+
definitionOfReady: "--definition-of-ready",
|
|
198
|
+
order: "--order/--rank",
|
|
199
|
+
goal: "--goal",
|
|
200
|
+
objective: "--objective",
|
|
201
|
+
value: "--value",
|
|
202
|
+
impact: "--impact",
|
|
203
|
+
outcome: "--outcome",
|
|
204
|
+
whyNow: "--why-now",
|
|
205
|
+
author: "--author",
|
|
206
|
+
message: "--message",
|
|
207
|
+
assignee: "--assignee",
|
|
208
|
+
parent: "--parent",
|
|
209
|
+
reviewer: "--reviewer",
|
|
210
|
+
risk: "--risk",
|
|
211
|
+
confidence: "--confidence",
|
|
212
|
+
sprint: "--sprint",
|
|
213
|
+
release: "--release",
|
|
214
|
+
blockedBy: "--blocked-by",
|
|
215
|
+
blockedReason: "--blocked-reason",
|
|
216
|
+
unblockNote: "--unblock-note",
|
|
217
|
+
reporter: "--reporter",
|
|
218
|
+
severity: "--severity",
|
|
219
|
+
environment: "--environment",
|
|
220
|
+
reproSteps: "--repro-steps",
|
|
221
|
+
resolution: "--resolution",
|
|
222
|
+
expectedResult: "--expected-result",
|
|
223
|
+
actualResult: "--actual-result",
|
|
224
|
+
affectedVersion: "--affected-version",
|
|
225
|
+
fixedVersion: "--fixed-version",
|
|
226
|
+
component: "--component",
|
|
227
|
+
regression: "--regression",
|
|
228
|
+
customerImpact: "--customer-impact",
|
|
229
|
+
dep: "--dep",
|
|
230
|
+
comment: "--comment",
|
|
231
|
+
note: "--note",
|
|
232
|
+
learning: "--learning",
|
|
233
|
+
file: "--file",
|
|
234
|
+
test: "--test",
|
|
235
|
+
doc: "--doc",
|
|
236
|
+
reminder: "--reminder",
|
|
237
|
+
event: "--event",
|
|
238
|
+
typeOption: "--type-option"
|
|
239
|
+
};
|
|
240
|
+
var UPDATE_COMMAND_OPTION_FLAG_LABELS = {
|
|
241
|
+
title: "--title",
|
|
242
|
+
description: "--description",
|
|
243
|
+
body: "--body",
|
|
244
|
+
status: "--status",
|
|
245
|
+
closeReason: "--close-reason",
|
|
246
|
+
priority: "--priority",
|
|
247
|
+
type: "--type",
|
|
248
|
+
tags: "--tags",
|
|
249
|
+
deadline: "--deadline",
|
|
250
|
+
estimatedMinutes: "--estimate/--estimated-minutes",
|
|
251
|
+
acceptanceCriteria: "--acceptance-criteria/--ac",
|
|
252
|
+
definitionOfReady: "--definition-of-ready",
|
|
253
|
+
order: "--order/--rank",
|
|
254
|
+
goal: "--goal",
|
|
255
|
+
objective: "--objective",
|
|
256
|
+
value: "--value",
|
|
257
|
+
impact: "--impact",
|
|
258
|
+
outcome: "--outcome",
|
|
259
|
+
whyNow: "--why-now",
|
|
260
|
+
assignee: "--assignee",
|
|
261
|
+
parent: "--parent",
|
|
262
|
+
reviewer: "--reviewer",
|
|
263
|
+
risk: "--risk",
|
|
264
|
+
confidence: "--confidence",
|
|
265
|
+
sprint: "--sprint",
|
|
266
|
+
release: "--release",
|
|
267
|
+
blockedBy: "--blocked-by",
|
|
268
|
+
blockedReason: "--blocked-reason",
|
|
269
|
+
unblockNote: "--unblock-note",
|
|
270
|
+
reporter: "--reporter",
|
|
271
|
+
severity: "--severity",
|
|
272
|
+
environment: "--environment",
|
|
273
|
+
reproSteps: "--repro-steps",
|
|
274
|
+
resolution: "--resolution",
|
|
275
|
+
expectedResult: "--expected-result",
|
|
276
|
+
actualResult: "--actual-result",
|
|
277
|
+
affectedVersion: "--affected-version",
|
|
278
|
+
fixedVersion: "--fixed-version",
|
|
279
|
+
component: "--component",
|
|
280
|
+
regression: "--regression",
|
|
281
|
+
customerImpact: "--customer-impact",
|
|
282
|
+
comment: "--comment",
|
|
283
|
+
note: "--note",
|
|
284
|
+
learning: "--learning",
|
|
285
|
+
file: "--file",
|
|
286
|
+
test: "--test",
|
|
287
|
+
doc: "--doc",
|
|
288
|
+
reminder: "--reminder",
|
|
289
|
+
event: "--event",
|
|
290
|
+
typeOption: "--type-option",
|
|
291
|
+
allowAuditUpdate: "--allow-audit-update",
|
|
292
|
+
author: "--author",
|
|
293
|
+
message: "--message",
|
|
294
|
+
force: "--force"
|
|
295
|
+
};
|
|
296
|
+
function normalizeCommandOptionToken(value) {
|
|
297
|
+
return value.trim().replace(/^--+/, "").toLowerCase();
|
|
298
|
+
}
|
|
299
|
+
function commandOptionKeys(command) {
|
|
300
|
+
return command === "create" ? CREATE_COMMAND_OPTION_KEYS : UPDATE_COMMAND_OPTION_KEYS;
|
|
301
|
+
}
|
|
302
|
+
function commandOptionAliases(command) {
|
|
303
|
+
return command === "create" ? CREATE_COMMAND_OPTION_ALIASES : UPDATE_COMMAND_OPTION_ALIASES;
|
|
304
|
+
}
|
|
305
|
+
function canonicalizeCommandOptionKey(command, rawOption) {
|
|
306
|
+
const normalizedToken = normalizeCommandOptionToken(rawOption);
|
|
307
|
+
if (normalizedToken.length === 0) {
|
|
308
|
+
return void 0;
|
|
309
|
+
}
|
|
310
|
+
const aliased = commandOptionAliases(command)[normalizedToken];
|
|
311
|
+
if (aliased) {
|
|
312
|
+
return aliased;
|
|
313
|
+
}
|
|
314
|
+
return commandOptionKeys(command).find((candidate) => candidate.toLowerCase() === normalizedToken);
|
|
315
|
+
}
|
|
316
|
+
function commandOptionFlagLabel(command, optionKey) {
|
|
317
|
+
const labels = command === "create" ? CREATE_COMMAND_OPTION_FLAG_LABELS : UPDATE_COMMAND_OPTION_FLAG_LABELS;
|
|
318
|
+
return labels[optionKey] ?? `--${optionKey.replace(/([A-Z])/g, "-$1").toLowerCase()}`;
|
|
319
|
+
}
|
|
320
|
+
function toDefaultFolder(name) {
|
|
321
|
+
const normalized = name.trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
322
|
+
if (normalized.length === 0) {
|
|
323
|
+
return "items";
|
|
324
|
+
}
|
|
325
|
+
return normalized.endsWith("s") ? normalized : `${normalized}s`;
|
|
326
|
+
}
|
|
327
|
+
function normalizeTypeDefinition(definition) {
|
|
328
|
+
return normalizeItemTypeDefinition(definition, { resolvePolicyCommand: strictPolicyCommand });
|
|
329
|
+
}
|
|
330
|
+
function coerceTypeDefinitionFromUnknown(raw) {
|
|
331
|
+
if (typeof raw !== "object" || raw === null || Array.isArray(raw)) {
|
|
332
|
+
return null;
|
|
333
|
+
}
|
|
334
|
+
const record = raw;
|
|
335
|
+
const name = typeof record.name === "string" ? record.name : "";
|
|
336
|
+
if (name.trim().length === 0) {
|
|
337
|
+
return null;
|
|
338
|
+
}
|
|
339
|
+
const folder = typeof record.folder === "string" ? record.folder : void 0;
|
|
340
|
+
const description = typeof record.description === "string" ? record.description : void 0;
|
|
341
|
+
const defaultStatus = typeof record.default_status === "string" ? record.default_status : void 0;
|
|
342
|
+
const aliases = Array.isArray(record.aliases) ? record.aliases.filter((value) => typeof value === "string") : void 0;
|
|
343
|
+
const requiredCreateFields = Array.isArray(record.required_create_fields) ? record.required_create_fields.filter((value) => typeof value === "string") : void 0;
|
|
344
|
+
const requiredCreateRepeatables = Array.isArray(record.required_create_repeatables) ? record.required_create_repeatables.filter((value) => typeof value === "string") : void 0;
|
|
345
|
+
let options;
|
|
346
|
+
if (Array.isArray(record.options)) {
|
|
347
|
+
options = [];
|
|
348
|
+
for (const entry of record.options) {
|
|
349
|
+
if (typeof entry !== "object" || entry === null || Array.isArray(entry)) {
|
|
350
|
+
continue;
|
|
351
|
+
}
|
|
352
|
+
const optionRecord = entry;
|
|
353
|
+
if (typeof optionRecord.key !== "string") {
|
|
354
|
+
continue;
|
|
355
|
+
}
|
|
356
|
+
options.push({
|
|
357
|
+
key: optionRecord.key,
|
|
358
|
+
values: Array.isArray(optionRecord.values) ? optionRecord.values.filter((value) => typeof value === "string") : [],
|
|
359
|
+
required: optionRecord.required === void 0 ? void 0 : Boolean(optionRecord.required),
|
|
360
|
+
aliases: Array.isArray(optionRecord.aliases) ? optionRecord.aliases.filter((value) => typeof value === "string") : void 0,
|
|
361
|
+
description: typeof optionRecord.description === "string" ? optionRecord.description : void 0
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
let commandOptionPolicies;
|
|
366
|
+
if (Array.isArray(record.command_option_policies)) {
|
|
367
|
+
commandOptionPolicies = [];
|
|
368
|
+
for (const entry of record.command_option_policies) {
|
|
369
|
+
if (typeof entry !== "object" || entry === null || Array.isArray(entry)) {
|
|
370
|
+
continue;
|
|
371
|
+
}
|
|
372
|
+
const policyRecord = entry;
|
|
373
|
+
if (typeof policyRecord.command !== "string" || typeof policyRecord.option !== "string") {
|
|
374
|
+
continue;
|
|
375
|
+
}
|
|
376
|
+
const normalizedCommand = policyRecord.command.trim().toLowerCase();
|
|
377
|
+
if (normalizedCommand !== "create" && normalizedCommand !== "update") {
|
|
378
|
+
continue;
|
|
379
|
+
}
|
|
380
|
+
commandOptionPolicies.push({
|
|
381
|
+
command: normalizedCommand,
|
|
382
|
+
option: policyRecord.option,
|
|
383
|
+
required: policyRecord.required === void 0 ? void 0 : Boolean(policyRecord.required),
|
|
384
|
+
visible: policyRecord.visible === void 0 ? void 0 : Boolean(policyRecord.visible),
|
|
385
|
+
enabled: policyRecord.enabled === void 0 ? void 0 : Boolean(policyRecord.enabled)
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
return {
|
|
390
|
+
name,
|
|
391
|
+
description,
|
|
392
|
+
default_status: defaultStatus,
|
|
393
|
+
folder,
|
|
394
|
+
aliases,
|
|
395
|
+
required_create_fields: requiredCreateFields,
|
|
396
|
+
required_create_repeatables: requiredCreateRepeatables,
|
|
397
|
+
options,
|
|
398
|
+
command_option_policies: commandOptionPolicies
|
|
399
|
+
};
|
|
400
|
+
}
|
|
401
|
+
function applyTypeDefinitions(source, target, preserveBuiltinDefaults) {
|
|
402
|
+
for (const rawDefinition of source) {
|
|
403
|
+
const normalizedDefinition = normalizeTypeDefinition(rawDefinition);
|
|
404
|
+
if (!normalizedDefinition) {
|
|
405
|
+
continue;
|
|
406
|
+
}
|
|
407
|
+
const lowerName = normalizedDefinition.name.toLowerCase();
|
|
408
|
+
const existing = target.get(lowerName);
|
|
409
|
+
const keepName = existing?.name ?? normalizedDefinition.name;
|
|
410
|
+
const folder = normalizedDefinition.folder ?? existing?.folder ?? toDefaultFolder(keepName);
|
|
411
|
+
const aliases = normalizeItemTypeStringList([
|
|
412
|
+
...existing?.aliases ?? [],
|
|
413
|
+
...normalizedDefinition.aliases ?? []
|
|
414
|
+
]);
|
|
415
|
+
const requiredCreateFields = normalizedDefinition.required_create_fields ? normalizeItemTypeStringList(normalizedDefinition.required_create_fields) : existing?.required_create_fields ?? (preserveBuiltinDefaults ? [...DEFAULT_REQUIRED_CREATE_FIELDS] : []);
|
|
416
|
+
const requiredCreateRepeatables = normalizedDefinition.required_create_repeatables ? normalizeItemTypeStringList(normalizedDefinition.required_create_repeatables) : existing?.required_create_repeatables ?? (preserveBuiltinDefaults ? [...DEFAULT_REQUIRED_CREATE_REPEATABLES] : []);
|
|
417
|
+
const options = normalizedDefinition.options ? normalizedDefinition.options : existing?.options ? [...existing.options] : [];
|
|
418
|
+
const commandOptionPolicies = normalizedDefinition.command_option_policies ? normalizedDefinition.command_option_policies : existing?.command_option_policies ? [...existing.command_option_policies] : [];
|
|
419
|
+
const defaultStatus = normalizedDefinition.default_status ?? existing?.default_status;
|
|
420
|
+
const description = normalizedDefinition.description ?? existing?.description;
|
|
421
|
+
target.set(lowerName, {
|
|
422
|
+
name: keepName,
|
|
423
|
+
...description ? { description } : {},
|
|
424
|
+
...defaultStatus ? { default_status: defaultStatus } : {},
|
|
425
|
+
folder,
|
|
426
|
+
aliases,
|
|
427
|
+
required_create_fields: requiredCreateFields,
|
|
428
|
+
required_create_repeatables: requiredCreateRepeatables,
|
|
429
|
+
options,
|
|
430
|
+
command_option_policies: commandOptionPolicies
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
function collectExtensionTypeDefinitions(registrations) {
|
|
435
|
+
if (!registrations) {
|
|
436
|
+
return [];
|
|
437
|
+
}
|
|
438
|
+
const definitions = [];
|
|
439
|
+
for (const registration of registrations.item_types ?? []) {
|
|
440
|
+
const typeDefinitionsRaw = registration.types;
|
|
441
|
+
if (!Array.isArray(typeDefinitionsRaw)) {
|
|
442
|
+
continue;
|
|
443
|
+
}
|
|
444
|
+
for (const rawDefinition of typeDefinitionsRaw) {
|
|
445
|
+
const normalized = coerceTypeDefinitionFromUnknown(rawDefinition);
|
|
446
|
+
if (normalized) {
|
|
447
|
+
definitions.push(normalized);
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
return definitions;
|
|
452
|
+
}
|
|
453
|
+
function resolveItemTypeRegistry(settings, extensionRegistrations = null) {
|
|
454
|
+
const byLowerName = /* @__PURE__ */ new Map();
|
|
455
|
+
for (const builtin of ITEM_TYPE_VALUES) {
|
|
456
|
+
byLowerName.set(builtin.toLowerCase(), {
|
|
457
|
+
name: builtin,
|
|
458
|
+
folder: TYPE_TO_FOLDER[builtin],
|
|
459
|
+
aliases: [],
|
|
460
|
+
required_create_fields: [...DEFAULT_REQUIRED_CREATE_FIELDS],
|
|
461
|
+
required_create_repeatables: [...DEFAULT_REQUIRED_CREATE_REPEATABLES],
|
|
462
|
+
options: [],
|
|
463
|
+
command_option_policies: []
|
|
464
|
+
});
|
|
465
|
+
}
|
|
466
|
+
applyTypeDefinitions(settings.item_types?.definitions ?? [], byLowerName, false);
|
|
467
|
+
applyTypeDefinitions(collectExtensionTypeDefinitions(extensionRegistrations), byLowerName, false);
|
|
468
|
+
const definitions = [...byLowerName.values()].sort((left, right) => left.name.localeCompare(right.name));
|
|
469
|
+
const byType = {};
|
|
470
|
+
const aliasToType = {};
|
|
471
|
+
const typeToFolder = {};
|
|
472
|
+
for (const definition of definitions) {
|
|
473
|
+
byType[definition.name] = definition;
|
|
474
|
+
typeToFolder[definition.name] = definition.folder;
|
|
475
|
+
aliasToType[definition.name.toLowerCase()] = definition.name;
|
|
476
|
+
for (const alias of definition.aliases) {
|
|
477
|
+
aliasToType[alias.toLowerCase()] = definition.name;
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
const folders = [...new Set(definitions.map((definition) => definition.folder))].sort((left, right) => left.localeCompare(right));
|
|
481
|
+
return {
|
|
482
|
+
types: definitions.map((definition) => definition.name),
|
|
483
|
+
folders,
|
|
484
|
+
type_to_folder: typeToFolder,
|
|
485
|
+
by_type: byType,
|
|
486
|
+
alias_to_type: aliasToType
|
|
487
|
+
};
|
|
488
|
+
}
|
|
489
|
+
function resolveTypeName(rawType, registry) {
|
|
490
|
+
if (rawType === void 0) {
|
|
491
|
+
return void 0;
|
|
492
|
+
}
|
|
493
|
+
return registry.alias_to_type[rawType.trim().toLowerCase()];
|
|
494
|
+
}
|
|
495
|
+
function resolveTypeDefinition(typeName, registry) {
|
|
496
|
+
const resolvedName = resolveTypeName(typeName, registry);
|
|
497
|
+
if (!resolvedName) {
|
|
498
|
+
return void 0;
|
|
499
|
+
}
|
|
500
|
+
return registry.by_type[resolvedName];
|
|
501
|
+
}
|
|
502
|
+
function resolveCommandOptionPolicyState(typeDefinition, command, baseRequiredOptions) {
|
|
503
|
+
const errors = [];
|
|
504
|
+
const required = /* @__PURE__ */ new Set();
|
|
505
|
+
const hidden = /* @__PURE__ */ new Set();
|
|
506
|
+
const disabled = /* @__PURE__ */ new Set();
|
|
507
|
+
for (const rawBase of baseRequiredOptions) {
|
|
508
|
+
const canonical = canonicalizeCommandOptionKey(command, rawBase);
|
|
509
|
+
if (!canonical) {
|
|
510
|
+
errors.push(`Unsupported base required option "${rawBase}" for command "${command}" on type "${typeDefinition.name}"`);
|
|
511
|
+
continue;
|
|
512
|
+
}
|
|
513
|
+
required.add(canonical);
|
|
514
|
+
}
|
|
515
|
+
for (const policy of typeDefinition.command_option_policies) {
|
|
516
|
+
if (policy.command !== command) {
|
|
517
|
+
continue;
|
|
518
|
+
}
|
|
519
|
+
const canonical = canonicalizeCommandOptionKey(command, policy.option);
|
|
520
|
+
if (!canonical) {
|
|
521
|
+
errors.push(`Unsupported command_option_policies option "${policy.option}" for command "${command}" on type "${typeDefinition.name}"`);
|
|
522
|
+
continue;
|
|
523
|
+
}
|
|
524
|
+
if (policy.required !== void 0) {
|
|
525
|
+
if (policy.required) {
|
|
526
|
+
required.add(canonical);
|
|
527
|
+
} else {
|
|
528
|
+
required.delete(canonical);
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
if (policy.visible !== void 0) {
|
|
532
|
+
if (policy.visible) {
|
|
533
|
+
hidden.delete(canonical);
|
|
534
|
+
} else {
|
|
535
|
+
hidden.add(canonical);
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
if (policy.enabled !== void 0) {
|
|
539
|
+
if (policy.enabled) {
|
|
540
|
+
disabled.delete(canonical);
|
|
541
|
+
} else {
|
|
542
|
+
disabled.add(canonical);
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
for (const option of required) {
|
|
547
|
+
if (disabled.has(option)) {
|
|
548
|
+
errors.push(`Option "${option}" cannot be both required and disabled for command "${command}" on type "${typeDefinition.name}"`);
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
return {
|
|
552
|
+
required: [...required],
|
|
553
|
+
hidden: [...hidden].sort((left, right) => left.localeCompare(right)),
|
|
554
|
+
disabled: [...disabled].sort((left, right) => left.localeCompare(right)),
|
|
555
|
+
errors
|
|
556
|
+
};
|
|
557
|
+
}
|
|
558
|
+
function validateTypeOptions(typeName, rawTypeOptions, registry) {
|
|
559
|
+
const typeDefinition = resolveTypeDefinition(typeName, registry);
|
|
560
|
+
if (!typeDefinition) {
|
|
561
|
+
return {
|
|
562
|
+
normalized: void 0,
|
|
563
|
+
errors: [`Unknown type "${typeName}"`]
|
|
564
|
+
};
|
|
565
|
+
}
|
|
566
|
+
const errors = [];
|
|
567
|
+
const optionByAlias = /* @__PURE__ */ new Map();
|
|
568
|
+
for (const option of typeDefinition.options) {
|
|
569
|
+
optionByAlias.set(option.key.toLowerCase(), option);
|
|
570
|
+
for (const alias of option.aliases ?? []) {
|
|
571
|
+
optionByAlias.set(alias.toLowerCase(), option);
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
const normalized = {};
|
|
575
|
+
for (const [rawKey, rawValue] of Object.entries(rawTypeOptions ?? {})) {
|
|
576
|
+
const trimmedKey = rawKey.trim();
|
|
577
|
+
const trimmedValue = rawValue.trim();
|
|
578
|
+
if (trimmedKey.length === 0) {
|
|
579
|
+
errors.push("type option keys must not be empty");
|
|
580
|
+
continue;
|
|
581
|
+
}
|
|
582
|
+
if (trimmedValue.length === 0) {
|
|
583
|
+
errors.push(`type option "${trimmedKey}" must not be empty`);
|
|
584
|
+
continue;
|
|
585
|
+
}
|
|
586
|
+
const optionDefinition = optionByAlias.get(trimmedKey.toLowerCase());
|
|
587
|
+
if (!optionDefinition) {
|
|
588
|
+
const allowed = typeDefinition.options.map((option) => option.key).join(", ");
|
|
589
|
+
errors.push(typeDefinition.options.length > 0 ? `Unknown type option "${trimmedKey}" for type "${typeDefinition.name}". Allowed: ${allowed}` : `Type "${typeDefinition.name}" does not define any configurable type options`);
|
|
590
|
+
continue;
|
|
591
|
+
}
|
|
592
|
+
const allowedValues = optionDefinition.values;
|
|
593
|
+
let resolvedValue = trimmedValue;
|
|
594
|
+
if (allowedValues.length > 0) {
|
|
595
|
+
const valueLookup = new Map(allowedValues.map((value) => [value.toLowerCase(), value]));
|
|
596
|
+
const canonical = valueLookup.get(trimmedValue.toLowerCase());
|
|
597
|
+
if (!canonical) {
|
|
598
|
+
errors.push(`Invalid value "${trimmedValue}" for type option "${optionDefinition.key}". Allowed: ${allowedValues.join(", ")}`);
|
|
599
|
+
continue;
|
|
600
|
+
}
|
|
601
|
+
resolvedValue = canonical;
|
|
602
|
+
}
|
|
603
|
+
normalized[optionDefinition.key] = resolvedValue;
|
|
604
|
+
}
|
|
605
|
+
for (const option of typeDefinition.options) {
|
|
606
|
+
if (option.required && !(option.key in normalized)) {
|
|
607
|
+
errors.push(`Missing required type option "${option.key}" for type "${typeDefinition.name}"`);
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
const sortedKeys = Object.keys(normalized).sort((left, right) => left.localeCompare(right));
|
|
611
|
+
if (sortedKeys.length === 0) {
|
|
612
|
+
return {
|
|
613
|
+
normalized: void 0,
|
|
614
|
+
errors
|
|
615
|
+
};
|
|
616
|
+
}
|
|
617
|
+
return {
|
|
618
|
+
normalized: Object.fromEntries(sortedKeys.map((key) => [key, normalized[key]])),
|
|
619
|
+
errors
|
|
620
|
+
};
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
export {
|
|
624
|
+
canonicalizeCommandOptionKey,
|
|
625
|
+
commandOptionFlagLabel,
|
|
626
|
+
resolveItemTypeRegistry,
|
|
627
|
+
resolveTypeName,
|
|
628
|
+
resolveTypeDefinition,
|
|
629
|
+
resolveCommandOptionPolicyState,
|
|
630
|
+
validateTypeOptions
|
|
631
|
+
};
|
|
632
|
+
//# sourceMappingURL=chunk-WDPXDQFG.js.map
|