openspecui 0.0.0 → 0.1.0

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 (323) hide show
  1. package/dist/cli.mjs +91 -0
  2. package/dist/index.mjs +3 -0
  3. package/dist/open-CmiqsyCQ.mjs +473 -0
  4. package/dist/src-CNuprcB-.mjs +13604 -0
  5. package/package.json +35 -7
  6. package/web/assets/index-BhzIZ_eQ.js +150 -0
  7. package/web/assets/index-D6x5Q1lW.css +1 -0
  8. package/web/dist/assets/index-BhzIZ_eQ.js +150 -0
  9. package/web/dist/assets/index-CqKOZnDE.css +1 -0
  10. package/web/dist/assets/index-D6x5Q1lW.css +1 -0
  11. package/web/dist/assets/index-Om_P2_SF.js +155 -0
  12. package/web/dist/index.html +14 -0
  13. package/web/index.html +14 -0
  14. package/.gitmodules +0 -3
  15. package/CHAT.md +0 -3
  16. package/references/openspec/.changeset/README.md +0 -6
  17. package/references/openspec/.changeset/config.json +0 -12
  18. package/references/openspec/.coderabbit.yaml +0 -11
  19. package/references/openspec/.devcontainer/README.md +0 -92
  20. package/references/openspec/.devcontainer/devcontainer.json +0 -68
  21. package/references/openspec/.github/CODEOWNERS +0 -2
  22. package/references/openspec/.github/workflows/ci.yml +0 -222
  23. package/references/openspec/.github/workflows/release-prepare.yml +0 -50
  24. package/references/openspec/AGENTS.md +0 -18
  25. package/references/openspec/CHANGELOG.md +0 -205
  26. package/references/openspec/LICENSE +0 -22
  27. package/references/openspec/README.md +0 -374
  28. package/references/openspec/assets/openspec_dashboard.png +0 -0
  29. package/references/openspec/assets/openspec_pixel_dark.svg +0 -89
  30. package/references/openspec/assets/openspec_pixel_light.svg +0 -89
  31. package/references/openspec/bin/openspec.js +0 -3
  32. package/references/openspec/build.js +0 -31
  33. package/references/openspec/openspec/AGENTS.md +0 -454
  34. package/references/openspec/openspec/changes/IMPLEMENTATION_ORDER.md +0 -68
  35. package/references/openspec/openspec/changes/add-antigravity-support/proposal.md +0 -11
  36. package/references/openspec/openspec/changes/add-antigravity-support/specs/cli-init/spec.md +0 -9
  37. package/references/openspec/openspec/changes/add-antigravity-support/specs/cli-update/spec.md +0 -8
  38. package/references/openspec/openspec/changes/add-antigravity-support/tasks.md +0 -12
  39. package/references/openspec/openspec/changes/add-scaffold-command/proposal.md +0 -11
  40. package/references/openspec/openspec/changes/add-scaffold-command/specs/cli-scaffold/spec.md +0 -36
  41. package/references/openspec/openspec/changes/add-scaffold-command/tasks.md +0 -12
  42. package/references/openspec/openspec/changes/archive/2025-01-11-add-update-command/design.md +0 -86
  43. package/references/openspec/openspec/changes/archive/2025-01-11-add-update-command/proposal.md +0 -29
  44. package/references/openspec/openspec/changes/archive/2025-01-11-add-update-command/specs/cli-update/spec.md +0 -59
  45. package/references/openspec/openspec/changes/archive/2025-01-11-add-update-command/tasks.md +0 -20
  46. package/references/openspec/openspec/changes/archive/2025-01-13-add-list-command/proposal.md +0 -20
  47. package/references/openspec/openspec/changes/archive/2025-01-13-add-list-command/specs/cli-list/spec.md +0 -69
  48. package/references/openspec/openspec/changes/archive/2025-01-13-add-list-command/tasks.md +0 -26
  49. package/references/openspec/openspec/changes/archive/2025-08-05-initialize-typescript-project/design.md +0 -64
  50. package/references/openspec/openspec/changes/archive/2025-08-05-initialize-typescript-project/proposal.md +0 -18
  51. package/references/openspec/openspec/changes/archive/2025-08-05-initialize-typescript-project/tasks.md +0 -25
  52. package/references/openspec/openspec/changes/archive/2025-08-06-add-init-command/design.md +0 -104
  53. package/references/openspec/openspec/changes/archive/2025-08-06-add-init-command/proposal.md +0 -30
  54. package/references/openspec/openspec/changes/archive/2025-08-06-add-init-command/specs/cli-init/spec.md +0 -148
  55. package/references/openspec/openspec/changes/archive/2025-08-06-add-init-command/tasks.md +0 -38
  56. package/references/openspec/openspec/changes/archive/2025-08-06-adopt-future-state-storage/proposal.md +0 -24
  57. package/references/openspec/openspec/changes/archive/2025-08-06-adopt-future-state-storage/specs/openspec-conventions/spec.md +0 -120
  58. package/references/openspec/openspec/changes/archive/2025-08-06-adopt-future-state-storage/tasks.md +0 -38
  59. package/references/openspec/openspec/changes/archive/2025-08-11-add-complexity-guidelines/proposal.md +0 -13
  60. package/references/openspec/openspec/changes/archive/2025-08-11-add-complexity-guidelines/specs/openspec-docs/README.md +0 -472
  61. package/references/openspec/openspec/changes/archive/2025-08-11-add-complexity-guidelines/tasks.md +0 -9
  62. package/references/openspec/openspec/changes/archive/2025-08-13-add-archive-command/proposal.md +0 -15
  63. package/references/openspec/openspec/changes/archive/2025-08-13-add-archive-command/specs/cli-archive/spec.md +0 -111
  64. package/references/openspec/openspec/changes/archive/2025-08-13-add-archive-command/tasks.md +0 -44
  65. package/references/openspec/openspec/changes/archive/2025-08-13-add-diff-command/proposal.md +0 -19
  66. package/references/openspec/openspec/changes/archive/2025-08-13-add-diff-command/specs/cli-diff/spec.md +0 -77
  67. package/references/openspec/openspec/changes/archive/2025-08-13-add-diff-command/tasks.md +0 -23
  68. package/references/openspec/openspec/changes/archive/2025-08-19-add-change-commands/design.md +0 -56
  69. package/references/openspec/openspec/changes/archive/2025-08-19-add-change-commands/proposal.md +0 -17
  70. package/references/openspec/openspec/changes/archive/2025-08-19-add-change-commands/specs/cli-change/spec.md +0 -48
  71. package/references/openspec/openspec/changes/archive/2025-08-19-add-change-commands/specs/cli-list/spec.md +0 -12
  72. package/references/openspec/openspec/changes/archive/2025-08-19-add-change-commands/tasks.md +0 -34
  73. package/references/openspec/openspec/changes/archive/2025-08-19-add-interactive-show-command/proposal.md +0 -20
  74. package/references/openspec/openspec/changes/archive/2025-08-19-add-interactive-show-command/specs/cli-change/spec.md +0 -23
  75. package/references/openspec/openspec/changes/archive/2025-08-19-add-interactive-show-command/specs/cli-show/spec.md +0 -83
  76. package/references/openspec/openspec/changes/archive/2025-08-19-add-interactive-show-command/specs/cli-spec/spec.md +0 -23
  77. package/references/openspec/openspec/changes/archive/2025-08-19-add-interactive-show-command/tasks.md +0 -142
  78. package/references/openspec/openspec/changes/archive/2025-08-19-add-skip-specs-archive-option/proposal.md +0 -13
  79. package/references/openspec/openspec/changes/archive/2025-08-19-add-skip-specs-archive-option/specs/cli-archive/spec.md +0 -191
  80. package/references/openspec/openspec/changes/archive/2025-08-19-add-skip-specs-archive-option/tasks.md +0 -57
  81. package/references/openspec/openspec/changes/archive/2025-08-19-add-spec-commands/design.md +0 -45
  82. package/references/openspec/openspec/changes/archive/2025-08-19-add-spec-commands/proposal.md +0 -19
  83. package/references/openspec/openspec/changes/archive/2025-08-19-add-spec-commands/specs/cli-spec/spec.md +0 -43
  84. package/references/openspec/openspec/changes/archive/2025-08-19-add-spec-commands/tasks.md +0 -22
  85. package/references/openspec/openspec/changes/archive/2025-08-19-add-zod-validation/design.md +0 -104
  86. package/references/openspec/openspec/changes/archive/2025-08-19-add-zod-validation/proposal.md +0 -22
  87. package/references/openspec/openspec/changes/archive/2025-08-19-add-zod-validation/specs/cli-archive/spec.md +0 -18
  88. package/references/openspec/openspec/changes/archive/2025-08-19-add-zod-validation/specs/cli-diff/spec.md +0 -12
  89. package/references/openspec/openspec/changes/archive/2025-08-19-add-zod-validation/tasks.md +0 -59
  90. package/references/openspec/openspec/changes/archive/2025-08-19-adopt-delta-based-changes/proposal.md +0 -93
  91. package/references/openspec/openspec/changes/archive/2025-08-19-adopt-delta-based-changes/specs/cli-archive/spec.md +0 -48
  92. package/references/openspec/openspec/changes/archive/2025-08-19-adopt-delta-based-changes/specs/cli-diff/spec.md +0 -45
  93. package/references/openspec/openspec/changes/archive/2025-08-19-adopt-delta-based-changes/specs/openspec-conventions/spec.md +0 -101
  94. package/references/openspec/openspec/changes/archive/2025-08-19-adopt-delta-based-changes/tasks.md +0 -55
  95. package/references/openspec/openspec/changes/archive/2025-08-19-adopt-verb-noun-cli-structure/design.md +0 -19
  96. package/references/openspec/openspec/changes/archive/2025-08-19-adopt-verb-noun-cli-structure/proposal.md +0 -67
  97. package/references/openspec/openspec/changes/archive/2025-08-19-adopt-verb-noun-cli-structure/specs/cli-list/spec.md +0 -57
  98. package/references/openspec/openspec/changes/archive/2025-08-19-adopt-verb-noun-cli-structure/specs/openspec-conventions/spec.md +0 -23
  99. package/references/openspec/openspec/changes/archive/2025-08-19-adopt-verb-noun-cli-structure/tasks.md +0 -27
  100. package/references/openspec/openspec/changes/archive/2025-08-19-bulk-validation-interactive-selection/proposal.md +0 -20
  101. package/references/openspec/openspec/changes/archive/2025-08-19-bulk-validation-interactive-selection/specs/cli-change/spec.md +0 -22
  102. package/references/openspec/openspec/changes/archive/2025-08-19-bulk-validation-interactive-selection/specs/cli-spec/spec.md +0 -23
  103. package/references/openspec/openspec/changes/archive/2025-08-19-bulk-validation-interactive-selection/specs/cli-validate/spec.md +0 -149
  104. package/references/openspec/openspec/changes/archive/2025-08-19-bulk-validation-interactive-selection/tasks.md +0 -81
  105. package/references/openspec/openspec/changes/archive/2025-08-19-fix-update-tool-selection/proposal.md +0 -40
  106. package/references/openspec/openspec/changes/archive/2025-08-19-fix-update-tool-selection/specs/cli-update/spec.md +0 -23
  107. package/references/openspec/openspec/changes/archive/2025-08-19-fix-update-tool-selection/tasks.md +0 -21
  108. package/references/openspec/openspec/changes/archive/2025-08-19-improve-validate-error-messages/proposal.md +0 -25
  109. package/references/openspec/openspec/changes/archive/2025-08-19-improve-validate-error-messages/specs/cli-validate/spec.md +0 -55
  110. package/references/openspec/openspec/changes/archive/2025-08-19-improve-validate-error-messages/tasks.md +0 -21
  111. package/references/openspec/openspec/changes/archive/2025-08-19-structured-spec-format/proposal.md +0 -36
  112. package/references/openspec/openspec/changes/archive/2025-08-19-structured-spec-format/specs/openspec-conventions/spec.md +0 -192
  113. package/references/openspec/openspec/changes/archive/2025-08-19-structured-spec-format/tasks.md +0 -19
  114. package/references/openspec/openspec/changes/archive/2025-09-12-add-view-dashboard-command/proposal.md +0 -38
  115. package/references/openspec/openspec/changes/archive/2025-09-12-add-view-dashboard-command/specs/cli-view/spec.md +0 -109
  116. package/references/openspec/openspec/changes/archive/2025-09-12-add-view-dashboard-command/tasks.md +0 -47
  117. package/references/openspec/openspec/changes/archive/2025-09-29-add-agents-md-config/proposal.md +0 -28
  118. package/references/openspec/openspec/changes/archive/2025-09-29-add-agents-md-config/specs/cli-init/spec.md +0 -71
  119. package/references/openspec/openspec/changes/archive/2025-09-29-add-agents-md-config/specs/cli-update/spec.md +0 -41
  120. package/references/openspec/openspec/changes/archive/2025-09-29-add-agents-md-config/tasks.md +0 -17
  121. package/references/openspec/openspec/changes/archive/2025-09-29-add-multi-agent-init/proposal.md +0 -35
  122. package/references/openspec/openspec/changes/archive/2025-09-29-add-multi-agent-init/specs/cli-init/spec.md +0 -45
  123. package/references/openspec/openspec/changes/archive/2025-09-29-add-multi-agent-init/tasks.md +0 -16
  124. package/references/openspec/openspec/changes/archive/2025-09-29-add-slash-command-support/proposal.md +0 -119
  125. package/references/openspec/openspec/changes/archive/2025-09-29-add-slash-command-support/specs/cli-init/spec.md +0 -21
  126. package/references/openspec/openspec/changes/archive/2025-09-29-add-slash-command-support/specs/cli-update/spec.md +0 -22
  127. package/references/openspec/openspec/changes/archive/2025-09-29-add-slash-command-support/tasks.md +0 -20
  128. package/references/openspec/openspec/changes/archive/2025-09-29-improve-cli-e2e-plan/proposal.md +0 -19
  129. package/references/openspec/openspec/changes/archive/2025-09-29-improve-cli-e2e-plan/tasks.md +0 -9
  130. package/references/openspec/openspec/changes/archive/2025-09-29-improve-deterministic-tests/proposal.md +0 -78
  131. package/references/openspec/openspec/changes/archive/2025-09-29-improve-deterministic-tests/tasks.md +0 -25
  132. package/references/openspec/openspec/changes/archive/2025-09-29-improve-init-onboarding/proposal.md +0 -13
  133. package/references/openspec/openspec/changes/archive/2025-09-29-improve-init-onboarding/specs/cli-init/spec.md +0 -92
  134. package/references/openspec/openspec/changes/archive/2025-09-29-improve-init-onboarding/tasks.md +0 -12
  135. package/references/openspec/openspec/changes/archive/2025-09-29-remove-diff-command/proposal.md +0 -81
  136. package/references/openspec/openspec/changes/archive/2025-09-29-remove-diff-command/tasks.md +0 -37
  137. package/references/openspec/openspec/changes/archive/2025-09-29-sort-active-changes-by-progress/proposal.md +0 -25
  138. package/references/openspec/openspec/changes/archive/2025-09-29-sort-active-changes-by-progress/specs/cli-view/spec.md +0 -9
  139. package/references/openspec/openspec/changes/archive/2025-09-29-sort-active-changes-by-progress/tasks.md +0 -8
  140. package/references/openspec/openspec/changes/archive/2025-09-29-update-agent-file-name/proposal.md +0 -29
  141. package/references/openspec/openspec/changes/archive/2025-09-29-update-agent-file-name/specs/cli-init/spec.md +0 -40
  142. package/references/openspec/openspec/changes/archive/2025-09-29-update-agent-file-name/specs/cli-update/spec.md +0 -22
  143. package/references/openspec/openspec/changes/archive/2025-09-29-update-agent-file-name/specs/openspec-conventions/spec.md +0 -27
  144. package/references/openspec/openspec/changes/archive/2025-09-29-update-agent-file-name/tasks.md +0 -22
  145. package/references/openspec/openspec/changes/archive/2025-09-29-update-agent-instructions/design.md +0 -130
  146. package/references/openspec/openspec/changes/archive/2025-09-29-update-agent-instructions/proposal.md +0 -117
  147. package/references/openspec/openspec/changes/archive/2025-09-29-update-agent-instructions/tasks.md +0 -69
  148. package/references/openspec/openspec/changes/archive/2025-09-29-update-markdown-parser-crlf/proposal.md +0 -19
  149. package/references/openspec/openspec/changes/archive/2025-09-29-update-markdown-parser-crlf/specs/cli-validate/spec.md +0 -9
  150. package/references/openspec/openspec/changes/archive/2025-09-29-update-markdown-parser-crlf/tasks.md +0 -11
  151. package/references/openspec/openspec/changes/archive/2025-10-14-add-codex-slash-command-support/proposal.md +0 -25
  152. package/references/openspec/openspec/changes/archive/2025-10-14-add-codex-slash-command-support/specs/cli-init/spec.md +0 -56
  153. package/references/openspec/openspec/changes/archive/2025-10-14-add-codex-slash-command-support/specs/cli-update/spec.md +0 -41
  154. package/references/openspec/openspec/changes/archive/2025-10-14-add-codex-slash-command-support/tasks.md +0 -19
  155. package/references/openspec/openspec/changes/archive/2025-10-14-add-github-copilot-prompts/proposal.md +0 -25
  156. package/references/openspec/openspec/changes/archive/2025-10-14-add-github-copilot-prompts/specs/cli-init/spec.md +0 -48
  157. package/references/openspec/openspec/changes/archive/2025-10-14-add-github-copilot-prompts/specs/cli-update/spec.md +0 -48
  158. package/references/openspec/openspec/changes/archive/2025-10-14-add-github-copilot-prompts/tasks.md +0 -30
  159. package/references/openspec/openspec/changes/archive/2025-10-14-add-kilocode-workflows/proposal.md +0 -17
  160. package/references/openspec/openspec/changes/archive/2025-10-14-add-kilocode-workflows/specs/cli-init/spec.md +0 -43
  161. package/references/openspec/openspec/changes/archive/2025-10-14-add-kilocode-workflows/specs/cli-update/spec.md +0 -27
  162. package/references/openspec/openspec/changes/archive/2025-10-14-add-kilocode-workflows/tasks.md +0 -15
  163. package/references/openspec/openspec/changes/archive/2025-10-14-add-non-interactive-init-options/proposal.md +0 -12
  164. package/references/openspec/openspec/changes/archive/2025-10-14-add-non-interactive-init-options/specs/cli-init/spec.md +0 -39
  165. package/references/openspec/openspec/changes/archive/2025-10-14-add-non-interactive-init-options/tasks.md +0 -17
  166. package/references/openspec/openspec/changes/archive/2025-10-14-add-windsurf-workflows/proposal.md +0 -17
  167. package/references/openspec/openspec/changes/archive/2025-10-14-add-windsurf-workflows/specs/cli-init/spec.md +0 -42
  168. package/references/openspec/openspec/changes/archive/2025-10-14-add-windsurf-workflows/specs/cli-update/spec.md +0 -27
  169. package/references/openspec/openspec/changes/archive/2025-10-14-add-windsurf-workflows/tasks.md +0 -17
  170. package/references/openspec/openspec/changes/archive/2025-10-14-enhance-validation-error-messages/proposal.md +0 -12
  171. package/references/openspec/openspec/changes/archive/2025-10-14-enhance-validation-error-messages/specs/cli-validate/spec.md +0 -39
  172. package/references/openspec/openspec/changes/archive/2025-10-14-enhance-validation-error-messages/tasks.md +0 -12
  173. package/references/openspec/openspec/changes/archive/2025-10-14-improve-agent-instruction-usability/proposal.md +0 -12
  174. package/references/openspec/openspec/changes/archive/2025-10-14-improve-agent-instruction-usability/specs/docs-agent-instructions/spec.md +0 -33
  175. package/references/openspec/openspec/changes/archive/2025-10-14-improve-agent-instruction-usability/tasks.md +0 -11
  176. package/references/openspec/openspec/changes/archive/2025-10-14-slim-root-agents-file/proposal.md +0 -13
  177. package/references/openspec/openspec/changes/archive/2025-10-14-slim-root-agents-file/tasks.md +0 -15
  178. package/references/openspec/openspec/changes/archive/2025-10-14-update-cli-init-enter-selection/proposal.md +0 -14
  179. package/references/openspec/openspec/changes/archive/2025-10-14-update-cli-init-enter-selection/specs/cli-init/spec.md +0 -10
  180. package/references/openspec/openspec/changes/archive/2025-10-14-update-cli-init-enter-selection/tasks.md +0 -8
  181. package/references/openspec/openspec/changes/archive/2025-10-14-update-cli-init-root-agents/proposal.md +0 -15
  182. package/references/openspec/openspec/changes/archive/2025-10-14-update-cli-init-root-agents/specs/cli-init/spec.md +0 -32
  183. package/references/openspec/openspec/changes/archive/2025-10-14-update-cli-init-root-agents/specs/cli-update/spec.md +0 -10
  184. package/references/openspec/openspec/changes/archive/2025-10-14-update-cli-init-root-agents/tasks.md +0 -11
  185. package/references/openspec/openspec/changes/archive/2025-10-14-update-release-automation/proposal.md +0 -49
  186. package/references/openspec/openspec/changes/archive/2025-10-14-update-release-automation/tasks.md +0 -12
  187. package/references/openspec/openspec/changes/archive/2025-10-22-add-archive-command-arguments/proposal.md +0 -17
  188. package/references/openspec/openspec/changes/archive/2025-10-22-add-archive-command-arguments/specs/cli-update/spec.md +0 -32
  189. package/references/openspec/openspec/changes/archive/2025-10-22-add-archive-command-arguments/tasks.md +0 -15
  190. package/references/openspec/openspec/changes/archive/2025-10-22-add-cline-support/proposal.md +0 -15
  191. package/references/openspec/openspec/changes/archive/2025-10-22-add-cline-support/specs/cli-init/spec.md +0 -97
  192. package/references/openspec/openspec/changes/archive/2025-10-22-add-cline-support/tasks.md +0 -19
  193. package/references/openspec/openspec/changes/archive/2025-10-22-add-crush-support/proposal.md +0 -13
  194. package/references/openspec/openspec/changes/archive/2025-10-22-add-crush-support/specs/cli-init/spec.md +0 -67
  195. package/references/openspec/openspec/changes/archive/2025-10-22-add-crush-support/tasks.md +0 -7
  196. package/references/openspec/openspec/changes/archive/2025-10-22-add-factory-slash-commands/proposal.md +0 -12
  197. package/references/openspec/openspec/changes/archive/2025-10-22-add-factory-slash-commands/specs/cli-init/spec.md +0 -54
  198. package/references/openspec/openspec/changes/archive/2025-10-22-add-factory-slash-commands/specs/cli-update/spec.md +0 -54
  199. package/references/openspec/openspec/changes/archive/2025-10-22-add-factory-slash-commands/tasks.md +0 -11
  200. package/references/openspec/openspec/changes/fix-cline-workflows-implementation/proposal.md +0 -13
  201. package/references/openspec/openspec/changes/fix-cline-workflows-implementation/specs/cli-init/spec.md +0 -11
  202. package/references/openspec/openspec/changes/fix-cline-workflows-implementation/tasks.md +0 -13
  203. package/references/openspec/openspec/changes/make-validation-scope-aware/proposal.md +0 -12
  204. package/references/openspec/openspec/changes/make-validation-scope-aware/specs/cli-validate/spec.md +0 -25
  205. package/references/openspec/openspec/changes/make-validation-scope-aware/tasks.md +0 -16
  206. package/references/openspec/openspec/project.md +0 -53
  207. package/references/openspec/openspec/specs/cli-archive/spec.md +0 -210
  208. package/references/openspec/openspec/specs/cli-change/spec.md +0 -91
  209. package/references/openspec/openspec/specs/cli-init/spec.md +0 -311
  210. package/references/openspec/openspec/specs/cli-list/spec.md +0 -103
  211. package/references/openspec/openspec/specs/cli-show/spec.md +0 -85
  212. package/references/openspec/openspec/specs/cli-spec/spec.md +0 -87
  213. package/references/openspec/openspec/specs/cli-update/spec.md +0 -190
  214. package/references/openspec/openspec/specs/cli-validate/spec.md +0 -218
  215. package/references/openspec/openspec/specs/cli-view/spec.md +0 -105
  216. package/references/openspec/openspec/specs/docs-agent-instructions/spec.md +0 -38
  217. package/references/openspec/openspec/specs/openspec-conventions/spec.md +0 -474
  218. package/references/openspec/openspec-parallel-merge-plan.md +0 -98
  219. package/references/openspec/package.json +0 -73
  220. package/references/openspec/pnpm-lock.yaml +0 -2324
  221. package/references/openspec/scripts/pack-version-check.mjs +0 -111
  222. package/references/openspec/src/cli/index.ts +0 -253
  223. package/references/openspec/src/commands/change.ts +0 -291
  224. package/references/openspec/src/commands/show.ts +0 -139
  225. package/references/openspec/src/commands/spec.ts +0 -250
  226. package/references/openspec/src/commands/validate.ts +0 -305
  227. package/references/openspec/src/core/archive.ts +0 -606
  228. package/references/openspec/src/core/config.ts +0 -41
  229. package/references/openspec/src/core/configurators/agents.ts +0 -23
  230. package/references/openspec/src/core/configurators/base.ts +0 -6
  231. package/references/openspec/src/core/configurators/claude.ts +0 -23
  232. package/references/openspec/src/core/configurators/cline.ts +0 -23
  233. package/references/openspec/src/core/configurators/codebuddy.ts +0 -24
  234. package/references/openspec/src/core/configurators/costrict.ts +0 -23
  235. package/references/openspec/src/core/configurators/iflow.ts +0 -23
  236. package/references/openspec/src/core/configurators/qoder.ts +0 -53
  237. package/references/openspec/src/core/configurators/qwen.ts +0 -47
  238. package/references/openspec/src/core/configurators/registry.ts +0 -49
  239. package/references/openspec/src/core/configurators/slash/amazon-q.ts +0 -51
  240. package/references/openspec/src/core/configurators/slash/antigravity.ts +0 -28
  241. package/references/openspec/src/core/configurators/slash/auggie.ts +0 -37
  242. package/references/openspec/src/core/configurators/slash/base.ts +0 -95
  243. package/references/openspec/src/core/configurators/slash/claude.ts +0 -42
  244. package/references/openspec/src/core/configurators/slash/cline.ts +0 -27
  245. package/references/openspec/src/core/configurators/slash/codebuddy.ts +0 -43
  246. package/references/openspec/src/core/configurators/slash/codex.ts +0 -126
  247. package/references/openspec/src/core/configurators/slash/costrict.ts +0 -36
  248. package/references/openspec/src/core/configurators/slash/crush.ts +0 -42
  249. package/references/openspec/src/core/configurators/slash/cursor.ts +0 -42
  250. package/references/openspec/src/core/configurators/slash/factory.ts +0 -41
  251. package/references/openspec/src/core/configurators/slash/gemini.ts +0 -27
  252. package/references/openspec/src/core/configurators/slash/github-copilot.ts +0 -39
  253. package/references/openspec/src/core/configurators/slash/iflow.ts +0 -42
  254. package/references/openspec/src/core/configurators/slash/kilocode.ts +0 -21
  255. package/references/openspec/src/core/configurators/slash/opencode.ts +0 -83
  256. package/references/openspec/src/core/configurators/slash/qoder.ts +0 -84
  257. package/references/openspec/src/core/configurators/slash/qwen.ts +0 -55
  258. package/references/openspec/src/core/configurators/slash/registry.ts +0 -81
  259. package/references/openspec/src/core/configurators/slash/roocode.ts +0 -27
  260. package/references/openspec/src/core/configurators/slash/toml-base.ts +0 -66
  261. package/references/openspec/src/core/configurators/slash/windsurf.ts +0 -27
  262. package/references/openspec/src/core/converters/json-converter.ts +0 -61
  263. package/references/openspec/src/core/index.ts +0 -2
  264. package/references/openspec/src/core/init.ts +0 -986
  265. package/references/openspec/src/core/list.ts +0 -104
  266. package/references/openspec/src/core/parsers/change-parser.ts +0 -234
  267. package/references/openspec/src/core/parsers/markdown-parser.ts +0 -237
  268. package/references/openspec/src/core/parsers/requirement-blocks.ts +0 -234
  269. package/references/openspec/src/core/schemas/base.schema.ts +0 -20
  270. package/references/openspec/src/core/schemas/change.schema.ts +0 -42
  271. package/references/openspec/src/core/schemas/index.ts +0 -20
  272. package/references/openspec/src/core/schemas/spec.schema.ts +0 -17
  273. package/references/openspec/src/core/styles/palette.ts +0 -8
  274. package/references/openspec/src/core/templates/agents-root-stub.ts +0 -16
  275. package/references/openspec/src/core/templates/agents-template.ts +0 -457
  276. package/references/openspec/src/core/templates/claude-template.ts +0 -1
  277. package/references/openspec/src/core/templates/cline-template.ts +0 -1
  278. package/references/openspec/src/core/templates/costrict-template.ts +0 -1
  279. package/references/openspec/src/core/templates/index.ts +0 -50
  280. package/references/openspec/src/core/templates/project-template.ts +0 -38
  281. package/references/openspec/src/core/templates/slash-command-templates.ts +0 -60
  282. package/references/openspec/src/core/update.ts +0 -129
  283. package/references/openspec/src/core/validation/constants.ts +0 -48
  284. package/references/openspec/src/core/validation/types.ts +0 -19
  285. package/references/openspec/src/core/validation/validator.ts +0 -448
  286. package/references/openspec/src/core/view.ts +0 -189
  287. package/references/openspec/src/index.ts +0 -2
  288. package/references/openspec/src/utils/file-system.ts +0 -187
  289. package/references/openspec/src/utils/index.ts +0 -2
  290. package/references/openspec/src/utils/interactive.ts +0 -7
  291. package/references/openspec/src/utils/item-discovery.ts +0 -45
  292. package/references/openspec/src/utils/match.ts +0 -26
  293. package/references/openspec/src/utils/task-progress.ts +0 -43
  294. package/references/openspec/test/cli-e2e/basic.test.ts +0 -156
  295. package/references/openspec/test/commands/change.interactive-show.test.ts +0 -45
  296. package/references/openspec/test/commands/change.interactive-validate.test.ts +0 -48
  297. package/references/openspec/test/commands/show.test.ts +0 -123
  298. package/references/openspec/test/commands/spec.interactive-show.test.ts +0 -44
  299. package/references/openspec/test/commands/spec.interactive-validate.test.ts +0 -44
  300. package/references/openspec/test/commands/spec.test.ts +0 -324
  301. package/references/openspec/test/commands/validate.enriched-output.test.ts +0 -49
  302. package/references/openspec/test/commands/validate.test.ts +0 -133
  303. package/references/openspec/test/core/archive.test.ts +0 -680
  304. package/references/openspec/test/core/commands/change-command.list.test.ts +0 -76
  305. package/references/openspec/test/core/commands/change-command.show-validate.test.ts +0 -111
  306. package/references/openspec/test/core/converters/json-converter.test.ts +0 -184
  307. package/references/openspec/test/core/init.test.ts +0 -1710
  308. package/references/openspec/test/core/list.test.ts +0 -165
  309. package/references/openspec/test/core/parsers/change-parser.test.ts +0 -52
  310. package/references/openspec/test/core/parsers/markdown-parser.test.ts +0 -291
  311. package/references/openspec/test/core/update.test.ts +0 -1642
  312. package/references/openspec/test/core/validation.enriched-messages.test.ts +0 -74
  313. package/references/openspec/test/core/validation.test.ts +0 -489
  314. package/references/openspec/test/core/view.test.ts +0 -79
  315. package/references/openspec/test/fixtures/tmp-init/openspec/changes/c1/proposal.md +0 -7
  316. package/references/openspec/test/fixtures/tmp-init/openspec/changes/c1/specs/alpha/spec.md +0 -8
  317. package/references/openspec/test/fixtures/tmp-init/openspec/specs/alpha/spec.md +0 -12
  318. package/references/openspec/test/helpers/run-cli.ts +0 -139
  319. package/references/openspec/test/utils/file-system.test.ts +0 -211
  320. package/references/openspec/test/utils/marker-updates.test.ts +0 -287
  321. package/references/openspec/tsconfig.json +0 -21
  322. package/references/openspec/vitest.config.ts +0 -25
  323. package/references/openspec/vitest.setup.ts +0 -6
package/dist/cli.mjs ADDED
@@ -0,0 +1,91 @@
1
+ #!/usr/bin/env node
2
+ import { t as startServer } from "./src-CNuprcB-.mjs";
3
+
4
+ //#region src/cli.ts
5
+ function parseArgs(args) {
6
+ const result = {
7
+ port: 3100,
8
+ projectDir: process.cwd(),
9
+ open: true,
10
+ help: false
11
+ };
12
+ for (let i = 0; i < args.length; i++) {
13
+ const arg = args[i];
14
+ if (arg === "-p" || arg === "--port") {
15
+ const next = args[++i];
16
+ if (next) result.port = parseInt(next, 10);
17
+ } else if (arg === "-d" || arg === "--dir") {
18
+ const next = args[++i];
19
+ if (next) result.projectDir = next;
20
+ } else if (arg === "--no-open") result.open = false;
21
+ else if (arg === "-h" || arg === "--help") result.help = true;
22
+ else if (!arg.startsWith("-")) result.projectDir = arg;
23
+ }
24
+ return result;
25
+ }
26
+ function printHelp() {
27
+ console.log(`
28
+ OpenSpec UI - Visual interface for OpenSpec
29
+
30
+ Usage: openspecui [options] [project-dir]
31
+
32
+ Options:
33
+ -p, --port <port> Port to run the server on (default: 3100)
34
+ -d, --dir <path> Project directory containing openspec/ (default: cwd)
35
+ --no-open Don't automatically open the browser
36
+ -h, --help Show this help message
37
+
38
+ Examples:
39
+ openspecui # Start in current directory
40
+ openspecui ./my-project # Start with specific project
41
+ openspecui -p 8080 # Start on custom port
42
+ openspecui --no-open # Start without opening browser
43
+ `);
44
+ }
45
+ async function main() {
46
+ const args = parseArgs(process.argv.slice(2));
47
+ if (args.help) {
48
+ printHelp();
49
+ process.exit(0);
50
+ }
51
+ console.log(`
52
+ ┌─────────────────────────────────────────────┐
53
+ │ OpenSpec UI │
54
+ │ Visual interface for spec-driven dev │
55
+ └─────────────────────────────────────────────┘
56
+ `);
57
+ console.log(`📁 Project: ${args.projectDir}`);
58
+ console.log(`🔌 Port: ${args.port}`);
59
+ console.log("");
60
+ try {
61
+ const server = await startServer({
62
+ projectDir: args.projectDir,
63
+ port: args.port,
64
+ open: args.open
65
+ });
66
+ console.log(`✅ Server running at ${server.url}`);
67
+ console.log("");
68
+ if (args.open) {
69
+ await (await import("./open-CmiqsyCQ.mjs")).default(server.url);
70
+ console.log("🌐 Browser opened");
71
+ }
72
+ console.log("");
73
+ console.log("Press Ctrl+C to stop the server");
74
+ process.on("SIGINT", async () => {
75
+ console.log("\n\n👋 Shutting down...");
76
+ await server.close();
77
+ process.exit(0);
78
+ });
79
+ process.on("SIGTERM", async () => {
80
+ await server.close();
81
+ process.exit(0);
82
+ });
83
+ } catch (error) {
84
+ console.error("❌ Failed to start server:", error);
85
+ process.exit(1);
86
+ }
87
+ }
88
+ main();
89
+
90
+ //#endregion
91
+ export { };
package/dist/index.mjs ADDED
@@ -0,0 +1,3 @@
1
+ import { i as ACPAgents, n as createServer, r as ProviderManager, t as startServer } from "./src-CNuprcB-.mjs";
2
+
3
+ export { ACPAgents, ProviderManager, createServer, startServer };
@@ -0,0 +1,473 @@
1
+ import fs from "node:fs";
2
+ import path from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+ import process from "node:process";
5
+ import { Buffer } from "node:buffer";
6
+ import { promisify } from "node:util";
7
+ import childProcess, { execFile } from "node:child_process";
8
+ import fs$1, { constants } from "node:fs/promises";
9
+ import os from "node:os";
10
+
11
+ //#region ../../node_modules/.pnpm/is-docker@3.0.0/node_modules/is-docker/index.js
12
+ let isDockerCached;
13
+ function hasDockerEnv() {
14
+ try {
15
+ fs.statSync("/.dockerenv");
16
+ return true;
17
+ } catch {
18
+ return false;
19
+ }
20
+ }
21
+ function hasDockerCGroup() {
22
+ try {
23
+ return fs.readFileSync("/proc/self/cgroup", "utf8").includes("docker");
24
+ } catch {
25
+ return false;
26
+ }
27
+ }
28
+ function isDocker() {
29
+ if (isDockerCached === void 0) isDockerCached = hasDockerEnv() || hasDockerCGroup();
30
+ return isDockerCached;
31
+ }
32
+
33
+ //#endregion
34
+ //#region ../../node_modules/.pnpm/is-inside-container@1.0.0/node_modules/is-inside-container/index.js
35
+ let cachedResult;
36
+ const hasContainerEnv = () => {
37
+ try {
38
+ fs.statSync("/run/.containerenv");
39
+ return true;
40
+ } catch {
41
+ return false;
42
+ }
43
+ };
44
+ function isInsideContainer() {
45
+ if (cachedResult === void 0) cachedResult = hasContainerEnv() || isDocker();
46
+ return cachedResult;
47
+ }
48
+
49
+ //#endregion
50
+ //#region ../../node_modules/.pnpm/is-wsl@3.1.0/node_modules/is-wsl/index.js
51
+ const isWsl = () => {
52
+ if (process.platform !== "linux") return false;
53
+ if (os.release().toLowerCase().includes("microsoft")) {
54
+ if (isInsideContainer()) return false;
55
+ return true;
56
+ }
57
+ try {
58
+ return fs.readFileSync("/proc/version", "utf8").toLowerCase().includes("microsoft") ? !isInsideContainer() : false;
59
+ } catch {
60
+ return false;
61
+ }
62
+ };
63
+ var is_wsl_default = process.env.__IS_WSL_TEST__ ? isWsl : isWsl();
64
+
65
+ //#endregion
66
+ //#region ../../node_modules/.pnpm/wsl-utils@0.1.0/node_modules/wsl-utils/index.js
67
+ const wslDrivesMountPoint = (() => {
68
+ const defaultMountPoint = "/mnt/";
69
+ let mountPoint;
70
+ return async function() {
71
+ if (mountPoint) return mountPoint;
72
+ const configFilePath = "/etc/wsl.conf";
73
+ let isConfigFileExists = false;
74
+ try {
75
+ await fs$1.access(configFilePath, constants.F_OK);
76
+ isConfigFileExists = true;
77
+ } catch {}
78
+ if (!isConfigFileExists) return defaultMountPoint;
79
+ const configContent = await fs$1.readFile(configFilePath, { encoding: "utf8" });
80
+ const configMountPoint = /(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(configContent);
81
+ if (!configMountPoint) return defaultMountPoint;
82
+ mountPoint = configMountPoint.groups.mountPoint.trim();
83
+ mountPoint = mountPoint.endsWith("/") ? mountPoint : `${mountPoint}/`;
84
+ return mountPoint;
85
+ };
86
+ })();
87
+ const powerShellPathFromWsl = async () => {
88
+ return `${await wslDrivesMountPoint()}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`;
89
+ };
90
+ const powerShellPath = async () => {
91
+ if (is_wsl_default) return powerShellPathFromWsl();
92
+ return `${process.env.SYSTEMROOT || process.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;
93
+ };
94
+
95
+ //#endregion
96
+ //#region ../../node_modules/.pnpm/define-lazy-prop@3.0.0/node_modules/define-lazy-prop/index.js
97
+ function defineLazyProperty(object, propertyName, valueGetter) {
98
+ const define = (value) => Object.defineProperty(object, propertyName, {
99
+ value,
100
+ enumerable: true,
101
+ writable: true
102
+ });
103
+ Object.defineProperty(object, propertyName, {
104
+ configurable: true,
105
+ enumerable: true,
106
+ get() {
107
+ const result = valueGetter();
108
+ define(result);
109
+ return result;
110
+ },
111
+ set(value) {
112
+ define(value);
113
+ }
114
+ });
115
+ return object;
116
+ }
117
+
118
+ //#endregion
119
+ //#region ../../node_modules/.pnpm/default-browser-id@5.0.1/node_modules/default-browser-id/index.js
120
+ const execFileAsync$3 = promisify(execFile);
121
+ async function defaultBrowserId() {
122
+ if (process.platform !== "darwin") throw new Error("macOS only");
123
+ const { stdout } = await execFileAsync$3("defaults", [
124
+ "read",
125
+ "com.apple.LaunchServices/com.apple.launchservices.secure",
126
+ "LSHandlers"
127
+ ]);
128
+ const browserId = /LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(stdout)?.groups.id ?? "com.apple.Safari";
129
+ if (browserId === "com.apple.safari") return "com.apple.Safari";
130
+ return browserId;
131
+ }
132
+
133
+ //#endregion
134
+ //#region ../../node_modules/.pnpm/run-applescript@7.1.0/node_modules/run-applescript/index.js
135
+ const execFileAsync$2 = promisify(execFile);
136
+ async function runAppleScript(script, { humanReadableOutput = true, signal } = {}) {
137
+ if (process.platform !== "darwin") throw new Error("macOS only");
138
+ const outputArguments = humanReadableOutput ? [] : ["-ss"];
139
+ const execOptions = {};
140
+ if (signal) execOptions.signal = signal;
141
+ const { stdout } = await execFileAsync$2("osascript", [
142
+ "-e",
143
+ script,
144
+ outputArguments
145
+ ], execOptions);
146
+ return stdout.trim();
147
+ }
148
+
149
+ //#endregion
150
+ //#region ../../node_modules/.pnpm/bundle-name@4.1.0/node_modules/bundle-name/index.js
151
+ async function bundleName(bundleId) {
152
+ return runAppleScript(`tell application "Finder" to set app_path to application file id "${bundleId}" as string\ntell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`);
153
+ }
154
+
155
+ //#endregion
156
+ //#region ../../node_modules/.pnpm/default-browser@5.4.0/node_modules/default-browser/windows.js
157
+ const execFileAsync$1 = promisify(execFile);
158
+ const windowsBrowserProgIds = {
159
+ MSEdgeHTM: {
160
+ name: "Edge",
161
+ id: "com.microsoft.edge"
162
+ },
163
+ MSEdgeBHTML: {
164
+ name: "Edge Beta",
165
+ id: "com.microsoft.edge.beta"
166
+ },
167
+ MSEdgeDHTML: {
168
+ name: "Edge Dev",
169
+ id: "com.microsoft.edge.dev"
170
+ },
171
+ AppXq0fevzme2pys62n3e0fbqa7peapykr8v: {
172
+ name: "Edge",
173
+ id: "com.microsoft.edge.old"
174
+ },
175
+ ChromeHTML: {
176
+ name: "Chrome",
177
+ id: "com.google.chrome"
178
+ },
179
+ ChromeBHTML: {
180
+ name: "Chrome Beta",
181
+ id: "com.google.chrome.beta"
182
+ },
183
+ ChromeDHTML: {
184
+ name: "Chrome Dev",
185
+ id: "com.google.chrome.dev"
186
+ },
187
+ ChromiumHTM: {
188
+ name: "Chromium",
189
+ id: "org.chromium.Chromium"
190
+ },
191
+ BraveHTML: {
192
+ name: "Brave",
193
+ id: "com.brave.Browser"
194
+ },
195
+ BraveBHTML: {
196
+ name: "Brave Beta",
197
+ id: "com.brave.Browser.beta"
198
+ },
199
+ BraveDHTML: {
200
+ name: "Brave Dev",
201
+ id: "com.brave.Browser.dev"
202
+ },
203
+ BraveSSHTM: {
204
+ name: "Brave Nightly",
205
+ id: "com.brave.Browser.nightly"
206
+ },
207
+ FirefoxURL: {
208
+ name: "Firefox",
209
+ id: "org.mozilla.firefox"
210
+ },
211
+ OperaStable: {
212
+ name: "Opera",
213
+ id: "com.operasoftware.Opera"
214
+ },
215
+ VivaldiHTM: {
216
+ name: "Vivaldi",
217
+ id: "com.vivaldi.Vivaldi"
218
+ },
219
+ "IE.HTTP": {
220
+ name: "Internet Explorer",
221
+ id: "com.microsoft.ie"
222
+ }
223
+ };
224
+ const _windowsBrowserProgIdMap = new Map(Object.entries(windowsBrowserProgIds));
225
+ var UnknownBrowserError = class extends Error {};
226
+ async function defaultBrowser$1(_execFileAsync = execFileAsync$1) {
227
+ const { stdout } = await _execFileAsync("reg", [
228
+ "QUERY",
229
+ " HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice",
230
+ "/v",
231
+ "ProgId"
232
+ ]);
233
+ const match = /ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(stdout);
234
+ if (!match) throw new UnknownBrowserError(`Cannot find Windows browser in stdout: ${JSON.stringify(stdout)}`);
235
+ const { id } = match.groups;
236
+ const browser = windowsBrowserProgIds[id];
237
+ if (!browser) throw new UnknownBrowserError(`Unknown browser ID: ${id}`);
238
+ return browser;
239
+ }
240
+
241
+ //#endregion
242
+ //#region ../../node_modules/.pnpm/default-browser@5.4.0/node_modules/default-browser/index.js
243
+ const execFileAsync = promisify(execFile);
244
+ const titleize = (string) => string.toLowerCase().replaceAll(/(?:^|\s|-)\S/g, (x) => x.toUpperCase());
245
+ async function defaultBrowser() {
246
+ if (process.platform === "darwin") {
247
+ const id = await defaultBrowserId();
248
+ return {
249
+ name: await bundleName(id),
250
+ id
251
+ };
252
+ }
253
+ if (process.platform === "linux") {
254
+ const { stdout } = await execFileAsync("xdg-mime", [
255
+ "query",
256
+ "default",
257
+ "x-scheme-handler/http"
258
+ ]);
259
+ const id = stdout.trim();
260
+ return {
261
+ name: titleize(id.replace(/.desktop$/, "").replace("-", " ")),
262
+ id
263
+ };
264
+ }
265
+ if (process.platform === "win32") return defaultBrowser$1();
266
+ throw new Error("Only macOS, Linux, and Windows are supported");
267
+ }
268
+
269
+ //#endregion
270
+ //#region ../../node_modules/.pnpm/open@10.2.0/node_modules/open/index.js
271
+ const execFile$1 = promisify(childProcess.execFile);
272
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
273
+ const localXdgOpenPath = path.join(__dirname, "xdg-open");
274
+ const { platform, arch } = process;
275
+ /**
276
+ Get the default browser name in Windows from WSL.
277
+
278
+ @returns {Promise<string>} Browser name.
279
+ */
280
+ async function getWindowsDefaultBrowserFromWsl() {
281
+ const powershellPath = await powerShellPath();
282
+ const rawCommand = String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`;
283
+ const { stdout } = await execFile$1(powershellPath, [
284
+ "-NoProfile",
285
+ "-NonInteractive",
286
+ "-ExecutionPolicy",
287
+ "Bypass",
288
+ "-EncodedCommand",
289
+ Buffer.from(rawCommand, "utf16le").toString("base64")
290
+ ], { encoding: "utf8" });
291
+ const progId = stdout.trim();
292
+ const browserMap = {
293
+ ChromeHTML: "com.google.chrome",
294
+ BraveHTML: "com.brave.Browser",
295
+ MSEdgeHTM: "com.microsoft.edge",
296
+ FirefoxURL: "org.mozilla.firefox"
297
+ };
298
+ return browserMap[progId] ? { id: browserMap[progId] } : {};
299
+ }
300
+ const pTryEach = async (array, mapper) => {
301
+ let latestError;
302
+ for (const item of array) try {
303
+ return await mapper(item);
304
+ } catch (error) {
305
+ latestError = error;
306
+ }
307
+ throw latestError;
308
+ };
309
+ const baseOpen = async (options) => {
310
+ options = {
311
+ wait: false,
312
+ background: false,
313
+ newInstance: false,
314
+ allowNonzeroExitCode: false,
315
+ ...options
316
+ };
317
+ if (Array.isArray(options.app)) return pTryEach(options.app, (singleApp) => baseOpen({
318
+ ...options,
319
+ app: singleApp
320
+ }));
321
+ let { name: app, arguments: appArguments = [] } = options.app ?? {};
322
+ appArguments = [...appArguments];
323
+ if (Array.isArray(app)) return pTryEach(app, (appName) => baseOpen({
324
+ ...options,
325
+ app: {
326
+ name: appName,
327
+ arguments: appArguments
328
+ }
329
+ }));
330
+ if (app === "browser" || app === "browserPrivate") {
331
+ const ids = {
332
+ "com.google.chrome": "chrome",
333
+ "google-chrome.desktop": "chrome",
334
+ "com.brave.Browser": "brave",
335
+ "org.mozilla.firefox": "firefox",
336
+ "firefox.desktop": "firefox",
337
+ "com.microsoft.msedge": "edge",
338
+ "com.microsoft.edge": "edge",
339
+ "com.microsoft.edgemac": "edge",
340
+ "microsoft-edge.desktop": "edge"
341
+ };
342
+ const flags = {
343
+ chrome: "--incognito",
344
+ brave: "--incognito",
345
+ firefox: "--private-window",
346
+ edge: "--inPrivate"
347
+ };
348
+ const browser = is_wsl_default ? await getWindowsDefaultBrowserFromWsl() : await defaultBrowser();
349
+ if (browser.id in ids) {
350
+ const browserName = ids[browser.id];
351
+ if (app === "browserPrivate") appArguments.push(flags[browserName]);
352
+ return baseOpen({
353
+ ...options,
354
+ app: {
355
+ name: apps[browserName],
356
+ arguments: appArguments
357
+ }
358
+ });
359
+ }
360
+ throw new Error(`${browser.name} is not supported as a default browser`);
361
+ }
362
+ let command;
363
+ const cliArguments = [];
364
+ const childProcessOptions = {};
365
+ if (platform === "darwin") {
366
+ command = "open";
367
+ if (options.wait) cliArguments.push("--wait-apps");
368
+ if (options.background) cliArguments.push("--background");
369
+ if (options.newInstance) cliArguments.push("--new");
370
+ if (app) cliArguments.push("-a", app);
371
+ } else if (platform === "win32" || is_wsl_default && !isInsideContainer() && !app) {
372
+ command = await powerShellPath();
373
+ cliArguments.push("-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "-EncodedCommand");
374
+ if (!is_wsl_default) childProcessOptions.windowsVerbatimArguments = true;
375
+ const encodedArguments = ["Start"];
376
+ if (options.wait) encodedArguments.push("-Wait");
377
+ if (app) {
378
+ encodedArguments.push(`"\`"${app}\`""`);
379
+ if (options.target) appArguments.push(options.target);
380
+ } else if (options.target) encodedArguments.push(`"${options.target}"`);
381
+ if (appArguments.length > 0) {
382
+ appArguments = appArguments.map((argument) => `"\`"${argument}\`""`);
383
+ encodedArguments.push("-ArgumentList", appArguments.join(","));
384
+ }
385
+ options.target = Buffer.from(encodedArguments.join(" "), "utf16le").toString("base64");
386
+ } else {
387
+ if (app) command = app;
388
+ else {
389
+ const isBundled = !__dirname || __dirname === "/";
390
+ let exeLocalXdgOpen = false;
391
+ try {
392
+ await fs$1.access(localXdgOpenPath, constants.X_OK);
393
+ exeLocalXdgOpen = true;
394
+ } catch {}
395
+ command = process.versions.electron ?? (platform === "android" || isBundled || !exeLocalXdgOpen) ? "xdg-open" : localXdgOpenPath;
396
+ }
397
+ if (appArguments.length > 0) cliArguments.push(...appArguments);
398
+ if (!options.wait) {
399
+ childProcessOptions.stdio = "ignore";
400
+ childProcessOptions.detached = true;
401
+ }
402
+ }
403
+ if (platform === "darwin" && appArguments.length > 0) cliArguments.push("--args", ...appArguments);
404
+ if (options.target) cliArguments.push(options.target);
405
+ const subprocess = childProcess.spawn(command, cliArguments, childProcessOptions);
406
+ if (options.wait) return new Promise((resolve, reject) => {
407
+ subprocess.once("error", reject);
408
+ subprocess.once("close", (exitCode) => {
409
+ if (!options.allowNonzeroExitCode && exitCode > 0) {
410
+ reject(/* @__PURE__ */ new Error(`Exited with code ${exitCode}`));
411
+ return;
412
+ }
413
+ resolve(subprocess);
414
+ });
415
+ });
416
+ subprocess.unref();
417
+ return subprocess;
418
+ };
419
+ const open = (target, options) => {
420
+ if (typeof target !== "string") throw new TypeError("Expected a `target`");
421
+ return baseOpen({
422
+ ...options,
423
+ target
424
+ });
425
+ };
426
+ function detectArchBinary(binary) {
427
+ if (typeof binary === "string" || Array.isArray(binary)) return binary;
428
+ const { [arch]: archBinary } = binary;
429
+ if (!archBinary) throw new Error(`${arch} is not supported`);
430
+ return archBinary;
431
+ }
432
+ function detectPlatformBinary({ [platform]: platformBinary }, { wsl }) {
433
+ if (wsl && is_wsl_default) return detectArchBinary(wsl);
434
+ if (!platformBinary) throw new Error(`${platform} is not supported`);
435
+ return detectArchBinary(platformBinary);
436
+ }
437
+ const apps = {};
438
+ defineLazyProperty(apps, "chrome", () => detectPlatformBinary({
439
+ darwin: "google chrome",
440
+ win32: "chrome",
441
+ linux: [
442
+ "google-chrome",
443
+ "google-chrome-stable",
444
+ "chromium"
445
+ ]
446
+ }, { wsl: {
447
+ ia32: "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",
448
+ x64: ["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe", "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]
449
+ } }));
450
+ defineLazyProperty(apps, "brave", () => detectPlatformBinary({
451
+ darwin: "brave browser",
452
+ win32: "brave",
453
+ linux: ["brave-browser", "brave"]
454
+ }, { wsl: {
455
+ ia32: "/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe",
456
+ x64: ["/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe", "/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe"]
457
+ } }));
458
+ defineLazyProperty(apps, "firefox", () => detectPlatformBinary({
459
+ darwin: "firefox",
460
+ win32: String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,
461
+ linux: "firefox"
462
+ }, { wsl: "/mnt/c/Program Files/Mozilla Firefox/firefox.exe" }));
463
+ defineLazyProperty(apps, "edge", () => detectPlatformBinary({
464
+ darwin: "microsoft edge",
465
+ win32: "msedge",
466
+ linux: ["microsoft-edge", "microsoft-edge-dev"]
467
+ }, { wsl: "/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe" }));
468
+ defineLazyProperty(apps, "browser", () => "browser");
469
+ defineLazyProperty(apps, "browserPrivate", () => "browserPrivate");
470
+ var open_default = open;
471
+
472
+ //#endregion
473
+ export { open_default as default };