@unbrained/pm-cli 2026.5.28 → 2026.5.30

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.
Files changed (160) hide show
  1. package/CHANGELOG.md +127 -93
  2. package/dist/cli/bootstrap-args.d.ts +1 -1
  3. package/dist/cli/bootstrap-args.js +59 -9
  4. package/dist/cli/bootstrap-args.js.map +1 -1
  5. package/dist/cli/commander-usage.js +8 -8
  6. package/dist/cli/commander-usage.js.map +1 -1
  7. package/dist/cli/commands/activity.js +4 -4
  8. package/dist/cli/commands/activity.js.map +1 -1
  9. package/dist/cli/commands/aggregate.js +4 -3
  10. package/dist/cli/commands/aggregate.js.map +1 -1
  11. package/dist/cli/commands/calendar.d.ts +8 -0
  12. package/dist/cli/commands/calendar.js +15 -4
  13. package/dist/cli/commands/calendar.js.map +1 -1
  14. package/dist/cli/commands/close.js +4 -4
  15. package/dist/cli/commands/close.js.map +1 -1
  16. package/dist/cli/commands/completion.js +36 -4
  17. package/dist/cli/commands/completion.js.map +1 -1
  18. package/dist/cli/commands/config.d.ts +11 -1
  19. package/dist/cli/commands/config.js +68 -6
  20. package/dist/cli/commands/config.js.map +1 -1
  21. package/dist/cli/commands/create.d.ts +1 -0
  22. package/dist/cli/commands/create.js +55 -6
  23. package/dist/cli/commands/create.js.map +1 -1
  24. package/dist/cli/commands/deps.js +4 -4
  25. package/dist/cli/commands/deps.js.map +1 -1
  26. package/dist/cli/commands/extension/bundled-catalog.js +4 -3
  27. package/dist/cli/commands/extension/bundled-catalog.js.map +1 -1
  28. package/dist/cli/commands/extension/install-sources.d.ts +1 -0
  29. package/dist/cli/commands/extension/install-sources.js +20 -2
  30. package/dist/cli/commands/extension/install-sources.js.map +1 -1
  31. package/dist/cli/commands/extension.js +26 -5
  32. package/dist/cli/commands/extension.js.map +1 -1
  33. package/dist/cli/commands/get.js +6 -3
  34. package/dist/cli/commands/get.js.map +1 -1
  35. package/dist/cli/commands/health.js +3 -11
  36. package/dist/cli/commands/health.js.map +1 -1
  37. package/dist/cli/commands/linked-test-parsers.js +5 -4
  38. package/dist/cli/commands/linked-test-parsers.js.map +1 -1
  39. package/dist/cli/commands/list.js +25 -6
  40. package/dist/cli/commands/list.js.map +1 -1
  41. package/dist/cli/commands/plan.js +5 -4
  42. package/dist/cli/commands/plan.js.map +1 -1
  43. package/dist/cli/commands/search.js +45 -2
  44. package/dist/cli/commands/search.js.map +1 -1
  45. package/dist/cli/commands/stats.js +4 -4
  46. package/dist/cli/commands/stats.js.map +1 -1
  47. package/dist/cli/commands/test-all.js +4 -4
  48. package/dist/cli/commands/test-all.js.map +1 -1
  49. package/dist/cli/commands/update-many.js +35 -6
  50. package/dist/cli/commands/update-many.js.map +1 -1
  51. package/dist/cli/commands/update.d.ts +2 -0
  52. package/dist/cli/commands/update.js +38 -6
  53. package/dist/cli/commands/update.js.map +1 -1
  54. package/dist/cli/help-json-payload.d.ts +1 -11
  55. package/dist/cli/help-json-payload.js +12 -12
  56. package/dist/cli/help-json-payload.js.map +1 -1
  57. package/dist/cli/main.d.ts +2 -0
  58. package/dist/cli/main.js +39 -11
  59. package/dist/cli/main.js.map +1 -1
  60. package/dist/cli/register-list-query.js +3 -3
  61. package/dist/cli/register-list-query.js.map +1 -1
  62. package/dist/cli/register-mutation.js +20 -8
  63. package/dist/cli/register-mutation.js.map +1 -1
  64. package/dist/cli/register-setup.js +4 -2
  65. package/dist/cli/register-setup.js.map +1 -1
  66. package/dist/cli/registration-helpers.d.ts +2 -6
  67. package/dist/cli/registration-helpers.js +9 -6
  68. package/dist/cli/registration-helpers.js.map +1 -1
  69. package/dist/cli-bundle/chunks/chunk-PB2YU2E3.js +164 -0
  70. package/dist/cli-bundle/chunks/chunk-PB2YU2E3.js.map +7 -0
  71. package/dist/cli-bundle/chunks/chunk-RJONRNXN.js +682 -0
  72. package/dist/cli-bundle/chunks/chunk-RJONRNXN.js.map +7 -0
  73. package/dist/cli-bundle/chunks/chunk-SW5BMMCU.js +13864 -0
  74. package/dist/cli-bundle/chunks/chunk-SW5BMMCU.js.map +7 -0
  75. package/dist/cli-bundle/chunks/commands-XJ4TJ5UN.js +24225 -0
  76. package/dist/cli-bundle/chunks/commands-XJ4TJ5UN.js.map +7 -0
  77. package/dist/cli-bundle/chunks/register-list-query-EIVQ5FMR.js +223 -0
  78. package/dist/cli-bundle/chunks/register-list-query-EIVQ5FMR.js.map +7 -0
  79. package/dist/cli-bundle/chunks/register-mutation-RSZNPSGI.js +702 -0
  80. package/dist/cli-bundle/chunks/register-mutation-RSZNPSGI.js.map +7 -0
  81. package/dist/cli-bundle/chunks/register-operations-APUSYDMR.js +355 -0
  82. package/dist/cli-bundle/chunks/register-operations-APUSYDMR.js.map +7 -0
  83. package/dist/cli-bundle/chunks/register-setup-OZOKSMPJ.js +237 -0
  84. package/dist/cli-bundle/chunks/register-setup-OZOKSMPJ.js.map +7 -0
  85. package/dist/cli-bundle/main.js +6896 -0
  86. package/dist/cli-bundle/main.js.map +7 -0
  87. package/dist/cli.js +1 -1
  88. package/dist/core/config/nested-settings.d.ts +88 -0
  89. package/dist/core/config/nested-settings.js +273 -0
  90. package/dist/core/config/nested-settings.js.map +1 -0
  91. package/dist/core/item/parse.d.ts +19 -0
  92. package/dist/core/item/parse.js +76 -2
  93. package/dist/core/item/parse.js.map +1 -1
  94. package/dist/core/item/priority.d.ts +2 -1
  95. package/dist/core/item/priority.js +12 -2
  96. package/dist/core/item/priority.js.map +1 -1
  97. package/dist/core/item/type-synonyms.d.ts +20 -0
  98. package/dist/core/item/type-synonyms.js +42 -0
  99. package/dist/core/item/type-synonyms.js.map +1 -0
  100. package/dist/core/search/cache.js +46 -4
  101. package/dist/core/search/cache.js.map +1 -1
  102. package/dist/core/search/providers.js +25 -5
  103. package/dist/core/search/providers.js.map +1 -1
  104. package/dist/core/search/semantic-defaults.js +73 -32
  105. package/dist/core/search/semantic-defaults.js.map +1 -1
  106. package/dist/core/search/staleness.d.ts +23 -0
  107. package/dist/core/search/staleness.js +34 -0
  108. package/dist/core/search/staleness.js.map +1 -0
  109. package/dist/core/search/vector-stores.js +12 -3
  110. package/dist/core/search/vector-stores.js.map +1 -1
  111. package/dist/core/sentry/helpers.d.ts +1 -1
  112. package/dist/core/sentry/helpers.js +4 -4
  113. package/dist/core/sentry/helpers.js.map +1 -1
  114. package/dist/core/shared/constants.js +3 -2
  115. package/dist/core/shared/constants.js.map +1 -1
  116. package/dist/core/shared/html-entity-decode.d.ts +22 -0
  117. package/dist/core/shared/html-entity-decode.js +127 -0
  118. package/dist/core/shared/html-entity-decode.js.map +1 -0
  119. package/dist/core/shared/split-comma-list.d.ts +20 -0
  120. package/dist/core/shared/split-comma-list.js +29 -0
  121. package/dist/core/shared/split-comma-list.js.map +1 -0
  122. package/dist/core/shared/time.js +52 -2
  123. package/dist/core/shared/time.js.map +1 -1
  124. package/dist/core/store/front-matter-cache.d.ts +24 -0
  125. package/dist/core/store/front-matter-cache.js +119 -8
  126. package/dist/core/store/front-matter-cache.js.map +1 -1
  127. package/dist/core/store/item-store.d.ts +7 -0
  128. package/dist/core/store/item-store.js +13 -3
  129. package/dist/core/store/item-store.js.map +1 -1
  130. package/dist/core/store/settings-validator.d.ts +1 -0
  131. package/dist/core/store/settings-validator.js +3 -2
  132. package/dist/core/store/settings-validator.js.map +1 -1
  133. package/dist/core/store/settings.js +19 -3
  134. package/dist/core/store/settings.js.map +1 -1
  135. package/dist/mcp/server.js +11 -4
  136. package/dist/mcp/server.js.map +1 -1
  137. package/dist/sdk/cli-contracts/commander-mutation-options.js +47 -11
  138. package/dist/sdk/cli-contracts/commander-mutation-options.js.map +1 -1
  139. package/dist/sdk/cli-contracts/tool-option-contracts.js +5 -2
  140. package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -1
  141. package/dist/sdk/cli-contracts/tool-parameter-tables.js +12 -2
  142. package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
  143. package/dist/sdk/cli-contracts.js +28 -7
  144. package/dist/sdk/cli-contracts.js.map +1 -1
  145. package/dist/sdk/runtime.d.ts +1 -1
  146. package/dist/sdk/runtime.js +3 -3
  147. package/dist/sdk/runtime.js.map +1 -1
  148. package/dist/types.d.ts +2 -0
  149. package/dist/types.js +2 -2
  150. package/dist/types.js.map +1 -1
  151. package/docs/AGENT_GUIDE.md +7 -0
  152. package/docs/COMMANDS.md +17 -0
  153. package/docs/CONFIGURATION.md +66 -0
  154. package/docs/QUICKSTART.md +3 -0
  155. package/package.json +7 -4
  156. package/packages/pm-calendar/extensions/calendar/index.js +27 -2
  157. package/packages/pm-calendar/extensions/calendar/index.ts +28 -2
  158. package/packages/pm-calendar/extensions/calendar/runtime.js +5 -0
  159. package/packages/pm-calendar/extensions/calendar/runtime.ts +6 -0
  160. package/scripts/bundle-cli.mjs +39 -0
@@ -1,5 +1,5 @@
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]="9dfba929-1fc6-569e-8311-91fc06f420bc")}catch(e){}}();
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]="a8653cb8-6b5a-5e26-bf29-f20efd02a25b")}catch(e){}}();
3
3
  import { activateExtensions, loadExtensions, } from "../core/extensions/index.js";
4
4
  import { resolveItemTypeRegistry } from "../core/item/type-registry.js";
5
5
  import { resolveRuntimeStatusRegistry } from "../core/schema/runtime-schema.js";
@@ -23,7 +23,7 @@ export { isTimestampLiteral, nowIso } from "../core/shared/time.js";
23
23
  export { listAllFrontMatter, locateItem, readLocatedItem } from "../core/store/item-store.js";
24
24
  export { getHistoryPath, getItemPath, getSettingsPath, resolvePmRoot } from "../core/store/paths.js";
25
25
  export { readSettings } from "../core/store/settings.js";
26
- export { renderCalendarMarkdown, resolveCalendarOutputFormat, runCalendar, } from "../cli/commands/calendar.js";
26
+ export { renderCalendarMarkdown, renderCalendarToon, resolveCalendarOutputFormat, runCalendar, } from "../cli/commands/calendar.js";
27
27
  export { renderGuideMarkdown, resolveGuideOutputFormat, runGuide, } from "../cli/commands/guide.js";
28
28
  export { runCompletion } from "../cli/commands/completion.js";
29
29
  export { runCommentsAudit, } from "../cli/commands/comments-audit.js";
@@ -73,4 +73,4 @@ async function loadWorkspaceExtensionRegistrations(pmRoot, settings, cwd) {
73
73
  return activationResult.registrations;
74
74
  }
75
75
  //# sourceMappingURL=runtime.js.map
76
- //# debugId=9dfba929-1fc6-569e-8311-91fc06f420bc
76
+ //# debugId=a8653cb8-6b5a-5e26-bf29-f20efd02a25b
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.js","sources":["sdk/runtime.ts"],"sourceRoot":"/","sourcesContent":["import {\n activateExtensions,\n loadExtensions,\n type ExtensionRegistrationRegistry,\n} from \"../core/extensions/index.js\";\nimport type { GlobalOptions } from \"../core/shared/command-types.js\";\nimport { resolveItemTypeRegistry } from \"../core/item/type-registry.js\";\nimport { resolveRuntimeStatusRegistry } from \"../core/schema/runtime-schema.js\";\nimport { readSettings } from \"../core/store/settings.js\";\nimport {\n runContracts,\n type ContractsCommandOptions,\n type ContractsResult,\n} from \"../cli/commands/contracts.js\";\n\nexport {\n getActiveExtensionRegistrations,\n runActiveOnReadHooks,\n runActiveOnWriteHooks,\n} from \"../core/extensions/index.js\";\nexport { pathExists, readFileIfExists, removeFileIfExists, writeFileAtomic } from \"../core/fs/fs-utils.js\";\nexport { appendHistoryEntry, createHistoryEntry } from \"../core/history/history.js\";\nexport { generateItemId, normalizeItemId, normalizeRawItemId } from \"../core/item/id.js\";\nexport { readBooleanOption, readCsvListOption, readStringOption } from \"./package-runtime-options.js\";\nexport {\n commitImportedItem,\n emptyImportedDocument,\n ensureTrackerInitialized,\n selectImportAuthor,\n toEstimatedMinutesValue,\n toImportPriority,\n toImportStatus,\n toImportTags,\n toNonEmptyImportString,\n type CommitImportedItemParams,\n type CommitImportedItemResult,\n} from \"./package-import-adapters.js\";\nexport {\n canonicalDocument,\n normalizeFrontMatter,\n serializeItemDocument,\n splitFrontMatter,\n} from \"../core/item/item-format.js\";\nexport { parseTags } from \"../core/item/parse.js\";\nexport { normalizeStatusInput } from \"../core/item/status.js\";\nexport { resolveItemTypeRegistry } from \"../core/item/type-registry.js\";\nexport { acquireLock } from \"../core/lock/lock.js\";\nexport { resolveRuntimeFieldRegistry, resolveRuntimeStatusRegistry } from \"../core/schema/runtime-schema.js\";\nexport { EXIT_CODE } from \"../core/shared/constants.js\";\nexport { PmCliError } from \"../core/shared/errors.js\";\nexport { isTimestampLiteral, nowIso } from \"../core/shared/time.js\";\nexport { listAllFrontMatter, locateItem, readLocatedItem } from \"../core/store/item-store.js\";\nexport { getHistoryPath, getItemPath, getSettingsPath, resolvePmRoot } from \"../core/store/paths.js\";\nexport { readSettings } from \"../core/store/settings.js\";\nexport {\n renderCalendarMarkdown,\n resolveCalendarOutputFormat,\n runCalendar,\n type CalendarOptions,\n type CalendarResult,\n} from \"../cli/commands/calendar.js\";\nexport {\n renderGuideMarkdown,\n resolveGuideOutputFormat,\n runGuide,\n type GuideDepth,\n type GuideOptions,\n type GuideOutputFormat,\n type GuideResult,\n} from \"../cli/commands/guide.js\";\nexport { runCompletion, type CompletionResult, type CompletionShell } from \"../cli/commands/completion.js\";\nexport {\n runCommentsAudit,\n type CommentsAuditEntry,\n type CommentsAuditHistoryRow,\n type CommentsAuditOptions,\n type CommentsAuditResult,\n type CommentsAuditSummary,\n type CommentsAuditTypeSummary,\n} from \"../cli/commands/comments-audit.js\";\nexport {\n runDedupeAudit,\n type DedupeAuditCandidate,\n type DedupeAuditCluster,\n type DedupeAuditOptions,\n type DedupeAuditResult,\n} from \"../cli/commands/dedupe-audit.js\";\nexport { runNormalize, type NormalizeCommandOptions, type NormalizeResult } from \"../cli/commands/normalize.js\";\nexport { runReindex, type ReindexOptions, type ReindexResult } from \"../cli/commands/reindex.js\";\nexport { runSearch, type SearchOptions, type SearchResult } from \"../cli/commands/search.js\";\nexport {\n loadCreateTemplateOptions,\n runTemplatesList,\n runTemplatesSave,\n runTemplatesShow,\n type CreateTemplateOptions,\n type TemplatesListResult,\n type TemplatesSaveResult,\n type TemplatesShowResult,\n} from \"../cli/commands/templates.js\";\nexport {\n runTestRunsList,\n runTestRunsLogs,\n runTestRunsResume,\n runTestRunsStatus,\n runTestRunsStop,\n type TestRunsListCommandOptions,\n type TestRunsLogsCommandOptions,\n type TestRunsResumeCommandOptions,\n type TestRunsStopCommandOptions,\n} from \"../cli/commands/test-runs.js\";\nexport {\n CONFIDENCE_TEXT_VALUES,\n DEPENDENCY_KIND_VALUES,\n BUILTIN_ITEM_TYPE_VALUES,\n ISSUE_SEVERITY_VALUES,\n ITEM_TYPE_VALUES,\n RISK_VALUES,\n STATUS_VALUES,\n} from \"../types/index.js\";\nexport type { GlobalOptions } from \"../core/shared/command-types.js\";\nexport type {\n Dependency,\n ItemDocument,\n ItemMetadata,\n ItemStatus,\n ItemType,\n LinkedDoc,\n LinkedFile,\n LinkedTest,\n LogNote,\n PmSettings,\n} from \"../types/index.js\";\n\nexport interface GetContractsOptions extends ContractsCommandOptions {\n pmRoot?: string;\n cwd?: string;\n noExtensions?: boolean;\n quiet?: boolean;\n profile?: boolean;\n}\n\nexport interface WorkspaceContractsOptions {\n extensionRegistrations?: ExtensionRegistrationRegistry | null;\n noExtensions?: boolean;\n cwd?: string;\n}\n\nexport interface WorkspaceContracts {\n types: string[];\n statuses: string[];\n openStatus: string;\n closeStatus: string;\n canceledStatus: string;\n}\n\nexport async function getWorkspaceContracts(\n pmRoot: string,\n options: WorkspaceContractsOptions = {},\n): Promise<WorkspaceContracts> {\n const settings = await readSettings(pmRoot);\n const extensionRegistrations =\n options.extensionRegistrations ??\n (options.noExtensions === true ? null : await loadWorkspaceExtensionRegistrations(pmRoot, settings, options.cwd));\n const typeRegistry = resolveItemTypeRegistry(settings, extensionRegistrations);\n const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);\n\n return {\n types: [...typeRegistry.types],\n statuses: statusRegistry.definitions.map((definition) => definition.id),\n openStatus: statusRegistry.open_status,\n closeStatus: statusRegistry.close_status,\n canceledStatus: statusRegistry.canceled_status,\n };\n}\n\nexport async function getContracts(\n pmRootOrOptions?: string | GetContractsOptions,\n options: GetContractsOptions = {},\n): Promise<ContractsResult> {\n const resolvedOptions =\n typeof pmRootOrOptions === \"string\"\n ? { ...options, pmRoot: pmRootOrOptions }\n : (pmRootOrOptions ?? options);\n const global: GlobalOptions = {\n json: true,\n quiet: resolvedOptions.quiet ?? true,\n noExtensions: resolvedOptions.noExtensions ?? false,\n noPager: true,\n profile: resolvedOptions.profile ?? false,\n path: resolvedOptions.pmRoot,\n };\n\n return runContracts(resolvedOptions, global);\n}\n\nasync function loadWorkspaceExtensionRegistrations(\n pmRoot: string,\n settings: Awaited<ReturnType<typeof readSettings>>,\n cwd?: string,\n): Promise<ExtensionRegistrationRegistry | null> {\n const loadResult = await loadExtensions({\n pmRoot,\n settings,\n cwd: cwd ?? process.cwd(),\n noExtensions: false,\n });\n const activationResult = await activateExtensions(loadResult);\n return activationResult.registrations;\n}\n\nexport type { ContractsCommandOptions, ContractsResult };\n"],"names":[],"mappings":";;AAAA,OAAO,EACL,kBAAkB,EAClB,cAAc,GAEf,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,4BAA4B,EAAE,MAAM,kCAAkC,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EACL,YAAY,GAGb,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EACL,+BAA+B,EAC/B,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,6BAA6B,CAAC;AACrC,OAAO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AAO,gBAAgB,CAAC,aAAa,CAAC;AACxC,CAAC","debugId":"9dfba929-1fc6-569e-8311-91fc06f420bc"}
1
+ {"version":3,"file":"runtime.js","sources":["sdk/runtime.ts"],"sourceRoot":"/","sourcesContent":["import {\n activateExtensions,\n loadExtensions,\n type ExtensionRegistrationRegistry,\n} from \"../core/extensions/index.js\";\nimport type { GlobalOptions } from \"../core/shared/command-types.js\";\nimport { resolveItemTypeRegistry } from \"../core/item/type-registry.js\";\nimport { resolveRuntimeStatusRegistry } from \"../core/schema/runtime-schema.js\";\nimport { readSettings } from \"../core/store/settings.js\";\nimport {\n runContracts,\n type ContractsCommandOptions,\n type ContractsResult,\n} from \"../cli/commands/contracts.js\";\n\nexport {\n getActiveExtensionRegistrations,\n runActiveOnReadHooks,\n runActiveOnWriteHooks,\n} from \"../core/extensions/index.js\";\nexport { pathExists, readFileIfExists, removeFileIfExists, writeFileAtomic } from \"../core/fs/fs-utils.js\";\nexport { appendHistoryEntry, createHistoryEntry } from \"../core/history/history.js\";\nexport { generateItemId, normalizeItemId, normalizeRawItemId } from \"../core/item/id.js\";\nexport { readBooleanOption, readCsvListOption, readStringOption } from \"./package-runtime-options.js\";\nexport {\n commitImportedItem,\n emptyImportedDocument,\n ensureTrackerInitialized,\n selectImportAuthor,\n toEstimatedMinutesValue,\n toImportPriority,\n toImportStatus,\n toImportTags,\n toNonEmptyImportString,\n type CommitImportedItemParams,\n type CommitImportedItemResult,\n} from \"./package-import-adapters.js\";\nexport {\n canonicalDocument,\n normalizeFrontMatter,\n serializeItemDocument,\n splitFrontMatter,\n} from \"../core/item/item-format.js\";\nexport { parseTags } from \"../core/item/parse.js\";\nexport { normalizeStatusInput } from \"../core/item/status.js\";\nexport { resolveItemTypeRegistry } from \"../core/item/type-registry.js\";\nexport { acquireLock } from \"../core/lock/lock.js\";\nexport { resolveRuntimeFieldRegistry, resolveRuntimeStatusRegistry } from \"../core/schema/runtime-schema.js\";\nexport { EXIT_CODE } from \"../core/shared/constants.js\";\nexport { PmCliError } from \"../core/shared/errors.js\";\nexport { isTimestampLiteral, nowIso } from \"../core/shared/time.js\";\nexport { listAllFrontMatter, locateItem, readLocatedItem } from \"../core/store/item-store.js\";\nexport { getHistoryPath, getItemPath, getSettingsPath, resolvePmRoot } from \"../core/store/paths.js\";\nexport { readSettings } from \"../core/store/settings.js\";\nexport {\n renderCalendarMarkdown,\n renderCalendarToon,\n resolveCalendarOutputFormat,\n runCalendar,\n type CalendarOptions,\n type CalendarResult,\n} from \"../cli/commands/calendar.js\";\nexport {\n renderGuideMarkdown,\n resolveGuideOutputFormat,\n runGuide,\n type GuideDepth,\n type GuideOptions,\n type GuideOutputFormat,\n type GuideResult,\n} from \"../cli/commands/guide.js\";\nexport { runCompletion, type CompletionResult, type CompletionShell } from \"../cli/commands/completion.js\";\nexport {\n runCommentsAudit,\n type CommentsAuditEntry,\n type CommentsAuditHistoryRow,\n type CommentsAuditOptions,\n type CommentsAuditResult,\n type CommentsAuditSummary,\n type CommentsAuditTypeSummary,\n} from \"../cli/commands/comments-audit.js\";\nexport {\n runDedupeAudit,\n type DedupeAuditCandidate,\n type DedupeAuditCluster,\n type DedupeAuditOptions,\n type DedupeAuditResult,\n} from \"../cli/commands/dedupe-audit.js\";\nexport { runNormalize, type NormalizeCommandOptions, type NormalizeResult } from \"../cli/commands/normalize.js\";\nexport { runReindex, type ReindexOptions, type ReindexResult } from \"../cli/commands/reindex.js\";\nexport { runSearch, type SearchOptions, type SearchResult } from \"../cli/commands/search.js\";\nexport {\n loadCreateTemplateOptions,\n runTemplatesList,\n runTemplatesSave,\n runTemplatesShow,\n type CreateTemplateOptions,\n type TemplatesListResult,\n type TemplatesSaveResult,\n type TemplatesShowResult,\n} from \"../cli/commands/templates.js\";\nexport {\n runTestRunsList,\n runTestRunsLogs,\n runTestRunsResume,\n runTestRunsStatus,\n runTestRunsStop,\n type TestRunsListCommandOptions,\n type TestRunsLogsCommandOptions,\n type TestRunsResumeCommandOptions,\n type TestRunsStopCommandOptions,\n} from \"../cli/commands/test-runs.js\";\nexport {\n CONFIDENCE_TEXT_VALUES,\n DEPENDENCY_KIND_VALUES,\n BUILTIN_ITEM_TYPE_VALUES,\n ISSUE_SEVERITY_VALUES,\n ITEM_TYPE_VALUES,\n RISK_VALUES,\n STATUS_VALUES,\n} from \"../types/index.js\";\nexport type { GlobalOptions } from \"../core/shared/command-types.js\";\nexport type {\n Dependency,\n ItemDocument,\n ItemMetadata,\n ItemStatus,\n ItemType,\n LinkedDoc,\n LinkedFile,\n LinkedTest,\n LogNote,\n PmSettings,\n} from \"../types/index.js\";\n\nexport interface GetContractsOptions extends ContractsCommandOptions {\n pmRoot?: string;\n cwd?: string;\n noExtensions?: boolean;\n quiet?: boolean;\n profile?: boolean;\n}\n\nexport interface WorkspaceContractsOptions {\n extensionRegistrations?: ExtensionRegistrationRegistry | null;\n noExtensions?: boolean;\n cwd?: string;\n}\n\nexport interface WorkspaceContracts {\n types: string[];\n statuses: string[];\n openStatus: string;\n closeStatus: string;\n canceledStatus: string;\n}\n\nexport async function getWorkspaceContracts(\n pmRoot: string,\n options: WorkspaceContractsOptions = {},\n): Promise<WorkspaceContracts> {\n const settings = await readSettings(pmRoot);\n const extensionRegistrations =\n options.extensionRegistrations ??\n (options.noExtensions === true ? null : await loadWorkspaceExtensionRegistrations(pmRoot, settings, options.cwd));\n const typeRegistry = resolveItemTypeRegistry(settings, extensionRegistrations);\n const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);\n\n return {\n types: [...typeRegistry.types],\n statuses: statusRegistry.definitions.map((definition) => definition.id),\n openStatus: statusRegistry.open_status,\n closeStatus: statusRegistry.close_status,\n canceledStatus: statusRegistry.canceled_status,\n };\n}\n\nexport async function getContracts(\n pmRootOrOptions?: string | GetContractsOptions,\n options: GetContractsOptions = {},\n): Promise<ContractsResult> {\n const resolvedOptions =\n typeof pmRootOrOptions === \"string\"\n ? { ...options, pmRoot: pmRootOrOptions }\n : (pmRootOrOptions ?? options);\n const global: GlobalOptions = {\n json: true,\n quiet: resolvedOptions.quiet ?? true,\n noExtensions: resolvedOptions.noExtensions ?? false,\n noPager: true,\n profile: resolvedOptions.profile ?? false,\n path: resolvedOptions.pmRoot,\n };\n\n return runContracts(resolvedOptions, global);\n}\n\nasync function loadWorkspaceExtensionRegistrations(\n pmRoot: string,\n settings: Awaited<ReturnType<typeof readSettings>>,\n cwd?: string,\n): Promise<ExtensionRegistrationRegistry | null> {\n const loadResult = await loadExtensions({\n pmRoot,\n settings,\n cwd: cwd ?? process.cwd(),\n noExtensions: false,\n });\n const activationResult = await activateExtensions(loadResult);\n return activationResult.registrations;\n}\n\nexport type { ContractsCommandOptions, ContractsResult };\n"],"names":[],"mappings":";;AAAA,OAAO,EACL,kBAAkB,EAClB,cAAc,GAEf,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,4BAA4B,EAAE,MAAM,kCAAkC,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EACL,YAAY,GAGb,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EACL,+BAA+B,EAC/B,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC3G,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACpF,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACzF,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACtG,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,wBAAwB,EACxB,kBAAkB,EAClB,uBAAuB,EACvB,gBAAgB,EAChB,cAAc,EACd,YAAY,E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9C,UAA+B,EAAE;IAEjC,MAAM,eAAe,GACnB,OAAO,eAAe,KAAK,QAAQ;QACjC,CAAC,CAAC,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE;QACzC,CAAC,CAAC,CAAC,eAAe,IAAI,OAAO,CAAC,CAAC;IACnC,MAAM,MAAM,GAAkB;QAC5B,IAAI,EAAE,IAAI;QACV,KAAK,EAAE,eAAe,CAAC,KAAK,IAAI,IAAI;QACpC,YAAY,EAAE,eAAe,CAAC,YAAY,IAAI,KAAK;QACnD,OAAO,EAAE,IAAI;QACb,OAAO,EAAE,eAAe,CAAC,OAAO,IAAI,KAAK;QACzC,IAAI,EAAE,eAAe,CAAC,MAAM;KAC7B,CAAC;IAEF,OAAO,YAAY,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;AAC/C,CAAC;AAED,KAAK,UAAU,mCAAmC,CAChD,MAAc,EACd,QAAkD,EAClD,GAAY;IAEZ,MAAM,UAAU,GAAG,MAAM,cAAc,CAAC;QACtC,MAAM;QACN,QAAQ;QACR,GAAG,EAAE,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE;QACzB,YAAY,EAAE,KAAK;KACpB,CAAC,CAAC;IACH,MAAM,gBAAgB,GAAG,MAAM,kBAAkB,CAAC,UAAU,CAAC,CAAC;IAC9D,OAAO,gBAAgB,CAAC,aAAa,CAAC;AACxC,CAAC","debugId":"a8653cb8-6b5a-5e26-bf29-f20efd02a25b"}
package/dist/types.d.ts CHANGED
@@ -442,6 +442,7 @@ export interface AgentGuidanceSettings {
442
442
  template_version: number;
443
443
  last_checked_files: string[];
444
444
  }
445
+ export type SearchMutationRefreshPolicy = "cache_only" | "semantic_configured" | "semantic_auto";
445
446
  export interface PmSettings {
446
447
  version: number;
447
448
  id_prefix: string;
@@ -500,6 +501,7 @@ export interface PmSettings {
500
501
  embedding_timeout_ms: number;
501
502
  scanner_max_batch_retries: number;
502
503
  provider?: string;
504
+ mutation_refresh_policy: SearchMutationRefreshPolicy;
503
505
  tuning?: {
504
506
  title_exact_bonus?: number;
505
507
  title_weight?: number;
package/dist/types.js CHANGED
@@ -1,5 +1,5 @@
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]="68c1fa65-9fc4-5566-9c23-bdb17c35cb53")}catch(e){}}();
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]="026a0266-59b3-5570-af68-9a56d4113da2")}catch(e){}}();
3
3
  export const BUILTIN_ITEM_TYPE_VALUES = [
4
4
  "Epic",
5
5
  "Feature",
@@ -125,4 +125,4 @@ export const CONTEXT_SECTION_VALUES = [
125
125
  "tests",
126
126
  ];
127
127
  //# sourceMappingURL=types.js.map
128
- //# debugId=68c1fa65-9fc4-5566-9c23-bdb17c35cb53
128
+ //# debugId=026a0266-59b3-5570-af68-9a56d4113da2
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sources":["types.ts"],"sourceRoot":"/","sourcesContent":["export const BUILTIN_ITEM_TYPE_VALUES = [\n \"Epic\",\n \"Feature\",\n \"Task\",\n \"Chore\",\n \"Issue\",\n \"Decision\",\n \"Event\",\n \"Reminder\",\n \"Milestone\",\n \"Meeting\",\n \"Plan\",\n] as const;\nexport const ITEM_TYPE_VALUES = BUILTIN_ITEM_TYPE_VALUES;\nexport type BuiltinItemType = (typeof BUILTIN_ITEM_TYPE_VALUES)[number];\nexport type ItemType = string;\n\nexport const STATUS_VALUES = [\n \"draft\",\n \"open\",\n \"in_progress\",\n \"blocked\",\n \"closed\",\n \"canceled\",\n] as const;\nexport type ItemStatus = string;\n\nexport const RUNTIME_STATUS_ROLE_VALUES = [\n \"draft\",\n \"active\",\n \"blocked\",\n \"terminal\",\n \"terminal_done\",\n \"terminal_canceled\",\n \"default_open\",\n \"default_close\",\n \"default_cancel\",\n] as const;\nexport type RuntimeStatusRole = (typeof RUNTIME_STATUS_ROLE_VALUES)[number];\n\nexport const RUNTIME_FIELD_TYPE_VALUES = [\"string\", \"number\", \"boolean\", \"string_array\"] as const;\nexport type RuntimeFieldType = (typeof RUNTIME_FIELD_TYPE_VALUES)[number];\n\nexport const RUNTIME_FIELD_COMMAND_VALUES = [\"create\", \"update\", \"update_many\", \"list\", \"search\", \"calendar\", \"context\"] as const;\nexport type RuntimeFieldCommand = (typeof RUNTIME_FIELD_COMMAND_VALUES)[number];\n\nexport const RUNTIME_UNKNOWN_FIELD_POLICY_VALUES = [\"allow\", \"warn\", \"reject\"] as const;\nexport type RuntimeUnknownFieldPolicy = (typeof RUNTIME_UNKNOWN_FIELD_POLICY_VALUES)[number];\n\nexport const DEPENDENCY_KIND_VALUES = [\n \"blocks\",\n \"parent\",\n \"child\",\n \"parent_child\",\n \"child_of\",\n \"related\",\n \"related_to\",\n \"discovered_from\",\n \"blocked_by\",\n \"incident_from\",\n \"epic\",\n \"supersedes\",\n \"task\",\n] as const;\nexport type DependencyKind = (typeof DEPENDENCY_KIND_VALUES)[number];\n\nexport const SCOPE_VALUES = [\"project\", \"global\"] as const;\nexport type LinkScope = (typeof SCOPE_VALUES)[number];\n\nexport const RISK_VALUES = [\"low\", \"medium\", \"high\", \"critical\"] as const;\nexport type RiskLevel = (typeof RISK_VALUES)[number];\n\nexport const ISSUE_SEVERITY_VALUES = [\"low\", \"medium\", \"high\", \"critical\"] as const;\nexport type IssueSeverity = (typeof ISSUE_SEVERITY_VALUES)[number];\n\nexport const CONFIDENCE_TEXT_VALUES = [\"low\", \"medium\", \"high\"] as const;\nexport type ConfidenceTextLevel = (typeof CONFIDENCE_TEXT_VALUES)[number];\nexport type ConfidenceValue = number | ConfidenceTextLevel;\n\nexport const ITEM_FORMAT_VALUES = [\"toon\", \"json_markdown\"] as const;\nexport type ItemFormat = (typeof ITEM_FORMAT_VALUES)[number];\n\nexport const SPRINT_RELEASE_FORMAT_POLICY_VALUES = [\"warn\", \"strict_error\"] as const;\nexport type SprintReleaseFormatPolicy = (typeof SPRINT_RELEASE_FORMAT_POLICY_VALUES)[number];\nexport const PARENT_REFERENCE_POLICY_VALUES = [\"warn\", \"strict_error\"] as const;\nexport type ParentReferencePolicy = (typeof PARENT_REFERENCE_POLICY_VALUES)[number];\nexport const VALIDATE_METADATA_PROFILE_VALUES = [\"core\", \"strict\", \"custom\"] as const;\nexport type ValidateMetadataProfile = (typeof VALIDATE_METADATA_PROFILE_VALUES)[number];\nexport const GOVERNANCE_PRESET_VALUES = [\"minimal\", \"default\", \"strict\", \"custom\"] as const;\nexport type GovernancePreset = (typeof GOVERNANCE_PRESET_VALUES)[number];\nexport const GOVERNANCE_OWNERSHIP_ENFORCEMENT_VALUES = [\"none\", \"warn\", \"strict\"] as const;\nexport type GovernanceOwnershipEnforcement = (typeof GOVERNANCE_OWNERSHIP_ENFORCEMENT_VALUES)[number];\nexport const GOVERNANCE_CREATE_MODE_DEFAULT_VALUES = [\"progressive\", \"strict\"] as const;\nexport type GovernanceCreateModeDefault = (typeof GOVERNANCE_CREATE_MODE_DEFAULT_VALUES)[number];\nexport const GOVERNANCE_CLOSE_VALIDATION_DEFAULT_VALUES = [\"off\", \"warn\", \"strict\"] as const;\nexport type GovernanceCloseValidationDefault = (typeof GOVERNANCE_CLOSE_VALIDATION_DEFAULT_VALUES)[number];\nexport const VALIDATE_METADATA_REQUIRED_FIELD_VALUES = [\n \"author\",\n \"acceptance_criteria\",\n \"estimated_minutes\",\n \"close_reason\",\n \"reviewer\",\n \"risk\",\n \"confidence\",\n \"sprint\",\n \"release\",\n] as const;\nexport type ValidateMetadataRequiredField = (typeof VALIDATE_METADATA_REQUIRED_FIELD_VALUES)[number];\n\nexport const RECURRENCE_FREQUENCY_VALUES = [\"daily\", \"weekly\", \"monthly\", \"yearly\"] as const;\nexport type RecurrenceFrequency = (typeof RECURRENCE_FREQUENCY_VALUES)[number];\n\nexport const RECURRENCE_WEEKDAY_VALUES = [\"mon\", \"tue\", \"wed\", \"thu\", \"fri\", \"sat\", \"sun\"] as const;\nexport type RecurrenceWeekday = (typeof RECURRENCE_WEEKDAY_VALUES)[number];\n\n/**\n * Canonical week-order index for a recurrence weekday (mon=0 .. sun=6).\n * Shared by item serialization, create/update parsing, and calendar expansion\n * so weekday ordering cannot drift between those modules.\n */\nexport function weekdayOrderIndex(value: RecurrenceWeekday): number {\n return RECURRENCE_WEEKDAY_VALUES.indexOf(value);\n}\n\nexport interface Dependency {\n id: string;\n kind: DependencyKind;\n created_at: string;\n author?: string;\n source_kind?: string;\n}\n\nexport interface Comment {\n created_at: string;\n author: string;\n text: string;\n}\n\nexport interface LogNote {\n created_at: string;\n author: string;\n text: string;\n}\n\nexport interface LinkedFile {\n path: string;\n scope: LinkScope;\n note?: string;\n}\n\nexport interface LinkedTest {\n command?: string;\n path?: string;\n scope: LinkScope;\n timeout_seconds?: number;\n pm_context_mode?: \"schema\" | \"tracker\" | \"auto\";\n env_set?: Record<string, string>;\n env_clear?: string[];\n shared_host_safe?: boolean;\n assert_stdout_contains?: string[];\n assert_stdout_regex?: string[];\n assert_stderr_contains?: string[];\n assert_stderr_regex?: string[];\n assert_stdout_min_lines?: number;\n assert_json_field_equals?: Record<string, string>;\n assert_json_field_gte?: Record<string, number>;\n note?: string;\n}\n\nexport interface LinkedDoc {\n path: string;\n scope: LinkScope;\n note?: string;\n}\n\nexport interface Reminder {\n at: string;\n text: string;\n}\n\nexport interface RecurrenceRule {\n freq: RecurrenceFrequency;\n interval?: number;\n count?: number;\n until?: string;\n by_weekday?: RecurrenceWeekday[];\n by_month_day?: number[];\n exdates?: string[];\n}\n\nexport interface CalendarEvent {\n start_at: string;\n end_at?: string;\n title?: string;\n description?: string;\n location?: string;\n all_day?: boolean;\n timezone?: string;\n recurrence?: RecurrenceRule;\n}\n\nexport const PLAN_MODE_VALUES = [\n \"draft\",\n \"research\",\n \"review\",\n \"approved\",\n \"executing\",\n \"paused\",\n \"completed\",\n \"superseded\",\n] as const;\nexport type PlanMode = (typeof PLAN_MODE_VALUES)[number];\n\nexport const PLAN_STEP_STATUS_VALUES = [\n \"pending\",\n \"in_progress\",\n \"completed\",\n \"blocked\",\n \"skipped\",\n \"superseded\",\n] as const;\nexport type PlanStepStatus = (typeof PLAN_STEP_STATUS_VALUES)[number];\n\nexport const PLAN_HARNESS_VALUES = [\"codex\", \"claude-code\", \"cursor\", \"generic\"] as const;\nexport type PlanHarness = (typeof PLAN_HARNESS_VALUES)[number];\n\nexport const PLAN_STEP_LINK_KIND_VALUES = [\n \"related\",\n \"blocks\",\n \"blocked_by\",\n \"depends_on\",\n \"discovered_from\",\n \"implements\",\n \"verifies\",\n \"supersedes\",\n] as const;\nexport type PlanStepLinkKind = (typeof PLAN_STEP_LINK_KIND_VALUES)[number];\n\nexport interface PlanStepLink {\n id: string;\n kind: PlanStepLinkKind;\n note?: string;\n required_before_step?: boolean;\n}\n\nexport interface PlanStepFile {\n path: string;\n scope?: LinkScope;\n note?: string;\n}\n\nexport interface PlanStepTest {\n command?: string;\n path?: string;\n note?: string;\n}\n\nexport interface PlanStepDoc {\n path: string;\n scope?: LinkScope;\n note?: string;\n}\n\nexport interface PlanStep {\n id: string;\n order: number;\n title: string;\n body?: string;\n status: PlanStepStatus;\n owner?: string;\n evidence?: string;\n blocked_reason?: string;\n superseded_by?: string;\n linked_items?: PlanStepLink[];\n files?: PlanStepFile[];\n tests?: PlanStepTest[];\n docs?: PlanStepDoc[];\n created_at: string;\n updated_at: string;\n completed_at?: string;\n}\n\nexport interface PlanDecision {\n ts: string;\n author: string;\n decision: string;\n rationale?: string;\n evidence?: string;\n step_id?: string;\n}\n\nexport interface PlanDiscovery {\n ts: string;\n author: string;\n text: string;\n step_id?: string;\n}\n\nexport interface PlanValidationCheck {\n text: string;\n command?: string;\n expected?: string;\n}\n\nexport interface ItemTypeOptionDefinition {\n key: string;\n values: string[];\n required?: boolean;\n aliases?: string[];\n description?: string;\n}\n\nexport interface ItemTypeCommandOptionPolicy {\n command: \"create\" | \"update\";\n option: string;\n required?: boolean;\n visible?: boolean;\n enabled?: boolean;\n}\n\nexport interface ItemTypeDefinition {\n name: string;\n folder?: string;\n aliases?: string[];\n required_create_fields?: string[];\n required_create_repeatables?: string[];\n options?: ItemTypeOptionDefinition[];\n command_option_policies?: ItemTypeCommandOptionPolicy[];\n}\n\nexport interface RuntimeStatusDefinition {\n id: string;\n aliases?: string[];\n roles?: RuntimeStatusRole[];\n description?: string;\n order?: number;\n}\n\nexport interface RuntimeFieldDefinition {\n key: string;\n metadata_key?: string;\n /**\n * @deprecated Use metadata_key.\n */\n front_matter_key?: string;\n cli_flag?: string;\n cli_aliases?: string[];\n description?: string;\n type?: RuntimeFieldType;\n commands?: RuntimeFieldCommand[];\n repeatable?: boolean;\n required?: boolean;\n required_on_create?: boolean;\n required_types?: string[];\n allow_unset?: boolean;\n}\n\nexport interface RuntimeWorkflowDefinition {\n draft_status?: string;\n open_status?: string;\n in_progress_status?: string;\n blocked_status?: string;\n close_status?: string;\n canceled_status?: string;\n}\n\nexport interface RuntimeSchemaFileConfig {\n types?: string;\n statuses?: string;\n fields?: string;\n workflows?: string;\n}\n\nexport interface RuntimeSchemaSettings {\n version: number;\n files: RuntimeSchemaFileConfig;\n statuses: RuntimeStatusDefinition[];\n fields: RuntimeFieldDefinition[];\n workflow: RuntimeWorkflowDefinition;\n unknown_field_policy: RuntimeUnknownFieldPolicy;\n}\n\nexport interface ItemTestRunSummary {\n run_id: string;\n kind: \"test\" | \"test-all\";\n status: \"passed\" | \"failed\" | \"stopped\" | \"canceled\";\n started_at: string;\n finished_at: string;\n recorded_at: string;\n attempt?: number;\n resumed_from?: string;\n passed: number;\n failed: number;\n skipped: number;\n items?: number;\n linked_tests?: number;\n fail_on_skipped_triggered?: boolean;\n}\n\nexport interface ItemMetadata {\n id: string;\n title: string;\n description: string;\n type: ItemType;\n source_type?: string;\n type_options?: Record<string, string>;\n status: ItemStatus;\n priority: 0 | 1 | 2 | 3 | 4;\n tags: string[];\n created_at: string;\n updated_at: string;\n deadline?: string;\n reminders?: Reminder[];\n events?: CalendarEvent[];\n closed_at?: string;\n assignee?: string;\n source_owner?: string;\n author?: string;\n estimated_minutes?: number;\n acceptance_criteria?: string;\n design?: string;\n external_ref?: string;\n definition_of_ready?: string;\n order?: number;\n goal?: string;\n objective?: string;\n value?: string;\n impact?: string;\n outcome?: string;\n why_now?: string;\n parent?: string;\n reviewer?: string;\n risk?: \"low\" | \"medium\" | \"high\" | \"critical\";\n confidence?: ConfidenceValue;\n sprint?: string;\n release?: string;\n blocked_by?: string;\n blocked_reason?: string;\n unblock_note?: string;\n reporter?: string;\n severity?: IssueSeverity;\n environment?: string;\n repro_steps?: string;\n resolution?: string;\n expected_result?: string;\n actual_result?: string;\n affected_version?: string;\n fixed_version?: string;\n component?: string;\n regression?: boolean;\n customer_impact?: string;\n dependencies?: Dependency[];\n comments?: Comment[];\n notes?: LogNote[];\n learnings?: LogNote[];\n files?: LinkedFile[];\n tests?: LinkedTest[];\n test_runs?: ItemTestRunSummary[];\n docs?: LinkedDoc[];\n close_reason?: string;\n plan_mode?: PlanMode;\n plan_scope?: string;\n plan_harness?: PlanHarness;\n plan_steps?: PlanStep[];\n plan_decisions?: PlanDecision[];\n plan_discoveries?: PlanDiscovery[];\n plan_validation?: PlanValidationCheck[];\n plan_resume_context?: string;\n [key: string]: unknown;\n}\n\n/**\n * @deprecated Use ItemMetadata.\n */\nexport type ItemFrontMatter = ItemMetadata;\n\nexport interface ItemDocument {\n metadata: ItemMetadata;\n body: string;\n}\n\nexport interface HistoryPatchOp {\n op: \"add\" | \"remove\" | \"replace\" | \"move\" | \"copy\" | \"test\";\n path: string;\n from?: string;\n value?: unknown;\n}\n\nexport interface HistoryEntry {\n ts: string;\n author: string;\n op: string;\n patch: HistoryPatchOp[];\n before_hash: string;\n after_hash: string;\n message?: string;\n}\n\nexport const CONTEXT_DEPTH_VALUES = [\"brief\", \"standard\", \"deep\"] as const;\nexport type ContextDepth = (typeof CONTEXT_DEPTH_VALUES)[number];\n\nexport const CONTEXT_SECTION_VALUES = [\n \"hierarchy\",\n \"activity\",\n \"progress\",\n \"blockers\",\n \"files\",\n \"workload\",\n \"staleness\",\n \"tests\",\n] as const;\nexport type ContextSectionName = (typeof CONTEXT_SECTION_VALUES)[number];\n\nexport interface ContextSectionSettings {\n hierarchy: boolean;\n activity: boolean;\n progress: boolean;\n blockers: boolean;\n files: boolean;\n workload: boolean;\n staleness: boolean;\n tests: boolean;\n}\n\nexport interface ContextSettings {\n default_depth: ContextDepth;\n activity_limit: number;\n stale_threshold_days: number;\n sections: ContextSectionSettings;\n}\n\nexport interface GovernanceSettings {\n preset: GovernancePreset;\n ownership_enforcement: GovernanceOwnershipEnforcement;\n create_mode_default: GovernanceCreateModeDefault;\n close_validation_default: GovernanceCloseValidationDefault;\n parent_reference: ParentReferencePolicy;\n metadata_profile: ValidateMetadataProfile;\n force_required_for_stale_lock: boolean;\n create_default_type?: string;\n}\n\nexport type ExtensionPolicyMode = \"off\" | \"warn\" | \"enforce\";\nexport type ExtensionTrustMode = \"off\" | \"warn\" | \"enforce\";\nexport type ExtensionSandboxProfile = \"none\" | \"restricted\" | \"strict\";\n\nexport interface ExtensionPolicyOverrideSettings {\n name: string;\n disabled?: boolean;\n require_trusted?: boolean;\n require_provenance?: boolean;\n sandbox_profile?: ExtensionSandboxProfile;\n allowed_capabilities?: string[];\n blocked_capabilities?: string[];\n allowed_surfaces?: string[];\n blocked_surfaces?: string[];\n allowed_commands?: string[];\n blocked_commands?: string[];\n allowed_actions?: string[];\n blocked_actions?: string[];\n allowed_services?: string[];\n blocked_services?: string[];\n}\n\nexport interface ExtensionPolicySettings {\n mode: ExtensionPolicyMode;\n trust_mode: ExtensionTrustMode;\n require_provenance: boolean;\n trusted_extensions: string[];\n default_sandbox_profile: ExtensionSandboxProfile;\n allowed_extensions: string[];\n blocked_extensions: string[];\n allowed_capabilities: string[];\n blocked_capabilities: string[];\n allowed_surfaces: string[];\n blocked_surfaces: string[];\n allowed_commands: string[];\n blocked_commands: string[];\n allowed_actions: string[];\n blocked_actions: string[];\n allowed_services: string[];\n blocked_services: string[];\n extension_overrides: ExtensionPolicyOverrideSettings[];\n}\n\nexport interface AgentGuidanceSettings {\n prompt_completed: boolean;\n declined: boolean;\n declined_at: string;\n template_version: number;\n last_checked_files: string[];\n}\n\nexport interface PmSettings {\n version: number;\n id_prefix: string;\n author_default: string;\n item_format: ItemFormat;\n locks: {\n ttl_seconds: number;\n };\n output: {\n default_format: \"toon\" | \"json\";\n };\n history: {\n missing_stream: \"auto_create\" | \"strict_error\";\n };\n validation: {\n sprint_release_format: SprintReleaseFormatPolicy;\n parent_reference: ParentReferencePolicy;\n metadata_profile: ValidateMetadataProfile;\n metadata_required_fields: ValidateMetadataRequiredField[];\n lifecycle_stale_blocker_reason_patterns: string[];\n lifecycle_closure_like_blocked_reason_patterns: string[];\n lifecycle_closure_like_resolution_patterns: string[];\n lifecycle_closure_like_actual_result_patterns: string[];\n };\n governance: GovernanceSettings;\n workflow: {\n definition_of_done: string[];\n };\n testing: {\n record_results_to_items: boolean;\n };\n telemetry: {\n enabled: boolean;\n first_run_prompt_completed: boolean;\n capture_level: \"minimal\" | \"redacted\" | \"max\";\n endpoint: string;\n installation_id: string;\n retention_days: number;\n };\n agent_guidance: AgentGuidanceSettings;\n item_types: {\n definitions: ItemTypeDefinition[];\n };\n schema: RuntimeSchemaSettings;\n extensions: {\n enabled: string[];\n disabled: string[];\n policy: ExtensionPolicySettings;\n };\n search: {\n score_threshold: number;\n hybrid_semantic_weight: number;\n max_results: number;\n embedding_model: string;\n embedding_batch_size: number;\n embedding_timeout_ms: number;\n scanner_max_batch_retries: number;\n provider?: string;\n tuning?: {\n title_exact_bonus?: number;\n title_weight?: number;\n description_weight?: number;\n tags_weight?: number;\n status_weight?: number;\n body_weight?: number;\n comments_weight?: number;\n notes_weight?: number;\n learnings_weight?: number;\n dependencies_weight?: number;\n linked_content_weight?: number;\n };\n };\n providers: {\n openai: {\n base_url: string;\n api_key: string;\n model: string;\n };\n ollama: {\n base_url: string;\n model: string;\n };\n };\n context: ContextSettings;\n vector_store: {\n adapter?: string;\n qdrant: {\n url: string;\n api_key: string;\n };\n lancedb: {\n path: string;\n };\n };\n}\n"],"names":[],"mappings":";;AAAA,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,MAAM;IACN,SAAS;IACT,MAAM;IACN,OAAO;IACP,OAAO;IACP,UAAU;IACV,OAAO;IACP,UAAU;IACV,WAAW;IACX,SAAS;IACT,MAAM;CACE,CAAC;AACX,MAAM,CAAC,MAAM,gBAAgB,GAAG,wBAAwB,CAAC;AAIzD,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,OAAO;IACP,MAAM;IACN,aAAa;IACb,SAAS;IACT,QAAQ;IACR,UAAU;CACF,CAAC;AAGX,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,OAAO;IACP,QAAQ;IACR,SAAS;IACT,UAAU;IACV,eAAe;IACf,mBAAmB;IACnB,cAAc;IACd,eAAe;IACf,gBAAgB;CACR,CAAC;AAGX,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,cAAc,CAAU,CAAC;AAGlG,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,CAAU,CAAC;AAGlI,MAAM,CAAC,MAAM,mCAAmC,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAU,CAAC;AAGxF,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,cAAc;IACd,UA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ources":["types.ts"],"sourceRoot":"/","sourcesContent":["export const BUILTIN_ITEM_TYPE_VALUES = [\n \"Epic\",\n \"Feature\",\n \"Task\",\n \"Chore\",\n \"Issue\",\n \"Decision\",\n \"Event\",\n \"Reminder\",\n \"Milestone\",\n \"Meeting\",\n \"Plan\",\n] as const;\nexport const ITEM_TYPE_VALUES = BUILTIN_ITEM_TYPE_VALUES;\nexport type BuiltinItemType = (typeof BUILTIN_ITEM_TYPE_VALUES)[number];\nexport type ItemType = string;\n\nexport const STATUS_VALUES = [\n \"draft\",\n \"open\",\n \"in_progress\",\n \"blocked\",\n \"closed\",\n \"canceled\",\n] as const;\nexport type ItemStatus = string;\n\nexport const RUNTIME_STATUS_ROLE_VALUES = [\n \"draft\",\n \"active\",\n \"blocked\",\n \"terminal\",\n \"terminal_done\",\n \"terminal_canceled\",\n \"default_open\",\n \"default_close\",\n \"default_cancel\",\n] as const;\nexport type RuntimeStatusRole = (typeof RUNTIME_STATUS_ROLE_VALUES)[number];\n\nexport const RUNTIME_FIELD_TYPE_VALUES = [\"string\", \"number\", \"boolean\", \"string_array\"] as const;\nexport type RuntimeFieldType = (typeof RUNTIME_FIELD_TYPE_VALUES)[number];\n\nexport const RUNTIME_FIELD_COMMAND_VALUES = [\"create\", \"update\", \"update_many\", \"list\", \"search\", \"calendar\", \"context\"] as const;\nexport type RuntimeFieldCommand = (typeof RUNTIME_FIELD_COMMAND_VALUES)[number];\n\nexport const RUNTIME_UNKNOWN_FIELD_POLICY_VALUES = [\"allow\", \"warn\", \"reject\"] as const;\nexport type RuntimeUnknownFieldPolicy = (typeof RUNTIME_UNKNOWN_FIELD_POLICY_VALUES)[number];\n\nexport const DEPENDENCY_KIND_VALUES = [\n \"blocks\",\n \"parent\",\n \"child\",\n \"parent_child\",\n \"child_of\",\n \"related\",\n \"related_to\",\n \"discovered_from\",\n \"blocked_by\",\n \"incident_from\",\n \"epic\",\n \"supersedes\",\n \"task\",\n] as const;\nexport type DependencyKind = (typeof DEPENDENCY_KIND_VALUES)[number];\n\nexport const SCOPE_VALUES = [\"project\", \"global\"] as const;\nexport type LinkScope = (typeof SCOPE_VALUES)[number];\n\nexport const RISK_VALUES = [\"low\", \"medium\", \"high\", \"critical\"] as const;\nexport type RiskLevel = (typeof RISK_VALUES)[number];\n\nexport const ISSUE_SEVERITY_VALUES = [\"low\", \"medium\", \"high\", \"critical\"] as const;\nexport type IssueSeverity = (typeof ISSUE_SEVERITY_VALUES)[number];\n\nexport const CONFIDENCE_TEXT_VALUES = [\"low\", \"medium\", \"high\"] as const;\nexport type ConfidenceTextLevel = (typeof CONFIDENCE_TEXT_VALUES)[number];\nexport type ConfidenceValue = number | ConfidenceTextLevel;\n\nexport const ITEM_FORMAT_VALUES = [\"toon\", \"json_markdown\"] as const;\nexport type ItemFormat = (typeof ITEM_FORMAT_VALUES)[number];\n\nexport const SPRINT_RELEASE_FORMAT_POLICY_VALUES = [\"warn\", \"strict_error\"] as const;\nexport type SprintReleaseFormatPolicy = (typeof SPRINT_RELEASE_FORMAT_POLICY_VALUES)[number];\nexport const PARENT_REFERENCE_POLICY_VALUES = [\"warn\", \"strict_error\"] as const;\nexport type ParentReferencePolicy = (typeof PARENT_REFERENCE_POLICY_VALUES)[number];\nexport const VALIDATE_METADATA_PROFILE_VALUES = [\"core\", \"strict\", \"custom\"] as const;\nexport type ValidateMetadataProfile = (typeof VALIDATE_METADATA_PROFILE_VALUES)[number];\nexport const GOVERNANCE_PRESET_VALUES = [\"minimal\", \"default\", \"strict\", \"custom\"] as const;\nexport type GovernancePreset = (typeof GOVERNANCE_PRESET_VALUES)[number];\nexport const GOVERNANCE_OWNERSHIP_ENFORCEMENT_VALUES = [\"none\", \"warn\", \"strict\"] as const;\nexport type GovernanceOwnershipEnforcement = (typeof GOVERNANCE_OWNERSHIP_ENFORCEMENT_VALUES)[number];\nexport const GOVERNANCE_CREATE_MODE_DEFAULT_VALUES = [\"progressive\", \"strict\"] as const;\nexport type GovernanceCreateModeDefault = (typeof GOVERNANCE_CREATE_MODE_DEFAULT_VALUES)[number];\nexport const GOVERNANCE_CLOSE_VALIDATION_DEFAULT_VALUES = [\"off\", \"warn\", \"strict\"] as const;\nexport type GovernanceCloseValidationDefault = (typeof GOVERNANCE_CLOSE_VALIDATION_DEFAULT_VALUES)[number];\nexport const VALIDATE_METADATA_REQUIRED_FIELD_VALUES = [\n \"author\",\n \"acceptance_criteria\",\n \"estimated_minutes\",\n \"close_reason\",\n \"reviewer\",\n \"risk\",\n \"confidence\",\n \"sprint\",\n \"release\",\n] as const;\nexport type ValidateMetadataRequiredField = (typeof VALIDATE_METADATA_REQUIRED_FIELD_VALUES)[number];\n\nexport const RECURRENCE_FREQUENCY_VALUES = [\"daily\", \"weekly\", \"monthly\", \"yearly\"] as const;\nexport type RecurrenceFrequency = (typeof RECURRENCE_FREQUENCY_VALUES)[number];\n\nexport const RECURRENCE_WEEKDAY_VALUES = [\"mon\", \"tue\", \"wed\", \"thu\", \"fri\", \"sat\", \"sun\"] as const;\nexport type RecurrenceWeekday = (typeof RECURRENCE_WEEKDAY_VALUES)[number];\n\n/**\n * Canonical week-order index for a recurrence weekday (mon=0 .. sun=6).\n * Shared by item serialization, create/update parsing, and calendar expansion\n * so weekday ordering cannot drift between those modules.\n */\nexport function weekdayOrderIndex(value: RecurrenceWeekday): number {\n return RECURRENCE_WEEKDAY_VALUES.indexOf(value);\n}\n\nexport interface Dependency {\n id: string;\n kind: DependencyKind;\n created_at: string;\n author?: string;\n source_kind?: string;\n}\n\nexport interface Comment {\n created_at: string;\n author: string;\n text: string;\n}\n\nexport interface LogNote {\n created_at: string;\n author: string;\n text: string;\n}\n\nexport interface LinkedFile {\n path: string;\n scope: LinkScope;\n note?: string;\n}\n\nexport interface LinkedTest {\n command?: string;\n path?: string;\n scope: LinkScope;\n timeout_seconds?: number;\n pm_context_mode?: \"schema\" | \"tracker\" | \"auto\";\n env_set?: Record<string, string>;\n env_clear?: string[];\n shared_host_safe?: boolean;\n assert_stdout_contains?: string[];\n assert_stdout_regex?: string[];\n assert_stderr_contains?: string[];\n assert_stderr_regex?: string[];\n assert_stdout_min_lines?: number;\n assert_json_field_equals?: Record<string, string>;\n assert_json_field_gte?: Record<string, number>;\n note?: string;\n}\n\nexport interface LinkedDoc {\n path: string;\n scope: LinkScope;\n note?: string;\n}\n\nexport interface Reminder {\n at: string;\n text: string;\n}\n\nexport interface RecurrenceRule {\n freq: RecurrenceFrequency;\n interval?: number;\n count?: number;\n until?: string;\n by_weekday?: RecurrenceWeekday[];\n by_month_day?: number[];\n exdates?: string[];\n}\n\nexport interface CalendarEvent {\n start_at: string;\n end_at?: string;\n title?: string;\n description?: string;\n location?: string;\n all_day?: boolean;\n timezone?: string;\n recurrence?: RecurrenceRule;\n}\n\nexport const PLAN_MODE_VALUES = [\n \"draft\",\n \"research\",\n \"review\",\n \"approved\",\n \"executing\",\n \"paused\",\n \"completed\",\n \"superseded\",\n] as const;\nexport type PlanMode = (typeof PLAN_MODE_VALUES)[number];\n\nexport const PLAN_STEP_STATUS_VALUES = [\n \"pending\",\n \"in_progress\",\n \"completed\",\n \"blocked\",\n \"skipped\",\n \"superseded\",\n] as const;\nexport type PlanStepStatus = (typeof PLAN_STEP_STATUS_VALUES)[number];\n\nexport const PLAN_HARNESS_VALUES = [\"codex\", \"claude-code\", \"cursor\", \"generic\"] as const;\nexport type PlanHarness = (typeof PLAN_HARNESS_VALUES)[number];\n\nexport const PLAN_STEP_LINK_KIND_VALUES = [\n \"related\",\n \"blocks\",\n \"blocked_by\",\n \"depends_on\",\n \"discovered_from\",\n \"implements\",\n \"verifies\",\n \"supersedes\",\n] as const;\nexport type PlanStepLinkKind = (typeof PLAN_STEP_LINK_KIND_VALUES)[number];\n\nexport interface PlanStepLink {\n id: string;\n kind: PlanStepLinkKind;\n note?: string;\n required_before_step?: boolean;\n}\n\nexport interface PlanStepFile {\n path: string;\n scope?: LinkScope;\n note?: string;\n}\n\nexport interface PlanStepTest {\n command?: string;\n path?: string;\n note?: string;\n}\n\nexport interface PlanStepDoc {\n path: string;\n scope?: LinkScope;\n note?: string;\n}\n\nexport interface PlanStep {\n id: string;\n order: number;\n title: string;\n body?: string;\n status: PlanStepStatus;\n owner?: string;\n evidence?: string;\n blocked_reason?: string;\n superseded_by?: string;\n linked_items?: PlanStepLink[];\n files?: PlanStepFile[];\n tests?: PlanStepTest[];\n docs?: PlanStepDoc[];\n created_at: string;\n updated_at: string;\n completed_at?: string;\n}\n\nexport interface PlanDecision {\n ts: string;\n author: string;\n decision: string;\n rationale?: string;\n evidence?: string;\n step_id?: string;\n}\n\nexport interface PlanDiscovery {\n ts: string;\n author: string;\n text: string;\n step_id?: string;\n}\n\nexport interface PlanValidationCheck {\n text: string;\n command?: string;\n expected?: string;\n}\n\nexport interface ItemTypeOptionDefinition {\n key: string;\n values: string[];\n required?: boolean;\n aliases?: string[];\n description?: string;\n}\n\nexport interface ItemTypeCommandOptionPolicy {\n command: \"create\" | \"update\";\n option: string;\n required?: boolean;\n visible?: boolean;\n enabled?: boolean;\n}\n\nexport interface ItemTypeDefinition {\n name: string;\n folder?: string;\n aliases?: string[];\n required_create_fields?: string[];\n required_create_repeatables?: string[];\n options?: ItemTypeOptionDefinition[];\n command_option_policies?: ItemTypeCommandOptionPolicy[];\n}\n\nexport interface RuntimeStatusDefinition {\n id: string;\n aliases?: string[];\n roles?: RuntimeStatusRole[];\n description?: string;\n order?: number;\n}\n\nexport interface RuntimeFieldDefinition {\n key: string;\n metadata_key?: string;\n /**\n * @deprecated Use metadata_key.\n */\n front_matter_key?: string;\n cli_flag?: string;\n cli_aliases?: string[];\n description?: string;\n type?: RuntimeFieldType;\n commands?: RuntimeFieldCommand[];\n repeatable?: boolean;\n required?: boolean;\n required_on_create?: boolean;\n required_types?: string[];\n allow_unset?: boolean;\n}\n\nexport interface RuntimeWorkflowDefinition {\n draft_status?: string;\n open_status?: string;\n in_progress_status?: string;\n blocked_status?: string;\n close_status?: string;\n canceled_status?: string;\n}\n\nexport interface RuntimeSchemaFileConfig {\n types?: string;\n statuses?: string;\n fields?: string;\n workflows?: string;\n}\n\nexport interface RuntimeSchemaSettings {\n version: number;\n files: RuntimeSchemaFileConfig;\n statuses: RuntimeStatusDefinition[];\n fields: RuntimeFieldDefinition[];\n workflow: RuntimeWorkflowDefinition;\n unknown_field_policy: RuntimeUnknownFieldPolicy;\n}\n\nexport interface ItemTestRunSummary {\n run_id: string;\n kind: \"test\" | \"test-all\";\n status: \"passed\" | \"failed\" | \"stopped\" | \"canceled\";\n started_at: string;\n finished_at: string;\n recorded_at: string;\n attempt?: number;\n resumed_from?: string;\n passed: number;\n failed: number;\n skipped: number;\n items?: number;\n linked_tests?: number;\n fail_on_skipped_triggered?: boolean;\n}\n\nexport interface ItemMetadata {\n id: string;\n title: string;\n description: string;\n type: ItemType;\n source_type?: string;\n type_options?: Record<string, string>;\n status: ItemStatus;\n priority: 0 | 1 | 2 | 3 | 4;\n tags: string[];\n created_at: string;\n updated_at: string;\n deadline?: string;\n reminders?: Reminder[];\n events?: CalendarEvent[];\n closed_at?: string;\n assignee?: string;\n source_owner?: string;\n author?: string;\n estimated_minutes?: number;\n acceptance_criteria?: string;\n design?: string;\n external_ref?: string;\n definition_of_ready?: string;\n order?: number;\n goal?: string;\n objective?: string;\n value?: string;\n impact?: string;\n outcome?: string;\n why_now?: string;\n parent?: string;\n reviewer?: string;\n risk?: \"low\" | \"medium\" | \"high\" | \"critical\";\n confidence?: ConfidenceValue;\n sprint?: string;\n release?: string;\n blocked_by?: string;\n blocked_reason?: string;\n unblock_note?: string;\n reporter?: string;\n severity?: IssueSeverity;\n environment?: string;\n repro_steps?: string;\n resolution?: string;\n expected_result?: string;\n actual_result?: string;\n affected_version?: string;\n fixed_version?: string;\n component?: string;\n regression?: boolean;\n customer_impact?: string;\n dependencies?: Dependency[];\n comments?: Comment[];\n notes?: LogNote[];\n learnings?: LogNote[];\n files?: LinkedFile[];\n tests?: LinkedTest[];\n test_runs?: ItemTestRunSummary[];\n docs?: LinkedDoc[];\n close_reason?: string;\n plan_mode?: PlanMode;\n plan_scope?: string;\n plan_harness?: PlanHarness;\n plan_steps?: PlanStep[];\n plan_decisions?: PlanDecision[];\n plan_discoveries?: PlanDiscovery[];\n plan_validation?: PlanValidationCheck[];\n plan_resume_context?: string;\n [key: string]: unknown;\n}\n\n/**\n * @deprecated Use ItemMetadata.\n */\nexport type ItemFrontMatter = ItemMetadata;\n\nexport interface ItemDocument {\n metadata: ItemMetadata;\n body: string;\n}\n\nexport interface HistoryPatchOp {\n op: \"add\" | \"remove\" | \"replace\" | \"move\" | \"copy\" | \"test\";\n path: string;\n from?: string;\n value?: unknown;\n}\n\nexport interface HistoryEntry {\n ts: string;\n author: string;\n op: string;\n patch: HistoryPatchOp[];\n before_hash: string;\n after_hash: string;\n message?: string;\n}\n\nexport const CONTEXT_DEPTH_VALUES = [\"brief\", \"standard\", \"deep\"] as const;\nexport type ContextDepth = (typeof CONTEXT_DEPTH_VALUES)[number];\n\nexport const CONTEXT_SECTION_VALUES = [\n \"hierarchy\",\n \"activity\",\n \"progress\",\n \"blockers\",\n \"files\",\n \"workload\",\n \"staleness\",\n \"tests\",\n] as const;\nexport type ContextSectionName = (typeof CONTEXT_SECTION_VALUES)[number];\n\nexport interface ContextSectionSettings {\n hierarchy: boolean;\n activity: boolean;\n progress: boolean;\n blockers: boolean;\n files: boolean;\n workload: boolean;\n staleness: boolean;\n tests: boolean;\n}\n\nexport interface ContextSettings {\n default_depth: ContextDepth;\n activity_limit: number;\n stale_threshold_days: number;\n sections: ContextSectionSettings;\n}\n\nexport interface GovernanceSettings {\n preset: GovernancePreset;\n ownership_enforcement: GovernanceOwnershipEnforcement;\n create_mode_default: GovernanceCreateModeDefault;\n close_validation_default: GovernanceCloseValidationDefault;\n parent_reference: ParentReferencePolicy;\n metadata_profile: ValidateMetadataProfile;\n force_required_for_stale_lock: boolean;\n create_default_type?: string;\n}\n\nexport type ExtensionPolicyMode = \"off\" | \"warn\" | \"enforce\";\nexport type ExtensionTrustMode = \"off\" | \"warn\" | \"enforce\";\nexport type ExtensionSandboxProfile = \"none\" | \"restricted\" | \"strict\";\n\nexport interface ExtensionPolicyOverrideSettings {\n name: string;\n disabled?: boolean;\n require_trusted?: boolean;\n require_provenance?: boolean;\n sandbox_profile?: ExtensionSandboxProfile;\n allowed_capabilities?: string[];\n blocked_capabilities?: string[];\n allowed_surfaces?: string[];\n blocked_surfaces?: string[];\n allowed_commands?: string[];\n blocked_commands?: string[];\n allowed_actions?: string[];\n blocked_actions?: string[];\n allowed_services?: string[];\n blocked_services?: string[];\n}\n\nexport interface ExtensionPolicySettings {\n mode: ExtensionPolicyMode;\n trust_mode: ExtensionTrustMode;\n require_provenance: boolean;\n trusted_extensions: string[];\n default_sandbox_profile: ExtensionSandboxProfile;\n allowed_extensions: string[];\n blocked_extensions: string[];\n allowed_capabilities: string[];\n blocked_capabilities: string[];\n allowed_surfaces: string[];\n blocked_surfaces: string[];\n allowed_commands: string[];\n blocked_commands: string[];\n allowed_actions: string[];\n blocked_actions: string[];\n allowed_services: string[];\n blocked_services: string[];\n extension_overrides: ExtensionPolicyOverrideSettings[];\n}\n\nexport interface AgentGuidanceSettings {\n prompt_completed: boolean;\n declined: boolean;\n declined_at: string;\n template_version: number;\n last_checked_files: string[];\n}\n\nexport type SearchMutationRefreshPolicy = \"cache_only\" | \"semantic_configured\" | \"semantic_auto\";\n\nexport interface PmSettings {\n version: number;\n id_prefix: string;\n author_default: string;\n item_format: ItemFormat;\n locks: {\n ttl_seconds: number;\n };\n output: {\n default_format: \"toon\" | \"json\";\n };\n history: {\n missing_stream: \"auto_create\" | \"strict_error\";\n };\n validation: {\n sprint_release_format: SprintReleaseFormatPolicy;\n parent_reference: ParentReferencePolicy;\n metadata_profile: ValidateMetadataProfile;\n metadata_required_fields: ValidateMetadataRequiredField[];\n lifecycle_stale_blocker_reason_patterns: string[];\n lifecycle_closure_like_blocked_reason_patterns: string[];\n lifecycle_closure_like_resolution_patterns: string[];\n lifecycle_closure_like_actual_result_patterns: string[];\n };\n governance: GovernanceSettings;\n workflow: {\n definition_of_done: string[];\n };\n testing: {\n record_results_to_items: boolean;\n };\n telemetry: {\n enabled: boolean;\n first_run_prompt_completed: boolean;\n capture_level: \"minimal\" | \"redacted\" | \"max\";\n endpoint: string;\n installation_id: string;\n retention_days: number;\n };\n agent_guidance: AgentGuidanceSettings;\n item_types: {\n definitions: ItemTypeDefinition[];\n };\n schema: RuntimeSchemaSettings;\n extensions: {\n enabled: string[];\n disabled: string[];\n policy: ExtensionPolicySettings;\n };\n search: {\n score_threshold: number;\n hybrid_semantic_weight: number;\n max_results: number;\n embedding_model: string;\n embedding_batch_size: number;\n embedding_timeout_ms: number;\n scanner_max_batch_retries: number;\n provider?: string;\n mutation_refresh_policy: SearchMutationRefreshPolicy;\n tuning?: {\n title_exact_bonus?: number;\n title_weight?: number;\n description_weight?: number;\n tags_weight?: number;\n status_weight?: number;\n body_weight?: number;\n comments_weight?: number;\n notes_weight?: number;\n learnings_weight?: number;\n dependencies_weight?: number;\n linked_content_weight?: number;\n };\n };\n providers: {\n openai: {\n base_url: string;\n api_key: string;\n model: string;\n };\n ollama: {\n base_url: string;\n model: string;\n };\n };\n context: ContextSettings;\n vector_store: {\n adapter?: string;\n qdrant: {\n url: string;\n api_key: string;\n };\n lancedb: {\n path: string;\n };\n };\n}\n"],"names":[],"mappings":";;AAAA,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,MAAM;IACN,SAAS;IACT,MAAM;IACN,OAAO;IACP,OAAO;IACP,UAAU;IACV,OAAO;IACP,UAAU;IACV,WAAW;IACX,SAAS;IACT,MAAM;CACE,CAAC;AACX,MAAM,CAAC,MAAM,gBAAgB,GAAG,wBAAwB,CAAC;AAIzD,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,OAAO;IACP,MAAM;IACN,aAAa;IACb,SAAS;IACT,QAAQ;IACR,UAAU;CACF,CAAC;AAGX,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,OAAO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,CAAC,MAAM,mBAAmB,GAAG,CAAC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,SAAS,CAAU,CAAC;AAG1F,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,SAAS;IACT,QAAQ;IACR,YAAY;IACZ,YAAY;IACZ,iBAAiB;IACjB,YAAY;IACZ,UAAU;IACV,YAAY;CACJ,CAAC;AAuQX,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,OAAO,EAAE,UAAU,EAAE,MAAM,CAAU,CAAC;AAG3E,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,WAAW;IACX,UAAU;IACV,UAAU;IACV,UAAU;IACV,OAAO;IACP,UAAU;IACV,WAAW;IACX,OAAO;CACC,CAAC","debugId":"026a0266-59b3-5570-af68-9a56d4113da2"}
@@ -48,6 +48,13 @@ Priority accepts either numeric `0..4` or named aliases `critical`, `high`, `med
48
48
 
49
49
  Repeated singular/plural list flags accumulate, so `--tag a --tag b` is equivalent to `--tags a,b` (same for `--status` and `--fields` on read commands). You no longer have to pre-join values into one comma list.
50
50
 
51
+ `--tags` REPLACES the whole tag list. To edit tags without restating the full set, prefer `--add-tags <value>` (adds without replacing) and `--remove-tags <value>` (prunes) on `create`/`update`/`update-many` (both repeatable; CSV or JSON-array). `--remove-tags` is `update`/`update-many` only. Also note `--expected`/`--actual` are short aliases for `--expected-result`/`--actual-result` on these commands, matching `pm close`.
52
+
53
+ ```bash
54
+ pm update <item-id> --add-tags urgent,backend # keep existing tags, add two
55
+ pm update <item-id> --remove-tags stale # drop one, keep the rest
56
+ ```
57
+
51
58
  Create hierarchy from broad to narrow: `Epic` -> `Feature` -> `Task` or `Issue`. Use `--parent <id>` for child items.
52
59
 
53
60
  3. **Claim**
package/docs/COMMANDS.md CHANGED
@@ -129,6 +129,17 @@ pm create \
129
129
 
130
130
  Repeated singular/plural list flags now accumulate, so `--tag a --tag b` is equivalent to `--tags a,b` (the same holds for `--status` and `--fields` on read commands). Earlier versions silently kept only the last value.
131
131
 
132
+ `--tags` REPLACES the whole tag list. To edit tags without restating the full set, use the additive/subtractive flags on `create`/`update`/`update-many`:
133
+
134
+ - `--add-tags <value>` adds tags to the existing list without replacing it (repeatable; CSV or JSON-array values accepted).
135
+ - `--remove-tags <value>` prunes the given tags from the existing list (repeatable; CSV or JSON-array). Available on `update`/`update-many` only — `create` has no prior tags to remove.
136
+
137
+ ```bash
138
+ pm update pm-abc1 --add-tags urgent,backend # keeps existing tags, adds two
139
+ pm update pm-abc1 --remove-tags stale # drops "stale", keeps the rest
140
+ pm create "New backend task" --add-tags backend,p1
141
+ ```
142
+
132
143
  Update existing work:
133
144
 
134
145
  ```bash
@@ -138,6 +149,12 @@ pm update <id> --parent <parent-id>
138
149
  pm append <id> --body "Detailed implementation notes."
139
150
  ```
140
151
 
152
+ `--expected` and `--actual` are short aliases for `--expected-result` and `--actual-result` on `create`/`update`/`update-many`, matching the aliases `pm close` already accepts:
153
+
154
+ ```bash
155
+ pm update <id> --expected "Retry succeeds after backoff" --actual "Retry threw on first attempt"
156
+ ```
157
+
141
158
  Mutation commands (`create`/`update`/`close`/`append`/...) echo a `changed_fields` array. In high-volume agent loops that array is mostly redundant with the item echo above it, so pass the global `--no-changed-fields` flag to replace it with a compact `changed_field_count`:
142
159
 
143
160
  ```bash
@@ -134,14 +134,80 @@ Semantic and hybrid search can use built-in OpenAI-compatible or Ollama provider
134
134
 
135
135
  For local Ollama or slower embedding providers, tune `search.embedding_batch_size`, `search.embedding_timeout_ms`, and `search.scanner_max_batch_retries` in project config before assuming semantic search is broken. Keyword search remains the fast baseline while semantic indexing catches up.
136
136
 
137
+ Mutation commands invalidate keyword search caches immediately. Semantic vector refresh is controlled by `search.mutation_refresh_policy`:
138
+
139
+ | Policy | Behavior |
140
+ |--------|----------|
141
+ | `semantic_configured` | default; refresh vectors during mutations only when semantic provider/store settings are explicitly configured |
142
+ | `cache_only` | fastest writes; invalidate keyword caches and leave vector refresh to `pm reindex` or `pm health --refresh-vectors` |
143
+ | `semantic_auto` | also apply implicit local Ollama/LanceDB defaults during mutations |
144
+
137
145
  Useful commands:
138
146
 
139
147
  ```bash
148
+ pm config project set search_mutation_refresh_policy cache_only
140
149
  pm search "calendar reminders" --mode hybrid --limit 10
141
150
  pm reindex --mode hybrid --progress
142
151
  pm health --check-only
143
152
  ```
144
153
 
154
+ ### Custom search providers
155
+
156
+ pm supports any OpenAI-compatible API or Ollama-style provider via configuration. No code changes needed. Each leaf below can be set with `pm config <scope> set <key> <value>` (the corresponding `settings.json` dotted path is shown in parentheses).
157
+
158
+ **Ollama** (local, default for offline embedding):
159
+
160
+ ```bash
161
+ pm config project set ollama_base_url http://localhost:11434
162
+ pm config project set ollama_model nomic-embed-text
163
+ pm config project set search_provider ollama
164
+ ```
165
+
166
+ **OpenAI**:
167
+
168
+ ```bash
169
+ pm config project set openai_base_url https://api.openai.com/v1
170
+ pm config project set openai_api_key '<OPENAI_API_KEY>'
171
+ pm config project set openai_model text-embedding-3-small
172
+ pm config project set search_provider openai
173
+ ```
174
+
175
+ The base URL defaults to empty, so it must be set explicitly even for the canonical OpenAI endpoint.
176
+
177
+ **LM Studio (OpenAI-compatible)** — point pm at LM Studio's local OpenAI-compatible endpoint:
178
+
179
+ ```bash
180
+ pm config project set openai_base_url http://localhost:1234/v1
181
+ pm config project set openai_model nomic-embed-text-v1.5
182
+ pm config project set search_provider openai
183
+ ```
184
+
185
+ Set `openai_api_key` to any non-empty value if LM Studio is configured to require one.
186
+
187
+ **vLLM (OpenAI-compatible)** — point pm at a vLLM server serving an embedding model:
188
+
189
+ ```bash
190
+ pm config project set openai_base_url http://localhost:8000/v1
191
+ pm config project set openai_model BAAI/bge-large-en-v1.5
192
+ pm config project set search_provider openai
193
+ ```
194
+
195
+ **Vector store** — choose where vector embeddings live. LanceDB is file-backed and zero-setup; Qdrant runs as a service:
196
+
197
+ ```bash
198
+ pm config project set vector_store_adapter lancedb
199
+ pm config project set lancedb_path .agents/pm/search/lancedb
200
+
201
+ # or, with Qdrant:
202
+ pm config project set vector_store_adapter qdrant
203
+ pm config project set qdrant_url http://localhost:6333
204
+ pm config project set qdrant_api_key '<QDRANT_API_KEY>' # omit on unauthenticated dev servers
205
+ ```
206
+
207
+ After changing any of these, run `pm reindex --mode hybrid` so the vector index reflects the new provider/store. `pm search ... --mode semantic|hybrid` emits a `vector_index_stale` warning when items have been modified since the last reindex.
208
+
209
+ **Refresh contract (important for agents):** by default a mutation (`pm create`/`pm update`) does **not** synchronously re-embed the changed item, so a brand-new item is absent from `--mode semantic|hybrid` results until the next `pm reindex`. This keeps writes fast. Control the tradeoff with `search.mutation_refresh_policy`: `cache_only` (never refresh on write — fastest), `semantic_auto` (refresh when implicit Ollama/LanceDB defaults are active), or `semantic_configured` (refresh only when semantic search is explicitly configured). Keyword mode (`--mode keyword`, the default) always reflects writes immediately because it reads items directly.
210
+
145
211
  ## Custom Item Types
146
212
 
147
213
  Custom item types can be defined in settings and by extensions. Runtime type resolution affects create/update validation, list/search/calendar filters, completions, and storage folders.
@@ -93,10 +93,13 @@ pm search "restore lock retry" --limit 10
93
93
  pm list-open --limit 20
94
94
  pm claim <item-id>
95
95
  pm update <item-id> --status in_progress --message "Start implementation"
96
+ pm update <item-id> --add-tags urgent,backend
96
97
  ```
97
98
 
98
99
  Do not create a duplicate item until `context`, `search`, and list commands show no relevant active item.
99
100
 
101
+ `--tags` replaces the whole tag list; use `--add-tags <value>` to add tags without replacing them and `--remove-tags <value>` to prune them (both on `update`/`update-many`; `create` supports `--add-tags`). On `create`/`update`/`update-many`, `--expected`/`--actual` are short aliases for `--expected-result`/`--actual-result`.
102
+
100
103
  ## Link Work Artifacts
101
104
 
102
105
  ```bash
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unbrained/pm-cli",
3
- "version": "2026.5.28",
3
+ "version": "2026.5.30",
4
4
  "description": "Git-native project management CLI for humans and agents.",
5
5
  "type": "module",
6
6
  "author": "unbrained",
@@ -53,6 +53,7 @@
53
53
  ".claude-plugin/**",
54
54
  "plugins/**",
55
55
  "packages/pm-*/**",
56
+ "scripts/bundle-cli.mjs",
56
57
  "scripts/finalize-build.mjs",
57
58
  "scripts/install.sh",
58
59
  "scripts/install.ps1",
@@ -60,7 +61,7 @@
60
61
  "marketplace.json"
61
62
  ],
62
63
  "scripts": {
63
- "build": "node scripts/prepare-build-cache.mjs && tsc -p tsconfig.json && node scripts/finalize-build.mjs",
64
+ "build": "node scripts/prepare-build-cache.mjs && tsc -p tsconfig.json && node scripts/bundle-cli.mjs && node scripts/finalize-build.mjs",
64
65
  "typecheck": "tsc --noEmit -p tsconfig.json && tsc -p tsconfig.packages.json",
65
66
  "start": "node dist/cli.js",
66
67
  "dev": "tsx src/cli.ts",
@@ -114,7 +115,7 @@
114
115
  }
115
116
  },
116
117
  "dependencies": {
117
- "@sentry/node": "^10.54.0",
118
+ "@sentry/node": "^10.55.0",
118
119
  "@toon-format/toon": "^2.3.0",
119
120
  "commander": "^14.0.3",
120
121
  "fast-glob": "^3.3.3",
@@ -125,13 +126,15 @@
125
126
  "@types/node": "^25.9.1",
126
127
  "@vitest/coverage-v8": "^4.1.7",
127
128
  "c8": "^11.0.0",
129
+ "esbuild": "0.28.0",
128
130
  "tsx": "^4.22.3",
129
131
  "typescript": "^6.0.3",
130
132
  "vitest": "^4.1.7"
131
133
  },
132
134
  "pnpm": {
133
135
  "onlyBuiltDependencies": [
134
- "@sentry/cli"
136
+ "@sentry/cli",
137
+ "esbuild"
135
138
  ],
136
139
  "overrides": {
137
140
  "rollup": ">=4.59.0",
@@ -53,6 +53,17 @@ function normalizeCalendarView(arg) {
53
53
  return CALENDAR_VIEW_NAMES.includes(normalized) ? normalized : null;
54
54
  }
55
55
 
56
+ // A positional that looks like a date/time anchor rather than a view name:
57
+ // ISO/hyphenated or compact dates (optionally with a time), the keyword "now",
58
+ // or a relative token (+7d/+6h/+2w/+1m). These are the same forms the runtime's
59
+ // --date parser accepts, so we re-route them to --date instead of hard-erroring
60
+ // "view must be agenda|day|week|month" — `pm calendar 2026-06-15` just works.
61
+ const DATE_LIKE_POSITIONAL = /^(?:\d{4}-\d{2}-\d{2}(?:[T Z+].*)?|\d{8}(?:[T ]?\d.*)?|now|\+\d+[hdwm])$/i;
62
+
63
+ function isDateLikePositional(arg) {
64
+ return normalizeCalendarView(arg) === null && DATE_LIKE_POSITIONAL.test(arg);
65
+ }
66
+
56
67
  function buildPositionalViewError(positionalArgs) {
57
68
  const received = positionalArgs.map((arg) => arg.trim()).filter((arg) => arg.length > 0);
58
69
  const receivedList = received.join(", ");
@@ -94,10 +105,24 @@ function calendarCommand(name) {
94
105
  if (positionalArgs.length > 1) {
95
106
  throw buildPositionalViewError(positionalArgs);
96
107
  }
108
+ const baseOptions = context.options;
109
+ // Route a date-like positional (`pm calendar 2026-06-15`, `pm calendar +7d`)
110
+ // to --date with a day view instead of failing as an invalid view name. An
111
+ // explicit --date or --view always wins so nothing already-specified is lost.
112
+ if (positionalView && isDateLikePositional(positionalView)) {
113
+ return runCalendarPackage(
114
+ {
115
+ ...baseOptions,
116
+ ...(baseOptions.date === undefined ? { date: positionalView } : {}),
117
+ ...(baseOptions.view === undefined ? { view: "day" } : {}),
118
+ },
119
+ context.global,
120
+ );
121
+ }
97
122
  return runCalendarPackage(
98
123
  {
99
- ...context.options,
100
- ...(positionalView && context.options.view === undefined ? { view: positionalView } : {}),
124
+ ...baseOptions,
125
+ ...(positionalView && baseOptions.view === undefined ? { view: positionalView } : {}),
101
126
  },
102
127
  context.global,
103
128
  );
@@ -62,6 +62,18 @@ function normalizeCalendarView(arg: string): (typeof CALENDAR_VIEW_NAMES)[number
62
62
  : null;
63
63
  }
64
64
 
65
+ // A positional that looks like a date/time anchor rather than a view name:
66
+ // ISO/hyphenated or compact dates (optionally with a time), the keyword "now",
67
+ // or a relative token (+7d/+6h/+2w/+1m). These are the same forms the runtime's
68
+ // --date parser accepts, so we re-route them to --date instead of hard-erroring
69
+ // "view must be agenda|day|week|month" — `pm calendar 2026-06-15` just works.
70
+ const DATE_LIKE_POSITIONAL =
71
+ /^(?:\d{4}-\d{2}-\d{2}(?:[T Z+].*)?|\d{8}(?:[T ]?\d.*)?|now|\+\d+[hdwm])$/i;
72
+
73
+ function isDateLikePositional(arg: string): boolean {
74
+ return normalizeCalendarView(arg) === null && DATE_LIKE_POSITIONAL.test(arg);
75
+ }
76
+
65
77
  function buildPositionalViewError(positionalArgs: readonly string[]): PmCliError {
66
78
  const received = positionalArgs.map((arg) => arg.trim()).filter((arg) => arg.length > 0);
67
79
  const receivedList = received.join(", ");
@@ -105,10 +117,24 @@ function calendarCommand(name: "calendar" | "cal"): CommandDefinition {
105
117
  if (positionalArgs.length > 1) {
106
118
  throw buildPositionalViewError(positionalArgs);
107
119
  }
120
+ const baseOptions = context.options as CalendarOptions;
121
+ // Route a date-like positional (`pm calendar 2026-06-15`, `pm calendar +7d`)
122
+ // to --date with a day view instead of failing as an invalid view name. An
123
+ // explicit --date or --view always wins so nothing already-specified is lost.
124
+ if (positionalView && isDateLikePositional(positionalView)) {
125
+ return runCalendarPackage(
126
+ {
127
+ ...baseOptions,
128
+ ...(baseOptions.date === undefined ? { date: positionalView } : {}),
129
+ ...(baseOptions.view === undefined ? { view: "day" } : {}),
130
+ },
131
+ context.global,
132
+ );
133
+ }
108
134
  return runCalendarPackage(
109
135
  {
110
- ...(context.options as CalendarOptions),
111
- ...(positionalView && (context.options as CalendarOptions).view === undefined ? { view: positionalView } : {}),
136
+ ...baseOptions,
137
+ ...(positionalView && baseOptions.view === undefined ? { view: positionalView } : {}),
112
138
  },
113
139
  context.global,
114
140
  );
@@ -29,6 +29,7 @@ async function loadCalendarCoreModule() {
29
29
  if (
30
30
  typeof loaded.runCalendar === "function" &&
31
31
  typeof loaded.renderCalendarMarkdown === "function" &&
32
+ typeof loaded.renderCalendarToon === "function" &&
32
33
  typeof loaded.resolveCalendarOutputFormat === "function"
33
34
  ) {
34
35
  return loaded;
@@ -111,5 +112,9 @@ export function renderCalendarPackageOutput(context) {
111
112
  if (outputFormat === "json" || readPayloadFormat(context.payload) === "json") {
112
113
  return `${JSON.stringify(result, null, 2)}\n`;
113
114
  }
115
+ if (outputFormat === "toon") {
116
+ const rendered = calendarCore.renderCalendarToon(result);
117
+ return rendered.endsWith("\n") ? rendered : `${rendered}\n`;
118
+ }
114
119
  return null;
115
120
  }
@@ -8,6 +8,7 @@ const PM_PACKAGE_ROOT_ENV = "PM_CLI_PACKAGE_ROOT";
8
8
  interface CalendarCoreModule {
9
9
  runCalendar: (options: CalendarOptions, global: GlobalOptions) => Promise<CalendarResult>;
10
10
  renderCalendarMarkdown: (result: CalendarResult) => string;
11
+ renderCalendarToon: (result: CalendarResult) => string;
11
12
  resolveCalendarOutputFormat: (options: CalendarOptions, global: GlobalOptions) => "markdown" | "toon" | "json";
12
13
  }
13
14
 
@@ -38,6 +39,7 @@ async function loadCalendarCoreModule(): Promise<CalendarCoreModule> {
38
39
  if (
39
40
  typeof loaded.runCalendar === "function" &&
40
41
  typeof loaded.renderCalendarMarkdown === "function" &&
42
+ typeof loaded.renderCalendarToon === "function" &&
41
43
  typeof loaded.resolveCalendarOutputFormat === "function"
42
44
  ) {
43
45
  return loaded as CalendarCoreModule;
@@ -120,5 +122,9 @@ export function renderCalendarPackageOutput(context: ServiceOverrideContext): st
120
122
  if (outputFormat === "json" || readPayloadFormat(context.payload) === "json") {
121
123
  return `${JSON.stringify(result, null, 2)}\n`;
122
124
  }
125
+ if (outputFormat === "toon") {
126
+ const rendered = calendarCore.renderCalendarToon(result);
127
+ return rendered.endsWith("\n") ? rendered : `${rendered}\n`;
128
+ }
123
129
  return null;
124
130
  }
@@ -0,0 +1,39 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { readFile, rm, writeFile } from "node:fs/promises";
4
+ import path from "node:path";
5
+ import { build } from "esbuild";
6
+
7
+ const repoRoot = process.cwd();
8
+ const entryPoint = path.join(repoRoot, "dist", "cli", "main.js");
9
+ const outputDir = path.join(repoRoot, "dist", "cli-bundle");
10
+ const binPath = path.join(repoRoot, "dist", "cli.js");
11
+
12
+ await rm(outputDir, { recursive: true, force: true });
13
+
14
+ await build({
15
+ entryPoints: [entryPoint],
16
+ outdir: outputDir,
17
+ bundle: true,
18
+ splitting: true,
19
+ format: "esm",
20
+ platform: "node",
21
+ target: ["node20"],
22
+ packages: "external",
23
+ sourcemap: true,
24
+ entryNames: "[name]",
25
+ chunkNames: "chunks/[name]-[hash]",
26
+ logLevel: "warning",
27
+ });
28
+
29
+ const binSource = await readFile(binPath, "utf8");
30
+ const sourceImport = 'await import("./cli/main.js")';
31
+ const bundledImport = 'await import("./cli-bundle/main.js")';
32
+ if (binSource.includes(bundledImport)) {
33
+ process.exit(0);
34
+ }
35
+ const bundledBinSource = binSource.replace(sourceImport, bundledImport);
36
+ if (bundledBinSource === binSource) {
37
+ throw new Error("Unable to rewrite dist/cli.js to use the bundled CLI entrypoint.");
38
+ }
39
+ await writeFile(binPath, bundledBinSource, "utf8");