opkg 0.5.0 → 0.6.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 +49 -8
- package/dist/commands/add.js +11 -276
- package/dist/commands/add.js.map +1 -1
- package/dist/commands/init.js +73 -145
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/install.js +26 -668
- package/dist/commands/install.js.map +1 -1
- package/dist/commands/pack.js +10 -137
- package/dist/commands/pack.js.map +1 -1
- package/dist/commands/push.js +14 -8
- package/dist/commands/push.js.map +1 -1
- package/dist/commands/save.js +12 -167
- package/dist/commands/save.js.map +1 -1
- package/dist/commands/status.js +2 -2
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/uninstall.js +5 -5
- package/dist/commands/uninstall.js.map +1 -1
- package/dist/constants/index.js +18 -45
- package/dist/constants/index.js.map +1 -1
- package/dist/constants/workspace.js +9 -0
- package/dist/constants/workspace.js.map +1 -0
- package/dist/core/add/add-conflict-handler.js +68 -0
- package/dist/core/add/add-conflict-handler.js.map +1 -0
- package/dist/core/add/add-pipeline.js +137 -0
- package/dist/core/add/add-pipeline.js.map +1 -0
- package/dist/core/add/package-index-updater.js +62 -33
- package/dist/core/add/package-index-updater.js.map +1 -1
- package/dist/core/add/platform-path-transformer.js +47 -0
- package/dist/core/add/platform-path-transformer.js.map +1 -0
- package/dist/core/add/source-collector.js +57 -0
- package/dist/core/add/source-collector.js.map +1 -0
- package/dist/core/dependency-resolver.js +3 -1
- package/dist/core/dependency-resolver.js.map +1 -1
- package/dist/core/directory.js +2 -2
- package/dist/core/directory.js.map +1 -1
- package/dist/core/discovery/file-discovery.js +55 -54
- package/dist/core/discovery/file-discovery.js.map +1 -1
- package/dist/core/discovery/platform-files-discovery.js +32 -17
- package/dist/core/discovery/platform-files-discovery.js.map +1 -1
- package/dist/core/install/bulk-install-pipeline.js +199 -0
- package/dist/core/install/bulk-install-pipeline.js.map +1 -0
- package/dist/core/install/canonical-plan.js +123 -0
- package/dist/core/install/canonical-plan.js.map +1 -0
- package/dist/core/install/dry-run.js +2 -2
- package/dist/core/install/dry-run.js.map +1 -1
- package/dist/core/install/index.js +3 -0
- package/dist/core/install/index.js.map +1 -0
- package/dist/core/install/install-errors.js +41 -0
- package/dist/core/install/install-errors.js.map +1 -0
- package/dist/core/install/install-flow.js +2 -5
- package/dist/core/install/install-flow.js.map +1 -1
- package/dist/core/install/install-pipeline.js +228 -0
- package/dist/core/install/install-pipeline.js.map +1 -0
- package/dist/core/install/install-reporting.js +99 -0
- package/dist/core/install/install-reporting.js.map +1 -0
- package/dist/core/install/platform-resolution.js +6 -6
- package/dist/core/install/platform-resolution.js.map +1 -1
- package/dist/core/install/remote-flow.js +67 -1
- package/dist/core/install/remote-flow.js.map +1 -1
- package/dist/core/openpackage.js +16 -8
- package/dist/core/openpackage.js.map +1 -1
- package/dist/core/package-context.js +246 -0
- package/dist/core/package-context.js.map +1 -0
- package/dist/core/package.js +3 -2
- package/dist/core/package.js.map +1 -1
- package/dist/core/platforms.js +126 -217
- package/dist/core/platforms.js.map +1 -1
- package/dist/core/registry/registry-rename.js +2 -1
- package/dist/core/registry/registry-rename.js.map +1 -1
- package/dist/core/registry.js +10 -3
- package/dist/core/registry.js.map +1 -1
- package/dist/core/remote-pull.js +2 -1
- package/dist/core/remote-pull.js.map +1 -1
- package/dist/core/save/constants.js +4 -0
- package/dist/core/save/constants.js.map +1 -1
- package/dist/core/save/name-resolution.js +31 -0
- package/dist/core/save/name-resolution.js.map +1 -0
- package/dist/core/save/package-detection.js +147 -0
- package/dist/core/save/package-detection.js.map +1 -0
- package/dist/core/save/package-saver.js +46 -43
- package/dist/core/save/package-saver.js.map +1 -1
- package/dist/core/save/package-yml-generator.js +50 -71
- package/dist/core/save/package-yml-generator.js.map +1 -1
- package/dist/core/save/root-save-candidates.js.map +1 -1
- package/dist/core/save/save-candidate-loader.js +89 -0
- package/dist/core/save/save-candidate-loader.js.map +1 -0
- package/dist/core/save/save-conflict-resolution.js +72 -410
- package/dist/core/save/save-conflict-resolution.js.map +1 -1
- package/dist/core/save/save-conflict-resolver.js +277 -0
- package/dist/core/save/save-conflict-resolver.js.map +1 -0
- package/dist/core/save/save-pipeline.js +151 -0
- package/dist/core/save/save-pipeline.js.map +1 -0
- package/dist/core/save/save-types.js +2 -0
- package/dist/core/save/save-types.js.map +1 -0
- package/dist/core/save/save-yml-resolution.js +77 -39
- package/dist/core/save/save-yml-resolution.js.map +1 -1
- package/dist/core/save/workspace-rename.js +6 -6
- package/dist/core/save/workspace-rename.js.map +1 -1
- package/dist/core/scoping/package-scoping.js +13 -1
- package/dist/core/scoping/package-scoping.js.map +1 -1
- package/dist/core/status/status-file-discovery.js +12 -30
- package/dist/core/status/status-file-discovery.js.map +1 -1
- package/dist/core/sync/platform-sync.js +7 -4
- package/dist/core/sync/platform-sync.js.map +1 -1
- package/dist/core/sync/root-files-sync.js +59 -1
- package/dist/core/sync/root-files-sync.js.map +1 -1
- package/dist/core/uninstall/uninstall-file-discovery.js +1 -2
- package/dist/core/uninstall/uninstall-file-discovery.js.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/utils/file-processing.js +5 -58
- package/dist/utils/file-processing.js.map +1 -1
- package/dist/utils/index-based-installer.js +15 -33
- package/dist/utils/index-based-installer.js.map +1 -1
- package/dist/utils/install-file-discovery.js +3 -3
- package/dist/utils/install-file-discovery.js.map +1 -1
- package/dist/utils/install-orchestrator.js +21 -21
- package/dist/utils/install-orchestrator.js.map +1 -1
- package/dist/utils/jsonc.js +44 -0
- package/dist/utils/jsonc.js.map +1 -0
- package/dist/utils/package-copy.js +199 -0
- package/dist/utils/package-copy.js.map +1 -0
- package/dist/utils/package-filters.js +125 -0
- package/dist/utils/package-filters.js.map +1 -0
- package/dist/utils/package-index-yml.js +15 -10
- package/dist/utils/package-index-yml.js.map +1 -1
- package/dist/utils/package-installation.js +4 -113
- package/dist/utils/package-installation.js.map +1 -1
- package/dist/utils/package-local-files.js +2 -35
- package/dist/utils/package-local-files.js.map +1 -1
- package/dist/utils/package-management.js +59 -37
- package/dist/utils/package-management.js.map +1 -1
- package/dist/utils/package-yml.js +24 -0
- package/dist/utils/package-yml.js.map +1 -1
- package/dist/utils/path-normalization.js +8 -53
- package/dist/utils/path-normalization.js.map +1 -1
- package/dist/utils/paths.js +17 -9
- package/dist/utils/paths.js.map +1 -1
- package/dist/utils/platform-file.js +16 -59
- package/dist/utils/platform-file.js.map +1 -1
- package/dist/utils/platform-mapper.js +29 -41
- package/dist/utils/platform-mapper.js.map +1 -1
- package/dist/utils/platform-specific-paths.js.map +1 -1
- package/dist/utils/platform-utils.js +28 -139
- package/dist/utils/platform-utils.js.map +1 -1
- package/dist/utils/platform-yaml-merge.js +13 -6
- package/dist/utils/platform-yaml-merge.js.map +1 -1
- package/dist/utils/registry-entry-filter.js +38 -24
- package/dist/utils/registry-entry-filter.js.map +1 -1
- package/dist/utils/registry-paths.js +10 -0
- package/dist/utils/registry-paths.js.map +1 -0
- package/dist/utils/root-file-installer.js +19 -0
- package/dist/utils/root-file-installer.js.map +1 -1
- package/dist/utils/root-file-registry.js.map +1 -1
- package/package.json +3 -2
- package/platforms.jsonc +178 -0
- package/specs/package/README.md +60 -0
- package/specs/package/nested-packages-and-parent-packages.md +79 -0
- package/specs/package/package-index-yml.md +171 -0
- package/specs/package/package-root-layout.md +78 -0
- package/specs/package/registry-payload-and-copy.md +77 -0
- package/specs/package/universal-content.md +144 -0
- package/specs/platforms.md +193 -0
- package/specs/save/README.md +40 -0
- package/specs/save/save-conflict-resolution.md +146 -0
- package/specs/save/save-file-discovery.md +101 -0
- package/specs/save/save-frontmatter-overrides.md +81 -0
- package/specs/save/save-modes-inputs.md +53 -0
- package/specs/save/save-naming-scoping.md +93 -0
- package/specs/save/save-package-detection.md +60 -0
- package/specs/save/save-registry-sync.md +126 -0
- package/dist/commands/release.js +0 -33
- package/dist/commands/release.js.map +0 -1
- package/dist/commands/tag.js +0 -311
- package/dist/commands/tag.js.map +0 -1
- package/dist/commands/update.js +0 -30
- package/dist/commands/update.js.map +0 -1
- package/dist/core/add/formula-index-updater.js +0 -290
- package/dist/core/add/formula-index-updater.js.map +0 -1
- package/dist/core/discovery/ai-files-discovery.js +0 -2
- package/dist/core/discovery/ai-files-discovery.js.map +0 -1
- package/dist/core/discovery/formula-files-discovery.js +0 -14
- package/dist/core/discovery/formula-files-discovery.js.map +0 -1
- package/dist/core/discovery/index-files-discovery.js +0 -91
- package/dist/core/discovery/index-files-discovery.js.map +0 -1
- package/dist/core/discovery/md-files-discovery.js +0 -82
- package/dist/core/discovery/md-files-discovery.js.map +0 -1
- package/dist/core/discovery/package-files-discovery.js +0 -14
- package/dist/core/discovery/package-files-discovery.js.map +0 -1
- package/dist/core/discovery/platform-discovery.js +0 -84
- package/dist/core/discovery/platform-discovery.js.map +0 -1
- package/dist/core/discovery/root-files-discovery.js +0 -2
- package/dist/core/discovery/root-files-discovery.js.map +0 -1
- package/dist/core/formula.js +0 -170
- package/dist/core/formula.js.map +0 -1
- package/dist/core/git-registry.js +0 -46
- package/dist/core/git-registry.js.map +0 -1
- package/dist/core/groundzero.js +0 -277
- package/dist/core/groundzero.js.map +0 -1
- package/dist/core/install/scenario.js +0 -11
- package/dist/core/install/scenario.js.map +0 -1
- package/dist/core/package-sync.js +0 -219
- package/dist/core/package-sync.js.map +0 -1
- package/dist/core/save/formula-file-generator.js +0 -167
- package/dist/core/save/formula-file-generator.js.map +0 -1
- package/dist/core/save/formula-saver.js +0 -52
- package/dist/core/save/formula-saver.js.map +0 -1
- package/dist/core/save/formula-yml-generator.js +0 -89
- package/dist/core/save/formula-yml-generator.js.map +0 -1
- package/dist/core/save/formula-yml-versioning.js +0 -108
- package/dist/core/save/formula-yml-versioning.js.map +0 -1
- package/dist/core/save/generic-file-sync.js +0 -38
- package/dist/core/save/generic-file-sync.js.map +0 -1
- package/dist/core/save/md-files-sync.js +0 -33
- package/dist/core/save/md-files-sync.js.map +0 -1
- package/dist/core/save/package-yml-versioning.js +0 -108
- package/dist/core/save/package-yml-versioning.js.map +0 -1
- package/dist/core/save/platform-sync.js +0 -95
- package/dist/core/save/platform-sync.js.map +0 -1
- package/dist/core/save/root-files-sync.js +0 -140
- package/dist/core/save/root-files-sync.js.map +0 -1
- package/dist/core/save/save-candidate-types.js +0 -2
- package/dist/core/save/save-candidate-types.js.map +0 -1
- package/dist/core/save/save-conflict-types.js +0 -2
- package/dist/core/save/save-conflict-types.js.map +0 -1
- package/dist/core/save/save-file-discovery.js +0 -5
- package/dist/core/save/save-file-discovery.js.map +0 -1
- package/dist/core/status-file-discovery.js +0 -175
- package/dist/core/status-file-discovery.js.map +0 -1
- package/dist/utils/discovery/file-processing.js +0 -156
- package/dist/utils/discovery/file-processing.js.map +0 -1
- package/dist/utils/discovery/formula-discovery.js +0 -211
- package/dist/utils/discovery/formula-discovery.js.map +0 -1
- package/dist/utils/discovery/platform-discovery.js +0 -2
- package/dist/utils/discovery/platform-discovery.js.map +0 -1
- package/dist/utils/formula-discovery.js +0 -102
- package/dist/utils/formula-discovery.js.map +0 -1
- package/dist/utils/formula-index-yml.js +0 -122
- package/dist/utils/formula-index-yml.js.map +0 -1
- package/dist/utils/formula-installation.js +0 -110
- package/dist/utils/formula-installation.js.map +0 -1
- package/dist/utils/formula-local-files.js +0 -38
- package/dist/utils/formula-local-files.js.map +0 -1
- package/dist/utils/formula-management.js +0 -191
- package/dist/utils/formula-management.js.map +0 -1
- package/dist/utils/formula-name.js +0 -97
- package/dist/utils/formula-name.js.map +0 -1
- package/dist/utils/formula-versioning.js +0 -109
- package/dist/utils/formula-versioning.js.map +0 -1
- package/dist/utils/formula-yml.js +0 -82
- package/dist/utils/formula-yml.js.map +0 -1
- package/dist/utils/git.js +0 -54
- package/dist/utils/git.js.map +0 -1
- package/dist/utils/id-based-discovery.js +0 -126
- package/dist/utils/id-based-discovery.js.map +0 -1
- package/dist/utils/id-based-installer.js +0 -249
- package/dist/utils/id-based-installer.js.map +0 -1
- package/dist/utils/index-yml-based-installer.js +0 -375
- package/dist/utils/index-yml-based-installer.js.map +0 -1
- package/dist/utils/index-yml.js +0 -124
- package/dist/utils/index-yml.js.map +0 -1
- package/dist/utils/md-frontmatter.js +0 -3
- package/dist/utils/md-frontmatter.js.map +0 -1
- package/dist/utils/package-link-yml.js +0 -92
- package/dist/utils/package-link-yml.js.map +0 -1
- package/dist/utils/platform-discovery.js +0 -2
- package/dist/utils/platform-discovery.js.map +0 -1
- package/dist/utils/platform-frontmatter-split.js +0 -15
- package/dist/utils/platform-frontmatter-split.js.map +0 -1
- package/dist/utils/timestamp-encoder.js +0 -13
- package/dist/utils/timestamp-encoder.js.map +0 -1
- package/dist/utils/wip-versioning.js +0 -24
- package/dist/utils/wip-versioning.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"root-file-registry.js","sourceRoot":"","sources":["../../src/utils/root-file-registry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"root-file-registry.js","sourceRoot":"","sources":["../../src/utils/root-file-registry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAiB,MAAM,sBAAsB,CAAC;AAE7F;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAC5C,WAAmB,EACnB,OAAe;IAEf,MAAM,SAAS,GAAG,IAAI,GAAG,EAAkB,CAAC;IAC5C,MAAM,WAAW,GAAG,qBAAqB,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IAEhE,IAAI,CAAC,CAAC,MAAM,MAAM,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC;QACjC,MAAM,CAAC,KAAK,CAAC,wCAAwC,WAAW,EAAE,CAAC,CAAC;QACpE,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,sEAAsE;IACtE,MAAM,iBAAiB,GAAG,CAAC,GAAG,EAAE;QAC9B,MAAM,GAAG,GAAG,IAAI,GAAG,EAAU,CAAC;QAC9B,KAAK,MAAM,QAAQ,IAAI,eAAe,EAAE,EAAE,CAAC;YACzC,MAAM,GAAG,GAAG,qBAAqB,CAAC,QAAQ,CAAC,CAAC;YAC5C,IAAI,GAAG,CAAC,QAAQ;gBAAE,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC1C,CAAC;QACD,wEAAwE;QACxE,GAAG,CAAC,GAAG,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;QACjC,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;IAClC,CAAC,CAAC,EAAE,CAAC;IAEL,gCAAgC;IAChC,KAAK,MAAM,YAAY,IAAI,iBAAiB,EAAE,CAAC;QAC7C,MAAM,YAAY,GAAG,IAAI,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;QAErD,IAAI,MAAM,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC;YAC/B,IAAI,CAAC;gBACH,MAAM,OAAO,GAAG,MAAM,YAAY,CAAC,YAAY,CAAC,CAAC;gBACjD,IAAI,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC;oBACnB,SAAS,CAAC,GAAG,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;oBACrC,MAAM,CAAC,KAAK,CAAC,gCAAgC,YAAY,QAAQ,WAAW,IAAI,OAAO,EAAE,CAAC,CAAC;gBAC7F,CAAC;YACH,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,CAAC,IAAI,CAAC,4BAA4B,YAAY,mBAAmB,KAAK,EAAE,CAAC,CAAC;YAClF,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,sBAAsB,CAAC,QAAgB;IACrD,6DAA6D;IAC7D,IAAI,QAAQ,KAAK,aAAa,CAAC,SAAS,EAAE,CAAC;QACzC,OAAO,WAAW,CAAC;IACrB,CAAC;IAED,qCAAqC;IACrC,KAAK,MAAM,QAAQ,IAAI,eAAe,EAAE,EAAE,CAAC;QACzC,MAAM,GAAG,GAAG,qBAAqB,CAAC,QAAQ,CAAC,CAAC;QAC5C,IAAI,GAAG,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;YAC9B,OAAO,QAAQ,CAAC;QAClB,CAAC;IACH,CAAC;IAED,oBAAoB;IACpB,OAAO,WAAW,CAAC;AACrB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opkg",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -40,13 +40,14 @@
|
|
|
40
40
|
"dev:watch": "nodemon --exec ts-node src/index.ts",
|
|
41
41
|
"clean": "rm -rf dist",
|
|
42
42
|
"prepublishOnly": "npm run build",
|
|
43
|
-
"test": "node --loader ts-node/esm tests/save-pack-versioning.test.ts && node --loader ts-node/esm tests/install-cli-modes.test.ts && node --loader ts-node/esm tests/install-selection.test.
|
|
43
|
+
"test": "TS_NODE_TRANSPILE_ONLY=1 node --loader ts-node/esm tests/save-pack-versioning.test.ts && TS_NODE_TRANSPILE_ONLY=1 node --loader ts-node/esm tests/install-cli-modes.test.ts && TS_NODE_TRANSPILE_ONLY=1 node --loader ts-node/esm tests/install-selection.test.ts && TS_NODE_TRANSPILE_ONLY=1 node --loader ts-node/esm tests/version-selection.test.ts && TS_NODE_TRANSPILE_ONLY=1 node --loader ts-node/esm tests/push-stable-selection.test.ts && TS_NODE_TRANSPILE_ONLY=1 node --loader ts-node/esm tests/workspace-paths.test.ts && TS_NODE_TRANSPILE_ONLY=1 node --loader ts-node/esm tests/platform-extension-filter.test.ts && TS_NODE_TRANSPILE_ONLY=1 node --loader ts-node/esm tests/package-filters.test.ts"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"commander": "^14.0.0",
|
|
47
47
|
"gray-matter": "^4.0.3",
|
|
48
48
|
"hash-wasm": "^4.12.0",
|
|
49
49
|
"js-yaml": "^4.1.0",
|
|
50
|
+
"jsonc-parser": "^3.3.1",
|
|
50
51
|
"junk": "^4.0.1",
|
|
51
52
|
"nanoid": "^5.0.7",
|
|
52
53
|
"prompts": "^2.4.2",
|
package/platforms.jsonc
ADDED
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
{
|
|
2
|
+
// Platform definitions for all supported AI coding platforms
|
|
3
|
+
// Each platform defines its directory structure, root files, and subdirectories
|
|
4
|
+
|
|
5
|
+
"augment": {
|
|
6
|
+
"name": "Augment Code",
|
|
7
|
+
"rootDir": ".augment",
|
|
8
|
+
"subdirs": {
|
|
9
|
+
"rules": {
|
|
10
|
+
"path": "rules",
|
|
11
|
+
"exts": [".md"]
|
|
12
|
+
},
|
|
13
|
+
"commands": {
|
|
14
|
+
"path": "commands",
|
|
15
|
+
"exts": [".md"]
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
"claude": {
|
|
21
|
+
"name": "Claude Code",
|
|
22
|
+
"rootDir": ".claude",
|
|
23
|
+
"rootFile": "CLAUDE.md",
|
|
24
|
+
"aliases": ["claudecode"],
|
|
25
|
+
"subdirs": {
|
|
26
|
+
"commands": {
|
|
27
|
+
"path": "commands",
|
|
28
|
+
"exts": [".md"]
|
|
29
|
+
},
|
|
30
|
+
"agents": {
|
|
31
|
+
"path": "agents",
|
|
32
|
+
"exts": [".md"]
|
|
33
|
+
},
|
|
34
|
+
"skills": {
|
|
35
|
+
"path": "skills"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
"codex": {
|
|
41
|
+
"name": "Codex CLI",
|
|
42
|
+
"rootDir": ".codex",
|
|
43
|
+
"rootFile": "AGENTS.md",
|
|
44
|
+
"aliases": ["codexcli"],
|
|
45
|
+
"subdirs": {
|
|
46
|
+
"commands": {
|
|
47
|
+
"path": "prompts",
|
|
48
|
+
"exts": [".md"]
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
|
|
53
|
+
"cursor": {
|
|
54
|
+
"name": "Cursor",
|
|
55
|
+
"rootDir": ".cursor",
|
|
56
|
+
"rootFile": "AGENTS.md",
|
|
57
|
+
"subdirs": {
|
|
58
|
+
"rules": {
|
|
59
|
+
"path": "rules",
|
|
60
|
+
"exts": [".mdc", ".md"],
|
|
61
|
+
"transformations": [
|
|
62
|
+
{
|
|
63
|
+
"packageExt": ".md",
|
|
64
|
+
"workspaceExt": ".mdc"
|
|
65
|
+
}
|
|
66
|
+
]
|
|
67
|
+
},
|
|
68
|
+
"commands": {
|
|
69
|
+
"path": "commands",
|
|
70
|
+
"exts": [".md"]
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
|
|
75
|
+
"factory": {
|
|
76
|
+
"name": "Factory AI",
|
|
77
|
+
"rootDir": ".factory",
|
|
78
|
+
"rootFile": "AGENTS.md",
|
|
79
|
+
"subdirs": {
|
|
80
|
+
"commands": {
|
|
81
|
+
"path": "commands",
|
|
82
|
+
"exts": [".md"]
|
|
83
|
+
},
|
|
84
|
+
"agents": {
|
|
85
|
+
"path": "droids",
|
|
86
|
+
"exts": [".md"]
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
|
|
91
|
+
"kilo": {
|
|
92
|
+
"name": "Kilo Code",
|
|
93
|
+
"rootDir": ".kilocode",
|
|
94
|
+
"rootFile": "AGENTS.md",
|
|
95
|
+
"aliases": ["kilocode"],
|
|
96
|
+
"subdirs": {
|
|
97
|
+
"rules": {
|
|
98
|
+
"path": "rules",
|
|
99
|
+
"exts": [".md"]
|
|
100
|
+
},
|
|
101
|
+
"commands": {
|
|
102
|
+
"path": "workflows",
|
|
103
|
+
"exts": [".md"]
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
|
|
108
|
+
"kiro": {
|
|
109
|
+
"name": "Kiro",
|
|
110
|
+
"rootDir": ".kiro",
|
|
111
|
+
"subdirs": {
|
|
112
|
+
"rules": {
|
|
113
|
+
"path": "steering",
|
|
114
|
+
"exts": [".md"]
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
|
|
119
|
+
"opencode": {
|
|
120
|
+
"name": "OpenCode",
|
|
121
|
+
"rootDir": ".opencode",
|
|
122
|
+
"rootFile": "AGENTS.md",
|
|
123
|
+
"subdirs": {
|
|
124
|
+
"commands": {
|
|
125
|
+
"path": "command",
|
|
126
|
+
"exts": [".md"]
|
|
127
|
+
},
|
|
128
|
+
"agents": {
|
|
129
|
+
"path": "agent",
|
|
130
|
+
"exts": [".md"]
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
|
|
135
|
+
"qwen": {
|
|
136
|
+
"name": "Qwen Code",
|
|
137
|
+
"rootDir": ".qwen",
|
|
138
|
+
"rootFile": "QWEN.md",
|
|
139
|
+
"aliases": ["qwencode"],
|
|
140
|
+
"subdirs": {
|
|
141
|
+
"agents": {
|
|
142
|
+
"path": "agents",
|
|
143
|
+
"exts": [".md"]
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
|
|
148
|
+
"roo": {
|
|
149
|
+
"name": "Roo Code",
|
|
150
|
+
"rootDir": ".roo",
|
|
151
|
+
"rootFile": "AGENTS.md",
|
|
152
|
+
"subdirs": {
|
|
153
|
+
"commands": {
|
|
154
|
+
"path": "commands",
|
|
155
|
+
"exts": [".md"]
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
|
|
160
|
+
"warp": {
|
|
161
|
+
"name": "Warp",
|
|
162
|
+
"rootDir": ".warp",
|
|
163
|
+
"rootFile": "WARP.md",
|
|
164
|
+
"subdirs": {}
|
|
165
|
+
},
|
|
166
|
+
|
|
167
|
+
"windsurf": {
|
|
168
|
+
"name": "Windsurf",
|
|
169
|
+
"rootDir": ".windsurf",
|
|
170
|
+
"subdirs": {
|
|
171
|
+
"rules": {
|
|
172
|
+
"path": "rules",
|
|
173
|
+
"exts": [".md"]
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
### Canonical Universal Package Structure
|
|
2
|
+
|
|
3
|
+
This directory contains the canonical on-disk structure spec for OpenPackage packages, split into focused documents:
|
|
4
|
+
|
|
5
|
+
- **Root layout**: `package-root-layout.md` – Package directory structure and content types
|
|
6
|
+
- **Universal content**: `universal-content.md` – Platform-normalized content under `.openpackage/`
|
|
7
|
+
- **Package index**: `package-index-yml.md` – File mapping and `package.index.yml` structure
|
|
8
|
+
- **Registry payload and 1:1 copy rules**: `registry-payload-and-copy.md` – What gets included in packages
|
|
9
|
+
- **Nested packages and parent packages**: `nested-packages-and-parent-packages.md` – Multi-package workspaces
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
#### Core Concept: Package Root
|
|
14
|
+
|
|
15
|
+
A **package root** is any directory containing `.openpackage/package.yml`. This applies to:
|
|
16
|
+
|
|
17
|
+
- **Workspace root package**: `cwd/` is the package root
|
|
18
|
+
- **Nested packages**: `cwd/.openpackage/packages/<name>/` is the package root
|
|
19
|
+
- **Registry copies**: `~/.openpackage/registry/<name>/<version>/` is the package root
|
|
20
|
+
|
|
21
|
+
All package roots have **identical internal structure**:
|
|
22
|
+
|
|
23
|
+
```text
|
|
24
|
+
<package-root>/
|
|
25
|
+
.openpackage/
|
|
26
|
+
package.yml # marks this as a package
|
|
27
|
+
package.index.yml # install index (not in registry)
|
|
28
|
+
commands/ # universal content
|
|
29
|
+
rules/
|
|
30
|
+
agents/
|
|
31
|
+
skills/
|
|
32
|
+
<root-dir>/ # root-level content (outside .openpackage/)
|
|
33
|
+
AGENTS.md # root files
|
|
34
|
+
README.md
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
#### Two Types of Content
|
|
40
|
+
|
|
41
|
+
| Type | Location | Example |
|
|
42
|
+
|------|----------|---------|
|
|
43
|
+
| **Universal content** | `.openpackage/<subdir>/` | `.openpackage/commands/test.md` |
|
|
44
|
+
| **Root-level content** | At package root (outside `.openpackage/`) | `<dir>/helper.md`, `AGENTS.md` |
|
|
45
|
+
|
|
46
|
+
**Universal content** is mapped to platform-specific paths during install.
|
|
47
|
+
**Root-level content** is copied 1:1 without transformation.
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
#### Design Goal
|
|
52
|
+
|
|
53
|
+
A package directory can be **moved or copied 1:1** between:
|
|
54
|
+
|
|
55
|
+
- Workspace root packages (`cwd/`)
|
|
56
|
+
- Nested workspace packages (`cwd/.openpackage/packages/<name>/`)
|
|
57
|
+
- Local registry copies (`~/.openpackage/registry/<name>/<version>/`)
|
|
58
|
+
|
|
59
|
+
…while preserving the same internal layout and invariants.
|
|
60
|
+
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
### Nested Packages and Parent Packages
|
|
2
|
+
|
|
3
|
+
#### Workspace Structure with Nested Packages
|
|
4
|
+
|
|
5
|
+
```text
|
|
6
|
+
<workspace-root>/ # root package (package root = cwd/)
|
|
7
|
+
.openpackage/
|
|
8
|
+
package.yml # root package manifest
|
|
9
|
+
package.index.yml # root package index
|
|
10
|
+
commands/ # root package universal content
|
|
11
|
+
shared-command.md
|
|
12
|
+
rules/
|
|
13
|
+
shared-rule.md
|
|
14
|
+
<root-dir>/ # root package root-level content (any directory)
|
|
15
|
+
workspace-helper.md
|
|
16
|
+
AGENTS.md # root package root file
|
|
17
|
+
packages/ # nested packages directory (workspace root only)
|
|
18
|
+
alpha/ # nested package (package root = .openpackage/packages/alpha/)
|
|
19
|
+
.openpackage/
|
|
20
|
+
package.yml
|
|
21
|
+
package.index.yml
|
|
22
|
+
commands/
|
|
23
|
+
alpha-command.md
|
|
24
|
+
<root-dir>/ # nested package root-level content
|
|
25
|
+
alpha-helper.md
|
|
26
|
+
beta/ # nested package (package root = .openpackage/packages/beta/)
|
|
27
|
+
.openpackage/
|
|
28
|
+
package.yml
|
|
29
|
+
package.index.yml
|
|
30
|
+
rules/
|
|
31
|
+
beta-rule.md
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
#### Key Rules
|
|
37
|
+
|
|
38
|
+
- Each `packages/<name>/` directory is its **own canonical package root**, with:
|
|
39
|
+
- Its own `.openpackage/package.yml` (marks it as a package)
|
|
40
|
+
- Its own `.openpackage/` content directory
|
|
41
|
+
- Its own root-level content (outside `.openpackage/`)
|
|
42
|
+
|
|
43
|
+
- The **parent root package never inlines** `packages/<name>/` into its own payload.
|
|
44
|
+
|
|
45
|
+
- Registry entries for `alpha` and `beta` are created **independently** from their respective package roots.
|
|
46
|
+
|
|
47
|
+
- **Only the workspace root package** can have a `packages/` directory. Nested packages cannot have further nested packages.
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
#### Package Root Locations
|
|
52
|
+
|
|
53
|
+
| Package Type | Package Root Path |
|
|
54
|
+
|--------------|-------------------|
|
|
55
|
+
| Workspace root | `cwd/` |
|
|
56
|
+
| Nested `alpha` | `cwd/.openpackage/packages/alpha/` |
|
|
57
|
+
| Nested `beta` | `cwd/.openpackage/packages/beta/` |
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
#### Identical Internal Structure
|
|
62
|
+
|
|
63
|
+
Both root and nested packages have **identical internal structure**:
|
|
64
|
+
|
|
65
|
+
```text
|
|
66
|
+
<package-root>/
|
|
67
|
+
.openpackage/
|
|
68
|
+
package.yml
|
|
69
|
+
package.index.yml
|
|
70
|
+
<universal-subdirs>/
|
|
71
|
+
<root-level-content>/
|
|
72
|
+
<root-files>
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
This uniformity ensures packages can be:
|
|
76
|
+
- Moved between workspace root and nested locations
|
|
77
|
+
- Copied to/from registry without structural changes
|
|
78
|
+
- Processed by the same code paths regardless of location
|
|
79
|
+
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
### Package Index File (`package.index.yml`)
|
|
2
|
+
|
|
3
|
+
The `package.index.yml` file tracks the mapping between package files and their **actually installed** workspace locations.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
#### Location
|
|
8
|
+
|
|
9
|
+
- **Root package**: `cwd/.openpackage/package.index.yml`
|
|
10
|
+
- **Nested package**: `cwd/.openpackage/packages/<name>/.openpackage/package.index.yml`
|
|
11
|
+
|
|
12
|
+
> **Note**: `package.index.yml` is **never** included in the registry payload. It's workspace-local metadata.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
#### Excluded Content
|
|
17
|
+
|
|
18
|
+
The following files are **never** included in the index, even though they may exist in the package:
|
|
19
|
+
|
|
20
|
+
| File | Reason |
|
|
21
|
+
|------|--------|
|
|
22
|
+
| `package.yml` | Package manifest; not synced to workspace |
|
|
23
|
+
| `.openpackage/package.yml` | Same as above (path variant) |
|
|
24
|
+
| `package.index.yml` | Index file itself; workspace-local metadata |
|
|
25
|
+
|
|
26
|
+
The index only contains entries for content that is **actually synced** to workspace locations.
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
#### Structure
|
|
31
|
+
|
|
32
|
+
```yaml
|
|
33
|
+
# This file is managed by OpenPackage. Do not edit manually.
|
|
34
|
+
|
|
35
|
+
workspace:
|
|
36
|
+
hash: <workspace-hash>
|
|
37
|
+
version: <installed-version>
|
|
38
|
+
files:
|
|
39
|
+
<registry-key>:
|
|
40
|
+
- <installed-path>
|
|
41
|
+
- <installed-path>
|
|
42
|
+
<registry-key>:
|
|
43
|
+
- <installed-path>
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
#### Registry Keys
|
|
49
|
+
|
|
50
|
+
Registry keys are **relative to the package root**:
|
|
51
|
+
|
|
52
|
+
| Content Type | Key Format | Example |
|
|
53
|
+
|--------------|------------|---------|
|
|
54
|
+
| Universal content | `.openpackage/<subdir>/<file>` | `.openpackage/commands/test.md` |
|
|
55
|
+
| Root-level content | `<path>` | `<dir>/helper.md` |
|
|
56
|
+
| Root files | `<filename>` | `AGENTS.md` |
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
#### Values (Installed Paths)
|
|
61
|
+
|
|
62
|
+
Values are **relative to the workspace root (`cwd`)** and represent **paths that actually exist**:
|
|
63
|
+
|
|
64
|
+
| Content Type | Value Format | Example |
|
|
65
|
+
|--------------|--------------|---------|
|
|
66
|
+
| Universal content | Platform-specific paths | `.cursor/commands/test.md`, `.opencode/commands/test.md` |
|
|
67
|
+
| Root-level content | Same as key | `ai/helper.md` |
|
|
68
|
+
|
|
69
|
+
> **Important**: The index only records paths where files **actually exist**. If a file is only installed to one platform (e.g., `.cursor/`), only that path appears in the index—not hypothetical paths for other platforms.
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
#### Index Update Behavior
|
|
74
|
+
|
|
75
|
+
The index is updated differently depending on the operation:
|
|
76
|
+
|
|
77
|
+
| Operation | Behavior |
|
|
78
|
+
|-----------|----------|
|
|
79
|
+
| **Add** | Records only the source path that was used to add the file. If you add `.cursor/commands/test.md`, only that path is recorded. |
|
|
80
|
+
| **Save/Sync** | Expands the index to include all platform paths where files were actually created during sync. |
|
|
81
|
+
| **Install** | Populates the index with all platform paths where files were installed. |
|
|
82
|
+
|
|
83
|
+
This ensures the index reflects the **current state** of the workspace, not hypothetical future states.
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
#### Root Package Skip Logic
|
|
88
|
+
|
|
89
|
+
For **root packages only**, when a registry key maps to the exact same value, the mapping is **skipped** because:
|
|
90
|
+
- The file is already at the correct location
|
|
91
|
+
- No installation/syncing needed
|
|
92
|
+
- Avoids redundant mappings
|
|
93
|
+
|
|
94
|
+
**Example**: For a root package, `<dir>/helper.md` → `<dir>/helper.md` is skipped.
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
#### Nested Package Full Mapping
|
|
99
|
+
|
|
100
|
+
For **nested packages**, all mappings are included because:
|
|
101
|
+
- Files live inside the nested package directory
|
|
102
|
+
- Need to be mapped OUT to workspace root during install
|
|
103
|
+
|
|
104
|
+
**Example**: For nested package `foo`:
|
|
105
|
+
- File at `.openpackage/packages/foo/<dir>/helper.md`
|
|
106
|
+
- Key: `<dir>/helper.md`
|
|
107
|
+
- Value: `<dir>/helper.md` (installed at workspace root)
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
#### Complete Examples
|
|
112
|
+
|
|
113
|
+
**After `opkg add .cursor/commands/test.md`** (only source path recorded):
|
|
114
|
+
|
|
115
|
+
```yaml
|
|
116
|
+
workspace:
|
|
117
|
+
hash: abc123
|
|
118
|
+
version: 1.0.0-abc123.xyz
|
|
119
|
+
files:
|
|
120
|
+
.openpackage/commands/test.md:
|
|
121
|
+
- .cursor/commands/test.md # Only the source path that exists
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
**After `opkg save`** (all synced paths recorded):
|
|
125
|
+
|
|
126
|
+
```yaml
|
|
127
|
+
workspace:
|
|
128
|
+
hash: abc123
|
|
129
|
+
version: 1.0.0-abc123.xyz
|
|
130
|
+
files:
|
|
131
|
+
.openpackage/commands/test.md:
|
|
132
|
+
- .cursor/commands/test.md # Original source
|
|
133
|
+
- .opencode/command/test.md # Synced by save
|
|
134
|
+
.openpackage/rules/auth.md:
|
|
135
|
+
- .cursor/rules/auth.mdc
|
|
136
|
+
# Note: package.yml is NOT included (it's the manifest, not synced content)
|
|
137
|
+
# Note: <dir>/helper.md is SKIPPED for root packages (maps to itself)
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
**Nested package** (`cwd/.openpackage/packages/foo/.openpackage/package.index.yml`):
|
|
141
|
+
|
|
142
|
+
```yaml
|
|
143
|
+
workspace:
|
|
144
|
+
hash: abc123
|
|
145
|
+
version: 1.0.0
|
|
146
|
+
files:
|
|
147
|
+
.openpackage/commands/test.md:
|
|
148
|
+
- .cursor/commands/test.md
|
|
149
|
+
- .opencode/command/test.md
|
|
150
|
+
<dir>/helper.md:
|
|
151
|
+
- <dir>/helper.md
|
|
152
|
+
AGENTS.md:
|
|
153
|
+
- AGENTS.md
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
#### Add Command Examples
|
|
159
|
+
|
|
160
|
+
When adding files, the index only records the **source path that exists**:
|
|
161
|
+
|
|
162
|
+
| Command | Package | Stored At | Registry Key | Values (in index) |
|
|
163
|
+
|---------|---------|-----------|--------------|-------------------|
|
|
164
|
+
| `opkg add foo <dir>/foo.md` | Nested `foo` | `.openpackage/packages/foo/<dir>/foo.md` | `<dir>/foo.md` | `<dir>/foo.md` |
|
|
165
|
+
| `opkg add foo .cursor/test/foo.md` | Nested `foo` | `.openpackage/packages/foo/.openpackage/test/foo.md` | `.openpackage/test/foo.md` | `.cursor/test/foo.md` (only source) |
|
|
166
|
+
| `opkg add <dir>/foo.md` | Root | `.openpackage/<dir>/foo.md` | `<dir>/foo.md` | SKIPPED |
|
|
167
|
+
| `opkg add .cursor/test/foo.md` | Root | `.openpackage/test/foo.md` | `.openpackage/test/foo.md` | `.cursor/test/foo.md` (only source) |
|
|
168
|
+
|
|
169
|
+
> **Note**: After `opkg save`, the index will expand to include other platform paths (e.g., `.opencode/test/foo.md`) once those files are actually synced.
|
|
170
|
+
|
|
171
|
+
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
### Package Root Layout
|
|
2
|
+
|
|
3
|
+
Every package root directory (workspace root, nested, or registry) uses this structure:
|
|
4
|
+
|
|
5
|
+
```text
|
|
6
|
+
<package-root>/
|
|
7
|
+
.openpackage/ # REQUIRED – package content directory
|
|
8
|
+
package.yml # REQUIRED – package manifest (marks this as a package)
|
|
9
|
+
package.index.yml # OPTIONAL – install/index metadata (never in registry payload)
|
|
10
|
+
agents/ # universal content subdirs
|
|
11
|
+
rules/
|
|
12
|
+
commands/
|
|
13
|
+
skills/
|
|
14
|
+
<custom-subdirs>/ # any additional universal content
|
|
15
|
+
<root-dirs>/ # OPTIONAL – root-level content (outside .openpackage/)
|
|
16
|
+
AGENTS.md # OPTIONAL – universal root file
|
|
17
|
+
<other-root-files> # OPTIONAL – platform-specific root files (e.g. CLAUDE.md)
|
|
18
|
+
README.md # OPTIONAL – documentation
|
|
19
|
+
packages/ # OPTIONAL – nested packages (workspace root only)
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
#### Two Types of Package Content
|
|
25
|
+
|
|
26
|
+
1. **Root-level content** (outside `.openpackage/`):
|
|
27
|
+
- Any files/directories at the package root (e.g., `<dir>/foo.md`, `AGENTS.md`, `CLAUDE.md`)
|
|
28
|
+
- Live directly at the package root level, outside `.openpackage/`
|
|
29
|
+
- Stored and mapped without transformation
|
|
30
|
+
|
|
31
|
+
2. **Universal content** (inside `.openpackage/`):
|
|
32
|
+
- Platform-normalized files stored under `.openpackage/<subdir>/`
|
|
33
|
+
- Source files like `.cursor/commands/test.md` are normalized to `.openpackage/commands/test.md`
|
|
34
|
+
- Mapped to platform-specific locations during install (e.g., `.cursor/commands/`, `.opencode/commands/`)
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
#### Key Invariants
|
|
39
|
+
|
|
40
|
+
- **`.openpackage/package.yml`** marks a directory as a package root.
|
|
41
|
+
- **Universal content** (rules, agents, commands, skills, custom subdirs) lives **under `.openpackage/`**.
|
|
42
|
+
- **Root-level content** (any directories/files outside `.openpackage/`) lives **at the package root** (sibling of `.openpackage/`).
|
|
43
|
+
- **Nested packages** live under `packages/` and are treated as **independent packages**.
|
|
44
|
+
- The **same structure** applies to workspace root packages, nested packages, and registry copies.
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
#### Concrete Examples
|
|
49
|
+
|
|
50
|
+
**Workspace root package** (package root = `cwd/`):
|
|
51
|
+
|
|
52
|
+
```text
|
|
53
|
+
cwd/
|
|
54
|
+
.openpackage/
|
|
55
|
+
package.yml
|
|
56
|
+
package.index.yml
|
|
57
|
+
commands/
|
|
58
|
+
test.md
|
|
59
|
+
rules/
|
|
60
|
+
auth.md
|
|
61
|
+
<root-dir>/ # any root-level directory
|
|
62
|
+
helper.md
|
|
63
|
+
AGENTS.md
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
**Nested package** (package root = `cwd/.openpackage/packages/foo/`):
|
|
67
|
+
|
|
68
|
+
```text
|
|
69
|
+
cwd/.openpackage/packages/foo/
|
|
70
|
+
.openpackage/
|
|
71
|
+
package.yml
|
|
72
|
+
package.index.yml
|
|
73
|
+
commands/
|
|
74
|
+
test.md
|
|
75
|
+
<root-dir>/ # any root-level directory
|
|
76
|
+
helper.md
|
|
77
|
+
```
|
|
78
|
+
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
### Registry Payload and 1:1 Copy
|
|
2
|
+
|
|
3
|
+
The **registry payload** for a given version is defined by two layers of rules.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
#### 1. Static Rules
|
|
8
|
+
|
|
9
|
+
**Always exclude:**
|
|
10
|
+
- `package.index.yml` (workspace-local metadata)
|
|
11
|
+
- Anything under `packages/` (nested packages are separate units)
|
|
12
|
+
|
|
13
|
+
**Always include (cannot be excluded):**
|
|
14
|
+
- `.openpackage/package.yml` (package manifest)
|
|
15
|
+
|
|
16
|
+
**Included by default (removable via manifest `exclude`):**
|
|
17
|
+
- Every platform root file declared in `platforms.jsonc` (e.g., `CLAUDE.md`, `WARP.md`, `AGENTS.md`) when it exists
|
|
18
|
+
- Any `.openpackage/<universal-subdir>/…` directory (agents, rules, commands, skills, etc.)
|
|
19
|
+
- Any root-level content (directories/files at package root, outside `.openpackage/`)
|
|
20
|
+
|
|
21
|
+
**Everything else starts excluded by default.**
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
#### 2. Manifest Filters
|
|
26
|
+
|
|
27
|
+
In `package.yml`:
|
|
28
|
+
|
|
29
|
+
- **`include`** (array): Expands the payload by listing additional glob-like patterns relative to the package root
|
|
30
|
+
- **`exclude`** (array): Removes matches after include rules are applied (but never overrides hard includes/excludes)
|
|
31
|
+
|
|
32
|
+
> **Note**: Newly created nested packages default their `package.yml` to `include: ["**"]`, so they start including all files until the author narrows the list.
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
#### Save and Install Operations
|
|
37
|
+
|
|
38
|
+
**When saving:**
|
|
39
|
+
|
|
40
|
+
1. The save pipeline reads files from the package root using the rules above
|
|
41
|
+
2. Files are written **unchanged** to: `~/.openpackage/registry/<name>/<version>/...`
|
|
42
|
+
|
|
43
|
+
**When installing:**
|
|
44
|
+
|
|
45
|
+
1. The install pipeline loads `pkg.files` from the registry
|
|
46
|
+
2. Files are written 1:1 to: `cwd/.openpackage/packages/<name>/...` for local cache
|
|
47
|
+
3. Universal content is mapped to platform-specific locations in the workspace
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
#### Package Structure in Registry
|
|
52
|
+
|
|
53
|
+
Registry copies maintain the same structure as workspace packages:
|
|
54
|
+
|
|
55
|
+
```text
|
|
56
|
+
~/.openpackage/registry/<name>/<version>/
|
|
57
|
+
.openpackage/
|
|
58
|
+
package.yml # package manifest
|
|
59
|
+
commands/ # universal content
|
|
60
|
+
test.md
|
|
61
|
+
rules/
|
|
62
|
+
auth.md
|
|
63
|
+
<root-dir>/ # root-level content (any directory)
|
|
64
|
+
helper.md
|
|
65
|
+
AGENTS.md # root files
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
#### Guarantees
|
|
71
|
+
|
|
72
|
+
This system guarantees that:
|
|
73
|
+
|
|
74
|
+
- The **workspace package**, **local cache**, and **registry version directory** all share the **same tree shape**
|
|
75
|
+
- Save and install operations are **pure copies** at the package boundary, without structural rewrites
|
|
76
|
+
- Packages can be moved between locations (workspace root ↔ nested ↔ registry) without modification
|
|
77
|
+
|