opkg 0.6.1 → 0.7.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 (487) hide show
  1. package/README.md +109 -186
  2. package/assets/openpackage_ascii_dark.png +0 -0
  3. package/assets/openpackage_ascii_light.png +0 -0
  4. package/dist/commands/add.js +34 -10
  5. package/dist/commands/add.js.map +1 -1
  6. package/dist/commands/apply.js +16 -0
  7. package/dist/commands/apply.js.map +1 -0
  8. package/dist/commands/delete.js +1 -1
  9. package/dist/commands/delete.js.map +1 -1
  10. package/dist/commands/install.js +177 -8
  11. package/dist/commands/install.js.map +1 -1
  12. package/dist/commands/list.js +2 -2
  13. package/dist/commands/list.js.map +1 -1
  14. package/dist/commands/login.js +1 -1
  15. package/dist/commands/login.js.map +1 -1
  16. package/dist/commands/logout.js +1 -1
  17. package/dist/commands/logout.js.map +1 -1
  18. package/dist/commands/new.js +125 -0
  19. package/dist/commands/new.js.map +1 -0
  20. package/dist/commands/pack.js +7 -13
  21. package/dist/commands/pack.js.map +1 -1
  22. package/dist/commands/pull.js +1 -1
  23. package/dist/commands/pull.js.map +1 -1
  24. package/dist/commands/push.js +1 -1
  25. package/dist/commands/push.js.map +1 -1
  26. package/dist/commands/remove.js +63 -0
  27. package/dist/commands/remove.js.map +1 -0
  28. package/dist/commands/save.js +11 -17
  29. package/dist/commands/save.js.map +1 -1
  30. package/dist/commands/set.js +33 -0
  31. package/dist/commands/set.js.map +1 -0
  32. package/dist/commands/show.js +16 -94
  33. package/dist/commands/show.js.map +1 -1
  34. package/dist/commands/status.js +26 -701
  35. package/dist/commands/status.js.map +1 -1
  36. package/dist/commands/uninstall.js +14 -427
  37. package/dist/commands/uninstall.js.map +1 -1
  38. package/dist/constants/index.js +72 -16
  39. package/dist/constants/index.js.map +1 -1
  40. package/dist/core/add/add-conflict-handler.js +1 -8
  41. package/dist/core/add/add-conflict-handler.js.map +1 -1
  42. package/dist/core/add/add-pipeline.js +12 -10
  43. package/dist/core/add/add-pipeline.js.map +1 -1
  44. package/dist/core/add/add-to-source-pipeline.js +123 -0
  45. package/dist/core/add/add-to-source-pipeline.js.map +1 -0
  46. package/dist/core/add/package-index-updater.js +77 -78
  47. package/dist/core/add/package-index-updater.js.map +1 -1
  48. package/dist/core/add/platform-path-transformer.js +6 -4
  49. package/dist/core/add/platform-path-transformer.js.map +1 -1
  50. package/dist/core/add/source-collector.js +2 -3
  51. package/dist/core/add/source-collector.js.map +1 -1
  52. package/dist/core/apply/apply-pipeline.js +110 -0
  53. package/dist/core/apply/apply-pipeline.js.map +1 -0
  54. package/dist/core/dependency-resolver.js +263 -21
  55. package/dist/core/dependency-resolver.js.map +1 -1
  56. package/dist/core/discovery/file-discovery.js +1 -2
  57. package/dist/core/discovery/file-discovery.js.map +1 -1
  58. package/dist/core/discovery/platform-files-discovery.js +33 -18
  59. package/dist/core/discovery/platform-files-discovery.js.map +1 -1
  60. package/dist/core/flows/flow-executor.js +974 -0
  61. package/dist/core/flows/flow-executor.js.map +1 -0
  62. package/dist/core/flows/flow-inverter.js +442 -0
  63. package/dist/core/flows/flow-inverter.js.map +1 -0
  64. package/dist/core/flows/flow-key-extractor.js +101 -0
  65. package/dist/core/flows/flow-key-extractor.js.map +1 -0
  66. package/dist/core/flows/flow-key-mapper.js +382 -0
  67. package/dist/core/flows/flow-key-mapper.js.map +1 -0
  68. package/dist/core/flows/flow-transforms.js +632 -0
  69. package/dist/core/flows/flow-transforms.js.map +1 -0
  70. package/dist/core/flows/map-pipeline/context.js +73 -0
  71. package/dist/core/flows/map-pipeline/context.js.map +1 -0
  72. package/dist/core/flows/map-pipeline/index.js +156 -0
  73. package/dist/core/flows/map-pipeline/index.js.map +1 -0
  74. package/dist/core/flows/map-pipeline/operations/copy.js +104 -0
  75. package/dist/core/flows/map-pipeline/operations/copy.js.map +1 -0
  76. package/dist/core/flows/map-pipeline/operations/pipe.js +70 -0
  77. package/dist/core/flows/map-pipeline/operations/pipe.js.map +1 -0
  78. package/dist/core/flows/map-pipeline/operations/rename.js +102 -0
  79. package/dist/core/flows/map-pipeline/operations/rename.js.map +1 -0
  80. package/dist/core/flows/map-pipeline/operations/set.js +50 -0
  81. package/dist/core/flows/map-pipeline/operations/set.js.map +1 -0
  82. package/dist/core/flows/map-pipeline/operations/switch.js +79 -0
  83. package/dist/core/flows/map-pipeline/operations/switch.js.map +1 -0
  84. package/dist/core/flows/map-pipeline/operations/transform.js +543 -0
  85. package/dist/core/flows/map-pipeline/operations/transform.js.map +1 -0
  86. package/dist/core/flows/map-pipeline/operations/unset.js +65 -0
  87. package/dist/core/flows/map-pipeline/operations/unset.js.map +1 -0
  88. package/dist/core/flows/map-pipeline/types.js +8 -0
  89. package/dist/core/flows/map-pipeline/types.js.map +1 -0
  90. package/dist/core/flows/map-pipeline/utils.js +278 -0
  91. package/dist/core/flows/map-pipeline/utils.js.map +1 -0
  92. package/dist/core/flows/platform-converter.js +328 -0
  93. package/dist/core/flows/platform-converter.js.map +1 -0
  94. package/dist/core/flows/source-resolver.js +192 -0
  95. package/dist/core/flows/source-resolver.js.map +1 -0
  96. package/dist/core/flows/toml-domain-transforms.js +23 -0
  97. package/dist/core/flows/toml-domain-transforms.js.map +1 -0
  98. package/dist/core/install/bulk-install-pipeline.js +68 -7
  99. package/dist/core/install/bulk-install-pipeline.js.map +1 -1
  100. package/dist/core/install/canonical-plan.js +3 -3
  101. package/dist/core/install/canonical-plan.js.map +1 -1
  102. package/dist/core/install/dry-run.js +3 -3
  103. package/dist/core/install/dry-run.js.map +1 -1
  104. package/dist/core/install/flow-based-installer.js +1158 -0
  105. package/dist/core/install/flow-based-installer.js.map +1 -0
  106. package/dist/core/install/flow-workspace-tracker.js +111 -0
  107. package/dist/core/install/flow-workspace-tracker.js.map +1 -0
  108. package/dist/core/install/format-detector.js +228 -0
  109. package/dist/core/install/format-detector.js.map +1 -0
  110. package/dist/core/install/git-package-loader.js +20 -0
  111. package/dist/core/install/git-package-loader.js.map +1 -0
  112. package/dist/core/install/install-errors.js +1 -1
  113. package/dist/core/install/install-errors.js.map +1 -1
  114. package/dist/core/install/install-flow.js +34 -14
  115. package/dist/core/install/install-flow.js.map +1 -1
  116. package/dist/core/install/install-pipeline.js +52 -17
  117. package/dist/core/install/install-pipeline.js.map +1 -1
  118. package/dist/core/install/install-reporting.js +26 -8
  119. package/dist/core/install/install-reporting.js.map +1 -1
  120. package/dist/core/install/local-source-resolution.js +103 -0
  121. package/dist/core/install/local-source-resolution.js.map +1 -0
  122. package/dist/core/install/marketplace-handler.js +221 -0
  123. package/dist/core/install/marketplace-handler.js.map +1 -0
  124. package/dist/core/install/path-install-pipeline.js +241 -0
  125. package/dist/core/install/path-install-pipeline.js.map +1 -0
  126. package/dist/core/install/path-package-loader.js +116 -0
  127. package/dist/core/install/path-package-loader.js.map +1 -0
  128. package/dist/core/install/plugin-detector.js +72 -0
  129. package/dist/core/install/plugin-detector.js.map +1 -0
  130. package/dist/core/install/plugin-to-universal-converter.js +218 -0
  131. package/dist/core/install/plugin-to-universal-converter.js.map +1 -0
  132. package/dist/core/install/plugin-transformer.js +191 -0
  133. package/dist/core/install/plugin-transformer.js.map +1 -0
  134. package/dist/core/install/version-selection.js +1 -1
  135. package/dist/core/install/version-selection.js.map +1 -1
  136. package/dist/core/openpackage.js +40 -22
  137. package/dist/core/openpackage.js.map +1 -1
  138. package/dist/core/pack/pack-output.js +62 -0
  139. package/dist/core/pack/pack-output.js.map +1 -0
  140. package/dist/core/pack/pack-pipeline.js +186 -0
  141. package/dist/core/pack/pack-pipeline.js.map +1 -0
  142. package/dist/core/package-context.js +45 -70
  143. package/dist/core/package-context.js.map +1 -1
  144. package/dist/core/package-creation.js +203 -0
  145. package/dist/core/package-creation.js.map +1 -0
  146. package/dist/core/package.js +20 -6
  147. package/dist/core/package.js.map +1 -1
  148. package/dist/core/platforms.js +665 -209
  149. package/dist/core/platforms.js.map +1 -1
  150. package/dist/core/push/push-context.js +1 -1
  151. package/dist/core/push/push-context.js.map +1 -1
  152. package/dist/core/push/push-upload.js +2 -2
  153. package/dist/core/push/push-upload.js.map +1 -1
  154. package/dist/core/registry.js +6 -6
  155. package/dist/core/registry.js.map +1 -1
  156. package/dist/core/remote-pull.js +2 -2
  157. package/dist/core/remote-pull.js.map +1 -1
  158. package/dist/core/remove/removal-collector.js +52 -0
  159. package/dist/core/remove/removal-collector.js.map +1 -0
  160. package/dist/core/remove/removal-confirmation.js +39 -0
  161. package/dist/core/remove/removal-confirmation.js.map +1 -0
  162. package/dist/core/remove/remove-from-source-pipeline.js +173 -0
  163. package/dist/core/remove/remove-from-source-pipeline.js.map +1 -0
  164. package/dist/core/save/constants.js +3 -3
  165. package/dist/core/save/constants.js.map +1 -1
  166. package/dist/core/save/flow-based-saver.js +270 -0
  167. package/dist/core/save/flow-based-saver.js.map +1 -0
  168. package/dist/core/save/name-resolution.js +1 -1
  169. package/dist/core/save/name-resolution.js.map +1 -1
  170. package/dist/core/save/package-yml-generator.js +4 -5
  171. package/dist/core/save/package-yml-generator.js.map +1 -1
  172. package/dist/core/save/save-candidate-builder.js +215 -0
  173. package/dist/core/save/save-candidate-builder.js.map +1 -0
  174. package/dist/core/save/save-candidate-loader.js +12 -11
  175. package/dist/core/save/save-candidate-loader.js.map +1 -1
  176. package/dist/core/save/save-conflict-analyzer.js +150 -0
  177. package/dist/core/save/save-conflict-analyzer.js.map +1 -0
  178. package/dist/core/save/save-conflict-resolution.js +28 -14
  179. package/dist/core/save/save-conflict-resolution.js.map +1 -1
  180. package/dist/core/save/save-conflict-resolver.js +31 -275
  181. package/dist/core/save/save-conflict-resolver.js.map +1 -1
  182. package/dist/core/save/save-group-builder.js +52 -0
  183. package/dist/core/save/save-group-builder.js.map +1 -0
  184. package/dist/core/save/save-interactive-resolver.js +190 -0
  185. package/dist/core/save/save-interactive-resolver.js.map +1 -0
  186. package/dist/core/save/save-pipeline.js +58 -34
  187. package/dist/core/save/save-pipeline.js.map +1 -1
  188. package/dist/core/save/save-platform-handler.js +53 -0
  189. package/dist/core/save/save-platform-handler.js.map +1 -0
  190. package/dist/core/save/save-resolution-executor.js +145 -0
  191. package/dist/core/save/save-resolution-executor.js.map +1 -0
  192. package/dist/core/save/save-result-reporter.js +167 -0
  193. package/dist/core/save/save-result-reporter.js.map +1 -0
  194. package/dist/core/save/save-to-source-pipeline.js +154 -0
  195. package/dist/core/save/save-to-source-pipeline.js.map +1 -0
  196. package/dist/core/save/save-versioning.js +4 -4
  197. package/dist/core/save/save-versioning.js.map +1 -1
  198. package/dist/core/save/save-write-coordinator.js +204 -0
  199. package/dist/core/save/save-write-coordinator.js.map +1 -0
  200. package/dist/core/save/save-yml-resolution.js +28 -216
  201. package/dist/core/save/save-yml-resolution.js.map +1 -1
  202. package/dist/core/save/workspace-rename.js +7 -8
  203. package/dist/core/save/workspace-rename.js.map +1 -1
  204. package/dist/core/set/set-output.js +72 -0
  205. package/dist/core/set/set-output.js.map +1 -0
  206. package/dist/core/set/set-pipeline.js +361 -0
  207. package/dist/core/set/set-pipeline.js.map +1 -0
  208. package/dist/core/set/set-types.js +5 -0
  209. package/dist/core/set/set-types.js.map +1 -0
  210. package/dist/core/show/package-resolver.js +257 -0
  211. package/dist/core/show/package-resolver.js.map +1 -0
  212. package/dist/core/show/scope-discovery.js +165 -0
  213. package/dist/core/show/scope-discovery.js.map +1 -0
  214. package/dist/core/show/show-output.js +168 -0
  215. package/dist/core/show/show-output.js.map +1 -0
  216. package/dist/core/show/show-pipeline.js +113 -0
  217. package/dist/core/show/show-pipeline.js.map +1 -0
  218. package/dist/core/show/show-types.js +5 -0
  219. package/dist/core/show/show-types.js.map +1 -0
  220. package/dist/core/source-resolution/dependency-graph.js +104 -0
  221. package/dist/core/source-resolution/dependency-graph.js.map +1 -0
  222. package/dist/core/source-resolution/resolve-mutable-source.js +109 -0
  223. package/dist/core/source-resolution/resolve-mutable-source.js.map +1 -0
  224. package/dist/core/source-resolution/resolve-package-source.js +29 -0
  225. package/dist/core/source-resolution/resolve-package-source.js.map +1 -0
  226. package/dist/core/source-resolution/resolve-registry-version.js +35 -0
  227. package/dist/core/source-resolution/resolve-registry-version.js.map +1 -0
  228. package/dist/core/source-resolution/types.js.map +1 -0
  229. package/dist/core/status/status-file-discovery.js +23 -12
  230. package/dist/core/status/status-file-discovery.js.map +1 -1
  231. package/dist/core/status/status-pipeline.js +134 -0
  232. package/dist/core/status/status-pipeline.js.map +1 -0
  233. package/dist/core/sync/platform-sync-summary.js +27 -0
  234. package/dist/core/sync/platform-sync-summary.js.map +1 -0
  235. package/dist/core/uninstall/flow-aware-uninstaller.js +189 -0
  236. package/dist/core/uninstall/flow-aware-uninstaller.js.map +1 -0
  237. package/dist/core/uninstall/uninstall-file-discovery.js +11 -6
  238. package/dist/core/uninstall/uninstall-file-discovery.js.map +1 -1
  239. package/dist/core/uninstall/uninstall-pipeline.js +141 -0
  240. package/dist/core/uninstall/uninstall-pipeline.js.map +1 -0
  241. package/dist/core/universal-patterns.js +64 -0
  242. package/dist/core/universal-patterns.js.map +1 -0
  243. package/dist/index.js +99 -6
  244. package/dist/index.js.map +1 -1
  245. package/dist/types/flows.js +8 -0
  246. package/dist/types/flows.js.map +1 -0
  247. package/dist/types/index.js +3 -0
  248. package/dist/types/index.js.map +1 -1
  249. package/dist/types/platform-flows.js +8 -0
  250. package/dist/types/platform-flows.js.map +1 -0
  251. package/dist/types/workspace-index.js +6 -0
  252. package/dist/types/workspace-index.js.map +1 -0
  253. package/dist/utils/custom-path-resolution.js +160 -0
  254. package/dist/utils/custom-path-resolution.js.map +1 -0
  255. package/dist/utils/dependency-coverage.js +1 -1
  256. package/dist/utils/dependency-coverage.js.map +1 -1
  257. package/dist/utils/file-processing.js +1 -1
  258. package/dist/utils/flow-index-installer.js +209 -0
  259. package/dist/utils/flow-index-installer.js.map +1 -0
  260. package/dist/utils/formatters.js +47 -1
  261. package/dist/utils/formatters.js.map +1 -1
  262. package/dist/utils/fs.js +17 -0
  263. package/dist/utils/fs.js.map +1 -1
  264. package/dist/utils/git-clone-registry.js +88 -0
  265. package/dist/utils/git-clone-registry.js.map +1 -0
  266. package/dist/utils/git-clone.js +69 -0
  267. package/dist/utils/git-clone.js.map +1 -0
  268. package/dist/utils/git-spec.js +96 -0
  269. package/dist/utils/git-spec.js.map +1 -0
  270. package/dist/utils/http-client.js +7 -0
  271. package/dist/utils/http-client.js.map +1 -1
  272. package/dist/utils/index-based-installer.js +356 -163
  273. package/dist/utils/index-based-installer.js.map +1 -1
  274. package/dist/utils/install-conflict-handler.js +2 -2
  275. package/dist/utils/install-conflict-handler.js.map +1 -1
  276. package/dist/utils/install-file-discovery.js +18 -13
  277. package/dist/utils/install-file-discovery.js.map +1 -1
  278. package/dist/utils/install-helpers.js +43 -20
  279. package/dist/utils/install-helpers.js.map +1 -1
  280. package/dist/utils/jsonc.js +23 -1
  281. package/dist/utils/jsonc.js.map +1 -1
  282. package/dist/utils/manifest-paths.js +1 -1
  283. package/dist/utils/manifest-paths.js.map +1 -1
  284. package/dist/utils/markdown-frontmatter.js +46 -0
  285. package/dist/utils/markdown-frontmatter.js.map +1 -1
  286. package/dist/utils/package-copy.js +5 -103
  287. package/dist/utils/package-copy.js.map +1 -1
  288. package/dist/utils/package-filters.js +9 -105
  289. package/dist/utils/package-filters.js.map +1 -1
  290. package/dist/utils/package-index-yml.js +27 -6
  291. package/dist/utils/package-index-yml.js.map +1 -1
  292. package/dist/utils/package-input.js +98 -0
  293. package/dist/utils/package-input.js.map +1 -0
  294. package/dist/utils/package-management.js +80 -28
  295. package/dist/utils/package-management.js.map +1 -1
  296. package/dist/utils/package-name-resolution.js +327 -0
  297. package/dist/utils/package-name-resolution.js.map +1 -0
  298. package/dist/utils/package-name.js +18 -16
  299. package/dist/utils/package-name.js.map +1 -1
  300. package/dist/utils/package-versioning.js +2 -33
  301. package/dist/utils/package-versioning.js.map +1 -1
  302. package/dist/utils/package-yml.js +19 -28
  303. package/dist/utils/package-yml.js.map +1 -1
  304. package/dist/utils/path-resolution.js +102 -0
  305. package/dist/utils/path-resolution.js.map +1 -0
  306. package/dist/utils/paths.js +6 -6
  307. package/dist/utils/paths.js.map +1 -1
  308. package/dist/utils/platform-file.js +36 -24
  309. package/dist/utils/platform-file.js.map +1 -1
  310. package/dist/utils/platform-mapper.js +222 -68
  311. package/dist/utils/platform-mapper.js.map +1 -1
  312. package/dist/utils/platform-root-files.js +44 -0
  313. package/dist/utils/platform-root-files.js.map +1 -0
  314. package/dist/utils/platform-utils.js +35 -54
  315. package/dist/utils/platform-utils.js.map +1 -1
  316. package/dist/utils/platform-yaml-merge.js +20 -140
  317. package/dist/utils/platform-yaml-merge.js.map +1 -1
  318. package/dist/utils/prompts.js +92 -7
  319. package/dist/utils/prompts.js.map +1 -1
  320. package/dist/utils/registry-entry-filter.js +50 -27
  321. package/dist/utils/registry-entry-filter.js.map +1 -1
  322. package/dist/utils/registry-paths.js +5 -4
  323. package/dist/utils/registry-paths.js.map +1 -1
  324. package/dist/utils/scope-resolution.js +156 -0
  325. package/dist/utils/scope-resolution.js.map +1 -0
  326. package/dist/utils/source-mutability.js +15 -0
  327. package/dist/utils/source-mutability.js.map +1 -0
  328. package/dist/utils/tarball.js +29 -4
  329. package/dist/utils/tarball.js.map +1 -1
  330. package/dist/utils/version-ranges.js +1 -32
  331. package/dist/utils/version-ranges.js.map +1 -1
  332. package/dist/utils/workspace-index-helpers.js +28 -0
  333. package/dist/utils/workspace-index-helpers.js.map +1 -0
  334. package/dist/utils/workspace-index-ownership.js +100 -0
  335. package/dist/utils/workspace-index-ownership.js.map +1 -0
  336. package/dist/utils/workspace-index-yml.js +173 -0
  337. package/dist/utils/workspace-index-yml.js.map +1 -0
  338. package/examples/custom-subdirs-platform.jsonc +157 -0
  339. package/package.json +7 -2
  340. package/platforms.jsonc +531 -84
  341. package/schemas/map-pipeline-v1.json +256 -0
  342. package/schemas/platforms-v1.json +400 -0
  343. package/specs/README.md +88 -0
  344. package/specs/add/README.md +166 -0
  345. package/specs/agents-claude.md +570 -0
  346. package/specs/agents-opencode.md +622 -0
  347. package/specs/apply/README.md +21 -0
  348. package/specs/apply/apply-behavior.md +58 -0
  349. package/specs/apply/apply-command.md +51 -0
  350. package/specs/apply/conflicts.md +41 -0
  351. package/specs/apply/index-effects.md +81 -0
  352. package/specs/architecture.md +107 -0
  353. package/specs/auth/README.md +17 -0
  354. package/specs/auth/auth-http-contract.md +25 -0
  355. package/specs/auth/cli/credentials.md +39 -0
  356. package/specs/auth/cli/login.md +32 -0
  357. package/specs/auth/cli/logout.md +16 -0
  358. package/specs/claude-mcp.md +1065 -0
  359. package/specs/claude-plugins-marketplace.md +363 -0
  360. package/specs/claude-plugins.md +413 -0
  361. package/specs/cli-options.md +52 -0
  362. package/specs/codex-mcp.md +114 -0
  363. package/specs/commands-overview.md +175 -0
  364. package/specs/directory-layout.md +95 -0
  365. package/specs/install/README.md +12 -4
  366. package/specs/install/git-sources.md +230 -0
  367. package/specs/install/install-behavior.md +483 -73
  368. package/specs/install/package-yml-canonical.md +67 -35
  369. package/specs/install/version-resolution.md +69 -115
  370. package/specs/new/README.md +769 -0
  371. package/specs/new/SUMMARY.md +310 -0
  372. package/specs/new/scope-behavior.md +793 -0
  373. package/specs/pack/README.md +77 -0
  374. package/specs/pack/package-name-resolution.md +330 -0
  375. package/specs/package/README.md +18 -17
  376. package/specs/package/nested-packages-and-parent-packages.md +32 -31
  377. package/specs/package/package-index-yml.md +95 -101
  378. package/specs/package/package-root-layout.md +64 -46
  379. package/specs/package/registry-payload-and-copy.md +50 -44
  380. package/specs/package/universal-content.md +33 -56
  381. package/specs/package-sources.md +248 -0
  382. package/specs/platforms/README.md +52 -0
  383. package/specs/platforms/configuration.md +571 -0
  384. package/specs/platforms/detection.md +552 -0
  385. package/specs/platforms/directory-layout.md +599 -0
  386. package/specs/platforms/examples.md +1146 -0
  387. package/specs/platforms/flow-reference.md +1240 -0
  388. package/specs/platforms/flows.md +1488 -0
  389. package/specs/platforms/map-pipeline.md +801 -0
  390. package/specs/platforms/overview.md +349 -0
  391. package/specs/platforms/specification.md +700 -0
  392. package/specs/platforms/troubleshooting.md +697 -0
  393. package/specs/platforms/universal-converter.md +520 -0
  394. package/specs/push/README.md +1 -0
  395. package/specs/push/push-behavior.md +11 -3
  396. package/specs/push/push-remote-upload.md +1 -1
  397. package/specs/push/push-scoping.md +1 -1
  398. package/specs/push/push-version-selection.md +1 -1
  399. package/specs/registry.md +111 -0
  400. package/specs/remove/README.md +257 -0
  401. package/specs/save/README.md +21 -17
  402. package/specs/save/save-conflict-resolution.md +205 -83
  403. package/specs/save/save-file-discovery.md +6 -4
  404. package/specs/save/save-frontmatter-overrides.md +11 -15
  405. package/specs/save/save-modes-inputs.md +9 -39
  406. package/specs/save/save-naming-scoping.md +4 -4
  407. package/specs/save/save-package-detection.md +13 -13
  408. package/specs/save/save-registry-sync.md +16 -106
  409. package/specs/save/save-versioning.md +80 -0
  410. package/specs/scope-management.md +92 -0
  411. package/specs/set/README.md +520 -0
  412. package/specs/set/set-behavior.md +563 -0
  413. package/specs/show/README.md +483 -0
  414. package/specs/show/show-remote.md +494 -0
  415. package/specs/status/README.md +38 -0
  416. package/specs/uninstall/README.md +231 -0
  417. package/dist/commands/duplicate.js +0 -69
  418. package/dist/commands/duplicate.js.map +0 -1
  419. package/dist/commands/init.js +0 -117
  420. package/dist/commands/init.js.map +0 -1
  421. package/dist/commands/prune.js +0 -357
  422. package/dist/commands/prune.js.map +0 -1
  423. package/dist/commands/tui.js +0 -61
  424. package/dist/commands/tui.js.map +0 -1
  425. package/dist/core/install/index.js +0 -3
  426. package/dist/core/install/index.js.map +0 -1
  427. package/dist/core/push/push-single-file.js +0 -56
  428. package/dist/core/push/push-single-file.js.map +0 -1
  429. package/dist/core/save/package-detection.js +0 -147
  430. package/dist/core/save/package-detection.js.map +0 -1
  431. package/dist/core/save/save-single-file.js +0 -124
  432. package/dist/core/save/save-single-file.js.map +0 -1
  433. package/dist/core/token-store.js +0 -73
  434. package/dist/core/token-store.js.map +0 -1
  435. package/dist/tui/app.js +0 -95
  436. package/dist/tui/app.js.map +0 -1
  437. package/dist/tui/components/package-list.js +0 -73
  438. package/dist/tui/components/package-list.js.map +0 -1
  439. package/dist/tui/controller.js +0 -365
  440. package/dist/tui/controller.js.map +0 -1
  441. package/dist/tui/index.js +0 -12
  442. package/dist/tui/index.js.map +0 -1
  443. package/dist/tui/services/file-index.js +0 -64
  444. package/dist/tui/services/file-index.js.map +0 -1
  445. package/dist/tui/services/packages.js +0 -18
  446. package/dist/tui/services/packages.js.map +0 -1
  447. package/dist/tui/services/save.js +0 -21
  448. package/dist/tui/services/save.js.map +0 -1
  449. package/dist/tui/state/app-state.js +0 -15
  450. package/dist/tui/state/app-state.js.map +0 -1
  451. package/dist/tui/state.js +0 -17
  452. package/dist/tui/state.js.map +0 -1
  453. package/dist/tui/types.js.map +0 -1
  454. package/dist/tui/views/add-file-modal.js +0 -129
  455. package/dist/tui/views/add-file-modal.js.map +0 -1
  456. package/dist/tui/views/file-preview.js +0 -44
  457. package/dist/tui/views/file-preview.js.map +0 -1
  458. package/dist/tui/views/list-packages.js +0 -73
  459. package/dist/tui/views/list-packages.js.map +0 -1
  460. package/dist/tui/views/main-menu.js +0 -29
  461. package/dist/tui/views/main-menu.js.map +0 -1
  462. package/dist/tui/views/manage-view.js +0 -81
  463. package/dist/tui/views/manage-view.js.map +0 -1
  464. package/dist/tui/views/package-hub.js +0 -120
  465. package/dist/tui/views/package-hub.js.map +0 -1
  466. package/dist/tui/views/placeholder.js +0 -24
  467. package/dist/tui/views/placeholder.js.map +0 -1
  468. package/dist/utils/bun-bootstrap.js +0 -72
  469. package/dist/utils/bun-bootstrap.js.map +0 -1
  470. package/dist/utils/entity-id.js +0 -19
  471. package/dist/utils/entity-id.js.map +0 -1
  472. package/dist/utils/package-local-files.js +0 -5
  473. package/dist/utils/package-local-files.js.map +0 -1
  474. package/dist/utils/path-matching.js +0 -74
  475. package/dist/utils/path-matching.js.map +0 -1
  476. package/dist/utils/root-file-operations.js +0 -39
  477. package/dist/utils/root-file-operations.js.map +0 -1
  478. package/dist/utils/root-file-transformer.js +0 -27
  479. package/dist/utils/root-file-transformer.js.map +0 -1
  480. package/dist/utils/yaml-frontmatter.js +0 -25
  481. package/dist/utils/yaml-frontmatter.js.map +0 -1
  482. package/specs/auth/auth-device-flow.md +0 -70
  483. package/specs/login/login-device-flow.md +0 -70
  484. package/specs/platforms.md +0 -193
  485. package/specs/save-pack-versioning.md +0 -224
  486. package/specs/save-pack.md +0 -68
  487. /package/dist/{tui → core/source-resolution}/types.js +0 -0
@@ -1,24 +1,24 @@
1
- ### `package.yml` as Canonical for Install
1
+ ### `openpackage.yml` as Canonical for Install
2
2
 
3
- This document defines how `.openpackage/package.yml` interacts with the `install` command, and what it means for `package.yml` to be the **canonical** declaration of dependency intent.
3
+ This document defines how `openpackage.yml` interacts with the `install` command, and what it means for `openpackage.yml` to be the **canonical** declaration of dependency intent.
4
4
 
5
- The aim is to make behavior predictable and avoid “CLI overrides” that silently diverge from `package.yml`.
5
+ The aim is to make behavior predictable and avoid “CLI overrides” that silently diverge from `openpackage.yml`.
6
6
 
7
7
  ---
8
8
 
9
9
  ## 1. Canonical responsibility
10
10
 
11
11
  - **Canonical source of truth**:
12
- - For the **current workspace**, `.openpackage/package.yml` is the **only authoritative declaration** of:
12
+ - For the **current workspace**, `openpackage.yml` is the **only authoritative declaration** of:
13
13
  - Which **direct dependencies** exist.
14
- - Which **version ranges** apply to those dependencies.
14
+ - Which **source** and **version intent** apply to those dependencies.
15
15
  - This applies to both:
16
16
  - `packages` (regular dependencies).
17
17
  - `dev-packages` (development dependencies).
18
18
 
19
19
  - **Install’s role**:
20
20
  - `install` **never changes intent by itself**:
21
- - It does **not mutate existing ranges** in `package.yml` unless explicitly asked by a future higher-level command (e.g. an `upgrade`).
21
+ - It does **not mutate existing ranges** in `openpackage.yml` unless explicitly asked by a future higher-level command (e.g. an `upgrade`).
22
22
  - It **materializes or refreshes** dependencies so the workspace matches the declared intent.
23
23
 
24
24
  ---
@@ -26,29 +26,44 @@ The aim is to make behavior predictable and avoid “CLI overrides” that silen
26
26
  ## 2. Direct vs transitive dependencies
27
27
 
28
28
  - **Direct dependencies**:
29
- - Declared in the workspace `.openpackage/package.yml`.
29
+ - Declared in the workspace `openpackage.yml`.
30
30
  - Fully controlled by the user.
31
- - Canonical range comes from `package.yml`.
31
+ - Canonical range comes from `openpackage.yml`.
32
32
 
33
33
  - **Transitive dependencies**:
34
- - Declared in other packages’ `package.yml` files (inside registry packages).
35
- - Resolved entirely by the dependency resolver according to version constraints; they do not appear in the root `package.yml`.
34
+ - Declared in other packages’ `openpackage.yml` files (inside registry packages).
35
+ - Resolved entirely by the dependency resolver according to version constraints; they do not appear in the root `openpackage.yml`.
36
36
  - `install` may upgrade them within the declared ranges, but they are **not canonical at the root level**.
37
37
 
38
38
  ---
39
39
 
40
40
  ## 3. Mapping CLI input to canonical ranges
41
41
 
42
- ### 3.1 Fresh packages (not yet in `package.yml`)
42
+ ### 3.0 Dependency entry schema (source fields)
43
+
44
+ Each dependency entry MUST specify **exactly one** source field:
45
+
46
+ - `version`: a registry range or exact version (`^1.2.0`, `1.2.3`, `*`, etc.)
47
+ - `path`: a filesystem path to a package directory or tarball
48
+ - `git`: a git URL (https/ssh/etc.) with optional `ref`
49
+
50
+ Additional rules:
51
+
52
+ - `ref` is only valid when `git` is present.
53
+ - A dependency entry MUST NOT specify multiple sources (e.g. `version` + `path`).
54
+
55
+ This keeps dependency intent unambiguous and aligns with modern package managers that treat source types as mutually exclusive.
56
+
57
+ ### 3.1 Fresh packages (not yet in `openpackage.yml`)
43
58
 
44
59
  - **Case A – `opkg install <name>`**:
45
60
  - No explicit range is provided.
46
61
  - The CLI:
47
62
  - Resolves **latest suitable version** from local+remote (see `version-resolution.md`).
48
- - Adds `<name>` to `package.yml` with a **default range derived from that version**, e.g.:
63
+ - Adds `<name>` to `openpackage.yml` with a **default range derived from that version**, e.g.:
49
64
  - `^S` where `S` is the selected stable version.
50
- - If only WIP/pre-release exists, the policy may:
51
- - Use an **exact WIP version** in `package.yml`, or
65
+ - If only a pre-release exists, the policy may:
66
+ - Use an **exact pre-release version** in `openpackage.yml`, or
52
67
  - Use a range that explicitly includes that pre-release.
53
68
  - If the selected version is **unversioned** (manifest omits `version`, represented as `0.0.0` internally), persist the dependency entry **without a `version` field** (bare name), rather than writing `0.0.0`.
54
69
 
@@ -58,11 +73,11 @@ The aim is to make behavior predictable and avoid “CLI overrides” that silen
58
73
  - Uses `<spec>` as the range for selecting a concrete version.
59
74
  - On success:
60
75
  - Installs the selected version.
61
- - **Persists `<spec>` as-is** in `package.yml` (except for any normalization strictly required by the version-range parser).
76
+ - **Persists `<spec>` as-is** in `openpackage.yml` (except for any normalization strictly required by the version-range parser).
62
77
 
63
- ### 3.2 Existing packages (already in `package.yml`)
78
+ ### 3.2 Existing packages (already in `openpackage.yml`)
64
79
 
65
- - Let **`R_pkg`** be the range string stored in `package.yml` for `<name>`.
80
+ - Let **`R_pkg`** be the range string stored in `openpackage.yml` for `<name>`.
66
81
 
67
82
  - **Case C – `opkg install <name>`**:
68
83
  - The canonical range is **`R_pkg`**.
@@ -83,15 +98,28 @@ The aim is to make behavior predictable and avoid “CLI overrides” that silen
83
98
  - Outcomes:
84
99
  - If `<spec>` is **compatible** with `R_pkg`:
85
100
  - Proceed using **`R_pkg` as the effective range** for resolution.
86
- - Optionally log a message: “Using version range from package.yml (`R_pkg`); CLI spec `<spec>` is compatible.”
101
+ - Optionally log a message: “Using version range from openpackage.yml (`R_pkg`); CLI spec `<spec>` is compatible.”
87
102
  - If `<spec>` is **incompatible** with `R_pkg`:
88
103
  - **Fail with a clear error**, for example:
89
- - “Version spec `<spec>` conflicts with `package.yml` range `R_pkg` for `<name>`. Edit `.openpackage/package.yml` if you intend to change the dependency line.”
104
+ - “Version spec `<spec>` conflicts with `openpackage.yml` range `R_pkg` for `<name>`. Edit `openpackage.yml` if you intend to change the dependency line.”
90
105
  - No installs or upgrades are performed.
91
106
 
107
+ ### 3.3 Path and git dependencies (non-registry sources)
108
+
109
+ When a dependency uses `path` or `git`, it is treated as a **source-pinned** dependency rather than a semver-ranged registry dependency:
110
+
111
+ - The installed content is loaded from that source.
112
+ - The installed package version comes from the dependency’s own `openpackage.yml`.
113
+ - `install` MUST NOT write a registry `version` range for `path`/`git` dependencies.
114
+
115
+ For git dependencies:
116
+
117
+ - `git` stores the repository URL.
118
+ - `ref` optionally stores the branch/tag/commit provided by the user.
119
+
92
120
  ---
93
121
 
94
- ## 4. When and how `package.yml` is mutated
122
+ ## 4. When and how `openpackage.yml` is mutated
95
123
 
96
124
  ### 4.1 Allowed mutations by `install`
97
125
 
@@ -103,8 +131,12 @@ The aim is to make behavior predictable and avoid “CLI overrides” that silen
103
131
  - Remove existing entries.
104
132
  - Rewrite existing version ranges.
105
133
 
134
+ - **Adding source-pinned dependencies**:
135
+ - When installing from `path` or `git`, `install` persists the dependency using the corresponding source fields.
136
+ - It must not add a `version` field in these cases (source-pinned dependencies are not semver-ranged).
137
+
106
138
  - **Rewriting malformed entries (edge case)**:
107
- - If `package.yml` contains a **syntactically invalid** version range for a dependency that the user is trying to install:
139
+ - If `openpackage.yml` contains a **syntactically invalid** version range for a dependency that the user is trying to install:
108
140
  - The primary expectation is to **fail with a clear error** and ask the user to fix the YAML.
109
141
  - Auto-rewriting malformed entries should **not** happen silently.
110
142
 
@@ -114,13 +146,13 @@ The aim is to make behavior predictable and avoid “CLI overrides” that silen
114
146
  - `save` / `pack` and any future `upgrade`-like commands are responsible for:
115
147
  - Intentionally changing version lines.
116
148
  - Bumping base versions for stable lines.
117
- - Therefore, `install` **never auto-bumps** the declared ranges in `package.yml`.
149
+ - Therefore, `install` **never auto-bumps** the declared ranges in `openpackage.yml`.
118
150
 
119
151
  - **Auto-tracking of workspace-owned packages (`save` / `pack`)**:
120
152
  - When a package developed in the current workspace is first added as a dependency:
121
153
  - `save` / `pack` persist a **default caret range** derived from the new stable, e.g. `^1.2.3`.
122
154
  - On subsequent `save` / `pack` operations for that same package:
123
- - Let `R_pkg` be the existing range in `package.yml` and `S_new` the new stable base version (e.g. `2.0.0`).
155
+ - Let `R_pkg` be the existing range in `openpackage.yml` and `S_new` the new stable base version (e.g. `2.0.0`).
124
156
  - **Special case: Prerelease-to-stable transition during `pack`**:
125
157
  - If `R_pkg` includes explicit prerelease intent (e.g. `^1.0.0-0`) and `S_new` is a stable version on the same base line (e.g. `1.0.0`):
126
158
  - Then `pack` **updates** `R_pkg` to a stable range (e.g. `^1.0.0`) to reflect the transition from prerelease to stable.
@@ -129,7 +161,7 @@ The aim is to make behavior predictable and avoid “CLI overrides” that silen
129
161
  - If `S_new` **already satisfies** `R_pkg` (e.g. `R_pkg = ^1.0.0`, `S_new = 1.0.1`):
130
162
  - **The constraint is left unchanged**; `save` / `pack` do not rewrite `R_pkg`.
131
163
  - If `S_new` is **outside** `R_pkg` (e.g. `R_pkg = ^1.0.0`, `S_new = 2.0.0`):
132
- - `save` / `pack` may **auto-update** the dependency line in `package.yml` to a new caret range `^S_new` to keep the workspace tracking the new stable line.
164
+ - `save` / `pack` may **auto-update** the dependency line in `openpackage.yml` to a new caret range `^S_new` to keep the workspace tracking the new stable line.
133
165
  - This auto-tracking behavior:
134
166
  - Applies only to dependencies managed via `save` / `pack` for workspace-owned packages.
135
167
  - Never changes constraints that already include the new stable version (except for the prerelease-to-stable transition exception above).
@@ -138,22 +170,22 @@ The aim is to make behavior predictable and avoid “CLI overrides” that silen
138
170
 
139
171
  ## 5. Conflict scenarios & UX
140
172
 
141
- ### 5.1 CLI vs `package.yml` disagreement
173
+ ### 5.1 CLI vs `openpackage.yml` disagreement
142
174
 
143
175
  - **Scenario**:
144
- - `package.yml`: `foo: ^1.2.0`
176
+ - `openpackage.yml`: `foo: ^1.2.0`
145
177
  - User runs: `opkg install foo@2.0.0`
146
178
 
147
179
  - **Behavior**:
148
180
  - Detect that `<spec> = 2.0.0` is **outside** `^1.2.0`.
149
181
  - Fail with a message similar to:
150
- - “Requested `foo@2.0.0`, but `.openpackage/package.yml` declares `foo` with range `^1.2.0`. Edit `package.yml` to change the dependency line, then re-run `opkg install`.”
182
+ - “Requested `foo@2.0.0`, but `openpackage.yml` declares `foo` with range `^1.2.0`. Edit `openpackage.yml` to change the dependency line, then re-run `opkg install`.”
151
183
 
152
- ### 5.2 Existing install but changed `package.yml`
184
+ ### 5.2 Existing install but changed `openpackage.yml`
153
185
 
154
186
  - **Scenario**:
155
187
  - Previously: `foo` declared as `^1.2.0`, installed `1.3.0`.
156
- - User edits `package.yml` to `foo: ^2.0.0`.
188
+ - User edits `openpackage.yml` to `foo: ^2.0.0`.
157
189
  - Then runs `opkg install` or `opkg install foo`.
158
190
 
159
191
  - **Behavior**:
@@ -162,10 +194,10 @@ The aim is to make behavior predictable and avoid “CLI overrides” that silen
162
194
  - Install or upgrade to that version, even if it requires pulling from remote.
163
195
  - Optionally log a message noting that the base line changed, similar to the save/pack reset messages (but this is informational only).
164
196
 
165
- ### 5.3 Dependency removed from `package.yml`
197
+ ### 5.3 Dependency removed from `openpackage.yml`
166
198
 
167
199
  - **Scenario**:
168
- - `foo` used to be in `package.yml`.
200
+ - `foo` used to be in `openpackage.yml`.
169
201
  - User removes `foo` from both `packages` and `dev-packages`.
170
202
  - `foo` may still be installed under `.openpackage` from a previous state.
171
203
 
@@ -187,7 +219,7 @@ The aim is to make behavior predictable and avoid “CLI overrides” that silen
187
219
  - Re-installs with an existing `files` list **reuse** that list as canonical; a TTY prompt may offer to clear it to switch back to a full install.
188
220
  - Supplying a new path via CLI for a dependency that already has `files` **adds** the path (deduped) before install.
189
221
  - Removing the `files` field (or setting it to `null`/empty) returns the dependency to **full-install semantics**.
190
- - If a dependency is currently full (no `files`), a path-based install attempt is **rejected**; convert to partial by editing `package.yml` or reinstalling after removal.
222
+ - If a dependency is currently full (no `files`), a path-based install attempt is **rejected**; convert to partial by editing `openpackage.yml` or reinstalling after removal.
191
223
 
192
224
  - **Matching rules**:
193
225
  - Paths in `files` are **exact registry paths** (no globs) and are normalized when persisted.
@@ -198,7 +230,7 @@ The aim is to make behavior predictable and avoid “CLI overrides” that silen
198
230
  ## 7. Summary invariants
199
231
 
200
232
  - **I1 – Canonical intent**:
201
- - For direct dependencies, **`package.yml` is always the source of truth**.
233
+ - For direct dependencies, **`openpackage.yml` is always the source of truth**.
202
234
  - CLI specs cannot silently override it; at most they can:
203
235
  - Seed new entries (fresh installs).
204
236
  - Act as compatibility hints for existing entries.
@@ -209,8 +241,8 @@ The aim is to make behavior predictable and avoid “CLI overrides” that silen
209
241
  - Only **adds new entries** when installing fresh dependencies.
210
242
 
211
243
  - **I3 – Explicit edits for semantic changes**:
212
- - To change which major version line a dependency tracks, the user **edits `package.yml`**, not `install` flags.
244
+ - To change which major version line a dependency tracks, the user **edits `openpackage.yml`**, not `install` flags.
213
245
  - This mirrors the mental model from the save/pack specs:
214
- - “`package.yml` version is what I’m working toward; commands operate relative to that declaration.”
246
+ - “`openpackage.yml` version is what I’m working toward; commands operate relative to that declaration.”
215
247
 
216
248
 
@@ -3,10 +3,10 @@
3
3
  This document specifies how `install` chooses **which concrete version** of a package to install, given:
4
4
 
5
5
  - A **package name**.
6
- - An **effective version constraint** (from `package.yml` and/or CLI).
6
+ - An **effective version constraint** (from `openpackage.yml` and/or CLI).
7
7
  - Access to **local registry versions** and optionally **remote registry metadata**.
8
8
 
9
- The goal is to implement **“latest in range from local+remote”** deterministically, with clear WIP vs stable semantics.
9
+ The goal is to implement **“latest in range from local+remote”** deterministically, with clear pre-release vs stable semantics.
10
10
 
11
11
  ---
12
12
 
@@ -16,11 +16,11 @@ The goal is to implement **“latest in range from local+remote”** determinist
16
16
  - **Constraint**:
17
17
  - A string understood by `version-ranges` (exact, caret, tilde, wildcard, comparison).
18
18
  - Examples: `1.2.3`, `^1.2.0`, `~2.0.1`, `>=3.0.0 <4.0.0`, `*`, `latest`.
19
- - When a dependency entry in `package.yml` omits `version`, the effective constraint is treated as `*` (wildcard).
19
+ - When a dependency entry in `openpackage.yml` omits `version`, the effective constraint is treated as `*` (wildcard).
20
20
  - **Local versions**:
21
21
  - Semver versions discoverable via `listPackageVersions(name)` from the **local registry**.
22
- - May include a `0.0.0` entry when the package has no `version` in `package.yml`.
23
- - Includes both **stable** and **WIP/pre-release** semver versions, e.g. `1.2.3`, `1.2.3-000fz8.a3k`.
22
+ - May include a `0.0.0` entry when the package has no `version` in `openpackage.yml`.
23
+ - Includes both **stable** and **pre-release** semver versions, e.g. `1.2.3`, `1.2.3-beta.1`.
24
24
  - **Remote versions**:
25
25
  - Semver versions discoverable via remote metadata APIs (e.g. via `fetchRemotePackageMetadata` / registry metadata).
26
26
  - May include a `0.0.0` entry when the remote package has no versioned releases yet.
@@ -33,12 +33,12 @@ The goal is to implement **“latest in range from local+remote”** determinist
33
33
  - **Base rule**:
34
34
  - The **effective `available` set** depends on the resolution mode and scenario, and this rule is applied **uniformly** to:
35
35
  - The **root package** being installed.
36
- - **All recursive dependencies** discovered from `package.yml` files.
36
+ - **All recursive dependencies** discovered from `openpackage.yml` files.
37
37
  - Any **pre-flight checks or validations** that need to answer “what version would be chosen?” for a given name + constraint.
38
38
  - **Local-only / explicit `--local`**:
39
39
  - **`available = local`**.
40
40
  - Remote metadata is **never** consulted; if no satisfying local version exists, resolution fails (see error behavior).
41
- - **Fresh dependency installs in default mode** (e.g. `opkg install <name>` or `opkg install <name>@<spec>` where `<name>` is **not yet declared** in `package.yml`):
41
+ - **Fresh dependency installs in default mode** (e.g. `opkg install <name>` or `opkg install <name>@<spec>` where `<name>` is **not yet declared** in `openpackage.yml`):
42
42
  - Version selection is **local-first with remote fallback**, regardless of whether the effective constraint is a wildcard or an explicit range:
43
43
  - Step 1 – **Local-only attempt**:
44
44
  - Start with **`available_local = local`**.
@@ -53,7 +53,7 @@ The goal is to implement **“latest in range from local+remote”** determinist
53
53
  - Resolution fails with a clear error that:
54
54
  - Explains that no satisfying local version exists, and
55
55
  - Mentions that remote lookup also failed (or was disabled).
56
- - **Existing dependencies in default mode** (e.g. entries already in `package.yml`, or dependencies declared in nested `package.yml` files during recursive resolution):
56
+ - **Existing dependencies in default mode** (e.g. entries already in `openpackage.yml`, or dependencies declared in nested `openpackage.yml` files during recursive resolution):
57
57
  - Resolution also follows a **local-first with remote fallback** policy:
58
58
  - Step 1 – **Local-only attempt**:
59
59
  - Use **only local registry versions** that match the declared range to build `available_local`.
@@ -89,7 +89,7 @@ The goal is to implement **“latest in range from local+remote”** determinist
89
89
  - **Invalid constraints**:
90
90
  - If the constraint string cannot be parsed:
91
91
  - The install operation **fails early** with a clear error.
92
- - The user is instructed to fix the version in `package.yml` for canonical cases, or in the CLI for fresh installs.
92
+ - The user is instructed to fix the version in `openpackage.yml` for canonical cases, or in the CLI for fresh installs.
93
93
 
94
94
  ---
95
95
 
@@ -102,142 +102,98 @@ Given `available: string[]` and a parsed constraint:
102
102
  - Otherwise:
103
103
  - Fail with **"version not found"** and list the nearest available versions (see error UX section).
104
104
 
105
- - **If constraint is `wildcard` / `latest`** (default behavior):
105
+ - **If constraint is `wildcard` / `latest`**:
106
106
  - Use `semver.maxSatisfying(available, '*', { includePrerelease: true })` to find the **highest semver version**.
107
- - **Select the single highest semver version**, stable or WIP/pre-release (if only `0.0.0` exists, it is selected).
108
- - If the selected version is a pre-release/WIP, the CLI should make that explicit in its output.
107
+ - **Select the single highest semver version**, stable or pre-release (if only `0.0.0` exists, it is selected).
108
+ - If the selected version is a pre-release, the CLI should make that explicit in its output.
109
109
 
110
- - **If constraint is `caret`, `tilde`, or `comparison`** (default behavior):
110
+ - **If constraint is `caret`, `tilde`, or `comparison`**:
111
111
  - Use `semver.maxSatisfying(available, range, { includePrerelease: true })` to find the **highest satisfying version**.
112
- - **Select that version** (stable or pre-release/WIP). `0.0.0` satisfies ranges according to standard semver rules.
113
- - No additional "downgrade WIP to stable" heuristic is applied; WIP/pre-release versions are first-class semver versions for resolution purposes.
114
-
115
- - **With `--stable` flag**:
116
- - The selection follows the **stable-preferred policy** described in §5.2.
117
- - For wildcard/ranges: if any satisfying stable version exists, pick the **latest satisfying stable**.
118
- - Only pick prerelease/WIP when **no satisfying stable exists at all**.
112
+ - **Select that version** (stable or pre-release). `0.0.0` satisfies ranges according to standard semver rules.
113
+ - No additional "downgrade pre-release to stable" heuristic is applied; pre-release versions are first-class semver versions for resolution purposes.
119
114
 
120
115
  If no version satisfies the constraint:
121
116
 
122
117
  - The operation **fails** with:
123
118
  - A clear description of:
124
119
  - The requested range.
125
- - The set of available stable and WIP versions.
120
+ - The set of available stable and pre-release versions.
126
121
  - Suggestions for:
127
- - Editing `package.yml` to broaden the range.
128
- - Using `pack` / `save` to create a compatible version.
122
+ - Editing `openpackage.yml` to broaden the range.
123
+ - Using `pack` (or pulling from remote) to create a compatible version.
129
124
 
130
125
  ---
131
126
 
132
- ## 5. WIP vs stable selection policy
127
+ ## 5. Pre-release vs stable selection policy
133
128
 
134
129
  ### 5.1 Definitions
135
130
 
136
131
  - Let **`S`** be a stable version string, e.g. `1.2.3`.
137
- - Let **`W(S)`** be the set of WIP versions derived from `S`, e.g.:
138
- - `1.2.3-<t>.<w>`.
132
+ - Let **`P(S)`** be the set of pre-release versions derived from `S`, e.g.:
133
+ - `1.2.3-beta.1`.
139
134
 
140
- ### 5.2 Default policy: Latest wins (stable and WIP treated uniformly)
135
+ ### 5.2 Latest wins policy (stable and pre-release treated uniformly)
141
136
 
142
137
  - **Latest-in-range selection**:
143
138
  - Among all versions that satisfy the constraint, **choose the highest semver version** according to normal semver ordering (with pre-releases ordered per semver).
144
- - WIP versions (`S-<t>.<w>`) are just a subset of pre-release versions; there is no special demotion to their base stable.
145
- - This ensures that `opkg install <name>` naturally selects the newest available version, including WIPs, which is useful for development workflows.
139
+ - Pre-release versions are first-class semver versions; there is no special demotion to their base stable.
140
+ - This ensures that `opkg install <name>` naturally selects the newest available version, including pre-releases, which can be useful for development workflows.
146
141
 
147
142
  - **Pre-release transparency**:
148
- - When the chosen version is a pre-release/WIP, the CLI **surfaces that fact** in messages and summaries, but does not alter the chosen version.
143
+ - When the chosen version is a pre-release, the CLI **surfaces that fact** in messages and summaries, but does not alter the chosen version.
149
144
  - This helps users understand when they're working with pre-release code.
150
145
 
151
- ### 5.3 Stable-preferred policy (used with `--stable` flag)
152
-
153
- - **Stable dominates WIP for the same base line**:
154
- - If both:
155
- - A stable `S`, and
156
- - One or more WIPs in `W(S)`
157
- **satisfy the constraint**, then:
158
- - **Select `S`**, even if some WIPs have a higher pre-release ordering.
159
- - Rationale:
160
- - Matches the mental model that **packed stable** is the canonical release.
161
- - Useful for CI/production scenarios where stability is preferred.
162
-
163
- - **WIP only when stable is not an option**:
164
- - If:
165
- - No stable versions exist in `available` that satisfy the constraint, but
166
- - One or more WIP (or other pre-release) versions do:
167
- - The resolver picks the **latest WIP** that satisfies the constraint.
168
- - For implicit "latest" / wildcard constraints:
169
- - If **any stable versions** exist at all for that package (even if outside the requested range), prefer telling the user to **widen the range** rather than silently pulling a WIP.
170
-
171
146
  ---
172
147
 
173
148
  ## 6. Behavior per constraint type
174
149
 
175
- ### 6.1 Exact versions (incl. exact WIP)
150
+ ### 6.1 Exact versions (incl. exact pre-release)
176
151
 
177
- - **Example**: `install foo@1.2.3-000fz8.a3k`.
152
+ - **Example**: `install foo@1.2.3-beta.1`.
178
153
  - Behavior:
179
154
  - Use **exact match**:
180
155
  - If that exact version is in `available`, select it.
181
156
  - Otherwise, fail with **“exact version not found”**, show nearby versions.
182
- - No additional WIP/stable heuristics are applied.
157
+ - No additional pre-release/stable heuristics are applied.
183
158
 
184
159
  ### 6.2 Wildcard / latest (`*`, `latest`)
185
160
 
186
161
  - **Fresh dependency default (wildcard)**:
187
- - For `opkg install <name>` where `<name>` is not yet in `package.yml` and the effective constraint is wildcard/latest:
162
+ - For `opkg install <name>` where `<name>` is not yet in `openpackage.yml` and the effective constraint is wildcard/latest:
188
163
  - Resolution follows the **local-first with remote fallback** policy (see §2 and §7):
189
164
  - First, attempt selection using **only local versions** as `available`.
190
165
  - If no local versions exist, or none satisfy the wildcard constraint:
191
166
  - When remote metadata is available, expand `available` to **`dedup(local ∪ remote)`** and retry selection.
192
167
  - Only if **no satisfying version exists in either local or remote**, or remote lookup fails, does the operation error.
193
168
 
194
- - **Default behavior (given an `available` set)**:
169
+ - **Behavior (given an `available` set)**:
195
170
  - Use `semver.maxSatisfying(available, '*', { includePrerelease: true })` to find the **highest semver version**.
196
- - Select that version (stable or WIP/pre-release).
197
- - If the selected version is a pre-release/WIP, the CLI output should make that explicit.
198
-
199
- - **With `--stable` flag**:
200
- - If **stable versions exist** in `available`, select the **latest stable**.
201
- - If **no stable versions exist**:
202
- - Select the **latest WIP / pre-release**.
203
- - The summary should make it explicit that a **pre-release** was chosen.
171
+ - Select that version (stable or pre-release).
172
+ - If the selected version is a pre-release, the CLI output should make that explicit.
204
173
 
205
174
  ### 6.3 Caret / tilde (`^`, `~`)
206
175
 
207
- - **Default behavior**:
176
+ - **Behavior**:
208
177
  - Use `maxSatisfying` with `{ includePrerelease: true }` to find the **highest satisfying version**.
209
- - Select that version directly (stable or WIP/pre-release), using the `available` pool determined by the mode and scenario in §2–§3 (including local-first-with-fallback for fresh dependencies).
210
-
211
- - **With `--stable` flag**:
212
- - Use `maxSatisfying` with `{ includePrerelease: true }` to find the **highest satisfying version**.
213
- - Then:
214
- - If that best version is **stable**, use it.
215
- - If it is **WIP**:
216
- - Check whether the **base stable line** of that WIP (`S`) also has a stable version in `available` satisfying the range.
217
- - If yes, **pick `S` instead**.
218
- - If no, accept the WIP version.
178
+ - Select that version directly (stable or pre-release), using the `available` pool determined by the mode and scenario in §2–§3 (including local-first-with-fallback for fresh dependencies).
219
179
 
220
180
  ### 6.4 Comparison ranges
221
181
 
222
- - **Default behavior**:
182
+ - **Behavior**:
223
183
  - Use `semver.maxSatisfying(available, range, { includePrerelease: true })` to find the **highest satisfying version**.
224
- - Select that version directly (stable or WIP/pre-release), using the `available` pool determined by the mode and scenario in §2–§3 (including local-first-with-fallback for fresh dependencies).
225
-
226
- - **With `--stable` flag**:
227
- - Same as caret/tilde with `--stable`, but using the exact comparison string.
228
- - The stable-preferred rules from §5.3 apply.
184
+ - Select that version directly (stable or pre-release), using the `available` pool determined by the mode and scenario in §2–§3 (including local-first-with-fallback for fresh dependencies).
229
185
 
230
186
  ---
231
187
 
232
188
  ## 7. Local vs remote precedence
233
189
 
234
190
  - **Default mode**:
235
- - For **all dependency resolutions in default mode** (root package and recursive dependencies, whether or not they are already declared in some `package.yml`):
191
+ - For **all dependency resolutions in default mode** (root package and recursive dependencies, whether or not they are already declared in some `openpackage.yml`):
236
192
  - The resolver behaves as **local-first with automatic fallback to remote** as described in §2:
237
193
  - It first attempts to satisfy the effective constraint using **local versions only**.
238
194
  - If no satisfying local version exists, it **includes remote versions** (when available) and retries selection over the combined set.
239
195
  - Only when **neither local nor remote** can satisfy the constraint does it fail with a “no matching versions found” style error.
240
- - For **fresh dependencies** (`opkg install <name>` or `opkg install <name>@<spec>` where `<name>` is not yet in `package.yml`, and `--local` is **not** set):
196
+ - For **fresh dependencies** (`opkg install <name>` or `opkg install <name>@<spec>` where `<name>` is not yet in `openpackage.yml`, and `--local` is **not** set):
241
197
  - This is just a special case of the general rule above, where the dependency is being introduced for the first time into the workspace.
242
198
 
243
199
  - **`--remote` mode**:
@@ -252,65 +208,63 @@ If no version satisfies the constraint:
252
208
  These examples assume remote is reachable.
253
209
 
254
210
  - **Example 1 – Simple caret range**:
255
- - `package.yml`: `foo: ^1.2.0`
211
+ - `openpackage.yml`: `foo: ^1.2.0`
256
212
  - Local: `1.2.3`, `1.3.0`
257
213
  - Remote: `1.3.1`
258
214
  - Selected: **`1.3.1`**.
259
215
 
260
- - **Example 2 – WIP and stable (default behavior)**:
261
- - `package.yml`: `foo: ^1.2.0`
262
- - Local: `1.2.3-000fz8.a3k`, `1.2.3`, `1.3.0-000fz9.a3k`
216
+ - **Example 2 – Pre-release and stable**:
217
+ - `openpackage.yml`: `foo: ^1.2.0`
218
+ - Local: `1.2.3-beta.1`, `1.2.3`, `1.3.0-beta.2`
263
219
  - Remote: `1.3.0`
264
- - Satisfying: `1.2.3`, `1.3.0-000fz9.a3k`, `1.3.0`
220
+ - Satisfying: `1.2.3`, `1.3.0-beta.2`, `1.3.0`
265
221
  - Selected: **`1.3.0`** (highest semver version).
266
- - With `--stable`: **`1.3.0`** (same result, stable preferred).
267
222
 
268
- - **Example 2b – WIP and stable (WIP is newer)**:
269
- - `package.yml`: `foo: ^1.2.0`
270
- - Local: `1.2.3`, `1.3.0-000fz9.a3k`
223
+ - **Example 2b – Pre-release and stable (pre-release is newer)**:
224
+ - `openpackage.yml`: `foo: ^1.2.0`
225
+ - Local: `1.2.3`, `1.3.0-beta.2`
271
226
  - Remote: `1.3.0`
272
- - Satisfying: `1.2.3`, `1.3.0-000fz9.a3k`, `1.3.0`
273
- - Selected (default): **`1.3.0-000fz9.a3k`** (highest semver, even though WIP).
274
- - With `--stable`: **`1.3.0`** (stable preferred over WIP).
227
+ - Satisfying: `1.2.3`, `1.3.0-beta.2`, `1.3.0`
228
+ - Selected: **`1.3.0-beta.2`** (highest semver, even though pre-release).
275
229
 
276
230
  - **Example 3 – No stable exists**:
277
- - `package.yml`: `foo: ^1.0.0-0` (or explicit WIP version).
231
+ - `openpackage.yml`: `foo: ^1.0.0-0` (or explicit pre-release).
278
232
  - Local: none.
279
- - Remote: `1.0.0-000fz8.a3k`, `1.0.1-000fz9.a3k`
280
- - Selected: **`1.0.1-000fz9.a3k`**.
233
+ - Remote: `1.0.0-beta.1`, `1.0.1-beta.1`
234
+ - Selected: **`1.0.1-beta.1`**.
281
235
 
282
- - **Example 4 – Wildcard with only WIPs**:
236
+ - **Example 4 – Wildcard with only pre-releases**:
283
237
  - CLI: `install foo` (fresh dep, default wildcard internally).
284
238
  - Local: none.
285
- - Remote: `0.1.0-000fz8.a3k`
286
- - Selected: **`0.1.0-000fz8.a3k`**, but:
287
- - The CLI should make it clear the installed version is a **pre-release/WIP**.
288
- - The stored range in `package.yml` may be **exact** or chosen policy-driven (e.g. exact WIP string).
239
+ - Remote: `0.1.0-beta.1`
240
+ - Selected: **`0.1.0-beta.1`**, but:
241
+ - The CLI should make it clear the installed version is a **pre-release**.
242
+ - The stored range in `openpackage.yml` may be **exact** or chosen policy-driven (e.g. exact pre-release string).
289
243
 
290
244
  ---
291
245
 
292
- ## 9. Content resolution for WIP versions
246
+ ## 9. Content resolution for pre-release versions
293
247
 
294
- Version resolution chooses **which version string** to install; this section summarizes how content for **local WIP versions** is sourced, and defers full behavior to `install-behavior.md`.
248
+ Version resolution chooses **which version string** to install; this section summarizes how content for **local pre-release versions** is sourced, and defers full behavior to `install-behavior.md`.
295
249
 
296
- - **Local WIP versions as full copies**:
297
- - When the selected version is a WIP that exists locally, it is represented as a **full copied package** in the registry:
298
- - Path: `~/.openpackage/registry/<pkg>/<wipVersion>/...`.
250
+ - **Local pre-release versions as full copies**:
251
+ - When the selected version is a pre-release that exists locally, it is represented as a **full copied package** in the registry:
252
+ - Path: `~/.openpackage/registry/<pkg>/<version>/...`.
299
253
  - The loader must:
300
254
  - Load package files directly from that directory.
301
- - Read the `package.yml` from that directory for metadata.
302
- - The resolved version string (`S-<t>.<w>`) still participates in semver ordering and dependency resolution as specified above.
255
+ - Read the `openpackage.yml` from that directory for metadata.
256
+ - The resolved version string still participates in semver ordering and dependency resolution as specified above.
303
257
 
304
- - **Remote WIPs**:
305
- - Remote registries are expected to expose **copied artifacts** for any WIP versions they publish.
306
- - WIP versions from remote are treated the same as stable versions for content loading (normal registry copies).
258
+ - **Remote pre-releases**:
259
+ - Remote registries may expose copied artifacts for pre-release versions.
260
+ - Pre-release versions from remote are treated the same as stable versions for content loading (normal registry copies).
307
261
 
308
262
  - **Error behavior**:
309
- - If a WIP version is selected but its registry directory is missing or malformed:
263
+ - If a pre-release version is selected but its registry directory is missing or malformed:
310
264
  - The install operation should fail with a clear error instead of silently falling back to another version.
311
265
  - The error should point to:
312
- - The problematic WIP version string.
266
+ - The problematic version string.
313
267
  - The expected registry path.
314
- - Suggested remediation (re-save, pack to stable, or choose a different version).
268
+ - Suggested remediation (re-pack / re-pull, or choose a different version).
315
269
 
316
270