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
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
# Commands Overview
|
|
2
|
+
|
|
3
|
+
This file provides high-level semantics for core commands in the path-based model. Detailed behaviors in subdirs (e.g., [Save](save/), [Pack](pack/)). Commands enforce mutability (e.g., save/add require mutable sources).
|
|
4
|
+
|
|
5
|
+
## Command Summary
|
|
6
|
+
|
|
7
|
+
| Command | Direction | Purpose | Mutable Source | Immutable Source |
|
|
8
|
+
|---------|-----------|---------|----------------|------------------|
|
|
9
|
+
| `new` | N/A | Create package manifest | N/A | N/A |
|
|
10
|
+
| `add` | Filesystem → Source | Add new files (source-only) | ✅ | ❌ Error |
|
|
11
|
+
| `remove` | Source → Deletion | Remove files from source (source-only) | ✅ | ❌ Error |
|
|
12
|
+
| `save` | Workspace → Source | Sync edits back (requires install) | ✅ | ❌ Error |
|
|
13
|
+
| `set` | N/A | Update manifest metadata | ✅ | ❌ Error |
|
|
14
|
+
| `pack` | Source → Registry | Create immutable snapshot | ✅ | N/A |
|
|
15
|
+
| `apply` | Source/Registry → Workspace | Sync content to platforms + update index | ✅ | ✅ |
|
|
16
|
+
| `install` | Registry → Workspace | Install version (git/path too) + update index | N/A | ✅ |
|
|
17
|
+
| `show` | N/A | Display package details (read-only) | ✅ | ✅ |
|
|
18
|
+
| `status` | N/A | Report sync state | ✅ | ✅ |
|
|
19
|
+
| `uninstall` | Workspace | Remove package files/mappings | ✅ | ✅ |
|
|
20
|
+
| `push` | Local → Remote | Upload (deferred details) | N/A | N/A |
|
|
21
|
+
|
|
22
|
+
Other: `list`, `login`/`logout` in subdocs or future.
|
|
23
|
+
|
|
24
|
+
## Detailed Semantics
|
|
25
|
+
|
|
26
|
+
### `save`
|
|
27
|
+
|
|
28
|
+
Sync workspace changes to mutable source via index mappings.
|
|
29
|
+
|
|
30
|
+
- Preconditions: Mutable source; fails on registry.
|
|
31
|
+
- Flow: Read index → Collect/resolve conflicts (mtime, platforms) → Write to source.
|
|
32
|
+
- Versioning: Computes WIP prerelease; copies full to registry for persistence.
|
|
33
|
+
- Example: `opkg save my-pkg` (or `opkg save <path>` for add-like).
|
|
34
|
+
- See [Save](save/) and [Save Versioning](save/save-versioning.md).
|
|
35
|
+
|
|
36
|
+
### `add`
|
|
37
|
+
|
|
38
|
+
Add new files from anywhere to mutable source (workspace or global packages).
|
|
39
|
+
|
|
40
|
+
- Preconditions: Mutable package source (workspace or global); **does not require installation**.
|
|
41
|
+
- Flow: Resolve mutable source → Collect input → Map (platform→universal, root→root, other→root/<rel>) → Copy to source.
|
|
42
|
+
- **No index updates**: `add` only modifies package source. To sync to workspace, use `install` + `apply` or `--apply` flag.
|
|
43
|
+
- Options: `--apply` (sync to workspace immediately; requires package to be installed in current workspace).
|
|
44
|
+
- Example:
|
|
45
|
+
- `opkg add my-pkg ./new-files/` (source-only)
|
|
46
|
+
- `opkg add my-pkg ./file.md --apply` (source + workspace sync)
|
|
47
|
+
- Works from any directory with any mutable package.
|
|
48
|
+
- See [Add](add/).
|
|
49
|
+
|
|
50
|
+
### `remove`
|
|
51
|
+
|
|
52
|
+
Remove files from mutable source.
|
|
53
|
+
|
|
54
|
+
- Preconditions: Mutable source; fails on registry.
|
|
55
|
+
- Flow: Resolve source → Collect files → Confirm → Delete → Clean up empty dirs.
|
|
56
|
+
- **No index updates**: `remove` only modifies package source. To sync deletions to workspace, use `apply` or `--apply` flag.
|
|
57
|
+
- Options: `--apply` (sync to workspace immediately; requires package to be installed in current workspace), `--force` (skip confirmation), `--dry-run` (preview).
|
|
58
|
+
- Example:
|
|
59
|
+
- `opkg remove my-pkg commands/deprecated.md` (source-only)
|
|
60
|
+
- `opkg remove my-pkg rules/old/ --apply` (source + workspace sync)
|
|
61
|
+
- `opkg remove my-pkg commands/ --dry-run` (preview)
|
|
62
|
+
- Works from any directory with any mutable package.
|
|
63
|
+
- Opposite of `add` command.
|
|
64
|
+
- See [Remove](remove/).
|
|
65
|
+
|
|
66
|
+
### `set`
|
|
67
|
+
|
|
68
|
+
Update manifest metadata fields in openpackage.yml for mutable packages.
|
|
69
|
+
|
|
70
|
+
- Preconditions: Mutable source; fails on registry.
|
|
71
|
+
- Flow: Resolve package → Load manifest → Collect updates (interactive or flags) → Validate → Apply → Write.
|
|
72
|
+
- Modes: Interactive (prompts for fields), Batch (via CLI flags), Non-interactive (CI/CD).
|
|
73
|
+
- Fields: `--ver` (version), `--name`, `--description`, `--keywords`, `--author`, `--license`, `--homepage`, `--private`.
|
|
74
|
+
- Options: `--force` (skip confirmation), `--non-interactive` (require flags).
|
|
75
|
+
- Example:
|
|
76
|
+
- `opkg set my-pkg --ver 1.2.0` (update version)
|
|
77
|
+
- `opkg set my-pkg` (interactive mode)
|
|
78
|
+
- `opkg set --ver 2.0.0 --description "Updated"` (CWD package)
|
|
79
|
+
- See [Set](set/).
|
|
80
|
+
|
|
81
|
+
### `pack`
|
|
82
|
+
|
|
83
|
+
Archive mutable source to registry snapshot.
|
|
84
|
+
|
|
85
|
+
- Flow: Read source → Version from yml/compute → Copy dir to registry/<name>/<ver>/.
|
|
86
|
+
- Options: `--output <path>` (bypass registry), `--dry-run`.
|
|
87
|
+
- Ties to save: Promotes stable from WIP line.
|
|
88
|
+
- Example: `opkg pack my-pkg`.
|
|
89
|
+
- See [Pack](pack/).
|
|
90
|
+
|
|
91
|
+
### `apply`
|
|
92
|
+
|
|
93
|
+
Sync from source/registry to workspace platforms/root.
|
|
94
|
+
|
|
95
|
+
- Flow: Resolve path → Map files → Write/update → Update index.
|
|
96
|
+
- Handles universal/platform variants, conflicts.
|
|
97
|
+
- Example: `opkg apply my-pkg`.
|
|
98
|
+
- See [Apply](apply/).
|
|
99
|
+
|
|
100
|
+
### `install`
|
|
101
|
+
|
|
102
|
+
Resolve/install from registry/git/path to workspace.
|
|
103
|
+
|
|
104
|
+
- Flow: Resolve ver/source → Apply files → Update yml (constraint) / index (path/ver/mappings).
|
|
105
|
+
- Partial via `files:` supported.
|
|
106
|
+
- **Claude Code plugin support**: Automatically detects and transforms plugins from git sources (individual plugins or marketplaces with interactive selection).
|
|
107
|
+
- Subdirectory support: `git:url#ref&subdirectory=path` for monorepos and plugin marketplaces.
|
|
108
|
+
- Example:
|
|
109
|
+
- `opkg install community-pkg@^1.0.0` (registry)
|
|
110
|
+
- `opkg install github:anthropics/claude-code#subdirectory=plugins/commit-commands` (plugin)
|
|
111
|
+
- `opkg install github:anthropics/claude-code` (marketplace with interactive selection)
|
|
112
|
+
- See [Install](install/).
|
|
113
|
+
|
|
114
|
+
### `status`
|
|
115
|
+
|
|
116
|
+
Check package states.
|
|
117
|
+
|
|
118
|
+
- Flow: Read index → Validate paths → Hash compare source vs. workspace → Report (synced/modified/missing).
|
|
119
|
+
- Example: `opkg status` (✅/⚠️/❌ output).
|
|
120
|
+
- See [Status](status/).
|
|
121
|
+
|
|
122
|
+
### `uninstall`
|
|
123
|
+
|
|
124
|
+
Remove package from workspace.
|
|
125
|
+
|
|
126
|
+
- Flow: Read index → Delete mapped files (not source) → Remove sections from root files → Update index/yml.
|
|
127
|
+
- Example: `opkg uninstall my-pkg`.
|
|
128
|
+
- See [Uninstall](uninstall/).
|
|
129
|
+
|
|
130
|
+
### `show`
|
|
131
|
+
|
|
132
|
+
Display detailed package information (read-only inspection).
|
|
133
|
+
|
|
134
|
+
- Purpose: Inspect packages from any source without modification.
|
|
135
|
+
- Flow: Classify input → Resolve package location → Collect metadata/files → Display formatted output.
|
|
136
|
+
- Sources: Package names (unified resolution), paths, git URLs, tarballs.
|
|
137
|
+
- Resolution Priority: CWD → Workspace → Global → Registry (same as `pack`).
|
|
138
|
+
- Options: None currently (future: `--remote`, `--json`, `--tree`).
|
|
139
|
+
- Example:
|
|
140
|
+
- `opkg show my-pkg` (by name)
|
|
141
|
+
- `opkg show .openpackage/packages/shared-utils` (by path)
|
|
142
|
+
- `opkg show git:https://github.com/user/repo.git#main` (from git)
|
|
143
|
+
- Output: Name, version, source, type, description, dependencies, file list.
|
|
144
|
+
- See [Show](show/).
|
|
145
|
+
|
|
146
|
+
### `new`
|
|
147
|
+
|
|
148
|
+
Create a new package with manifest.
|
|
149
|
+
|
|
150
|
+
- Flow: Prompt for scope (if interactive) → Validate scope/name → Resolve target path → Create directory → Write openpackage.yml → Optional workspace integration.
|
|
151
|
+
- Scopes: `root` (cwd), `local` (workspace), `global` (cross-workspace).
|
|
152
|
+
- Scope Selection: Interactive prompt when `--scope` not provided; required in non-interactive mode.
|
|
153
|
+
- Options: `--scope`, `--force`, `--non-interactive`.
|
|
154
|
+
- Example: `opkg new my-pkg` (prompts for scope), `opkg new utils --scope global` (explicit global).
|
|
155
|
+
- See [New](new/).
|
|
156
|
+
|
|
157
|
+
## Mutability Matrix (Expanded)
|
|
158
|
+
|
|
159
|
+
| Command | Mutable Source | Immutable Source | Creates Files In |
|
|
160
|
+
|---------|----------------|------------------|------------------|
|
|
161
|
+
| `new` | N/A | N/A | Package location (scope-dependent) |
|
|
162
|
+
| `save` | ✅ Syncs to source | ❌ Error | Source path |
|
|
163
|
+
| `add` | ✅ Adds to source | ❌ Error | Source path |
|
|
164
|
+
| `remove` | ✅ Removes from source | ❌ Error | N/A (deletes) |
|
|
165
|
+
| `set` | ✅ Updates manifest | ❌ Error | Source path |
|
|
166
|
+
| `pack` | ✅ Creates version | N/A | Registry |
|
|
167
|
+
| `apply` | ✅ Syncs to workspace | ✅ Syncs to workspace | Workspace |
|
|
168
|
+
| `install` | N/A | ✅ Syncs to workspace | Workspace |
|
|
169
|
+
| `show` | ✅ Displays info | ✅ Displays info | N/A (read-only) |
|
|
170
|
+
| `status` | ✅ Shows status | ✅ Shows status | N/A |
|
|
171
|
+
| `uninstall` | ✅ Removes | ✅ Removes | N/A (deletes) |
|
|
172
|
+
|
|
173
|
+
See table above for summary; full ops rules in [Package Sources](package-sources.md).
|
|
174
|
+
|
|
175
|
+
For CLI options common to commands, see [CLI Options](cli-options.md). Future commands (e.g., elevate) in [Scope Management](scope-management.md).
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# Directory Layout
|
|
2
|
+
|
|
3
|
+
This document describes the global (`~/.openpackage/`) and workspace directory structures central to the path-based model.
|
|
4
|
+
|
|
5
|
+
## Global Directory (`~/.openpackage/`)
|
|
6
|
+
|
|
7
|
+
The global dir holds shared mutable sources and local registry snapshots.
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
~/.openpackage/
|
|
11
|
+
├── packages/ # Mutable development codebases
|
|
12
|
+
│ ├── <name>/ # e.g., shared-rules/
|
|
13
|
+
│ │ ├── openpackage.yml # Manifest
|
|
14
|
+
│ │ ├── commands/ # Universal content
|
|
15
|
+
│ │ ├── rules/
|
|
16
|
+
│ │ └── root/ # Copy-to-root files
|
|
17
|
+
│ └── @scope/ # Scoped (e.g., @org/tools/)
|
|
18
|
+
│ └── <name>/
|
|
19
|
+
│
|
|
20
|
+
├── registry/ # Immutable versioned snapshots
|
|
21
|
+
│ ├── <name>/ # Directory-based (no tarballs)
|
|
22
|
+
│ │ ├── <version>/ # e.g., 1.0.0/
|
|
23
|
+
│ │ │ ├── openpackage.yml
|
|
24
|
+
│ │ │ ├── commands/
|
|
25
|
+
│ │ │ ├── rules/
|
|
26
|
+
│ │ │ └── AGENTS.md # Root files
|
|
27
|
+
│ │ └── <version>/
|
|
28
|
+
│ └── @scope/
|
|
29
|
+
│ └── <name>/
|
|
30
|
+
│ └── <version>/
|
|
31
|
+
│
|
|
32
|
+
└── config.yml # Global config (future?)
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Workspace Directory
|
|
36
|
+
|
|
37
|
+
Workspace-local metadata and packages; platforms are sync targets.
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
<workspace>/
|
|
41
|
+
├── .openpackage/ # Local metadata & packages
|
|
42
|
+
│ ├── openpackage.yml # Root manifest (deps)
|
|
43
|
+
│ ├── openpackage.index.yml # Unified index (all packages/sources/mappings)
|
|
44
|
+
│ └── packages/ # Workspace-local mutable sources
|
|
45
|
+
│ └── <name>/ # e.g., project-tools/
|
|
46
|
+
│ ├── openpackage.yml
|
|
47
|
+
│ ├── commands/
|
|
48
|
+
│ └── root/
|
|
49
|
+
│
|
|
50
|
+
├── .cursor/ # Platform dir (sync target)
|
|
51
|
+
│ ├── rules/ # From package universal subdirs
|
|
52
|
+
│ └── commands/
|
|
53
|
+
├── .opencode/ # Other platforms
|
|
54
|
+
│ └── ...
|
|
55
|
+
└── docs/ # Root-level (e.g., from package root/ or AGENTS.md processing)
|
|
56
|
+
└── ...
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Directory Purposes
|
|
60
|
+
|
|
61
|
+
| Directory | Purpose | Mutability | Notes |
|
|
62
|
+
|-----------|---------|------------|-------|
|
|
63
|
+
| `~/.openpackage/packages/` | Global shared dev codebases | ✅ Mutable | Cross-workspace sharing |
|
|
64
|
+
| `~/.openpackage/registry/` | Versioned immutable snapshots | ❌ Immutable | From pack; git clones cached here |
|
|
65
|
+
| `./.openpackage/packages/` | Workspace-local dev codebases | ✅ Mutable | Project-specific; inside .openpackage/ for cleanliness |
|
|
66
|
+
| `./.openpackage/openpackage.index.yml` | Tracks installs/sources/mappings | Metadata | Unified; never in payload |
|
|
67
|
+
|
|
68
|
+
## Key Principles
|
|
69
|
+
|
|
70
|
+
- **Unified Index**: Single file at `.openpackage/openpackage.index.yml` for all package tracking—replaces prior per-package indices.
|
|
71
|
+
- **Directory Registry**: Expanded dirs for easy inspection/debugging; same code for all sources (no extraction).
|
|
72
|
+
- **Workspace Packages in `.openpackage/`**: Keeps root clean; signals opkg management.
|
|
73
|
+
- **No Workspace Metadata in Payload**: `.openpackage/` excluded from registry copies.
|
|
74
|
+
|
|
75
|
+
See [Package Root Layout](package/package-root-layout.md) for inside package dirs; [Registry](registry.md) for version details.
|
|
76
|
+
|
|
77
|
+
## Path Conventions
|
|
78
|
+
|
|
79
|
+
| Type | Example | Use | Portability |
|
|
80
|
+
|------|---------|-----|-------------|
|
|
81
|
+
| Workspace Rel | `./.openpackage/packages/my-pkg/` | Local packages | ✅ (project-committed) |
|
|
82
|
+
| Global Tilde | `~/.openpackage/packages/shared/` | Shared | ✅ (tilde expands) |
|
|
83
|
+
| Registry | `~/.openpackage/registry/my-pkg/1.0.0/` | Immutable | Inferred post-install |
|
|
84
|
+
| Absolute | `/custom/path/` | Custom | ❌ Machine-specific |
|
|
85
|
+
|
|
86
|
+
Tilde `~` expands at runtime; relatives from openpackage.yml location.
|
|
87
|
+
|
|
88
|
+
## Key Changes from Prior Versions
|
|
89
|
+
|
|
90
|
+
- **Unified Index**: Single file vs. per-package.
|
|
91
|
+
- **No Per-Package Metadata Dirs**: Embedded in index.
|
|
92
|
+
- **Directory Registry**: No tarballs.
|
|
93
|
+
- **Workspace Packages Location**: `./.openpackage/packages/` (was `./packages/?`).
|
|
94
|
+
|
|
95
|
+
For source resolution, see [Package Sources](package-sources.md).
|
package/specs/install/README.md
CHANGED
|
@@ -3,15 +3,23 @@
|
|
|
3
3
|
This directory contains specifications for the `install` command, with a focus on:
|
|
4
4
|
|
|
5
5
|
- **Latest-in-range resolution from local + remote registries**
|
|
6
|
-
-
|
|
6
|
+
- **Workspace context**: Installs target effective cwd (shell or global --cwd; see [../../cli-options.md])
|
|
7
|
+
- **`openpackage.yml` as the canonical source of dependency intent**
|
|
7
8
|
- **Consistent, minimal, npm-inspired UX**
|
|
9
|
+
- **Git sources with subdirectory support** for monorepos and Claude Code plugins
|
|
10
|
+
- **Cross-platform conversion** via Universal Platform Converter (automatic format detection and conversion)
|
|
8
11
|
|
|
9
12
|
The documents are intended to be implementation-guiding but not tied to specific modules.
|
|
10
13
|
|
|
11
14
|
### Files
|
|
12
15
|
|
|
13
|
-
- **`install-behavior.md`**: Top-level `opkg install` UX and scenarios (CLI shapes, fresh vs existing deps, dev vs prod).
|
|
14
|
-
- **`
|
|
15
|
-
- **`
|
|
16
|
+
- **`install-behavior.md`**: Top-level `opkg install` UX and scenarios (CLI shapes, fresh vs existing deps, dev vs prod). Includes Claude Code plugin support (§9) with Universal Converter integration.
|
|
17
|
+
- **`git-sources.md`**: Installing packages from git repositories (`git:` and `github:` inputs), including subdirectory support for monorepos and Claude Code plugins.
|
|
18
|
+
- **`version-resolution.md`**: Formal rules for "latest in range from local+remote", including pre-release vs stable semantics.
|
|
19
|
+
- **`package-yml-canonical.md`**: Rules for treating `openpackage.yml` as the canonical declaration for install.
|
|
20
|
+
|
|
21
|
+
### Related
|
|
22
|
+
|
|
23
|
+
- **[Universal Platform Converter](../platforms/universal-converter.md)**: Cross-platform package conversion system that enables installing platform-specific packages to any platform
|
|
16
24
|
|
|
17
25
|
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
### `opkg install` – Git Sources
|
|
2
|
+
|
|
3
|
+
This document specifies how `install` supports installing packages from **git repositories**, including **subdirectory support for Claude Code plugins and monorepos**.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Supported inputs
|
|
8
|
+
|
|
9
|
+
### 1.1 CLI inputs
|
|
10
|
+
|
|
11
|
+
- **`opkg install git:<url>[#ref][&subdirectory=path]`**
|
|
12
|
+
- Installs a package from a git repository URL.
|
|
13
|
+
- `ref` is optional and may be a branch, tag, or commit SHA.
|
|
14
|
+
- `subdirectory` is optional and specifies a subdirectory within the repository to install.
|
|
15
|
+
|
|
16
|
+
- **`opkg install github:<owner>/<repo>[#ref][&subdirectory=path]`**
|
|
17
|
+
- Convenience shorthand for GitHub.
|
|
18
|
+
- Equivalent to:
|
|
19
|
+
- `opkg install git:https://github.com/<owner>/<repo>.git[#ref][&subdirectory=path]`
|
|
20
|
+
|
|
21
|
+
**Examples:**
|
|
22
|
+
```bash
|
|
23
|
+
# Install from main branch
|
|
24
|
+
opkg install github:anthropics/claude-code
|
|
25
|
+
|
|
26
|
+
# Install from specific branch
|
|
27
|
+
opkg install github:anthropics/claude-code#main
|
|
28
|
+
|
|
29
|
+
# Install from subdirectory (Claude Code plugin)
|
|
30
|
+
opkg install github:anthropics/claude-code#subdirectory=plugins/commit-commands
|
|
31
|
+
|
|
32
|
+
# Install from specific tag and subdirectory
|
|
33
|
+
opkg install github:anthropics/claude-code#v1.0.0&subdirectory=plugins/commit-commands
|
|
34
|
+
|
|
35
|
+
# Install from any git URL with subdirectory
|
|
36
|
+
opkg install git:https://gitlab.com/user/repo.git#main&subdirectory=packages/plugin-a
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### 1.2 Subdirectory syntax
|
|
40
|
+
|
|
41
|
+
The subdirectory option supports two formats:
|
|
42
|
+
- **After ref**: `#ref&subdirectory=path` (ref + subdirectory)
|
|
43
|
+
- **Without ref**: `#subdirectory=path` (subdirectory only)
|
|
44
|
+
|
|
45
|
+
Order matters: `ref` must come before `subdirectory` when both are present.
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## 2. openpackage.yml schema
|
|
50
|
+
|
|
51
|
+
Dependencies in `openpackage.yml` support git sources via:
|
|
52
|
+
|
|
53
|
+
```yaml
|
|
54
|
+
packages:
|
|
55
|
+
- name: somepkg
|
|
56
|
+
git: https://example.com/org/repo.git
|
|
57
|
+
ref: main
|
|
58
|
+
subdirectory: plugins/my-plugin # Optional
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Rules:
|
|
62
|
+
- Each dependency entry MUST specify **exactly one** source field: `version`, `path`, or `git`.
|
|
63
|
+
- `ref` and `subdirectory` are only valid when `git` is present.
|
|
64
|
+
- Git dependencies MUST NOT specify `version` (git dependencies are source-pinned, not semver-ranged).
|
|
65
|
+
- `subdirectory` specifies a subdirectory path within the repository to use as the package root.
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## 3. Resolution and installation behavior
|
|
70
|
+
|
|
71
|
+
### 3.1 Basic git install
|
|
72
|
+
|
|
73
|
+
- `install` clones the repository to a temporary directory using the system `git` executable.
|
|
74
|
+
- If `ref` is provided:
|
|
75
|
+
- For branch/tag: clone the specified ref.
|
|
76
|
+
- For commit SHA: clone and checkout that SHA (best-effort shallow fetch).
|
|
77
|
+
- Without subdirectory: The cloned repository root MUST contain `openpackage.yml`.
|
|
78
|
+
- The installed package version is read from the repo's `openpackage.yml`.
|
|
79
|
+
- The rest of the install flow matches path installs:
|
|
80
|
+
- Dependencies are resolved recursively.
|
|
81
|
+
- Content is installed to the workspace platforms.
|
|
82
|
+
|
|
83
|
+
### 3.2 Subdirectory installs
|
|
84
|
+
|
|
85
|
+
When `subdirectory` is specified:
|
|
86
|
+
- Repository is cloned to a temporary directory.
|
|
87
|
+
- The specified subdirectory path is resolved relative to the repository root.
|
|
88
|
+
- The subdirectory MUST contain either:
|
|
89
|
+
- `openpackage.yml` (standard OpenPackage package), OR
|
|
90
|
+
- `.claude-plugin/plugin.json` (Claude Code plugin), OR
|
|
91
|
+
- `.claude-plugin/marketplace.json` (Claude Code plugin marketplace)
|
|
92
|
+
- For OpenPackage packages: `openpackage.yml` is read from the subdirectory.
|
|
93
|
+
- For Claude Code plugins: See §4 for special handling.
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## 4. Claude Code plugin support
|
|
98
|
+
|
|
99
|
+
**See also:** [Install Behavior §9](./install-behavior.md#9-claude-code-plugin-support) for complete plugin install flow with Universal Converter integration.
|
|
100
|
+
|
|
101
|
+
### 4.1 Plugin detection
|
|
102
|
+
|
|
103
|
+
When installing from a git source (with or without subdirectory), the system detects:
|
|
104
|
+
|
|
105
|
+
1. **Claude Code plugin manifests:**
|
|
106
|
+
- **Individual plugins**: `.claude-plugin/plugin.json`
|
|
107
|
+
- **Plugin marketplaces**: `.claude-plugin/marketplace.json`
|
|
108
|
+
|
|
109
|
+
2. **Package format** (via Universal Converter):
|
|
110
|
+
- **Platform-specific**: Files in platform directories (`.claude/`, `.cursor/`, etc.)
|
|
111
|
+
- **Universal**: Files in universal subdirectories (`commands/`, `agents/`, etc.)
|
|
112
|
+
|
|
113
|
+
Detection happens automatically after cloning, before attempting to load as an OpenPackage.
|
|
114
|
+
|
|
115
|
+
### 4.2 Individual plugin install
|
|
116
|
+
|
|
117
|
+
When an individual plugin is detected:
|
|
118
|
+
1. Plugin manifest (`.claude-plugin/plugin.json`) is read and validated.
|
|
119
|
+
2. Plugin metadata is transformed to OpenPackage format in-memory:
|
|
120
|
+
- `name` and `version` from `plugin.json` become package metadata
|
|
121
|
+
- `description`, `author`, `repository`, etc. are preserved
|
|
122
|
+
3. All plugin files are collected (commands/, agents/, skills/, hooks/, .mcp.json, .lsp.json, etc.)
|
|
123
|
+
4. **Package format is detected** and appropriate installation strategy selected:
|
|
124
|
+
- **Direct AS-IS**: Source platform = target platform (fastest)
|
|
125
|
+
- **Cross-platform conversion**: Source ≠ target (via Universal Converter)
|
|
126
|
+
- **Standard flows**: Universal format packages
|
|
127
|
+
5. Files are installed to platform-specific directories:
|
|
128
|
+
- `commands/` → `.claude/commands/`, `.cursor/commands/`, etc.
|
|
129
|
+
- `agents/` → `.claude/agents/`, `.cursor/agents/`, etc.
|
|
130
|
+
- Root files (`.mcp.json`, `.lsp.json`) → platform roots
|
|
131
|
+
6. The dependency is tracked in `openpackage.yml` with its git source (not as a registry version).
|
|
132
|
+
7. No registry copy is created (git repository remains source of truth).
|
|
133
|
+
|
|
134
|
+
**See:** [Universal Platform Converter](../platforms/universal-converter.md) for cross-platform conversion details.
|
|
135
|
+
|
|
136
|
+
**Example:**
|
|
137
|
+
```bash
|
|
138
|
+
opkg install github:anthropics/claude-code#subdirectory=plugins/commit-commands
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Result in `openpackage.yml`:
|
|
142
|
+
```yaml
|
|
143
|
+
packages:
|
|
144
|
+
- name: commit-commands
|
|
145
|
+
git: https://github.com/anthropics/claude-code.git
|
|
146
|
+
subdirectory: plugins/commit-commands
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### 4.3 Marketplace install
|
|
150
|
+
|
|
151
|
+
When a plugin marketplace is detected:
|
|
152
|
+
1. Marketplace manifest (`.claude-plugin/marketplace.json`) is parsed.
|
|
153
|
+
2. An interactive multiselect prompt is displayed listing all available plugins.
|
|
154
|
+
3. User selects which plugin(s) to install (space to select, enter to confirm).
|
|
155
|
+
4. Each selected plugin is installed individually:
|
|
156
|
+
- Plugin subdirectory is resolved within the cloned repository.
|
|
157
|
+
- Plugin is validated (must have `.claude-plugin/plugin.json`).
|
|
158
|
+
- Plugin is installed following the individual plugin flow (§4.2).
|
|
159
|
+
5. Each plugin gets its own entry in `openpackage.yml` with its specific subdirectory.
|
|
160
|
+
|
|
161
|
+
**Example:**
|
|
162
|
+
```bash
|
|
163
|
+
opkg install github:anthropics/claude-code
|
|
164
|
+
|
|
165
|
+
📦 Marketplace: claude-code-plugins
|
|
166
|
+
Example plugins demonstrating Claude Code plugin capabilities
|
|
167
|
+
|
|
168
|
+
3 plugins available:
|
|
169
|
+
|
|
170
|
+
❯ ◯ commit-commands
|
|
171
|
+
◯ pr-review-toolkit
|
|
172
|
+
◯ explanatory-output-style
|
|
173
|
+
|
|
174
|
+
Select plugins to install (space to select, enter to confirm):
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
Result in `openpackage.yml` (if user selected commit-commands and pr-review-toolkit):
|
|
178
|
+
```yaml
|
|
179
|
+
packages:
|
|
180
|
+
- name: commit-commands
|
|
181
|
+
git: https://github.com/anthropics/claude-code.git
|
|
182
|
+
subdirectory: plugins/commit-commands
|
|
183
|
+
- name: pr-review-toolkit
|
|
184
|
+
git: https://github.com/anthropics/claude-code.git
|
|
185
|
+
subdirectory: plugins/pr-review-toolkit
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### 4.4 Plugin transformation details
|
|
189
|
+
|
|
190
|
+
**In-memory transformation** (no registry copy):
|
|
191
|
+
- Plugin manifest fields map to OpenPackage metadata:
|
|
192
|
+
- `name` → `metadata.name`
|
|
193
|
+
- `version` → `metadata.version`
|
|
194
|
+
- `description` → `metadata.description`
|
|
195
|
+
- `author.name` → `metadata.author`
|
|
196
|
+
- `repository.url` → `metadata.repository.url`
|
|
197
|
+
- `license` → `metadata.license`
|
|
198
|
+
- `keywords` → `metadata.keywords`
|
|
199
|
+
|
|
200
|
+
**File collection**:
|
|
201
|
+
- All files except `.claude-plugin/` are collected.
|
|
202
|
+
- Original directory structure is preserved.
|
|
203
|
+
- Platform mapping applies automatically during install.
|
|
204
|
+
|
|
205
|
+
**Skipped files**:
|
|
206
|
+
- `.claude-plugin/` directory (plugin metadata, not needed in workspace)
|
|
207
|
+
- `.git/` directory and git metadata
|
|
208
|
+
- Junk files (`.DS_Store`, `Thumbs.db`, etc.)
|
|
209
|
+
|
|
210
|
+
---
|
|
211
|
+
|
|
212
|
+
## 5. Limitations and future work
|
|
213
|
+
|
|
214
|
+
### 5.1 Current limitations
|
|
215
|
+
|
|
216
|
+
- No lockfile or commit pinning is persisted (no `resolvedSha` field).
|
|
217
|
+
- No clone caching (each install may re-clone).
|
|
218
|
+
- Authentication behavior is delegated to `git` (credentials configured in the user's environment).
|
|
219
|
+
|
|
220
|
+
### 5.2 Subdirectory support notes
|
|
221
|
+
|
|
222
|
+
- Subdirectory paths are relative to repository root.
|
|
223
|
+
- Subdirectory must contain a valid package or plugin manifest.
|
|
224
|
+
- For OpenPackage packages in subdirectories, their dependencies are resolved relative to the subdirectory location.
|
|
225
|
+
|
|
226
|
+
### 5.3 Future considerations
|
|
227
|
+
|
|
228
|
+
- Commit SHA resolution and pinning for reproducible installs.
|
|
229
|
+
- Clone caching to speed up repeated installs.
|
|
230
|
+
- Plugin registry support (converting plugins to first-class OpenPackage packages).
|