@unbrained/pm-cli 2026.5.29 → 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 (100) hide show
  1. package/CHANGELOG.md +29 -12
  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/commands/activity.js +4 -4
  6. package/dist/cli/commands/activity.js.map +1 -1
  7. package/dist/cli/commands/calendar.js +4 -4
  8. package/dist/cli/commands/calendar.js.map +1 -1
  9. package/dist/cli/commands/close.js +4 -4
  10. package/dist/cli/commands/close.js.map +1 -1
  11. package/dist/cli/commands/completion.js +4 -4
  12. package/dist/cli/commands/completion.js.map +1 -1
  13. package/dist/cli/commands/create.js +18 -5
  14. package/dist/cli/commands/create.js.map +1 -1
  15. package/dist/cli/commands/deps.js +4 -4
  16. package/dist/cli/commands/deps.js.map +1 -1
  17. package/dist/cli/commands/extension/install-sources.d.ts +1 -0
  18. package/dist/cli/commands/extension/install-sources.js +20 -2
  19. package/dist/cli/commands/extension/install-sources.js.map +1 -1
  20. package/dist/cli/commands/extension.js +26 -5
  21. package/dist/cli/commands/extension.js.map +1 -1
  22. package/dist/cli/commands/get.js +6 -3
  23. package/dist/cli/commands/get.js.map +1 -1
  24. package/dist/cli/commands/list.js +25 -6
  25. package/dist/cli/commands/list.js.map +1 -1
  26. package/dist/cli/commands/search.js +3 -3
  27. package/dist/cli/commands/search.js.map +1 -1
  28. package/dist/cli/commands/stats.js +4 -4
  29. package/dist/cli/commands/stats.js.map +1 -1
  30. package/dist/cli/commands/test-all.js +4 -4
  31. package/dist/cli/commands/test-all.js.map +1 -1
  32. package/dist/cli/main.d.ts +2 -0
  33. package/dist/cli/main.js +39 -11
  34. package/dist/cli/main.js.map +1 -1
  35. package/dist/cli/register-list-query.js +3 -3
  36. package/dist/cli/register-list-query.js.map +1 -1
  37. package/dist/cli/register-setup.js +3 -3
  38. package/dist/cli/register-setup.js.map +1 -1
  39. package/dist/cli-bundle/chunks/chunk-PB2YU2E3.js +164 -0
  40. package/dist/cli-bundle/chunks/chunk-PB2YU2E3.js.map +7 -0
  41. package/dist/cli-bundle/chunks/chunk-RJONRNXN.js +682 -0
  42. package/dist/cli-bundle/chunks/chunk-RJONRNXN.js.map +7 -0
  43. package/dist/cli-bundle/chunks/chunk-SW5BMMCU.js +13864 -0
  44. package/dist/cli-bundle/chunks/chunk-SW5BMMCU.js.map +7 -0
  45. package/dist/cli-bundle/chunks/commands-XJ4TJ5UN.js +24225 -0
  46. package/dist/cli-bundle/chunks/commands-XJ4TJ5UN.js.map +7 -0
  47. package/dist/cli-bundle/chunks/register-list-query-EIVQ5FMR.js +223 -0
  48. package/dist/cli-bundle/chunks/register-list-query-EIVQ5FMR.js.map +7 -0
  49. package/dist/cli-bundle/chunks/register-mutation-RSZNPSGI.js +702 -0
  50. package/dist/cli-bundle/chunks/register-mutation-RSZNPSGI.js.map +7 -0
  51. package/dist/cli-bundle/chunks/register-operations-APUSYDMR.js +355 -0
  52. package/dist/cli-bundle/chunks/register-operations-APUSYDMR.js.map +7 -0
  53. package/dist/cli-bundle/chunks/register-setup-OZOKSMPJ.js +237 -0
  54. package/dist/cli-bundle/chunks/register-setup-OZOKSMPJ.js.map +7 -0
  55. package/dist/cli-bundle/main.js +6896 -0
  56. package/dist/cli-bundle/main.js.map +7 -0
  57. package/dist/cli.js +1 -1
  58. package/dist/core/config/nested-settings.d.ts +2 -0
  59. package/dist/core/config/nested-settings.js +17 -2
  60. package/dist/core/config/nested-settings.js.map +1 -1
  61. package/dist/core/item/type-synonyms.d.ts +20 -0
  62. package/dist/core/item/type-synonyms.js +42 -0
  63. package/dist/core/item/type-synonyms.js.map +1 -0
  64. package/dist/core/search/cache.js +46 -4
  65. package/dist/core/search/cache.js.map +1 -1
  66. package/dist/core/search/semantic-defaults.js +73 -32
  67. package/dist/core/search/semantic-defaults.js.map +1 -1
  68. package/dist/core/sentry/helpers.d.ts +1 -1
  69. package/dist/core/sentry/helpers.js +4 -4
  70. package/dist/core/sentry/helpers.js.map +1 -1
  71. package/dist/core/shared/constants.js +3 -2
  72. package/dist/core/shared/constants.js.map +1 -1
  73. package/dist/core/shared/html-entity-decode.d.ts +2 -1
  74. package/dist/core/shared/html-entity-decode.js +14 -9
  75. package/dist/core/shared/html-entity-decode.js.map +1 -1
  76. package/dist/core/shared/time.js +52 -2
  77. package/dist/core/shared/time.js.map +1 -1
  78. package/dist/core/store/front-matter-cache.d.ts +24 -0
  79. package/dist/core/store/front-matter-cache.js +119 -8
  80. package/dist/core/store/front-matter-cache.js.map +1 -1
  81. package/dist/core/store/item-store.d.ts +7 -0
  82. package/dist/core/store/item-store.js +13 -3
  83. package/dist/core/store/item-store.js.map +1 -1
  84. package/dist/core/store/settings-validator.d.ts +1 -0
  85. package/dist/core/store/settings-validator.js +3 -2
  86. package/dist/core/store/settings-validator.js.map +1 -1
  87. package/dist/core/store/settings.js +19 -3
  88. package/dist/core/store/settings.js.map +1 -1
  89. package/dist/mcp/server.js +3 -3
  90. package/dist/mcp/server.js.map +1 -1
  91. package/dist/sdk/cli-contracts.js +5 -5
  92. package/dist/sdk/cli-contracts.js.map +1 -1
  93. package/dist/types.d.ts +2 -0
  94. package/dist/types.js +2 -2
  95. package/dist/types.js.map +1 -1
  96. package/docs/CONFIGURATION.md +11 -0
  97. package/package.json +7 -4
  98. package/packages/pm-calendar/extensions/calendar/index.js +27 -2
  99. package/packages/pm-calendar/extensions/calendar/index.ts +28 -2
  100. package/scripts/bundle-cli.mjs +39 -0
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,C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IACV,WAAW;IACX,OAAO;CACC,CAAC","debugId":"68c1fa65-9fc4-5566-9c23-bdb17c35cb53"}
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 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,a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uB,GAAG;IACrC,SAAS;IACT,aAAa;IACb,WAAW;IACX,SAAS;IACT,SAAS;IACT,YAAY;CACJ,CAAC;AAGX,MAAM,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"}
@@ -134,9 +134,18 @@ 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
@@ -197,6 +206,8 @@ pm config project set qdrant_api_key '<QDRANT_API_KEY>' # omit on unauthentica
197
206
 
198
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.
199
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
+
200
211
  ## Custom Item Types
201
212
 
202
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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unbrained/pm-cli",
3
- "version": "2026.5.29",
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
  );
@@ -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");