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.
- package/README.md +109 -186
- package/assets/openpackage_ascii_dark.png +0 -0
- package/assets/openpackage_ascii_light.png +0 -0
- package/dist/commands/add.js +34 -10
- package/dist/commands/add.js.map +1 -1
- package/dist/commands/apply.js +16 -0
- package/dist/commands/apply.js.map +1 -0
- package/dist/commands/delete.js +1 -1
- package/dist/commands/delete.js.map +1 -1
- package/dist/commands/install.js +177 -8
- package/dist/commands/install.js.map +1 -1
- package/dist/commands/list.js +2 -2
- package/dist/commands/list.js.map +1 -1
- package/dist/commands/login.js +1 -1
- package/dist/commands/login.js.map +1 -1
- package/dist/commands/logout.js +1 -1
- package/dist/commands/logout.js.map +1 -1
- package/dist/commands/new.js +125 -0
- package/dist/commands/new.js.map +1 -0
- package/dist/commands/pack.js +7 -13
- package/dist/commands/pack.js.map +1 -1
- package/dist/commands/pull.js +1 -1
- package/dist/commands/pull.js.map +1 -1
- package/dist/commands/push.js +1 -1
- package/dist/commands/push.js.map +1 -1
- package/dist/commands/remove.js +63 -0
- package/dist/commands/remove.js.map +1 -0
- package/dist/commands/save.js +11 -17
- package/dist/commands/save.js.map +1 -1
- package/dist/commands/set.js +33 -0
- package/dist/commands/set.js.map +1 -0
- package/dist/commands/show.js +16 -94
- package/dist/commands/show.js.map +1 -1
- package/dist/commands/status.js +26 -701
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/uninstall.js +14 -427
- package/dist/commands/uninstall.js.map +1 -1
- package/dist/constants/index.js +72 -16
- package/dist/constants/index.js.map +1 -1
- package/dist/core/add/add-conflict-handler.js +1 -8
- package/dist/core/add/add-conflict-handler.js.map +1 -1
- package/dist/core/add/add-pipeline.js +12 -10
- package/dist/core/add/add-pipeline.js.map +1 -1
- package/dist/core/add/add-to-source-pipeline.js +123 -0
- package/dist/core/add/add-to-source-pipeline.js.map +1 -0
- package/dist/core/add/package-index-updater.js +77 -78
- package/dist/core/add/package-index-updater.js.map +1 -1
- package/dist/core/add/platform-path-transformer.js +6 -4
- package/dist/core/add/platform-path-transformer.js.map +1 -1
- package/dist/core/add/source-collector.js +2 -3
- package/dist/core/add/source-collector.js.map +1 -1
- package/dist/core/apply/apply-pipeline.js +110 -0
- package/dist/core/apply/apply-pipeline.js.map +1 -0
- package/dist/core/dependency-resolver.js +263 -21
- package/dist/core/dependency-resolver.js.map +1 -1
- package/dist/core/discovery/file-discovery.js +1 -2
- package/dist/core/discovery/file-discovery.js.map +1 -1
- package/dist/core/discovery/platform-files-discovery.js +33 -18
- package/dist/core/discovery/platform-files-discovery.js.map +1 -1
- package/dist/core/flows/flow-executor.js +974 -0
- package/dist/core/flows/flow-executor.js.map +1 -0
- package/dist/core/flows/flow-inverter.js +442 -0
- package/dist/core/flows/flow-inverter.js.map +1 -0
- package/dist/core/flows/flow-key-extractor.js +101 -0
- package/dist/core/flows/flow-key-extractor.js.map +1 -0
- package/dist/core/flows/flow-key-mapper.js +382 -0
- package/dist/core/flows/flow-key-mapper.js.map +1 -0
- package/dist/core/flows/flow-transforms.js +632 -0
- package/dist/core/flows/flow-transforms.js.map +1 -0
- package/dist/core/flows/map-pipeline/context.js +73 -0
- package/dist/core/flows/map-pipeline/context.js.map +1 -0
- package/dist/core/flows/map-pipeline/index.js +156 -0
- package/dist/core/flows/map-pipeline/index.js.map +1 -0
- package/dist/core/flows/map-pipeline/operations/copy.js +104 -0
- package/dist/core/flows/map-pipeline/operations/copy.js.map +1 -0
- package/dist/core/flows/map-pipeline/operations/pipe.js +70 -0
- package/dist/core/flows/map-pipeline/operations/pipe.js.map +1 -0
- package/dist/core/flows/map-pipeline/operations/rename.js +102 -0
- package/dist/core/flows/map-pipeline/operations/rename.js.map +1 -0
- package/dist/core/flows/map-pipeline/operations/set.js +50 -0
- package/dist/core/flows/map-pipeline/operations/set.js.map +1 -0
- package/dist/core/flows/map-pipeline/operations/switch.js +79 -0
- package/dist/core/flows/map-pipeline/operations/switch.js.map +1 -0
- package/dist/core/flows/map-pipeline/operations/transform.js +543 -0
- package/dist/core/flows/map-pipeline/operations/transform.js.map +1 -0
- package/dist/core/flows/map-pipeline/operations/unset.js +65 -0
- package/dist/core/flows/map-pipeline/operations/unset.js.map +1 -0
- package/dist/core/flows/map-pipeline/types.js +8 -0
- package/dist/core/flows/map-pipeline/types.js.map +1 -0
- package/dist/core/flows/map-pipeline/utils.js +278 -0
- package/dist/core/flows/map-pipeline/utils.js.map +1 -0
- package/dist/core/flows/platform-converter.js +328 -0
- package/dist/core/flows/platform-converter.js.map +1 -0
- package/dist/core/flows/source-resolver.js +192 -0
- package/dist/core/flows/source-resolver.js.map +1 -0
- package/dist/core/flows/toml-domain-transforms.js +23 -0
- package/dist/core/flows/toml-domain-transforms.js.map +1 -0
- package/dist/core/install/bulk-install-pipeline.js +68 -7
- package/dist/core/install/bulk-install-pipeline.js.map +1 -1
- package/dist/core/install/canonical-plan.js +3 -3
- package/dist/core/install/canonical-plan.js.map +1 -1
- package/dist/core/install/dry-run.js +3 -3
- package/dist/core/install/dry-run.js.map +1 -1
- package/dist/core/install/flow-based-installer.js +1158 -0
- package/dist/core/install/flow-based-installer.js.map +1 -0
- package/dist/core/install/flow-workspace-tracker.js +111 -0
- package/dist/core/install/flow-workspace-tracker.js.map +1 -0
- package/dist/core/install/format-detector.js +228 -0
- package/dist/core/install/format-detector.js.map +1 -0
- package/dist/core/install/git-package-loader.js +20 -0
- package/dist/core/install/git-package-loader.js.map +1 -0
- package/dist/core/install/install-errors.js +1 -1
- package/dist/core/install/install-errors.js.map +1 -1
- package/dist/core/install/install-flow.js +34 -14
- package/dist/core/install/install-flow.js.map +1 -1
- package/dist/core/install/install-pipeline.js +52 -17
- package/dist/core/install/install-pipeline.js.map +1 -1
- package/dist/core/install/install-reporting.js +26 -8
- package/dist/core/install/install-reporting.js.map +1 -1
- package/dist/core/install/local-source-resolution.js +103 -0
- package/dist/core/install/local-source-resolution.js.map +1 -0
- package/dist/core/install/marketplace-handler.js +221 -0
- package/dist/core/install/marketplace-handler.js.map +1 -0
- package/dist/core/install/path-install-pipeline.js +241 -0
- package/dist/core/install/path-install-pipeline.js.map +1 -0
- package/dist/core/install/path-package-loader.js +116 -0
- package/dist/core/install/path-package-loader.js.map +1 -0
- package/dist/core/install/plugin-detector.js +72 -0
- package/dist/core/install/plugin-detector.js.map +1 -0
- package/dist/core/install/plugin-to-universal-converter.js +218 -0
- package/dist/core/install/plugin-to-universal-converter.js.map +1 -0
- package/dist/core/install/plugin-transformer.js +191 -0
- package/dist/core/install/plugin-transformer.js.map +1 -0
- package/dist/core/install/version-selection.js +1 -1
- package/dist/core/install/version-selection.js.map +1 -1
- package/dist/core/openpackage.js +40 -22
- package/dist/core/openpackage.js.map +1 -1
- package/dist/core/pack/pack-output.js +62 -0
- package/dist/core/pack/pack-output.js.map +1 -0
- package/dist/core/pack/pack-pipeline.js +186 -0
- package/dist/core/pack/pack-pipeline.js.map +1 -0
- package/dist/core/package-context.js +45 -70
- package/dist/core/package-context.js.map +1 -1
- package/dist/core/package-creation.js +203 -0
- package/dist/core/package-creation.js.map +1 -0
- package/dist/core/package.js +20 -6
- package/dist/core/package.js.map +1 -1
- package/dist/core/platforms.js +665 -209
- package/dist/core/platforms.js.map +1 -1
- package/dist/core/push/push-context.js +1 -1
- package/dist/core/push/push-context.js.map +1 -1
- package/dist/core/push/push-upload.js +2 -2
- package/dist/core/push/push-upload.js.map +1 -1
- package/dist/core/registry.js +6 -6
- package/dist/core/registry.js.map +1 -1
- package/dist/core/remote-pull.js +2 -2
- package/dist/core/remote-pull.js.map +1 -1
- package/dist/core/remove/removal-collector.js +52 -0
- package/dist/core/remove/removal-collector.js.map +1 -0
- package/dist/core/remove/removal-confirmation.js +39 -0
- package/dist/core/remove/removal-confirmation.js.map +1 -0
- package/dist/core/remove/remove-from-source-pipeline.js +173 -0
- package/dist/core/remove/remove-from-source-pipeline.js.map +1 -0
- package/dist/core/save/constants.js +3 -3
- package/dist/core/save/constants.js.map +1 -1
- package/dist/core/save/flow-based-saver.js +270 -0
- package/dist/core/save/flow-based-saver.js.map +1 -0
- package/dist/core/save/name-resolution.js +1 -1
- package/dist/core/save/name-resolution.js.map +1 -1
- package/dist/core/save/package-yml-generator.js +4 -5
- package/dist/core/save/package-yml-generator.js.map +1 -1
- package/dist/core/save/save-candidate-builder.js +215 -0
- package/dist/core/save/save-candidate-builder.js.map +1 -0
- package/dist/core/save/save-candidate-loader.js +12 -11
- package/dist/core/save/save-candidate-loader.js.map +1 -1
- package/dist/core/save/save-conflict-analyzer.js +150 -0
- package/dist/core/save/save-conflict-analyzer.js.map +1 -0
- package/dist/core/save/save-conflict-resolution.js +28 -14
- package/dist/core/save/save-conflict-resolution.js.map +1 -1
- package/dist/core/save/save-conflict-resolver.js +31 -275
- package/dist/core/save/save-conflict-resolver.js.map +1 -1
- package/dist/core/save/save-group-builder.js +52 -0
- package/dist/core/save/save-group-builder.js.map +1 -0
- package/dist/core/save/save-interactive-resolver.js +190 -0
- package/dist/core/save/save-interactive-resolver.js.map +1 -0
- package/dist/core/save/save-pipeline.js +58 -34
- package/dist/core/save/save-pipeline.js.map +1 -1
- package/dist/core/save/save-platform-handler.js +53 -0
- package/dist/core/save/save-platform-handler.js.map +1 -0
- package/dist/core/save/save-resolution-executor.js +145 -0
- package/dist/core/save/save-resolution-executor.js.map +1 -0
- package/dist/core/save/save-result-reporter.js +167 -0
- package/dist/core/save/save-result-reporter.js.map +1 -0
- package/dist/core/save/save-to-source-pipeline.js +154 -0
- package/dist/core/save/save-to-source-pipeline.js.map +1 -0
- package/dist/core/save/save-versioning.js +4 -4
- package/dist/core/save/save-versioning.js.map +1 -1
- package/dist/core/save/save-write-coordinator.js +204 -0
- package/dist/core/save/save-write-coordinator.js.map +1 -0
- package/dist/core/save/save-yml-resolution.js +28 -216
- package/dist/core/save/save-yml-resolution.js.map +1 -1
- package/dist/core/save/workspace-rename.js +7 -8
- package/dist/core/save/workspace-rename.js.map +1 -1
- package/dist/core/set/set-output.js +72 -0
- package/dist/core/set/set-output.js.map +1 -0
- package/dist/core/set/set-pipeline.js +361 -0
- package/dist/core/set/set-pipeline.js.map +1 -0
- package/dist/core/set/set-types.js +5 -0
- package/dist/core/set/set-types.js.map +1 -0
- package/dist/core/show/package-resolver.js +257 -0
- package/dist/core/show/package-resolver.js.map +1 -0
- package/dist/core/show/scope-discovery.js +165 -0
- package/dist/core/show/scope-discovery.js.map +1 -0
- package/dist/core/show/show-output.js +168 -0
- package/dist/core/show/show-output.js.map +1 -0
- package/dist/core/show/show-pipeline.js +113 -0
- package/dist/core/show/show-pipeline.js.map +1 -0
- package/dist/core/show/show-types.js +5 -0
- package/dist/core/show/show-types.js.map +1 -0
- package/dist/core/source-resolution/dependency-graph.js +104 -0
- package/dist/core/source-resolution/dependency-graph.js.map +1 -0
- package/dist/core/source-resolution/resolve-mutable-source.js +109 -0
- package/dist/core/source-resolution/resolve-mutable-source.js.map +1 -0
- package/dist/core/source-resolution/resolve-package-source.js +29 -0
- package/dist/core/source-resolution/resolve-package-source.js.map +1 -0
- package/dist/core/source-resolution/resolve-registry-version.js +35 -0
- package/dist/core/source-resolution/resolve-registry-version.js.map +1 -0
- package/dist/core/source-resolution/types.js.map +1 -0
- package/dist/core/status/status-file-discovery.js +23 -12
- package/dist/core/status/status-file-discovery.js.map +1 -1
- package/dist/core/status/status-pipeline.js +134 -0
- package/dist/core/status/status-pipeline.js.map +1 -0
- package/dist/core/sync/platform-sync-summary.js +27 -0
- package/dist/core/sync/platform-sync-summary.js.map +1 -0
- package/dist/core/uninstall/flow-aware-uninstaller.js +189 -0
- package/dist/core/uninstall/flow-aware-uninstaller.js.map +1 -0
- package/dist/core/uninstall/uninstall-file-discovery.js +11 -6
- package/dist/core/uninstall/uninstall-file-discovery.js.map +1 -1
- package/dist/core/uninstall/uninstall-pipeline.js +141 -0
- package/dist/core/uninstall/uninstall-pipeline.js.map +1 -0
- package/dist/core/universal-patterns.js +64 -0
- package/dist/core/universal-patterns.js.map +1 -0
- package/dist/index.js +99 -6
- package/dist/index.js.map +1 -1
- package/dist/types/flows.js +8 -0
- package/dist/types/flows.js.map +1 -0
- package/dist/types/index.js +3 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/platform-flows.js +8 -0
- package/dist/types/platform-flows.js.map +1 -0
- package/dist/types/workspace-index.js +6 -0
- package/dist/types/workspace-index.js.map +1 -0
- package/dist/utils/custom-path-resolution.js +160 -0
- package/dist/utils/custom-path-resolution.js.map +1 -0
- package/dist/utils/dependency-coverage.js +1 -1
- package/dist/utils/dependency-coverage.js.map +1 -1
- package/dist/utils/file-processing.js +1 -1
- package/dist/utils/flow-index-installer.js +209 -0
- package/dist/utils/flow-index-installer.js.map +1 -0
- package/dist/utils/formatters.js +47 -1
- package/dist/utils/formatters.js.map +1 -1
- package/dist/utils/fs.js +17 -0
- package/dist/utils/fs.js.map +1 -1
- package/dist/utils/git-clone-registry.js +88 -0
- package/dist/utils/git-clone-registry.js.map +1 -0
- package/dist/utils/git-clone.js +69 -0
- package/dist/utils/git-clone.js.map +1 -0
- package/dist/utils/git-spec.js +96 -0
- package/dist/utils/git-spec.js.map +1 -0
- package/dist/utils/http-client.js +7 -0
- package/dist/utils/http-client.js.map +1 -1
- package/dist/utils/index-based-installer.js +356 -163
- package/dist/utils/index-based-installer.js.map +1 -1
- package/dist/utils/install-conflict-handler.js +2 -2
- package/dist/utils/install-conflict-handler.js.map +1 -1
- package/dist/utils/install-file-discovery.js +18 -13
- package/dist/utils/install-file-discovery.js.map +1 -1
- package/dist/utils/install-helpers.js +43 -20
- package/dist/utils/install-helpers.js.map +1 -1
- package/dist/utils/jsonc.js +23 -1
- package/dist/utils/jsonc.js.map +1 -1
- package/dist/utils/manifest-paths.js +1 -1
- package/dist/utils/manifest-paths.js.map +1 -1
- package/dist/utils/markdown-frontmatter.js +46 -0
- package/dist/utils/markdown-frontmatter.js.map +1 -1
- package/dist/utils/package-copy.js +5 -103
- package/dist/utils/package-copy.js.map +1 -1
- package/dist/utils/package-filters.js +9 -105
- package/dist/utils/package-filters.js.map +1 -1
- package/dist/utils/package-index-yml.js +27 -6
- package/dist/utils/package-index-yml.js.map +1 -1
- package/dist/utils/package-input.js +98 -0
- package/dist/utils/package-input.js.map +1 -0
- package/dist/utils/package-management.js +80 -28
- package/dist/utils/package-management.js.map +1 -1
- package/dist/utils/package-name-resolution.js +327 -0
- package/dist/utils/package-name-resolution.js.map +1 -0
- package/dist/utils/package-name.js +18 -16
- package/dist/utils/package-name.js.map +1 -1
- package/dist/utils/package-versioning.js +2 -33
- package/dist/utils/package-versioning.js.map +1 -1
- package/dist/utils/package-yml.js +19 -28
- package/dist/utils/package-yml.js.map +1 -1
- package/dist/utils/path-resolution.js +102 -0
- package/dist/utils/path-resolution.js.map +1 -0
- package/dist/utils/paths.js +6 -6
- package/dist/utils/paths.js.map +1 -1
- package/dist/utils/platform-file.js +36 -24
- package/dist/utils/platform-file.js.map +1 -1
- package/dist/utils/platform-mapper.js +222 -68
- package/dist/utils/platform-mapper.js.map +1 -1
- package/dist/utils/platform-root-files.js +44 -0
- package/dist/utils/platform-root-files.js.map +1 -0
- package/dist/utils/platform-utils.js +35 -54
- package/dist/utils/platform-utils.js.map +1 -1
- package/dist/utils/platform-yaml-merge.js +20 -140
- package/dist/utils/platform-yaml-merge.js.map +1 -1
- package/dist/utils/prompts.js +92 -7
- package/dist/utils/prompts.js.map +1 -1
- package/dist/utils/registry-entry-filter.js +50 -27
- package/dist/utils/registry-entry-filter.js.map +1 -1
- package/dist/utils/registry-paths.js +5 -4
- package/dist/utils/registry-paths.js.map +1 -1
- package/dist/utils/scope-resolution.js +156 -0
- package/dist/utils/scope-resolution.js.map +1 -0
- package/dist/utils/source-mutability.js +15 -0
- package/dist/utils/source-mutability.js.map +1 -0
- package/dist/utils/tarball.js +29 -4
- package/dist/utils/tarball.js.map +1 -1
- package/dist/utils/version-ranges.js +1 -32
- package/dist/utils/version-ranges.js.map +1 -1
- package/dist/utils/workspace-index-helpers.js +28 -0
- package/dist/utils/workspace-index-helpers.js.map +1 -0
- package/dist/utils/workspace-index-ownership.js +100 -0
- package/dist/utils/workspace-index-ownership.js.map +1 -0
- package/dist/utils/workspace-index-yml.js +173 -0
- package/dist/utils/workspace-index-yml.js.map +1 -0
- package/examples/custom-subdirs-platform.jsonc +157 -0
- package/package.json +7 -2
- package/platforms.jsonc +531 -84
- package/schemas/map-pipeline-v1.json +256 -0
- package/schemas/platforms-v1.json +400 -0
- package/specs/README.md +88 -0
- package/specs/add/README.md +166 -0
- package/specs/agents-claude.md +570 -0
- package/specs/agents-opencode.md +622 -0
- package/specs/apply/README.md +21 -0
- package/specs/apply/apply-behavior.md +58 -0
- package/specs/apply/apply-command.md +51 -0
- package/specs/apply/conflicts.md +41 -0
- package/specs/apply/index-effects.md +81 -0
- package/specs/architecture.md +107 -0
- package/specs/auth/README.md +17 -0
- package/specs/auth/auth-http-contract.md +25 -0
- package/specs/auth/cli/credentials.md +39 -0
- package/specs/auth/cli/login.md +32 -0
- package/specs/auth/cli/logout.md +16 -0
- package/specs/claude-mcp.md +1065 -0
- package/specs/claude-plugins-marketplace.md +363 -0
- package/specs/claude-plugins.md +413 -0
- package/specs/cli-options.md +52 -0
- package/specs/codex-mcp.md +114 -0
- package/specs/commands-overview.md +175 -0
- package/specs/directory-layout.md +95 -0
- package/specs/install/README.md +12 -4
- package/specs/install/git-sources.md +230 -0
- package/specs/install/install-behavior.md +483 -73
- package/specs/install/package-yml-canonical.md +67 -35
- package/specs/install/version-resolution.md +69 -115
- package/specs/new/README.md +769 -0
- package/specs/new/SUMMARY.md +310 -0
- package/specs/new/scope-behavior.md +793 -0
- package/specs/pack/README.md +77 -0
- package/specs/pack/package-name-resolution.md +330 -0
- package/specs/package/README.md +18 -17
- package/specs/package/nested-packages-and-parent-packages.md +32 -31
- package/specs/package/package-index-yml.md +95 -101
- package/specs/package/package-root-layout.md +64 -46
- package/specs/package/registry-payload-and-copy.md +50 -44
- package/specs/package/universal-content.md +33 -56
- package/specs/package-sources.md +248 -0
- package/specs/platforms/README.md +52 -0
- package/specs/platforms/configuration.md +571 -0
- package/specs/platforms/detection.md +552 -0
- package/specs/platforms/directory-layout.md +599 -0
- package/specs/platforms/examples.md +1146 -0
- package/specs/platforms/flow-reference.md +1240 -0
- package/specs/platforms/flows.md +1488 -0
- package/specs/platforms/map-pipeline.md +801 -0
- package/specs/platforms/overview.md +349 -0
- package/specs/platforms/specification.md +700 -0
- package/specs/platforms/troubleshooting.md +697 -0
- package/specs/platforms/universal-converter.md +520 -0
- package/specs/push/README.md +1 -0
- package/specs/push/push-behavior.md +11 -3
- package/specs/push/push-remote-upload.md +1 -1
- package/specs/push/push-scoping.md +1 -1
- package/specs/push/push-version-selection.md +1 -1
- package/specs/registry.md +111 -0
- package/specs/remove/README.md +257 -0
- package/specs/save/README.md +21 -17
- package/specs/save/save-conflict-resolution.md +205 -83
- package/specs/save/save-file-discovery.md +6 -4
- package/specs/save/save-frontmatter-overrides.md +11 -15
- package/specs/save/save-modes-inputs.md +9 -39
- package/specs/save/save-naming-scoping.md +4 -4
- package/specs/save/save-package-detection.md +13 -13
- package/specs/save/save-registry-sync.md +16 -106
- package/specs/save/save-versioning.md +80 -0
- package/specs/scope-management.md +92 -0
- package/specs/set/README.md +520 -0
- package/specs/set/set-behavior.md +563 -0
- package/specs/show/README.md +483 -0
- package/specs/show/show-remote.md +494 -0
- package/specs/status/README.md +38 -0
- package/specs/uninstall/README.md +231 -0
- package/dist/commands/duplicate.js +0 -69
- package/dist/commands/duplicate.js.map +0 -1
- package/dist/commands/init.js +0 -117
- package/dist/commands/init.js.map +0 -1
- package/dist/commands/prune.js +0 -357
- package/dist/commands/prune.js.map +0 -1
- package/dist/commands/tui.js +0 -61
- package/dist/commands/tui.js.map +0 -1
- package/dist/core/install/index.js +0 -3
- package/dist/core/install/index.js.map +0 -1
- package/dist/core/push/push-single-file.js +0 -56
- package/dist/core/push/push-single-file.js.map +0 -1
- package/dist/core/save/package-detection.js +0 -147
- package/dist/core/save/package-detection.js.map +0 -1
- package/dist/core/save/save-single-file.js +0 -124
- package/dist/core/save/save-single-file.js.map +0 -1
- package/dist/core/token-store.js +0 -73
- package/dist/core/token-store.js.map +0 -1
- package/dist/tui/app.js +0 -95
- package/dist/tui/app.js.map +0 -1
- package/dist/tui/components/package-list.js +0 -73
- package/dist/tui/components/package-list.js.map +0 -1
- package/dist/tui/controller.js +0 -365
- package/dist/tui/controller.js.map +0 -1
- package/dist/tui/index.js +0 -12
- package/dist/tui/index.js.map +0 -1
- package/dist/tui/services/file-index.js +0 -64
- package/dist/tui/services/file-index.js.map +0 -1
- package/dist/tui/services/packages.js +0 -18
- package/dist/tui/services/packages.js.map +0 -1
- package/dist/tui/services/save.js +0 -21
- package/dist/tui/services/save.js.map +0 -1
- package/dist/tui/state/app-state.js +0 -15
- package/dist/tui/state/app-state.js.map +0 -1
- package/dist/tui/state.js +0 -17
- package/dist/tui/state.js.map +0 -1
- package/dist/tui/types.js.map +0 -1
- package/dist/tui/views/add-file-modal.js +0 -129
- package/dist/tui/views/add-file-modal.js.map +0 -1
- package/dist/tui/views/file-preview.js +0 -44
- package/dist/tui/views/file-preview.js.map +0 -1
- package/dist/tui/views/list-packages.js +0 -73
- package/dist/tui/views/list-packages.js.map +0 -1
- package/dist/tui/views/main-menu.js +0 -29
- package/dist/tui/views/main-menu.js.map +0 -1
- package/dist/tui/views/manage-view.js +0 -81
- package/dist/tui/views/manage-view.js.map +0 -1
- package/dist/tui/views/package-hub.js +0 -120
- package/dist/tui/views/package-hub.js.map +0 -1
- package/dist/tui/views/placeholder.js +0 -24
- package/dist/tui/views/placeholder.js.map +0 -1
- package/dist/utils/bun-bootstrap.js +0 -72
- package/dist/utils/bun-bootstrap.js.map +0 -1
- package/dist/utils/entity-id.js +0 -19
- package/dist/utils/entity-id.js.map +0 -1
- package/dist/utils/package-local-files.js +0 -5
- package/dist/utils/package-local-files.js.map +0 -1
- package/dist/utils/path-matching.js +0 -74
- package/dist/utils/path-matching.js.map +0 -1
- package/dist/utils/root-file-operations.js +0 -39
- package/dist/utils/root-file-operations.js.map +0 -1
- package/dist/utils/root-file-transformer.js +0 -27
- package/dist/utils/root-file-transformer.js.map +0 -1
- package/dist/utils/yaml-frontmatter.js +0 -25
- package/dist/utils/yaml-frontmatter.js.map +0 -1
- package/specs/auth/auth-device-flow.md +0 -70
- package/specs/login/login-device-flow.md +0 -70
- package/specs/platforms.md +0 -193
- package/specs/save-pack-versioning.md +0 -224
- package/specs/save-pack.md +0 -68
- /package/dist/{tui → core/source-resolution}/types.js +0 -0
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
### `
|
|
1
|
+
### `openpackage.yml` as Canonical for Install
|
|
2
2
|
|
|
3
|
-
This document defines how
|
|
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 `
|
|
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**,
|
|
12
|
+
- For the **current workspace**, `openpackage.yml` is the **only authoritative declaration** of:
|
|
13
13
|
- Which **direct dependencies** exist.
|
|
14
|
-
- Which **version
|
|
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 `
|
|
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
|
|
29
|
+
- Declared in the workspace `openpackage.yml`.
|
|
30
30
|
- Fully controlled by the user.
|
|
31
|
-
- Canonical range comes from `
|
|
31
|
+
- Canonical range comes from `openpackage.yml`.
|
|
32
32
|
|
|
33
33
|
- **Transitive dependencies**:
|
|
34
|
-
- Declared in other packages’ `
|
|
35
|
-
- Resolved entirely by the dependency resolver according to version constraints; they do not appear in the root `
|
|
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.
|
|
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 `
|
|
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
|
|
51
|
-
- Use an **exact
|
|
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 `
|
|
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 `
|
|
78
|
+
### 3.2 Existing packages (already in `openpackage.yml`)
|
|
64
79
|
|
|
65
|
-
- Let **`R_pkg`** be the range string stored in `
|
|
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
|
|
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 `
|
|
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 `
|
|
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 `
|
|
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 `
|
|
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 `
|
|
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 `
|
|
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 `
|
|
173
|
+
### 5.1 CLI vs `openpackage.yml` disagreement
|
|
142
174
|
|
|
143
175
|
- **Scenario**:
|
|
144
|
-
- `
|
|
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
|
|
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 `
|
|
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 `
|
|
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 `
|
|
197
|
+
### 5.3 Dependency removed from `openpackage.yml`
|
|
166
198
|
|
|
167
199
|
- **Scenario**:
|
|
168
|
-
- `foo` used to be in `
|
|
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 `
|
|
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, **`
|
|
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 `
|
|
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
|
-
- “`
|
|
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 `
|
|
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
|
|
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 `
|
|
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 `
|
|
23
|
-
- Includes both **stable** and **
|
|
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 `
|
|
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 `
|
|
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 `
|
|
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 `
|
|
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
|
|
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
|
|
108
|
-
- If the selected version is a pre-release
|
|
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
|
|
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
|
|
113
|
-
- No additional "downgrade
|
|
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
|
|
120
|
+
- The set of available stable and pre-release versions.
|
|
126
121
|
- Suggestions for:
|
|
127
|
-
- Editing `
|
|
128
|
-
- Using `pack`
|
|
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.
|
|
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 **`
|
|
138
|
-
- `1.2.3
|
|
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
|
|
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
|
-
-
|
|
145
|
-
- This ensures that `opkg install <name>` naturally selects the newest available version, including
|
|
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
|
|
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
|
|
150
|
+
### 6.1 Exact versions (incl. exact pre-release)
|
|
176
151
|
|
|
177
|
-
- **Example**: `install foo@1.2.3-
|
|
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
|
|
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 `
|
|
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
|
-
- **
|
|
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
|
|
197
|
-
- If the selected version is a pre-release
|
|
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
|
-
- **
|
|
176
|
+
- **Behavior**:
|
|
208
177
|
- Use `maxSatisfying` with `{ includePrerelease: true }` to find the **highest satisfying version**.
|
|
209
|
-
- Select that version directly (stable or
|
|
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
|
-
- **
|
|
182
|
+
- **Behavior**:
|
|
223
183
|
- Use `semver.maxSatisfying(available, range, { includePrerelease: true })` to find the **highest satisfying version**.
|
|
224
|
-
- Select that version directly (stable or
|
|
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 `
|
|
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 `
|
|
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
|
-
- `
|
|
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 –
|
|
261
|
-
- `
|
|
262
|
-
- Local: `1.2.3-
|
|
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-
|
|
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 –
|
|
269
|
-
- `
|
|
270
|
-
- Local: `1.2.3`, `1.3.0-
|
|
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-
|
|
273
|
-
- Selected
|
|
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
|
-
- `
|
|
231
|
+
- `openpackage.yml`: `foo: ^1.0.0-0` (or explicit pre-release).
|
|
278
232
|
- Local: none.
|
|
279
|
-
- Remote: `1.0.0-
|
|
280
|
-
- Selected: **`1.0.1-
|
|
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
|
|
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-
|
|
286
|
-
- Selected: **`0.1.0-
|
|
287
|
-
- The CLI should make it clear the installed version is a **pre-release
|
|
288
|
-
- The stored range in `
|
|
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
|
|
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
|
|
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
|
|
297
|
-
- When the selected version is a
|
|
298
|
-
- Path: `~/.openpackage/registry/<pkg>/<
|
|
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 `
|
|
302
|
-
- The resolved version string
|
|
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
|
|
305
|
-
- Remote registries
|
|
306
|
-
-
|
|
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
|
|
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
|
|
266
|
+
- The problematic version string.
|
|
313
267
|
- The expected registry path.
|
|
314
|
-
- Suggested remediation (re-
|
|
268
|
+
- Suggested remediation (re-pack / re-pull, or choose a different version).
|
|
315
269
|
|
|
316
270
|
|